Versions in this module Expand all Collapse all v0 v0.14.0 Apr 24, 2024 v0.13.0 Feb 27, 2024 Changes in this version + const KeyTypeAES128 + const KeyTypeAES256 + const KeyTypeChaCha20 + const KeyTypeECDSA256 + const KeyTypeECDSA384 + const KeyTypeECDSA521 + const KeyTypeED25519 + const KeyTypeRSA2048 + const KeyTypeRSA3072 + const KeyTypeRSA4096 + const PropertiesPrefix + var ErrInvalidFormat = data.NewDataError(data.ErrorCodeOrmMapping, "invalid encrypted data") + var ErrInvalidV1Format = data.NewDataError(data.ErrorCodeOrmMapping, "invalid V1 data payload format") + var ErrUnsupportedAlgorithm = data.NewDataError(data.ErrorCodeOrmMapping, "unsupported encryption algorithm of data") + var ErrUnsupportedVersion = data.NewDataError(data.ErrorCodeOrmMapping, "unsupported version of encrypted data format") + var Module = &bootstrap.Module + func CreateKey(ctx context.Context, kid string, opts ...KeyOptions) error + func CreateKeyWithUUID(ctx context.Context, kid uuid.UUID, opts ...KeyOptions) error + func Decrypt(ctx context.Context, raw *EncryptedRaw, dest interface{}) error + func Use() + type Algorithm string + const AlgPlain + const AlgVault + func (a *Algorithm) UnmarshalText(text []byte) error + type DataEncryptionProperties struct + Enabled bool + Key KeyProperties + func BindDataEncryptionProperties(ctx *bootstrap.ApplicationContext) DataEncryptionProperties + func NewDataEncryptionProperties() *DataEncryptionProperties + type EncryptedMap struct + Data map[string]interface{} + func NewEncryptedMap(kid uuid.UUID, v map[string]interface{}) *EncryptedMap + func (d *EncryptedMap) Scan(src interface{}) error + func (d *EncryptedMap) Value() (driver.Value, error) + type EncryptedRaw struct + Alg Algorithm + KeyID string + Raw json.RawMessage + Ver Version + func Encrypt(ctx context.Context, kid string, v interface{}) (*EncryptedRaw, error) + func ParseEncryptedRaw(text string) (ret *EncryptedRaw, err error) + func (EncryptedRaw) GormDataType() string + func (d *EncryptedRaw) Scan(src interface{}) error + func (d *EncryptedRaw) UnmarshalTextV1(text []byte) error + func (d *EncryptedRaw) Value() (driver.Value, error) + type Encryptor interface + Decrypt func(ctx context.Context, raw *EncryptedRaw, dest interface{}) error + Encrypt func(ctx context.Context, kid string, v interface{}) (*EncryptedRaw, error) + KeyOperations func() KeyOperations + type KeyOperations interface + Create func(ctx context.Context, kid string, opts ...KeyOptions) error + type KeyOptions func(opt *keyOption) + type KeyProperties struct + AllowPlaintextBackup bool + Exportable bool + Type string + type KeyType string + func (t *KeyType) UnmarshalText(text []byte) error + type Version int + const V1 + const V2 + func (v *Version) UnmarshalJSON(data []byte) (err error) + func (v *Version) UnmarshalText(text []byte) error