1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2024-12-22 07:42:52 +00:00

Show public key algo

This commit is contained in:
M66B 2024-12-20 07:28:45 +01:00
parent 50f2fa4228
commit 469c2de8cd
3 changed files with 33 additions and 0 deletions

View file

@ -10142,6 +10142,10 @@ public class FragmentMessages extends FragmentBase
EntityCertificate record = db.certificate().getCertificate(fingerprint, email); EntityCertificate record = db.certificate().getCertificate(fingerprint, email);
if (record == null) if (record == null)
known = false; known = false;
else {
args.putString("keyalgo", record.getSigAlgName());
break;
}
} }
String sender = null; String sender = null;
@ -10407,6 +10411,7 @@ public class FragmentMessages extends FragmentBase
boolean valid = args.getBoolean("valid"); boolean valid = args.getBoolean("valid");
String reason = args.getString("reason"); String reason = args.getString("reason");
String algo = args.getString("algo"); String algo = args.getString("algo");
String keyalgo = args.getString("keyalgo");
final ArrayList<String> trace = args.getStringArrayList("trace"); final ArrayList<String> trace = args.getStringArrayList("trace");
EntityCertificate record = EntityCertificate.from(cert, null); EntityCertificate record = EntityCertificate.from(cert, null);
@ -10438,6 +10443,8 @@ public class FragmentMessages extends FragmentBase
TextView tvBefore = dview.findViewById(R.id.tvBefore); TextView tvBefore = dview.findViewById(R.id.tvBefore);
TextView tvExpired = dview.findViewById(R.id.tvExpired); TextView tvExpired = dview.findViewById(R.id.tvExpired);
TextView tvAlgorithm = dview.findViewById(R.id.tvAlgorithm); TextView tvAlgorithm = dview.findViewById(R.id.tvAlgorithm);
TextView tvKeyAlgorithmTitle = dview.findViewById(R.id.tvKeyAlgorithmTitle);
TextView tvKeyAlgorithm = dview.findViewById(R.id.tvKeyAlgorithm);
tvCertificateInvalid.setVisibility(valid ? View.GONE : View.VISIBLE); tvCertificateInvalid.setVisibility(valid ? View.GONE : View.VISIBLE);
tvCertificateReason.setText(reason); tvCertificateReason.setText(reason);
@ -10456,6 +10463,12 @@ public class FragmentMessages extends FragmentBase
algo = algo.replace("(?i)With", "/"); algo = algo.replace("(?i)With", "/");
tvAlgorithm.setText(algo); tvAlgorithm.setText(algo);
tvKeyAlgorithmTitle.setVisibility(info ? View.VISIBLE : View.GONE);
if (!TextUtils.isEmpty(keyalgo))
keyalgo = keyalgo.replaceAll("(?i)With", "/");
tvKeyAlgorithm.setVisibility(info ? View.VISIBLE : View.GONE);
tvKeyAlgorithm.setText(keyalgo);
ibInfo.setOnClickListener(new View.OnClickListener() { ibInfo.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {

View file

@ -183,5 +183,24 @@
android:textAppearance="@style/TextAppearance.AppCompat.Medium" android:textAppearance="@style/TextAppearance.AppCompat.Medium"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvAlgorithmTitle" /> app:layout_constraintTop_toBottomOf="@id/tvAlgorithmTitle" />
<TextView
android:id="@+id/tvKeyAlgorithmTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:text="@string/title_signature_public_key"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvExpired" />
<TextView
android:id="@+id/tvKeyAlgorithm"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="SHA256withRSA"
android:textAppearance="@style/TextAppearance.AppCompat.Medium"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvAlgorithmTitle" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView> </ScrollView>

View file

@ -1933,6 +1933,7 @@
<string name="title_signature_email">Signature\'s address</string> <string name="title_signature_email">Signature\'s address</string>
<string name="title_signature_mismatch">The email address of the sender and signature do not match</string> <string name="title_signature_mismatch">The email address of the sender and signature do not match</string>
<string name="title_signature_algorithm">Algorithm</string> <string name="title_signature_algorithm">Algorithm</string>
<string name="title_signature_public_key">Public key</string>
<string name="title_signature_subject">Subject</string> <string name="title_signature_subject">Subject</string>
<string name="title_signature_validity">Validity</string> <string name="title_signature_validity">Validity</string>
<string name="title_signature_outdated">This public key is currently not valid</string> <string name="title_signature_outdated">This public key is currently not valid</string>