Documentation
¶
Index ¶
- Variables
- type AES256
- type CredentialCipher
- type CredentialKeyring
- func (r *CredentialKeyring) CurrentKeyID() string
- func (r *CredentialKeyring) Open(scope CredentialScope, ciphertext []byte) ([]byte, error)
- func (r *CredentialKeyring) Rekey(scope CredentialScope, ciphertext []byte) ([]byte, bool, error)
- func (r *CredentialKeyring) Seal(scope CredentialScope, plaintext []byte) ([]byte, error)
- type CredentialScope
- type Hasher
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalidHash = xerror.InvalidInput(xerror.PasswordHash) ErrIncompatibleVersion = xerror.Unsupported(xerror.PasswordHash) )
var ( ErrCredentialCiphertext = xerror.New(xerror.KindInternal, "CREDENTIAL_CIPHERTEXT_INVALID", "credential ciphertext invalid") ErrCredentialScope = xerror.New(xerror.KindInternal, "CREDENTIAL_SCOPE_INVALID", "credential encryption scope invalid") ErrCredentialKeyring = xerror.New(xerror.KindInternal, "CREDENTIAL_KEYRING_INVALID", "credential encryption keyring invalid") )
Functions ¶
This section is empty.
Types ¶
type AES256 ¶
type AES256 interface {
Encrypt(plaintext []byte) ([]byte, error)
Decrypt(ciphertext []byte) ([]byte, error)
}
AES256 is the interface for AES-256-GCM encryption/decryption.
type CredentialCipher ¶
type CredentialCipher interface {
Seal(CredentialScope, []byte) ([]byte, error)
Open(CredentialScope, []byte) ([]byte, error)
}
CredentialCipher protects persisted product secrets. Queued email tokens and short-lived execution envelopes have separate keys and lifecycles.
type CredentialKeyring ¶
type CredentialKeyring struct {
// contains filtered or unexported fields
}
CredentialKeyring encrypts with one key and decrypts with explicitly retained keys. The optional legacy key reads pre-versioning records only.
func NewCredentialKeyring ¶
func (*CredentialKeyring) CurrentKeyID ¶
func (r *CredentialKeyring) CurrentKeyID() string
func (*CredentialKeyring) Open ¶
func (r *CredentialKeyring) Open(scope CredentialScope, ciphertext []byte) ([]byte, error)
func (*CredentialKeyring) Rekey ¶
func (r *CredentialKeyring) Rekey(scope CredentialScope, ciphertext []byte) ([]byte, bool, error)
Rekey authenticates even current-key records. Unchanged records retain their original bytes so a resumable sweep can skip writes and preserve revisions.
func (*CredentialKeyring) Seal ¶
func (r *CredentialKeyring) Seal(scope CredentialScope, plaintext []byte) ([]byte, error)
type CredentialScope ¶
CredentialScope comes from the expected database record, never the ciphertext. SchemaVersion identifies the plaintext contract independently of the cipher format.