summaryrefslogtreecommitdiffstats
path: root/keystore
diff options
context:
space:
mode:
authorBrian Carlstrom <bdc@google.com>2011-04-06 15:41:29 -0700
committerBrian Carlstrom <bdc@google.com>2011-04-07 11:58:37 -0700
commit46703b099516c383a6882815bcf9cd4df0ec538d (patch)
tree0b4f84436ce6d2b30ad7865facd03d889ea916be /keystore
parente651c68ee8f9de7fe3c342c5b5f6690c729f6014 (diff)
downloadframeworks_base-46703b099516c383a6882815bcf9cd4df0ec538d.zip
frameworks_base-46703b099516c383a6882815bcf9cd4df0ec538d.tar.gz
frameworks_base-46703b099516c383a6882815bcf9cd4df0ec538d.tar.bz2
Tolerate missing AccountManager resource, not just missing resource name
In addition to the primary change in the subject, also some minor cleanup of javadoc, typos, CloseGuard warning, etc found while working on a new AbstractAccountAuthenticator. Change-Id: I73f3408773a43a0021a15f8d051fd3dbbdf898a5
Diffstat (limited to 'keystore')
-rw-r--r--keystore/java/android/security/KeyStore.java19
1 files changed, 6 insertions, 13 deletions
diff --git a/keystore/java/android/security/KeyStore.java b/keystore/java/android/security/KeyStore.java
index 4614b53..7183688 100644
--- a/keystore/java/android/security/KeyStore.java
+++ b/keystore/java/android/security/KeyStore.java
@@ -23,10 +23,13 @@ import java.io.InputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.UnsupportedEncodingException;
+import java.nio.charset.Charsets;
import java.util.ArrayList;
/**
- * {@hide}
+ * @hide This should not be made public in its present form because it
+ * assumes that private and secret key bytes are available and would
+ * preclude the use of hardware crypto.
*/
public class KeyStore {
public static final int NO_ERROR = 1;
@@ -211,20 +214,10 @@ public class KeyStore {
}
private static byte[] getBytes(String string) {
- try {
- return string.getBytes("UTF-8");
- } catch (UnsupportedEncodingException e) {
- // will never happen
- throw new RuntimeException(e);
- }
+ return string.getBytes(Charsets.UTF_8);
}
private static String toString(byte[] bytes) {
- try {
- return new String(bytes, "UTF-8");
- } catch (UnsupportedEncodingException e) {
- // will never happen
- throw new RuntimeException(e);
- }
+ return new String(bytes, Charsets.UTF_8);
}
}