changes to armor encoding
parent
0cbe840bde
commit
bfde7a79a4
|
@ -1,7 +1,6 @@
|
||||||
package routes
|
package routes
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
"net/http"
|
"net/http"
|
||||||
"time"
|
"time"
|
||||||
|
@ -62,16 +61,6 @@ func GetOpenPGPInformationEncoded(c *gin.Context) {
|
||||||
}
|
}
|
||||||
break
|
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{
|
c.JSON(http.StatusOK, gin.H{
|
||||||
"status": true,
|
"status": true,
|
||||||
"fullName": key.FullName,
|
"fullName": key.FullName,
|
||||||
|
@ -82,6 +71,6 @@ 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": buf.String(),
|
"armor": query,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue