Class DigestServerAuthenticationHelper
java.lang.Object
io.github.lunasaw.gbproxy.server.transmit.request.register.DigestServerAuthenticationHelper
Implements the HTTP digest authentication method server side functionality.
- Author:
- M. Ranganathan, Marc Bednarek
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final MessageDigest -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleandoAuthenticateHashedPassword(javax.sip.message.Request request, String hashedPassword) Authenticate the inbound request.static booleandoAuthenticatePlainTextPassword(javax.sip.message.Request request, String pass) Authenticate the inbound request given plain text password.static StringGenerate the challenge string.static StringtoHexString(byte[] b)
-
Field Details
-
messageDigest
-
DEFAULT_ALGORITHM
- See Also:
-
DEFAULT_SCHEME
- See Also:
-
-
Constructor Details
-
DigestServerAuthenticationHelper
public DigestServerAuthenticationHelper()
-
-
Method Details
-
toHexString
-
generateNonce
Generate the challenge string.- Returns:
- a generated nonce.
-
doAuthenticateHashedPassword
public static boolean doAuthenticateHashedPassword(javax.sip.message.Request request, String hashedPassword) Authenticate the inbound request.- Parameters:
request- - the request to authenticate.hashedPassword- -- the MD5 hashed string of username:realm:plaintext password.- Returns:
- true if authentication succeded and false otherwise.
-
doAuthenticatePlainTextPassword
public static boolean doAuthenticatePlainTextPassword(javax.sip.message.Request request, String pass) Authenticate the inbound request given plain text password.- Parameters:
request- - the request to authenticate.pass- -- the plain text password.- Returns:
- true if authentication succeded and false otherwise.
-