authority

package
v1.66.2 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2022 License: BSD-3-Clause Imports: 12 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// Author 全局证书校验器
	Author = &Authority{}

	// IsAuthEnable 是否开启全局校验开关
	IsAuthEnable = false
)

Functions

This section is empty.

Types

type Authority

type Authority struct {

	// 历史证书缓存
	HistoryCertCache *HistoryCertData
	// contains filtered or unexported fields
}

Authority 证书校验器主要结构

func (*Authority) GetSnFromByte added in v1.65.2

func (auth *Authority) GetSnFromByte(signature *types.Signature) ([]byte, error)

GetSnFromSig 解析证书序列号

func (*Authority) Init

func (auth *Authority) Init(conf *ty.Authority) error

Init 初始化auth

func (*Authority) ReloadCert

func (auth *Authority) ReloadCert(store *types.HistoryCertStore) error

ReloadCert 从数据库中的记录数据恢复证书,用于证书回滚

func (*Authority) ReloadCertByHeght

func (auth *Authority) ReloadCertByHeght(currentHeight int64) error

ReloadCertByHeght 从新的authdir下的文件更新证书,用于证书更新

func (*Authority) Validate

func (auth *Authority) Validate(signature *types.Signature) error

Validate 检验证书

func (*Authority) ValidateCerts

func (auth *Authority) ValidateCerts(task []*types.Signature) bool

ValidateCerts 并发校验证书

type HistoryCertData

type HistoryCertData struct {
	CryptoCfg *core.AuthConfig
	CurHeight int64
	NxtHeight int64
}

HistoryCertData 历史变更记录

func (*HistoryCertData) ToHistoryCertStore

func (certdata *HistoryCertData) ToHistoryCertStore(store *types.HistoryCertStore)

ToHistoryCertStore 历史数据转成store可存储的历史数据

type User

type User struct {
	ID   string
	Cert []byte
	Key  crypto.PrivKey
}

User 用户关联的证书私钥信息

type UserLoader

type UserLoader struct {
	// contains filtered or unexported fields
}

UserLoader SKD加载user使用

func (*UserLoader) Get

func (loader *UserLoader) Get(userName, orgName string) (*User, error)

Get 根据用户名获取user结构

func (*UserLoader) Init

func (loader *UserLoader) Init(configPath string, signType string) error

Init userloader初始化

Jump to

Keyboard shortcuts

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