All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class w3c.www.dsig.SigCert

java.lang.Object
   |
   +----w3c.www.dsig.SigCert

public class SigCert
extends Object
DSig SigBlock's Certificate class. This class implements certificates for inclusion in the AttribInfo section of a DSig SigBlock. Instances of this class cannot be modified once they have been created.

As defined in the SigBlock specification, the SigBlock supports arbitrary certificates types, where the type is indicated by a URL. The certicate itself can either be included as a BASE64 encoded string or referenced by a URL. When creating an object, BASE64 encoded certificates are automatically decoded and certificates referenced via a URL are automatically fetched.

If the certificate could be decoded successfully the CertFormatRegistry is automatically queried for the appropriate certificate handling class. If it is present, certificate is created (implements java.security.Certificate) and added to the CertDatabase.


Variable Index

 o CERT_BASE64
Tag for certificates present as base64 encoded data.
 o CERT_UNDEF
Tag for certificates of undefined/ empty type.
 o CERT_URLREF
Tag for certificates referenced via a URL.

Constructor Index

 o SigCert(Certificate)
Create a SigCert from the given Certificate.
 o SigCert(String, InputStream)
Create a new certificate of type certType, the certificate is read from the InputStream ins and will be stored in BASE64 format.
 o SigCert(String, String)
Create a certificate with the format and value.

Method Index

 o getCertObj()
Return a Certificate object conforming to the java.security API for this object.
 o getData()
Return the encoded data of this certificate (BASE64 or URL).
 o getFormat()
Return the format URL.
 o getRawCert()
Return the raw certificate data.
 o isBase64Cert()
Return true if the certificate is Base64 encoded.
 o isUrlCert()
Return true if the certificate is referenced via a URL.
 o isValid()
Return true if this certificate is valid, that means not corrupted.
 o toString()
Return the SigCert as a String

Variables

 o CERT_UNDEF
 protected static final int CERT_UNDEF
Tag for certificates of undefined/ empty type.

 o CERT_BASE64
 protected static final int CERT_BASE64
Tag for certificates present as base64 encoded data.

 o CERT_URLREF
 protected static final int CERT_URLREF
Tag for certificates referenced via a URL.

Constructors

 o SigCert
 public SigCert(String certType,
                String certData) throws DSigException
Create a certificate with the format and value.

Throws: DSigException
if the certData cannot be parsed correctly.
 o SigCert
 public SigCert(String certType,
                InputStream ins) throws DSigException
Create a new certificate of type certType, the certificate is read from the InputStream ins and will be stored in BASE64 format.

Throws: DSigException
if the input cert cannot be parsed correctly.
 o SigCert
 public SigCert(Certificate cert) throws DSigException
Create a SigCert from the given Certificate. Requires that an appropriate certificate format is installed in the CertFormatRegistry. In case of an error, a DSigException is thrown.

Throws: DSigException
if the cert cannot be parsed correctly.

Methods

 o getFormat
 public String getFormat()
Return the format URL.

 o getData
 public String getData()
Return the encoded data of this certificate (BASE64 or URL). Application programmers will generally not need this method.

 o getRawCert
 public byte[] getRawCert()
Return the raw certificate data. This is the actual certificate data, BASE64 decoded or fetched from the given URL. Application programmers will generally not need this method.

 o getCertObj
 public Certificate getCertObj()
Return a Certificate object conforming to the java.security API for this object. Returns null if none is available (certicate format not installed in the registry, certificate invalid).

 o isBase64Cert
 public boolean isBase64Cert()
Return true if the certificate is Base64 encoded.

 o isUrlCert
 public boolean isUrlCert()
Return true if the certificate is referenced via a URL.

 o isValid
 public boolean isValid()
Return true if this certificate is valid, that means not corrupted. For base64 encoded certificates, that means they could not be decoded, for URL references, that the object could not be retrieved.

 o toString
 public String toString()
Return the SigCert as a String

Overrides:
toString in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index