FileDocCategorySizeDatePackage
Certificate.javaAPI DocAndroid 1.5 API5857Wed May 06 22:41:06 BST 2009org.apache.harmony.security.x509

Certificate

public class Certificate extends Object
The class encapsulates the ASN.1 DER encoding/decoding work with the X.509 certificate. Its ASN notation is as follows (as specified in RFC 3280 - Internet X.509 Public Key Infrastructure. Certificate and Certificate Revocation List (CRL) Profile. http://www.ietf.org/rfc/rfc3280.txt):
Certificate ::= SEQUENCE {
tbsCertificate TBSCertificate,
signatureAlgorithm AlgorithmIdentifier,
signatureValue BIT STRING
}

Fields Summary
private final TBSCertificate
tbsCertificate
private final AlgorithmIdentifier
signatureAlgorithm
private final byte[]
signatureValue
private byte[]
encoding
public static final org.apache.harmony.security.asn1.ASN1Sequence
ASN1
X.509 Certificate encoder/decoder.
Constructors Summary
public Certificate(TBSCertificate tbsCertificate, AlgorithmIdentifier signatureAlgorithm, byte[] signatureValue)
TODO

param
tbsCertificate: TBSCertificate
param
signatureAlgorithm: AlgorithmIdentifier
param
signatureValue: byte[]

        this.tbsCertificate = tbsCertificate;
        this.signatureAlgorithm = signatureAlgorithm;
        this.signatureValue = new byte[signatureValue.length];
        System.arraycopy(signatureValue, 0, this.signatureValue, 0, 
                                                    signatureValue.length);
    
private Certificate(TBSCertificate tbsCertificate, AlgorithmIdentifier signatureAlgorithm, byte[] signatureValue, byte[] encoding)

        this(tbsCertificate, signatureAlgorithm, signatureValue);
        this.encoding = encoding;
    
Methods Summary
public byte[]getEncoded()
Returns ASN.1 encoded form of this X.509 TBSCertificate value.

return
a byte array containing ASN.1 encode form.

        if (encoding == null) {
            encoding = Certificate.ASN1.encode(this);
        }
        return encoding;
    
public AlgorithmIdentifiergetSignatureAlgorithm()
Returns the value of signatureAlgorithm field of the structure.

return
signatureAlgorithm

        return signatureAlgorithm;
    
public byte[]getSignatureValue()
Returns the value of signatureValue field of the structure.

return
signatureValue

        byte[] result = new byte[signatureValue.length];
        System.arraycopy(signatureValue, 0, result, 0, signatureValue.length);
        return result;
    
public TBSCertificategetTbsCertificate()
Returns the value of tbsCertificate field of the structure.

return
tbsCertificate

        return tbsCertificate;
    
public java.lang.StringtoString()

        StringBuffer buffer = new StringBuffer();
        buffer.append("X.509 Certificate:\n[\n"); //$NON-NLS-1$
        tbsCertificate.dumpValue(buffer);
        buffer.append("\n  Algorithm: ["); //$NON-NLS-1$
        signatureAlgorithm.dumpValue(buffer);
        buffer.append(']");
        buffer.append("\n  Signature Value:\n"); //$NON-NLS-1$
        buffer.append(Array.toString(signatureValue, "")); //$NON-NLS-1$
        buffer.append(']");
        return buffer.toString();