changes to armor encoding
parent
5dc9b586b5
commit
aff99a8124
|
@ -4,7 +4,6 @@ import (
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
"net/http"
|
"net/http"
|
||||||
"time"
|
"time"
|
||||||
"io/ioutil"
|
|
||||||
|
|
||||||
"golang.org/x/crypto/openpgp"
|
"golang.org/x/crypto/openpgp"
|
||||||
"golang.org/x/crypto/openpgp/armor"
|
"golang.org/x/crypto/openpgp/armor"
|
||||||
|
@ -23,8 +22,6 @@ type PGPKey struct {
|
||||||
|
|
||||||
func GetOpenPGPInformationEncoded(c *gin.Context) {
|
func GetOpenPGPInformationEncoded(c *gin.Context) {
|
||||||
query := c.Copy().Request.Body
|
query := c.Copy().Request.Body
|
||||||
query2 := c.Copy().Request.Body
|
|
||||||
body, _ := ioutil.ReadAll(query2)
|
|
||||||
|
|
||||||
block, err := armor.Decode(query)
|
block, err := armor.Decode(query)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -74,6 +71,5 @@ func GetOpenPGPInformationEncoded(c *gin.Context) {
|
||||||
"publicKeyAlgorithm": key.PublicKeyAlgorithm,
|
"publicKeyAlgorithm": key.PublicKeyAlgorithm,
|
||||||
"fingerprint": hex.EncodeToString(key.Fingerprint[:]),
|
"fingerprint": hex.EncodeToString(key.Fingerprint[:]),
|
||||||
"keyID": key.KeyID,
|
"keyID": key.KeyID,
|
||||||
"armor": body,
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue