mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-03 06:40:26 +08:00
16 lines
276 B
Go
16 lines
276 B
Go
package acme
|
|
|
|
import (
|
|
"crypto/x509"
|
|
"encoding/base64"
|
|
)
|
|
|
|
func ParsePrivateKeyFromBase64(base64String string) (interface{}, error) {
|
|
data, err := base64.StdEncoding.DecodeString(base64String)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return x509.ParsePKCS8PrivateKey(data)
|
|
}
|