Package org.wildfly.security.evidence
Interface Evidence
-
- All Known Subinterfaces:
AlgorithmEvidence
- All Known Implementing Classes:
BearerTokenEvidence,PasswordGuessEvidence,X509PeerCertificateChainEvidence
public interface EvidenceA piece of evidence which may be used for credential verification.- Author:
- David M. Lloyd, Darran Lofthouse
-
-
Method Summary
All Methods Instance Methods Default Methods Deprecated Methods Modifier and Type Method Description default <E extends Evidence,R>
RcastAndApply(Class<E> evidenceType, String algorithmName, Function<E,R> function)Cast this evidence type and apply a function if the type matches.default <E extends Evidence,R>
RcastAndApply(Class<E> evidenceType, Function<E,R> function)Cast this evidence type and apply a function if the type matches.default <E extends Evidence>
EcastAs(Class<E> evidenceType)Cast this evidence type if the type matches.default <E extends Evidence>
EcastAs(Class<E> evidenceType, String algorithmName)Cast this evidence type if the type and algorithm matches.default PrincipalgetDecodedPrincipal()Get thePrincipalderived from this evidence using an evidence decoder (may benull).default PrincipalgetDefaultPrincipal()Get the defaultPrincipalassociated with this evidence (may benull).default PrincipalgetPrincipal()Deprecated.UsegetDefaultPrincipal()orgetDecodedPrincipal()instead.default voidsetDecodedPrincipal(Principal principal)Set thePrincipalderived from this evidence using an evidence decoder (may benull).
-
-
-
Method Detail
-
getPrincipal
@Deprecated default Principal getPrincipal()
Deprecated.UsegetDefaultPrincipal()orgetDecodedPrincipal()instead.Get thePrincipalwhich can be derived from this evidence, this can benullif there is no derived Principal.- Returns:
- the
Principalwhich can be derived from this evidence, this can benullif there is no derived Principal.
-
getDefaultPrincipal
default Principal getDefaultPrincipal()
Get the defaultPrincipalassociated with this evidence (may benull).- Returns:
- the default
Principalassociated with this evidence (may benull) - Since:
- 1.10.0
-
getDecodedPrincipal
default Principal getDecodedPrincipal()
Get thePrincipalderived from this evidence using an evidence decoder (may benull).- Returns:
- the
Principalderived from this evidence using an evidence decoder (may benull) - Since:
- 1.10.0
-
setDecodedPrincipal
default void setDecodedPrincipal(Principal principal)
Set thePrincipalderived from this evidence using an evidence decoder (may benull). This method is a no-op by default. It is intended to be implemented by evidence types that can be associated with a principal derived from an evidence decoder.- Parameters:
principal- the principal derived from this evidence using an evidence decoder (may benull)- Since:
- 1.10.0
-
castAs
default <E extends Evidence> E castAs(Class<E> evidenceType, String algorithmName)
Cast this evidence type if the type and algorithm matches.- Type Parameters:
E- the evidence type- Parameters:
evidenceType- the evidence type class to checkalgorithmName- the name of the algorithm ornullif any algorithm is acceptable- Returns:
- the evidence cast as the target type, or
nullif the evidence does not match the criteria
-
castAs
default <E extends Evidence> E castAs(Class<E> evidenceType)
Cast this evidence type if the type matches.- Type Parameters:
E- the evidence type- Parameters:
evidenceType- the evidence type class to check- Returns:
- the evidence cast as the target type, or
nullif the evidence does not match the criteria
-
castAndApply
default <E extends Evidence,R> R castAndApply(Class<E> evidenceType, String algorithmName, Function<E,R> function)
Cast this evidence type and apply a function if the type matches.- Type Parameters:
E- the evidence typeR- the return type- Parameters:
evidenceType- the evidence type class to checkalgorithmName- the name of the algorithm ornullif any algorithm is acceptablefunction- the function to apply- Returns:
- the result of the function, or
nullif the evidence is not of the given type
-
castAndApply
default <E extends Evidence,R> R castAndApply(Class<E> evidenceType, Function<E,R> function)
Cast this evidence type and apply a function if the type matches.- Type Parameters:
E- the evidence typeR- the return type- Parameters:
evidenceType- the evidence type class to checkfunction- the function to apply- Returns:
- the result of the function, or
nullif the evidence is not of the given type
-
-