rspec/rules/S5547/swift/how-to-fix-it/commoncrypto.adoc
2023-06-12 15:58:19 +02:00

29 lines
502 B
Plaintext

== How to fix it in CommonCrypto
=== Code examples
include::../../common/fix/code-rationale.adoc[]
==== Noncompliant code example
[source,swift,diff-id=1,diff-type=noncompliant]
----
import CommonCrypto
let algorithm = CCAlgorithm(kCCAlgorithmDES) // Noncompliant
----
==== Compliant solution
[source,swift,diff-id=1,diff-type=compliant]
----
import Crypto
let sealedBox = try AES.GCM.seal(input, using: key)
----
=== How does this work?
include::../../common/fix/strong-cryptography.adoc[]