utils

package
v0.0.0-...-ea10e50 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2024 License: MPL-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const TimeFormat = "2006/01/02"

Variables

This section is empty.

Functions

func BigIntFromHexString

func BigIntFromHexString(serial string) (*big.Int, error)

func CRLFromURL

func CRLFromURL(crlUrl string) (*pkix.CertificateList, error)

func FindSerial

func FindSerial(crl *pkix.CertificateList, serial *big.Int) (pkix.RevokedCertificate, error)

func TimeFromString

func TimeFromString(date string) (time.Time, error)

func ValidateRevocationDate

func ValidateRevocationDate(cert pkix.RevokedCertificate, ourRevocationDate time.Time) error

func ValidateRevocationReason

func ValidateRevocationReason(cert pkix.RevokedCertificate, ourReason RevocationReason) error

Types

type CRLDownloadFailed

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

func (CRLDownloadFailed) Error

func (c CRLDownloadFailed) Error() string

type CRLFailedToParse

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

func (CRLFailedToParse) Error

func (c CRLFailedToParse) Error() string

type CRLNotGiven

type CRLNotGiven struct{}

func (CRLNotGiven) Error

func (c CRLNotGiven) Error() string

type HexDecodeFailed

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

func (HexDecodeFailed) Error

func (h HexDecodeFailed) Error() string

type RevocationReason

type RevocationReason int
const (
	UNSPECIFIED RevocationReason = iota
	KEY_COMPROMISE
	CA_COMPROMISE
	AFFILIATION_CHANGE
	SUPERSEDED
	CESSATION_OF_OPERATION
	CERTIFICATE_HOLD
	REMOVE_FROM_CRL
	PRIVILEGE_WITHDRAWN
	AA_COMPROMISE
)
const NOT_GIVEN RevocationReason = -1

The following is an enumeration that, for a given revocation, the CA is claiming is the reason for said revocation.

https://tools.ietf.org/html/rfc5280#section-5.3.1

Integers 0-10 (inclusive) are reserved by RFC 5280. As this field is optional, this program reserves -1 to mean "not given" (either from the CCADB or a CA).

(0) unspecified
(1) keyCompromise
(2) cACompromise
(3) affiliationChanged
(4) superseded
(5) cessationOfOperation
(6) certificateHold
(8) removeFromCRL
(9) privilegeWithdrawn
(10) aACompromise

func FromString

func FromString(str *string) (RevocationReason, error)

func (RevocationReason) String

func (r RevocationReason) String() string

type RevocationReasonError

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

func (RevocationReasonError) Error

func (r RevocationReasonError) Error() string

type RevocationtimeError

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

func (RevocationtimeError) Error

func (r RevocationtimeError) Error() string

type SerialNotFound

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

func (SerialNotFound) Error

func (s SerialNotFound) Error() string

Jump to

Keyboard shortcuts

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