Interface CryptoService

All Known Implementing Classes:
CryptoServiceImpl

public interface CryptoService
  • Method Details

    • encodePassword

      String encodePassword(String password, PublicKey publicKey)
      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

      Boolean matches(String password, String encoded, PrivateKey privateKey)
      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.