Interface KeePassRpcPairingService

All Known Implementing Classes:
DefaultKeePassRpcPairingService

public interface KeePassRpcPairingService
UI-independent use case for pairing a Java application with KeePassRPC.

Implementations open a KeePassRPC WebSocket connection, perform the initial SRP identification step, wait for the user-visible one-time pairing key, and return the SRP key that the application must persist for future authenticated requests.

  • Method Details

    • startPairing

      Start a pairing session and keep the underlying WebSocket open until the caller completes or closes the session.
      Parameters:
      request - endpoint, origin, client name, and timeout settings
      Returns:
      an open pairing session waiting for the one-time key shown by KeePass
      Throws:
      KeePassRpcPairingException - if KeePassRPC is not reachable or rejects the request
    • completePairing

      KeePassRpcPairingResult completePairing(KeePassRpcPairingSession session, String pairingKey)
      Complete an open pairing session using the one-time key displayed by KeePass.
      Parameters:
      session - open session returned by startPairing(KeePassRpcPairingRequest)
      pairingKey - one-time key shown by KeePassRPC
      Returns:
      reusable pairing result containing the SRP key to persist
      Throws:
      KeePassRpcPairingException - if the key is invalid or the protocol exchange fails
    • pair

      Run the complete pairing flow with an application-provided key callback.
      Parameters:
      request - endpoint, origin, client name, and timeout settings
      keyProvider - callback that obtains the one-time key from a UI, CLI, or setup flow
      Returns:
      reusable pairing result containing the SRP key to persist