Interface SymmetricKeyAlgorithmNegotiator
public interface SymmetricKeyAlgorithmNegotiator
Interface for symmetric key algorithm negotiation.
-
Method Summary
Modifier and TypeMethodDescriptionReturn an instance that negotiates aSymmetricKeyAlgorithm
by selecting the most popular acceptable algorithm from the list of preferences.negotiate
(Policy.SymmetricKeyAlgorithmPolicy policy, SymmetricKeyAlgorithm override, List<Set<SymmetricKeyAlgorithm>> keyPreferences) Negotiate a symmetric encryption algorithm.
-
Method Details
-
negotiate
SymmetricKeyAlgorithm negotiate(Policy.SymmetricKeyAlgorithmPolicy policy, SymmetricKeyAlgorithm override, List<Set<SymmetricKeyAlgorithm>> keyPreferences) Negotiate a symmetric encryption algorithm. If the override is non-null, it will be returned instead of performing an actual negotiation. Otherwise, the list of ordered sets containing the preferences of different recipient keys will be used to determine a suitable symmetric encryption algorithm.- Parameters:
policy
- algorithm policyoverride
- algorithm override (if not null, return this)keyPreferences
- list of preferences per key- Returns:
- negotiated algorithm
-
byPopularity
Return an instance that negotiates aSymmetricKeyAlgorithm
by selecting the most popular acceptable algorithm from the list of preferences. This negotiator has the best chances to select an algorithm which is understood by all recipients.- Returns:
- negotiator that selects by popularity
-