public class CertificateBuilder extends Object
| Constructor and Description |
|---|
CertificateBuilder(KeystoreHandler keystoreHandler) |
| Modifier and Type | Method and Description |
|---|---|
X509Certificate |
buildAndSignCert(BigInteger serialNumber,
PrivateKey signerPrivateKey,
PublicKey signerPublicKey,
PublicKey subjectPublicKey,
org.bouncycastle.asn1.x500.X500Name issuer,
org.bouncycastle.asn1.x500.X500Name subject,
Map<String,String> customAttrs,
String type,
String ocspUrl,
String crlUrl)
Builds and signs a certificate.
|
HashMap<String,String> |
convertCommas(String orgName,
String type,
String callName,
String uid)
Converts any commas in the given strings to something that looks like a comma, but isn't
|
X509Certificate |
generateCertForEntity(BigInteger serialNumber,
String country,
String orgName,
String type,
String callName,
String email,
String uid,
PublicKey publickey,
Map<String,String> customAttr,
String signingAlias,
String baseCrlOcspURI)
Generates a signed certificate for an entity.
|
static KeyPair |
generateKeyPair()
Generates a keypair (public and private) based on Elliptic curves.
|
BigInteger |
generateSerialNumber()
Generate a unique serial number to uniquely identify certificates.
|
public CertificateBuilder(KeystoreHandler keystoreHandler)
public X509Certificate buildAndSignCert(BigInteger serialNumber, PrivateKey signerPrivateKey, PublicKey signerPublicKey, PublicKey subjectPublicKey, org.bouncycastle.asn1.x500.X500Name issuer, org.bouncycastle.asn1.x500.X500Name subject, Map<String,String> customAttrs, String type, String ocspUrl, String crlUrl) throws Exception
serialNumber - The serialnumber of the new certificate.signerPrivateKey - Private key for signing the certificatesignerPublicKey - Public key of the signing certificatesubjectPublicKey - Public key for the new certificateissuer - DN of the signing certificatesubject - DN of the new certificatecustomAttrs - The custom MC attributes to include in the certificatetype - Type of certificate, can be "ROOT", "INTERMEDIATE" or "ENTITY".ocspUrl - OCSP endpointcrlUrl - CRL endpoint - can be nullException - Throws exception on certificate generation errors.public X509Certificate generateCertForEntity(BigInteger serialNumber, String country, String orgName, String type, String callName, String email, String uid, PublicKey publickey, Map<String,String> customAttr, String signingAlias, String baseCrlOcspURI) throws Exception
country - The country of org/entityorgName - The name of the organization the entity belongs totype - The type of the entitycallName - The name of the entityemail - The email of the entitypublickey - The public key of the entitybaseCrlOcspURI - The base URI used for the CRL and OCSP endpoint. This will be prepended: (ocsp|crl)/urn:mrn:mcl:ca:...Exceptionpublic static KeyPair generateKeyPair()
public BigInteger generateSerialNumber()
Copyright © 2012–2019 Danish Maritime Authority. All rights reserved.