Top Fields Constructors Methods
io.netty5.handler.ssl.util

public final Class LazyJavaxX509Certificate

extends X509Certificate
Class Inheritance
Imports
javax.security.cert.CertificateException, .CertificateExpiredException, .CertificateNotYetValidException, .X509Certificate, java.math.BigInteger, java.security.InvalidKeyException, .NoSuchAlgorithmException, .NoSuchProviderException, .Principal, .PublicKey, .SignatureException, java.util.Date

Deprecated

as a consequence of X509Certificate being deprecated. See corresponding docs for further information.

Field Summary

Modifier and TypeField and Description
private final byte[]
private X509Certificate
wrapped

Deprecated as a consequence of X509Certificate being deprecated.

Constructor Summary

AccessConstructor and Description
public
LazyJavaxX509Certificate(byte[] bytes)

Creates a new instance which will lazy parse the given bytes.

Method Summary

Modifier and TypeMethod and Description
public void
checkValidity()

Implements abstract javax.security.cert.X509Certificate.checkValidity.

Checks that the certificate is currently valid.
public void
checkValidity(Date
the Date to check against to see if this certificate is valid at that date/time.
date
)

Implements abstract javax.security.cert.X509Certificate.checkValidity.

Checks that the specified date is within the certificate's validity period.
pack-priv byte[]
getBytes()

Return the underlying byte[] without cloning it first.

public byte[]
getEncoded()

Implements abstract javax.security.cert.Certificate.getEncoded.

Returns the encoded form of this certificate.
public Principal
getIssuerDN()

Implements abstract javax.security.cert.X509Certificate.getIssuerDN.

Gets the issuer (issuer distinguished name) value from the certificate.
public Date
getNotAfter()

Implements abstract javax.security.cert.X509Certificate.getNotAfter.

Gets the notAfter date from the validity period of the certificate.
public Date
getNotBefore()

Implements abstract javax.security.cert.X509Certificate.getNotBefore.

Gets the notBefore date from the validity period of the certificate.
public PublicKey
getPublicKey()

Implements abstract javax.security.cert.Certificate.getPublicKey.

Gets the public key from this certificate.
public BigInteger
getSerialNumber()

Implements abstract javax.security.cert.X509Certificate.getSerialNumber.

Gets the serialNumber value from the certificate.
public String
getSigAlgName()

Implements abstract javax.security.cert.X509Certificate.getSigAlgName.

Gets the signature algorithm name for the certificate signature algorithm.
public String
getSigAlgOID()

Implements abstract javax.security.cert.X509Certificate.getSigAlgOID.

Gets the signature algorithm OID string from the certificate.
public byte[]
getSigAlgParams()

Implements abstract javax.security.cert.X509Certificate.getSigAlgParams.

Gets the DER-encoded signature algorithm parameters from this certificate's signature algorithm.
public Principal
getSubjectDN()

Implements abstract javax.security.cert.X509Certificate.getSubjectDN.

Gets the subject (subject distinguished name) value from the certificate.
public int
getVersion()

Implements abstract javax.security.cert.X509Certificate.getVersion.

Gets the version (version number) value from the certificate.
public String
toString()

Implements abstract javax.security.cert.Certificate.toString.

Returns a string representation of this certificate.
private X509Certificate
unwrap()

Deprecated as a consequence of X509Certificate being deprecated.
public void
verify(PublicKey
the PublicKey used to carry out the verification.
key
)

Implements abstract javax.security.cert.Certificate.verify.

Verifies that this certificate was signed using the private key that corresponds to the specified public key.
public void
verify(PublicKey
the PublicKey used to carry out the verification.
key
,
String
the name of the signature provider.
sigProvider
)

Implements abstract javax.security.cert.Certificate.verify.

Verifies that this certificate was signed using the private key that corresponds to the specified public key.
Inherited from javax.security.cert.X509Certificate:
getInstancegetInstance

Field Detail

bytesback to summary
private final byte[] bytes
wrappedback to summary
private X509Certificate wrapped

Deprecated

as a consequence of X509Certificate being deprecated. See corresponding docs for further information.

Constructor Detail

LazyJavaxX509Certificateback to summary
public LazyJavaxX509Certificate(byte[] bytes)

Creates a new instance which will lazy parse the given bytes. Be aware that the bytes will not be cloned.

Method Detail

checkValidityback to summary
public void checkValidity() throws CertificateExpiredException, CertificateNotYetValidException

Implements abstract javax.security.cert.X509Certificate.checkValidity.

Doc from javax.security.cert.X509Certificate.checkValidity.

Checks that the certificate is currently valid. It is if the current date and time are within the validity period given in the certificate.

The validity period consists of two date/time values: the first and last dates (and times) on which the certificate is valid. It is defined in ASN.1 as:

validity             Validity

Validity ::= SEQUENCE {
    notBefore      CertificateValidityDate,
    notAfter       CertificateValidityDate }

CertificateValidityDate ::= CHOICE {
    utcTime        UTCTime,
    generalTime    GeneralizedTime }
Annotations
@Override
Exceptions
CertificateExpiredException:
if the certificate has expired.
CertificateNotYetValidException:
if the certificate is not yet valid.
checkValidityback to summary
public void checkValidity(Date date) throws CertificateExpiredException, CertificateNotYetValidException

Implements abstract javax.security.cert.X509Certificate.checkValidity.

Doc from javax.security.cert.X509Certificate.checkValidity.

Checks that the specified date is within the certificate's validity period. In other words, this determines whether the certificate would be valid at the specified date/time.

Parameters
date:Date

the Date to check against to see if this certificate is valid at that date/time.

Annotations
@Override
Exceptions
CertificateExpiredException:
if the certificate has expired with respect to the date supplied.
CertificateNotYetValidException:
if the certificate is not yet valid with respect to the date supplied.
getBytesback to summary
pack-priv byte[] getBytes()

Return the underlying byte[] without cloning it first. This byte[] must never be mutated.

Annotations
@SuppressWarnings:AssignmentOrReturnOfFieldWithMutableType
getEncodedback to summary
public byte[] getEncoded()

Implements abstract javax.security.cert.Certificate.getEncoded.

Doc from javax.security.cert.Certificate.getEncoded.

Returns the encoded form of this certificate. It is assumed that each certificate type would have only a single form of encoding; for example, X.509 certificates would be encoded as ASN.1 DER.

Returns:byte[]

encoded form of this certificate

Annotations
@Override
getIssuerDNback to summary
public Principal getIssuerDN()

Implements abstract javax.security.cert.X509Certificate.getIssuerDN.

Doc from javax.security.cert.X509Certificate.getIssuerDN.

Gets the issuer (issuer distinguished name) value from the certificate. The issuer name identifies the entity that signed (and issued) the certificate.

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 AttributeValue component is determined by the AttributeType; in general it will be a directoryString. A directoryString is usually one of PrintableString, TeletexString or UniversalString.
Returns:Principal

a Principal whose name is the issuer distinguished name.

Annotations
@Override
getNotAfterback to summary
public Date getNotAfter()

Implements abstract javax.security.cert.X509Certificate.getNotAfter.

Doc from javax.security.cert.X509Certificate.getNotAfter.

Gets the notAfter date from the validity period of the certificate. See getNotBefore for relevant ASN.1 definitions.

Returns:Date

the end date of the validity period.

Annotations
@Override
getNotBeforeback to summary
public Date getNotBefore()

Implements abstract javax.security.cert.X509Certificate.getNotBefore.

Doc from javax.security.cert.X509Certificate.getNotBefore.

Gets the notBefore date from the validity period of the certificate. The relevant ASN.1 definitions are:

validity             Validity

Validity ::= SEQUENCE {
    notBefore      CertificateValidityDate,
    notAfter       CertificateValidityDate }

CertificateValidityDate ::= CHOICE {
    utcTime        UTCTime,
    generalTime    GeneralizedTime }
Returns:Date

the start date of the validity period.

Annotations
@Override
getPublicKeyback to summary
public PublicKey getPublicKey()

Implements abstract javax.security.cert.Certificate.getPublicKey.

Doc from javax.security.cert.Certificate.getPublicKey.

Gets the public key from this certificate.

Returns:PublicKey

the public key.

Annotations
@Override
getSerialNumberback to summary
public BigInteger getSerialNumber()

Implements abstract javax.security.cert.X509Certificate.getSerialNumber.

Doc from javax.security.cert.X509Certificate.getSerialNumber.

Gets the serialNumber value from the certificate. The serial number is an integer assigned by the certification authority to each certificate. It must be unique for each certificate issued by a given CA (i.e., the issuer name and serial number identify a unique certificate). The ASN.1 definition for this is:

serialNumber     CertificateSerialNumber

CertificateSerialNumber  ::=  INTEGER
Returns:BigInteger

the serial number.

Annotations
@Override
getSigAlgNameback to summary
public String getSigAlgName()

Implements abstract javax.security.cert.X509Certificate.getSigAlgName.

Doc from javax.security.cert.X509Certificate.getSigAlgName.

Gets the signature algorithm name for the certificate signature algorithm. An example is the string "SHA-1/DSA". The ASN.1 definition for this is:

signatureAlgorithm   AlgorithmIdentifier

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

The algorithm name is determined from the algorithm OID string.

Returns:String

the signature algorithm name.

Annotations
@Override
getSigAlgOIDback to summary
public String getSigAlgOID()

Implements abstract javax.security.cert.X509Certificate.getSigAlgOID.

Doc from javax.security.cert.X509Certificate.getSigAlgOID.

Gets the signature algorithm OID string from the certificate. An OID is represented by a set of positive whole numbers separated by periods. For example, the string "1.2.840.10040.4.3" identifies the SHA-1 with DSA signature algorithm, as per the PKIX part I.

See getSigAlgName for relevant ASN.1 definitions.

Returns:String

the signature algorithm OID string.

Annotations
@Override
getSigAlgParamsback to summary
public byte[] getSigAlgParams()

Implements abstract javax.security.cert.X509Certificate.getSigAlgParams.

Doc from javax.security.cert.X509Certificate.getSigAlgParams.

Gets the DER-encoded signature algorithm parameters from this certificate's signature algorithm. In most cases, the signature algorithm parameters are null; the parameters are usually supplied with the certificate's public key.

See getSigAlgName for relevant ASN.1 definitions.

Returns:byte[]

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

Annotations
@Override
getSubjectDNback to summary
public Principal getSubjectDN()

Implements abstract javax.security.cert.X509Certificate.getSubjectDN.

Doc from javax.security.cert.X509Certificate.getSubjectDN.

Gets the subject (subject distinguished name) value from the certificate. The ASN.1 definition for this is:

subject    Name

See getIssuerDN for Name and other relevant definitions.

Returns:Principal

a Principal whose name is the subject name.

Annotations
@Override
getVersionback to summary
public int getVersion()

Implements abstract javax.security.cert.X509Certificate.getVersion.

Doc from javax.security.cert.X509Certificate.getVersion.

Gets the version (version number) value from the certificate. The ASN.1 definition for this is:

version         [0]  EXPLICIT Version DEFAULT v1

Version  ::=  INTEGER  {  v1(0), v2(1), v3(2)  }
Returns:int

the version number from the ASN.1 encoding, i.e. 0, 1 or 2.

Annotations
@Override
toStringback to summary
public String toString()

Implements abstract javax.security.cert.Certificate.toString.

Doc from javax.security.cert.Certificate.toString.

Returns a string representation of this certificate.

Returns:String

a string representation of this certificate.

Annotations
@Override
unwrapback to summary
private X509Certificate unwrap()

Deprecated

as a consequence of X509Certificate being deprecated. See corresponding docs for further information.

verifyback to summary
public void verify(PublicKey key) throws CertificateException, NoSuchAlgorithmException, InvalidKeyException, NoSuchProviderException, SignatureException

Implements abstract javax.security.cert.Certificate.verify.

Doc from javax.security.cert.Certificate.verify.

Verifies that this certificate was signed using the private key that corresponds to the specified public key.

Parameters
key:PublicKey

the PublicKey used to carry out the verification.

Annotations
@Override
Exceptions
CertificateException:
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 void verify(PublicKey key, String sigProvider) throws CertificateException, NoSuchAlgorithmException, InvalidKeyException, NoSuchProviderException, SignatureException

Implements abstract javax.security.cert.Certificate.verify.

Doc from javax.security.cert.Certificate.verify.

Verifies that this certificate was signed using the private key that corresponds to the specified public key. This method uses the signature verification engine supplied by the specified provider.

Parameters
key:PublicKey

the PublicKey used to carry out the verification.

sigProvider:String

the name of the signature provider.

Annotations
@Override
Exceptions
CertificateException:
on encoding errors.
NoSuchAlgorithmException:
on unsupported signature algorithms.
InvalidKeyException:
on incorrect key.
NoSuchProviderException:
on incorrect provider.
SignatureException:
on signature errors.