Interface SymmetricKeyAlgorithmNegotiator
-
public interface SymmetricKeyAlgorithmNegotiatorInterface for symmetric key algorithm negotiation.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static SymmetricKeyAlgorithmNegotiatorbyPopularity()Return an instance that negotiates aSymmetricKeyAlgorithmby selecting the most popular acceptable algorithm from the list of preferences.SymmetricKeyAlgorithmnegotiate(Policy.SymmetricKeyAlgorithmPolicy policy, SymmetricKeyAlgorithm override, java.util.List<java.util.Set<SymmetricKeyAlgorithm>> keyPreferences)Negotiate a symmetric encryption algorithm.
-
-
-
Method Detail
-
negotiate
SymmetricKeyAlgorithm negotiate(Policy.SymmetricKeyAlgorithmPolicy policy, SymmetricKeyAlgorithm override, java.util.List<java.util.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
static SymmetricKeyAlgorithmNegotiator byPopularity()
Return an instance that negotiates aSymmetricKeyAlgorithmby 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
-
-