private static byte[] sign(String stringData,final byte[] key) throws AWSIotException {
  try {
    byte[] data=stringData.getBytes(UTF8);
    return sign(data,key);
  }
 catch (  Exception e) {
    throw new AWSIotException("Unable to calculate a request signature: " + e.getMessage());
  }
}

private static byte [ ] sign ( String stringData , final byte [ ] key ) throws AWSIotException { try { byte [ ] data = stringData . getBytes ( UTF8 ) ; return sign ( data , key ) ; } catch ( Exception e ) { throw new AWSIotException ( "Unable to calculate a request signature: " + e . getMessage ( ) ) ; } }
sign the given string with the key provided .
