Documentation
¶
Overview ¶
Package x509util provides utility functions for parsing and handling X.509 certificates and keys.
Index ¶
- func NewCAELSICertificateDER(subAttrs ELSIName, keyparams KeyParams) (subPrivKey any, DERCert []byte, err error)
- func NewCAELSICertificateRaw(subAttrs ELSIName, keyparams KeyParams) (subPrivKey any, subCert *x509.Certificate, err error)
- func ParseCertificateFromPEM(pemData []byte) (cert *x509.Certificate, issuer *ELSIName, subject *ELSIName, b64der string, ...)
- func ParseEIDASCertB64Der(certDer string) (cert *x509.Certificate, issuer *ELSIName, subject *ELSIName, err error)
- func ParseEIDASCertDer(rawCert []byte) (cert *x509.Certificate, issuer *ELSIName, subject *ELSIName, err error)
- type ELSIName
- type KeyParams
- type PEMCert
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCAELSICertificateDER ¶
func NewCAELSICertificateRaw ¶
func ParseCertificateFromPEM ¶
func ParseCertificateFromPEM(pemData []byte) (cert *x509.Certificate, issuer *ELSIName, subject *ELSIName, b64der string, err error)
ParseCertificate extracts the first certificate from the given PEM string
func ParseEIDASCertB64Der ¶
func ParseEIDASCertDer ¶
Types ¶
type ELSIName ¶
type ELSIName struct {
Country string `json:"country,omitempty"`
Organization string `json:"organization,omitempty"`
OrganizationalUnit string `json:"organizational_unit,omitempty"`
Locality string `json:"locality,omitempty"`
Province string `json:"province,omitempty"`
StreetAddress string `json:"street_address,omitempty"`
PostalCode string `json:"postal_code,omitempty"`
SerialNumber string `json:"serial_number,omitempty"`
CommonName string `json:"common_name,omitempty"`
GivenName string `json:"given_name,omitempty"`
Surname string `json:"surname,omitempty"`
OrganizationIdentifier string `json:"organization_identifier,omitempty"`
EmailAddress string `json:"email_address,omitempty"`
}
ELSIName represents an X.509 distinguished name. This only includes the common elements of a DN. Note that ELSIName is only an approximation of the X.509 structure. If an accurate representation is needed, asn1.Unmarshal the raw subject or issuer as an [RDNSequence].
func ParseEIDASNameFromATVSequence ¶
func ParseEIDASNameFromATVSequence(rdn []pkix.AttributeTypeAndValue) *ELSIName
func (ELSIName) ToATVSequence ¶
func (n ELSIName) ToATVSequence() (ret []pkix.AttributeTypeAndValue)
Click to show internal directories.
Click to hide internal directories.