public class X509v3CertificateBuilder extends Object
| Constructor and Description |
|---|
X509v3CertificateBuilder(org.bouncycastle.asn1.x500.X500Name issuer,
BigInteger serial,
Date notBefore,
Date notAfter,
org.bouncycastle.asn1.x500.X500Name subject,
org.bouncycastle.asn1.x509.SubjectPublicKeyInfo publicKeyInfo)
Create a builder for a version 3 certificate.
|
| Modifier and Type | Method and Description |
|---|---|
X509v3CertificateBuilder |
addExtension(org.bouncycastle.asn1.ASN1ObjectIdentifier oid,
boolean isCritical,
org.bouncycastle.asn1.ASN1Object value)
Add a given extension field for the standard extensions tag (tag 3)
|
X509Certificate |
build(PrivateKey key,
org.bouncycastle.asn1.x509.AlgorithmIdentifier sigAlg,
String sigAlgName,
String provider,
SecureRandom random)
Generate the certificate, signing it with the provided private key and
using the specified algorithm.
|
static org.bouncycastle.asn1.x509.AlgorithmIdentifier |
extractAlgorithmId(X509Certificate cert)
Extracts the full algorithm identifier from the given certificate.
|
public X509v3CertificateBuilder(org.bouncycastle.asn1.x500.X500Name issuer,
BigInteger serial,
Date notBefore,
Date notAfter,
org.bouncycastle.asn1.x500.X500Name subject,
org.bouncycastle.asn1.x509.SubjectPublicKeyInfo publicKeyInfo)
issuer - the certificate issuerserial - the certificate serial numbernotBefore - the date before which the certificate is not validnotAfter - the date after which the certificate is not validsubject - the certificate subjectpublicKeyInfo - the info structure for the public key to be associated
with this certificate.public X509v3CertificateBuilder addExtension(org.bouncycastle.asn1.ASN1ObjectIdentifier oid, boolean isCritical, org.bouncycastle.asn1.ASN1Object value) throws IOException
oid - the OID defining the extension type.isCritical - true if the extension is critical, false otherwise.value - the ASN.1 structure that forms the extension's value.IOException - IO exceptionpublic X509Certificate build(PrivateKey key, org.bouncycastle.asn1.x509.AlgorithmIdentifier sigAlg, String sigAlgName, String provider, SecureRandom random) throws InvalidKeyException, CertificateParsingException, NoSuchProviderException, NoSuchAlgorithmException, SignatureException, IOException
key - to be used for signingsigAlg - oid and paramters of the signature algsigAlgName - name of the signature algprovider - can be null -> default will be usedrandom - can be null -> default will be usedInvalidKeyException - invalid key exceptionCertificateParsingException - certificate parsing exceptionNoSuchProviderException - no such provider exceptionNoSuchAlgorithmException - no such algorithm exceptionSignatureException - signature exceptionIOException - IO exceptionpublic static org.bouncycastle.asn1.x509.AlgorithmIdentifier extractAlgorithmId(X509Certificate cert) throws IOException
cert - input certificateIOException - if parameters of the algorithm can not be parsedCopyright © 2012–2018 European Middleware Initiative. All rights reserved.