jsdsi
Class Certificate

java.lang.Object
  extended byjava.security.cert.Certificate
      extended byjsdsi.Certificate
All Implemented Interfaces:
java.io.Serializable

public class Certificate
extends java.security.cert.Certificate

A Cert along with its validators (verification path, signature, and online test results). Whereas a Cert is simply an unauthenticated statement, a Certificate is self-validating and thus can be considered authentic if verify() succeeds. A Certificate is serialized as a SPKI/SDSI Sequence.

Version:
$Revision: 1.3.2.1 $ $Date: 2005/11/08 03:12:52 $
Author:
Sameer Ajmani, Sean Radford
See Also:
Cert, Signature, Sequence, Serialized Form

Nested Class Summary
 
Nested classes inherited from class java.security.cert.Certificate
java.security.cert.Certificate.CertificateRep
 
Constructor Summary
Certificate(Cert c, Signature s)
          Creates a new Certificate from a given Cert and Signature.
Certificate(java.security.PublicKey k, Cert c, Signature s)
          Creates a new Certificate from a given public key, Cert, and signature.
 
Method Summary
static Certificate fromElements(java.util.Iterator elems)
          Factory method for creating a new Certificate from an iterator that holds a Cert and a Signature.
static Certificate fromSequence(Sequence seq)
          Factory method that creates a new Certificate from a given Sequence that contains a Cert and a Signature (in this order).
 Cert getCert()
           
 byte[] getEncoded()
           
 java.lang.String getFormat()
          Returns the format of this Certificate, namely "SEXP".
 java.security.PublicKey getPublicKey()
           
 void toElements(java.util.List elems)
          Adds the issuer (if not null), the Cert, and the Signture of this Certificate to the given List.
 Sequence toSequence()
          Returns a Sequence containing the issuer (if not null), the Cert, and the Signature of this Certificate.
 java.lang.String toString()
           
 void verify(java.security.PublicKey key)
           
 void verify(java.security.PublicKey key, java.lang.String sigProvider)
           
 
Methods inherited from class java.security.cert.Certificate
equals, getType, hashCode, writeReplace
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Certificate

public Certificate(java.security.PublicKey k,
                   Cert c,
                   Signature s)
            throws java.security.cert.CertificateException
Creates a new Certificate from a given public key, Cert, and signature.

Parameters:
k - public key of the issuer (principal).
c - Cert of this Certificate.
s - Signature of this Certificate.
Throws:
java.security.cert.CertificateException - if k is null or not a PublicKey.

Certificate

public Certificate(Cert c,
                   Signature s)
            throws java.security.cert.CertificateException
Creates a new Certificate from a given Cert and Signature.

Parameters:
c - Cert to create a new Certificate from.
s - Signature to create a new Certificate from.
Throws:
java.security.cert.CertificateException
Method Detail

getPublicKey

public java.security.PublicKey getPublicKey()
See Also:
Certificate.getPublicKey()

verify

public void verify(java.security.PublicKey key)
            throws java.security.cert.CertificateException,
                   java.security.NoSuchAlgorithmException,
                   java.security.InvalidKeyException,
                   java.security.NoSuchProviderException,
                   java.security.SignatureException
Throws:
java.security.cert.CertificateException
java.security.NoSuchAlgorithmException
java.security.InvalidKeyException
java.security.NoSuchProviderException
java.security.SignatureException
See Also:
Certificate.verify(PublicKey)

verify

public void verify(java.security.PublicKey key,
                   java.lang.String sigProvider)
            throws java.security.cert.CertificateException,
                   java.security.NoSuchAlgorithmException,
                   java.security.InvalidKeyException,
                   java.security.NoSuchProviderException,
                   java.security.SignatureException
Throws:
java.security.cert.CertificateException
java.security.NoSuchAlgorithmException
java.security.InvalidKeyException
java.security.NoSuchProviderException
java.security.SignatureException
See Also:
Certificate.verify(PublicKey, String)

getCert

public Cert getCert()
Returns:
the Cert of this Certificate.

fromElements

public static Certificate fromElements(java.util.Iterator elems)
                                throws java.security.cert.CertificateException
Factory method for creating a new Certificate from an iterator that holds a Cert and a Signature.

Parameters:
elems - Iterator holding a Cert and a Signature (in this order).
Returns:
the certificate created from the Cert and the Signature in elems.
Throws:
java.security.cert.CertificateException - if elems does not contain the expected values.

toElements

public void toElements(java.util.List elems)
Adds the issuer (if not null), the Cert, and the Signture of this Certificate to the given List.

Parameters:
elems - List to add the issuer (if not null), the Cert, and the Signture of this Certificate to.

fromSequence

public static Certificate fromSequence(Sequence seq)
                                throws java.security.cert.CertificateException
Factory method that creates a new Certificate from a given Sequence that contains a Cert and a Signature (in this order).

Parameters:
seq - Sequence holding the Cert and the Signature to create the Certificate from.
Returns:
the new Certificate.
Throws:
java.security.cert.CertificateException - if the creation of the Certificate failed.

toSequence

public Sequence toSequence()
Returns a Sequence containing the issuer (if not null), the Cert, and the Signature of this Certificate.

Returns:
Sequence

toString

public java.lang.String toString()
See Also:
Object.toString()

getEncoded

public byte[] getEncoded()
See Also:
Certificate.getEncoded()

getFormat

public java.lang.String getFormat()
Returns the format of this Certificate, namely "SEXP".

Returns:
the format of this Certificate ("SEXP").


Copyright © 2002-2006 JSDSI. All Rights Reserved.