shares

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: May 19, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StatusActive   = "active"
	StatusDisabled = "disabled"
)

Variables

View Source
var (
	ErrShareNotFound         = errors.New("platform share not found")
	ErrShareDisabled         = errors.New("platform share is disabled")
	ErrInvalidSharePayload   = errors.New("invalid platform share payload")
	ErrVaultUnavailable      = errors.New("vault unavailable")
	ErrVaultPermissionDenied = errors.New("vault permission denied")
	ErrVaultWriteFailed      = errors.New("vault write failed")
	ErrVaultReadFailed       = errors.New("vault read failed")
	ErrMetadataMismatch      = errors.New("platform share metadata mismatch")
	ErrUnsupportedVersion    = errors.New("unsupported platform share version")
)

Functions

func MarshalKeyMaterial added in v0.2.2

func MarshalKeyMaterial(material ECDSAKeyMaterial) ([]byte, error)

Types

type Cipher

type Cipher interface {
	Encrypt(ctx context.Context, plaintext []byte) ([]byte, error)
	Decrypt(ctx context.Context, ciphertext []byte) ([]byte, error)
}

type ECDSAKeyMaterial added in v0.2.2

type ECDSAKeyMaterial struct {
	Share            ecdsakeygen.LocalPartySaveData
	ChainCode        []byte
	PublicKeyFormat  string
	DerivationScheme string
}

func UnmarshalKeyMaterial added in v0.2.2

func UnmarshalKeyMaterial(blob []byte) (ECDSAKeyMaterial, error)

type KeyMaterialMeta added in v0.2.2

type KeyMaterialMeta struct {
	ChainCode        []byte
	PublicKeyFormat  string
	DerivationScheme string
}

type KeyRef

type KeyRef struct {
	KeyID string
	OrgID string
	Role  string
}

type LoadedShare

type LoadedShare struct {
	Ref       KeyRef
	Plaintext []byte
	Meta      ShareMeta
}

type ShareMeta

type ShareMeta struct {
	KeyID            string
	OrgID            string
	Algorithm        string
	Curve            string
	CreatedAt        time.Time
	Version          uint32
	Status           string
	ChainCodePresent bool
	PublicKeyFormat  string
	DerivationScheme string
}

type ShareToSave

type ShareToSave struct {
	Ref       KeyRef
	Plaintext []byte
	Meta      ShareMeta
}

type Sink

type Sink interface {
	SaveShare(ctx context.Context, in ShareToSave) error
}

type Source

type Source interface {
	LoadShare(ctx context.Context, ref KeyRef) (*LoadedShare, error)
}

type SourceSink

type SourceSink interface {
	Source
	Sink
}

type Store

type Store interface {
	SaveShare(ctx context.Context, keyID string, blob []byte, meta ShareMeta) error
	LoadShare(ctx context.Context, keyID string) (*StoredShare, error)
	DisableShare(ctx context.Context, keyID string) error
}

type StoredShare

type StoredShare struct {
	Blob []byte
	Meta ShareMeta
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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