aboutsummaryrefslogtreecommitdiffstats
path: root/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpConversionHelper.java
diff options
context:
space:
mode:
Diffstat (limited to 'OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpConversionHelper.java')
-rw-r--r--OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpConversionHelper.java38
1 files changed, 19 insertions, 19 deletions
diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpConversionHelper.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpConversionHelper.java
index c7dd7d647..1f8dec7a1 100644
--- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpConversionHelper.java
+++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpConversionHelper.java
@@ -17,11 +17,6 @@
package org.sufficientlysecure.keychain.pgp;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Iterator;
-
import org.spongycastle.openpgp.PGPKeyRing;
import org.spongycastle.openpgp.PGPObjectFactory;
import org.spongycastle.openpgp.PGPSecretKey;
@@ -29,12 +24,17 @@ import org.spongycastle.openpgp.PGPSecretKeyRing;
import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.util.Log;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Iterator;
+
public class PgpConversionHelper {
/**
* Convert from byte[] to PGPKeyRing
- *
+ *
* @param keysBytes
* @return
*/
@@ -54,7 +54,7 @@ public class PgpConversionHelper {
/**
* Convert from byte[] to ArrayList<PGPSecretKey>
- *
+ *
* @param keysBytes
* @return
*/
@@ -90,10 +90,10 @@ public class PgpConversionHelper {
/**
* Convert from byte[] to PGPSecretKey
- *
+ * <p/>
* Singles keys are encoded as keyRings with one single key in it by Bouncy Castle
- *
- * @param keysBytes
+ *
+ * @param keyBytes
* @return
*/
public static PGPSecretKey BytesToPGPSecretKey(byte[] keyBytes) {
@@ -105,13 +105,13 @@ public class PgpConversionHelper {
Log.e(Constants.TAG, "Error while converting to PGPSecretKey!", e);
}
PGPSecretKey secKey = null;
- if(obj instanceof PGPSecretKey) {
- if ((secKey = (PGPSecretKey)obj ) == null) {
+ if (obj instanceof PGPSecretKey) {
+ if ((secKey = (PGPSecretKey) obj) == null) {
Log.e(Constants.TAG, "No keys given!");
}
- } else if(obj instanceof PGPSecretKeyRing) { //master keys are sent as keyrings
+ } else if (obj instanceof PGPSecretKeyRing) { //master keys are sent as keyrings
PGPSecretKeyRing keyRing = null;
- if ((keyRing = (PGPSecretKeyRing)obj) == null) {
+ if ((keyRing = (PGPSecretKeyRing) obj) == null) {
Log.e(Constants.TAG, "No keys given!");
}
secKey = keyRing.getSecretKey();
@@ -122,7 +122,7 @@ public class PgpConversionHelper {
/**
* Convert from ArrayList<PGPSecretKey> to byte[]
- *
+ *
* @param keys
* @return
*/
@@ -141,8 +141,8 @@ public class PgpConversionHelper {
/**
* Convert from PGPSecretKey to byte[]
- *
- * @param keysBytes
+ *
+ * @param key
* @return
*/
public static byte[] PGPSecretKeyToBytes(PGPSecretKey key) {
@@ -157,8 +157,8 @@ public class PgpConversionHelper {
/**
* Convert from PGPSecretKeyRing to byte[]
- *
- * @param keysBytes
+ *
+ * @param keyRing
* @return
*/
public static byte[] PGPSecretKeyRingToBytes(PGPSecretKeyRing keyRing) {