Class BindCertificateUseCase
java.lang.Object
com.irurueta.authserver.authorization.application.x509.BindCertificateUseCase
Use case that binds a client certificate to an account and audits it. The audit detail is the fingerprint, which
identifies a public certificate and is not a secret.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final CertificateBindingRepositoryPort that stores the bindings.private final ClockSource of the current time.private final RecordSecurityEventUseCaseUse case that records the audit events. -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
certificateBindingRepository
Port that stores the bindings. -
recordSecurityEventUseCase
Use case that records the audit events. -
clock
Source of the current time.
-
-
Constructor Details
-
BindCertificateUseCase
public BindCertificateUseCase()
-
-
Method Details
-
execute
public CertificateBinding execute(UUID userId, String username, String fingerprintSha256, String subjectDn) Binds a certificate to an account. Binding a certificate the account already has changes nothing.- Parameters:
userId- identifier of the account.username- name of the account, for the audit log.fingerprintSha256- SHA-256 fingerprint of the certificate, as lower case hexadecimal digits.subjectDn- subject distinguished name of the certificate.- Returns:
- the binding.
- Throws:
CertificateAlreadyBoundException- if the certificate is bound to another account.IllegalArgumentException- if the fingerprint or the subject is malformed.
-