Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrKeyExists = fmt.Errorf("Key已经存在")
View Source
var ErrNoSuchKey = fmt.Errorf("Key不存在")
Functions ¶
This section is empty.
Types ¶
type FSKeystore ¶
type FSKeystore struct {
// contains filtered or unexported fields
}
FSKeystore 将keystore存储在磁盘文件中
func NewFSKeystore ¶
func NewFSKeystore(dir string) (*FSKeystore, error)
NewFSKeystore 创建FSKeystore文件夹
type Keystore ¶
type Keystore interface { // 判断Key是否存在 Has(string) (bool, error) // 将Key存储到keystore中, 如果已经存在相同名称的key,则返回已存在错误。 Put(string, ci.PrivKey) error // 从keystore中获取key,如果不存在返回不存在错误 Get(string) (ci.PrivKey, error) // 从Keystore中删除key Delete(string) error // 列出所有的key List() ([]string, error) }
Keystore 提供了一个key管理的接口
type MemKeystore ¶
type MemKeystore struct {
// contains filtered or unexported fields
}
MemKeystore 是内存存储
Click to show internal directories.
Click to hide internal directories.