public class JcaX509ExtensionUtils extends X509ExtensionUtils
| Constructor and Description |
|---|
JcaX509ExtensionUtils()
Create a utility class pre-configured with a SHA-1 digest calculator based on the
default implementation.
|
JcaX509ExtensionUtils(org.bouncycastle.operator.DigestCalculator calculator) |
| Modifier and Type | Method and Description |
|---|---|
AuthorityKeyIdentifier |
createAuthorityKeyIdentifier(java.security.PublicKey pubKey)
Create an AuthorityKeyIdentifier from the passed in SubjectPublicKeyInfo.
|
AuthorityKeyIdentifier |
createAuthorityKeyIdentifier(java.security.PublicKey pubKey,
GeneralNames generalNames,
java.math.BigInteger serial)
Create an AuthorityKeyIdentifier from the passed in arguments.
|
AuthorityKeyIdentifier |
createAuthorityKeyIdentifier(java.security.PublicKey pubKey,
javax.security.auth.x500.X500Principal name,
java.math.BigInteger serial)
Create an AuthorityKeyIdentifier from the passed in arguments.
|
AuthorityKeyIdentifier |
createAuthorityKeyIdentifier(java.security.cert.X509Certificate cert)
Create an AuthorityKeyIdentifier from the passed in SubjectPublicKeyInfo.
|
SubjectKeyIdentifier |
createSubjectKeyIdentifier(java.security.PublicKey publicKey)
Return a RFC 3280 type 1 key identifier.
|
SubjectKeyIdentifier |
createTruncatedSubjectKeyIdentifier(java.security.PublicKey publicKey)
Return a RFC 3280 type 2 key identifier.
|
static java.util.Collection |
getIssuerAlternativeNames(java.security.cert.X509Certificate cert) |
static java.util.Collection |
getSubjectAlternativeNames(java.security.cert.X509Certificate cert) |
static ASN1Primitive |
parseExtensionValue(byte[] encExtValue)
Return the ASN.1 object contained in a byte[] returned by a getExtensionValue() call.
|
createAuthorityKeyIdentifierpublic JcaX509ExtensionUtils()
throws java.security.NoSuchAlgorithmException
java.security.NoSuchAlgorithmExceptionpublic JcaX509ExtensionUtils(org.bouncycastle.operator.DigestCalculator calculator)
public AuthorityKeyIdentifier createAuthorityKeyIdentifier(java.security.cert.X509Certificate cert)
throws java.security.cert.CertificateEncodingException
X509ExtensionUtilscreateAuthorityKeyIdentifier in class X509ExtensionUtilscert - the SubjectPublicKeyInfo to base the key identifier on.java.security.cert.CertificateEncodingExceptionpublic AuthorityKeyIdentifier createAuthorityKeyIdentifier(java.security.PublicKey pubKey)
X509ExtensionUtilscreateAuthorityKeyIdentifier in class X509ExtensionUtilspubKey - the SubjectPublicKeyInfo to base the key identifier on.public AuthorityKeyIdentifier createAuthorityKeyIdentifier(java.security.PublicKey pubKey,
javax.security.auth.x500.X500Principal name,
java.math.BigInteger serial)
X509ExtensionUtilscreateAuthorityKeyIdentifier in class X509ExtensionUtilspubKey - the SubjectPublicKeyInfo to base the key identifier on.name - the general names to associate with the issuer cert's issuer.serial - the serial number of the issuer cert.public AuthorityKeyIdentifier createAuthorityKeyIdentifier(java.security.PublicKey pubKey,
GeneralNames generalNames,
java.math.BigInteger serial)
X509ExtensionUtilscreateAuthorityKeyIdentifier in class X509ExtensionUtilspubKey - the SubjectPublicKeyInfo to base the key identifier on.generalNames - the general names to associate with the issuer cert's issuer.serial - the serial number of the issuer cert.public SubjectKeyIdentifier createSubjectKeyIdentifier(java.security.PublicKey publicKey)
(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).
createSubjectKeyIdentifier in class X509ExtensionUtilspublicKey - the key object containing the key identifier is to be based on.public SubjectKeyIdentifier createTruncatedSubjectKeyIdentifier(java.security.PublicKey publicKey)
(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.
createTruncatedSubjectKeyIdentifier in class X509ExtensionUtilspublicKey - the key object of interest.public static ASN1Primitive parseExtensionValue(byte[] encExtValue)
throws java.io.IOException
encExtValue - DER encoded OCTET STRING containing the DER encoded extension object.java.io.IOException - on a parsing error.public static java.util.Collection getIssuerAlternativeNames(java.security.cert.X509Certificate cert)
throws java.security.cert.CertificateParsingException
java.security.cert.CertificateParsingExceptionpublic static java.util.Collection getSubjectAlternativeNames(java.security.cert.X509Certificate cert)
throws java.security.cert.CertificateParsingException
java.security.cert.CertificateParsingException