Flatten KeyStoreKeyProperties constants.

This moves constants/flags declared in inner classes of
KeyStoreKeyProperties into KeyStoreKeyProperties, as requested by API
Council.

Bug: 21039983
Change-Id: I84a3c983e13644a027bed9f605ab8044220a352c
This commit is contained in:
Alex Klyubin
2015-05-12 12:53:23 -07:00
parent 4b403557bc
commit 622fd932fd
13 changed files with 455 additions and 567 deletions

View File

@ -266,7 +266,7 @@ public final class KeyChain {
*/
public static void choosePrivateKeyAlias(@NonNull Activity activity,
@NonNull KeyChainAliasCallback response,
@KeyStoreKeyProperties.AlgorithmEnum String[] keyTypes, Principal[] issuers,
@KeyStoreKeyProperties.KeyAlgorithmEnum String[] keyTypes, Principal[] issuers,
@Nullable String host, int port, @Nullable String alias) {
choosePrivateKeyAlias(activity, response, keyTypes, issuers, host, port, null, alias);
}
@ -312,7 +312,7 @@ public final class KeyChain {
*/
public static void choosePrivateKeyAlias(@NonNull Activity activity,
@NonNull KeyChainAliasCallback response,
@KeyStoreKeyProperties.AlgorithmEnum String[] keyTypes, Principal[] issuers,
@KeyStoreKeyProperties.KeyAlgorithmEnum String[] keyTypes, Principal[] issuers,
@Nullable String host, int port, @Nullable String url, @Nullable String alias) {
/*
* TODO currently keyTypes, issuers are unused. They are meant
@ -439,10 +439,10 @@ public final class KeyChain {
* "RSA").
*/
public static boolean isKeyAlgorithmSupported(
@NonNull @KeyStoreKeyProperties.AlgorithmEnum String algorithm) {
@NonNull @KeyStoreKeyProperties.KeyAlgorithmEnum String algorithm) {
final String algUpper = algorithm.toUpperCase(Locale.US);
return KeyStoreKeyProperties.Algorithm.EC.equals(algUpper)
|| KeyStoreKeyProperties.Algorithm.RSA.equals(algUpper);
return KeyStoreKeyProperties.KEY_ALGORITHM_EC.equals(algUpper)
|| KeyStoreKeyProperties.KEY_ALGORITHM_RSA.equals(algUpper);
}
/**
@ -453,7 +453,7 @@ public final class KeyChain {
* that makes it non-exportable.
*/
public static boolean isBoundKeyAlgorithm(
@NonNull @KeyStoreKeyProperties.AlgorithmEnum String algorithm) {
@NonNull @KeyStoreKeyProperties.KeyAlgorithmEnum String algorithm) {
if (!isKeyAlgorithmSupported(algorithm)) {
return false;
}