@Override public final CredentialStoreException cannotRemoveCredentialFromStore(final Throwable cause) { final CredentialStoreException result = new CredentialStoreException(String.format(getLoggingLocale(), cannotRemoveCredentialFromStore$str()), cause); final StackTraceElement[] st = result.getStackTrace(); result.setStackTrace(Arrays.copyOfRange(st, 1, st.length)); return result; } private static final String cannotFlushCredentialStore = "ELY09513: Unable to flush credential store to storage";
void init(String cryptographicAlgorithm, String keyAlias, KeyStore keyStore, char[] keyPassword, KeyStore dataKeyStore) throws CredentialStoreException { if (cryptographicAlgorithm == null) cryptographicAlgorithm = DEFAULT_CRYPTOGRAPHIC_ALGORITHM; storageSecretKeyStore = keyStore; this.dataKeyStore = dataKeyStore; try { fetchStorageSecretKey(keyAlias, keyPassword); Provider provider = keyStore.getProvider(); try { encrypt = Cipher.getInstance(cryptographicAlgorithm, provider); } catch (NoSuchAlgorithmException e) { // fallback to any provider of desired algorithm encrypt = Cipher.getInstance(cryptographicAlgorithm); } try { decrypt = Cipher.getInstance(cryptographicAlgorithm, provider); } catch (NoSuchAlgorithmException e) { // fallback to any provider of desired algorithm decrypt = Cipher.getInstance(cryptographicAlgorithm); } } catch (NoSuchAlgorithmException | NoSuchPaddingException | UnrecoverableEntryException | KeyStoreException | IOException | CertificateException e) { throw new CredentialStoreException(e); } }
void init(String cryptographicAlgorithm, String keyAlias, KeyStore keyStore, char[] keyPassword, KeyStore dataKeyStore) throws CredentialStoreException { if (cryptographicAlgorithm == null) cryptographicAlgorithm = DEFAULT_CRYPTOGRAPHIC_ALGORITHM; storageSecretKeyStore = keyStore; this.dataKeyStore = dataKeyStore; try { fetchStorageSecretKey(keyAlias, keyPassword); Provider provider = keyStore.getProvider(); try { encrypt = Cipher.getInstance(cryptographicAlgorithm, provider); } catch (NoSuchAlgorithmException e) { // fallback to any provider of desired algorithm encrypt = Cipher.getInstance(cryptographicAlgorithm); } try { decrypt = Cipher.getInstance(cryptographicAlgorithm, provider); } catch (NoSuchAlgorithmException e) { // fallback to any provider of desired algorithm decrypt = Cipher.getInstance(cryptographicAlgorithm); } } catch (NoSuchAlgorithmException | NoSuchPaddingException | UnrecoverableEntryException | KeyStoreException | IOException | CertificateException e) { throw new CredentialStoreException(e); } }
@Override public final CredentialStoreException cannotFlushCredentialStore(final Throwable cause) { final CredentialStoreException result = new CredentialStoreException(String.format(getLoggingLocale(), cannotFlushCredentialStore$str()), cause); final StackTraceElement[] st = result.getStackTrace(); result.setStackTrace(Arrays.copyOfRange(st, 1, st.length)); return result; } private static final String cannotInitializeCredentialStore = "ELY09514: Unable to initialize credential store";
void init(String cryptographicAlgorithm, String keyAlias, KeyStore keyStore, char[] keyPassword, KeyStore dataKeyStore) throws CredentialStoreException { if (cryptographicAlgorithm == null) cryptographicAlgorithm = DEFAULT_CRYPTOGRAPHIC_ALGORITHM; storageSecretKeyStore = keyStore; this.dataKeyStore = dataKeyStore; try { fetchStorageSecretKey(keyAlias, keyPassword); Provider provider = keyStore.getProvider(); try { encrypt = Cipher.getInstance(cryptographicAlgorithm, provider); } catch (NoSuchAlgorithmException e) { // fallback to any provider of desired algorithm encrypt = Cipher.getInstance(cryptographicAlgorithm); } try { decrypt = Cipher.getInstance(cryptographicAlgorithm, provider); } catch (NoSuchAlgorithmException e) { // fallback to any provider of desired algorithm decrypt = Cipher.getInstance(cryptographicAlgorithm); } } catch (NoSuchAlgorithmException | NoSuchPaddingException | UnrecoverableEntryException | KeyStoreException | IOException | CertificateException e) { throw new CredentialStoreException(e); } }
@Override public final CredentialStoreException cannotInitializeCredentialStore(final Throwable cause) { final CredentialStoreException result = new CredentialStoreException(String.format(getLoggingLocale(), cannotInitializeCredentialStore$str()), cause); final StackTraceElement[] st = result.getStackTrace(); result.setStackTrace(Arrays.copyOfRange(st, 1, st.length)); return result; } @Override
void init(String cryptographicAlgorithm, String keyAlias, KeyStore keyStore, char[] keyPassword, KeyStore dataKeyStore) throws CredentialStoreException { if (cryptographicAlgorithm == null) cryptographicAlgorithm = DEFAULT_CRYPTOGRAPHIC_ALGORITHM; storageSecretKeyStore = keyStore; this.dataKeyStore = dataKeyStore; try { fetchStorageSecretKey(keyAlias, keyPassword); Provider provider = keyStore.getProvider(); try { encrypt = Cipher.getInstance(cryptographicAlgorithm, provider); } catch (NoSuchAlgorithmException e) { // fallback to any provider of desired algorithm encrypt = Cipher.getInstance(cryptographicAlgorithm); } try { decrypt = Cipher.getInstance(cryptographicAlgorithm, provider); } catch (NoSuchAlgorithmException e) { // fallback to any provider of desired algorithm decrypt = Cipher.getInstance(cryptographicAlgorithm); } } catch (NoSuchAlgorithmException | NoSuchPaddingException | UnrecoverableEntryException | KeyStoreException | IOException | CertificateException e) { throw new CredentialStoreException(e); } }
@Override public final CredentialStoreException protectionParameterRequired() { final CredentialStoreException result = new CredentialStoreException(String.format(getLoggingLocale(), protectionParameterRequired$str())); final StackTraceElement[] st = result.getStackTrace(); result.setStackTrace(Arrays.copyOfRange(st, 1, st.length)); return result; } private static final String automaticStorageCreationDisabled = "ELY09518: Automatic storage creation for the Credential Store is disabled \"%s\"";
@Override public final CredentialStoreException algorithmNotBlockBased(final String algorithm) { final CredentialStoreException result = new CredentialStoreException(String.format(getLoggingLocale(), algorithmNotBlockBased$str(), algorithm)); final StackTraceElement[] st = result.getStackTrace(); result.setStackTrace(Arrays.copyOfRange(st, 1, st.length)); return result; } private static final String algorithmNotIV = "ELY09523: Algorithm \"%s\" does not use an initialization vector (IV)";
@Override public final CredentialStoreException wrongTypeOfExternalStorageKey(final String keyAlias) { final CredentialStoreException result = new CredentialStoreException(String.format(getLoggingLocale(), wrongTypeOfExternalStorageKey$str(), keyAlias)); final StackTraceElement[] st = result.getStackTrace(); result.setStackTrace(Arrays.copyOfRange(st, 1, st.length)); return result; } private static final String duplicateAttributeFound = "ELY09501: Duplicate attribute (\"%s\") found in configuration.";
@Override public final CredentialStoreException cannotWriteCredentialToStore(final Throwable cause) { final CredentialStoreException result = new CredentialStoreException(String.format(getLoggingLocale(), cannotWriteCredentialToStore$str()), cause); final StackTraceElement[] st = result.getStackTrace(); result.setStackTrace(Arrays.copyOfRange(st, 1, st.length)); return result; } private static final String unsupportedCredentialType = "ELY09509: Unsupported credential type %s";
@Override public final CredentialStoreException unsupportedAttribute(final String attribute, final java.util.List<String> validAttribute) { final CredentialStoreException result = new CredentialStoreException(String.format(getLoggingLocale(), unsupportedAttribute$str(), attribute, validAttribute)); final StackTraceElement[] st = result.getStackTrace(); result.setStackTrace(Arrays.copyOfRange(st, 1, st.length)); return result; } private static final String xmlInvalidCredentialStoreRef = "ELY09527: Invalid credential store reference";
@Override public final CredentialStoreException externalPathMissing(final String keyStoreType) { final CredentialStoreException result = new CredentialStoreException(String.format(getLoggingLocale(), externalPathMissing$str(), keyStoreType)); final StackTraceElement[] st = result.getStackTrace(); result.setStackTrace(Arrays.copyOfRange(st, 1, st.length)); return result; } private static final String extensionAlreadyExists = "ELY10000: X.509 certificate extension with OID %s already exists";
@Override public final CredentialStoreException invalidCredentialStoreEntryType(final Class<? extends java.security.KeyStore.Entry> entryType, final Class<? extends java.security.KeyStore.Entry> expectedType) { final CredentialStoreException result = new CredentialStoreException(String.format(getLoggingLocale(), invalidCredentialStoreEntryType$str(), entryType, expectedType)); final StackTraceElement[] st = result.getStackTrace(); result.setStackTrace(Arrays.copyOfRange(st, 1, st.length)); return result; } private static final String unableToReadCredentialTypeFromStore = "ELY09511: Unable to read credential %s from store";
@Override public final CredentialStoreException unableToReadCredentialTypeFromStore(final Class<? extends org.wildfly.security.credential.Credential> credentialType) { final CredentialStoreException result = new CredentialStoreException(String.format(getLoggingLocale(), unableToReadCredentialTypeFromStore$str(), credentialType)); final StackTraceElement[] st = result.getStackTrace(); result.setStackTrace(Arrays.copyOfRange(st, 1, st.length)); return result; } private static final String cannotRemoveCredentialFromStore = "ELY09512: Unable to remove credential from store";
@Override public final CredentialStoreException locationAndExternalPathAreIdentical(final String location, final String externalPath) { final CredentialStoreException result = new CredentialStoreException(String.format(getLoggingLocale(), locationAndExternalPathAreIdentical$str(), location, externalPath)); final StackTraceElement[] st = result.getStackTrace(); result.setStackTrace(Arrays.copyOfRange(st, 1, st.length)); return result; } private static final String unsupportedAttribute = "ELY09526: Unable to initialize credential store as attribute %s is unsupported in %s";
@Override public final CredentialStoreException invalidProtectionParameter(final ProtectionParameter protectionParameter) { final CredentialStoreException result = new CredentialStoreException(String.format(getLoggingLocale(), invalidProtectionParameter$str(), protectionParameter)); final StackTraceElement[] st = result.getStackTrace(); result.setStackTrace(Arrays.copyOfRange(st, 1, st.length)); return result; } private static final String cannotWriteCredentialToStore = "ELY09508: Cannot write credential to store";
@Override public final CredentialStoreException automaticStorageCreationDisabled(final String location) { final CredentialStoreException result = new CredentialStoreException(String.format(getLoggingLocale(), automaticStorageCreationDisabled$str(), location)); final StackTraceElement[] st = result.getStackTrace(); result.setStackTrace(Arrays.copyOfRange(st, 1, st.length)); return result; } private static final String unexpectedFileVersion = "ELY09519: Unexpected credential store external storage file version \"%s\"";
@Override public final CredentialStoreException cannotAcquireCredentialFromStore(final Throwable cause) { final CredentialStoreException result = new CredentialStoreException(String.format(getLoggingLocale(), cannotAcquireCredentialFromStore$str()), cause); final StackTraceElement[] st = result.getStackTrace(); result.setStackTrace(Arrays.copyOfRange(st, 1, st.length)); return result; } private static final String nonModifiableCredentialStore = "ELY09505: Cannot perform operation '%s': Credential store is set non modifiable";
@Override public final CredentialStoreException nonModifiableCredentialStore(final String operation) { final CredentialStoreException result = new CredentialStoreException(String.format(getLoggingLocale(), nonModifiableCredentialStore$str(), operation)); final StackTraceElement[] st = result.getStackTrace(); result.setStackTrace(Arrays.copyOfRange(st, 1, st.length)); return result; } private static final String credentialCommandInterrupted = "ELY09506: Credential store command interrupted";