From 7d27a5f1ae89892b5d4ff71ee4b796d52f7cf904 Mon Sep 17 00:00:00 2001 From: Matthew R Date: Fri, 2 Jul 2021 23:45:03 -0400 Subject: [PATCH] changes to armor encoding --- routes/pgp.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/routes/pgp.go b/routes/pgp.go index d94681e..6c0f349 100644 --- a/routes/pgp.go +++ b/routes/pgp.go @@ -4,6 +4,7 @@ import ( "encoding/hex" "net/http" "time" + "io/ioutil" "golang.org/x/crypto/openpgp" "golang.org/x/crypto/openpgp/armor" @@ -22,6 +23,7 @@ type PGPKey struct { func GetOpenPGPInformationEncoded(c *gin.Context) { query := c.Copy().Request.Body + body, _ := ioutil.ReadAll(query) block, err := armor.Decode(query) if err != nil { @@ -71,6 +73,6 @@ func GetOpenPGPInformationEncoded(c *gin.Context) { "publicKeyAlgorithm": key.PublicKeyAlgorithm, "fingerprint": hex.EncodeToString(key.Fingerprint[:]), "keyID": key.KeyID, - "armor": query, + "armor": body, }) }