diff options
author | Elliott Hughes <enh@google.com> | 2010-11-11 16:42:09 -0800 |
---|---|---|
committer | Elliott Hughes <enh@google.com> | 2010-11-11 16:42:09 -0800 |
commit | 460c26e9875833dc494575b5c43f08c8baa15f34 (patch) | |
tree | 4b05bdabfe75c0a29dfc1fd8161be9dbb42c1cd1 /keystore | |
parent | 7ab17a3426d3565f72c6832bb650d1709cbf52cf (diff) | |
download | frameworks_base-460c26e9875833dc494575b5c43f08c8baa15f34.zip frameworks_base-460c26e9875833dc494575b5c43f08c8baa15f34.tar.gz frameworks_base-460c26e9875833dc494575b5c43f08c8baa15f34.tar.bz2 |
Use deliberately public API rather than org.apache cruft.
InputStreamHelper is scheduled for deletion. As a bonus, the new code is more
efficient.
Change-Id: Ied8b87fa24f8506cf748b0d4c99ee7e2ae201483
Diffstat (limited to 'keystore')
-rw-r--r-- | keystore/java/android/security/SystemKeyStore.java | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/keystore/java/android/security/SystemKeyStore.java b/keystore/java/android/security/SystemKeyStore.java index 47718e6..bca8f68 100644 --- a/keystore/java/android/security/SystemKeyStore.java +++ b/keystore/java/android/security/SystemKeyStore.java @@ -20,8 +20,6 @@ import android.os.Environment; import android.os.FileUtils; import android.os.Process; -import org.apache.harmony.luni.util.InputStreamHelper; - import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; @@ -32,6 +30,8 @@ import java.security.SecureRandom; import javax.crypto.KeyGenerator; import javax.crypto.SecretKey; +import libcore.io.IoUtils; + /** *@hide */ @@ -117,13 +117,10 @@ public class SystemKeyStore { public byte[] retrieveKey(String keyName) throws IOException { File keyFile = getKeyFile(keyName); - if (!keyFile.exists()) { return null; } - - FileInputStream fis = new FileInputStream(keyFile); - return InputStreamHelper.readFullyAndClose(fis); + return IoUtils.readFileAsByteArray(keyFile.toString()); } public void deleteKey(String keyName) { |