Class EvidenceVerifyCallback

java.lang.Object
org.wildfly.security.auth.callback.EvidenceVerifyCallback
All Implemented Interfaces:
Callback, ExtendedCallback

public class EvidenceVerifyCallback extends Object implements ExtendedCallback
A Callback for use where credential verification is required.
Author:
Darran Lofthouse
  • Constructor Summary

    Constructors
    Constructor
    Description
    EvidenceVerifyCallback(org.wildfly.security.evidence.Evidence evidence)
    Construct a new instance of this Callback.
  • Method Summary

    Modifier and Type
    Method
    Description
    <C extends org.wildfly.security.evidence.Evidence, R>
    R
    applyToEvidence(Class<C> evidenceType, String algorithmName, Function<C,R> function)
    Apply the given function to the acquired evidence, if it is set and of the given type and algorithm.
    <C extends org.wildfly.security.evidence.Evidence, R>
    R
    applyToEvidence(Class<C> evidenceType, Function<C,R> function)
    Apply the given function to the acquired evidence, if it is set and of the given type.
    org.wildfly.security.evidence.Evidence
    Get the evidence being verified.
    <C extends org.wildfly.security.evidence.Evidence>
    C
    getEvidence(Class<C> evidenceType)
    Get the acquired evidence, if it is set and of the given type, and if so, return the evidence cast to the type.
    <C extends org.wildfly.security.evidence.Evidence>
    C
    getEvidence(Class<C> evidenceType, String algorithmName)
    Get the acquired evidence, if it is set and of the given type and algorithm, and if so, return the evidence cast to the type.
    boolean
    This Callback is not optional as verification is required.
    boolean
    Get the verification state for the evidence referenced here.
    boolean
    This Callback needs to know if evidence validation was successful.
    void
    setVerified(boolean verified)
    Set if the evidence referenced here has been verified.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • EvidenceVerifyCallback

      public EvidenceVerifyCallback(org.wildfly.security.evidence.Evidence evidence)
      Construct a new instance of this Callback.
      Parameters:
      evidence - the evidence to be verified
  • Method Details

    • getEvidence

      public org.wildfly.security.evidence.Evidence getEvidence()
      Get the evidence being verified.
      Returns:
      the evidence being verified
    • getEvidence

      public <C extends org.wildfly.security.evidence.Evidence> C getEvidence(Class<C> evidenceType)
      Get the acquired evidence, if it is set and of the given type, and if so, return the evidence cast to the type.
      Type Parameters:
      C - the evidence type
      Parameters:
      evidenceType - the evidence type class (must not be null)
      Returns:
      the evidence, or null if the criteria wasn't met
    • getEvidence

      public <C extends org.wildfly.security.evidence.Evidence> C getEvidence(Class<C> evidenceType, String algorithmName)
      Get the acquired evidence, if it is set and of the given type and algorithm, and if so, return the evidence cast to the type.
      Type Parameters:
      C - the evidence type
      Parameters:
      evidenceType - the evidence type class (must not be null)
      algorithmName - the algorithm name
      Returns:
      the evidence, or null if the criteria are not met
    • applyToEvidence

      public <C extends org.wildfly.security.evidence.Evidence, R> R applyToEvidence(Class<C> evidenceType, Function<C,R> function)
      Apply the given function to the acquired evidence, if it is set and of the given type.
      Type Parameters:
      C - the evidence type
      R - the return type
      Parameters:
      evidenceType - the evidence type class (must not be null)
      function - the function to apply (must not be null)
      Returns:
      the result of the function, or null if the criteria are not met
    • applyToEvidence

      public <C extends org.wildfly.security.evidence.Evidence, R> R applyToEvidence(Class<C> evidenceType, String algorithmName, Function<C,R> function)
      Apply the given function to the acquired evidence, if it is set and of the given type and algorithm.
      Type Parameters:
      C - the evidence type
      R - the return type
      Parameters:
      evidenceType - the evidence type class (must not be null)
      algorithmName - the algorithm name
      function - the function to apply (must not be null)
      Returns:
      the result of the function, or null if the criteria are not met
    • setVerified

      public void setVerified(boolean verified)
      Set if the evidence referenced here has been verified.
      Parameters:
      verified - the verification state of the evidence
    • isVerified

      public boolean isVerified()
      Get the verification state for the evidence referenced here.
      Returns:
      true if the evidence has been verified, false otherwise
    • isOptional

      public boolean isOptional()
      This Callback is not optional as verification is required.
      Specified by:
      isOptional in interface ExtendedCallback
      Returns:
      true if the callback is optional, false if it is mandatory
    • needsInformation

      public boolean needsInformation()
      This Callback needs to know if evidence validation was successful.
      Specified by:
      needsInformation in interface ExtendedCallback
      Returns:
      true if the callback is requesting information, false if it is only providing information