-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdoc.go
31 lines (31 loc) · 880 Bytes
/
doc.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// Package decryptpem decrypts encrypted PEM files and blocks. Provides (optional) TTY prompt for input for password.
//
// Installation
//
// go get github.com/phayes/decryptpem
//
// Example
//
// // Get private key, prompt for password and decrypt if necessary
// pem, err := decryptpem.DecryptFileWithPrompt("/path/to/private_key.pem")
// if err != nil {
// log.Fatal(err)
// }
// privateKey, err := x509.ParsePKCS1PrivateKey(pem.Bytes());
// if err != nil {
// log.Fatal(err)
// }
//
//
// // It will also work with unencrypted plaintext PEM files
// pem, err := decryptpem.DecryptFileWithPrompt("/path/to/plaintext_key.pem") // Will not prompt for pasword.
// if err != nil {
// log.Fatal(err)
// }
// privateKey, err := x509.ParsePKCS1PrivateKey(pem.Bytes());
// if err != nil {
// log.Fatal(err)
// }
//
//
package decryptpem