Class AlgorithmPredicates
java.lang.Object
se.swedenconnect.security.algorithms.AlgorithmPredicates
A set of "ready-to-go" predicates to use when searching for algorithms in the
AlgorithmRegistry
.- Author:
- Martin Lindström (martin@idsec.se), Stefan Santesson (stefan@idsec.se)
-
Method Summary
Modifier and TypeMethodDescriptionfromAlgorithmIdentifier
(org.bouncycastle.asn1.x509.AlgorithmIdentifier algorithmIdentifier) Predicate for finding an algorithm based on itsAlgorithmIdentifier
.fromAlgorithmIdentifierRelaxed
(org.bouncycastle.asn1.x509.AlgorithmIdentifier algorithmIdentifier) Predicate for finding an algorithm based on itsAlgorithmIdentifier
.fromJcaName
(String jcaName) Predicate for finding an algorithm based on its JCA name.fromKeyType
(String keyType) Predicate for finding an algorithm based on its key type.fromType
(AlgorithmType type) Predicate for finding an algorithm based on its type.A predicate that can be combined with other predicates to ensure that the resultingAlgorithm
is not blacklisted.
-
Method Details
-
notBlacklisted
A predicate that can be combined with other predicates to ensure that the resultingAlgorithm
is not blacklisted.- Returns:
- a predicate
-
fromJcaName
Predicate for finding an algorithm based on its JCA name.- Parameters:
jcaName
- the JCA name- Returns:
- a predicate
-
fromType
Predicate for finding an algorithm based on its type.- Parameters:
type
- the algorithm type- Returns:
- a predicate
-
fromKeyType
Predicate for finding an algorithm based on its key type.- Parameters:
keyType
- the key type- Returns:
- a predicate
-
fromAlgorithmIdentifier
public static Predicate<Algorithm> fromAlgorithmIdentifier(org.bouncycastle.asn1.x509.AlgorithmIdentifier algorithmIdentifier) Predicate for finding an algorithm based on itsAlgorithmIdentifier
.- Parameters:
algorithmIdentifier
- the algorithm identifier- Returns:
- a predicate
-
fromAlgorithmIdentifierRelaxed
public static Predicate<Algorithm> fromAlgorithmIdentifierRelaxed(org.bouncycastle.asn1.x509.AlgorithmIdentifier algorithmIdentifier) Predicate for finding an algorithm based on itsAlgorithmIdentifier
. The method implementation is "relaxed" which means that if no parameters are supplied in thealgorithmIdentifier
the comparison of parameters will be excluded. This covers for the case when the special NULL param is used.Also, for RSA-PSS, we compare only the digest part of the parameters.
- Parameters:
algorithmIdentifier
- the algorithm identifier- Returns:
- a predicate
-