Refactoring-1811
This commit is contained in:
@ -6,7 +6,6 @@ import (
|
||||
"encoding/pem"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
func ReadPrivateKeyRSAfromPath(path string) (*rsa.PrivateKey, error) {
|
||||
@ -23,7 +22,7 @@ func ReadPrivateKeyRSAfromPath(path string) (*rsa.PrivateKey, error) {
|
||||
}
|
||||
|
||||
func ReadPublicKeyRSAfromString(pemString string) (*rsa.PublicKey, error) {
|
||||
pemByte := *(*[]byte)(unsafe.Pointer(&pemString))
|
||||
pemByte := []byte(pemString)
|
||||
decoded, _ := pem.Decode(pemByte)
|
||||
keyInterface, err := x509.ParsePKIXPublicKey(decoded.Bytes)
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user