Loading core/java/android/app/ActivityThread.java +1 −1 Original line number Diff line number Diff line Loading @@ -96,7 +96,7 @@ import android.view.Window; import android.view.WindowManager; import android.view.WindowManagerGlobal; import android.renderscript.RenderScriptCacheDir; import android.security.AndroidKeyStoreProvider; import android.security.keystore.AndroidKeyStoreProvider; import com.android.internal.app.IVoiceInteractor; import com.android.internal.content.ReferrerIntent; Loading core/java/android/hardware/fingerprint/FingerprintManager.java +1 −1 Original line number Diff line number Diff line Loading @@ -32,7 +32,7 @@ import android.os.RemoteException; import android.os.UserHandle; import android.provider.Settings; import android.hardware.fingerprint.FingerprintManager.EnrollmentCallback; import android.security.AndroidKeyStoreProvider; import android.security.keystore.AndroidKeyStoreProvider; import android.util.Log; import android.util.Slog; Loading keystore/java/android/security/Credentials.java +3 −3 Original line number Diff line number Diff line Loading @@ -216,7 +216,7 @@ public class Credentials { * particular {@code alias}. All three can exist for any given alias. * Returns {@code true} if there was at least one of those types. */ static boolean deleteAllTypesForAlias(KeyStore keystore, String alias) { public static boolean deleteAllTypesForAlias(KeyStore keystore, String alias) { /* * Make sure every type is deleted. There can be all three types, so * don't use a conditional here. Loading @@ -231,7 +231,7 @@ public class Credentials { * particular {@code alias}. All three can exist for any given alias. * Returns {@code true} if there was at least one of those types. */ static boolean deleteCertificateTypesForAlias(KeyStore keystore, String alias) { public static boolean deleteCertificateTypesForAlias(KeyStore keystore, String alias) { /* * Make sure every certificate type is deleted. There can be two types, * so don't use a conditional here. Loading @@ -252,7 +252,7 @@ public class Credentials { * Delete secret key for a particular {@code alias}. * Returns {@code true} if an entry was was deleted. */ static boolean deleteSecretKeyTypeForAlias(KeyStore keystore, String alias) { public static boolean deleteSecretKeyTypeForAlias(KeyStore keystore, String alias) { return keystore.delete(Credentials.USER_SECRET_KEY + alias); } } keystore/java/android/security/GateKeeper.java +16 −0 Original line number Diff line number Diff line /* * Copyright (C) 2015 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package android.security; import android.os.RemoteException; Loading keystore/java/android/security/KeyStore.java +6 −5 Original line number Diff line number Diff line Loading @@ -109,7 +109,7 @@ public class KeyStore { mContext = getApplicationContext(); } static Context getApplicationContext() { public static Context getApplicationContext() { ActivityThread activityThread = ActivityThread.currentActivityThread(); if (activityThread == null) { throw new IllegalStateException( Loading @@ -136,7 +136,7 @@ public class KeyStore { return mToken; } static int getKeyTypeForAlgorithm(@KeyProperties.KeyAlgorithmEnum String keyType) { public static int getKeyTypeForAlgorithm(@KeyProperties.KeyAlgorithmEnum String keyType) { if (KeyProperties.KEY_ALGORITHM_RSA.equalsIgnoreCase(keyType)) { return NativeConstants.EVP_PKEY_RSA; } else if (KeyProperties.KEY_ALGORITHM_EC.equalsIgnoreCase(keyType)) { Loading Loading @@ -632,7 +632,7 @@ public class KeyStore { * Returns a {@link KeyStoreException} corresponding to the provided keystore/keymaster error * code. */ static KeyStoreException getKeyStoreException(int errorCode) { public static KeyStoreException getKeyStoreException(int errorCode) { if (errorCode > 0) { // KeyStore layer error switch (errorCode) { Loading Loading @@ -674,7 +674,8 @@ public class KeyStore { * Returns an {@link InvalidKeyException} corresponding to the provided * {@link KeyStoreException}. */ InvalidKeyException getInvalidKeyException(String keystoreKeyAlias, KeyStoreException e) { public InvalidKeyException getInvalidKeyException( String keystoreKeyAlias, KeyStoreException e) { switch (e.getErrorCode()) { case LOCKED: return new UserNotAuthenticatedException(); Loading Loading @@ -745,7 +746,7 @@ public class KeyStore { * Returns an {@link InvalidKeyException} corresponding to the provided keystore/keymaster error * code. */ InvalidKeyException getInvalidKeyException(String keystoreKeyAlias, int errorCode) { public InvalidKeyException getInvalidKeyException(String keystoreKeyAlias, int errorCode) { return getInvalidKeyException(keystoreKeyAlias, getKeyStoreException(errorCode)); } } Loading
core/java/android/app/ActivityThread.java +1 −1 Original line number Diff line number Diff line Loading @@ -96,7 +96,7 @@ import android.view.Window; import android.view.WindowManager; import android.view.WindowManagerGlobal; import android.renderscript.RenderScriptCacheDir; import android.security.AndroidKeyStoreProvider; import android.security.keystore.AndroidKeyStoreProvider; import com.android.internal.app.IVoiceInteractor; import com.android.internal.content.ReferrerIntent; Loading
core/java/android/hardware/fingerprint/FingerprintManager.java +1 −1 Original line number Diff line number Diff line Loading @@ -32,7 +32,7 @@ import android.os.RemoteException; import android.os.UserHandle; import android.provider.Settings; import android.hardware.fingerprint.FingerprintManager.EnrollmentCallback; import android.security.AndroidKeyStoreProvider; import android.security.keystore.AndroidKeyStoreProvider; import android.util.Log; import android.util.Slog; Loading
keystore/java/android/security/Credentials.java +3 −3 Original line number Diff line number Diff line Loading @@ -216,7 +216,7 @@ public class Credentials { * particular {@code alias}. All three can exist for any given alias. * Returns {@code true} if there was at least one of those types. */ static boolean deleteAllTypesForAlias(KeyStore keystore, String alias) { public static boolean deleteAllTypesForAlias(KeyStore keystore, String alias) { /* * Make sure every type is deleted. There can be all three types, so * don't use a conditional here. Loading @@ -231,7 +231,7 @@ public class Credentials { * particular {@code alias}. All three can exist for any given alias. * Returns {@code true} if there was at least one of those types. */ static boolean deleteCertificateTypesForAlias(KeyStore keystore, String alias) { public static boolean deleteCertificateTypesForAlias(KeyStore keystore, String alias) { /* * Make sure every certificate type is deleted. There can be two types, * so don't use a conditional here. Loading @@ -252,7 +252,7 @@ public class Credentials { * Delete secret key for a particular {@code alias}. * Returns {@code true} if an entry was was deleted. */ static boolean deleteSecretKeyTypeForAlias(KeyStore keystore, String alias) { public static boolean deleteSecretKeyTypeForAlias(KeyStore keystore, String alias) { return keystore.delete(Credentials.USER_SECRET_KEY + alias); } }
keystore/java/android/security/GateKeeper.java +16 −0 Original line number Diff line number Diff line /* * Copyright (C) 2015 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package android.security; import android.os.RemoteException; Loading
keystore/java/android/security/KeyStore.java +6 −5 Original line number Diff line number Diff line Loading @@ -109,7 +109,7 @@ public class KeyStore { mContext = getApplicationContext(); } static Context getApplicationContext() { public static Context getApplicationContext() { ActivityThread activityThread = ActivityThread.currentActivityThread(); if (activityThread == null) { throw new IllegalStateException( Loading @@ -136,7 +136,7 @@ public class KeyStore { return mToken; } static int getKeyTypeForAlgorithm(@KeyProperties.KeyAlgorithmEnum String keyType) { public static int getKeyTypeForAlgorithm(@KeyProperties.KeyAlgorithmEnum String keyType) { if (KeyProperties.KEY_ALGORITHM_RSA.equalsIgnoreCase(keyType)) { return NativeConstants.EVP_PKEY_RSA; } else if (KeyProperties.KEY_ALGORITHM_EC.equalsIgnoreCase(keyType)) { Loading Loading @@ -632,7 +632,7 @@ public class KeyStore { * Returns a {@link KeyStoreException} corresponding to the provided keystore/keymaster error * code. */ static KeyStoreException getKeyStoreException(int errorCode) { public static KeyStoreException getKeyStoreException(int errorCode) { if (errorCode > 0) { // KeyStore layer error switch (errorCode) { Loading Loading @@ -674,7 +674,8 @@ public class KeyStore { * Returns an {@link InvalidKeyException} corresponding to the provided * {@link KeyStoreException}. */ InvalidKeyException getInvalidKeyException(String keystoreKeyAlias, KeyStoreException e) { public InvalidKeyException getInvalidKeyException( String keystoreKeyAlias, KeyStoreException e) { switch (e.getErrorCode()) { case LOCKED: return new UserNotAuthenticatedException(); Loading Loading @@ -745,7 +746,7 @@ public class KeyStore { * Returns an {@link InvalidKeyException} corresponding to the provided keystore/keymaster error * code. */ InvalidKeyException getInvalidKeyException(String keystoreKeyAlias, int errorCode) { public InvalidKeyException getInvalidKeyException(String keystoreKeyAlias, int errorCode) { return getInvalidKeyException(keystoreKeyAlias, getKeyStoreException(errorCode)); } }