changes to armor encoding

master
Matthew 2021-07-02 23:43:10 -04:00
parent 0cbe840bde
commit bfde7a79a4
No known key found for this signature in database
GPG Key ID: 210AF32ADE3B5C4B
1 changed files with 1 additions and 12 deletions

View File

@ -1,7 +1,6 @@
package routes
import (
"bytes"
"encoding/hex"
"net/http"
"time"
@ -62,16 +61,6 @@ func GetOpenPGPInformationEncoded(c *gin.Context) {
}
break
}
buf := new(bytes.Buffer)
closer, err := armor.Encode(buf, block.Type, block.Header)
defer closer.Close()
if err != nil {
c.JSON(http.StatusBadRequest, gin.H{
"status": false,
"message": "Unable to re-encode armor..",
})
return
}
c.JSON(http.StatusOK, gin.H{
"status": true,
"fullName": key.FullName,
@ -82,6 +71,6 @@ func GetOpenPGPInformationEncoded(c *gin.Context) {
"publicKeyAlgorithm": key.PublicKeyAlgorithm,
"fingerprint": hex.EncodeToString(key.Fingerprint[:]),
"keyID": key.KeyID,
"armor": buf.String(),
"armor": query,
})
}