core

package
v1.68.4 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2023 License: BSD-3-Clause Imports: 21 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseECDSAPubKey2SM2PubKey

func ParseECDSAPubKey2SM2PubKey(key *ecdsa.PublicKey) *sm2.PublicKey

ParseECDSAPubKey2SM2PubKey 将ECDSA的公钥转成SM2公钥

Types

type AuthConfig

type AuthConfig struct {
	RootCerts         [][]byte
	IntermediateCerts [][]byte
	RevocationList    [][]byte
}

AuthConfig 校验器配置

func GetAuthConfig

func GetAuthConfig(dir string) (*AuthConfig, error)

GetAuthConfig 获取证书文件配置

type Validator

type Validator interface {
	Setup(config *AuthConfig) error

	Validate(cert []byte, pubKey []byte) error

	GetCertFromSignature(signature []byte) ([]byte, error)

	GetCertSnFromSignature(signature []byte) ([]byte, error)
}

Validator 证书校验器

func GetLocalValidator

func GetLocalValidator(authConfig *AuthConfig, signType int) (Validator, error)

GetLocalValidator 根据类型获取校验器

func NewEcdsaValidator

func NewEcdsaValidator() Validator

NewEcdsaValidator 创建ecdsa校验器

func NewGmValidator

func NewGmValidator() Validator

NewGmValidator 创建国密证书校验器

func NewNoneValidator

func NewNoneValidator() (Validator, error)

NewNoneValidator 创建none校验器

Jump to

Keyboard shortcuts

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