Package org.wildfly.security.sasl.util
Class SaslMechanismInformation
java.lang.Object
org.wildfly.security.sasl.util.SaslMechanismInformation
A collection of predicates and other information which can be used to filter SASL mechanisms.
- Author:
- David M. Lloyd
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classThe class providing Sasl Mechanism Names. -
Field Summary
FieldsModifier and TypeFieldDescriptionA predicate which is true when a mechanism which uses channel binding is being used.A predicate which is true when a DIGEST-family mechanism is being used.A predicate which is true when an EAP-family mechanism is being used.A predicate which is true when a GS2-family mechanism is being used.A predicate which is true when the mechanism uses MD5.A predicate which is true when the mechanism uses SHA.A predicate which is true when the mechanism uses SHA-256.A predicate which is true when the mechanism uses SHA-384.A predicate which is true when the mechanism uses SHA-512.A predicate which is true when the mechanism uses SHA-512/256.A predicate which is true when a IEC/ISO-9798-family mechanism is being used.A predicate which is true when the mechanism supports mutual authentication.A predicate which is true when the name being tested is a recommended mechanism as of the time of this release.A predicate which is true when a SCRAM-family mechanism is being used. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleandoesNotRequireClientCredentials(String mechName) Determine whether a mechanism does not need the client to present credentials.static booleandoesNotUsePrincipal(String mechName) Determine whether the given mechanism name is known to not use any sort ofPrincipalfor authentication.getSupportedClientCredentialAlgorithms(String mechName, Class<? extends Credential> credentialType) Get the supported algorithm names for a SASL client mechanism and credential type.static Set<Class<? extends Credential>>getSupportedClientCredentialTypes(String mechName) Get the supported credential types for the given SASL client mechanism.getSupportedClientPasswordTypes(String mechName) Get the supported password types for the given SASL client mechanism.getSupportedServerCredentialAlgorithms(String mechName, Class<? extends Credential> credentialType) Get the supported algorithm names for a SASL server mechanism and credential type.static Set<Class<? extends Credential>>getSupportedServerCredentialTypes(String mechName) Get the supported credential types for the given SASL server mechanism.getSupportedServerEvidenceAlgorithms(String mechName, Class<? extends AlgorithmEvidence> evidenceType) Get the supported algorithm names for a SASL server mechanism and evidence type.getSupportedServerEvidenceTypes(String mechName) Get the supported evidence types for the given SASL server mechanism.getSupportedServerPasswordTypes(String mechName) Get the supported password types for the given SASL server mechanism.static booleanisKnownMechanism(String mechName) Determine whether a mechanism is known by WildFly Elytron.static booleanneedsServerCredentials(String mechName) Determine whether a mechanism needs server-side credentials in order to authenticate.
-
Field Details
-
HASH_MD5
A predicate which is true when the mechanism uses MD5. -
HASH_SHA
A predicate which is true when the mechanism uses SHA. -
HASH_SHA_256
A predicate which is true when the mechanism uses SHA-256. -
HASH_SHA_384
A predicate which is true when the mechanism uses SHA-384. -
HASH_SHA_512
A predicate which is true when the mechanism uses SHA-512. -
HASH_SHA_512_256
A predicate which is true when the mechanism uses SHA-512/256. -
GS2
A predicate which is true when a GS2-family mechanism is being used. -
SCRAM
A predicate which is true when a SCRAM-family mechanism is being used. -
DIGEST
A predicate which is true when a DIGEST-family mechanism is being used. -
IEC_ISO_9798
A predicate which is true when a IEC/ISO-9798-family mechanism is being used. -
EAP
A predicate which is true when an EAP-family mechanism is being used. -
MUTUAL
A predicate which is true when the mechanism supports mutual authentication. -
BINDING
A predicate which is true when a mechanism which uses channel binding is being used. -
RECOMMENDED
A predicate which is true when the name being tested is a recommended mechanism as of the time of this release.
-
-
Constructor Details
-
SaslMechanismInformation
public SaslMechanismInformation()
-
-
Method Details
-
getSupportedClientCredentialTypes
Get the supported credential types for the given SASL client mechanism. If an empty set is returned, then no credentials are used by the mechanism or the mechanism is not known.- Parameters:
mechName- the mechanism name- Returns:
- the set of allowed client credentials
-
getSupportedClientPasswordTypes
Get the supported password types for the given SASL client mechanism. If an empty set is returned, then no passwords are used by the mechanism or nothing is known about the mechanism.- Parameters:
mechName- the mechanism name- Returns:
- the set of allowed client password types
-
getSupportedServerCredentialTypes
Get the supported credential types for the given SASL server mechanism. If an empty set is returned, then no credentials are used by the mechanism or the mechanism is unknown.- Parameters:
mechName- the mechanism name- Returns:
- the set of allowed server credential types
-
getSupportedServerPasswordTypes
Get the supported password types for the given SASL server mechanism. If an empty set is returned, then no passwords are used by the mechanism or nothing is known about the mechanism- Parameters:
mechName- the mechanism name- Returns:
- the set of allowed server password types
-
getSupportedClientCredentialAlgorithms
public static Set<String> getSupportedClientCredentialAlgorithms(String mechName, Class<? extends Credential> credentialType) Get the supported algorithm names for a SASL client mechanism and credential type. If the mechanism or credential type is not recognized, or if the given credential type does not use algorithms for the given mechanism name, an empty set is returned. If all algorithms are supported, a set containing the special string"*"is returned.- Parameters:
mechName- the SASL mechanism namecredentialType- the proposed credential type- Returns:
- the set of algorithms, or an empty set if all algorithms have unknown support
-
getSupportedServerCredentialAlgorithms
public static Set<String> getSupportedServerCredentialAlgorithms(String mechName, Class<? extends Credential> credentialType) Get the supported algorithm names for a SASL server mechanism and credential type. If the mechanism or credential type is not recognized, or if the given credential type does not use algorithms for the given mechanism name, an empty set is returned. If all algorithms are supported, a set containing the special string"*"is returned.- Parameters:
mechName- the SASL mechanism namecredentialType- the proposed credential type- Returns:
- the set of algorithms, or an empty set if all algorithms have equal or unknown support
-
getSupportedServerEvidenceTypes
Get the supported evidence types for the given SASL server mechanism. If an empty set is returned, then no evidence is used by the mechanism.- Parameters:
mechName- the mechanism name- Returns:
- the set of allowed server credential types
-
getSupportedServerEvidenceAlgorithms
public static Set<String> getSupportedServerEvidenceAlgorithms(String mechName, Class<? extends AlgorithmEvidence> evidenceType) Get the supported algorithm names for a SASL server mechanism and evidence type. If the mechanism or evidence type is not recognized, or if the given evidence type does not have an algorithm restriction for the given mechanism name, an empty set is returned.- Parameters:
mechName- the SASL mechanism nameevidenceType- the proposed evidence type- Returns:
- the set of algorithms, or an empty set if all algorithms have equal or unknown support
-
needsServerCredentials
Determine whether a mechanism needs server-side credentials in order to authenticate. This may include credential verification or acquisition, or both.- Parameters:
mechName- the mechanism name- Returns:
trueif the mechanism uses credentials,falseotherwise
-
doesNotUsePrincipal
Determine whether the given mechanism name is known to not use any sort ofPrincipalfor authentication.- Parameters:
mechName- the mechanism name (must not benull)- Returns:
trueif the mechanism does not use a principal,falseif it does or it is not known
-
doesNotRequireClientCredentials
Determine whether a mechanism does not need the client to present credentials.- Parameters:
mechName- the mechanism name- Returns:
trueif the mechanism does not require client credentials,falseif it it does or it is not known
-
isKnownMechanism
Determine whether a mechanism is known by WildFly Elytron. If the mechanism is not known the other methods in this class can not be relied upon.- Parameters:
mechName- the mechanism name- Returns:
trueif the mechanism is known to WildFly Elytron,falseif it is not known
-