Package org.wildfly.security.evidence
Interface AlgorithmEvidence
- All Superinterfaces:
Evidence
- All Known Implementing Classes:
X509PeerCertificateChainEvidence
A piece of evidence which supports multiple algorithms.
- Author:
- David M. Lloyd
-
Method Summary
Modifier and TypeMethodDescriptiondefault <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.Get the algorithm name associated with this evidence (will never benull).Methods inherited from interface org.wildfly.security.evidence.Evidence
castAndApply, castAs, castAs, getDecodedPrincipal, getDefaultPrincipal, getPrincipal, setDecodedPrincipal
-
Method Details
-
getAlgorithm
String getAlgorithm()Get the algorithm name associated with this evidence (will never benull).- Returns:
- the algorithm name
-
castAndApply
default <E extends Evidence,R> R castAndApply(Class<E> evidenceType, String algorithmName, Function<E, R> function) Description copied from interface:EvidenceCast this evidence type and apply a function if the type matches.- Specified by:
castAndApplyin interfaceEvidence- 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
-