Class CredentialStoreUtil
java.lang.Object
net.officefloor.web.security.store.CredentialStoreUtil
Utility functions for working with a
CredentialStore.- Author:
- Daniel Sagenschneider
-
Method Summary
Modifier and TypeMethodDescriptionstatic HttpAccessControlauthenticate(String userId, String realm, byte[] credentials, String scheme, CredentialStore store) Convenience method to authenticate the user from theCredentialStore.static MessageDigestcreateDigest(String algorithm) Creates theMessageDigestfor theCredentialStorealgorithm.
-
Method Details
-
createDigest
Creates 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(String userId, String realm, byte[] credentials, 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.
-