Interface AlgorithmCredential

All Superinterfaces:
Cloneable, Credential
All Known Subinterfaces:
X509CertificateChainCredential
All Known Implementing Classes:
KeyPairCredential, PasswordCredential, PublicKeyCredential, SecretKeyCredential, X509CertificateChainPrivateCredential, X509CertificateChainPublicCredential

public interface AlgorithmCredential extends Credential
A credential which has an associated algorithm name.
  • Method Details

    • getAlgorithm

      String getAlgorithm()
      Get the algorithm name associated with this credential (will never be null).
      Returns:
      the algorithm name
    • getParameters

      default AlgorithmParameterSpec getParameters()
      Get the default algorithm parameters of the any type from this credential.
      Returns:
      the parameter specification, or null if no parameters are present or available or the given type was not supported by this credential
    • getParameters

      default <P extends AlgorithmParameterSpec> P getParameters(Class<P> paramSpecClass)
      Get the algorithm parameters of the given type from this credential.
      Parameters:
      paramSpecClass - the parameter specification class (must not be null)
      Returns:
      the parameter specification, or null if no parameters are present or available or the given type was not supported by this credential
    • supportsParameters

      default boolean supportsParameters()
      Determine whether this credential instance supports any algorithm parameter type.
      Returns:
      true if parameters are supported, false otherwise
    • supportsParameters

      default boolean supportsParameters(Class<? extends AlgorithmParameterSpec> paramSpecClass)
      Determine whether this credential instance supports the given algorithm parameter type.
      Parameters:
      paramSpecClass - the parameter specification class (must not be null)
      Returns:
      true if the parameter type is supported, false otherwise
    • impliesParameters

      default boolean impliesParameters(AlgorithmParameterSpec parameterSpec)
      Determine whether this credential implies the given parameters. The default implementation returns false always.
      Parameters:
      parameterSpec - the parameters to test for (must not be null)
      Returns:
      true if the given parameters match this credential, false otherwise
    • impliesSameParameters

      default boolean impliesSameParameters(AlgorithmCredential other)
      Determine whether the other credential's parameters are implied by this one.
      Parameters:
      other - the other credential (must not be null)
      Returns:
      true if the credentials have matching parameters, false otherwise
    • clone

      Creates and returns a copy of this Credential.
      Specified by:
      clone in interface Credential
      Returns:
      a copy of this Credential.
    • matches

      default boolean matches(Credential other)
      Description copied from interface: Credential
      Determine if this credential is the same kind of credential as the given credential.
      Specified by:
      matches in interface Credential
      Parameters:
      other - the other credential
      Returns:
      true if the credentials are of the same kind, false otherwise
    • matches

      default boolean matches(AlgorithmCredential other)
      Description copied from interface: Credential
      Determine if this credential is the same kind of credential as the given credential.
      Specified by:
      matches in interface Credential
      Parameters:
      other - the other credential
      Returns:
      true if the credentials are of the same kind, false otherwise
    • matches

      default boolean matches(Class<? extends Credential> credentialType, String algorithmName, AlgorithmParameterSpec parameterSpec)
      Description copied from interface: Credential
      Determine if this credential matches the given criteria.
      Specified by:
      matches in interface Credential
      Parameters:
      credentialType - the credential type class to check
      algorithmName - the name of the algorithm or null if any algorithm is acceptable
      parameterSpec - the parameter specification or null if any parameter specification is acceptable
      Returns:
      true if the credential matches the specification, false otherwise