adcs

package
v0.0.0-...-3edab30 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2023 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdcsCertsrv

type AdcsCertsrv interface {
	// Request new certificate.
	// Returns (cert status, certificate or description, id, error)
	// If cert status is 'Unknown' the state of the certificate info couldn't be obtained from  certsrv. Check for error.
	// If cert status is 'Ready' the cert is returned immediately in 'certificate'.
	// If cert status is 'Pending' the cert can be obtained later with getExistingCertificate using the 'id' (see 'description' for more details)
	// If cert status is 'Error' see 'description' for details.
	RequestCertificate(csr string, template string) (AdcsResponseStatus, string, string, error)

	// Get previously requested certicate from Certserv
	// Returns (cert status, certificate or description, id, error)
	// If cert status is 'Unknown' the state of the certificate info couldn't be obtained from certsrv. Check for error.
	// If cert status is 'Ready' the cert is returned in 'certificate'.
	// If cert status is 'Pending' the cert can be obtained later with getExistingCertificate using the 'id' (see 'description' for more details)
	// If cert status is 'Error' see 'description' for details.
	GetExistingCertificate(id string) (AdcsResponseStatus, string, string, error)

	// Get the certsrv' CA cert
	// Returns ( certificate, error)
	GetCaCertificate() (string, error)

	// Get the certsrv' CA chain
	// Returns (certificate, error)
	GetCaCertificateChain() (string, error)
}

func NewNtlmCertsrv

func NewNtlmCertsrv(url string, username string, password string, caCertPool *x509.CertPool, verify bool) (AdcsCertsrv, error)

type AdcsResponseStatus

type AdcsResponseStatus int
const (
	Unknown  AdcsResponseStatus = 0
	Pending  AdcsResponseStatus = 1
	Ready    AdcsResponseStatus = 2
	Errored  AdcsResponseStatus = 3
	Rejected AdcsResponseStatus = 4
)

type NtlmCertsrv

type NtlmCertsrv struct {
	// contains filtered or unexported fields
}

func (*NtlmCertsrv) GetCaCertificate

func (s *NtlmCertsrv) GetCaCertificate() (string, error)

func (*NtlmCertsrv) GetCaCertificateChain

func (s *NtlmCertsrv) GetCaCertificateChain() (string, error)

func (*NtlmCertsrv) GetExistingCertificate

func (s *NtlmCertsrv) GetExistingCertificate(id string) (AdcsResponseStatus, string, string, error)

* Returns: * - Certificate response status * - Certificate (if status is Ready) or status description (if status is not Ready) * - ADCS Request ID * - Error

func (*NtlmCertsrv) RequestCertificate

func (s *NtlmCertsrv) RequestCertificate(csr string, template string) (AdcsResponseStatus, string, string, error)

* Returns: * - Certificate response status * - Certificate (if status is Ready) or status description (if status is not Ready) * - ADCS Request ID (if known) * - Error

Jump to

Keyboard shortcuts

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