public class X509CRLImpl
extends java.security.cert.X509CRL
implements com.tencent.kona.sun.security.util.DerEncoder
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
}
X509CRL| Modifier and Type | Class and Description |
|---|---|
static class |
X509CRLImpl.TBSCertList |
| Constructor and Description |
|---|
X509CRLImpl(byte[] crlData)
Unmarshals an X.509 CRL from its encoded form, parsing the encoded
bytes.
|
X509CRLImpl(com.tencent.kona.sun.security.util.DerValue val)
Unmarshals an X.509 CRL from an DER value.
|
X509CRLImpl(java.io.InputStream inStrm)
Unmarshals an X.509 CRL from an input stream.
|
X509CRLImpl(X509CRLImpl.TBSCertList info,
com.tencent.kona.sun.security.x509.AlgorithmId sigAlgId,
byte[] signature,
byte[] tbsCertList,
byte[] signedCRL)
Constructor simply setting all (non-cache) fields.
|
| Modifier and Type | Method and Description |
|---|---|
void |
encode(com.tencent.kona.sun.security.util.DerOutputStream out) |
KeyIdentifier |
getAuthKeyId()
return the AuthorityKeyIdentifier, if any.
|
AuthorityKeyIdentifierExtension |
getAuthKeyIdExtension()
return the AuthorityKeyIdentifierExtension, if any.
|
java.math.BigInteger |
getBaseCRLNumber()
return the base CRL number from the DeltaCRLIndicatorExtension, if any.
|
java.util.Set<java.lang.String> |
getCriticalExtensionOIDs()
Gets a Set of the extension(s) marked CRITICAL in the
CRL.
|
java.math.BigInteger |
getCRLNumber()
return the CRL number from the CRLNumberExtension, if any.
|
CRLNumberExtension |
getCRLNumberExtension()
return the CRLNumberExtension, if any.
|
DeltaCRLIndicatorExtension |
getDeltaCRLIndicatorExtension()
return the DeltaCRLIndicatorExtension, if any.
|
byte[] |
getEncoded()
Returns the ASN.1 DER encoded form of this CRL.
|
byte[] |
getEncodedInternal()
Returned the encoding as an uncloned byte array.
|
static byte[] |
getEncodedInternal(java.security.cert.X509CRL crl)
Returned the encoding of the given certificate for internal use.
|
java.lang.Object |
getExtension(com.tencent.kona.sun.security.util.ObjectIdentifier oid)
get an extension
|
byte[] |
getExtensionValue(java.lang.String oid)
Gets the DER encoded OCTET string for the extension value
(
extnValue) identified by the passed in oid String. |
IssuerAlternativeNameExtension |
getIssuerAltNameExtension()
return the IssuerAlternativeNameExtension, if any.
|
java.security.Principal |
getIssuerDN()
Gets the issuer distinguished name from this CRL.
|
javax.security.auth.x500.X500Principal |
getIssuerX500Principal()
Return the issuer as X500Principal.
|
static javax.security.auth.x500.X500Principal |
getIssuerX500Principal(java.security.cert.X509CRL crl)
Extract the issuer X500Principal from an X509CRL.
|
IssuingDistributionPointExtension |
getIssuingDistributionPointExtension()
return the IssuingDistributionPointExtension, if any.
|
java.util.Date |
getNextUpdate()
Gets the nextUpdate date from the CRL.
|
java.util.Set<java.lang.String> |
getNonCriticalExtensionOIDs()
Gets a Set of the extension(s) marked NON-CRITICAL in the
CRL.
|
java.security.cert.X509CRLEntry |
getRevokedCertificate(java.math.BigInteger serialNumber)
Gets the CRL entry with the given serial number from this CRL.
|
java.security.cert.X509CRLEntry |
getRevokedCertificate(java.security.cert.X509Certificate cert)
Gets the CRL entry for the given certificate.
|
java.util.Set<java.security.cert.X509CRLEntry> |
getRevokedCertificates()
Gets all the revoked certificates from the CRL.
|
com.tencent.kona.sun.security.x509.AlgorithmId |
getSigAlgId()
Gets the signature AlgorithmId from the CRL.
|
java.lang.String |
getSigAlgName()
Gets the signature algorithm name for the CRL
signature algorithm.
|
java.lang.String |
getSigAlgOID()
Gets the signature algorithm OID string from the CRL.
|
byte[] |
getSigAlgParams()
Gets the DER encoded signature algorithm parameters from this
CRL's signature algorithm.
|
byte[] |
getSignature()
Gets the raw Signature bits from the CRL.
|
byte[] |
getTBSCertList()
Gets the DER encoded CRL information, the
tbsCertList from this CRL. |
java.util.Date |
getThisUpdate()
Gets the thisUpdate date from the CRL.
|
int |
getVersion()
Gets the version number from this CRL.
|
boolean |
hasUnsupportedCriticalExtension()
Return true if a critical extension is found that is
not supported, otherwise return false.
|
boolean |
isRevoked(java.security.cert.Certificate cert)
Checks whether the given certificate is on this CRL.
|
static X509CRLImpl |
newSigned(X509CRLImpl.TBSCertList info,
java.security.PrivateKey key,
java.lang.String algorithm)
Creates a new X.509 CRL, which is signed using the given key.
|
static X509CRLImpl |
newSigned(X509CRLImpl.TBSCertList info,
java.security.PrivateKey key,
java.lang.String algorithm,
java.lang.String provider)
Creates a new X.509 CRL, which is signed using the given key.
|
static X509CRLImpl |
toImpl(java.security.cert.X509CRL crl)
Utility method to convert an arbitrary instance of X509CRL
to a X509CRLImpl.
|
java.lang.String |
toString()
Returns a printable string of this CRL.
|
java.lang.String |
toStringWithAlgName(java.lang.String name) |
void |
verify(java.security.PublicKey key)
Verifies that this CRL was signed using the
private key that corresponds to the given public key.
|
void |
verify(java.security.PublicKey key,
java.security.Provider sigProvider)
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.
|
void |
verify(java.security.PublicKey key,
java.lang.String sigProvider)
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 X509CRLImpl(X509CRLImpl.TBSCertList info, com.tencent.kona.sun.security.x509.AlgorithmId sigAlgId, byte[] signature, byte[] tbsCertList, byte[] signedCRL)
newSigned(com.tencent.kona.sun.security.x509.X509CRLImpl.TBSCertList, java.security.PrivateKey, java.lang.String).public X509CRLImpl(byte[] crlData)
throws java.security.cert.CRLException
crlData - the encoded bytes, with no trailing padding.java.security.cert.CRLException - on parsing errors.public X509CRLImpl(com.tencent.kona.sun.security.util.DerValue val)
throws java.security.cert.CRLException
val - a DER value holding at least one CRLjava.security.cert.CRLException - on parsing errors.public X509CRLImpl(java.io.InputStream inStrm)
throws java.security.cert.CRLException
inStrm - an input stream holding at least one CRLjava.security.cert.CRLException - on parsing errors.public byte[] getEncodedInternal()
throws java.security.cert.CRLException
java.security.cert.CRLExceptionpublic byte[] getEncoded()
throws java.security.cert.CRLException
getEncoded in class java.security.cert.X509CRLjava.security.cert.CRLException - if an encoding error occurs.public void verify(java.security.PublicKey key)
throws java.security.cert.CRLException,
java.security.NoSuchAlgorithmException,
java.security.InvalidKeyException,
java.security.NoSuchProviderException,
java.security.SignatureException
verify in class java.security.cert.X509CRLkey - the PublicKey used to carry out the verification.java.security.NoSuchAlgorithmException - on unsupported signature
algorithms.java.security.InvalidKeyException - on incorrect key.java.security.NoSuchProviderException - if there's no default provider.java.security.SignatureException - on signature errors.java.security.cert.CRLException - on encoding errors.public void verify(java.security.PublicKey key,
java.lang.String sigProvider)
throws java.security.cert.CRLException,
java.security.NoSuchAlgorithmException,
java.security.InvalidKeyException,
java.security.NoSuchProviderException,
java.security.SignatureException
verify in class java.security.cert.X509CRLkey - the PublicKey used to carry out the verification.sigProvider - the name of the signature provider.java.security.NoSuchAlgorithmException - on unsupported signature
algorithms.java.security.InvalidKeyException - on incorrect key.java.security.NoSuchProviderException - on incorrect provider.java.security.SignatureException - on signature errors.java.security.cert.CRLException - on encoding errors.public void verify(java.security.PublicKey key,
java.security.Provider sigProvider)
throws java.security.cert.CRLException,
java.security.NoSuchAlgorithmException,
java.security.InvalidKeyException,
java.security.SignatureException
verify in class java.security.cert.X509CRLkey - the PublicKey used to carry out the verification.sigProvider - the signature provider.java.security.NoSuchAlgorithmException - on unsupported signature
algorithms.java.security.InvalidKeyException - on incorrect key.java.security.SignatureException - on signature errors.java.security.cert.CRLException - on encoding errors.public static X509CRLImpl newSigned(X509CRLImpl.TBSCertList info, java.security.PrivateKey key, java.lang.String algorithm) throws java.security.cert.CRLException, java.security.NoSuchAlgorithmException, java.security.InvalidKeyException, java.security.NoSuchProviderException, java.security.SignatureException
info - the TBSCertList to signkey - the private key used for signing.algorithm - the name of the signature algorithm used.java.security.NoSuchAlgorithmException - on unsupported signature algorithms.java.security.InvalidKeyException - on incorrect key.java.security.NoSuchProviderException - on incorrect provider.java.security.SignatureException - on signature errors.java.security.cert.CRLException - if any mandatory data was omitted.public static X509CRLImpl newSigned(X509CRLImpl.TBSCertList info, java.security.PrivateKey key, java.lang.String algorithm, java.lang.String provider) throws java.security.cert.CRLException, java.security.NoSuchAlgorithmException, java.security.InvalidKeyException, java.security.NoSuchProviderException, java.security.SignatureException
info - the TBSCertList to signkey - the private key used for signing.algorithm - the name of the signature algorithm used.provider - (optional) the name of the provider.java.security.NoSuchAlgorithmException - on unsupported signature algorithms.java.security.InvalidKeyException - on incorrect key.java.security.NoSuchProviderException - on incorrect provider.java.security.SignatureException - on signature errors.java.security.cert.CRLException - if any mandatory data was omitted.public java.lang.String toString()
toString in class java.security.cert.CRLpublic java.lang.String toStringWithAlgName(java.lang.String name)
public boolean isRevoked(java.security.cert.Certificate cert)
isRevoked in class java.security.cert.CRLcert - the certificate to check for.public int getVersion()
Version ::= INTEGER { v1(0), v2(1), v3(2) }
-- v3 does not apply to CRLs but appears for consistency
-- with definition of Version for certs
getVersion in class java.security.cert.X509CRLpublic java.security.Principal getIssuerDN()
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.getIssuerDN in class java.security.cert.X509CRLpublic javax.security.auth.x500.X500Principal getIssuerX500Principal()
getIssuerX500Principal in class java.security.cert.X509CRLpublic java.util.Date getThisUpdate()
getThisUpdate in class java.security.cert.X509CRLpublic java.util.Date getNextUpdate()
getNextUpdate in class java.security.cert.X509CRLpublic java.security.cert.X509CRLEntry getRevokedCertificate(java.math.BigInteger serialNumber)
getRevokedCertificate in class java.security.cert.X509CRLnull if
no such entry exists in the CRL.X509CRLEntrypublic java.security.cert.X509CRLEntry getRevokedCertificate(java.security.cert.X509Certificate cert)
getRevokedCertificate in class java.security.cert.X509CRLpublic java.util.Set<java.security.cert.X509CRLEntry> getRevokedCertificates()
getRevokedCertificates in class java.security.cert.X509CRLnull if there are
none.X509CRLEntrypublic byte[] getTBSCertList()
throws java.security.cert.CRLException
tbsCertList from this CRL.
This can be used to verify the signature independently.getTBSCertList in class java.security.cert.X509CRLjava.security.cert.CRLException - on encoding errors.public byte[] getSignature()
getSignature in class java.security.cert.X509CRLpublic java.lang.String getSigAlgName()
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
getSigAlgName in class java.security.cert.X509CRLpublic java.lang.String getSigAlgOID()
getSigAlgOID in class java.security.cert.X509CRLpublic byte[] getSigAlgParams()
getSigAlgParams in class java.security.cert.X509CRLpublic com.tencent.kona.sun.security.x509.AlgorithmId getSigAlgId()
public KeyIdentifier getAuthKeyId()
public AuthorityKeyIdentifierExtension getAuthKeyIdExtension()
public CRLNumberExtension getCRLNumberExtension()
public java.math.BigInteger getCRLNumber()
public DeltaCRLIndicatorExtension getDeltaCRLIndicatorExtension()
public java.math.BigInteger getBaseCRLNumber()
public IssuerAlternativeNameExtension getIssuerAltNameExtension()
public IssuingDistributionPointExtension getIssuingDistributionPointExtension()
public boolean hasUnsupportedCriticalExtension()
hasUnsupportedCriticalExtension in interface java.security.cert.X509Extensionpublic java.util.Set<java.lang.String> getCriticalExtensionOIDs()
getCriticalExtensionOIDs in interface java.security.cert.X509Extensionpublic java.util.Set<java.lang.String> getNonCriticalExtensionOIDs()
getNonCriticalExtensionOIDs in interface java.security.cert.X509Extensionpublic byte[] getExtensionValue(java.lang.String oid)
extnValue) identified by the passed in oid String.
The oid string is
represented by a set of positive whole number separated
by ".", that means,getExtensionValue in interface java.security.cert.X509Extensionoid - the Object Identifier value for the extension.public java.lang.Object getExtension(com.tencent.kona.sun.security.util.ObjectIdentifier oid)
oid - ObjectIdentifier of extension desired<extension> or null, if not foundpublic static javax.security.auth.x500.X500Principal getIssuerX500Principal(java.security.cert.X509CRL crl)
public static byte[] getEncodedInternal(java.security.cert.X509CRL crl)
throws java.security.cert.CRLException
java.security.cert.CRLExceptionpublic static X509CRLImpl toImpl(java.security.cert.X509CRL crl) throws java.security.cert.CRLException
java.security.cert.CRLExceptionpublic void encode(com.tencent.kona.sun.security.util.DerOutputStream out)
encode in interface com.tencent.kona.sun.security.util.DerEncoder