uri

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package uri implement functions to get and marshal URI names from X.509 certificates.

Index

Constants

This section is empty.

Variables

View Source
var OidExtensionKeyUsage = asn1.ObjectIdentifier{2, 5, 29, 15}
View Source
var OidExtensionSubjectAltName = asn1.ObjectIdentifier{2, 5, 29, 17}

Functions

func FGetURINamesFromPEM

func FGetURINamesFromPEM(f io.Reader) (uris []string, err error)

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

func GetURINamesFromExtensions(extensions *[]pkix.Extension) (uris []string, err error)

GetURINamesFromExtensions retrieves URIs from the SAN extension of a slice of extensions

func GetURINamesFromPEM

func GetURINamesFromPEM(encodedCertificate string) (uris []string, err error)

GetURINamesFromPEM parses a PEM-encoded X.509 certificate and gets the URIs from the SAN extension.

func MarshalUriSANs

func MarshalUriSANs(uris []string) (derBytes []byte, err error)

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.

Jump to

Keyboard shortcuts

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