public static String sign ( PrivateKey key , String content ) throws Exception { Signature signature = Signature . getInstance ( SIGN_ALGORITHM ) ; signature . initSign ( key ) ; signature . update ( content . getBytes ( ) ) ; return Base64 . encodeBase64String ( signature . sign ( ) ) ; }
Returns the digital signature for the specified content .