29 lines
625 B
Plaintext
29 lines
625 B
Plaintext
include::../description.adoc[]
|
|
|
|
== Sensitive Code Example
|
|
|
|
A ``++CryptoObject++`` is not used during authentication:
|
|
|
|
[source,java]
|
|
----
|
|
// ...
|
|
BiometricPrompt biometricPrompt = new BiometricPrompt(activity, executor, callback);
|
|
// ...
|
|
biometricPrompt.authenticate(promptInfo); // Noncompliant
|
|
----
|
|
|
|
== Compliant Solution
|
|
|
|
A ``++CryptoObject++`` is used during authentication:
|
|
|
|
[source,java]
|
|
----
|
|
// ...
|
|
BiometricPrompt biometricPrompt = new BiometricPrompt(activity, executor, callback);
|
|
// ...
|
|
biometricPrompt.authenticate(promptInfo, new BiometricPrompt.CryptoObject(cipher)); // Compliant
|
|
|
|
----
|
|
|
|
include::../see.adoc[]
|