Class CryptoServiceImpl
java.lang.Object
dk.acto.fafnir.api.service.hazelcast.CryptoServiceImpl
- All Implemented Interfaces:
CryptoService
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal org.springframework.security.crypto.password.PasswordEncoder -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionencodePassword(String password, PublicKey publicKey) Encodes the password.matches(String password, String encoded, PrivateKey privateKey) Checks if the plaintext password matches the encoded one.
-
Field Details
-
passwordEncoder
public final org.springframework.security.crypto.password.PasswordEncoder passwordEncoder
-
-
Constructor Details
-
CryptoServiceImpl
public CryptoServiceImpl()
-
-
Method Details
-
encodePassword
Description copied from interface:CryptoServiceEncodes the password. Will also encrypt it if publicKey is present.- Specified by:
encodePasswordin interfaceCryptoService- Parameters:
password- the password to be encoded.publicKey- the publicKey to be used for encrypting. It can be null.- Returns:
- the encoded password.
-
matches
Description copied from interface:CryptoServiceChecks if the plaintext password matches the encoded one. If privateKey is present it assumes the encoded to be encrypted also.- Specified by:
matchesin interfaceCryptoService- Parameters:
password- the plaintext password.encoded- the encoded password.privateKey- the privateKey to be used for decrypting. It can be null.- Returns:
- whether the password matches.
-