public class DecryptHelper
{
public static String decryptAndVerify(String encrypted, PgpPrivateKey privateKey, PgpPublicKey key)
{
byte[] array = Encoding.UTF8.GetBytes(encrypted);
MemoryStream stream = new MemoryStream(array);
PgpObjectFactory objectFactory = new PgpObjectFactory(PgpUtilities.GetDecoderStream(stream));
Object obj = objectFactory.NextPgpObject();
PgpEncryptedDataList enc = obj is PgpEncryptedDataList ? (PgpEncryptedDataList)obj : (PgpEncryptedDataList)objectFactory.NextPgpObject();
PgpPublicKeyEncryptedData encdata = null;
foreach (PgpPublicKeyEncryptedData encdata1 in enc.GetEncryptedDataObjects())
{
if (1 == 1)
{
encdata = encdata1;
break;
}
}
PgpPublicKeyEncryptedData pb