Class PublicKeyCredential

java.lang.Object
org.wildfly.security.credential.PublicKeyCredential
All Implemented Interfaces:
Cloneable, AlgorithmCredential, Credential

public final class PublicKeyCredential extends Object implements AlgorithmCredential
A public key credential.
  • Constructor Details

    • PublicKeyCredential

      public PublicKeyCredential(PublicKey publicKey)
      Construct a new instance.
      Parameters:
      publicKey - the public key (may not be null)
  • Method Details

    • getPublicKey

      public PublicKey getPublicKey()
      Get the public key.
      Returns:
      the public key (not null)
    • supportsParameters

      public boolean supportsParameters(Class<? extends AlgorithmParameterSpec> paramSpecClass)
      Description copied from interface: AlgorithmCredential
      Determine whether this credential instance supports the given algorithm parameter type.
      Specified by:
      supportsParameters in interface AlgorithmCredential
      Parameters:
      paramSpecClass - the parameter specification class (must not be null)
      Returns:
      true if the parameter type is supported, false otherwise
    • getParameters

      public <P extends AlgorithmParameterSpec> P getParameters(Class<P> paramSpecClass)
      Description copied from interface: AlgorithmCredential
      Get the algorithm parameters of the given type from this credential.
      Specified by:
      getParameters in interface AlgorithmCredential
      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
    • impliesSameParameters

      public boolean impliesSameParameters(AlgorithmCredential other)
      Description copied from interface: AlgorithmCredential
      Determine whether the other credential's parameters are implied by this one.
      Specified by:
      impliesSameParameters in interface AlgorithmCredential
      Parameters:
      other - the other credential (must not be null)
      Returns:
      true if the credentials have matching parameters, false otherwise
    • getAlgorithm

      public String getAlgorithm()
      Get the public key algorithm.
      Specified by:
      getAlgorithm in interface AlgorithmCredential
      Returns:
      the public key algorithm name
    • clone

      public PublicKeyCredential clone()
      Description copied from interface: AlgorithmCredential
      Creates and returns a copy of this Credential.
      Specified by:
      clone in interface AlgorithmCredential
      Specified by:
      clone in interface Credential
      Overrides:
      clone in class Object
      Returns:
      a copy of this Credential.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object