Skip to content

Commit 9c16a03

Browse files
committed
pkcs12: add a note suggesting ToPEM for multiple certificates/keys
Updates golang/go#14015 Change-Id: Iffe73540c5d74e4b3d0664035a1bdce5b47663ee Reviewed-on: https://go-review.googlesource.com/c/160258 Reviewed-by: Bryan C. Mills <[email protected]>
1 parent b01c7a7 commit 9c16a03

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: pkcs12/pkcs12.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ func unmarshal(in []byte, out interface{}) error {
103103
return nil
104104
}
105105

106-
// ConvertToPEM converts all "safe bags" contained in pfxData to PEM blocks.
106+
// ToPEM converts all "safe bags" contained in pfxData to PEM blocks.
107107
func ToPEM(pfxData []byte, password string) ([]*pem.Block, error) {
108108
encodedPassword, err := bmpString(password)
109109
if err != nil {
@@ -211,7 +211,7 @@ func convertAttribute(attribute *pkcs12Attribute) (key, value string, err error)
211211

212212
// Decode extracts a certificate and private key from pfxData. This function
213213
// assumes that there is only one certificate and only one private key in the
214-
// pfxData.
214+
// pfxData; if there are more use ToPEM instead.
215215
func Decode(pfxData []byte, password string) (privateKey interface{}, certificate *x509.Certificate, err error) {
216216
encodedPassword, err := bmpString(password)
217217
if err != nil {

0 commit comments

Comments
 (0)