certmgr220

package
v2.3.4 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

  • Copyright (C) BABEC. All rights reserved. *
  • SPDX-License-Identifier: Apache-2.0

* 证书管理:链运行在证书模式下可用 包括:

证书哈希上链、删除、查询;
别名上链、更新、删除、查询

证书别名就是给证书设置一个别名,上链的时候可用此别名代替。以减少证书实际体积。 证书哈希是一种特殊的别名。

当前文件是证书别名的管理。

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 new manage @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

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, err error)

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

func (*CertManageRuntime) DeleteAlias

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

DeleteAlias 本组织管理员

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

func (*CertManageRuntime) Freeze

func (r *CertManageRuntime) Freeze(txSimContext protocol.TxSimContext, params map[string][]byte) ([]byte, 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

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, 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, 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

func (r *CertManageRuntime) UpdateAlias(txSimContext protocol.TxSimContext, params map[string][]byte) (
	result []byte, 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