Class DigestServerAuthenticationHelper
java.lang.Object
io.github.lunasaw.gbproxy.server.transimit.request.register.DigestServerAuthenticationHelper
Implements the HTTP digest authentication method server side functionality.
- Author:
- M. Ranganathan, Marc Bednarek
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
static final String
static final MessageDigest
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
doAuthenticateHashedPassword
(javax.sip.message.Request request, String hashedPassword) Authenticate the inbound request.static boolean
doAuthenticatePlainTextPassword
(javax.sip.message.Request request, String pass) Authenticate the inbound request given plain text password.static String
Generate the challenge string.static String
toHexString
(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.
-