mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-12-25 06:26:35 +08:00
[SSL证书]实现基本的自动申请证书流程
This commit is contained in:
15
internal/acme/key.go
Normal file
15
internal/acme/key.go
Normal file
@@ -0,0 +1,15 @@
|
||||
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)
|
||||
}
|
||||
Reference in New Issue
Block a user