@@ -0,0 +1,2785 @@
+package de.alpharogroup.crypto.factories;%0A%0Aimport java.math.BigInteger;%0Aimport java.security.PublicKey;%0Aimport java.util.Date;%0A%0Aimport org.bouncycastle.asn1.x500.X500Name;%0Aimport org.bouncycastle.asn1.x509.SubjectPublicKeyInfo;%0Aimport org.bouncycastle.cert.X509v1CertificateBuilder;%0Aimport org.bouncycastle.cert.X509v3CertificateBuilder;%0Aimport org.bouncycastle.cert.jcajce.JcaX509v1CertificateBuilder;%0A%0Aimport lombok.experimental.UtilityClass;%0A%0A/**%0A * The factory class %7B@link CertificateBuilderFactory%7D holds methods for%0A * creating CertificateBuilder.%0A */%0A@UtilityClass%0Apublic class CertificateBuilderFactory %7B%0A%0A%09/**%0A%09 * Factory method for creating a new %7B@link X509v1CertificateBuilder%7D object%0A%09 * of version 1 of X.509 from the given parameters.%0A%09 *%0A%09 * @param issuer%0A%09 *            X500Name representing the issuer of this certificate.%0A%09 * @param serial%0A%09 *            the serial number for the certificate.%0A%09 * @param notBefore%0A%09 *            date before which the certificate is not valid.%0A%09 * @param notAfter%0A%09 *            date after which the certificate is not valid.%0A%09 * @param subject%0A%09 *            X500Name representing the subject of this certificate.%0A%09 * @param publicKey%0A%09 *            the public key to be associated with the certificate.%0A%09 * @return the new %7B@link X509v3CertificateBuilder%7D object%0A%09 */%0A%09public static X509v1CertificateBuilder newX509v1CertificateBuilder(X500Name issuer, BigInteger serial,%0A%09%09%09Date notBefore, Date notAfter, X500Name subject, PublicKey publicKey) %7B%0A%09%09final X509v1CertificateBuilder certBuilder = new JcaX509v1CertificateBuilder(issuer, serial, notBefore,%0A%09%09%09%09notAfter, subject, publicKey);%0A%09%09return certBuilder;%0A%09%7D%0A%0A%09/**%0A%09 * Factory method for creating a new %7B@link X509v3CertificateBuilder%7D object%0A%09 * of version 3 of X.509 from the given parameters.%0A%09 *%0A%09 * @param issuer%0A%09 *            X500Name representing the issuer of this certificate.%0A%09 * @param serial%0A%09 *            the serial number for the certificate.%0A%09 * @param notBefore%0A%09 *            date before which the certificate is not valid.%0A%09 * @param notAfter%0A%09 *            date after which the certificate is not valid.%0A%09 * @param subject%0A%09 *            X500Name representing the subject of this certificate.%0A%09 * @param publicKeyInfo%0A%09 *            the info structure for the public key to be associated with%0A%09 *            this certificate.%0A%09 * @return the new %7B@link X509v3CertificateBuilder%7D object%0A%09 */%0A%09public static X509v3CertificateBuilder newX509v3CertificateBuilder(X500Name issuer, BigInteger serial,%0A%09%09%09Date notBefore, Date notAfter, X500Name subject, SubjectPublicKeyInfo publicKeyInfo) %7B%0A%09%09final X509v3CertificateBuilder certBuilder = new X509v3CertificateBuilder(issuer, serial, notBefore, notAfter,%0A%09%09%09%09subject, publicKeyInfo);%0A%09%09return certBuilder;%0A%09%7D%0A%7D%0A

Create CertificateBuilderFactory.java