APIdia Launch Partner
Top Description Fields Constructors Methods
sun.security.x509

public Class X509CRLEntryImpl

extends X509CRLEntry
implements Comparable<X509CRLEntryImpl>
Class Inheritance
All Implemented Interfaces
java.lang.Comparable
Imports
java.io.IOException, java.security.cert.CRLException, .CRLReason, .X509CRLEntry, java.math.BigInteger, java.util.*, javax.security.auth.x500.X500Principal, sun.security.util.*, .HexDumpEncoder

Abstract class for a revoked certificate in a CRL. This class is for each entry in the revokedCertificates, so it deals with the inner SEQUENCE. The ASN.1 definition for this is:

revokedCertificates    SEQUENCE OF SEQUENCE  {
    userCertificate    CertificateSerialNumber,
    revocationDate     ChoiceOfTime,
    crlEntryExtensions Extensions OPTIONAL
                       -- if present, must be v2
}  OPTIONAL

CertificateSerialNumber  ::=  INTEGER

Extensions  ::=  SEQUENCE SIZE (1..MAX) OF Extension

Extension  ::=  SEQUENCE  {
    extnId        OBJECT IDENTIFIER,
    critical      BOOLEAN DEFAULT FALSE,
    extnValue     OCTET STRING
                  -- contains a DER encoding of a value
                  -- of the type registered for use with
                  -- the extnId object identifier value
}
Author
Hemma Prafullchandra

Field Summary

Modifier and TypeField and Description
private X500Principal
private CRLExtensions
private static final boolean
private Date
private byte[]
private SerialNumber

Constructor Summary

AccessConstructor and Description
public
X509CRLEntryImpl(BigInteger
the serial number of the revoked certificate.
num
,
Date
the Date on which revocation took place.
date
)

Constructs a revoked certificate entry using the given serial number and revocation date.

public
X509CRLEntryImpl(BigInteger
the serial number of the revoked certificate.
num
,
Date
the Date on which revocation took place.
date
,
CRLExtensions
the extensions for this entry.
crlEntryExts
)

Constructs a revoked certificate entry using the given serial number, revocation date and the entry extensions.

public
X509CRLEntryImpl(byte[]
the encoded bytes.
revokedCert
)

Unmarshals a revoked certificate from its encoded form.

public
X509CRLEntryImpl(DerValue
the DER value containing the revoked certificate.
derValue
)

Unmarshals a revoked certificate from its encoded form.

Method Summary

Modifier and TypeMethod and Description
public int
compareTo(X509CRLEntryImpl that)

Implements java.lang.Comparable.compareTo.

Compares this object with the specified object for order.

public void
encode(DerOutputStream
an output stream to which the encoded revoked certificate is written.
outStrm
)

Encodes the revoked certificate to an output stream.

public X500Principal
getCertificateIssuer()

Overrides java.security.cert.X509CRLEntry.getCertificateIssuer.

Get the issuer of the X509Certificate described by this entry.

pack-priv CertificateIssuerExtension

Returns:

the CertificateIssuerExtension, or null if it does not exist
getCertificateIssuerExtension
()

Returns the CertificateIssuerExtension

public Set<String>

Returns:

a set of the extension oid strings in the Object that are marked critical.
getCriticalExtensionOIDs
()

Implements java.security.cert.X509Extension.getCriticalExtensionOIDs.

Gets a Set of the extension(s) marked CRITICAL in this X509CRLEntry.

public byte[]
getEncoded()

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

Returns the ASN.1 DER-encoded form of this CRL Entry, which corresponds to the inner SEQUENCE.

private byte[]
public Extension

Returns:

Extension of type <extension> or null, if not found
getExtension
(ObjectIdentifier
ObjectIdentifier of extension desired
oid
)

get an extension

public Map<String, Extension>

Returns:

the extension map, can be empty, but not null
getExtensions
()

Returns all extensions for this entry in a map

public byte[]

Returns:

the DER encoded octet string of the extension value.
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>

Returns:

a set of the extension oid strings in the Object that are marked critical.
getNonCriticalExtensionOIDs
()

Implements java.security.cert.X509Extension.getNonCriticalExtensionOIDs.

Gets a Set of the extension(s) marked NON-CRITICAL in this X509CRLEntry.

public Integer

Returns:

Integer or null, if no such extension
getReasonCode
()

get Reason Code from CRL entry.

public Date

Returns:

the revocation date.
getRevocationDate
()

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

Gets the revocation date from this X509CRLEntry, the revocationDate.

public CRLReason
getRevocationReason()

Overrides java.security.cert.X509CRLEntry.getRevocationReason.

This method is the overridden implementation of the getRevocationReason method in X509CRLEntry.

public static CRLReason
getRevocationReason(X509CRLEntry crlEntry)

This static method is the default implementation of the getRevocationReason method in X509CRLEntry.

public BigInteger

Returns:

the serial number.
getSerialNumber
()

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

Gets the serial number from this X509CRLEntry, i.e. the userCertificate.

public boolean

Returns:

true if this CRL entry has extensions, otherwise false.
hasExtensions
()

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

Returns true if this revoked certificate entry has extensions, otherwise false.

public boolean
hasUnsupportedCriticalExtension()

Implements java.security.cert.X509Extension.hasUnsupportedCriticalExtension.

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

private void
parse(DerValue derVal)

pack-priv void
public static X509CRLEntryImpl
toImpl(X509CRLEntry entry)

Utility method to convert an arbitrary instance of X509CRLEntry to a X509CRLEntryImpl.

public String

Returns:

value of this revoked certificate in a printable form.
toString
()

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

Returns a printable string of this revoked certificate.

Inherited from java.security.cert.X509CRLEntry:
equalshashCode

Field Detail

certIssuerback to summary
private X500Principal certIssuer
extensionsback to summary
private CRLExtensions extensions
isExplicitback to summary
private static final boolean isExplicit
revocationDateback to summary
private Date revocationDate
revokedCertback to summary
private byte[] revokedCert
serialNumberback to summary
private SerialNumber serialNumber

Constructor Detail

X509CRLEntryImplback to summary
public X509CRLEntryImpl(BigInteger num, Date date)

Constructs a revoked certificate entry using the given serial number and revocation date.

Parameters
num:BigInteger

the serial number of the revoked certificate.

date:Date

the Date on which revocation took place.

X509CRLEntryImplback to summary
public X509CRLEntryImpl(BigInteger num, Date date, CRLExtensions crlEntryExts)

Constructs a revoked certificate entry using the given serial number, revocation date and the entry extensions.

Parameters
num:BigInteger

the serial number of the revoked certificate.

date:Date

the Date on which revocation took place.

crlEntryExts:CRLExtensions

the extensions for this entry.

X509CRLEntryImplback to summary
public X509CRLEntryImpl(byte[] revokedCert) throws CRLException

Unmarshals a revoked certificate from its encoded form.

Parameters
revokedCert:byte[]

the encoded bytes.

Exceptions
CRLException:
on parsing errors.
X509CRLEntryImplback to summary
public X509CRLEntryImpl(DerValue derValue) throws CRLException

Unmarshals a revoked certificate from its encoded form.

Parameters
derValue:DerValue

the DER value containing the revoked certificate.

Exceptions
CRLException:
on parsing errors.

Method Detail

compareToback to summary
public int compareTo(X509CRLEntryImpl that)

Implements java.lang.Comparable.compareTo.

Doc from java.lang.Comparable.compareTo.

Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

The implementor must ensure signum(x.compareTo(y)) == -signum(y.compareTo(x)) for all x and y. (This implies that x.compareTo(y) must throw an exception if and only if y.compareTo(x) throws an exception.)

The implementor must also ensure that the relation is transitive: (x.compareTo(y) > 0 && y.compareTo(z) > 0) implies x.compareTo(z) > 0.

Finally, the implementor must ensure that x.compareTo(y)==0 implies that signum(x.compareTo(z)) == signum(y.compareTo(z)), for all z.

Annotations
@Override
encodeback to summary
public void encode(DerOutputStream outStrm)

Encodes the revoked certificate to an output stream.

Parameters
outStrm:DerOutputStream

an output stream to which the encoded revoked certificate is written.

getCertificateIssuerback to summary
public X500Principal getCertificateIssuer()

Overrides java.security.cert.X509CRLEntry.getCertificateIssuer.

Doc from java.security.cert.X509CRLEntry.getCertificateIssuer.

Get the issuer of the X509Certificate described by this entry. If the certificate issuer is also the CRL issuer, this method returns null.

This method is used with indirect CRLs. The default implementation always returns null. Subclasses that wish to support indirect CRLs should override it.

Annotations
@Override
getCertificateIssuerExtensionback to summary
pack-priv CertificateIssuerExtension getCertificateIssuerExtension()

Returns the CertificateIssuerExtension

Returns:CertificateIssuerExtension

the CertificateIssuerExtension, or null if it does not exist

getCriticalExtensionOIDsback to summary
public Set<String> getCriticalExtensionOIDs()

Implements java.security.cert.X509Extension.getCriticalExtensionOIDs.

Gets a Set of the extension(s) marked CRITICAL in this X509CRLEntry. In the returned set, each extension is represented by its OID string.

Returns:Set<String>

a set of the extension oid strings in the Object that are marked critical.

getEncodedback to summary
public byte[] getEncoded()

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

Returns the ASN.1 DER-encoded form of this CRL Entry, which corresponds to the inner SEQUENCE.

getEncoded0back to summary
private byte[] getEncoded0()
getExtensionback to summary
public Extension getExtension(ObjectIdentifier oid)

get an extension

Parameters
oid:ObjectIdentifier

ObjectIdentifier of extension desired

Returns:Extension

Extension of type <extension> or null, if not found

getExtensionsback to summary
public Map<String, Extension> getExtensions()

Returns all extensions for this entry in a map

Returns:Map<String, Extension>

the extension map, can be empty, but not null

getExtensionValueback to summary
public byte[] getExtensionValue(String 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. The oid string is represented by a set of positive whole number separated by ".", that means,
<positive whole number>.<positive whole number>.<positive whole number>.<...>

Parameters
oid:String

the Object Identifier value for the extension.

Returns:byte[]

the DER encoded octet string of the extension value.

getNonCriticalExtensionOIDsback to summary
public Set<String> getNonCriticalExtensionOIDs()

Implements java.security.cert.X509Extension.getNonCriticalExtensionOIDs.

Gets a Set of the extension(s) marked NON-CRITICAL in this X509CRLEntry. In the returned set, each extension is represented by its OID string.

Returns:Set<String>

a set of the extension oid strings in the Object that are marked critical.

getReasonCodeback to summary
public Integer getReasonCode()

get Reason Code from CRL entry.

Returns:Integer

Integer or null, if no such extension

getRevocationDateback to summary
public Date getRevocationDate()

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

Gets the revocation date from this X509CRLEntry, the revocationDate.

Returns:Date

the revocation date.

getRevocationReasonback to summary
public CRLReason getRevocationReason()

Overrides java.security.cert.X509CRLEntry.getRevocationReason.

This method is the overridden implementation of the getRevocationReason method in X509CRLEntry. It is better performance-wise since it returns cached values.

Annotations
@Override
getRevocationReasonback to summary
public static CRLReason getRevocationReason(X509CRLEntry crlEntry)

This static method is the default implementation of the getRevocationReason method in X509CRLEntry.

getSerialNumberback to summary
public BigInteger getSerialNumber()

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

Gets the serial number from this X509CRLEntry, i.e. the userCertificate.

Returns:BigInteger

the serial number.

hasExtensionsback to summary
public boolean hasExtensions()

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

Returns true if this revoked certificate entry has extensions, otherwise false.

Returns:boolean

true if this CRL entry has extensions, otherwise false.

hasUnsupportedCriticalExtensionback to summary
public boolean hasUnsupportedCriticalExtension()

Implements java.security.cert.X509Extension.hasUnsupportedCriticalExtension.

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

parseback to summary
private void parse(DerValue derVal) throws CRLException, IOException
setCertificateIssuerback to summary
pack-priv void setCertificateIssuer(X500Principal crlIssuer, X500Principal certIssuer)
toImplback to summary
public static X509CRLEntryImpl toImpl(X509CRLEntry entry) throws CRLException

Utility method to convert an arbitrary instance of X509CRLEntry to a X509CRLEntryImpl. Does a cast if possible, otherwise reparses the encoding.

toStringback to summary
public String toString()

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

Returns a printable string of this revoked certificate.

Returns:String

value of this revoked certificate in a printable form.

Annotations
@Override