org.littleshoot.util
Class SecurityUtils
java.lang.Object
org.littleshoot.util.SecurityUtils
public class SecurityUtils
- extends Object
Utility methods for security.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SecurityUtils
public SecurityUtils()
signAndEncode
public static String signAndEncode(String accessKey,
String canonicalString)
- Calculate the HMAC/SHA1 on a string.
- Parameters:
canonicalString - Data to signaccessKey - The secret access key to sign it with.
- Returns:
- The base64-encoded RFC 2104-compliant HMAC signature.
- Throws:
RuntimeException - If the algorithm does not exist or if the key
is invalid -- both should never happen.
hash
public static String hash(String str)
Copyright © 2011-2013 LittleShoot. All Rights Reserved.