/** * Get the acquired credential, if it is set and of the given type and algorithm, and if so, return the credential cast to the type. * * @param credentialType the credential type class (must not be {@code null}) * @param algorithmName the algorithm name * @param <C> the credential type * @return the credential, or {@code null} if the criteria are not met */ public <C extends Credential> C getCredential(Class<C> credentialType, String algorithmName) { return applyToCredential(credentialType, algorithmName, Function.identity()); }
/** * Set the credential. The credential must be of the supported type and algorithm. * * @param credential the credential, or {@code null} to indicate that no credential is available * @throws IllegalArgumentException if the given credential is not supported */ public void setCredential(final Credential credential) { if (credential != null && ! isCredentialSupported(credential)) { throw ElytronMessages.log.credentialNotSupported(); } this.credential = credential; }
/** * Determine whether the given credential type is supported. Will be {@code false} if the credential type requires * an algorithm name; in this case, use {@link #isCredentialTypeSupported(Class, String)} instead. * * @param credentialType the credential type (must not be {@code null}) * @return {@code true} if the credential type is supported, {@code false} otherwise */ public boolean isCredentialTypeSupported(final Class<? extends Credential> credentialType) { return isCredentialTypeSupported(credentialType, null); }
/** * Get the acquired credential, if it is set and of the given type, and if so, return the credential cast to the type. * * @param credentialType the credential type class (must not be {@code null}) * @param <C> the credential type * @return the credential, or {@code null} if the criteria wasn't met */ public <C extends Credential> C getCredential(Class<C> credentialType) { return applyToCredential(credentialType, Function.identity()); }
/** * Determine whether the given credential type is supported for the given algorithm name. * * @param credentialType the credential type (must not be {@code null}) * @param algorithmName the algorithm name, or {@code null} to indicate that no algorithm name will be available * @param parameterSpec the parameters, or {@code null} if no parameters are present in the credential * @return {@code true} if the credential type is supported, {@code false} otherwise */ public boolean isCredentialTypeSupported(final Class<? extends Credential> credentialType, final String algorithmName, final AlgorithmParameterSpec parameterSpec) { Assert.checkNotNullParam("credentialType", credentialType); return isCredentialTypeSupported(credentialType, algorithmName) && (this.parameterSpec == null || this.parameterSpec.equals(parameterSpec)); }
/** * Set the credential. The credential must be of the supported type and algorithm. * * @param credential the credential, or {@code null} to indicate that no credential is available * @throws IllegalArgumentException if the given credential is not supported */ public void setCredential(final Credential credential) { if (credential != null && ! isCredentialSupported(credential)) { throw ElytronMessages.log.credentialNotSupported(); } this.credential = credential; }
/** * Get the acquired credential, if it is set and of the given type, algorithm, and parameters, and if so, return the credential cast to the type. * * @param credentialType the credential type class (must not be {@code null}) * @param algorithmName the algorithm name * @param parameterSpec the parameter specification to match, or {@code null} if any parameters are allowed or parameters are not used by * the credential type * @param <C> the credential type * @return the credential, or {@code null} if the criteria are not met */ public <C extends Credential> C getCredential(Class<C> credentialType, String algorithmName, AlgorithmParameterSpec parameterSpec) { return applyToCredential(credentialType, algorithmName, parameterSpec, Function.identity()); }
/** * Determine whether the given credential type is supported. Will be {@code false} if the credential type requires * an algorithm name; in this case, use {@link #isCredentialTypeSupported(Class, String)} instead. * * @param credentialType the credential type (must not be {@code null}) * @return {@code true} if the credential type is supported, {@code false} otherwise */ public boolean isCredentialTypeSupported(final Class<? extends Credential> credentialType) { return isCredentialTypeSupported(credentialType, null); }
/** * Set the credential. The credential must be of the supported type and algorithm. * * @param credential the credential, or {@code null} to indicate that no credential is available * @throws IllegalArgumentException if the given credential is not supported */ public void setCredential(final Credential credential) { if (credential != null && ! isCredentialSupported(credential)) { throw ElytronMessages.log.credentialNotSupported(); } this.credential = credential; }
/** * Get the acquired credential, if it is set and of the given type, and if so, return the credential cast to the type. * * @param credentialType the credential type class (must not be {@code null}) * @param <C> the credential type * @return the credential, or {@code null} if the criteria wasn't met */ public <C extends Credential> C getCredential(Class<C> credentialType) { return applyToCredential(credentialType, Function.identity()); }
/** * Determine whether the given credential type is supported. Will be {@code false} if the credential type requires * an algorithm name; in this case, use {@link #isCredentialTypeSupported(Class, String)} instead. * * @param credentialType the credential type (must not be {@code null}) * @return {@code true} if the credential type is supported, {@code false} otherwise */ public boolean isCredentialTypeSupported(final Class<? extends Credential> credentialType) { return isCredentialTypeSupported(credentialType, null); }
/** * Set the credential. The credential must be of the supported type and algorithm. * * @param credential the credential, or {@code null} to indicate that no credential is available * @throws IllegalArgumentException if the given credential is not supported */ public void setCredential(final Credential credential) { if (credential != null && ! isCredentialSupported(credential)) { throw ElytronMessages.log.credentialNotSupported(); } this.credential = credential; }
/** * Get the acquired credential, if it is set and of the given type and algorithm, and if so, return the credential cast to the type. * * @param credentialType the credential type class (must not be {@code null}) * @param algorithmName the algorithm name * @param <C> the credential type * @return the credential, or {@code null} if the criteria are not met */ public <C extends Credential> C getCredential(Class<C> credentialType, String algorithmName) { return applyToCredential(credentialType, algorithmName, Function.identity()); }
/** * Determine whether the given credential type is supported. Will be {@code false} if the credential type requires * an algorithm name; in this case, use {@link #isCredentialTypeSupported(Class, String)} instead. * * @param credentialType the credential type (must not be {@code null}) * @return {@code true} if the credential type is supported, {@code false} otherwise */ public boolean isCredentialTypeSupported(final Class<? extends Credential> credentialType) { return isCredentialTypeSupported(credentialType, null); }
/** * Get the acquired credential, if it is set and of the given type and algorithm, and if so, return the credential cast to the type. * * @param credentialType the credential type class (must not be {@code null}) * @param algorithmName the algorithm name * @param <C> the credential type * @return the credential, or {@code null} if the criteria are not met */ public <C extends Credential> C getCredential(Class<C> credentialType, String algorithmName) { return applyToCredential(credentialType, algorithmName, Function.identity()); }
/** * Determine whether the given credential type is supported for the given algorithm name. * * @param credentialType the credential type (must not be {@code null}) * @param algorithmName the algorithm name, or {@code null} to indicate that no algorithm name will be available * @param parameterSpec the parameters, or {@code null} if no parameters are present in the credential * @return {@code true} if the credential type is supported, {@code false} otherwise */ public boolean isCredentialTypeSupported(final Class<? extends Credential> credentialType, final String algorithmName, final AlgorithmParameterSpec parameterSpec) { Assert.checkNotNullParam("credentialType", credentialType); return isCredentialTypeSupported(credentialType, algorithmName) && (this.parameterSpec == null || this.parameterSpec.equals(parameterSpec)); }
/** * Get the acquired credential, if it is set and of the given type and algorithm, and if so, return the credential cast to the type. * * @param credentialType the credential type class (must not be {@code null}) * @param algorithmName the algorithm name * @param <C> the credential type * @return the credential, or {@code null} if the criteria are not met */ public <C extends Credential> C getCredential(Class<C> credentialType, String algorithmName) { return applyToCredential(credentialType, algorithmName, Function.identity()); }
/** * Determine whether the given credential type is supported for the given algorithm name. * * @param credentialType the credential type (must not be {@code null}) * @param algorithmName the algorithm name, or {@code null} to indicate that no algorithm name will be available * @param parameterSpec the parameters, or {@code null} if no parameters are present in the credential * @return {@code true} if the credential type is supported, {@code false} otherwise */ public boolean isCredentialTypeSupported(final Class<? extends Credential> credentialType, final String algorithmName, final AlgorithmParameterSpec parameterSpec) { Assert.checkNotNullParam("credentialType", credentialType); return isCredentialTypeSupported(credentialType, algorithmName) && (this.parameterSpec == null || this.parameterSpec.equals(parameterSpec)); }
/** * Get the acquired credential, if it is set and of the given type, and if so, return the credential cast to the type. * * @param credentialType the credential type class (must not be {@code null}) * @param <C> the credential type * @return the credential, or {@code null} if the criteria wasn't met */ public <C extends Credential> C getCredential(Class<C> credentialType) { return applyToCredential(credentialType, Function.identity()); }
/** * Determine whether the given credential type is supported for the given algorithm name. * * @param credentialType the credential type (must not be {@code null}) * @param algorithmName the algorithm name, or {@code null} to indicate that no algorithm name will be available * @param parameterSpec the parameters, or {@code null} if no parameters are present in the credential * @return {@code true} if the credential type is supported, {@code false} otherwise */ public boolean isCredentialTypeSupported(final Class<? extends Credential> credentialType, final String algorithmName, final AlgorithmParameterSpec parameterSpec) { Assert.checkNotNullParam("credentialType", credentialType); return isCredentialTypeSupported(credentialType, algorithmName) && (this.parameterSpec == null || this.parameterSpec.equals(parameterSpec)); }