certmgr

package
v2.3.6 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Overview

Package certmgr is package for cert

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CertManageContract

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

CertManageContract 证书管理合约 包括:证书哈希管理、证书别名管理

func NewCertManageContract

func NewCertManageContract(log protocol.Logger) *CertManageContract

NewCertManageContract create a new instance @param log @return *CertManageContract

func (*CertManageContract) GetMethod

func (c *CertManageContract) GetMethod(methodName string) common.ContractFunc

GetMethod get register method by name

type CertManageRuntime

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

CertManageRuntime runtime for contract

func (*CertManageRuntime) Add

func (r *CertManageRuntime) Add(txSimContext protocol.TxSimContext, _ map[string][]byte) (
	result []byte, err error)

Add cert add @param none param one is the certificate itself the other is hash @return certHash

func (*CertManageRuntime) AddAlias added in v2.2.0

func (r *CertManageRuntime) AddAlias(txSimContext protocol.TxSimContext, params map[string][]byte) (
	result []byte, err error)

AddAlias add alias

别名和证书是多对一关系,一个证书可以有多个别名 别名唯一不可重复 其中证书哈希是别名的一个特殊格式 无需传入证书,因为是直接使用交易的签名者,即 sender @param alias 别名

func (*CertManageRuntime) Delete

func (r *CertManageRuntime) Delete(txSimContext protocol.TxSimContext, params map[string][]byte) (
	result []byte, event []*commonPb.ContractEvent, err error)

Delete cert delete @param cert_hashes is cert hash list string, separate by comma @return string for "Success"

func (*CertManageRuntime) DeleteAlias added in v2.2.0

func (r *CertManageRuntime) DeleteAlias(txSimContext protocol.TxSimContext, params map[string][]byte) (
	result []byte, event []*commonPb.ContractEvent, err error)

DeleteAlias 本组织管理员 别名自身不可删除,需组织管理员更新 @param aliases 别名列表,以逗号分隔,如:"alias1,alias2,alias3"

func (*CertManageRuntime) Freeze

func (r *CertManageRuntime) Freeze(txSimContext protocol.TxSimContext, params map[string][]byte) (
	[]byte, []*commonPb.ContractEvent, error)

Freeze certs @param certs is original certificate list string, separate by comma @result cert_hash

func (*CertManageRuntime) Query

func (r *CertManageRuntime) Query(txSimContext protocol.TxSimContext, params map[string][]byte) ([]byte, error)

Query certs query @param cert_hashes is cert hash list string, separate by comma @return cert_hash seeing the name of a thing one thinks of its function @return cert itself

func (*CertManageRuntime) QueryAlias added in v2.2.0

func (r *CertManageRuntime) QueryAlias(txSimContext protocol.TxSimContext, params map[string][]byte) (
	result []byte, err error)

QueryAlias 查询别名信息

@param aliases 别名列表,以逗号分隔,如:"alias1,alias2,alias3" @return HisCerts 返回该别名从最近一次添加后最近10次的的历史变更记录 @return NowCert 当前别名代表的证书、开始生效的高度、证书的哈希 @return Alias 别名

func (*CertManageRuntime) Revoke

func (r *CertManageRuntime) Revoke(txSimContext protocol.TxSimContext, params map[string][]byte) (
	[]byte, []*commonPb.ContractEvent, error)

Revoke certs revocation @param cert_crl @return cert_crl

func (*CertManageRuntime) Unfreeze

func (r *CertManageRuntime) Unfreeze(txSimContext protocol.TxSimContext, params map[string][]byte) (
	[]byte, []*commonPb.ContractEvent, error)

Unfreeze certs unfreeze @param certs is original certificate list string, separate by comma @param cert_hashes is cert hash list string, separate by comma either certs or cert_hashes @result string for "Success"

func (*CertManageRuntime) UpdateAlias added in v2.2.0

func (r *CertManageRuntime) UpdateAlias(txSimContext protocol.TxSimContext, params map[string][]byte) (
	result []byte, event []*commonPb.ContractEvent, err error)

UpdateAlias 别名更新,本组织管理员

别名自身不可更新,需组织管理员更新 @param cert 更新的证书 @param alias 别名

Jump to

Keyboard shortcuts

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