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 HashAlgorithmNegotiatornegotiateByPolicy(Policy.HashAlgorithmPolicy hashAlgorithmPolicy) Return an instance that negotiatesHashAlgorithmsbased on the givenPolicy.HashAlgorithmPolicy.negotiateHashAlgorithm(Set<HashAlgorithm> orderedHashAlgorithmPreferencesSet) Pick oneHashAlgorithmfrom the ordered set of acceptable algorithms.static HashAlgorithmNegotiatorReturn an instance that negotiatesHashAlgorithmsused for revocation signatures based on the givenPolicy.static HashAlgorithmNegotiatorReturn an instance that negotiatesHashAlgorithmsused for non-revocation signatures based on the givenPolicy.
-
Method Details
-
negotiateHashAlgorithm
Pick oneHashAlgorithmfrom the ordered set of acceptable algorithms.- Parameters:
orderedHashAlgorithmPreferencesSet- hash algorithm preferences- Returns:
- picked algorithms
-
negotiateSignatureHashAlgorithm
Return an instance that negotiatesHashAlgorithmsused for non-revocation signatures based on the givenPolicy.- Parameters:
policy- algorithm policy- Returns:
- negotiator
-
negotiateRevocationSignatureAlgorithm
Return an instance that negotiatesHashAlgorithmsused for revocation signatures based on the givenPolicy.- Parameters:
policy- algorithm policy- Returns:
- negotiator
-
negotiateByPolicy
Return an instance that negotiatesHashAlgorithmsbased on the givenPolicy.HashAlgorithmPolicy.- Parameters:
hashAlgorithmPolicy- algorithm policy for hash algorithms- Returns:
- negotiator
-