You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Extend the property based conversion feature to combine @Encrypted with @ValueConverter into a single annotation that is evaluated when mapping domain types into their store native representation and back.
The annotation can be applied on a per property basis covering simple values (like String, Integer) as well as complex ones (like an Address) or entire collections of values as outlined below.
@DocumentpublicclassPerson {
Stringid;
Stringname;
@EncryptedField(algorithm = AEAD_AES_256_CBC_HMAC_SHA_512_Deterministic)
Stringssn;
@EncryptedField(algorithm = AEAD_AES_256_CBC_HMAC_SHA_512_Random, altKeyName = "secret-key")
Stringwallet;
@EncryptedField(algorithm = AEAD_AES_256_CBC_HMAC_SHA_512_Random)
Addressaddress;
@EncryptedField(algorithm = AEAD_AES_256_CBC_HMAC_SHA_512_Random)
List<Address> listOfComplex;
// use the value stored in Person.name as value for the altKeyName attribute@EncryptedField(algorithm = AEAD_AES_256_CBC_HMAC_SHA_512_Random, altKeyName = "/name")
StringviaAltKeyNameField;
// ...
}
The EncryptingConverter SPI offers dedicated methods to en-/decrypt objects using an EncryptionContext that provides access to the underlying encryption engine plus all the additional information derived from the target property itself.
The default implementation (MongoCryptConverter implements EncryptingConverter) will be using com.mongodb.client.vault.ClientEncryption for en-/decrypt operations and is set as default for @EncryptedField(converter).
To use explicit encryption in a reactive setup one can choose to use the imperative converter (still using the sync mongodb encryption library) within the reactive flow or switch the default converter to a fully reactive variant (using the drivers reactive streams API) resolving values on subscribe.
Remove caching variant of MongoClientEncryption. Rename types for consistent key alt name scheme. Rename annotation to ExplicitEncrypted.
Add package-info. Improve documentation wording. Reduce visibility of KeyId and KeyAltName to package-private.
Original pull request: #4302
See: #4284
Extend the property based conversion feature to combine
@Encrypted
with@ValueConverter
into a single annotation that is evaluated when mapping domain types into their store native representation and back.The annotation can be applied on a per property basis covering simple values (like
String
,Integer
) as well as complex ones (like anAddress
) or entire collections of values as outlined below.The
EncryptingConverter
SPI offers dedicated methods to en-/decrypt objects using anEncryptionContext
that provides access to the underlying encryption engine plus all the additional information derived from the target property itself.The default implementation (
MongoCryptConverter implements EncryptingConverter
) will be usingcom.mongodb.client.vault.ClientEncryption
for en-/decrypt operations and is set as default for@EncryptedField(converter)
.To use explicit encryption in a reactive setup one can choose to use the imperative converter (still using the sync mongodb encryption library) within the reactive flow or switch the default converter to a fully reactive variant (using the drivers reactive streams API) resolving values on subscribe.
The text was updated successfully, but these errors were encountered: