Class BindCertificateUseCase

java.lang.Object
com.irurueta.authserver.authorization.application.x509.BindCertificateUseCase

@Service @Transactional public class BindCertificateUseCase extends Object
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 Details

    • certificateBindingRepository

      private final CertificateBindingRepository certificateBindingRepository
      Port that stores the bindings.
    • recordSecurityEventUseCase

      private final RecordSecurityEventUseCase recordSecurityEventUseCase
      Use case that records the audit events.
    • clock

      private final Clock 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.