diff --git a/routes/get.go b/routes/get.go index aafba39..20114d8 100644 --- a/routes/get.go +++ b/routes/get.go @@ -144,7 +144,8 @@ func GetCertificateInformationEncoded(c *gin.Context) { "validationType": validationType, "signatureAlgorithm": certificate.SignatureAlgorithm.String(), "publicKeyAlgorithm": certificate.PublicKeyAlgorithm.String(), - "serialNumber": certificate.SerialNumber.Int64(), + "serialNumber": certificate.SerialNumber.String(), + "notBefore": certificate.NotBefore, "notAfter": certificate.NotAfter, "keyUsage": keyUsages, "keyUsageAsText": keyUsagesText, @@ -183,6 +184,7 @@ func GetCertificateInfo(c *gin.Context) { tlsVersion = "unknown" } certificate := resp.ConnectionState().PeerCertificates[0] + rootCertificate := resp.ConnectionState().PeerCertificates[len(resp.ConnectionState().PeerCertificates)-1] var validationType string for _, value := range certificate.PolicyIdentifiers { @@ -285,10 +287,18 @@ func GetCertificateInfo(c *gin.Context) { "locality": certificate.Issuer.Locality, "country": certificate.Issuer.Country, }, + "root": gin.H{ + "commonName": rootCertificate.Issuer.CommonName, + "organization": rootCertificate.Issuer.Organization, + "organizationalUnit": rootCertificate.Issuer.OrganizationalUnit, + "locality": rootCertificate.Issuer.Locality, + "country": rootCertificate.Issuer.Country, + }, "validationType": validationType, "signatureAlgorithm": certificate.SignatureAlgorithm.String(), "publicKeyAlgorithm": certificate.PublicKeyAlgorithm.String(), - "serialNumber": certificate.SerialNumber.Int64(), + "serialNumber": certificate.SerialNumber.String(), + "notBefore": certificate.NotBefore, "notAfter": certificate.NotAfter, "keyUsage": keyUsages, "keyUsageAsText": keyUsagesText,