Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6050eb54 authored by Chad Brubaker's avatar Chad Brubaker Committed by Android Git Automerger
Browse files

am 5b11b3d6: am 31cee318: Merge "Specify public exponent for RSA"

* commit '5b11b3d6':
  Specify public exponent for RSA
parents 7163a0a1 5b11b3d6
Loading
Loading
Loading
Loading
+5 −0
Original line number Original line Diff line number Diff line
@@ -36,6 +36,7 @@ import java.nio.charset.StandardCharsets;
import java.util.Arrays;
import java.util.Arrays;
import java.util.Date;
import java.util.Date;
import java.util.HashSet;
import java.util.HashSet;
import java.security.spec.RSAKeyGenParameterSpec;


import android.util.Log;
import android.util.Log;
import android.util.Base64;
import android.util.Base64;
@@ -713,6 +714,8 @@ public class KeyStoreTest extends ActivityUnitTestCase<Activity> {
        args.addInt(KeymasterDefs.KM_TAG_KEY_SIZE, 2048);
        args.addInt(KeymasterDefs.KM_TAG_KEY_SIZE, 2048);
        args.addBlob(KeymasterDefs.KM_TAG_APPLICATION_ID, null);
        args.addBlob(KeymasterDefs.KM_TAG_APPLICATION_ID, null);
        args.addBlob(KeymasterDefs.KM_TAG_APPLICATION_DATA, null);
        args.addBlob(KeymasterDefs.KM_TAG_APPLICATION_DATA, null);
        args.addBlob(KeymasterDefs.KM_TAG_RSA_PUBLIC_EXPONENT,
                RSAKeyGenParameterSpec.F4.toByteArray());


        KeyCharacteristics outCharacteristics = new KeyCharacteristics();
        KeyCharacteristics outCharacteristics = new KeyCharacteristics();
        int result = mKeyStore.generateKey(name, args, 0, outCharacteristics);
        int result = mKeyStore.generateKey(name, args, 0, outCharacteristics);
@@ -750,6 +753,8 @@ public class KeyStoreTest extends ActivityUnitTestCase<Activity> {
        args.addInt(KeymasterDefs.KM_TAG_BLOCK_MODE, KeymasterDefs.KM_MODE_ECB);
        args.addInt(KeymasterDefs.KM_TAG_BLOCK_MODE, KeymasterDefs.KM_MODE_ECB);
        args.addBlob(KeymasterDefs.KM_TAG_APPLICATION_ID, new byte[] {0x01, 0x02, 0x03});
        args.addBlob(KeymasterDefs.KM_TAG_APPLICATION_ID, new byte[] {0x01, 0x02, 0x03});
        args.addBlob(KeymasterDefs.KM_TAG_APPLICATION_DATA, null);
        args.addBlob(KeymasterDefs.KM_TAG_APPLICATION_DATA, null);
        args.addBlob(KeymasterDefs.KM_TAG_RSA_PUBLIC_EXPONENT,
                RSAKeyGenParameterSpec.F4.toByteArray());


        KeyCharacteristics outCharacteristics = new KeyCharacteristics();
        KeyCharacteristics outCharacteristics = new KeyCharacteristics();
        int result = mKeyStore.generateKey(name, args, 0, outCharacteristics);
        int result = mKeyStore.generateKey(name, args, 0, outCharacteristics);