Maint: internal/openvpn/parse package

- Parse PEM key data for Cyberghost and VPNUnlimited
- Add more unit tests
This commit is contained in:
Quentin McGaw (desktop)
2021-09-08 16:40:19 +00:00
parent 9afe455635
commit 65ace12def
11 changed files with 321 additions and 212 deletions

View 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
}