    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.

##

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

##

SigCert(Certificate)
  Create a SigCert from the given Certificate.
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.
SigCert(String, String)
  Create a certificate with the format and value.

##

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

##

CERT_UNDEF

     protected static final int CERT_UNDEF

  Tag for certificates of undefined/ empty type.

CERT_BASE64

     protected static final int CERT_BASE64

  Tag for certificates present as base64 encoded data.

CERT_URLREF

     protected static final int CERT_URLREF

  Tag for certificates referenced via a URL.

##

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.

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.

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.

##

getFormat

     public String getFormat()

  Return the format URL.

getData

     public String getData()

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

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.

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

isBase64Cert

     public boolean isBase64Cert()

  Return true if the certificate is Base64 encoded.

isUrlCert

     public boolean isUrlCert()

  Return true if the certificate is referenced via a URL.

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.

toString

     public String toString()

  Return the SigCert as a String

  Overrides:
    toString in class Object

    All Packages  Class Hierarchy  This Package  Previous  Next  Index