@Test public void testChangeAccountKey() throws Exception { server = setupTestChangeAccountKey(); AcmeAccount account = populateAccount(ACCOUNT_6_V2); X509Certificate oldCertificate = account.getCertificate(); X500Principal oldDn = account.getDn(); acmeClient.changeAccountKey(account, false); assertTrue(! oldCertificate.equals(account.getCertificate())); assertEquals(oldDn, account.getDn()); assertEquals(Acme.VALID, acmeClient.queryAccountStatus(account, false)); }
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()); }
AcmeClientSpi { 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()); } }
AcmeClientSpi { 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()); }  }
AcmeClientSpi { 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()); }  Map<AcmeResource, URL> getResourceUrls(AcmeAccount account, boolean staging); AcmeMetadata getMetadata(AcmeAccount account, boolean staging); boolean createAccount(AcmeAccount account, boolean staging); boolean createAccount(AcmeAccount account, boolean staging, boolean onlyReturnExisting); void updateAccount(AcmeAccount account, boolean staging, boolean termsOfServiceAgreed); void updateAccount(AcmeAccount account, boolean staging, String[] contactUrls); void updateAccount(AcmeAccount account, boolean staging, boolean termsOfServiceAgreed, String[] contactUrls); void changeAccountKey(AcmeAccount account, boolean staging); void changeAccountKey(AcmeAccount account, boolean staging, X509Certificate certificate, PrivateKey privateKey); void deactivateAccount(AcmeAccount account, boolean staging); X509CertificateChainAndSigningKey obtainCertificateChain(AcmeAccount account, boolean staging, String... domainNames); X509CertificateChainAndSigningKey obtainCertificateChain(AcmeAccount account, boolean staging, String keyAlgorithmName, int keySize,
                                                                    String... domainNames); String createAuthorization(AcmeAccount account, boolean staging, String domainName); void deactivateAuthorization(AcmeAccount account, boolean staging, String authorizationUrl); abstract AcmeChallenge proveIdentifierControl(AcmeAccount account, List<AcmeChallenge> challenges); abstract void cleanupAfterChallenge(AcmeAccount account, AcmeChallenge challenge); void revokeCertificate(AcmeAccount account, boolean staging, X509Certificate certificate); void revokeCertificate(AcmeAccount account, boolean staging, X509Certificate certificate, CRLReason reason); byte[] getNewNonce(final AcmeAccount account, final boolean staging); }
AcmeClientSpi { 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()); }  Map<AcmeResource, URL> getResourceUrls(AcmeAccount account, boolean staging); AcmeMetadata getMetadata(AcmeAccount account, boolean staging); boolean createAccount(AcmeAccount account, boolean staging); boolean createAccount(AcmeAccount account, boolean staging, boolean onlyReturnExisting); void updateAccount(AcmeAccount account, boolean staging, boolean termsOfServiceAgreed); void updateAccount(AcmeAccount account, boolean staging, String[] contactUrls); void updateAccount(AcmeAccount account, boolean staging, boolean termsOfServiceAgreed, String[] contactUrls); void changeAccountKey(AcmeAccount account, boolean staging); void changeAccountKey(AcmeAccount account, boolean staging, X509Certificate certificate, PrivateKey privateKey); void deactivateAccount(AcmeAccount account, boolean staging); X509CertificateChainAndSigningKey obtainCertificateChain(AcmeAccount account, boolean staging, String... domainNames); X509CertificateChainAndSigningKey obtainCertificateChain(AcmeAccount account, boolean staging, String keyAlgorithmName, int keySize,
                                                                    String... domainNames); String createAuthorization(AcmeAccount account, boolean staging, String domainName); void deactivateAuthorization(AcmeAccount account, boolean staging, String authorizationUrl); abstract AcmeChallenge proveIdentifierControl(AcmeAccount account, List<AcmeChallenge> challenges); abstract void cleanupAfterChallenge(AcmeAccount account, AcmeChallenge challenge); void revokeCertificate(AcmeAccount account, boolean staging, X509Certificate certificate); void revokeCertificate(AcmeAccount account, boolean staging, X509Certificate certificate, CRLReason reason); byte[] getNewNonce(final AcmeAccount account, final boolean staging); static final int DEFAULT_EC_KEY_SIZE; static final int DEFAULT_KEY_SIZE; static final String DEFAULT_KEY_ALGORITHM_NAME; }