It bothers me that me as an end-user of ParsePKCS8PrivateKey have to do type assertion logic on the key even when you know what you expect.
We should utilize Go's strong type system to create type-specific functions called for example
ParsePKCS8PrivateKeyRSA(der []byte) (key *rsa.PrivateKey, err error)
ParsePKCS8PrivateKeyECDSA(der []byte) (key *ecdsa.PrivateKey, err error)
It bothers me that me as an end-user of
ParsePKCS8PrivateKeyhave to do type assertion logic on the key even when you know what you expect.We should utilize Go's strong type system to create type-specific functions called for example
ParsePKCS8PrivateKeyRSA(der []byte) (key *rsa.PrivateKey, err error)ParsePKCS8PrivateKeyECDSA(der []byte) (key *ecdsa.PrivateKey, err error)