Interface EncryptingConverter<S,T>
- All Superinterfaces:
MongoValueConverter<S,T>, PropertyValueConverter<S, T, MongoConversionContext>
- All Known Implementing Classes:
MongoEncryptionConverter
A specialized
MongoValueConverter for encrypting and decrypting properties.- Since:
- 4.1
- Author:
- Christoph Strobl
-
Nested Class Summary
Nested classes/interfaces inherited from interface PropertyValueConverter
PropertyValueConverter.FunctionPropertyValueConverter<DV,SV, P>, PropertyValueConverter.ObjectToObjectPropertyValueConverter -
Method Summary
Modifier and TypeMethodDescriptionObtain theEncryptionContextfor a givenvalue conversion context.@Nullable Sdecrypt(Object encryptedValue, EncryptionContext context) Decrypt the given encrypted source value within the givencontext.encrypt(@Nullable Object value, EncryptionContext context) Encrypt the given raw source value within the givencontext.default @Nullable Sread(Object value, MongoConversionContext context) default @Nullable Twrite(Object value, MongoConversionContext context) Methods inherited from interface PropertyValueConverter
readNull, writeNull
-
Method Details
-
read
- Specified by:
readin interfacePropertyValueConverter<S, T, MongoConversionContext>
-
decrypt
Decrypt the given encrypted source value within the givencontext.- Parameters:
encryptedValue- the encrypted source.context- the context to operate in.- Returns:
- never null.
-
write
- Specified by:
writein interfacePropertyValueConverter<S, T, MongoConversionContext>
-
encrypt
Encrypt the given raw source value within the givencontext.- Parameters:
value- the encrypted source.context- the context to operate in.- Returns:
- never null.
-
buildEncryptionContext
Obtain theEncryptionContextfor a givenvalue conversion context.- Parameters:
context- the current MongoDB specificValueConversionContext.- Returns:
- the
EncryptionContextto operate in. - See Also:
-