java.security.cert
Class Certificate.CertificateRep

java.lang.Object
  extended by java.security.cert.Certificate.CertificateRep
All Implemented Interfaces:
Serializable
Enclosing class:
Certificate

protected static class Certificate.CertificateRep
extends Object
implements Serializable

Certificate.CertificateRep is an inner class used to provide an alternate storage mechanism for serialized Certificates.

See Also:
Serialized Form

Constructor Summary
protected Certificate.CertificateRep(String type, byte[] data)
          Create an alternative representation of this certificate.
 
Method Summary
protected  Object readResolve()
          Deserialize this certificate replacement into the appropriate certificate object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Certificate.CertificateRep

protected Certificate.CertificateRep(String type,
                                     byte[] data)
Create an alternative representation of this certificate. The (type, data) pair is typically the certificate's type as returned by Certificate.getType() (i.e. the canonical name of the certificate type) and the encoded form as returned by Certificate.getEncoded().

For example, X.509 certificates would create an instance of this class with the parameters "X.509" and the ASN.1 representation of the certificate, encoded as DER bytes.

Parameters:
type - The certificate type.
data - The encoded certificate data.
Method Detail

readResolve

protected Object readResolve()
                      throws ObjectStreamException
Deserialize this certificate replacement into the appropriate certificate object. That is, this method attempts to create a CertificateFactory for this certificate's type, then attempts to parse the encoded data with that factory, returning the resulting certificate.

Returns:
The deserialized certificate.
Throws:
ObjectStreamException - If there is no appropriate certificate factory for the given type, or if the encoded form cannot be parsed.