crypto/rsa: hexadecimal string not accepted as argument to PrivateKey.Sign #38511
Labels
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
When I was using rsa2 way for signature found a problem, Java support with signature string generated sha256 in this paper, and put the paper into hex byte, after rsa2 signature, but go seems barely support, only support for the direct generation rsa2 signature, when I try to do like Java, triggered panic at compile time, "crypto/rsa: input must be hashed message".
java代码
//golang Code snippet
What did you expect to see?
After golang converts the digest to hexadecimal and signs it, it gets the same result as a Java signature
What did you see instead?
err:crypto/rsa: input must be hashed message
It appears to check the hash value and length of the digest,After commenting out the code I got a signature, but the result was not consistent with what Java got
The text was updated successfully, but these errors were encountered: