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
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user