x509

package
v0.4.25 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSubjectAltNames

func GetSubjectAltNames(cert *x509.Certificate) []string

返回指定 x509.Certificate 对象的主题替代名称。

入参:

  • cert: x509.Certificate 对象。

出参:

  • 主题替代名称的字符串切片。

func GetSubjectCommonName

func GetSubjectCommonName(cert *x509.Certificate) string

返回指定 x509.Certificate 对象的主题名称。 如果主题名称为空,则返回第一个主题替代名称。

入参:

  • cert: x509.Certificate 对象。

出参:

  • 主题名称。

func HasPolicy added in v0.4.25

func HasPolicy(cert *x509.Certificate, policy asn1.ObjectIdentifier) bool

检查指定 x509.Certificate 对象是否包含指定的证书策略。

入参:

  • cert: x509.Certificate 对象。
  • policy: 证书策略 OID。

出参:

  • 是否包含指定的证书策略。

func HasPolicyString added in v0.4.25

func HasPolicyString(cert *x509.Certificate, policy string) bool

检查指定 x509.Certificate 对象是否包含指定的证书策略。

入参:

  • cert: x509.Certificate 对象。
  • policy: 证书策略 OID 字符串。

出参:

  • 是否包含指定的证书策略。

Types

type ValidationType added in v0.4.25

type ValidationType int
const (
	UnknownValidation ValidationType = iota
	ExtendedValidation
	DomainValidated
	OrganizationalValidated
	IndividualValidated
)

func GetValidationType added in v0.4.25

func GetValidationType(cert *x509.Certificate) ValidationType

返回指定 x509.Certificate 对象的证书验证类型。

入参:

  • cert: x509.Certificate 对象。

出参:

  • 证书验证类型。

Jump to

Keyboard shortcuts

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