Package dk.acto.fafnir.api.service
Interface CryptoService
- All Known Implementing Classes:
CryptoServiceImpl
public interface CryptoService
-
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.
-
Method Details
-
encodePassword
Encodes the password. Will also encrypt it if publicKey is present.- Parameters:
password- the password to be encoded.publicKey- the publicKey to be used for encrypting. It can be null.- Returns:
- the encoded password.
-
matches
Checks if the plaintext password matches the encoded one. If privateKey is present it assumes the encoded to be encrypted also.- 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.
-