Module spring.data.mongodb
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 org.springframework.data.convert.PropertyValueConverter
PropertyValueConverter.FunctionPropertyValueConverter<DV extends Object,SV extends Object, P extends PersistentProperty<P>>, PropertyValueConverter.ObjectToObjectPropertyValueConverter -
Method Summary
Modifier and TypeMethodDescriptionObtain theEncryptionContextfor a givenvalue conversion context.decrypt(Object encryptedValue, EncryptionContext context) Decrypt the given encrypted source value within the givencontext.encrypt(Object value, EncryptionContext context) Encrypt the given raw source value within the givencontext.default Sread(Object value, MongoConversionContext context) default Twrite(Object value, MongoConversionContext context) Methods inherited from interface org.springframework.data.convert.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:
-