Class CryptoCAService
java.lang.Object
com.eurodyn.qlack.fuse.crypto.service.CryptoCAService
Certificate Authority management.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncertificateToPEM
(org.bouncycastle.cert.X509CertificateHolder certificateHolder) Converts a certificate to a PEM format encoded as X.509.createCA
(CreateCADTO createCADTO) Create a new Certificate Authority.org.bouncycastle.cert.X509CertificateHolder
generateCertificate
(CertificateSignDTO certificateSignDTO) Signs a key with another key providing a certificate.pemToCertificate
(String cert) Parses a certificate in PEM format encoded as X.509.
-
Constructor Details
-
CryptoCAService
-
-
Method Details
-
createCA
public CPPPemHolderDTO createCA(CreateCADTO createCADTO) throws NoSuchAlgorithmException, InvalidKeySpecException, org.bouncycastle.operator.OperatorCreationException, IOException, NoSuchProviderException Create a new Certificate Authority. This method also supports creating a sub-CA by providing the issuer's information.- Parameters:
createCADTO
- the details of the CA to be created- Returns:
- the generated certificate
- Throws:
NoSuchAlgorithmException
- thrown when no algorithm is found for encryptionInvalidKeySpecException
- thrown when the provided key is invalidorg.bouncycastle.operator.OperatorCreationException
- thrown when something unexpected happens during the encryptionIOException
- thrown when something unexpected happensNoSuchProviderException
-
generateCertificate
public org.bouncycastle.cert.X509CertificateHolder generateCertificate(CertificateSignDTO certificateSignDTO) throws org.bouncycastle.operator.OperatorCreationException, org.bouncycastle.cert.CertIOException Signs a key with another key providing a certificate.- Parameters:
certificateSignDTO
- the details of the signing to take place- Returns:
- the generated signature
- Throws:
org.bouncycastle.operator.OperatorCreationException
- thrown when something unexpected happens during the encryptionorg.bouncycastle.cert.CertIOException
- thrown when something unexpected happens while generating the certificate
-
certificateToPEM
public String certificateToPEM(org.bouncycastle.cert.X509CertificateHolder certificateHolder) throws IOException Converts a certificate to a PEM format encoded as X.509.- Parameters:
certificateHolder
- the certificate to convert- Returns:
- the generated PEM
- Throws:
IOException
- thrown when something unexpected happens
-
pemToCertificate
Parses a certificate in PEM format encoded as X.509.- Parameters:
cert
- the certificate in PEM format- Returns:
- the generated certificate
- Throws:
CertificateException
- thrown when something unexpected happens while generating the certificate
-