TBSCertListpublic class TBSCertList extends Object The class encapsulates the ASN.1 DER encoding/decoding work
with TBSCertList structure which is the part of X.509 CRL
(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):
TBSCertList ::= SEQUENCE {
version Version OPTIONAL,
-- if present, MUST be v2
signature AlgorithmIdentifier,
issuer Name,
thisUpdate Time,
nextUpdate Time OPTIONAL,
revokedCertificates SEQUENCE OF SEQUENCE {
userCertificate CertificateSerialNumber,
revocationDate Time,
crlEntryExtensions Extensions OPTIONAL
-- if present, MUST be v2
} OPTIONAL,
crlExtensions [0] EXPLICIT Extensions OPTIONAL
-- if present, MUST be v2
}
|
Fields Summary |
---|
private final int | version | private final AlgorithmIdentifier | signature | private final org.apache.harmony.security.x501.Name | issuer | private final Date | thisUpdate | private final Date | nextUpdate | private final List | revokedCertificates | private final Extensions | crlExtensions | private byte[] | encoding | public static final org.apache.harmony.security.asn1.ASN1Sequence | ASN1X.509 TBSCertList encoder/decoder. |
Constructors Summary |
---|
public TBSCertList(AlgorithmIdentifier signature, org.apache.harmony.security.x501.Name issuer, Date thisUpdate)Constructs the instance of TBSCertList without optional fields.
Take a note, that regarding to the rfc 3280 (p. 49):
"When CRLs are issued, the CRLs MUST be version 2 CRLs, include the date
by which the next CRL will be issued in the nextUpdate field (section
5.1.2.5), include the CRL number extension (section 5.2.3), and include
the authority key identifier extension (section 5.2.1). Conforming
applications that support CRLs are REQUIRED to process both version 1 and
version 2 complete CRLs that provide revocation information for all
certificates issued by one CA. Conforming applications are NOT REQUIRED
to support processing of delta CRLs, indirect CRLs, or CRLs with a scope
other than all certificates issued by one CA."
this.version = 1;
this.signature = signature;
this.issuer = issuer;
this.thisUpdate = thisUpdate;
this.nextUpdate = null;
this.revokedCertificates = null;
this.crlExtensions = null;
| public TBSCertList(int version, AlgorithmIdentifier signature, org.apache.harmony.security.x501.Name issuer, Date thisUpdate, Date nextUpdate, List revokedCertificates, Extensions crlExtensions)Constructs the instance of TBSCertList with all optional fields
this.version = version;
this.signature = signature;
this.issuer = issuer;
this.thisUpdate = thisUpdate;
this.nextUpdate = nextUpdate;
this.revokedCertificates = revokedCertificates;
this.crlExtensions = crlExtensions;
| private TBSCertList(int version, AlgorithmIdentifier signature, org.apache.harmony.security.x501.Name issuer, Date thisUpdate, Date nextUpdate, List revokedCertificates, Extensions crlExtensions, byte[] encoding)
this.version = version;
this.signature = signature;
this.issuer = issuer;
this.thisUpdate = thisUpdate;
this.nextUpdate = nextUpdate;
this.revokedCertificates = revokedCertificates;
this.crlExtensions = crlExtensions;
this.encoding = encoding;
|
Methods Summary |
---|
public void | dumpValue(java.lang.StringBuffer buffer)Places the string representation of extension value
into the StringBuffer object.
buffer.append("X.509 CRL v").append(version); //$NON-NLS-1$
buffer.append("\nSignature Algorithm: ["); //$NON-NLS-1$
signature.dumpValue(buffer);
buffer.append(']");
buffer.append("\nIssuer: ").append(issuer.getName(X500Principal.RFC2253)); //$NON-NLS-1$
buffer.append("\n\nThis Update: ").append(thisUpdate); //$NON-NLS-1$
buffer.append("\nNext Update: ").append(nextUpdate).append('\n"); //$NON-NLS-1$
if (revokedCertificates != null) {
buffer.append("\nRevoked Certificates: ") //$NON-NLS-1$
.append(revokedCertificates.size()).append(" ["); //$NON-NLS-1$
int number = 1;
for (Iterator it = revokedCertificates.iterator();it.hasNext();) {
buffer.append("\n [").append(number++).append(']"); //$NON-NLS-1$
((RevokedCertificate) it.next()).dumpValue(buffer, " "); //$NON-NLS-1$
buffer.append('\n");
}
buffer.append("]\n"); //$NON-NLS-1$
}
if (crlExtensions != null) {
buffer.append("\nCRL Extensions: ") //$NON-NLS-1$
.append(crlExtensions.size()).append(" ["); //$NON-NLS-1$
crlExtensions.dumpValue(buffer, " "); //$NON-NLS-1$
buffer.append("]\n"); //$NON-NLS-1$
}
| public boolean | equals(java.lang.Object tbs)
if (!(tbs instanceof TBSCertList)) {
return false;
}
TBSCertList tbscert = (TBSCertList) tbs;
return (version == tbscert.version)
&& (signature.equals(tbscert.signature))
// FIXME use Name.equals when it will be implemented
&& (Arrays.equals(issuer.getEncoded(), tbscert.issuer.getEncoded()))
&& ((thisUpdate.getTime() / 1000)
== (tbscert.thisUpdate.getTime() / 1000))
&& ((nextUpdate == null)
? tbscert.nextUpdate == null
: ((nextUpdate.getTime() / 1000)
== (tbscert.nextUpdate.getTime() / 1000)))
&& ((((revokedCertificates == null)
|| (tbscert.revokedCertificates == null))
&& (revokedCertificates == tbscert.revokedCertificates))
|| (revokedCertificates.containsAll(tbscert.revokedCertificates)
&& (revokedCertificates.size()
== tbscert.revokedCertificates.size())))
&& ((crlExtensions == null)
? tbscert.crlExtensions == null
: crlExtensions.equals(tbscert.crlExtensions));
| public Extensions | getCrlExtensions()Returns the value of crlExtensions field of the structure.
return crlExtensions;
| public byte[] | getEncoded()Returns ASN.1 encoded form of this X.509 TBSCertList value.
if (encoding == null) {
encoding = ASN1.encode(this);
}
return encoding;
| public org.apache.harmony.security.x501.Name | getIssuer()Returns the value of issuer field of the structure.
return issuer;
| public java.util.Date | getNextUpdate()Returns the value of nextUpdate field of the structure.
return nextUpdate;
| public java.util.List | getRevokedCertificates()Returns the value of revokedCertificates field of the structure.
return revokedCertificates;
| public AlgorithmIdentifier | getSignature()Returns the value of signature field of the structure.
return signature;
| public java.util.Date | getThisUpdate()Returns the value of thisUpdate field of the structure.
return thisUpdate;
| public int | getVersion()Returns the value of version field of the structure.
return version;
|
|