Fix typo in LoadPrivateKeyFromPEMWidthPassword

Fixes #62
This commit is contained in:
Stephen Gallagher 2016-05-25 15:47:55 -04:00 committed by Jeff Wendling
parent 535a60be66
commit 28dd155517

11
key.go
View File

@ -246,8 +246,8 @@ func LoadPrivateKeyFromPEM(pem_block []byte) (PrivateKey, error) {
return p, nil
}
// LoadPrivateKeyFromPEM loads a private key from a PEM-encoded block.
func LoadPrivateKeyFromPEMWidthPassword(pem_block []byte, password string) (
// LoadPrivateKeyFromPEMWithPassword loads a private key from a PEM-encoded block.
func LoadPrivateKeyFromPEMWithPassword(pem_block []byte, password string) (
PrivateKey, error) {
if len(pem_block) == 0 {
return nil, errors.New("empty pem block")
@ -318,6 +318,13 @@ func LoadPrivateKeyFromDER(der_block []byte) (PrivateKey, error) {
return p, nil
}
// LoadPrivateKeyFromPEMWidthPassword loads a private key from a PEM-encoded block.
// Backwards-compatible with typo
func LoadPrivateKeyFromPEMWidthPassword(pem_block []byte, password string) (
PrivateKey, error) {
return LoadPrivateKeyFromPEMWithPassword(pem_block, password)
}
// LoadPublicKeyFromPEM loads a public key from a PEM-encoded block.
func LoadPublicKeyFromPEM(pem_block []byte) (PublicKey, error) {
if len(pem_block) == 0 {