aboutsummaryrefslogtreecommitdiffstats
path: root/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpKeyHelper.java
diff options
context:
space:
mode:
Diffstat (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpKeyHelper.java')
-rw-r--r--OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpKeyHelper.java14
1 files changed, 6 insertions, 8 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpKeyHelper.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpKeyHelper.java
index 165382bda..78d1a857f 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpKeyHelper.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpKeyHelper.java
@@ -27,7 +27,6 @@ import android.text.style.ForegroundColorSpan;
import org.spongycastle.asn1.ASN1ObjectIdentifier;
import org.spongycastle.asn1.nist.NISTNamedCurves;
import org.spongycastle.asn1.teletrust.TeleTrusTNamedCurves;
-import org.spongycastle.bcpg.ECPublicBCPGKey;
import org.spongycastle.bcpg.PublicKeyAlgorithmTags;
import org.spongycastle.util.encoders.Hex;
import org.sufficientlysecure.keychain.Constants;
@@ -156,9 +155,11 @@ public class PgpKeyHelper {
return algorithmStr;
}
- // Return name of a curve. These are names, no need for translation
+ /**
+ * Return name of a curve. These are names, no need for translation
+ */
public static String getCurveInfo(Context context, Curve curve) {
- switch(curve) {
+ switch (curve) {
case NIST_P256:
return "NIST P-256";
case NIST_P384:
@@ -211,9 +212,7 @@ public class PgpKeyHelper {
* @return
*/
public static String convertFingerprintToHex(byte[] fingerprint) {
- String hexString = Hex.toHexString(fingerprint).toLowerCase(Locale.ENGLISH);
-
- return hexString;
+ return Hex.toHexString(fingerprint).toLowerCase(Locale.ENGLISH);
}
/**
@@ -327,10 +326,9 @@ public class PgpKeyHelper {
md.update(bytes);
byte[] digest = md.digest();
- int[] result = {((int) digest[0] + 256) % 256,
+ return new int[]{((int) digest[0] + 256) % 256,
((int) digest[1] + 256) % 256,
((int) digest[2] + 256) % 256};
- return result;
}
}