x509

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2019 License: GPL-3.0 Imports: 14 Imported by: 0

README

// Possible certificate files; stop after finding one.
var certFiles = []string{
	"/etc/ssl/certs/ca-certificates.crt",                // Debian/Ubuntu/Gentoo etc.
	"/etc/pki/tls/certs/ca-bundle.crt",                  // Fedora/RHEL 6
	"/etc/ssl/ca-bundle.pem",                            // OpenSUSE
	"/etc/pki/tls/cacert.pem",                           // OpenELEC
	"/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem", // CentOS/RHEL 7
}

Source: https://golang.org/src/crypto/x509/root_linux.go

Documentation

Index

Constants

View Source
const Name = "x509"

Name of the probe

Variables

This section is empty.

Functions

func New

func New() probe.Probe

New returns a new Probe

Types

type Probe

type Probe struct {
	Host        string `json:"host"`
	Port        int    `json:"port"`
	RootCertRaw string `json:"rootCert"`
	// contains filtered or unexported fields
}

Probe struct : Informations necessaires à l'execution de la probe All attributes must be Public

func (*Probe) GenerateTStepName

func (p *Probe) GenerateTStepName() string

GenerateTStepName return a tstep name if non existent

func (Probe) GetName

func (Probe) GetName() string

Return Probe Name

func (*Probe) Initialize

func (p *Probe) Initialize(step probe.StepProbe) error

Initialize Probe struct data

func (*Probe) Run

func (p *Probe) Run(timeout time.Duration) (probeReturns []probe.ProbeReturn)

Start the probe request

type ProbeAnswer

type ProbeAnswer struct {
	Valid   bool `json:"valid"`
	Expired bool `json:"expired"`
	// TODO Trusted             bool      `json:"trusted"`
	Daybeforeexpiration int       `json:"daybeforeexpiration"`
	EndCertificate      ProbeCert `json:"endcertificate"`
	IntCertificate      ProbeCert `json:"intcertificate"`
	RootCertificate     ProbeCert `json:"rootcertificate"`

	ProbeInfo probe.ProbeInfo `json:"probeinfo"`
}

ProbeAnswer is the returned result after query All attributes must be Public ProbeInfo is Mandatory => Détail l'execution de la probe

type ProbeCert

type ProbeCert struct {
	Signature                   []byte                  `json:"signature"`
	SignatureAlgorithm          string                  `json:"signaturealgorithm"`
	PublicKeyAlgorithm          string                  `json:"publickeyalgorithm"`
	PublicKey                   string                  `json:"publickey"` //interface{}
	Version                     int                     `json:"version"`
	SerialNumber                *big.Int                `json:"serialnumber"`
	Issuer                      pkix.Name               `json:"issuer"`
	Subject                     pkix.Name               `json:"subject"`
	NotBefore                   time.Time               `json:"notbefore"` // Validity bounds.
	NotAfter                    time.Time               `json:"notafter"`
	KeyUsage                    string                  `json:"keyusage"`
	Extensions                  []pkix.Extension        `json:"extensions"`
	ExtraExtensions             []pkix.Extension        `json:"extraextensions"`
	UnhandledCriticalExtensions []asn1.ObjectIdentifier `json:"unhandledcriticalextensions"`
	ExtKeyUsage                 string                  `json:"extkeyusage"` // []string // Sequence of extended key usages.
	BasicConstraintsValid       bool                    `json:"basicconstraintsvalid"`
	IsCA                        bool                    `json:"isca"`
	MaxPathLen                  int                     `json:"maxpathlen"`
	SubjectKeyId                []byte                  `json:"subjectkeyid"`
	AuthorityKeyId              []byte                  `json:"authoritykeyid"`
	OCSPServer                  []string                `json:"ocspserver"`
	IssuingCertificateURL       []string                `json:"issuingcertificateurl"`
	DNSNames                    []string                `json:"dnsnames"`
	EmailAddresses              []string                `json:"emailaddresses"`
	IPAddresses                 []net.IP                `json:"ipaddresses"`
	URIs                        []*url.URL              `json:"uris"`

	// Name constraints
	PermittedDNSDomainsCritical bool         `json:"permitteddnsdomainscritical"` // if true then the name constraints are marked critical.
	PermittedDNSDomains         []string     `json:"permitteddnsdomains"`
	ExcludedDNSDomains          []string     `json:"excludeddnsdomains"`
	PermittedIPRanges           []*net.IPNet `json:"permittedipranges"`
	ExcludedIPRanges            []*net.IPNet `json:"excludedipranges"`
	PermittedEmailAddresses     []string     `json:"permittedemailaddresses"`
	ExcludedEmailAddresses      []string     `json:"excludedemailaddresses"`
	PermittedURIDomains         []string     `json:"permitteduridomains"`
	ExcludedURIDomains          []string     `json:"excludeduridomains"`

	// CRL Distribution Points
	CRLDistributionPoints []string
}

Jump to

Keyboard shortcuts

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