org.littleshoot.util
Class SecurityUtils

java.lang.Object
  extended by org.littleshoot.util.SecurityUtils

public class SecurityUtils
extends Object

Utility methods for security.


Constructor Summary
SecurityUtils()
           
 
Method Summary
static String hash(String str)
           
static String signAndEncode(String accessKey, String canonicalString)
          Calculate the HMAC/SHA1 on a string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SecurityUtils

public SecurityUtils()
Method Detail

signAndEncode

public static String signAndEncode(String accessKey,
                                   String canonicalString)
Calculate the HMAC/SHA1 on a string.

Parameters:
canonicalString - Data to sign
accessKey - 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.