Certificatepublic 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 | ASN1X.509 Certificate encoder/decoder. |
Constructors Summary |
---|
public Certificate(TBSCertificate tbsCertificate, AlgorithmIdentifier signatureAlgorithm, byte[] signatureValue)TODO
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.
if (encoding == null) {
encoding = Certificate.ASN1.encode(this);
}
return encoding;
| public AlgorithmIdentifier | getSignatureAlgorithm()Returns the value of signatureAlgorithm field of the structure.
return signatureAlgorithm;
| public byte[] | getSignatureValue()Returns the value of signatureValue field of the structure.
byte[] result = new byte[signatureValue.length];
System.arraycopy(signatureValue, 0, result, 0, signatureValue.length);
return result;
| public TBSCertificate | getTbsCertificate()Returns the value of tbsCertificate field of the structure.
return tbsCertificate;
| public java.lang.String | toString()
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();
|
|