Package org.bouncycastle.cert.jcajce
Class JcaX509ExtensionUtils
java.lang.Object
org.bouncycastle.cert.X509ExtensionUtils
org.bouncycastle.cert.jcajce.JcaX509ExtensionUtils
-
Constructor Summary
ConstructorsConstructorDescriptionCreate a utility class pre-configured with a SHA-1 digest calculator based on the default implementation.JcaX509ExtensionUtils(DigestCalculator calculator) -
Method Summary
Modifier and TypeMethodDescriptioncreateAuthorityKeyIdentifier(PublicKey pubKey, X500Principal name, BigInteger serial) createAuthorityKeyIdentifier(PublicKey pubKey, GeneralNames generalNames, BigInteger serial) createSubjectKeyIdentifier(PublicKey publicKey) Return a RFC 3280 type 1 key identifier.createTruncatedSubjectKeyIdentifier(PublicKey publicKey) Return a RFC 3280 type 2 key identifier.static Collectionstatic Collectionstatic ASN1PrimitiveparseExtensionValue(byte[] encExtValue) Return the ASN.1 object contained in a byte[] returned by a getExtensionValue() call.Methods inherited from class org.bouncycastle.cert.X509ExtensionUtils
createAuthorityKeyIdentifier, createAuthorityKeyIdentifier, createAuthorityKeyIdentifier, createSubjectKeyIdentifier, createTruncatedSubjectKeyIdentifier
-
Constructor Details
-
JcaX509ExtensionUtils
Create a utility class pre-configured with a SHA-1 digest calculator based on the default implementation.- Throws:
NoSuchAlgorithmException
-
JcaX509ExtensionUtils
-
-
Method Details
-
createAuthorityKeyIdentifier
public AuthorityKeyIdentifier createAuthorityKeyIdentifier(X509Certificate cert) throws CertificateEncodingException - Throws:
CertificateEncodingException
-
createAuthorityKeyIdentifier
-
createAuthorityKeyIdentifier
public AuthorityKeyIdentifier createAuthorityKeyIdentifier(PublicKey pubKey, X500Principal name, BigInteger serial) -
createAuthorityKeyIdentifier
public AuthorityKeyIdentifier createAuthorityKeyIdentifier(PublicKey pubKey, GeneralNames generalNames, BigInteger serial) -
createSubjectKeyIdentifier
Return a RFC 3280 type 1 key identifier. As in:(1) The keyIdentifier is composed of the 160-bit SHA-1 hash of the value of the BIT STRING subjectPublicKey (excluding the tag, length, and number of unused bits).
- Parameters:
publicKey- the key object containing the key identifier is to be based on.- Returns:
- the key identifier.
-
createTruncatedSubjectKeyIdentifier
Return a RFC 3280 type 2 key identifier. As in:(2) The keyIdentifier is composed of a four bit type field with the value 0100 followed by the least significant 60 bits of the SHA-1 hash of the value of the BIT STRING subjectPublicKey.
- Parameters:
publicKey- the key object of interest.- Returns:
- the key identifier.
-
parseExtensionValue
Return the ASN.1 object contained in a byte[] returned by a getExtensionValue() call.- Parameters:
encExtValue- DER encoded OCTET STRING containing the DER encoded extension object.- Returns:
- an ASN.1 object
- Throws:
IOException- on a parsing error.
-
getIssuerAlternativeNames
public static Collection getIssuerAlternativeNames(X509Certificate cert) throws CertificateParsingException - Throws:
CertificateParsingException
-
getSubjectAlternativeNames
public static Collection getSubjectAlternativeNames(X509Certificate cert) throws CertificateParsingException - Throws:
CertificateParsingException
-