public String sign ( String content , PrivateKey privateKey ) { if ( content == null ) { return null ; } byte [ ] bytes = content . getBytes ( StandardCharsets . UTF_8 ) ; InputStream input = new ByteArrayInputStream ( bytes ) ; return sign ( input , privateKey ) ; // ByteArrayInputStream does not need to be closed. }
Generates a digital signature for the given string .