Package org.wildfly.security.evidence
Interface Evidence
-
- All Known Subinterfaces:
AlgorithmEvidence
- All Known Implementing Classes:
BearerTokenEvidence
,PasswordGuessEvidence
,X509PeerCertificateChainEvidence
public interface Evidence
A 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 Principal
getDecodedPrincipal()
Get thePrincipal
derived from this evidence using an evidence decoder (may benull
).default Principal
getDefaultPrincipal()
Get the defaultPrincipal
associated with this evidence (may benull
).default Principal
getPrincipal()
Deprecated.UsegetDefaultPrincipal()
orgetDecodedPrincipal()
instead.default void
setDecodedPrincipal(Principal principal)
Set thePrincipal
derived from this evidence using an evidence decoder (may benull
).
-
-
-
Method Detail
-
getPrincipal
@Deprecated default Principal getPrincipal()
Deprecated.UsegetDefaultPrincipal()
orgetDecodedPrincipal()
instead.Get thePrincipal
which can be derived from this evidence, this can benull
if there is no derived Principal.- Returns:
- the
Principal
which can be derived from this evidence, this can benull
if there is no derived Principal.
-
getDefaultPrincipal
default Principal getDefaultPrincipal()
Get the defaultPrincipal
associated with this evidence (may benull
).- Returns:
- the default
Principal
associated with this evidence (may benull
) - Since:
- 1.10.0
-
getDecodedPrincipal
default Principal getDecodedPrincipal()
Get thePrincipal
derived from this evidence using an evidence decoder (may benull
).- Returns:
- the
Principal
derived from this evidence using an evidence decoder (may benull
) - Since:
- 1.10.0
-
setDecodedPrincipal
default void setDecodedPrincipal(Principal principal)
Set thePrincipal
derived 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 ornull
if any algorithm is acceptable- Returns:
- the evidence cast as the target type, or
null
if 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
null
if 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 ornull
if any algorithm is acceptablefunction
- the function to apply- Returns:
- the result of the function, or
null
if 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
null
if the evidence is not of the given type
-
-