Interface CertificateBindingRepository
- All Known Implementing Classes:
JdbcCertificateBindingRepository
public interface CertificateBindingRepository
Port that stores the client certificates bound to accounts. It never returns
null.-
Method Summary
Modifier and TypeMethodDescriptionbooleanDeletes a binding of an account.findByFingerprintSha256(String fingerprintSha256) Finds the binding of a certificate.findByUser(UUID userId) Lists the certificates bound to an account, oldest first.save(CertificateBinding binding) Stores a binding.
-
Method Details
-
findByFingerprintSha256
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
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
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:
truewhen a binding was deleted.
-