/** * Check whether credential store service has an entry associated with the given credential alias of specified * credential type. The default implementation simply attempts to retrieve the credential without a protection * parameter, and returns {@code true} if any credential was returned. Credential stores which use a protection * parameter should override this method. * * @param credentialAlias key to check existence * @param credentialType to class of credential to look for * @return {@code true} in case key exist in store otherwise {@code false} * @throws CredentialStoreException when there is a problem with credential store */ public boolean exists(String credentialAlias, Class<? extends Credential> credentialType) throws CredentialStoreException { return retrieve(credentialAlias, credentialType, null, null, null) != null; }
/** * Retrieve credential stored in the store under the key and of the credential type. * * @param credentialAlias to find the credential in the store * @param credentialType credential type to retrieve from under the credentialAlias from the store * @param credentialAlgorithm the credential algorithm to match, or {@code null} to match any * @param parameterSpec the parameter specification to match, or {@code null} to match any * @param protectionParameter the protection parameter to use, or {@code null} to use none * @param <C> the class of type to which should be credential casted * @return instance of {@link Credential} stored in the store * @throws CredentialStoreException if credentialAlias credentialType combination doesn't exist or credentialAlias cannot be retrieved */ public <C extends Credential> C retrieve(String credentialAlias, Class<C> credentialType, String credentialAlgorithm, AlgorithmParameterSpec parameterSpec, ProtectionParameter protectionParameter) throws CredentialStoreException { return spi.retrieve(credentialAlias, credentialType, credentialAlgorithm, parameterSpec, protectionParameter); }
/** * Check whether credential store service has an entry associated with the given credential alias of specified * credential type. The default implementation simply attempts to retrieve the credential without a protection * parameter, and returns {@code true} if any credential was returned. Credential stores which use a protection * parameter should override this method. * * @param credentialAlias key to check existence * @param credentialType to class of credential to look for * @return {@code true} in case key exist in store otherwise {@code false} * @throws CredentialStoreException when there is a problem with credential store */ public boolean exists(String credentialAlias, Class<? extends Credential> credentialType) throws CredentialStoreException { return retrieve(credentialAlias, credentialType, null, null, null) != null; }
/** * Retrieve credential stored in the store under the key and of the credential type. * * @param credentialAlias to find the credential in the store * @param credentialType credential type to retrieve from under the credentialAlias from the store * @param credentialAlgorithm the credential algorithm to match, or {@code null} to match any * @param parameterSpec the parameter specification to match, or {@code null} to match any * @param protectionParameter the protection parameter to use, or {@code null} to use none * @param <C> the class of type to which should be credential casted * @return instance of {@link Credential} stored in the store * @throws CredentialStoreException if credentialAlias credentialType combination doesn't exist or credentialAlias cannot be retrieved */ public <C extends Credential> C retrieve(String credentialAlias, Class<C> credentialType, String credentialAlgorithm, AlgorithmParameterSpec parameterSpec, ProtectionParameter protectionParameter) throws CredentialStoreException { return spi.retrieve(credentialAlias, credentialType, credentialAlgorithm, parameterSpec, protectionParameter); }
/** * Check whether credential store service has an entry associated with the given credential alias of specified * credential type. The default implementation simply attempts to retrieve the credential without a protection * parameter, and returns {@code true} if any credential was returned. Credential stores which use a protection * parameter should override this method. * * @param credentialAlias key to check existence * @param credentialType to class of credential to look for * @return {@code true} in case key exist in store otherwise {@code false} * @throws CredentialStoreException when there is a problem with credential store */ public boolean exists(String credentialAlias, Class<? extends Credential> credentialType) throws CredentialStoreException { return retrieve(credentialAlias, credentialType, null, null, null) != null; }
/** * Check whether credential store service has an entry associated with the given credential alias of specified * credential type. The default implementation simply attempts to retrieve the credential without a protection * parameter, and returns {@code true} if any credential was returned. Credential stores which use a protection * parameter should override this method. * * @param credentialAlias key to check existence * @param credentialType to class of credential to look for * @return {@code true} in case key exist in store otherwise {@code false} * @throws CredentialStoreException when there is a problem with credential store */ public boolean exists(String credentialAlias, Class<? extends Credential> credentialType) throws CredentialStoreException { return retrieve(credentialAlias, credentialType, null, null, null) != null; }
/** * Retrieve credential stored in the store under the key and of the credential type. * * @param credentialAlias to find the credential in the store * @param credentialType credential type to retrieve from under the credentialAlias from the store * @param credentialAlgorithm the credential algorithm to match, or {@code null} to match any * @param parameterSpec the parameter specification to match, or {@code null} to match any * @param protectionParameter the protection parameter to use, or {@code null} to use none * @param <C> the class of type to which should be credential casted * @return instance of {@link Credential} stored in the store * @throws CredentialStoreException if credentialAlias credentialType combination doesn't exist or credentialAlias cannot be retrieved */ public <C extends Credential> C retrieve(String credentialAlias, Class<C> credentialType, String credentialAlgorithm, AlgorithmParameterSpec parameterSpec, ProtectionParameter protectionParameter) throws CredentialStoreException { return spi.retrieve(credentialAlias, credentialType, credentialAlgorithm, parameterSpec, protectionParameter); }
/** * Retrieve credential stored in the store under the key and of the credential type. * * @param credentialAlias to find the credential in the store * @param credentialType credential type to retrieve from under the credentialAlias from the store * @param credentialAlgorithm the credential algorithm to match, or {@code null} to match any * @param parameterSpec the parameter specification to match, or {@code null} to match any * @param protectionParameter the protection parameter to use, or {@code null} to use none * @param <C> the class of type to which should be credential casted * @return instance of {@link Credential} stored in the store * @throws CredentialStoreException if credentialAlias credentialType combination doesn't exist or credentialAlias cannot be retrieved */ public <C extends Credential> C retrieve(String credentialAlias, Class<C> credentialType, String credentialAlgorithm, AlgorithmParameterSpec parameterSpec, ProtectionParameter protectionParameter) throws CredentialStoreException { return spi.retrieve(credentialAlias, credentialType, credentialAlgorithm, parameterSpec, protectionParameter); }