rspec/rules/S5547/csharp/how-to-fix-it/bouncy-castle.adoc

37 lines
667 B
Plaintext
Raw Permalink Normal View History

2023-06-12 15:58:19 +02:00
== How to fix it in BouncyCastle
=== Code examples
include::../../common/fix/code-rationale.adoc[]
==== Noncompliant code example
[source,csharp,diff-id=1,diff-type=noncompliant]
----
using Org.BouncyCastle.Crypto.Engines;
using Org.BouncyCastle.Crypto.Parameters;
public void encrypt()
{
AesFastEngine aesFast = new AesFastEngine(); // Noncompliant
}
----
==== Compliant solution
[source,csharp,diff-id=1,diff-type=compliant]
----
using Org.BouncyCastle.Crypto.Engines;
using Org.BouncyCastle.Crypto.Parameters;
public void encrypt()
{
var AES = new AESEngine();
}
----
=== How does this work?
include::../../common/fix/strong-cryptography.adoc[]