@Override
  public WorkerKeyPair generate() {
    KeyPairGenerator kpg = null;
    try {
      kpg = KeyPairGenerator.getInstance(ALGORITHM);
    } catch (NoSuchAlgorithmException e) {
      monitor.severe(() -> "NoSuchAlgorithmException for: " + ALGORITHM, e);
      throw new RuntimeException("NoSuchAlgorithmException generating key", e);
    }
    kpg.initialize(1024);
    KeyPair keyPair = kpg.genKeyPair();
    return new WorkerKeyPair() {
      @Override
      public String getInstanceId() {
        return UUID.randomUUID().toString();
      }

      @Override
      public byte[] getEncodedPublicKey() {
        return keyPair.getPublic().getEncoded();
      }

      @Override
      public byte[] getEncodedPrivateKey() {
        return keyPair.getPrivate().getEncoded();
      }
    };
  }
RSA-based implementation for {@link KeyPair} creation. This will go unused in the clear text
flow. TODO: Move to a common location and reconcile with JWE RsaSymmetricKeyGenerator
extensions/security/portability-security-cleartext/src/main/java/org/datatransferproject/security/cleartext/ClearTextKeyGenerator.java