cert

package
v0.14.2 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2020 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const JwkCertificateType = "ct"

JwkCertificateType holds the JSON Web Key member name which will hold CertificateType, describing the type of the certificate.

Variables

This section is empty.

Functions

func GetDomain

func GetDomain(certificate *x509.Certificate) (string, error)

GetDomain tries to get the Nuts Domain from the certificate. If the certificate doesn't require the extension, an empty string is returned. If something else goes wrong, the error is returned.

func GetOrganizationSubjectAltName

func GetOrganizationSubjectAltName(certificate *x509.Certificate) (string, error)

GetOrganizationSubjectAltName tries to get the organization ID (AGB-code) from the certificate SAN. If it doesn't exist, an empty string is returned without error. If an error occurs, an empty string is returned alongside the error.

func GetVendorSubjectAltName

func GetVendorSubjectAltName(certificate *x509.Certificate) (string, error)

GetVendorSubjectAltName tries to get the vendor ID from the certificate SAN. If it doesn't exist, an empty string is returned without error. If an error occurs, an empty string is returned alongside the error.

func OrganisationCertificateRequest

func OrganisationCertificateRequest(vendorName string, organisationID string, organisationName string, domain string) (x509.CertificateRequest, error)

OrganisationCertificateRequest creates a CertificateRequest template for issuing an organisation. The certificate should be issued by the vendor CA. Parameters 'domain' and 'env' are optional.

func VendorCertificateRequest

func VendorCertificateRequest(vendorID string, vendorName string, qualifier string, domain string) (x509.CertificateRequest, error)

VendorCertificateRequest creates a CertificateRequest template for issuing a vendor certificate.

vendorID:      URN-OID-encoded ID of the vendor
vendorName:    Name of the vendor
qualifier:     (optional) Qualifier for the certificate, which will be postfixed to Subject.CommonName
domain:        Domain the vendor operates in, e.g. "healthcare"
env:           (optional) Environment for the certificate, e.g. "Test" or "Dev", which will be postfixed to Subject.CommonName

Types

type CertificateType

type CertificateType string

CertificateType holds one of the certificate types as specified in the Nuts certificate specification

const (
	// VendorCACertificate specifies the CA certificate of a vendor
	VendorCACertificate CertificateType = "vendor-ca"
	// OrganisationCertificate specifies the certificate of an organisation, issued by a vendor
	OrganisationCertificate CertificateType = "org"
)

Jump to

Keyboard shortcuts

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