Documentation ¶
Index ¶
- Constants
- func CreateRepo() (string, error)
- func NewChainAdaptor(conf *config.Config) (blockchain.KeyAdaptor, error)
- type Client
- type KeyAdaptor
- func (a *KeyAdaptor) GetSocialKey(ctx context.Context, req *keylocker.GetSocialKeyReq) (*keylocker.GetSocialKeyRep, error)
- func (a *KeyAdaptor) GetSupportChain(req *keylocker.SupportChainReq) (*keylocker.SupportChainRep, error)
- func (a *KeyAdaptor) SetSocialKey(ctx context.Context, req *keylocker.SetSocialKeyReq) (*keylocker.SetSocialKeyRep, error)
Constants ¶
View Source
const ChainName = "Ipfs"
Variables ¶
This section is empty.
Functions ¶
func NewChainAdaptor ¶
func NewChainAdaptor(conf *config.Config) (blockchain.KeyAdaptor, error)
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
type KeyAdaptor ¶
type KeyAdaptor struct { fallback.KeyAdaptor // contains filtered or unexported fields }
func (*KeyAdaptor) GetSocialKey ¶
func (a *KeyAdaptor) GetSocialKey(ctx context.Context, req *keylocker.GetSocialKeyReq) (*keylocker.GetSocialKeyRep, error)
GetSocialKey 1. req.uuid 取到链上的存储 req.key 的文件, 2. 解密返回就行
func (*KeyAdaptor) GetSupportChain ¶
func (a *KeyAdaptor) GetSupportChain(req *keylocker.SupportChainReq) (*keylocker.SupportChainRep, error)
func (*KeyAdaptor) SetSocialKey ¶
func (a *KeyAdaptor) SetSocialKey(ctx context.Context, req *keylocker.SetSocialKeyReq) (*keylocker.SetSocialKeyRep, error)
SetSocialKey 1. 如果对应 uuid(req.uuid) 没有 rsa 密钥对,生成 rsa 密钥对,生成 RSA 密钥对处理,私钥,用用户密码(req.password)进行 AES 加密存储, 公钥明文存储, 如果有直接使用 2. 用 rsa 私钥对 key(req.key 是用户上传的一个私钥) 加密,加密 key 调用 ipfs 上传 3. 返回加密的 RSA 的私钥和明文的 RSA 公钥匙, 加密方式,IPFS 对应的 CID
Click to show internal directories.
Click to hide internal directories.