how can realize openssl pkeyutl -sign by java
问题 the command line is openssl pkeyutl -sign -inkey pkcs1.pem -pkeyopt digest:sha1 -in testlog I want to realize it by java. But NONEwithRSA or SHA1withRSA neither give the same output. the NONEwithRSA's output is the same with openssl pkeyutl -sign -inkey pkcs1.pem -in testlog which has no -pkeyopt digest:sha1 the java code just like Signature sign = Signature.getInstance(algorithm); sign.initSign(privatekey); sign.update(keyByte); return sign.sign(); I don't know how to amend this. thank's