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

public Class X509CRLImpl

extends X509CRL
implements DerEncoder
Class Inheritance
All Implemented Interfaces
sun.security.util.DerEncoder
Imports
java.io.InputStream, .IOException, java.math.BigInteger, java.security.cert.Certificate, .X509CRL, .X509Certificate, .X509CRLEntry, .CRLException, java.security.*, java.util.*, javax.security.auth.x500.X500Principal, sun.security.provider.X509Factory, sun.security.util.*

An implementation for X509 CRL (Certificate Revocation List).

The X.509 v2 CRL format is described below in ASN.1:

CertificateList  ::=  SEQUENCE  {
    tbsCertList          TBSCertList,
    signatureAlgorithm   AlgorithmIdentifier,
    signature            BIT STRING  }
More information can be found in RFC 5280: Internet X.509 Public Key Infrastructure Certificate and CRL Profile.

The ASN.1 definition of tbsCertList is:

TBSCertList  ::=  SEQUENCE  {
    version                 Version OPTIONAL,
                            -- if present, must be v2
    signature               AlgorithmIdentifier,
    issuer                  Name,
    thisUpdate              ChoiceOfTime,
    nextUpdate              ChoiceOfTime OPTIONAL,
    revokedCertificates     SEQUENCE OF SEQUENCE  {
        userCertificate         CertificateSerialNumber,
        revocationDate          ChoiceOfTime,
        crlEntryExtensions      Extensions OPTIONAL
                                -- if present, must be v2
        }  OPTIONAL,
    crlExtensions           [0]  EXPLICIT Extensions OPTIONAL
                                 -- if present, must be v2
    }
Author
Hemma Prafullchandra
See Also
X509CRL

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
private static class
X509CRLImpl.X509IssuerSerial

Immutable X.509 Certificate Issuer DN and serial number pair

Field Summary

Modifier and TypeField and Description
private X509CRLImpl.TBSCertList
private static final boolean
private AlgorithmId
private byte[]
private byte[]
private byte[]
private String
verifiedProvider

If verifiedPublicKey is not null, name of the provider used to successfully verify the signature of this CRL, or the empty String if no provider was explicitly specified.

private PublicKey
verifiedPublicKey

PublicKey that has previously been used to successfully verify the signature of this CRL.

Constructor Summary

AccessConstructor and Description
public
X509CRLImpl(X509CRLImpl.TBSCertList info, AlgorithmId sigAlgId, byte[] signature, byte[] tbsCertList, byte[] signedCRL)

Constructor simply setting all (non-cache) fields.

public
X509CRLImpl(byte[]
the encoded bytes, with no trailing padding.
crlData
)

Unmarshals an X.509 CRL from its encoded form, parsing the encoded bytes.

public
X509CRLImpl(DerValue
a DER value holding at least one CRL
val
)

Unmarshals an X.509 CRL from an DER value.

public
X509CRLImpl(InputStream
an input stream holding at least one CRL
inStrm
)

Unmarshals an X.509 CRL from an input stream.

Method Summary

Modifier and TypeMethod and Description
public void
encode(DerOutputStream out)

Implements sun.security.util.DerEncoder.encode.

DER encode this object and write the results to a stream.

public KeyIdentifier

Returns:

AuthorityKeyIdentifier or null (if no AuthorityKeyIdentifierExtension)
getAuthKeyId
()

return the AuthorityKeyIdentifier, if any.

public AuthorityKeyIdentifierExtension

Returns:

AuthorityKeyIdentifierExtension or null (if no such extension)
getAuthKeyIdExtension
()

return the AuthorityKeyIdentifierExtension, if any.

public BigInteger

Returns:

number or null (if no such extension)
getBaseCRLNumber
()

return the base CRL number from the DeltaCRLIndicatorExtension, if any.

public Set<String>

Returns:

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

Implements java.security.cert.X509Extension.getCriticalExtensionOIDs.

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

public BigInteger

Returns:

number or null (if no such extension)
getCRLNumber
()

return the CRL number from the CRLNumberExtension, if any.

public CRLNumberExtension

Returns:

CRLNumberExtension or null (if no such extension)
getCRLNumberExtension
()

return the CRLNumberExtension, if any.

public DeltaCRLIndicatorExtension

Returns:

DeltaCRLIndicatorExtension or null (if no such extension)
getDeltaCRLIndicatorExtension
()

return the DeltaCRLIndicatorExtension, if any.

public byte[]
getEncoded()

Implements abstract java.security.cert.X509CRL.getEncoded.

Returns the ASN.1 DER encoded form of this CRL.

public byte[]
getEncodedInternal()

Returned the encoding as an uncloned byte array.

public static byte[]
getEncodedInternal(X509CRL crl)

Returned the encoding of the given certificate for internal use.

public Object

Returns:

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

get an extension

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 IssuerAlternativeNameExtension

Returns:

IssuerAlternativeNameExtension or null (if no such extension)
getIssuerAltNameExtension
()

return the IssuerAlternativeNameExtension, if any.

public Principal

Returns:

the issuer name.
getIssuerDN
()

Implements abstract java.security.cert.X509CRL.getIssuerDN.

Gets the issuer distinguished name from this CRL.

public X500Principal
getIssuerX500Principal()

Overrides java.security.cert.X509CRL.getIssuerX500Principal.

Return the issuer as X500Principal.

public static X500Principal
getIssuerX500Principal(X509CRL crl)

Extract the issuer X500Principal from an X509CRL.

public IssuingDistributionPointExtension

Returns:

IssuingDistributionPointExtension or null (if no such extension)
getIssuingDistributionPointExtension
()

return the IssuingDistributionPointExtension, if any.

public Date

Returns:

the nextUpdate date from the CRL, or null if not present.
getNextUpdate
()

Implements abstract java.security.cert.X509CRL.getNextUpdate.

Gets the nextUpdate date from the CRL.

public Set<String>

Returns:

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

Implements java.security.cert.X509Extension.getNonCriticalExtensionOIDs.

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

public X509CRLEntry

Returns:

the entry with the given serial number, or null if no such entry exists in the CRL.
getRevokedCertificate
(BigInteger serialNumber)

Implements abstract java.security.cert.X509CRL.getRevokedCertificate.

Gets the CRL entry with the given serial number from this CRL.

public X509CRLEntry
getRevokedCertificate(X509Certificate cert)

Overrides java.security.cert.X509CRL.getRevokedCertificate.

Gets the CRL entry for the given certificate.

public Set<X509CRLEntry>

Returns:

all the revoked certificates or null if there are none.
getRevokedCertificates
()

Implements abstract java.security.cert.X509CRL.getRevokedCertificates.

Gets all the revoked certificates from the CRL.

public AlgorithmId

Returns:

the signature AlgorithmId
getSigAlgId
()

Gets the signature AlgorithmId from the CRL.

public String

Returns:

the signature algorithm name.
getSigAlgName
()

Implements abstract java.security.cert.X509CRL.getSigAlgName.

Gets the signature algorithm name for the CRL signature algorithm.

public String

Returns:

the signature algorithm oid string.
getSigAlgOID
()

Implements abstract java.security.cert.X509CRL.getSigAlgOID.

Gets the signature algorithm OID string from the CRL.

public byte[]

Returns:

the DER encoded signature algorithm parameters, or null if no parameters are present.
getSigAlgParams
()

Implements abstract java.security.cert.X509CRL.getSigAlgParams.

Gets the DER encoded signature algorithm parameters from this CRL's signature algorithm.

public byte[]

Returns:

the signature.
getSignature
()

Implements abstract java.security.cert.X509CRL.getSignature.

Gets the raw Signature bits from the CRL.

public byte[]

Returns:

the DER encoded CRL information.
getTBSCertList
()

Implements abstract java.security.cert.X509CRL.getTBSCertList.

Gets the DER encoded CRL information, the tbsCertList from this CRL.

public Date

Returns:

the thisUpdate date from the CRL.
getThisUpdate
()

Implements abstract java.security.cert.X509CRL.getThisUpdate.

Gets the thisUpdate date from the CRL.

public int

Returns:

the version number, i.e. 1 or 2.
getVersion
()

Implements abstract java.security.cert.X509CRL.getVersion.

Gets the version number from this CRL.

public boolean
hasUnsupportedCriticalExtension()

Implements java.security.cert.X509Extension.hasUnsupportedCriticalExtension.

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

public X509CRLImpl.TBSCertList
info()

public boolean

Returns:

true if the given certificate is on this CRL, false otherwise.
isRevoked
(Certificate
the certificate to check for.
cert
)

Implements abstract java.security.cert.CRL.isRevoked.

Checks whether the given certificate is on this CRL.

public static X509CRLImpl

Returns:

a newly signed CRL
newSigned
(X509CRLImpl.TBSCertList
the TBSCertList to sign
info
,
PrivateKey
the private key used for signing.
key
,
String
the name of the signature algorithm used.
algorithm
)

Creates a new X.509 CRL, which is signed using the given key.

public static X509CRLImpl

Returns:

a newly signed CRL
newSigned
(X509CRLImpl.TBSCertList
the TBSCertList to sign
info
,
PrivateKey
the private key used for signing.
key
,
String
the name of the signature algorithm used.
algorithm
,
String
(optional) the name of the provider.
provider
)

Creates a new X.509 CRL, which is signed using the given key.

private void
public static X509CRLImpl
toImpl(X509CRL crl)

Utility method to convert an arbitrary instance of X509CRL to a X509CRLImpl.

public String

Returns:

value of this CRL in a printable form.
toString
()

Implements abstract java.security.cert.CRL.toString.

Returns a printable string of this CRL.

public String
public void
verify(PublicKey
the PublicKey used to carry out the verification.
key
)

Implements abstract java.security.cert.X509CRL.verify.

Verifies that this CRL was signed using the private key that corresponds to the given public key.

public synchronized void
verify(PublicKey
the PublicKey used to carry out the verification.
key
,
String
the name of the signature provider.
sigProvider
)

Implements abstract java.security.cert.X509CRL.verify.

Verifies that this CRL was signed using the private key that corresponds to the given public key, and that the signature verification was computed by the given provider.

public synchronized void
verify(PublicKey
the PublicKey used to carry out the verification.
key
,
Provider
the signature provider.
sigProvider
)

Overrides java.security.cert.X509CRL.verify.

Verifies that this CRL was signed using the private key that corresponds to the given public key, and that the signature verification was computed by the given provider.

Inherited from java.security.cert.X509CRL:
equalshashCode

Field Detail

infoback to summary
private X509CRLImpl.TBSCertList info
isExplicitback to summary
private static final boolean isExplicit
sigAlgIdback to summary
private AlgorithmId sigAlgId
signatureback to summary
private byte[] signature
signedCRLback to summary
private byte[] signedCRL
tbsCertListback to summary
private byte[] tbsCertList
verifiedProviderback to summary
private String verifiedProvider

If verifiedPublicKey is not null, name of the provider used to successfully verify the signature of this CRL, or the empty String if no provider was explicitly specified.

verifiedPublicKeyback to summary
private PublicKey verifiedPublicKey

PublicKey that has previously been used to successfully verify the signature of this CRL. Null if the CRL has not yet been verified (successfully).

Constructor Detail

X509CRLImplback to summary
public X509CRLImpl(X509CRLImpl.TBSCertList info, AlgorithmId sigAlgId, byte[] signature, byte[] tbsCertList, byte[] signedCRL)

Constructor simply setting all (non-cache) fields. Only used in newSigned.

X509CRLImplback to summary
public X509CRLImpl(byte[] crlData) throws CRLException

Unmarshals an X.509 CRL from its encoded form, parsing the encoded bytes. This form of constructor is used by agents which need to examine and use CRL contents. Note that the buffer must include only one CRL, and no "garbage" may be left at the end.

Parameters
crlData:byte[]

the encoded bytes, with no trailing padding.

Exceptions
CRLException:
on parsing errors.
X509CRLImplback to summary
public X509CRLImpl(DerValue val) throws CRLException

Unmarshals an X.509 CRL from an DER value.

Parameters
val:DerValue

a DER value holding at least one CRL

Exceptions
CRLException:
on parsing errors.
X509CRLImplback to summary
public X509CRLImpl(InputStream inStrm) throws CRLException

Unmarshals an X.509 CRL from an input stream. Only one CRL is expected at the end of the input stream.

Parameters
inStrm:InputStream

an input stream holding at least one CRL

Exceptions
CRLException:
on parsing errors.

Method Detail

encodeback to summary
public void encode(DerOutputStream out)

Implements sun.security.util.DerEncoder.encode.

Doc from sun.security.util.DerEncoder.encode.

DER encode this object and write the results to a stream.

Annotations
@Override
getAuthKeyIdback to summary
public KeyIdentifier getAuthKeyId()

return the AuthorityKeyIdentifier, if any.

Returns:KeyIdentifier

AuthorityKeyIdentifier or null (if no AuthorityKeyIdentifierExtension)

getAuthKeyIdExtensionback to summary
public AuthorityKeyIdentifierExtension getAuthKeyIdExtension()

return the AuthorityKeyIdentifierExtension, if any.

Returns:AuthorityKeyIdentifierExtension

AuthorityKeyIdentifierExtension or null (if no such extension)

getBaseCRLNumberback to summary
public BigInteger getBaseCRLNumber()

return the base CRL number from the DeltaCRLIndicatorExtension, if any.

Returns:BigInteger

number or null (if no such extension)

getCriticalExtensionOIDsback to summary
public Set<String> getCriticalExtensionOIDs()

Implements java.security.cert.X509Extension.getCriticalExtensionOIDs.

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

Returns:Set<String>

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

getCRLNumberback to summary
public BigInteger getCRLNumber()

return the CRL number from the CRLNumberExtension, if any.

Returns:BigInteger

number or null (if no such extension)

getCRLNumberExtensionback to summary
public CRLNumberExtension getCRLNumberExtension()

return the CRLNumberExtension, if any.

Returns:CRLNumberExtension

CRLNumberExtension or null (if no such extension)

getDeltaCRLIndicatorExtensionback to summary
public DeltaCRLIndicatorExtension getDeltaCRLIndicatorExtension()

return the DeltaCRLIndicatorExtension, if any.

Returns:DeltaCRLIndicatorExtension

DeltaCRLIndicatorExtension or null (if no such extension)

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

Implements abstract java.security.cert.X509CRL.getEncoded.

Returns the ASN.1 DER encoded form of this CRL.

Exceptions
CRLException:
if an encoding error occurs.
getEncodedInternalback to summary
public byte[] getEncodedInternal() throws CRLException

Returned the encoding as an uncloned byte array. Callers must guarantee that they neither modify it nor expose it to untrusted code.

getEncodedInternalback to summary
public static byte[] getEncodedInternal(X509CRL crl) throws CRLException

Returned the encoding of the given certificate for internal use. Callers must guarantee that they neither modify it nor expose it to untrusted code. Uses getEncodedInternal() if the certificate is instance of X509CertImpl, getEncoded() otherwise.

getExtensionback to summary
public Object getExtension(ObjectIdentifier oid)

get an extension

Parameters
oid:ObjectIdentifier

ObjectIdentifier of extension desired

Returns:Object

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

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>.<...>

Parameters
oid:String

the Object Identifier value for the extension.

Returns:byte[]

the der encoded octet string of the extension value.

getIssuerAltNameExtensionback to summary
public IssuerAlternativeNameExtension getIssuerAltNameExtension()

return the IssuerAlternativeNameExtension, if any.

Returns:IssuerAlternativeNameExtension

IssuerAlternativeNameExtension or null (if no such extension)

getIssuerDNback to summary
public Principal getIssuerDN()

Implements abstract java.security.cert.X509CRL.getIssuerDN.

Gets the issuer distinguished name from this CRL. The issuer name identifies the entity who has signed (and issued the CRL). The issuer name field contains an X.500 distinguished name (DN). The ASN.1 definition for this is:

issuer    Name

Name ::= CHOICE { RDNSequence }
RDNSequence ::= SEQUENCE OF RelativeDistinguishedName
RelativeDistinguishedName ::=
    SET OF AttributeValueAssertion

AttributeValueAssertion ::= SEQUENCE {
                              AttributeType,
                              AttributeValue }
AttributeType ::= OBJECT IDENTIFIER
AttributeValue ::= ANY
The Name describes a hierarchical name composed of attributes, such as country name, and corresponding values, such as US. The type of the component AttributeValue is determined by the AttributeType; in general it will be a directoryString. A directoryString is usually one of PrintableString, TeletexString or UniversalString.
Returns:Principal

the issuer name.

Annotations
@SuppressWarnings:deprecation
getIssuerX500Principalback to summary
public X500Principal getIssuerX500Principal()

Overrides java.security.cert.X509CRL.getIssuerX500Principal.

Return the issuer as X500Principal. Overrides method in X509CRL to provide a slightly more efficient version.

getIssuerX500Principalback to summary
public static X500Principal getIssuerX500Principal(X509CRL crl)

Extract the issuer X500Principal from an X509CRL. Parses the encoded form of the CRL to preserve the principal's ASN.1 encoding. Called by java.security.cert.X509CRL.getIssuerX500Principal().

getIssuingDistributionPointExtensionback to summary
public IssuingDistributionPointExtension getIssuingDistributionPointExtension()

return the IssuingDistributionPointExtension, if any.

Returns:IssuingDistributionPointExtension

IssuingDistributionPointExtension or null (if no such extension)

getNextUpdateback to summary
public Date getNextUpdate()

Implements abstract java.security.cert.X509CRL.getNextUpdate.

Gets the nextUpdate date from the CRL.

Returns:Date

the nextUpdate date from the CRL, or null if not present.

getNonCriticalExtensionOIDsback to summary
public Set<String> getNonCriticalExtensionOIDs()

Implements java.security.cert.X509Extension.getNonCriticalExtensionOIDs.

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

Returns:Set<String>

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

getRevokedCertificateback to summary
public X509CRLEntry getRevokedCertificate(BigInteger serialNumber)

Implements abstract java.security.cert.X509CRL.getRevokedCertificate.

Gets the CRL entry with the given serial number from this CRL.

Returns:X509CRLEntry

the entry with the given serial number, or null if no such entry exists in the CRL.

See Also
X509CRLEntry
getRevokedCertificateback to summary
public X509CRLEntry getRevokedCertificate(X509Certificate cert)

Overrides java.security.cert.X509CRL.getRevokedCertificate.

Gets the CRL entry for the given certificate.

getRevokedCertificatesback to summary
public Set<X509CRLEntry> getRevokedCertificates()

Implements abstract java.security.cert.X509CRL.getRevokedCertificates.

Gets all the revoked certificates from the CRL. A Set of X509CRLEntry.

Returns:Set<X509CRLEntry>

all the revoked certificates or null if there are none.

See Also
X509CRLEntry
getSigAlgIdback to summary
public AlgorithmId getSigAlgId()

Gets the signature AlgorithmId from the CRL.

Returns:AlgorithmId

the signature AlgorithmId

getSigAlgNameback to summary
public String getSigAlgName()

Implements abstract java.security.cert.X509CRL.getSigAlgName.

Gets the signature algorithm name for the CRL signature algorithm. For example, the string "SHA1withDSA". The ASN.1 definition for this is:

AlgorithmIdentifier  ::=  SEQUENCE  {
    algorithm               OBJECT IDENTIFIER,
    parameters              ANY DEFINED BY algorithm OPTIONAL  }
                            -- contains a value of the type
                            -- registered for use with the
                            -- algorithm object identifier value
Returns:String

the signature algorithm name.

getSigAlgOIDback to summary
public String getSigAlgOID()

Implements abstract java.security.cert.X509CRL.getSigAlgOID.

Gets the signature algorithm OID string from the CRL. An OID is represented by a set of positive whole number separated by ".", that means,
<positive whole number>.<positive whole number>.<...> For example, the string "1.2.840.10040.4.3" identifies the SHA-1 with DSA signature algorithm defined in RFC 3279: Algorithms and Identifiers for the Internet X.509 Public Key Infrastructure Certificate and CRL Profile.

Returns:String

the signature algorithm oid string.

getSigAlgParamsback to summary
public byte[] getSigAlgParams()

Implements abstract java.security.cert.X509CRL.getSigAlgParams.

Gets the DER encoded signature algorithm parameters from this CRL's signature algorithm. In most cases, the signature algorithm parameters are null, the parameters are usually supplied with the Public Key.

Returns:byte[]

the DER encoded signature algorithm parameters, or null if no parameters are present.

getSignatureback to summary
public byte[] getSignature()

Implements abstract java.security.cert.X509CRL.getSignature.

Gets the raw Signature bits from the CRL.

Returns:byte[]

the signature.

getTBSCertListback to summary
public byte[] getTBSCertList() throws CRLException

Implements abstract java.security.cert.X509CRL.getTBSCertList.

Gets the DER encoded CRL information, the tbsCertList from this CRL. This can be used to verify the signature independently.

Returns:byte[]

the DER encoded CRL information.

Exceptions
CRLException:
on encoding errors.
getThisUpdateback to summary
public Date getThisUpdate()

Implements abstract java.security.cert.X509CRL.getThisUpdate.

Gets the thisUpdate date from the CRL. The ASN.1 definition for this is:

Returns:Date

the thisUpdate date from the CRL.

getVersionback to summary
public int getVersion()

Implements abstract java.security.cert.X509CRL.getVersion.

Gets the version number from this CRL. The ASN.1 definition for this is:

Version  ::=  INTEGER  {  v1(0), v2(1), v3(2)  }
            -- v3 does not apply to CRLs but appears for consistency
            -- with definition of Version for certs
Returns:int

the version number, i.e. 1 or 2.

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.

infoback to summary
public X509CRLImpl.TBSCertList info()
isRevokedback to summary
public boolean isRevoked(Certificate cert)

Implements abstract java.security.cert.CRL.isRevoked.

Checks whether the given certificate is on this CRL.

Parameters
cert:Certificate

the certificate to check for.

Returns:boolean

true if the given certificate is on this CRL, false otherwise.

newSignedback to summary
public static X509CRLImpl newSigned(X509CRLImpl.TBSCertList info, PrivateKey key, String algorithm) throws CRLException, NoSuchAlgorithmException, InvalidKeyException, NoSuchProviderException, SignatureException

Creates a new X.509 CRL, which is signed using the given key.

Parameters
info:X509CRLImpl.TBSCertList

the TBSCertList to sign

key:PrivateKey

the private key used for signing.

algorithm:String

the name of the signature algorithm used.

Returns:X509CRLImpl

a newly signed CRL

Exceptions
CRLException:
if any mandatory data was omitted.
NoSuchAlgorithmException:
on unsupported signature algorithms.
InvalidKeyException:
on incorrect key.
NoSuchProviderException:
on incorrect provider.
SignatureException:
on signature errors.
newSignedback to summary
public static X509CRLImpl newSigned(X509CRLImpl.TBSCertList info, PrivateKey key, String algorithm, String provider) throws CRLException, NoSuchAlgorithmException, InvalidKeyException, NoSuchProviderException, SignatureException

Creates a new X.509 CRL, which is signed using the given key.

Parameters
info:X509CRLImpl.TBSCertList

the TBSCertList to sign

key:PrivateKey

the private key used for signing.

algorithm:String

the name of the signature algorithm used.

provider:String

(optional) the name of the provider.

Returns:X509CRLImpl

a newly signed CRL

Exceptions
CRLException:
if any mandatory data was omitted.
NoSuchAlgorithmException:
on unsupported signature algorithms.
InvalidKeyException:
on incorrect key.
NoSuchProviderException:
on incorrect provider.
SignatureException:
on signature errors.
parseback to summary
private void parse(DerValue val) throws CRLException, IOException
toImplback to summary
public static X509CRLImpl toImpl(X509CRL crl) throws CRLException

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

toStringback to summary
public String toString()

Implements abstract java.security.cert.CRL.toString.

Returns a printable string of this CRL.

Returns:String

value of this CRL in a printable form.

toStringWithAlgNameback to summary
public String toStringWithAlgName(String name)
verifyback to summary
public void verify(PublicKey key) throws CRLException, NoSuchAlgorithmException, InvalidKeyException, NoSuchProviderException, SignatureException

Implements abstract java.security.cert.X509CRL.verify.

Verifies that this CRL was signed using the private key that corresponds to the given public key.

Parameters
key:PublicKey

the PublicKey used to carry out the verification.

Exceptions
CRLException:
on encoding errors.
NoSuchAlgorithmException:
on unsupported signature algorithms.
InvalidKeyException:
on incorrect key.
NoSuchProviderException:
if there's no default provider.
SignatureException:
on signature errors.
verifyback to summary
public synchronized void verify(PublicKey key, String sigProvider) throws CRLException, NoSuchAlgorithmException, InvalidKeyException, NoSuchProviderException, SignatureException

Implements abstract java.security.cert.X509CRL.verify.

Verifies that this CRL was signed using the private key that corresponds to the given public key, and that the signature verification was computed by the given provider.

Parameters
key:PublicKey

the PublicKey used to carry out the verification.

sigProvider:String

the name of the signature provider.

Exceptions
CRLException:
on encoding errors.
NoSuchAlgorithmException:
on unsupported signature algorithms.
InvalidKeyException:
on incorrect key.
NoSuchProviderException:
on incorrect provider.
SignatureException:
on signature errors.
verifyback to summary
public synchronized void verify(PublicKey key, Provider sigProvider) throws CRLException, NoSuchAlgorithmException, InvalidKeyException, SignatureException

Overrides java.security.cert.X509CRL.verify.

Verifies that this CRL was signed using the private key that corresponds to the given public key, and that the signature verification was computed by the given provider. Note that the specified Provider object does not have to be registered in the provider list.

Parameters
key:PublicKey

the PublicKey used to carry out the verification.

sigProvider:Provider

the signature provider.

Exceptions
CRLException:
on encoding errors.
NoSuchAlgorithmException:
on unsupported signature algorithms.
InvalidKeyException:
on incorrect key.
SignatureException:
on signature errors.
sun.security.x509 back to summary

public Class X509CRLImpl.TBSCertList

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
private CRLExtensions
private AlgorithmId
private X500Name
private X500Principal
private Date
private final List<X509CRLEntry>
private final Map<X509CRLImpl.X509IssuerSerial, X509CRLEntry>
private Date
private int

Constructor Summary

AccessConstructor and Description
public
TBSCertList(X500Name
the name of the CA issuing this CRL.
issuer
,
Date
the Date of this issue.
thisDate
,
Date
the Date of the next CRL.
nextDate
)

Initial TBSCertList constructor, no revoked certs, and no extensions.

public
TBSCertList(X500Name
the name of the CA issuing this CRL.
issuer
,
Date
the Date of this issue.
thisDate
,
Date
the Date of the next CRL.
nextDate
,
X509CRLEntry[]
the array of CRL entries.
badCerts
)

TBSCertList constructor, revoked certs, no extensions.

public
TBSCertList(X500Name
the name of the CA issuing this CRL.
issuer
,
Date
the Date of this issue.
thisDate
,
Date
the Date of the next CRL.
nextDate
,
X509CRLEntry[]
the array of CRL entries.
badCerts
,
CRLExtensions
the CRL extensions.
crlExts
)

TBSCertList constructor, revoked certs and extensions.

public
TBSCertList(DerValue value)

Constructs from the encoding.

Method Summary

Modifier and TypeMethod and Description
public byte[]
encodeInfo()

Encodes the "to-be-signed" TBSCertList to the OutputStream.

private X500Principal

Returns:

the X500Principal in a CertificateIssuerExtension, or prevCertIssuer if it does not exist
getCertIssuer
(X509CRLEntryImpl
the entry to check
entry
,
X500Principal
the previous entry's certificate issuer
prevCertIssuer
)

Returns the X500 certificate issuer DN of a CRL entry.

public X500Principal
getIssuerX500Principal()

Return the issuer as X500Principal.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

extensionsback to summary
private CRLExtensions extensions
infoSigAlgIdback to summary
private AlgorithmId infoSigAlgId
issuerback to summary
private X500Name issuer
issuerPrincipalback to summary
private X500Principal issuerPrincipal
nextUpdateback to summary
private Date nextUpdate
revokedListback to summary
private final List<X509CRLEntry> revokedList
revokedMapback to summary
private final Map<X509CRLImpl.X509IssuerSerial, X509CRLEntry> revokedMap
thisUpdateback to summary
private Date thisUpdate
versionback to summary
private int version

Constructor Detail

TBSCertListback to summary
public TBSCertList(X500Name issuer, Date thisDate, Date nextDate)

Initial TBSCertList constructor, no revoked certs, and no extensions.

Parameters
issuer:X500Name

the name of the CA issuing this CRL.

thisDate:Date

the Date of this issue.

nextDate:Date

the Date of the next CRL.

TBSCertListback to summary
public TBSCertList(X500Name issuer, Date thisDate, Date nextDate, X509CRLEntry[] badCerts) throws CRLException

TBSCertList constructor, revoked certs, no extensions.

Parameters
issuer:X500Name

the name of the CA issuing this CRL.

thisDate:Date

the Date of this issue.

nextDate:Date

the Date of the next CRL.

badCerts:X509CRLEntry[]

the array of CRL entries.

Annotations
@SuppressWarnings:this-escape
Exceptions
CRLException:
on parsing/construction errors.
TBSCertListback to summary
public TBSCertList(X500Name issuer, Date thisDate, Date nextDate, X509CRLEntry[] badCerts, CRLExtensions crlExts) throws CRLException

TBSCertList constructor, revoked certs and extensions.

Parameters
issuer:X500Name

the name of the CA issuing this CRL.

thisDate:Date

the Date of this issue.

nextDate:Date

the Date of the next CRL.

badCerts:X509CRLEntry[]

the array of CRL entries.

crlExts:CRLExtensions

the CRL extensions.

Exceptions
CRLException:
on parsing/construction errors.
TBSCertListback to summary
public TBSCertList(DerValue value) throws IOException, CRLException

Constructs from the encoding.

Annotations
@SuppressWarnings:this-escape

Method Detail

encodeInfoback to summary
public byte[] encodeInfo() throws CRLException

Encodes the "to-be-signed" TBSCertList to the OutputStream.

Exceptions
CRLException:
on encoding errors.
getCertIssuerback to summary
private X500Principal getCertIssuer(X509CRLEntryImpl entry, X500Principal prevCertIssuer) throws CRLException

Returns the X500 certificate issuer DN of a CRL entry.

Parameters
entry:X509CRLEntryImpl

the entry to check

prevCertIssuer:X500Principal

the previous entry's certificate issuer

Returns:X500Principal

the X500Principal in a CertificateIssuerExtension, or prevCertIssuer if it does not exist

getIssuerX500Principalback to summary
public X500Principal getIssuerX500Principal()

Return the issuer as X500Principal.

sun.security.x509 back to summary

private final Class X509CRLImpl.X509IssuerSerial

extends Object
implements Comparable<X509CRLImpl.X509IssuerSerial>
Class Inheritance
All Implemented Interfaces
java.lang.Comparable

Immutable X.509 Certificate Issuer DN and serial number pair

Field Summary

Modifier and TypeField and Description
pack-priv volatile int
pack-priv final X500Principal
pack-priv final BigInteger

Constructor Summary

AccessConstructor and Description
pack-priv
X509IssuerSerial(X500Principal
the issuer DN
issuer
,
BigInteger
the serial number
serial
)

Create an X509IssuerSerial.

pack-priv
X509IssuerSerial(X509Certificate cert)

Construct an X509IssuerSerial from an X509Certificate.

Method Summary

Modifier and TypeMethod and Description
public int
compareTo(X509CRLImpl.X509IssuerSerial another)

Implements java.lang.Comparable.compareTo.

Compares this object with the specified object for order.

public boolean

Returns:

true if equal, false otherwise
equals
(Object
the other object to compare with
o
)

Overrides java.lang.Object.equals.

Compares this X509Serial with another and returns true if they are equivalent.

pack-priv X500Principal

Returns:

the issuer
getIssuer
()

Returns the issuer.

pack-priv BigInteger

Returns:

the serial number
getSerial
()

Returns the serial number.

public int

Returns:

a hash code value for this X509IssuerSerial
hashCode
()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this X509IssuerSerial.

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAlltoStringwaitwaitwait

Field Detail

hashcodeback to summary
pack-priv volatile int hashcode
issuerback to summary
pack-priv final X500Principal issuer
serialback to summary
pack-priv final BigInteger serial

Constructor Detail

X509IssuerSerialback to summary
pack-priv X509IssuerSerial(X500Principal issuer, BigInteger serial)

Create an X509IssuerSerial.

Parameters
issuer:X500Principal

the issuer DN

serial:BigInteger

the serial number

X509IssuerSerialback to summary
pack-priv X509IssuerSerial(X509Certificate cert)

Construct an X509IssuerSerial from an X509Certificate.

Method Detail

compareToback to summary
public int compareTo(X509CRLImpl.X509IssuerSerial another)

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
equalsback to summary
public boolean equals(Object o)

Overrides java.lang.Object.equals.

Compares this X509Serial with another and returns true if they are equivalent.

Parameters
o:Object

the other object to compare with

Returns:boolean

true if equal, false otherwise

Annotations
@Override
getIssuerback to summary
pack-priv X500Principal getIssuer()

Returns the issuer.

Returns:X500Principal

the issuer

getSerialback to summary
pack-priv BigInteger getSerial()

Returns the serial number.

Returns:BigInteger

the serial number

hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this X509IssuerSerial.

Returns:int

a hash code value for this X509IssuerSerial

Annotations
@Override