Skip to content

Commit

Permalink
Fix typo in LoadPrivateKeyFromPEMWidthPassword
Browse files Browse the repository at this point in the history
Fixes #62
  • Loading branch information
sgallagher authored and Jeff Wendling committed Apr 14, 2017
1 parent 535a60b commit 28dd155
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions key.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 28dd155

Please sign in to comment.