code: private PGPPrivateKey findSecretKey(PGPSecretKeyRingCollection pgpSec, long keyID, String passPhrase)
        throws PGPException {
  
      PGPSecretKey pgpSecKey = pgpSec.getSecretKey(keyID);
      if (pgpSecKey == null) {
        return null;
      }
      return pgpSecKey.extractPrivateKey(
          new JcePBESecretKeyDecryptorBuilder()
              .setProvider(BouncyCastleProvider.PROVIDER_NAME).build(passPhrase.toCharArray()));
    }
docs: Private util function that finds the private key from keyring collection based on keyId and passPhrase
  @param pgpSec keyring collection
  @param keyID keyID for this encryption file
  @param passPhrase passPhrase for this encryption file
  @throws PGPException