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