Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TxFromContext ¶
TxFromContext extracts the transaction set by WithTx, or returns nil.
Types ¶
type EncryptedKey ¶
type EncryptedKey struct {
Scope string
ScopeID string
KeyVersion int
EncryptedDEK []byte
SystemKeyID string
CreatedAt time.Time
RevokedAt *time.Time
}
EncryptedKey represents a stored encrypted DEK.
type KeyStore ¶
type KeyStore interface {
GetActiveKey(ctx context.Context, scope, scopeID string) (*EncryptedKey, error)
GetKey(ctx context.Context, scope, scopeID string, version int) (*EncryptedKey, error)
CreateKey(ctx context.Context, scope, scopeID string, version int, encryptedDEK []byte, systemKeyID string) error
// RevokeKeys revokes all keys for the scope except the highest version.
RevokeKeys(ctx context.Context, scope, scopeID string) error
DestroyKeys(ctx context.Context, scope, scopeID string) error
}
KeyStore manages encrypted DEK storage and retrieval.
Directories
¶
| Path | Synopsis |
|---|---|
|
migrations
Package migrations exposes the embedded PostgreSQL keystore migration.
|
Package migrations exposes the embedded PostgreSQL keystore migration. |
Click to show internal directories.
Click to hide internal directories.