CLI: Show deprecated types in privatekeyfile and su3file help

This commit is contained in:
zzz
2025-05-02 07:36:14 -04:00
parent eb562218e7
commit 7755860274
2 changed files with 13 additions and 4 deletions

View File

@ -714,8 +714,11 @@ public class SU3File {
t == SigType.RedDSA_SHA512_Ed25519)
continue; // not supported by keytool, and does double hashing right now
buf.append(" ").append(t).append("\t(code: ").append(t.getCode()).append(')');
if (t.getCode() == DEFAULT_SIG_CODE)
int code = t.getCode();
if (code == DEFAULT_SIG_CODE)
buf.append(" DEFAULT");
else if (code < DEFAULT_SIG_CODE)
buf.append(" DEPRECATED");
buf.append('\n');
}
}

View File

@ -453,11 +453,14 @@ public class PrivateKeyFile {
continue;
if (t.getBaseAlgorithm().equals(SigAlgo.RSA))
continue;
if (t.getCode() == 8)
int code = t.getCode();
if (code == 8)
continue;
buf.append(" ").append(t).append("\t(code: ").append(t.getCode()).append(')');
if (t.getCode() == 0)
if (code == 0)
buf.append(" DEFAULT");
if (code < 7)
buf.append(" DEPRECATED");
buf.append('\n');
}
buf.append("\nAvailable encryption types:\n");
@ -465,8 +468,11 @@ public class PrivateKeyFile {
if (!t.isAvailable())
continue;
buf.append(" ").append(t).append("\t(code: ").append(t.getCode()).append(')');
if (t.getCode() == 0)
int code = t.getCode();
if (code == 0)
buf.append(" DEFAULT");
if (code < 4)
buf.append(" DEPRECATED");
buf.append('\n');
}
System.out.println(buf.toString());