Documentation
¶
Index ¶
- Constants
- func GetDomain(certificate *x509.Certificate) (string, error)
- func GetOrganizationSubjectAltName(certificate *x509.Certificate) (string, error)
- func GetVendorSubjectAltName(certificate *x509.Certificate) (string, error)
- func OrganisationCertificateRequest(vendorName string, organisationID string, organisationName string, ...) (x509.CertificateRequest, error)
- func VendorCertificateRequest(vendorID string, vendorName string, qualifier string, domain string) (x509.CertificateRequest, error)
- type CertificateType
Constants ¶
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" )