x509

package
v1.4.4-2-dev Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Mvid = "Mvid"
	Mpid = "Mpid"
)

Variables

This section is empty.

Functions

func BytesToHex

func BytesToHex(bytes []byte) string

func FormatOID added in v0.10.0

func FormatOID(header, oldKey, newKey string) string

This function is needed to patch the Issuer/Subject(vid/pid) field of certificate to hex format. https://github.com/zigbee-alliance/distributed-compliance-ledger/issues/270

func GetPidFromSubject added in v1.2.0

func GetPidFromSubject(subjectAsText string) (int32, error)

func GetVidFromSubject added in v1.2.0

func GetVidFromSubject(subjectAsText string) (int32, error)

func RemoveWhitespaces added in v1.4.3

func RemoveWhitespaces(pem string) string

func ToBase64String added in v0.10.0

func ToBase64String(subject []byte) string

func ToSubjectAsText added in v0.10.0

func ToSubjectAsText(subject string) string

Types

type Certificate added in v0.10.0

type Certificate struct {
	Issuer         string
	SerialNumber   string
	Subject        string
	SubjectAsText  string
	SubjectKeyID   string
	AuthorityKeyID string
	Certificate    *x509.Certificate
}

func DecodeX509Certificate

func DecodeX509Certificate(pemCertificate string) (*Certificate, error)

func (Certificate) IsSelfSigned added in v0.10.0

func (c Certificate) IsSelfSigned() bool

func (Certificate) Verify added in v0.10.0

func (c Certificate) Verify(parent *Certificate, blockTime time.Time) error

Jump to

Keyboard shortcuts

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