code: public static SecretkeyElement createSecretkeyElement(byte[] keys,
                                                            String backupCode)
              throws PGPException, IOException {
          byte[] encrypted = PGPainless.encryptWithPassword(keys, new Passphrase(backupCode.toCharArray()),
                  SymmetricKeyAlgorithm.AES_256);
          return new SecretkeyElement(Base64.encode(encrypted));
      }
docs: Create a {@link SecretkeyElement} which contains the secret keys which are serialized in {@code keys} and is
  symmetrically encrypted using the {@code backupCode}.
  
  @see <a href="https://xmpp.org/extensions/xep-0373.html#backup-encryption">
  XEP-0373 §5.4 Encrypting the Secret Key Backup</a>
  
  @param keys serialized OpenPGP secret keys in transferable key format
  @param backupCode passphrase for symmetric encryption
  @return {@link SecretkeyElement}
  
  @throws PGPException PGP is brittle
  @throws IOException IO is dangerous