Maint: internal/openvpn/parse package
- Parse PEM key data for Cyberghost and VPNUnlimited - Add more unit tests
This commit is contained in:
14
internal/openvpn/parse/key.go
Normal file
14
internal/openvpn/parse/key.go
Normal file
@@ -0,0 +1,14 @@
|
||||
package parse
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
)
|
||||
|
||||
func ExtractPrivateKey(b []byte) (keyData string, err error) {
|
||||
keyData, err = extractPEM(b, "PRIVATE KEY")
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("%w: %s", ErrExtractPEM, err)
|
||||
}
|
||||
|
||||
return keyData, nil
|
||||
}
|
||||
Reference in New Issue
Block a user