diff --git a/src/crypto/x509/x509.go b/src/crypto/x509/x509.go index 7bca6810f7d..d959d0ba3fb 100644 --- a/src/crypto/x509/x509.go +++ b/src/crypto/x509/x509.go @@ -99,7 +99,7 @@ func marshalPublicKey(pub interface{}) (publicKeyBytes []byte, publicKeyAlgorith publicKeyBytes = pub publicKeyAlgorithm.Algorithm = oidPublicKeyEd25519 default: - return nil, pkix.AlgorithmIdentifier{}, errors.New("x509: only RSA and ECDSA public keys supported") + return nil, pkix.AlgorithmIdentifier{}, fmt.Errorf("x509: unsupported public key type: %T", pub) } return publicKeyBytes, publicKeyAlgorithm, nil