Top Description Fields Constructors Methods
org.conscrypt

pack-priv final Class OpenSSLX509CRLEntry

extends X509CRLEntry
Class Inheritance
Imports
java.io.ByteArrayOutputStream, java.math.BigInteger, java.security.cert.CRLException, .X509CRLEntry, java.util.Arrays, .Date, .HashSet, .Set, org.conscrypt.OpenSSLX509CertificateFactory.ParsingException

An implementation of X509CRLEntry based on BoringSSL.

Field Summary

Modifier and TypeField and Description
private final long
private final Date

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public Set<String>
getCriticalExtensionOIDs()

Implements java.security.cert.X509Extension.getCriticalExtensionOIDs.

Gets a Set of the OID strings for the extension(s) marked CRITICAL in the certificate/CRL managed by the object implementing this interface.
public byte[]
getEncoded()

Implements abstract java.security.cert.X509CRLEntry.getEncoded.

Returns the ASN.1 DER-encoded form of this CRL Entry, that is the inner SEQUENCE.
public byte[]
getExtensionValue(String
the Object Identifier value for the extension.
oid
)

Implements java.security.cert.X509Extension.getExtensionValue.

Gets the DER-encoded OCTET string for the extension value (extnValue) identified by the passed-in oid String.
public Set<String>
getNonCriticalExtensionOIDs()

Implements java.security.cert.X509Extension.getNonCriticalExtensionOIDs.

Gets a Set of the OID strings for the extension(s) marked NON-CRITICAL in the certificate/CRL managed by the object implementing this interface.
public Date
getRevocationDate()

Implements abstract java.security.cert.X509CRLEntry.getRevocationDate.

Gets the revocation date from this X509CRLEntry, the revocationDate.
public BigInteger
getSerialNumber()

Implements abstract java.security.cert.X509CRLEntry.getSerialNumber.

Gets the serial number from this X509CRLEntry, the userCertificate.
public boolean
hasExtensions()

Implements abstract java.security.cert.X509CRLEntry.hasExtensions.

Returns true if this CRL entry has extensions.
public boolean
hasUnsupportedCriticalExtension()

Implements java.security.cert.X509Extension.hasUnsupportedCriticalExtension.

Check if there is a critical extension that is not supported.
public String
toString()

Implements abstract java.security.cert.X509CRLEntry.toString.

Returns a string representation of this CRL entry.
Inherited from java.security.cert.X509CRLEntry:
equalsgetCertificateIssuergetRevocationReasonhashCode

Field Detail

mContextback to summary
private final long mContext
revocationDateback to summary
private final Date revocationDate

Constructor Detail

OpenSSLX509CRLEntryback to summary
pack-priv OpenSSLX509CRLEntry(long ctx) throws ParsingException

Method Detail

getCriticalExtensionOIDsback to summary
public Set<String> getCriticalExtensionOIDs()

Implements java.security.cert.X509Extension.getCriticalExtensionOIDs.

Doc from java.security.cert.X509Extension.getCriticalExtensionOIDs.

Gets a Set of the OID strings for the extension(s) marked CRITICAL in the certificate/CRL managed by the object implementing this interface. Here is sample code to get a Set of critical extensions from an X509Certificate and print the OIDs:

X509Certificate cert = null;
try (InputStream inStrm = new FileInputStream("DER-encoded-Cert")) {
    CertificateFactory cf = CertificateFactory.getInstance("X.509");
    cert = (X509Certificate)cf.generateCertificate(inStrm);
}

Set<String> critSet = cert.getCriticalExtensionOIDs();
if (critSet != null && !critSet.isEmpty()) {
    System.out.println("Set of critical extensions:");
    for (String oid : critSet) {
        System.out.println(oid);
    }
}
Returns:Set<String>

a Set (or an empty Set if none are marked critical) of the extension OID strings for extensions that are marked critical. If there are no extensions present at all, then this method returns null.

Annotations
@Override
getEncodedback to summary
public byte[] getEncoded() throws CRLException

Implements abstract java.security.cert.X509CRLEntry.getEncoded.

Doc from java.security.cert.X509CRLEntry.getEncoded.

Returns the ASN.1 DER-encoded form of this CRL Entry, that is the inner SEQUENCE.

Returns:byte[]

the encoded form of this certificate

Annotations
@Override
Exceptions
CRLException:
if an encoding error occurs.
getExtensionValueback to summary
public byte[] getExtensionValue(String oid)

Implements java.security.cert.X509Extension.getExtensionValue.

Doc from java.security.cert.X509Extension.getExtensionValue.

Gets the DER-encoded OCTET string for the extension value (extnValue) identified by the passed-in oid String. The oid string is represented by a set of nonnegative whole numbers separated by periods.

For example:

Examples of OIDs and extension names
OID (Object Identifier) Extension Name
2.5.29.14 SubjectKeyIdentifier
2.5.29.15 KeyUsage
2.5.29.16 PrivateKeyUsage
2.5.29.17 SubjectAlternativeName
2.5.29.18 IssuerAlternativeName
2.5.29.19 BasicConstraints
2.5.29.30 NameConstraints
2.5.29.33 PolicyMappings
2.5.29.35 AuthorityKeyIdentifier
2.5.29.36 PolicyConstraints
Parameters
oid:String

the Object Identifier value for the extension.

Returns:byte[]

the DER-encoded octet string of the extension value or null if it is not present.

Annotations
@Override
getNonCriticalExtensionOIDsback to summary
public Set<String> getNonCriticalExtensionOIDs()

Implements java.security.cert.X509Extension.getNonCriticalExtensionOIDs.

Doc from java.security.cert.X509Extension.getNonCriticalExtensionOIDs.

Gets a Set of the OID strings for the extension(s) marked NON-CRITICAL in the certificate/CRL managed by the object implementing this interface. Here is sample code to get a Set of non-critical extensions from an X509CRL revoked certificate entry and print the OIDs:

CertificateFactory cf = null;
X509CRL crl = null;
try (InputStream inStrm = new FileInputStream("DER-encoded-CRL")) {
    cf = CertificateFactory.getInstance("X.509");
    crl = (X509CRL)cf.generateCRL(inStrm);
}

byte[] certData = <DER-encoded certificate data>
ByteArrayInputStream bais = new ByteArrayInputStream(certData);
X509Certificate cert = (X509Certificate)cf.generateCertificate(bais);
X509CRLEntry badCert =
             crl.getRevokedCertificate(cert.getSerialNumber());

if (badCert != null) {
    Set<String> nonCritSet = badCert.getNonCriticalExtensionOIDs();
    if (nonCritSet != null)
        for (String oid : nonCritSet) {
            System.out.println(oid);
        }
}
Returns:Set<String>

a Set (or an empty Set if none are marked non-critical) of the extension OID strings for extensions that are marked non-critical. If there are no extensions present at all, then this method returns null.

Annotations
@Override
getRevocationDateback to summary
public Date getRevocationDate()

Implements abstract java.security.cert.X509CRLEntry.getRevocationDate.

Doc from java.security.cert.X509CRLEntry.getRevocationDate.

Gets the revocation date from this X509CRLEntry, the revocationDate.

Returns:Date

the revocation date.

Annotations
@Override
getSerialNumberback to summary
public BigInteger getSerialNumber()

Implements abstract java.security.cert.X509CRLEntry.getSerialNumber.

Doc from java.security.cert.X509CRLEntry.getSerialNumber.

Gets the serial number from this X509CRLEntry, the userCertificate.

Returns:BigInteger

the serial number.

Annotations
@Override
hasExtensionsback to summary
public boolean hasExtensions()

Implements abstract java.security.cert.X509CRLEntry.hasExtensions.

Doc from java.security.cert.X509CRLEntry.hasExtensions.

Returns true if this CRL entry has extensions.

Returns:boolean

true if this entry has extensions, false otherwise.

Annotations
@Override
hasUnsupportedCriticalExtensionback to summary
public boolean hasUnsupportedCriticalExtension()

Implements java.security.cert.X509Extension.hasUnsupportedCriticalExtension.

Doc from java.security.cert.X509Extension.hasUnsupportedCriticalExtension.

Check if there is a critical extension that is not supported.

Returns:boolean

true if a critical extension is found that is not supported, otherwise false.

Annotations
@Override
toStringback to summary
public String toString()

Implements abstract java.security.cert.X509CRLEntry.toString.

Doc from java.security.cert.X509CRLEntry.toString.

Returns a string representation of this CRL entry.

Returns:String

a string representation of this CRL entry.

Annotations
@Override