These certificates are managed and vouched for by Certificate Authorities (CAs). CAs are services which create certificates by placing data in the X.509 standard format and then digitally signing that data. Such signatures are quite difficult to forge. CAs act as trusted third parties, making introductions between agents who have no direct knowledge of each other. CA certificates are either signed by themselves, or by some other CA such as a "root" CA.
Standards relating to X.509 Public Key Infrastructure for the Internet can be referenced in RFC 5280.
X509CertInfo
| Modifier and Type | Field and Description |
|---|---|
| protected AlgorithmId | |
| private Set | |
| private List | |
| private final ConcurrentHashMap | |
| protected X509CertInfo | |
| private Collection | |
| public static final String | |
| private static final int | |
| private static final long | |
| protected byte[] | |
| private byte[] | |
| private Collection | |
| private boolean | verificationResult
If verifiedPublicKey is not null, result of the verification using verifiedPublicKey and verifiedProvider. |
| private String | verifiedProvider
If verifiedPublicKey is not null, name of the provider used to successfully verify the signature of this certificate, or the empty String if no provider was explicitly specified. |
| private PublicKey | verifiedPublicKey
PublicKey that has previously been used to verify the signature of this certificate. |
| Access | Constructor and Description |
|---|---|
| public | X509CertImpl(X509CertInfo info, AlgorithmId algId, byte[] signature, byte[] signedCert)
Constructor simply setting all (non-cache) fields. |
| public | X509CertImpl(byte[]
the encoded bytes, with no trailing padding. certData)Unmarshals a certificate from its encoded form, parsing the encoded bytes. |
| public | X509CertImpl(DerValue
the der value containing the encoded cert. derVal)Unmarshals a certificate from its encoded form, parsing a DER value. |
| public | X509CertImpl(InputStream
an input stream holding at least one certificate that may
be either DER-encoded or RFC1421 hex-encoded version of the
DER-encoded certificate. in)Unmarshals an X.509 certificate from an input stream. |
| Modifier and Type | Method and Description |
|---|---|
| public void | checkValidity()
Implements abstract java. Checks that the certificate is currently valid, i.e. the current time is within the specified validity period. |
| public void | checkValidity(Date
the Date to check against to see if this certificate
is valid at that date/time. date)Implements abstract java. Checks that the specified date is within the certificate's validity period, or basically if the certificate would be valid at the specified date/time. |
| private static Collection | cloneAltNames(Collection<List<?>> altNames)
Checks a Collection of altNames and clones any name entries of type byte []. |
| public void | encode(DerOutputStream
the output stream on which to write the DER encoding. out)Implements sun. DER encode this object onto an output stream. |
| public KeyIdentifier | |
| public AuthorityInfoAccessExtension | |
| public AuthorityKeyIdentifierExtension | Returns: AuthorityKeyIdentifier object or null (if no such object in certificate)Get AuthorityKeyIdentifier extension |
| public int | Returns: the length of the constraint.Implements abstract java. Get the certificate constraints path length from the critical BasicConstraints extension, (oid = 2.5.29.19). |
| public BasicConstraintsExtension | Returns: BasicConstraints object or null (if no such object in certificate)Get BasicConstraints extension |
| public CertificatePoliciesExtension | Returns: CertificatePoliciesExtension or null (if no such object in certificate)Get CertificatePoliciesExtension |
| public Set | Returns: a set of the extension oid strings in the certificate that are marked critical.Implements java. Gets a Set of the extension(s) marked CRITICAL in the certificate. |
| public CRLDistributionPointsExtension | Returns: CRLDistributionPoints object or null (if no such object in certificate)Get CRLDistributionPoints extension |
| public byte[] | getEncoded()
Implements abstract java. Returns the encoded form of this certificate. |
| public byte[] | |
| public static byte[] | getEncodedInternal(Certificate cert)
Returned the encoding of the given certificate for internal use. |
| public synchronized List | getExtendedKeyUsage()
Overrides java. This method is the overridden implementation of the getExtendedKeyUsage method in X509Certificate in the Sun provider. |
| public static List | getExtendedKeyUsage(X509Certificate cert)
This static method is the default implementation of the getExtendedKeyUsage method in X509Certificate. |
| public ExtendedKeyUsageExtension | Returns: ExtendedKeyUsage extension object or null (if no such object in certificate)Get ExtendedKeyUsage extension |
| public Extension | Returns: Extension or null if certificate does not contain this extensionthe Object Identifier value for the extension. oid)Gets the extension identified by the given ObjectIdentifier |
| private Extension | getExtensionIfParseable(ObjectIdentifier oid)
Returns the extension identified by OID or null if it doesn't exist and is not unparseable. |
| public byte[] | Returns: the DER-encoded extension value, ornull if
the extensions are not present or the value is not foundthe Object Identifier value for the extension. oid)Implements java. Gets the DER encoded extension identified by the given oid String. |
| private String | |
| public static String | Returns: the fingerprint, or null if it cannot be calculated because of an exceptionthe MessageDigest algorithm algorithm, X509Certificate the X509Certificate cert, Debug debug)Gets the requested fingerprint of the certificate. |
| private static String | |
| public X509CertInfo | |
| public IssuerAlternativeNameExtension | Returns: IssuerAlternativeName object or null (if no such object in certificate)Get IssuerAlternativeName extension |
| public synchronized Collection | getIssuerAlternativeNames()
Overrides java. This method is the overridden implementation of the getIssuerAlternativeNames method in X509Certificate in the Sun provider. |
| public static Collection | getIssuerAlternativeNames(X509Certificate cert)
This static method is the default implementation of the getIssuerAlternativeNames method in X509Certificate. |
| public Principal | Returns: the issuer name.Implements abstract java. Gets the issuer distinguished name from the certificate. |
| public boolean[] | Returns: the Issuer Unique Identity.Implements abstract java. Gets the Issuer Unique Identity from the certificate. |
| public X500Principal | getIssuerX500Principal()
Overrides java. Get issuer name as X500Principal. |
| public static X500Principal | getIssuerX500Principal(X509Certificate cert)
Extract the issuer X500Principal from an X509Certificate. |
| public boolean[] | Returns: the bit values of this extension as an array of booleans.Implements abstract java. Get a boolean array representing the bits of the KeyUsage extension, (oid = 2.5.29.15). |
| public NameConstraintsExtension | Returns: NameConstraints object or null (if no such object in certificate)Get NameConstraints extension |
| public Set | Returns: a set of the extension oid strings in the certificate that are NOT marked critical.Implements java. Gets a Set of the extension(s) marked NON-CRITICAL in the certificate. |
| public Date | Returns: the end date of the validity period.Implements abstract java. Gets the notAfter date from the validity period of the certificate. |
| public Date | Returns: the start date of the validity period.Implements abstract java. Gets the notBefore date from the validity period of the certificate. |
| public PolicyConstraintsExtension | Returns: PolicyConstraints object or null (if no such object in certificate)Get PolicyConstraints extension |
| public PolicyMappingsExtension | Returns: PolicyMappingsExtension object or null (if no such object in certificate)Get PolicyMappingsExtension extension |
| public PrivateKeyUsageExtension | Returns: PrivateKeyUsage object or null (if no such object in certificate)Get PrivateKeyUsage extension |
| public PublicKey | Returns: the publickey.Implements abstract java. Gets the publickey from this certificate. |
| public BigInteger | Returns: the serial number.Implements abstract java. Gets the serial number from the certificate. |
| public SerialNumber | Returns: the serial number.Gets the serial number from the certificate as a SerialNumber object. |
| public AlgorithmId | |
| public String | Returns: the signature algorithm name.Implements abstract java. Gets the signature algorithm name for the certificate signature algorithm. |
| public String | Returns: the signature algorithm oid string.Implements abstract java. Gets the signature algorithm OID string from the certificate. |
| public byte[] | Returns: the DER encoded signature algorithm parameters, or null if no parameters are present.Implements abstract java. Gets the DER encoded signature algorithm parameters from this certificate's signature algorithm. |
| public byte[] | Returns: the signature.Implements abstract java. Gets the raw Signature bits from the certificate. |
| public SubjectAlternativeNameExtension | Returns: SubjectAlternativeName object or null (if no such object in certificate)Get SubjectAlternativeName extension |
| public synchronized Collection | getSubjectAlternativeNames()
Overrides java. This method is the overridden implementation of the getSubjectAlternativeNames method in X509Certificate in the Sun provider. |
| public static Collection | getSubjectAlternativeNames(X509Certificate cert)
This static method is the default implementation of the getSubjectAlternativeNames method in X509Certificate. |
| public Principal | Returns: the subject name.Implements abstract java. Gets the subject distinguished name from the certificate. |
| public KeyIdentifier | |
| public SubjectKeyIdentifierExtension | Returns: SubjectKeyIdentifier object or null (if no such object in certificate)Get SubjectKeyIdentifier extension |
| public boolean[] | Returns: the Subject Unique Identity.Implements abstract java. Gets the Subject Unique Identity from the certificate. |
| public X500Principal | getSubjectX500Principal()
Overrides java. Get subject name as X500Principal. |
| public static X500Principal | getSubjectX500Principal(X509Certificate cert)
Extract the subject X500Principal from an X509Certificate. |
| public byte[] | Returns: the DER encoded certificate information.Implements abstract java. Gets the DER encoded certificate information, the
|
| public Extension | |
| public int | Returns: the version number, i.e. 1, 2 or 3.Implements abstract java. Gets the version number from the certificate. |
| private static X500Principal | getX500Principal(X509Certificate cert, boolean getIssuer)
Extract the subject or issuer X500Principal from an X509Certificate. |
| public boolean | hasUnsupportedCriticalExtension()
Implements java. Return true if a critical extension is found that is not supported, otherwise return false. |
| public static boolean | |
| public static boolean | isSelfSigned(X509Certificate cert, String sigProvider)
Utility method to test if a certificate is self-signed. |
| private static Collection | Returns: an immutable Collection of alternative namesthe GeneralNames to be converted names)Converts a GeneralNames structure into an immutable Collection of
alternative names (subject or issuer) in the form required by
|
| public static X509CertImpl | Returns: the newly signed certificatethe X509CertInfo 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 certificate, which is signed using the given key (associating a signature algorithm and an X.500 name). |
| public static X509CertImpl | Returns: the newly signed certificatethe X509CertInfo 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 certificate, which is signed using the given key (associating a signature algorithm and an X.500 name). |
| public static X509CertImpl | |
| private void | |
| private void | readObject(ObjectInputStream
the stream)ObjectInputStream from which data is readRestores the state of this object from the stream. |
| private DerValue | Returns: DerValue corresponding to decoded HEX-encoded bytesInputStream to read in)read input stream as HEX-encoded DER-encoded bytes |
| public static X509CertImpl | toImpl(X509Certificate cert)
Utility method to convert an arbitrary instance of X509Certificate to a X509CertImpl. |
| public String | toString()
Implements abstract java. Returns a printable representation of the certificate. |
| public void | verify(PublicKey
the public key used for verification. key)Implements abstract java. Throws an exception if the certificate was not signed using the verification key provided. |
| public synchronized void | verify(PublicKey
the public key used for verification. key, String the name of the provider. sigProvider)Implements abstract java. Throws an exception if the certificate was not signed using the verification key provided. |
| public synchronized void | verify(PublicKey
the public key used for verification. key, Provider the provider. sigProvider)Overrides java. Throws an exception if the certificate was not signed using the verification key provided. |