for (int i = 0; i < MAX_RETRIES; i++) { String encodedProtectedHeader = getEncodedProtectedHeader(useJwk, resourceUrl, account, staging); String encodedSignature = getEncodedSignature(account.getPrivateKey(), account.getSignature(), encodedProtectedHeader, encodedPayload); JsonObject jws = getJws(encodedProtectedHeader, encodedPayload, encodedSignature); connection = (HttpURLConnection) url.openConnection();
for (int i = 0; i < MAX_RETRIES; i++) { String encodedProtectedHeader = getEncodedProtectedHeader(useJwk, resourceUrl, account, staging); String encodedSignature = getEncodedSignature(account.getPrivateKey(), account.getSignature(), encodedProtectedHeader, encodedPayload); JsonObject jws = getJws(encodedProtectedHeader, encodedPayload, encodedSignature); connection = (HttpURLConnection) url.openConnection();
private void saveCertificateAuthorityAccountKey(ModifiableKeyStoreService keyStoreService, char[] keyPassword) throws OperationFailedException { KeyStore modifiableAccountkeyStore = keyStoreService.getModifiableValue(); try { modifiableAccountkeyStore.setKeyEntry(alias, acmeAccount.getPrivateKey(), keyPassword, new X509Certificate[]{ acmeAccount.getCertificate() }); } catch (KeyStoreException e) { throw ROOT_LOGGER.unableToUpdateCertificateAuthorityAccountKeyStore(e, e.getLocalizedMessage()); } ((KeyStoreService) keyStoreService).save(); } }
for (int i = 0; i < MAX_RETRIES; i++) { String encodedProtectedHeader = getEncodedProtectedHeader(useJwk, resourceUrl, account, staging); String encodedSignature = getEncodedSignature(account.getPrivateKey(), account.getSignature(), encodedProtectedHeader, encodedPayload); JsonObject jws = getJws(encodedProtectedHeader, encodedPayload, encodedSignature); connection = (HttpURLConnection) url.openConnection();
for (int i = 0; i < MAX_RETRIES; i++) { String encodedProtectedHeader = getEncodedProtectedHeader(useJwk, resourceUrl, account, staging); String encodedSignature = getEncodedSignature(account.getPrivateKey(), account.getSignature(), encodedProtectedHeader, encodedPayload); JsonObject jws = getJws(encodedProtectedHeader, encodedPayload, encodedSignature); connection = (HttpURLConnection) url.openConnection();
static AcmeAccount resetAcmeAccount(AcmeAccount acmeAccount, boolean staging) { String accountUrl = acmeAccount.getAccountUrl(); if (accountUrl != null) { String stagingEndpoint = acmeAccount.getStagingServerUrl().substring(0, acmeAccount.getStagingServerUrl().indexOf("/" + DIRECTORY)); if ((accountUrl.startsWith(stagingEndpoint) && ! staging) || (! accountUrl.startsWith(stagingEndpoint) && staging)) { // need to reset the account information so it will get populated with the correct staging / non-staging account URL AcmeAccount.Builder acmeAccountBuilder = AcmeAccount.builder(); acmeAccountBuilder .setServerUrl(acmeAccount.getServerUrl()) .setStagingServerUrl(acmeAccount.getStagingServerUrl()) .setDn(acmeAccount.getDn()) .setKey(acmeAccount.getCertificate(), acmeAccount.getPrivateKey()) .setTermsOfServiceAgreed(acmeAccount.isTermsOfServiceAgreed()); if (acmeAccount.getContactUrls() != null) { acmeAccountBuilder.setContactUrls(acmeAccount.getContactUrls()); } return acmeAccountBuilder.build(); } } return acmeAccount; }