certificate

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 29, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Grab

func Grab(network, ip, port string, timeout time.Duration, servername string) ([]x509.Certificate, error)

func Verify

func Verify(certs []x509.Certificate, servername string) error

Types

type Additional

type Additional struct {
	CommonName         string
	Hash               [32]byte
	NotAfter           time.Time
	Issuer             string
	PublicKey          PubKey
	SignatureAlgorithm x509.SignatureAlgorithm
}

Additional is the additional certificates (eg.: intermediate cert)

type Cert

type Cert struct {
	CommonName         string
	Hash               [32]byte // SHA256
	AlternativeNames   []string
	SignatureAlgorithm x509.SignatureAlgorithm
	PublicKey          PubKey
	SerialNumber       *big.Int
	Issuer             string
	NotBefore          time.Time
	NotAfter           time.Time
	Verified           bool
	VerifiedError      error // This is set if Verified == false
	Chain              []Additional
}

Cert is hold the fields "interesting" part of the certficate chain.

func Scan

func Scan(network, ip, port string, timeout time.Duration, servername string) (Cert, error)

type PubKey

type PubKey struct {
	Algo x509.PublicKeyAlgorithm
	Key  any // *rsa.PublicKey, *ed25519.PublicKey, ...
}

Jump to

Keyboard shortcuts

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