From 9c16a0384b5abb953a62cc94b37deeb547126004 Mon Sep 17 00:00:00 2001 From: Filippo Valsorda Date: Tue, 29 Jan 2019 14:50:44 -0500 Subject: [PATCH] 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 --- pkcs12/pkcs12.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkcs12/pkcs12.go b/pkcs12/pkcs12.go index 499f85b..55f7691 100644 --- a/pkcs12/pkcs12.go +++ b/pkcs12/pkcs12.go @@ -103,7 +103,7 @@ func unmarshal(in []byte, out interface{}) error { return nil } -// ConvertToPEM converts all "safe bags" contained in pfxData to PEM blocks. +// ToPEM converts all "safe bags" contained in pfxData to PEM blocks. func ToPEM(pfxData []byte, password string) ([]*pem.Block, error) { encodedPassword, err := bmpString(password) if err != nil { @@ -211,7 +211,7 @@ func convertAttribute(attribute *pkcs12Attribute) (key, value string, err error) // Decode extracts a certificate and private key from pfxData. This function // assumes that there is only one certificate and only one private key in the -// pfxData. +// pfxData; if there are more use ToPEM instead. func Decode(pfxData []byte, password string) (privateKey interface{}, certificate *x509.Certificate, err error) { encodedPassword, err := bmpString(password) if err != nil {