diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2022-10-04 12:04:27 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2022-10-04 12:04:27 +0700 |
commit | 2446ee5e5a03f864ab8fde48bc9c4c1f133f9271 (patch) | |
tree | 3680f45b5f9d04835b4989b01a547af4d215db08 /crypto/src/cms/KeyAgreeRecipientInformation.cs | |
parent | Update CryptoProObjectIdentifiers (diff) | |
download | BouncyCastle.NET-ed25519-2446ee5e5a03f864ab8fde48bc9c4c1f133f9271.tar.xz |
Refactoring
Diffstat (limited to 'crypto/src/cms/KeyAgreeRecipientInformation.cs')
-rw-r--r-- | crypto/src/cms/KeyAgreeRecipientInformation.cs | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/crypto/src/cms/KeyAgreeRecipientInformation.cs b/crypto/src/cms/KeyAgreeRecipientInformation.cs index 8843ede0d..398082810 100644 --- a/crypto/src/cms/KeyAgreeRecipientInformation.cs +++ b/crypto/src/cms/KeyAgreeRecipientInformation.cs @@ -208,11 +208,9 @@ namespace Org.BouncyCastle.Cms public override CmsTypedStream GetContentStream( ICipherParameters key) { - if (!(key is AsymmetricKeyParameter)) + if (!(key is AsymmetricKeyParameter receiverPrivateKey)) throw new ArgumentException("KeyAgreement requires asymmetric key", "key"); - AsymmetricKeyParameter receiverPrivateKey = (AsymmetricKeyParameter) key; - if (!receiverPrivateKey.IsPrivate) throw new ArgumentException("Expected private key", "key"); |