cert

package
v0.13.1 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2020 License: GPL-3.0 Imports: 6 Imported by: 12

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetActiveCertificates

func GetActiveCertificates(jwks []interface{}, instant time.Time) []*x509.Certificate

GetActiveCertificates converts the given JWKs to X509 certificates and returns them sorted, longest valid certificate first. Expired certificates aren't returned.

func GetCertificate

func GetCertificate(jwkAsMap interface{}) *x509.Certificate

GetCertificate converts the given JWK to a X.509 certificate chain, returning the topmost certificate. If the JWK does not contain any certificates, nil is returned.

func MarshalNutsDomain

func MarshalNutsDomain(domain string) ([]byte, error)

func MarshalOtherSubjectAltName

func MarshalOtherSubjectAltName(valueType asn1.ObjectIdentifier, value string) ([]byte, error)

func UnmarshalNutsDomain

func UnmarshalNutsDomain(data []byte) (string, error)

UnmarshalNutsDomain tries to unmarshal the ASN.1 encoded Nuts Domain extension in a X.509 certificate. It returns the value as a string, or an error if one occurs.

func UnmarshalOtherSubjectAltName

func UnmarshalOtherSubjectAltName(valueType asn1.ObjectIdentifier, data []byte) (string, error)

UnmarshalOtherSubjectAltName tries to unmarshal an SubjectAlternativeName otherName entry (marshalled by MarshalOtherSubjectAltName) with the given OID type (valueType). It returns the value as string. If an otherName with the given type wasn't found, an empty string is returned. If an errors occurs during unmarshalling, it is returned.

Types

This section is empty.

Jump to

Keyboard shortcuts

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