Documentation ¶
Overview ¶
Package uri implement functions to get and marshal URI names from X.509 certificates.
Index ¶
- Variables
- func FGetURINamesFromPEM(f io.Reader) (uris []string, err error)
- func GetExtensionsFromAsn1ObjectIdentifier(certificate *x509.Certificate, id asn1.ObjectIdentifier) []pkix.Extension
- func GetKeyUsageExtensionsFromCertificate(cert *x509.Certificate) (extension []pkix.Extension)
- func GetURINamesFromCertificate(cert *x509.Certificate) (uris []string, err error)
- func GetURINamesFromExtensions(extensions *[]pkix.Extension) (uris []string, err error)
- func GetURINamesFromPEM(encodedCertificate string) (uris []string, err error)
- func MarshalUriSANs(uris []string) (derBytes []byte, err error)
Constants ¶
This section is empty.
Variables ¶
var OidExtensionKeyUsage = asn1.ObjectIdentifier{2, 5, 29, 15}
var OidExtensionSubjectAltName = asn1.ObjectIdentifier{2, 5, 29, 17}
Functions ¶
func FGetURINamesFromPEM ¶
FGetURINamesFromPEM retrieves URIs from the SAN extension of a PEM-encoded X.509 certificate, whose content is in the provided io.Reader.
func GetExtensionsFromAsn1ObjectIdentifier ¶
func GetExtensionsFromAsn1ObjectIdentifier(certificate *x509.Certificate, id asn1.ObjectIdentifier) []pkix.Extension
GetExtensionsFromAsn1ObjectIdentifier takes a parsed X.509 certificate and an OID and gets the extensions that match the given OID
func GetKeyUsageExtensionsFromCertificate ¶
func GetKeyUsageExtensionsFromCertificate(cert *x509.Certificate) (extension []pkix.Extension)
GetKeyUsageExtensionsFromCertificate takes a parsed X.509 certificate and gets the Key Usage extensions
func GetURINamesFromCertificate ¶
func GetURINamesFromCertificate(cert *x509.Certificate) (uris []string, err error)
GetURINamesFromCertificate takes a parsed X.509 certificate and gets the URIs from the SAN extension.
func GetURINamesFromExtensions ¶
GetURINamesFromExtensions retrieves URIs from the SAN extension of a slice of extensions
func GetURINamesFromPEM ¶
GetURINamesFromPEM parses a PEM-encoded X.509 certificate and gets the URIs from the SAN extension.
func MarshalUriSANs ¶
MarshalUriSANs takes URI strings and returns the ASN.1 structure to be used in the Value field for the SAN Extension
Types ¶
This section is empty.