Interface ScramServerFunctionality
-
- All Known Implementing Classes:
ScramServerFunctionalityImpl
public interface ScramServerFunctionalityProvides building blocks for creating SCRAM authentication server
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classScramServerFunctionality.StateState of the authentication procedure
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description MessageDigestgetDigest()MacgetHmac()ScramServerFunctionality.StategetState()Gets the state of the authentication procedureStringhandleClientFirstMessage(String message)Handles client's first messagebooleanisEnded()Checks if authentication is completed, either successfully or not.booleanisSuccessful()Checks if authentication is completed, either successfully or not.StringprepareFinalMessage(String clientFinalMessage)Prepares server's final messageStringprepareFirstMessage(UserData userData)Prepares server's first message
-
-
-
Method Detail
-
handleClientFirstMessage
String handleClientFirstMessage(String message) throws ScramException
Handles client's first message- Parameters:
message- Client's first message- Returns:
- username extracted from the client message
- Throws:
ScramException
-
prepareFirstMessage
String prepareFirstMessage(UserData userData)
Prepares server's first message- Parameters:
userData- user data needed to prepare the message- Returns:
- Server's first message
-
prepareFinalMessage
String prepareFinalMessage(String clientFinalMessage) throws ScramException
Prepares server's final message- Parameters:
clientFinalMessage- Client's final message- Returns:
- Server's final message
- Throws:
ScramException
-
isSuccessful
boolean isSuccessful()
Checks if authentication is completed, either successfully or not. Authentication is completed ifgetState()returns ENDED.- Returns:
- true if authentication has ended
-
isEnded
boolean isEnded()
Checks if authentication is completed, either successfully or not. Authentication is completed ifgetState()returns ENDED.- Returns:
- true if authentication has ended
-
getState
ScramServerFunctionality.State getState()
Gets the state of the authentication procedure- Returns:
- Current state
-
getDigest
MessageDigest getDigest()
-
getHmac
Mac getHmac()
-
-