diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2023-04-12 19:47:03 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2023-04-12 19:47:03 +0700 |
commit | 05a2153fc8cee0f896a8807c0f5decfdb9c06aee (patch) | |
tree | 539fca5b99d32c658f8496dfb5055e7d1edbce85 /crypto/src/cms | |
parent | X509: Refactor stream calculator usage (diff) | |
download | BouncyCastle.NET-ed25519-05a2153fc8cee0f896a8807c0f5decfdb9c06aee.tar.xz |
Use KeyParameter.KeyLength
Diffstat (limited to 'crypto/src/cms')
-rw-r--r-- | crypto/src/cms/EnvelopedDataHelper.cs | 2 | ||||
-rw-r--r-- | crypto/src/cms/KEKRecipientInfoGenerator.cs | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/crypto/src/cms/EnvelopedDataHelper.cs b/crypto/src/cms/EnvelopedDataHelper.cs index 616048297..9dcfe033b 100644 --- a/crypto/src/cms/EnvelopedDataHelper.cs +++ b/crypto/src/cms/EnvelopedDataHelper.cs @@ -79,7 +79,7 @@ namespace Org.BouncyCastle.Cms public AlgorithmIdentifier GenerateEncryptionAlgID(DerObjectIdentifier encryptionOID, KeyParameter encKey, SecureRandom random) { - return AlgorithmIdentifierFactory.GenerateEncryptionAlgID(encryptionOID, encKey.GetKey().Length * 8, random); + return AlgorithmIdentifierFactory.GenerateEncryptionAlgID(encryptionOID, encKey.KeyLength * 8, random); } public CipherKeyGenerator CreateKeyGenerator(DerObjectIdentifier algorithm, SecureRandom random) diff --git a/crypto/src/cms/KEKRecipientInfoGenerator.cs b/crypto/src/cms/KEKRecipientInfoGenerator.cs index d8075d450..2b8524dc6 100644 --- a/crypto/src/cms/KEKRecipientInfoGenerator.cs +++ b/crypto/src/cms/KEKRecipientInfoGenerator.cs @@ -78,7 +78,7 @@ namespace Org.BouncyCastle.Cms } else if (Platform.StartsWith(algorithm, "AES")) { - int length = key.GetKey().Length * 8; + int length = key.KeyLength * 8; DerObjectIdentifier wrapOid; if (length == 128) @@ -107,7 +107,7 @@ namespace Org.BouncyCastle.Cms } else if (Platform.StartsWith(algorithm, "CAMELLIA")) { - int length = key.GetKey().Length * 8; + int length = key.KeyLength * 8; DerObjectIdentifier wrapOid; if (length == 128) |