Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

jsdsi
Class Certificate  view Certificate download Certificate.java

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.2 $ $Date: 2003/04/22 21:37:44 $

Nested Class Summary
 
Nested classes inherited from class java.security.cert.Certificate
java.security.cert.Certificate.CertificateRep
 
Field Summary
private  Cert cert
          Cert of this certificate.
private  java.security.PublicKey issuer
          Issuer of this Certificate.
private  Signature sig
          Signature of this Certificate.
 
Fields inherited from class java.security.cert.Certificate
 
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
private static void check(java.util.Iterator elems)
          Checks if a given Iterator has more elements.
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()
          Returns the Cert of this Certificate.
 byte[] getEncoded()
          Gets the DER ASN.1 encoded format for this Certificate.
 java.lang.String getFormat()
          Returns the format of this Certificate, namely "SEXP".
 java.security.PublicKey getPublicKey()
          Returns the public key stored in the Certificate.
 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()
          Returns a string representing the Certificate.
 void verify(java.security.PublicKey key)
          Verifies that this Certificate was properly signed with the PublicKey that corresponds to its private key.
 void verify(java.security.PublicKey key, java.lang.String sigProvider)
          Verifies that this Certificate was properly signed with the PublicKey that corresponds to its private key and uses the signature engine provided by the provider.
 
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
 

Field Detail

issuer

private java.security.PublicKey issuer
Issuer of this Certificate.


cert

private Cert cert
Cert of this certificate.


sig

private Signature sig
Signature of this Certificate.

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.


Certificate

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

Method Detail

getPublicKey

public java.security.PublicKey getPublicKey()
Description copied from class: java.security.cert.Certificate
Returns the public key stored in the Certificate.


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
Description copied from class: java.security.cert.Certificate
Verifies that this Certificate was properly signed with the PublicKey that corresponds to its private key.


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
Description copied from class: java.security.cert.Certificate
Verifies that this Certificate was properly signed with the PublicKey that corresponds to its private key and uses the signature engine provided by the provider.


getCert

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


check

private static void check(java.util.Iterator elems)
                   throws java.security.cert.CertificateException
Checks if a given Iterator has more elements.


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.


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.


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).


toSequence

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


toString

public java.lang.String toString()
Description copied from class: java.security.cert.Certificate
Returns a string representing the Certificate.


getEncoded

public byte[] getEncoded()
Description copied from class: java.security.cert.Certificate
Gets the DER ASN.1 encoded format for this Certificate. It assumes each certificate has only one encoding format. Ex: X.509 is encoded as ASN.1 DER


getFormat

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