diff --git a/app/utils/encrypt/rsa/rsa.go b/app/utils/encrypt/rsa/rsa.go index e4e02da..c5f958f 100644 --- a/app/utils/encrypt/rsa/rsa.go +++ b/app/utils/encrypt/rsa/rsa.go @@ -154,7 +154,9 @@ func GenerateKey() (string, string, error) { pubPem := pem.EncodeToMemory(pubBlock) pri := strings.Replace(string(privPem), "-----BEGIN RSA PRIVATE KEY-----\n", "", -1) pri = strings.Replace(pri, "\n-----END RSA PRIVATE KEY-----\n", "", -1) + pri = strings.Replace(pri, "\n", "", -1) pub := strings.Replace(string(pubPem), "-----BEGIN PUBLIC KEY-----\n", "", -1) pub = strings.Replace(pub, "\n-----END PUBLIC KEY-----\n", "", -1) + pub = strings.Replace(pub, "\n", "", -1) return pub, pri, nil }