diff --git a/PgpCore/Utilities.cs b/PgpCore/Utilities.cs index b47ce26..24e90ba 100644 --- a/PgpCore/Utilities.cs +++ b/PgpCore/Utilities.cs @@ -428,7 +428,7 @@ public static PgpPublicKey ReadPublicKey(Stream inputStream) { foreach (PgpSignature s in key.GetSignatures()) { - if (s.GetHashedSubPackets().GetKeyFlags() == encryptKeyFlags) + if (s.HasSubpackets && s.GetHashedSubPackets().GetKeyFlags() == encryptKeyFlags) return key; } }