internal

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidSecret 表示读取到的根密钥格式无效。
	ErrInvalidSecret = errors.New("key: invalid root secret")
	// ErrSecretNotFound 表示根密钥不存在或没有值。
	ErrSecretNotFound = errors.New("key: secret not found")
)

Functions

This section is empty.

Types

type Provider

type Provider interface {
	Get(context.Context, string) (Secret, error)
}

Provider 定义内部根密钥读取能力。

type Resolver

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

Resolver 实现统一的业务密钥派生。

func NewResolver

func NewResolver(provider Provider, rootName, scope string) (*Resolver, error)

NewResolver 创建内部密钥解析器。

func (*Resolver) Derive

func (r *Resolver) Derive(ctx context.Context, purpose string) ([]byte, error)

Derive 读取根密钥并按用途派生业务密钥。

type Secret

type Secret struct {
	Value []byte
}

Secret 表示 Provider 读取到的根密钥。

Jump to

Keyboard shortcuts

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