3 Star 6 Fork 7

Gitee 极速下载 / Hyperledger fabric

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/hyperledger/fabric
克隆/下载
interfaces.go 1.94 KB
一键复制 编辑 原始数据 按行查看 历史
/*
Copyright IBM Corp. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package entities
// Entity is the basic interface for all crypto entities
// that are used by the library to obtain cc-level encryption
type Entity interface {
// ID returns an identifier for the entity;
// the identifier can be set arbitrarily by
// the entity's constructor in a manner that
// is relevant for its usage at the cc-level
ID() string
// Equals compares this entity with the supplied
// one and returns a boolean that is true if the
// two entities are identical. This includes any
// and all key material that the entity uses
Equals(Entity) bool
// Public returns the public version of this entity
// in case asymmetric cryptography is used. If not,
// Public returns itself
Public() (Entity, error)
}
// Signer is an interface that provides basic sign/verify capabilities
type Signer interface {
// Sign returns a signature of the supplied message (or an error)
Sign(msg []byte) (signature []byte, err error)
// Verify checks whether the supplied signature
// over the supplied message is valid according to this interface
Verify(signature, msg []byte) (valid bool, err error)
}
// Encrypter is an interface that provides basic encrypt/decrypt capabilities
type Encrypter interface {
// Encrypt returns the ciphertext for the supplied plaintext message
Encrypt(plaintext []byte) (ciphertext []byte, err error)
// Decrypt returns the plaintext for the supplied ciphertext message
Decrypt(ciphertext []byte) (plaintext []byte, err error)
}
// Encrypter entity is an entity which is capable of performing encryption
type EncrypterEntity interface {
Entity
Encrypter
}
// SignerEntity is an entity which is capable of signing
type SignerEntity interface {
Entity
Signer
}
// EncrypterSignerEntity is an entity which is capable of performing
// encryption and of generating signatures
type EncrypterSignerEntity interface {
Entity
Encrypter
Signer
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/mirrors/fabric.git
git@gitee.com:mirrors/fabric.git
mirrors
fabric
Hyperledger fabric
v1.2.0-rc1

搜索帮助

344bd9b3 5694891 D2dac590 5694891