Interface EncryptingConverter<S,T>
- All Superinterfaces:
MongoValueConverter<S,,T> org.springframework.data.convert.PropertyValueConverter<S,T, MongoConversionContext>
- All Known Implementing Classes:
MongoEncryptionConverter
A specialized
MongoValueConverter for encryptiong and decrypting properties.- Since:
- 4.1
- Author:
- Christoph Strobl
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.springframework.data.convert.PropertyValueConverter
org.springframework.data.convert.PropertyValueConverter.FunctionPropertyValueConverter<DV extends Object,SV extends Object, P extends org.springframework.data.mapping.PersistentProperty<P>>, org.springframework.data.convert.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 interfaceorg.springframework.data.convert.PropertyValueConverter<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 interfaceorg.springframework.data.convert.PropertyValueConverter<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:
-
ValueConversionContext
-