区块链加密服务商 (Blockchain Cryptographic Service Provider, BCCSP)
1. 介绍
bccsp是fabric总结的概念,我在这一节主要就是介绍fabric里的bccsp开发细节,供所有区块链爱好者学习交流。
另外,我在GitHub上创建了一个仓库,专门用来学习fabric-2.3.0,欢迎大家多多⭐️。
2. bccsp包的内部细节
尽量详细的介绍fabric项目中bccsp包里代码的设计思路。
2.1 实现BCCSP需要实现哪些接口?
要想实现BCCSP的功能,那么我们需要实现以下给出的接口:
type BCCSP interface {
KeyGen(opts KeyGenOpts) (key Key, err error)
KeyDerive(key Key, opts KeyDeriveOpts) (dk Key, err error)
KeyImport(raw interface{}, opts KeyImportOpts) (key Key, err error)
GetKey(ski []byte) (key Key, err error)
Hash(msg []byte, opts HashOpts) ([]byte, error)
GetHash(opts HashOpts) (hash hash.Hash, err error)
Sign(key Key, digest []byte, opts SignerOpts) (signature []byte, err error)
Verify(key Key, digest []byte, opts SignerOpts) (valid bool, err error)
Encrypt(key Key, plaintext []byte, opts EncrypterOpts) (ciphertext []byte, err error)
Decrypt(key Key, ciphertext []byte, opts DecrypterOpts) (plaintext []byte, err error)
}
深入理解Fabric中的BCCSP:区块链加密服务接口详解,
BCCSP是HyperledgerFabric项目中的一个重要概念,它定义了一组用于加密操作的接口,包括密钥生成、导出、加密解密以及签名验证等功能。文章详细介绍了BCCSP包的内部设计,特别是需要实现的接口,如KeyGen、KeyDerive等,并提到了一个GitHub仓库,供学习者参考和交流Fabric2.3.0的相关知识。
4312

被折叠的 条评论
为什么被折叠?



