-
-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
multiple updates for performance, stability and bug fixing
- Loading branch information
Showing
15 changed files
with
212 additions
and
42 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<vector android:height="64dp" android:viewportHeight="128" | ||
android:viewportWidth="128" android:width="64dp" xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<path android:fillColor="#ffffff" android:pathData="M0,64C0,28.65 28.65,0 64,0V0C99.35,0 128,28.65 128,64V128H64C28.65,128 0,99.35 0,64V64Z"/> | ||
<path android:fillColor="#000000" android:fillType="evenOdd" android:pathData="M116.91,64V116.91H64C34.78,116.91 11.09,93.22 11.09,64C11.09,34.78 34.78,11.09 64,11.09C93.22,11.09 116.91,34.78 116.91,64ZM0,64C0,28.65 28.65,0 64,0C99.35,0 128,28.65 128,64V128H64C28.65,128 0,99.35 0,64ZM25.44,66.53C25.44,79.74 34.31,90.87 48.51,90.87C60.18,90.87 68.05,83.18 69.95,73.14H58.46C57.01,77.75 53.3,80.55 48.51,80.55C41.36,80.55 36.66,74.95 36.66,66.53C36.66,58.12 41.36,52.51 48.51,52.51C53.12,52.51 56.74,55.14 58.28,59.48H69.86C67.78,49.71 60,42.2 48.51,42.2C34.31,42.2 25.44,53.33 25.44,66.53ZM85.37,43.47H74.52V89.6H85.83V65.54C85.83,61.02 87.09,58.03 89.26,56.22C91.16,54.5 93.7,53.6 97.77,53.6H100.66V42.93H97.86C91.89,42.93 87.91,45.1 85.37,48.44V43.47Z"/> | ||
</vector> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<vector android:height="64dp" android:viewportHeight="128" | ||
android:viewportWidth="128" android:width="64dp" xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<path android:fillColor="#ffffff" android:fillType="evenOdd" android:pathData="M116.91,64V116.91H64C34.78,116.91 11.09,93.22 11.09,64C11.09,34.78 34.78,11.09 64,11.09C93.22,11.09 116.91,34.78 116.91,64ZM0,64C0,28.65 28.65,0 64,0C99.35,0 128,28.65 128,64V128H64C28.65,128 0,99.35 0,64ZM25.44,66.53C25.44,79.74 34.31,90.87 48.51,90.87C60.18,90.87 68.05,83.18 69.95,73.14H58.46C57.01,77.75 53.3,80.55 48.51,80.55C41.36,80.55 36.66,74.95 36.66,66.53C36.66,58.12 41.36,52.51 48.51,52.51C53.12,52.51 56.74,55.14 58.28,59.48H69.86C67.78,49.71 60,42.2 48.51,42.2C34.31,42.2 25.44,53.33 25.44,66.53ZM85.37,43.47H74.52V89.6H85.83V65.54C85.83,61.02 87.09,58.03 89.26,56.22C91.16,54.5 93.7,53.6 97.77,53.6H100.66V42.93H97.86C91.89,42.93 87.91,45.1 85.37,48.44V43.47Z"/> | ||
</vector> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -88,12 +88,11 @@ public class PgpUtils { | |
private PGPSecretKeyRing skr = null; | ||
private PGPPublicKeyRing pkr = null; | ||
|
||
private final static String keyId = "[email protected]"; | ||
private static String keyEmail = "[email protected]"; | ||
|
||
private final static String FILE_SECRET_KEY_RING = "pkr.asc"; | ||
private final static String FILE_PUBLIC_KEY_RING = "pub.asc"; | ||
|
||
//public final static String DEFAULT_PASSWORD = "password"; //static string for local keystore | ||
private final static String URL_POST_KEY_ENDPOINT = "https://keys.openpgp.org/vks/v1/upload"; | ||
|
||
public final static String URL_LOOKUP_ENDPOINT = "https://keys.openpgp.org/search?q=0x"; | ||
|
@@ -308,6 +307,18 @@ public static boolean keyRingExists (Context context) | |
return fileSecKeyRing.exists() && filePubKeyRing.exists(); | ||
} | ||
|
||
public void resetCrypto (Context context) { | ||
File fileSecKeyRing = new File(context.getFilesDir(),FILE_SECRET_KEY_RING); | ||
File filePubKeyRing = new File(context.getFilesDir(),FILE_PUBLIC_KEY_RING); | ||
fileSecKeyRing.delete(); | ||
filePubKeyRing.delete(); | ||
pgpSec = null; | ||
} | ||
|
||
public static void setKeyid (String email) { | ||
keyEmail = email; | ||
} | ||
|
||
public synchronized void initCrypto (Context context, String password) throws IOException, PGPException { | ||
if (pgpSec == null) { | ||
|
||
|
@@ -329,7 +340,7 @@ public synchronized void initCrypto (Context context, String password) throws IO | |
if (password.isEmpty()) | ||
throw new IOException("Empty PGP Key password not allowed for key generation"); | ||
|
||
final PGPKeyRingGenerator krgen = generateKeyRingGenerator(keyId, password.toCharArray()); | ||
final PGPKeyRingGenerator krgen = generateKeyRingGenerator(keyEmail, password.toCharArray()); | ||
skr = krgen.generateSecretKeyRing(); | ||
|
||
ArmoredOutputStream sout = new ArmoredOutputStream((new FileOutputStream(fileSecKeyRing))); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.