Interface HashAlgorithmNegotiator
public interface HashAlgorithmNegotiator
Interface for a class that negotiates
HashAlgorithms
.
You can provide your own implementation using custom logic by implementing the
negotiateHashAlgorithm(Set)
method.-
Method Summary
Modifier and TypeMethodDescriptionstatic HashAlgorithmNegotiator
negotiateByPolicy
(Policy.HashAlgorithmPolicy hashAlgorithmPolicy) Return an instance that negotiatesHashAlgorithms
based on the givenPolicy.HashAlgorithmPolicy
.negotiateHashAlgorithm
(Set<HashAlgorithm> orderedHashAlgorithmPreferencesSet) Pick oneHashAlgorithm
from the ordered set of acceptable algorithms.static HashAlgorithmNegotiator
Return an instance that negotiatesHashAlgorithms
used for revocation signatures based on the givenPolicy
.static HashAlgorithmNegotiator
Return an instance that negotiatesHashAlgorithms
used for non-revocation signatures based on the givenPolicy
.
-
Method Details
-
negotiateHashAlgorithm
Pick oneHashAlgorithm
from the ordered set of acceptable algorithms.- Parameters:
orderedHashAlgorithmPreferencesSet
- hash algorithm preferences- Returns:
- picked algorithms
-
negotiateSignatureHashAlgorithm
Return an instance that negotiatesHashAlgorithms
used for non-revocation signatures based on the givenPolicy
.- Parameters:
policy
- algorithm policy- Returns:
- negotiator
-
negotiateRevocationSignatureAlgorithm
Return an instance that negotiatesHashAlgorithms
used for revocation signatures based on the givenPolicy
.- Parameters:
policy
- algorithm policy- Returns:
- negotiator
-
negotiateByPolicy
Return an instance that negotiatesHashAlgorithms
based on the givenPolicy.HashAlgorithmPolicy
.- Parameters:
hashAlgorithmPolicy
- algorithm policy for hash algorithms- Returns:
- negotiator
-