public class X509ExtensionUtils extends Object
Note: This class is not thread safe!
Constructor and Description |
---|
X509ExtensionUtils(DigestCalculator calculator)
Base constructor - for conformance to RFC 5280 use a calculator based on SHA-1.
|
Modifier and Type | Method and Description |
---|---|
AuthorityKeyIdentifier |
createAuthorityKeyIdentifier(SubjectPublicKeyInfo publicKeyInfo)
Create an AuthorityKeyIdentifier from the passed in SubjectPublicKeyInfo.
|
AuthorityKeyIdentifier |
createAuthorityKeyIdentifier(SubjectPublicKeyInfo publicKeyInfo,
GeneralNames generalNames,
BigInteger serial)
Create an AuthorityKeyIdentifier from the passed in arguments.
|
AuthorityKeyIdentifier |
createAuthorityKeyIdentifier(X509CertificateHolder certHolder)
Create an AuthorityKeyIdentifier from the passed in arguments.
|
SubjectKeyIdentifier |
createSubjectKeyIdentifier(SubjectPublicKeyInfo publicKeyInfo)
Return a RFC 5280 type 1 key identifier.
|
SubjectKeyIdentifier |
createTruncatedSubjectKeyIdentifier(SubjectPublicKeyInfo publicKeyInfo)
Return a RFC 5280 type 2 key identifier.
|
public X509ExtensionUtils(DigestCalculator calculator)
calculator
- a calculator for calculating subject key ids.public AuthorityKeyIdentifier createAuthorityKeyIdentifier(X509CertificateHolder certHolder)
certHolder
- the issuer certificate that the AuthorityKeyIdentifier should refer to.public AuthorityKeyIdentifier createAuthorityKeyIdentifier(SubjectPublicKeyInfo publicKeyInfo)
publicKeyInfo
- the SubjectPublicKeyInfo to base the key identifier on.public AuthorityKeyIdentifier createAuthorityKeyIdentifier(SubjectPublicKeyInfo publicKeyInfo, GeneralNames generalNames, BigInteger serial)
publicKeyInfo
- 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(SubjectPublicKeyInfo publicKeyInfo)
(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).
publicKeyInfo
- the key info object containing the subjectPublicKey field.public SubjectKeyIdentifier createTruncatedSubjectKeyIdentifier(SubjectPublicKeyInfo publicKeyInfo)
(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.
publicKeyInfo
- the key info object containing the subjectPublicKey field.Copyright © 2018 BouncyCastle.org. All rights reserved.