1 files changed, 2 insertions, 2 deletions
diff --git a/crypto/src/openpgp/PgpPublicKeyRing.cs b/crypto/src/openpgp/PgpPublicKeyRing.cs
index e1a2a83f2..34b9e34d1 100644
--- a/crypto/src/openpgp/PgpPublicKeyRing.cs
+++ b/crypto/src/openpgp/PgpPublicKeyRing.cs
@@ -185,10 +185,10 @@ namespace Org.BouncyCastle.Bcpg.OpenPgp
internal static PublicKeyPacket ReadPublicKeyPacket(BcpgInputStream bcpgInput)
{
Packet packet = bcpgInput.ReadPacket();
- if (!(packet is PublicKeyPacket))
+ if (!(packet is PublicKeyPacket publicKeyPacket))
throw new IOException("unexpected packet in stream: " + packet);
- return (PublicKeyPacket)packet;
+ return publicKeyPacket;
}
internal static PgpPublicKey ReadSubkey(BcpgInputStream bcpgInput)
|