Class OpenSSLX509CRL
- All Implemented Interfaces:
X509Extension
public class OpenSSLX509CRL extends X509CRL
-
Method Summary
Modifier and Type Method Description protected voidfinalize()Invoked when the garbage collector has detected that this instance is no longer reachable.static List<OpenSSLX509CRL>fromPkcs7DerInputStream(InputStream is)static List<OpenSSLX509CRL>fromPkcs7PemInputStream(InputStream is)static OpenSSLX509CRLfromX509DerInputStream(InputStream is)static OpenSSLX509CRLfromX509PemInputStream(InputStream is)Set<String>getCriticalExtensionOIDs()Returns the set of OIDs of the extension(s) marked as CRITICAL, that this implementation manages.byte[]getEncoded()Returns this CRL in ASN.1 DER encoded form.byte[]getExtensionValue(String oid)Returns the extension value as DER-encoded OCTET string for the specified OID.PrincipalgetIssuerDN()Do not use, useX509CRL.getIssuerX500Principal()instead.X500PrincipalgetIssuerX500Principal()Returns the issuer distinguished name of this CRL.DategetNextUpdate()Returns thenextUpdatevalue of this CRL.Set<String>getNonCriticalExtensionOIDs()Returns the set of OIDs of the extension(s) marked as NON-CRITICAL, that this implementation manages.X509CRLEntrygetRevokedCertificate(BigInteger serialNumber)Returns the CRL entry with the specified certificate serial number.X509CRLEntrygetRevokedCertificate(X509Certificate certificate)Returns the CRL entry for the specified certificate.Set<? extends X509CRLEntry>getRevokedCertificates()Returns the set of revoked certificates.StringgetSigAlgName()Returns the name of the signature algorithm.StringgetSigAlgOID()Returns the OID of the signature algorithm.byte[]getSigAlgParams()Returns the parameters of the signature algorithm in DER encoded form.byte[]getSignature()Returns the signature bytes of this CRL.byte[]getTBSCertList()Returns thetbsCertListinformation of this CRL in DER encoded form.DategetThisUpdate()Returns thethisUpdatevalue of this CRL.intgetVersion()Returns the version number of this CRL.booleanhasUnsupportedCriticalExtension()Returns whether this instance has an extension marked as CRITICAL that it cannot support.booleanisRevoked(Certificate cert)Returns whether the specified certificate is revoked by this CRL.StringtoString()Returns the string representation of this instance.voidverify(PublicKey key)Verifies this CRL by verifying that this CRL was signed with the corresponding private key to the specified public key.voidverify(PublicKey key, String sigProvider)Verifies this CRL by verifying that this CRL was signed with the corresponding private key to the specified public key.
-
Method Details
-
fromX509DerInputStream
public static OpenSSLX509CRL fromX509DerInputStream(InputStream is) throws org.conscrypt.OpenSSLX509CertificateFactory.ParsingException- Throws:
org.conscrypt.OpenSSLX509CertificateFactory.ParsingException
-
fromPkcs7DerInputStream
public static List<OpenSSLX509CRL> fromPkcs7DerInputStream(InputStream is) throws org.conscrypt.OpenSSLX509CertificateFactory.ParsingException- Throws:
org.conscrypt.OpenSSLX509CertificateFactory.ParsingException
-
fromX509PemInputStream
public static OpenSSLX509CRL fromX509PemInputStream(InputStream is) throws org.conscrypt.OpenSSLX509CertificateFactory.ParsingException- Throws:
org.conscrypt.OpenSSLX509CertificateFactory.ParsingException
-
fromPkcs7PemInputStream
public static List<OpenSSLX509CRL> fromPkcs7PemInputStream(InputStream is) throws org.conscrypt.OpenSSLX509CertificateFactory.ParsingException- Throws:
org.conscrypt.OpenSSLX509CertificateFactory.ParsingException
-
getCriticalExtensionOIDs
Description copied from interface:X509ExtensionReturns the set of OIDs of the extension(s) marked as CRITICAL, that this implementation manages.- Returns:
- the set of extension OIDs marked as CRITIAL, an empty set if none
are marked as CRITICAL, or
nullif no extensions are present.
-
getExtensionValue
Description copied from interface:X509ExtensionReturns the extension value as DER-encoded OCTET string for the specified OID.- Parameters:
oid- the object identifier to get the extension value for.- Returns:
- the extension value as DER-encoded OCTET string, or
nullif no extension for the specified OID can be found.
-
getNonCriticalExtensionOIDs
Description copied from interface:X509ExtensionReturns the set of OIDs of the extension(s) marked as NON-CRITICAL, that this implementation manages.- Returns:
- the set of extension OIDs marked as NON-CRITIAL, an empty set if
none are marked as NON-.CRITICAL, or
nullif no extensions are present.
-
hasUnsupportedCriticalExtension
public boolean hasUnsupportedCriticalExtension()Description copied from interface:X509ExtensionReturns whether this instance has an extension marked as CRITICAL that it cannot support.- Returns:
trueif an unsupported CRITICAL extension is present,falseotherwise.
-
getEncoded
Description copied from class:X509CRLReturns this CRL in ASN.1 DER encoded form.- Specified by:
getEncodedin classX509CRL- Returns:
- this CRL in ASN.1 DER encoded form.
- Throws:
CRLException- if encoding fails.
-
verify
public void verify(PublicKey key) throws CRLException, NoSuchAlgorithmException, InvalidKeyException, NoSuchProviderException, SignatureExceptionDescription copied from class:X509CRLVerifies this CRL by verifying that this CRL was signed with the corresponding private key to the specified public key.- Specified by:
verifyin classX509CRL- Parameters:
key- the public key to verify this CRL with.- Throws:
CRLException- if encoding or decoding fails.NoSuchAlgorithmException- if a needed algorithm is not present.InvalidKeyException- if the specified key is invalid.NoSuchProviderException- if no provider can be found.SignatureException- if errors occur on signatures.
-
verify
public void verify(PublicKey key, String sigProvider) throws CRLException, NoSuchAlgorithmException, InvalidKeyException, NoSuchProviderException, SignatureExceptionDescription copied from class:X509CRLVerifies this CRL by verifying that this CRL was signed with the corresponding private key to the specified public key. The signature verification engine of the specified provider will be used.- Specified by:
verifyin classX509CRL- Parameters:
key- the public key to verify this CRL with.sigProvider- the name of the provider for the signature algorithm.- Throws:
CRLException- if encoding decoding fails.NoSuchAlgorithmException- if a needed algorithm is not present.InvalidKeyException- if the specified key is invalid.NoSuchProviderException- if the specified provider cannot be found.SignatureException- if errors occur on signatures.
-
getVersion
public int getVersion()Description copied from class:X509CRLReturns the version number of this CRL.- Specified by:
getVersionin classX509CRL- Returns:
- the version number of this CRL.
-
getIssuerDN
Description copied from class:X509CRLDo not use, useX509CRL.getIssuerX500Principal()instead. Returns the issuer as an implementation specific Principal object.- Specified by:
getIssuerDNin classX509CRL- Returns:
- the issuer distinguished name.
-
getIssuerX500Principal
Description copied from class:X509CRLReturns the issuer distinguished name of this CRL.- Overrides:
getIssuerX500Principalin classX509CRL- Returns:
- the issuer distinguished name of this CRL.
-
getThisUpdate
Description copied from class:X509CRLReturns thethisUpdatevalue of this CRL.- Specified by:
getThisUpdatein classX509CRL- Returns:
- the
thisUpdatevalue of this CRL.
-
getNextUpdate
Description copied from class:X509CRLReturns thenextUpdatevalue of this CRL.- Specified by:
getNextUpdatein classX509CRL- Returns:
- the
nextUpdatevalue of this CRL, ornullif none is present.
-
getRevokedCertificate
Description copied from class:X509CRLReturns the CRL entry with the specified certificate serial number.- Specified by:
getRevokedCertificatein classX509CRL- Parameters:
serialNumber- the certificate serial number to search for a CRL entry.- Returns:
- the entry for the specified certificate serial number, or
nullif not found.
-
getRevokedCertificate
Description copied from class:X509CRLReturns the CRL entry for the specified certificate.- Overrides:
getRevokedCertificatein classX509CRL- Parameters:
certificate- the certificate to search a CRL entry for.- Returns:
- the entry for the specified certificate, or
nullif not found.
-
getRevokedCertificates
Description copied from class:X509CRLReturns the set of revoked certificates.- Specified by:
getRevokedCertificatesin classX509CRL- Returns:
- the set of revoked certificates, or
nullif no revoked certificates are in this CRL.
-
getTBSCertList
Description copied from class:X509CRLReturns thetbsCertListinformation of this CRL in DER encoded form.- Specified by:
getTBSCertListin classX509CRL- Returns:
- the CRL information in DER encoded form.
- Throws:
CRLException- if encoding fails.
-
getSignature
public byte[] getSignature()Description copied from class:X509CRLReturns the signature bytes of this CRL.- Specified by:
getSignaturein classX509CRL- Returns:
- the signature bytes of this CRL.
-
getSigAlgName
Description copied from class:X509CRLReturns the name of the signature algorithm.- Specified by:
getSigAlgNamein classX509CRL- Returns:
- the name of the signature algorithm.
-
getSigAlgOID
Description copied from class:X509CRLReturns the OID of the signature algorithm.- Specified by:
getSigAlgOIDin classX509CRL- Returns:
- the OID of the signature algorithm.
-
getSigAlgParams
public byte[] getSigAlgParams()Description copied from class:X509CRLReturns the parameters of the signature algorithm in DER encoded form.- Specified by:
getSigAlgParamsin classX509CRL- Returns:
- the parameters of the signature algorithm in DER encoded form, or
nullif not present.
-
isRevoked
Description copied from class:CRLReturns whether the specified certificate is revoked by this CRL. -
toString
Description copied from class:CRLReturns the string representation of this instance. -
finalize
Description copied from class:ObjectInvoked when the garbage collector has detected that this instance is no longer reachable. The default implementation does nothing, but this method can be overridden to free resources.Note that objects that override
finalizeare significantly more expensive than objects that don't. Finalizers may be run a long time after the object is no longer reachable, depending on memory pressure, so it's a bad idea to rely on them for cleanup. Note also that finalizers are run on a single VM-wide finalizer thread, so doing blocking work in a finalizer is a bad idea. A finalizer is usually only necessary for a class that has a native peer and needs to call a native method to destroy that peer. Even then, it's better to provide an explicitclosemethod (and implementCloseable), and insist that callers manually dispose of instances. This works well for something like files, but less well for something like aBigIntegerwhere typical calling code would have to deal with lots of temporaries. Unfortunately, code that creates lots of temporaries is the worst kind of code from the point of view of the single finalizer thread.If you must use finalizers, consider at least providing your own
ReferenceQueueand having your own thread process that queue.Unlike constructors, finalizers are not automatically chained. You are responsible for calling
super.finalize()yourself.Uncaught exceptions thrown by finalizers are ignored and do not terminate the finalizer thread. See Effective Java Item 7, "Avoid finalizers" for more.
-