/** * Create an account with an ACME server using the given account information. * * @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 * @return {@code true} if the account was created, {@code false} if the account already existed * @throws AcmeException if an error occurs while attempting to create or lookup an account with * the ACME server */ public boolean createAccount(AcmeAccount account, boolean staging) throws AcmeException { return createAccount(account, staging, false); }
private String getAccountUrl(AcmeAccount account, boolean staging) throws AcmeException { String accountUrl = account.getAccountUrl(); if (accountUrl == null) { createAccount(account, staging, true); accountUrl = account.getAccountUrl(); if (accountUrl == null) { acme.acmeAccountDoesNotExist(); } } return accountUrl; }
/** * Create an account with an ACME server using the given account information. * * @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 * @return {@code true} if the account was created, {@code false} if the account already existed * @throws AcmeException if an error occurs while attempting to create or lookup an account with * the ACME server */ public boolean createAccount(AcmeAccount account, boolean staging) throws AcmeException { return createAccount(account, staging, false); }
/** * Create an account with an ACME server using the given account information. * * @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 * @return {@code true} if the account was created, {@code false} if the account already existed * @throws AcmeException if an error occurs while attempting to create or lookup an account with * the ACME server */ public boolean createAccount(AcmeAccount account, boolean staging) throws AcmeException { return createAccount(account, staging, false); }
/** * Create an account with an ACME server using the given account information. * * @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 * @return {@code true} if the account was created, {@code false} if the account already existed * @throws AcmeException if an error occurs while attempting to create or lookup an account with * the ACME server */ public boolean createAccount(AcmeAccount account, boolean staging) throws AcmeException { return createAccount(account, staging, false); }
private String getAccountUrl(AcmeAccount account, boolean staging) throws AcmeException { String accountUrl = account.getAccountUrl(); if (accountUrl == null) { createAccount(account, staging, true); accountUrl = account.getAccountUrl(); if (accountUrl == null) { acme.acmeAccountDoesNotExist(); } } return accountUrl; }
private String getAccountUrl(AcmeAccount account, boolean staging) throws AcmeException { String accountUrl = account.getAccountUrl(); if (accountUrl == null) { createAccount(account, staging, true); accountUrl = account.getAccountUrl(); if (accountUrl == null) { acme.acmeAccountDoesNotExist(); } } return accountUrl; }
private String getAccountUrl(AcmeAccount account, boolean staging) throws AcmeException { String accountUrl = account.getAccountUrl(); if (accountUrl == null) { createAccount(account, staging, true); accountUrl = account.getAccountUrl(); if (accountUrl == null) { acme.acmeAccountDoesNotExist(); } } return accountUrl; }
@Override protected void executeRuntimeStep(final OperationContext context, final ModelNode operation) throws OperationFailedException { boolean agreeToTermsOfService = AGREE_TO_TERMS_OF_SERVICE.resolveModelAttribute(context, operation).asBoolean(); boolean staging = STAGING.resolveModelAttribute(context, operation).asBoolean(); AcmeAccount acmeAccount = getAcmeAccount(context, staging); try { acmeAccount.setTermsOfServiceAgreed(agreeToTermsOfService); boolean created = acmeClient.createAccount(acmeAccount, staging); if (! created) { throw ROOT_LOGGER.certificateAuthorityAccountAlreadyExists(ElytronDescriptionConstants.UPDATE_ACCOUNT, ElytronDescriptionConstants.CHANGE_ACCOUNT_KEY); } } catch (AcmeException e) { throw ROOT_LOGGER.unableToCreateAccountWithCertificateAuthority(e, e.getLocalizedMessage()); } } }
created = acmeClient.createAccount(acmeAccount, staging);