types

package
v0.0.0-...-182cb5d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 4, 2022 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ExtKeyUsagesNameMap = map[x509.ExtKeyUsage]string{
	x509.ExtKeyUsageAny:                            "Any",
	x509.ExtKeyUsageServerAuth:                     "TLS Web Server Authentication",
	x509.ExtKeyUsageClientAuth:                     "TLS Web Client Authentication",
	x509.ExtKeyUsageCodeSigning:                    "Code Signing",
	x509.ExtKeyUsageEmailProtection:                "E-mail Protection",
	x509.ExtKeyUsageIPSECEndSystem:                 "IPSec End System",
	x509.ExtKeyUsageIPSECTunnel:                    "IPSec Tunnel",
	x509.ExtKeyUsageIPSECUser:                      "IPSec User",
	x509.ExtKeyUsageTimeStamping:                   "Time Stamping",
	x509.ExtKeyUsageOCSPSigning:                    "OCSP Signing",
	x509.ExtKeyUsageMicrosoftServerGatedCrypto:     "Microsoft Server Gated Crypto",
	x509.ExtKeyUsageNetscapeServerGatedCrypto:      "Netscape Server Gated Crypto",
	x509.ExtKeyUsageMicrosoftCommercialCodeSigning: "Microsoft Commercial Code Signing",
	x509.ExtKeyUsageMicrosoftKernelCodeSigning:     "Microsoft Kernel Code Signing",
}
View Source
var KeyUsageNameMap = map[int]string{
	0: "Digital Signature",
	1: "Non Repudiation",
	2: "Key Encipherment",
	3: "Data Encipherment",
	4: "Key Agreement",
	5: "Certificate Sign",
	6: "CRL Sign",
	7: "Encipher Only",
	8: "Decipher Only",
}

Functions

This section is empty.

Types

type Cert

type Cert struct {
	CommonName   string             `json:"commonName" yaml:"commonName"`
	AltNames     []string           `json:"altNames" yaml:"altNames"`
	NotBefore    time.Time          `json:"notBefore" yaml:"notBefore"`
	NotAfter     time.Time          `json:"notAfter" yaml:"notAfter"`
	KeyUsages    []string           `json:"keyUsages" yaml:"keyUsages"`
	ExtKeyUsages []string           `json:"extKeyUsages" yaml:"extKeyUsages"`
	SerialNumber string             `json:"serialNumber" yaml:"serialNumber"`
	Issuer       string             `json:"issuer" yaml:"issuer"`
	FingerPrints []CertFingerPrints `json:"fingerprints" yaml:"fingerprints"`
}

func BuildCert

func BuildCert(certificate *x509.Certificate) *Cert

func (*Cert) ToTxt

func (cert *Cert) ToTxt(withColors bool) string

type CertFingerPrints

type CertFingerPrints struct {
	Type        string `json:"hash" yaml:"hash"`
	FingerPrint string `json:"fingerprint" yaml:"fingerprint"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL