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 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 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:
write
in 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 theEncryptionContext
for a givenvalue conversion context
.- Parameters:
context
- the current MongoDB specificValueConversionContext
.- Returns:
- the
EncryptionContext
to operate in. - See Also:
-
ValueConversionContext
-