othername

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2025 License: MIT Imports: 5 Imported by: 2

Documentation

Overview

Package othername is a minimal and incomplete implementation of the otherName SAN extension.

Index

Constants

This section is empty.

Variables

View Source
var (
	UPNOID = asn1.ObjectIdentifier{1, 3, 6, 1, 4, 1, 311, 20, 2, 3}
	SANOID = asn1.ObjectIdentifier{2, 5, 29, 17}
)

Functions

func Extension

func Extension(names ...*OtherName) (pkix.Extension, error)

Extension generates an otherName extension.

func ExtensionFromUPNs

func ExtensionFromUPNs(upns ...string) (ext pkix.Extension, err error)

ExtensionFromUPNs build an otherName extension based on the provided UPNs.

func UPNs

func UPNs(cert *x509.Certificate) (upns []string, err error)

UPNs returns all UPNs that are stored in certificates otherName extension.

func UserAndDomain

func UserAndDomain(cert *x509.Certificate) (user string, domain string, err error)

UserAndDomain returns the user and domain from the first valid UPN in the certificate's otherName extension.

Types

type OtherName

type OtherName struct {
	ID    asn1.ObjectIdentifier
	Value asn1.RawValue
}

func Names

func Names(cert *x509.Certificate) ([]*OtherName, error)

Names returns the names from the otherName extension of the provided certificate. If it does not contain such an extension, it will return an empty slice and no error.

Jump to

Keyboard shortcuts

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