code: public static SecretkeyElement createSecretkeyElement(OpenPgpProvider provider,
                                                      BareJid owner,
                                                      Set<OpenPgpV4Fingerprint> fingerprints,
                                                      String backupCode)
              throws PGPException, IOException, MissingOpenPgpKeyException {
          ByteArrayOutputStream buffer = new ByteArrayOutputStream();
  
          for (OpenPgpV4Fingerprint fingerprint : fingerprints) {
  
                  PGPSecretKeyRing key = provider.getStore().getSecretKeyRing(owner, fingerprint);
                  if (key == null) {
                      throw new MissingOpenPgpKeyException(owner, fingerprint);
                  }
  
                  byte[] bytes = key.getEncoded();
                  buffer.write(bytes);
          }
          return createSecretkeyElement(buffer.toByteArray(), backupCode);
      }
docs: Create a {@link SecretkeyElement} which contains the secret keys listed in {@code fingerprints} and is encrypted
  symmetrically using the {@code backupCode}.
  
  @param provider {@link OpenPgpProvider} for symmetric encryption.
  @param owner owner of the secret keys (usually our jid).
  @param fingerprints set of {@link OpenPgpV4Fingerprint}s of the keys which are going to be backed up.
  @param backupCode passphrase for symmetric encryption.
  @return {@link SecretkeyElement}
  
  @throws PGPException PGP is brittle
  @throws IOException IO is dangerous
  @throws MissingOpenPgpKeyException in case one of the keys whose fingerprint is in {@code fingerprints} is
  not accessible.