Deprecated
Do not use this class directly - either use org.bouncycastle.cert (bcpkix) or CertificateFactory.
| Modifier and Type | Field and Description |
|---|---|
| private PKCS12BagAttributeCarrier | |
| private BasicConstraints | |
| private Certificate | |
| private int | |
| private boolean | |
| private boolean[] |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private int | |
| private void | |
| public void | checkValidity()
Implements abstract java. |
| public void | checkValidity(Date
the Date to check against to see if this certificate
is valid at that date/time. date)Implements abstract java. |
| public boolean | equals(Object
the object to test for equality with this certificate. o)Overrides java. |
| private static Collection | |
| public ASN1Encodable | |
| public Enumeration | |
| public int | getBasicConstraints()
Implements abstract java. BasicConstraints extension, (OID = 2.5.29.19).
|
| public Set | getCriticalExtensionOIDs()
Implements java. |
| public byte[] | getEncoded()
Implements abstract java. |
| public List | getExtendedKeyUsage()
Overrides java. ExtKeyUsageSyntax field of the
extended key usage extension, (OID = 2.5.29.37).
|
| private byte[] | |
| public byte[] | getExtensionValue(String
the Object Identifier value for the extension. oid)Implements java. oid
String.
|
| public Collection | getIssuerAlternativeNames()
Overrides java. IssuerAltName extension, (OID = 2.5.29.18).
|
| public Principal | getIssuerDN()
Implements abstract java. issuer (issuer distinguished name) value from
the certificate.
|
| public boolean[] | getIssuerUniqueID()
Implements abstract java. issuerUniqueID value from the certificate.
|
| public X500Principal | getIssuerX500Principal()
Overrides java. X500Principal.
|
| public boolean[] | getKeyUsage()
Implements abstract java. KeyUsage extension, (OID = 2.5.29.15).
|
| public Set | getNonCriticalExtensionOIDs()
Implements java. |
| public Date | getNotAfter()
Implements abstract java. notAfter date from the validity period of
the certificate.
|
| public Date | getNotBefore()
Implements abstract java. notBefore date from the validity period of
the certificate.
|
| public PublicKey | getPublicKey()
Implements abstract java. |
| public BigInteger | getSerialNumber()
Implements abstract java. serialNumber value from the certificate.
|
| public String | getSigAlgName()
Implements abstract java. |
| public String | getSigAlgOID()
Implements abstract java. |
| public byte[] | getSigAlgParams()
Implements abstract java. |
| public byte[] | getSignature()
Implements abstract java. signature value (the raw signature bits) from
the certificate.
|
| public Collection | getSubjectAlternativeNames()
Overrides java. SubjectAltName extension, (OID = 2.5.29.17).
|
| public Principal | getSubjectDN()
Implements abstract java. subject (subject distinguished name) value
from the certificate.
|
| public boolean[] | getSubjectUniqueID()
Implements abstract java. subjectUniqueID value from the certificate.
|
| public X500Principal | getSubjectX500Principal()
Overrides java. X500Principal.
|
| public byte[] | getTBSCertificate()
Implements abstract java. tbsCertificate from this certificate.
|
| public int | getVersion()
Implements abstract java. version (version number) value from the
certificate.
|
| public synchronized int | hashCode()
Overrides java. |
| public boolean | hasUnsupportedCriticalExtension()
Implements java. |
| private boolean | |
| public void | |
| public String | toString()
Implements abstract java. |
| public final void | verify(PublicKey
the PublicKey used to carry out the verification. key)Implements abstract java. |
| public final void | verify(PublicKey
the PublicKey used to carry out the verification. key, String the name of the signature provider. sigProvider)Implements abstract java. |
| public final void | verify(PublicKey
the PublicKey used to carry out the verification. key, Provider the signature provider. sigProvider)Overrides java. |
| attrCarrier | back to summary |
|---|---|
| private PKCS12BagAttributeCarrier attrCarrier | |
| basicConstraints | back to summary |
|---|---|
| private BasicConstraints basicConstraints | |
| c | back to summary |
|---|---|
| private Certificate c | |
| hashValue | back to summary |
|---|---|
| private int hashValue | |
| hashValueSet | back to summary |
|---|---|
| private boolean hashValueSet | |
| keyUsage | back to summary |
|---|---|
| private boolean[] keyUsage | |
| X509CertificateObject | back to summary |
|---|---|
| public X509CertificateObject(Certificate c) throws CertificateParsingException | |
| calculateHashCode | back to summary |
|---|---|
| private int calculateHashCode() | |
| checkSignature | back to summary |
|---|---|
| private void checkSignature(PublicKey key, Signature signature) throws CertificateException, NoSuchAlgorithmException, SignatureException, InvalidKeyException | |
| checkValidity | back to summary |
|---|---|
| public void checkValidity() throws CertificateExpiredException, CertificateNotYetValidException Implements abstract java. Doc from java. 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 }
| |
| checkValidity | back to summary |
|---|---|
| public void checkValidity(Date date) throws CertificateExpiredException, CertificateNotYetValidException Implements abstract java. Doc from java. Checks that the given date is within the certificate's validity period. In other words, this determines whether the certificate would be valid at the given date/time.
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object o) Overrides java. Doc from java. Compares this certificate for equality with the specified
object. If the
| |
| getAlternativeNames | back to summary |
|---|---|
| private static Collection | |
| getBagAttribute | back to summary |
|---|---|
| public ASN1Encodable getBagAttribute(ASN1ObjectIdentifier oid) Implements org. | |
| getBagAttributeKeys | back to summary |
|---|---|
| public Enumeration Implements org. | |
| getBasicConstraints | back to summary |
|---|---|
| public int getBasicConstraints() Implements abstract java. Doc from java. Gets the certificate constraints path length from the
critical
The basic constraints extension identifies whether the subject
of the certificate is a Certificate Authority (CA) and
how deep a certification path may exist through that CA. The
The ASN.1 definition for this is:
BasicConstraints ::= SEQUENCE {
cA BOOLEAN DEFAULT FALSE,
pathLenConstraint INTEGER (0..MAX) OPTIONAL }
| |
| getCriticalExtensionOIDs | back to summary |
|---|---|
| public Set Implements java. Doc from java. Gets a Set of the OID strings for the extension(s) marked CRITICAL in the certificate/CRL managed by the object implementing this interface. Here is sample code to get a Set of critical extensions from an X509Certificate and print the OIDs:
| |
| getEncoded | back to summary |
|---|---|
| public byte[] getEncoded() throws CertificateEncodingException Implements abstract java. Doc from java. 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.
| |
| getExtendedKeyUsage | back to summary |
|---|---|
| public List Overrides java. Doc from java. Gets an unmodifiable list of Strings representing the OBJECT
IDENTIFIERs of the ExtKeyUsageSyntax ::= SEQUENCE SIZE (1..MAX) OF KeyPurposeId KeyPurposeId ::= OBJECT IDENTIFIERKey purposes may be defined by any organization with a need. Object identifiers used to identify key purposes shall be assigned in accordance with IANA or ITU-T Rec. X.660 | ISO/IEC/ITU 9834-1.
This method was added to version 1.4 of the Java 2 Platform Standard
Edition. In order to maintain backwards compatibility with existing
service providers, this method is not
| |
| getExtensionBytes | back to summary |
|---|---|
| private byte[] getExtensionBytes(String oid) | |
| getExtensionValue | back to summary | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| public byte[] getExtensionValue(String oid) Implements java. Doc from java. Gets the DER-encoded OCTET string for the extension value
(extnValue) identified by the passed-in For example:
| |||||||||||||||||||||||
| getIssuerAlternativeNames | back to summary |
|---|---|
| public Collection Overrides java. Doc from java. Gets an immutable collection of issuer alternative names from the
The ASN.1 definition of the IssuerAltName ::= GeneralNamesThe ASN.1 definition of GeneralNames is defined
in getSubjectAlternativeNames.
If this certificate does not contain an
Note that the
This method was added to version 1.4 of the Java 2 Platform Standard
Edition. In order to maintain backwards compatibility with existing
service providers, this method is not
| |
| getIssuerDN | back to summary |
|---|---|
| public Principal getIssuerDN() Implements abstract java. Doc from java. Gets the 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.
| |
| getIssuerUniqueID | back to summary |
|---|---|
| public boolean[] getIssuerUniqueID() Implements abstract java. Doc from java. Gets the The ASN.1 definition for this is: issuerUniqueID [1] IMPLICIT UniqueIdentifier OPTIONAL UniqueIdentifier ::= BIT STRING
| |
| getIssuerX500Principal | back to summary |
|---|---|
| public X500Principal getIssuerX500Principal() Overrides java. Doc from java. Returns the issuer (issuer distinguished name) value from the
certificate as an It is recommended that subclasses override this method.
| |
| getKeyUsage | back to summary |
|---|---|
| public boolean[] getKeyUsage() Implements abstract java. Doc from java. Gets a boolean array representing bits of
the
KeyUsage ::= BIT STRING {
digitalSignature (0),
nonRepudiation (1),
keyEncipherment (2),
dataEncipherment (3),
keyAgreement (4),
keyCertSign (5),
cRLSign (6),
encipherOnly (7),
decipherOnly (8) }
RFC 5280 recommends that when used, this be marked
as a critical extension.
| |
| getNonCriticalExtensionOIDs | back to summary |
|---|---|
| public Set Implements java. Doc from java. Gets a Set of the OID strings for the extension(s) marked NON-CRITICAL in the certificate/CRL managed by the object implementing this interface. Here is sample code to get a Set of non-critical extensions from an X509CRL revoked certificate entry and print the OIDs:
| |
| getNotAfter | back to summary |
|---|---|
| public Date getNotAfter() Implements abstract java. Doc from java. Gets the
| |
| getNotBefore | back to summary |
|---|---|
| public Date getNotBefore() Implements abstract java. Doc from java. Gets the
validity Validity
Validity ::= SEQUENCE {
notBefore CertificateValidityDate,
notAfter CertificateValidityDate }
CertificateValidityDate ::= CHOICE {
utcTime UTCTime,
generalTime GeneralizedTime }
| |
| getPublicKey | back to summary |
|---|---|
| public PublicKey getPublicKey() Implements abstract java. Doc from java. Gets the public key from this certificate.
| |
| getSerialNumber | back to summary |
|---|---|
| public BigInteger getSerialNumber() Implements abstract java. Doc from java. Gets the serialNumber CertificateSerialNumber CertificateSerialNumber ::= INTEGER
| |
| getSigAlgName | back to summary |
|---|---|
| public String getSigAlgName() Implements abstract java. return a more "meaningful" representation for the signature algorithm used in the certficate.
| |
| getSigAlgOID | back to summary |
|---|---|
| public String getSigAlgOID() Implements abstract java. return the object identifier for the signature.
| |
| getSigAlgParams | back to summary |
|---|---|
| public byte[] getSigAlgParams() Implements abstract java. return the signature parameters, or null if there aren't any.
| |
| getSignature | back to summary |
|---|---|
| public byte[] getSignature() Implements abstract java. Doc from java. Gets the signature BIT STRING
| |
| getSubjectAlternativeNames | back to summary |
|---|---|
| public Collection Overrides java. Doc from java. Gets an immutable collection of subject alternative names from the
The ASN.1 definition of the
SubjectAltName ::= GeneralNames
GeneralNames :: = SEQUENCE SIZE (1..MAX) OF GeneralName
GeneralName ::= CHOICE {
otherName [0] OtherName,
rfc822Name [1] IA5String,
dNSName [2] IA5String,
x400Address [3] ORAddress,
directoryName [4] Name,
ediPartyName [5] EDIPartyName,
uniformResourceIdentifier [6] IA5String,
iPAddress [7] OCTET STRING,
registeredID [8] OBJECT IDENTIFIER}
OtherName ::= SEQUENCE {
type-id OBJECT IDENTIFIER,
value [0] EXPLICIT ANY DEFINED BY type-id }
If this certificate does not contain a
RFC 822, DNS, and URI
names are returned as
Note that the
This method was added to version 1.4 of the Java 2 Platform Standard
Edition. In order to maintain backwards compatibility with existing
service providers, this method is not
| |
| getSubjectDN | back to summary |
|---|---|
| public Principal getSubjectDN() Implements abstract java. Doc from java. Gets the The ASN.1 definition for this is: subject Name See
| |
| getSubjectUniqueID | back to summary |
|---|---|
| public boolean[] getSubjectUniqueID() Implements abstract java. Doc from java. Gets the The ASN.1 definition for this is: subjectUniqueID [2] IMPLICIT UniqueIdentifier OPTIONAL UniqueIdentifier ::= BIT STRING
| |
| getSubjectX500Principal | back to summary |
|---|---|
| public X500Principal getSubjectX500Principal() Overrides java. Doc from java. Returns the subject (subject distinguished name) value from the
certificate as an It is recommended that subclasses override this method.
| |
| getTBSCertificate | back to summary |
|---|---|
| public byte[] getTBSCertificate() throws CertificateEncodingException Implements abstract java. Doc from java. Gets the DER-encoded certificate information, the
| |
| getVersion | back to summary |
|---|---|
| public int getVersion() Implements abstract java. Doc from java. Gets the
version [0] EXPLICIT Version DEFAULT v1
Version ::= INTEGER { v1(0), v2(1), v3(2) }
| |
| hashCode | back to summary |
|---|---|
| public synchronized int hashCode() Overrides java. Doc from java. Returns a hashcode value for this certificate from its encoded form.
| |
| hasUnsupportedCriticalExtension | back to summary |
|---|---|
| public boolean hasUnsupportedCriticalExtension() Implements java. Doc from java. Check if there is a critical extension that is not supported.
| |
| isAlgIdEqual | back to summary |
|---|---|
| private boolean isAlgIdEqual(AlgorithmIdentifier id1, AlgorithmIdentifier id2) | |
| setBagAttribute | back to summary |
|---|---|
| public void setBagAttribute(ASN1ObjectIdentifier oid, ASN1Encodable attribute) Implements org. | |
| toString | back to summary |
|---|---|
| public String toString() Implements abstract java. Doc from java. Returns a string representation of this certificate.
| |
| verify | back to summary |
|---|---|
| public final void verify(PublicKey key) throws CertificateException, NoSuchAlgorithmException, InvalidKeyException, NoSuchProviderException, SignatureException Implements abstract java. Doc from java. Verifies that this certificate was signed using the private key that corresponds to the specified public key.
| |
| verify | back to summary |
|---|---|
| public final void verify(PublicKey key, String sigProvider) throws CertificateException, NoSuchAlgorithmException, InvalidKeyException, NoSuchProviderException, SignatureException Implements abstract java. Doc from java. 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.
| |
| verify | back to summary |
|---|---|
| public final void verify(PublicKey key, Provider sigProvider) throws CertificateException, NoSuchAlgorithmException, InvalidKeyException, SignatureException Overrides java. Doc from java. 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. Note that the specified
Provider object does not have to be registered in the provider list.
This method was added to version 1.8 of the Java Platform Standard
Edition. In order to maintain backwards compatibility with existing
service providers, this method is not
| |