mirror of
https://github.com/libp2p/go-openssl.git
synced 2024-12-25 23:30:06 +08:00
parent
535a60be66
commit
28dd155517
11
key.go
11
key.go
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user