Class CredentialStoreUtil
- java.lang.Object
-
- net.officefloor.web.security.store.CredentialStoreUtil
-
public class CredentialStoreUtil extends java.lang.Object
Utility functions for working with aCredentialStore
.- Author:
- Daniel Sagenschneider
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static HttpAccessControl
authenticate(java.lang.String userId, java.lang.String realm, byte[] credentials, java.lang.String scheme, CredentialStore store)
Convenience method to authenticate the user from theCredentialStore
.static java.security.MessageDigest
createDigest(java.lang.String algorithm)
Creates theMessageDigest
for theCredentialStore
algorithm.
-
-
-
Method Detail
-
createDigest
public static java.security.MessageDigest createDigest(java.lang.String algorithm) throws HttpException
Creates theMessageDigest
for theCredentialStore
algorithm.- Parameters:
algorithm
-CredentialStore
algorithm.- Returns:
MessageDigest
for the algorithm ornull
indicate credentials are in plain text.- Throws:
HttpException
- If fails to obtainMessageDigest
for the algorithm.
-
authenticate
public static HttpAccessControl authenticate(java.lang.String userId, java.lang.String realm, byte[] credentials, java.lang.String scheme, CredentialStore store) throws HttpException
Convenience method to authenticate the user from theCredentialStore
.- Parameters:
userId
- Identifier for the user.realm
- Security realm.credentials
- Credentials.scheme
- Authentication scheme.store
-CredentialStore
.- Returns:
HttpAccessControl
ornull
if not authorised.- Throws:
HttpException
- If fails to communicate withCredentialStore
.
-
-