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 theEncryptionContext
for 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 S
read
(Object value, MongoConversionContext context) default T
write
(Object value, MongoConversionContext context) Methods inherited from interface org.springframework.data.convert.PropertyValueConverter
readNull, writeNull
-
Method Details
-
read
- Specified by:
read
in 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:
write
in 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 theEncryptionContext
for a givenvalue conversion context
.- Parameters:
context
- the current MongoDB specificValueConversionContext
.- Returns:
- the
EncryptionContext
to operate in. - See Also:
-