changes to armor encoding
parent
bfde7a79a4
commit
7d27a5f1ae
|
@ -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,
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue