Class CredentialStoreUtil
- java.lang.Object
-
- net.officefloor.web.security.store.CredentialStoreUtil
-
public class CredentialStoreUtil extends java.lang.ObjectUtility functions for working with aCredentialStore.- Author:
- Daniel Sagenschneider
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static HttpAccessControlauthenticate(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.MessageDigestcreateDigest(java.lang.String algorithm)Creates theMessageDigestfor theCredentialStorealgorithm.
-
-
-
Method Detail
-
createDigest
public static java.security.MessageDigest createDigest(java.lang.String algorithm) throws HttpExceptionCreates theMessageDigestfor theCredentialStorealgorithm.- Parameters:
algorithm-CredentialStorealgorithm.- Returns:
MessageDigestfor the algorithm ornullindicate credentials are in plain text.- Throws:
HttpException- If fails to obtainMessageDigestfor 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:
HttpAccessControlornullif not authorised.- Throws:
HttpException- If fails to communicate withCredentialStore.
-
-