strings.ToUpper() for x509 and pgp fingerprints
parent
50402ded76
commit
8c27393d8f
|
@ -5,6 +5,7 @@ import (
|
|||
"crypto/rsa"
|
||||
"encoding/hex"
|
||||
"net/http"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"golang.org/x/crypto/openpgp"
|
||||
|
@ -93,7 +94,7 @@ func GetOpenPGPInformationEncoded(c *gin.Context) {
|
|||
"email": key.Email,
|
||||
"creationTime": key.CreationTime,
|
||||
"publicKeyAlgorithm": key.PublicKeyAlgorithm,
|
||||
"fingerprint": hex.EncodeToString(key.Fingerprint[:]),
|
||||
"fingerprint": strings.ToUpper(hex.EncodeToString(key.Fingerprint[:])),
|
||||
"keyID": entity.PrimaryKey.KeyIdString(),
|
||||
"bitLength": bitLength,
|
||||
})
|
||||
|
|
|
@ -11,6 +11,7 @@ import (
|
|||
"encoding/pem"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
@ -179,7 +180,7 @@ func GetCertificateInformationEncoded(c *gin.Context) {
|
|||
"extendedKeyUsageAsText": extendedKeyUsagesText,
|
||||
"san": certificate.DNSNames,
|
||||
"emailAddresses": certificate.EmailAddresses,
|
||||
"fingerprint": hex.EncodeToString(sum[:]),
|
||||
"fingerprint": strings.ToUpper(hex.EncodeToString(sum[:])),
|
||||
"bitLength": bitLength,
|
||||
"pem": string(pem.EncodeToMemory(block)),
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue