store

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2026 License: GPL-3.0 Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package store 是守卫侧的持久化层,以原子替换将扩展配对的长期共享密钥写入数据目录。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KeyStore

type KeyStore struct {
	// contains filtered or unexported fields
}

KeyStore 以 0600 权限持久化扩展配对的长期共享密钥 K。

func NewKeyStore

func NewKeyStore(path string) *KeyStore

NewKeyStore 返回落盘在 path 的密钥存储。

func (*KeyStore) Load

func (s *KeyStore) Load() (key []byte, ok bool, err error)

Load 读取长期密钥;文件不存在时返回 ok=false 而非错误。

func (*KeyStore) Save

func (s *KeyStore) Save(key []byte) error

Save 原子写入长期密钥,文件与目录权限分别为 0600 / 0700。重新配对时覆盖旧密钥。

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL