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