Interface CertificateBindingRepository

All Known Implementing Classes:
JdbcCertificateBindingRepository

public interface CertificateBindingRepository
Port that stores the client certificates bound to accounts. It never returns null.
  • Method Details

    • findByFingerprintSha256

      Optional<CertificateBinding> findByFingerprintSha256(String fingerprintSha256)
      Finds the binding of a certificate.
      Parameters:
      fingerprintSha256 - SHA-256 fingerprint of the certificate, as lower case hexadecimal digits.
      Returns:
      the binding, or an empty optional when the certificate is not bound to any account.
    • findByUser

      List<CertificateBinding> findByUser(UUID userId)
      Lists the certificates bound to an account, oldest first.
      Parameters:
      userId - identifier of the account.
      Returns:
      the bindings, possibly empty.
    • save

      Stores a binding.
      Parameters:
      binding - binding to store.
      Returns:
      the stored binding.
    • delete

      boolean delete(UUID id, UUID userId)
      Deletes a binding of an account.
      Parameters:
      id - identifier of the binding.
      userId - identifier of the account, so nobody can unbind another account's certificate.
      Returns:
      true when a binding was deleted.