public SupportLevel getCredentialAcquireSupport(final Class<? extends Credential> credentialType, final String algorithmName, final AlgorithmParameterSpec parameterSpec) throws IOException { Assert.checkNotNullParam("credentialType", credentialType); try { final CredentialStore credentialStore = credentialStoreFactory.create(); return credentialStore.exists(alias, credentialType) ? SupportLevel.POSSIBLY_SUPPORTED : SupportLevel.UNSUPPORTED; } catch (UnsupportedCredentialTypeException e) { return SupportLevel.UNSUPPORTED; } catch (GeneralSecurityException e) { throw log.unableToReadCredential(e); } }
public <C extends Credential> C getCredential(final Class<C> credentialType, final String algorithmName, final AlgorithmParameterSpec parameterSpec) throws IOException { Assert.checkNotNullParam("credentialType", credentialType); try { final CredentialStore credentialStore = credentialStoreFactory.create(); if (log.isTraceEnabled()) { log.tracef("CredentialStoreCredentialSource: obtaining credential: type = %s algorithm = %s exists = %b", alias, credentialType, credentialStore.exists(alias, credentialType)); } return credentialStore.retrieve(alias, credentialType, algorithmName, parameterSpec); } catch (UnsupportedCredentialTypeException e) { return null; } catch (GeneralSecurityException e) { throw log.unableToReadCredential(e); } } }
public SupportLevel getCredentialAcquireSupport(final Class<? extends Credential> credentialType, final String algorithmName, final AlgorithmParameterSpec parameterSpec) throws IOException { Assert.checkNotNullParam("credentialType", credentialType); try { final CredentialStore credentialStore = credentialStoreFactory.create(); return credentialStore.exists(alias, credentialType) ? SupportLevel.POSSIBLY_SUPPORTED : SupportLevel.UNSUPPORTED; } catch (UnsupportedCredentialTypeException e) { return SupportLevel.UNSUPPORTED; } catch (GeneralSecurityException e) { throw log.unableToReadCredential(e); } }
public SupportLevel getCredentialAcquireSupport(final Class<? extends Credential> credentialType, final String algorithmName, final AlgorithmParameterSpec parameterSpec) throws IOException { Assert.checkNotNullParam("credentialType", credentialType); try { final CredentialStore credentialStore = credentialStoreFactory.create(); return credentialStore.exists(alias, credentialType) ? SupportLevel.POSSIBLY_SUPPORTED : SupportLevel.UNSUPPORTED; } catch (UnsupportedCredentialTypeException e) { return SupportLevel.UNSUPPORTED; } catch (GeneralSecurityException e) { throw log.unableToReadCredential(e); } }
public SupportLevel getCredentialAcquireSupport(final Class<? extends Credential> credentialType, final String algorithmName, final AlgorithmParameterSpec parameterSpec) throws IOException { Assert.checkNotNullParam("credentialType", credentialType); try { final CredentialStore credentialStore = credentialStoreFactory.create(); return credentialStore.exists(alias, credentialType) ? SupportLevel.POSSIBLY_SUPPORTED : SupportLevel.UNSUPPORTED; } catch (UnsupportedCredentialTypeException e) { return SupportLevel.UNSUPPORTED; } catch (GeneralSecurityException e) { throw log.unableToReadCredential(e); } }
if (cs.exists(alias, PasswordCredential.class)) { Password password = cs.retrieve(alias, PasswordCredential.class).getPassword(); if (password instanceof ClearPassword) {
public <C extends Credential> C getCredential(final Class<C> credentialType, final String algorithmName, final AlgorithmParameterSpec parameterSpec) throws IOException { Assert.checkNotNullParam("credentialType", credentialType); try { final CredentialStore credentialStore = credentialStoreFactory.create(); if (log.isTraceEnabled()) { log.tracef("CredentialStoreCredentialSource: obtaining credential: type = %s algorithm = %s exists = %b", alias, credentialType, credentialStore.exists(alias, credentialType)); } return credentialStore.retrieve(alias, credentialType, algorithmName, parameterSpec); } catch (UnsupportedCredentialTypeException e) { return null; } catch (GeneralSecurityException e) { throw log.unableToReadCredential(e); } } }
public <C extends Credential> C getCredential(final Class<C> credentialType, final String algorithmName, final AlgorithmParameterSpec parameterSpec) throws IOException { Assert.checkNotNullParam("credentialType", credentialType); try { final CredentialStore credentialStore = credentialStoreFactory.create(); if (log.isTraceEnabled()) { log.tracef("CredentialStoreCredentialSource: obtaining credential: type = %s algorithm = %s exists = %b", alias, credentialType, credentialStore.exists(alias, credentialType)); } return credentialStore.retrieve(alias, credentialType, algorithmName, parameterSpec); } catch (UnsupportedCredentialTypeException e) { return null; } catch (GeneralSecurityException e) { throw log.unableToReadCredential(e); } } }
public <C extends Credential> C getCredential(final Class<C> credentialType, final String algorithmName, final AlgorithmParameterSpec parameterSpec) throws IOException { Assert.checkNotNullParam("credentialType", credentialType); try { final CredentialStore credentialStore = credentialStoreFactory.create(); if (log.isTraceEnabled()) { log.tracef("CredentialStoreCredentialSource: obtaining credential: type = %s algorithm = %s exists = %b", alias, credentialType, credentialStore.exists(alias, credentialType)); } return credentialStore.retrieve(alias, credentialType, algorithmName, parameterSpec); } catch (UnsupportedCredentialTypeException e) { return null; } catch (GeneralSecurityException e) { throw log.unableToReadCredential(e); } } }
CredentialStore credentialStore = credentialStoreService.getValue(); if (entryType == null || entryType.equals(PasswordCredential.class.getCanonicalName())) { if (credentialStore.exists(alias, PasswordCredential.class)) { throw ROOT_LOGGER.credentialAlreadyExists(alias, PasswordCredential.class.getName()); if ( ! credentialStore.exists(alias, PasswordCredential.class)) { throw ROOT_LOGGER.credentialDoesNotExist(alias, PasswordCredential.class.getName());