PKCS10CertificateSigningRequest.Builder csrBuilder = PKCS10CertificateSigningRequest.builder() .setCertificate(selfSignedX509CertificateAndSigningKey.getSelfSignedCertificate()) .setSigningKey(selfSignedX509CertificateAndSigningKey.getSigningKey()) .setSubjectDn(dn); csrBuilder.addExtension(new SubjectAlternativeNamesExtension(false, generalNames)); PrivateKey privateKey = selfSignedX509CertificateAndSigningKey.getSigningKey(); return new X509CertificateChainAndSigningKey(certificateChain, privateKey); } finally {
/** * Change the key that is associated with the given ACME account. * * @param account the ACME account information to use (must not be {@code null}) * @param staging whether or not the staging server URL should be used * @throws AcmeException if an error occurs while attempting to change the key that is associated with the given ACME account */ public void changeAccountKey(AcmeAccount account, boolean staging) throws AcmeException { Assert.checkNotNullParam("account", account); SelfSignedX509CertificateAndSigningKey newCertificateAndSigningKey = SelfSignedX509CertificateAndSigningKey.builder() .setKeySize(account.getKeySize()) .setKeyAlgorithmName(account.getKeyAlgorithmName()) .setDn(account.getDn()) .build(); changeAccountKey(account, staging, newCertificateAndSigningKey.getSelfSignedCertificate(), newCertificateAndSigningKey.getSigningKey()); }
.setDn(dn) .build(); privateKey = certificateAndSigningKey.getSigningKey(); certificate = certificateAndSigningKey.getSelfSignedCertificate(); signatureAlgorithm = getDefaultCompatibleSignatureAlgorithmName(privateKey);
private void createKeyStoreTrustStore(KeyStore keyStore, KeyStore trustStore, String DN, String alias) throws Exception { X500Principal principal = new X500Principal(DN); SelfSignedX509CertificateAndSigningKey selfSignedX509CertificateAndSigningKey = SelfSignedX509CertificateAndSigningKey.builder() .setKeyAlgorithmName("RSA") .setSignatureAlgorithmName("SHA256withRSA") .setDn(principal) .setKeySize(1024) .build(); X509Certificate certificate = selfSignedX509CertificateAndSigningKey.getSelfSignedCertificate(); keyStore.setKeyEntry(alias, selfSignedX509CertificateAndSigningKey.getSigningKey(), KEYSTORE_CREATION_PASSWORD, new X509Certificate[]{certificate}); trustStore.setCertificateEntry(alias, certificate); }
private static void createKeyStoreTrustStore(KeyStore keyStore, KeyStore trustStore, String DN, String alias) throws Exception { X500Principal principal = new X500Principal(DN); SelfSignedX509CertificateAndSigningKey selfSignedX509CertificateAndSigningKey = SelfSignedX509CertificateAndSigningKey.builder() .setKeyAlgorithmName("RSA") .setSignatureAlgorithmName("SHA256withRSA") .setDn(principal) .setKeySize(1024) .build(); X509Certificate certificate = selfSignedX509CertificateAndSigningKey.getSelfSignedCertificate(); keyStore.setKeyEntry(alias, selfSignedX509CertificateAndSigningKey.getSigningKey(), KEYSTORE_CREATION_PASSWORD, new X509Certificate[]{certificate}); if(trustStore != null) trustStore.setCertificateEntry(alias, certificate); }
private static void createKeyStoreTrustStore(KeyStore keyStore, KeyStore trustStore, String DN, String alias) throws Exception { X500Principal principal = new X500Principal(DN); SelfSignedX509CertificateAndSigningKey selfSignedX509CertificateAndSigningKey = SelfSignedX509CertificateAndSigningKey.builder() .setKeyAlgorithmName("RSA") .setSignatureAlgorithmName("SHA256withRSA") .setDn(principal) .setKeySize(1024) .build(); X509Certificate certificate = selfSignedX509CertificateAndSigningKey.getSelfSignedCertificate(); keyStore.setKeyEntry(alias, selfSignedX509CertificateAndSigningKey.getSigningKey(), KEYSTORE_CREATION_PASSWORD, new X509Certificate[]{certificate}); if(trustStore != null) trustStore.setCertificateEntry(alias, certificate); }
/** * Change the key that is associated with the given ACME account. * * @param account the ACME account information to use (must not be {@code null}) * @param staging whether or not the staging server URL should be used * @throws AcmeException if an error occurs while attempting to change the key that is associated with the given ACME account */ public void changeAccountKey(AcmeAccount account, boolean staging) throws AcmeException { Assert.checkNotNullParam("account", account); SelfSignedX509CertificateAndSigningKey newCertificateAndSigningKey = SelfSignedX509CertificateAndSigningKey.builder() .setKeySize(account.getKeySize()) .setKeyAlgorithmName(account.getKeyAlgorithmName()) .setDn(account.getDn()) .build(); changeAccountKey(account, staging, newCertificateAndSigningKey.getSelfSignedCertificate(), newCertificateAndSigningKey.getSigningKey()); }
PKCS10CertificateSigningRequest.Builder csrBuilder = PKCS10CertificateSigningRequest.builder() .setCertificate(selfSignedX509CertificateAndSigningKey.getSelfSignedCertificate()) .setSigningKey(selfSignedX509CertificateAndSigningKey.getSigningKey()) .setSubjectDn(dn); csrBuilder.addExtension(new SubjectAlternativeNamesExtension(false, generalNames)); PrivateKey privateKey = selfSignedX509CertificateAndSigningKey.getSigningKey(); return new X509CertificateChainAndSigningKey(certificateChain, privateKey); } finally {
/** * Change the key that is associated with the given ACME account. * * @param account the ACME account information to use (must not be {@code null}) * @param staging whether or not the staging server URL should be used * @throws AcmeException if an error occurs while attempting to change the key that is associated with the given ACME account */ public void changeAccountKey(AcmeAccount account, boolean staging) throws AcmeException { Assert.checkNotNullParam("account", account); SelfSignedX509CertificateAndSigningKey newCertificateAndSigningKey = SelfSignedX509CertificateAndSigningKey.builder() .setKeySize(account.getKeySize()) .setKeyAlgorithmName(account.getKeyAlgorithmName()) .setDn(account.getDn()) .build(); changeAccountKey(account, staging, newCertificateAndSigningKey.getSelfSignedCertificate(), newCertificateAndSigningKey.getSigningKey()); }
PKCS10CertificateSigningRequest.Builder csrBuilder = PKCS10CertificateSigningRequest.builder() .setCertificate(selfSignedX509CertificateAndSigningKey.getSelfSignedCertificate()) .setSigningKey(selfSignedX509CertificateAndSigningKey.getSigningKey()) .setSubjectDn(dn); csrBuilder.addExtension(new SubjectAlternativeNamesExtension(false, generalNames)); PrivateKey privateKey = selfSignedX509CertificateAndSigningKey.getSigningKey(); return new X509CertificateChainAndSigningKey(certificateChain, privateKey); } finally {
PKCS10CertificateSigningRequest.Builder csrBuilder = PKCS10CertificateSigningRequest.builder() .setCertificate(selfSignedX509CertificateAndSigningKey.getSelfSignedCertificate()) .setSigningKey(selfSignedX509CertificateAndSigningKey.getSigningKey()) .setSubjectDn(dn); csrBuilder.addExtension(new SubjectAlternativeNamesExtension(false, generalNames)); PrivateKey privateKey = selfSignedX509CertificateAndSigningKey.getSigningKey(); return new X509CertificateChainAndSigningKey(certificateChain, privateKey); } finally {
.setDn(dn) .build(); privateKey = certificateAndSigningKey.getSigningKey(); certificate = certificateAndSigningKey.getSelfSignedCertificate(); signatureAlgorithm = getDefaultCompatibleSignatureAlgorithmName(privateKey);
.setDn(dn) .build(); privateKey = certificateAndSigningKey.getSigningKey(); certificate = certificateAndSigningKey.getSelfSignedCertificate(); signatureAlgorithm = getDefaultCompatibleSignatureAlgorithmName(privateKey);
/** * Change the key that is associated with the given ACME account. * * @param account the ACME account information to use (must not be {@code null}) * @param staging whether or not the staging server URL should be used * @throws AcmeException if an error occurs while attempting to change the key that is associated with the given ACME account */ public void changeAccountKey(AcmeAccount account, boolean staging) throws AcmeException { Assert.checkNotNullParam("account", account); SelfSignedX509CertificateAndSigningKey newCertificateAndSigningKey = SelfSignedX509CertificateAndSigningKey.builder() .setKeySize(account.getKeySize()) .setKeyAlgorithmName(account.getKeyAlgorithmName()) .setDn(account.getDn()) .build(); changeAccountKey(account, staging, newCertificateAndSigningKey.getSelfSignedCertificate(), newCertificateAndSigningKey.getSigningKey()); }
.setDn(dn) .build(); privateKey = certificateAndSigningKey.getSigningKey(); certificate = certificateAndSigningKey.getSelfSignedCertificate(); signatureAlgorithm = getDefaultCompatibleSignatureAlgorithmName(privateKey);
final PrivateKey privateKey = certAndKey.getSigningKey(); final X509Certificate[] certChain = new X509Certificate[1]; certChain[0] = certAndKey.getSelfSignedCertificate();