x/crypto/ssh: please provide unified parameter types for ed25519.PrivateKey #51974
Labels
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Unfortunate
Milestone
Hi,
When I want to use go to do some format cleaning for PEM file found that
ssh.ParseRawPrivateKey
andx509.MarshalPKCS8PrivateKey
have different data type fored25519.PrivateKey
.ssh.ParseRawPrivateKey
actually output a Pointer,x509.MarshalPKCS8PrivateKey
only receiver Value.But other algorithms are both pointers. So I had to do type assertion for
ed25519.PrivateKey
.example code:
I think it's not necessary. Perhaps we can make
x509.MarshalPKCS8PrivateKey
receivered25519.PrivateKey
Pointer and Value at same time or makessh.ParseRawPrivateKey
output Value becauseed25519.PrivateKey
underlying type is[]byte
.The text was updated successfully, but these errors were encountered: