2020-06-30 12:49:37 +02:00
|
|
|
include::../description.adoc[]
|
|
|
|
|
|
|
|
== Noncompliant Code Example
|
|
|
|
|
|
|
|
----
|
|
|
|
$config = array(
|
|
|
|
"digest_alg" => "sha512",
|
|
|
|
"private_key_bits" => 1024, // Noncompliant
|
|
|
|
"private_key_type" => OPENSSL_KEYTYPE_RSA,
|
|
|
|
);
|
|
|
|
$res = openssl_pkey_new($config);
|
|
|
|
----
|
|
|
|
|
|
|
|
== Compliant Solution
|
|
|
|
|
|
|
|
----
|
|
|
|
$config = array(
|
|
|
|
"digest_alg" => "sha512",
|
|
|
|
"private_key_bits" => 2048 // Compliant
|
|
|
|
"private_key_type" => OPENSSL_KEYTYPE_RSA,
|
|
|
|
);
|
|
|
|
$res = openssl_pkey_new($config);
|
|
|
|
----
|
|
|
|
|
|
|
|
include::../see.adoc[]
|
2021-06-02 20:44:38 +02:00
|
|
|
|
|
|
|
ifdef::rspecator-view[]
|
|
|
|
== Comments And Links
|
|
|
|
(visible only on this page)
|
|
|
|
|
|
|
|
include::../comments-and-links.adoc[]
|
|
|
|
endif::rspecator-view[]
|