From: Katie Hockman Date: Fri, 17 Apr 2020 16:21:24 +0000 (-0400) Subject: crypto/x509: clarify MarshalPKIXPublicKey and ParsePKIXPublicKey docs X-Git-Tag: go1.15beta1~520 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=ef5c59d47b7f4376ea8ff54fb0a882528c0f5588;p=gostls13.git crypto/x509: clarify MarshalPKIXPublicKey and ParsePKIXPublicKey docs Fixes #35313 Change-Id: I7be3c40f338de6b1808358ea01e729db8b533ce5 Reviewed-on: https://go-review.googlesource.com/c/go/+/228778 Run-TryBot: Katie Hockman TryBot-Result: Gobot Gobot Reviewed-by: Filippo Valsorda --- diff --git a/src/crypto/x509/x509.go b/src/crypto/x509/x509.go index 6776608d75..6d03a129f8 100644 --- a/src/crypto/x509/x509.go +++ b/src/crypto/x509/x509.go @@ -47,6 +47,8 @@ type pkixPublicKey struct { } // ParsePKIXPublicKey parses a public key in PKIX, ASN.1 DER form. +// The encoded public key is a SubjectPublicKeyInfo structure +// (see RFC 5280, Section 4.1). // // It returns a *rsa.PublicKey, *dsa.PublicKey, *ecdsa.PublicKey, or // ed25519.PublicKey. More types might be supported in the future. @@ -107,6 +109,8 @@ func marshalPublicKey(pub interface{}) (publicKeyBytes []byte, publicKeyAlgorith } // MarshalPKIXPublicKey converts a public key to PKIX, ASN.1 DER form. +// The encoded public key is a SubjectPublicKeyInfo structure +// (see RFC 5280, Section 4.1). // // The following key types are currently supported: *rsa.PublicKey, *ecdsa.PublicKey // and ed25519.PublicKey. Unsupported key types result in an error.