Skip to content

Commit

Permalink
Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
avazirna committed Jan 24, 2024
1 parent db7ef66 commit 403fff4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import android.security.keystore.KeyGenParameterSpec
import androidx.test.ext.junit.runners.AndroidJUnit4
import io.mockk.every
import io.mockk.mockk
import org.commcare.android.util.TestAppInstaller
import org.commcare.CommCareApplication
import org.commcare.CommCareTestApplication
import org.commcare.android.util.TestAppInstaller
import org.commcare.util.EncryptionKeyHelper
import org.commcare.util.EncryptionHelper
import org.javarosa.core.model.User
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,12 @@

import android.os.Build;
import android.security.keystore.KeyProperties;

import androidx.annotation.RequiresApi;
import org.commcare.util.EncryptionHelper;
import org.commcare.util.EncryptionKeyHelper;
import org.commcare.util.IKeyStoreEncryptionKeyProvider;

import java.security.Key;

import androidx.annotation.RequiresApi;

/**
* Class for providing encryption keys backed by Android Keystore for Unit testing
*
Expand All @@ -20,17 +17,20 @@ public class TestKeyStoreEncryptionKeyProvider implements IKeyStoreEncryptionKey

@RequiresApi(api = Build.VERSION_CODES.M)
private static final String ALGORITHM = KeyProperties.KEY_ALGORITHM_AES;

@RequiresApi(api = Build.VERSION_CODES.M)
private static final String BLOCK_MODE = KeyProperties.BLOCK_MODE_GCM;

@RequiresApi(api = Build.VERSION_CODES.M)
private static final String PADDING = KeyProperties.ENCRYPTION_PADDING_NONE;

// Generates a cryptrographic key and adds it to the Android KeyStore
@Override
public Key generateCryptographicKeyInKeyStore(String keyAlias,
EncryptionHelper.CryptographicOperation cryptographicOperation)
public Key generateCryptographicKeyInKeyStore(
String keyAlias, EncryptionHelper.CryptographicOperation cryptographicOperation)
throws EncryptionKeyHelper.EncryptionKeyException {
throw new EncryptionKeyHelper.EncryptionKeyException("KeyStore encryption key generator provider for testing only");
throw new EncryptionKeyHelper.EncryptionKeyException(
"KeyStore encryption key generator provider for testing only");
}

@Override
Expand Down

0 comments on commit 403fff4

Please sign in to comment.