[xmlsectool] branch main updated: XSTJ-91 - Remove deprecated command-line options
Ian Young
ian at iay.org.uk
Tue Mar 4 16:51:29 UTC 2025
This is an automated email from the git hooks/post-receive script.
iay pushed a commit to branch main
in repository xmlsectool.
View the commit online:
http://git.shibboleth.net/view/?p=xmlsectool.git;a=commit;h=d9e2244e5e385e2f77921c15a551670b9ba1cd7f
The following commit(s) were added to refs/heads/main by this push:
new d9e2244 XSTJ-91 - Remove deprecated command-line options
d9e2244 is described below
commit d9e2244e5e385e2f77921c15a551670b9ba1cd7f
Author: Ian Young <ian at iay.org.uk>
AuthorDate: Tue Mar 4 16:51:25 2025 +0000
XSTJ-91 - Remove deprecated command-line options
https://shibboleth.atlassian.net/browse/XSTJ-91
---
.../tool/xmlsectool/CommandLineArguments.java | 97 ++--------------------
.../tool/xmlsectool/CommandLineArgumentsTest.java | 4 +-
.../net/shibboleth/tool/xmlsectool/XSTJ51Test.java | 2 +-
3 files changed, 8 insertions(+), 95 deletions(-)
diff --git a/src/main/java/net/shibboleth/tool/xmlsectool/CommandLineArguments.java b/src/main/java/net/shibboleth/tool/xmlsectool/CommandLineArguments.java
index 405cd85..9d6e497 100644
--- a/src/main/java/net/shibboleth/tool/xmlsectool/CommandLineArguments.java
+++ b/src/main/java/net/shibboleth/tool/xmlsectool/CommandLineArguments.java
@@ -58,8 +58,6 @@ public class CommandLineArguments {
private static final String KI_KEY_NAME_ARG = "keyInfoKeyName";
private static final String KI_CRL_ARG = "keyInfoCRL";
private static final String CERT_ARG = "certificate";
- @Deprecated(since="3.0.0", forRemoval=true)
- private static final String KEY_ARG = "key";
private static final String KEY_FILE_ARG = "keyFile";
private static final String KEY_ALIAS_ARG = "keyAlias";
private static final String KEY_PASSWORD_ARG = "keyPassword";
@@ -68,17 +66,9 @@ public class CommandLineArguments {
private static final String KEYSTORE_TYPE_ARG = "keystoreType";
private static final String KEYSTORE_PROVIDER_ARG = "keystoreProvider";
private static final String PKCS11_CONFIG_ARG = "pkcs11Config";
- @Deprecated(since="3.0.0", forRemoval=true)
- private static final String CLEAR_BLACKLIST_ARG = "clearBlacklist";
private static final String ALLOW_ALL_DIGESTS_ARG = "allowAllDigests";
- @Deprecated(since="3.0.0", forRemoval=true)
- private static final String BLACKLIST_DIGEST_ARG = "blacklistDigest";
private static final String DISALLOW_DIGEST_ARG = "disallowDigest";
- @Deprecated(since="3.0.0", forRemoval=true)
- private static final String WHITELIST_DIGEST_ARG = "whitelistDigest";
private static final String ALLOW_DIGEST_ARG = "allowDigest";
- @Deprecated(since="3.0.0", forRemoval=true)
- private static final String LIST_BLACKLIST_ARG = "listBlacklist";
private static final String LIST_ALGORITHMS_ARG = "listAlgorithms";
private static final String OUT_FILE_ARG = "outFile";
private static final String DEFLATE_OUT_ARG = "deflateOutput";
@@ -188,10 +178,6 @@ public class CommandLineArguments {
@Parameter(names = OPT + CERT_ARG)
private String cert;
- @Parameter(names = OPT + KEY_ARG)
- @Deprecated(since="3.0.0", forRemoval=true)
- private String key;
-
@Parameter(names = OPT + KEY_FILE_ARG)
private String keyFile;
@@ -228,9 +214,6 @@ public class CommandLineArguments {
*/
@Parameter(names = OPT + ALLOW_ALL_DIGESTS_ARG)
private boolean allowAllDigests;
- @Parameter(names = OPT + CLEAR_BLACKLIST_ARG)
- @Deprecated(since="3.0.0", forRemoval=true)
- private boolean clearBlacklist;
/**
* Option requesting that the signature verification
@@ -238,9 +221,6 @@ public class CommandLineArguments {
*/
@Parameter(names = OPT + LIST_ALGORITHMS_ARG)
private boolean listAlgorithms;
- @Parameter(names = OPT + LIST_BLACKLIST_ARG)
- @Deprecated(since="3.0.0", forRemoval=true)
- private boolean listBlacklist;
/**
* Option requesting that algorithms associated with a specific digest
@@ -248,9 +228,6 @@ public class CommandLineArguments {
*/
@Parameter(names = OPT + DISALLOW_DIGEST_ARG)
private List<String> disallowDigestNames;
- @Parameter(names = OPT + BLACKLIST_DIGEST_ARG)
- @Deprecated(since="3.0.0", forRemoval=true)
- private List<String> blacklistDigestNames;
/**
* Option requesting that algorithms associated with a specific digest
@@ -258,9 +235,6 @@ public class CommandLineArguments {
*/
@Parameter(names = OPT + ALLOW_DIGEST_ARG)
private List<String> allowDigestNames;
- @Parameter(names = OPT + WHITELIST_DIGEST_ARG)
- @Deprecated(since="3.0.0", forRemoval=true)
- private List<String> whitelistDigestNames;
// Logging
@Parameter(names = OPT + VERBOSE_ARG)
@@ -325,40 +299,6 @@ public class CommandLineArguments {
}
}
- // --clearBlacklist changed to --allowAllDigests in V3.0.0
- if (clearBlacklist) {
- DeprecationSupport.warn(ObjectType.CLI_OPTION, OPT + CLEAR_BLACKLIST_ARG,
- null, OPT + ALLOW_ALL_DIGESTS_ARG);
- }
-
- // --listBlacklist changed to --listAlgorithms in V3.0.0
- if (listBlacklist) {
- DeprecationSupport.warn(ObjectType.CLI_OPTION, OPT + LIST_BLACKLIST_ARG,
- null, OPT + LIST_ALGORITHMS_ARG);
- }
-
- // --blacklistDigest changed to --disallowDigest in V3.0.0
- if (blacklistDigestNames != null) {
- DeprecationSupport.warn(ObjectType.CLI_OPTION, OPT + BLACKLIST_DIGEST_ARG,
- null, OPT + DISALLOW_DIGEST_ARG);
- }
-
- // --whitelistDigest changed to --allowDigest in V3.0.0
- if (whitelistDigestNames != null) {
- DeprecationSupport.warn(ObjectType.CLI_OPTION, OPT + WHITELIST_DIGEST_ARG,
- null, OPT + ALLOW_DIGEST_ARG);
- }
-
- // --key deprecated, what to use instead depends on context
- if (key != null) {
- if (cert != null) {
- DeprecationSupport.warn(ObjectType.CLI_OPTION, OPT + KEY_ARG,
- null, OPT + KEY_FILE_ARG);
- } else {
- DeprecationSupport.warn(ObjectType.CLI_OPTION, OPT + KEY_ARG,
- null, OPT + KEY_ALIAS_ARG);
- }
- }
}
/**
@@ -372,7 +312,7 @@ public class CommandLineArguments {
*/
// Checkstyle: CyclomaticComplexity OFF
private void processDisallowedAlgorithmOptions() {
- if (allowAllDigests || clearBlacklist) {
+ if (allowAllDigests) {
disallowedAlgorithms.allowAllDigests();
}
@@ -396,25 +336,6 @@ public class CommandLineArguments {
}
}
- if (blacklistDigestNames != null) {
- for (final String name : blacklistDigestNames) {
- final DigestChoice dig = DigestChoice.find(name);
- if (dig == null) {
- errorAndExit("digest choice \"" + name + "\" was not recognised");
- }
- disallowedAlgorithms.disallowDigest(dig);
- }
- }
-
- if (whitelistDigestNames != null) {
- for (final String name : whitelistDigestNames) {
- final DigestChoice dig = DigestChoice.find(name);
- if (dig == null) {
- errorAndExit("digest choice \"" + name + "\" was not recognised");
- }
- disallowedAlgorithms.allowDigest(dig);
- }
- }
}
// Checkstyle: CyclomaticComplexity OFF
@@ -546,19 +467,11 @@ public class CommandLineArguments {
}
public String getKeyFile() {
- if (keyFile != null) {
- return keyFile;
- }
- // fall back to legacy option
- return key;
+ return keyFile;
}
public String getKeyAlias() {
- if (keyAlias != null) {
- return keyAlias;
- }
- // fall back to legacy option
- return key;
+ return keyAlias;
}
public String getKeyPassword() {
@@ -600,7 +513,7 @@ public class CommandLineArguments {
* @return <code>true</code> if option selected
*/
public boolean doListAlgorithms() {
- return listAlgorithms || listBlacklist;
+ return listAlgorithms;
}
public boolean doVerboseOutput() {
@@ -627,7 +540,7 @@ public class CommandLineArguments {
return;
}
- if (listAlgorithms || listBlacklist) {
+ if (listAlgorithms) {
return;
}
diff --git a/src/test/java/net/shibboleth/tool/xmlsectool/CommandLineArgumentsTest.java b/src/test/java/net/shibboleth/tool/xmlsectool/CommandLineArgumentsTest.java
index 99bf5ae..e053bc5 100644
--- a/src/test/java/net/shibboleth/tool/xmlsectool/CommandLineArgumentsTest.java
+++ b/src/test/java/net/shibboleth/tool/xmlsectool/CommandLineArgumentsTest.java
@@ -27,7 +27,7 @@ public class CommandLineArgumentsTest {
"--inFile", "in.xml",
"--outFile", "out.xml",
"--certificate", "example.crt",
- "--key", "example.key"
+ "--keyFile", "example.key"
};
final CommandLineArguments cli = new CommandLineArguments();
cli.parseCommandLineArguments(args);
@@ -43,7 +43,7 @@ public class CommandLineArgumentsTest {
"--inFile", "in.xml",
"--outFile", "out.xml",
"--certificate", "example.crt",
- "--key", "example.key"
+ "--keyFile", "example.key"
};
final CommandLineArguments cli = new CommandLineArguments();
cli.parseCommandLineArguments(args);
diff --git a/src/test/java/net/shibboleth/tool/xmlsectool/XSTJ51Test.java b/src/test/java/net/shibboleth/tool/xmlsectool/XSTJ51Test.java
index 66654ce..50eac2b 100644
--- a/src/test/java/net/shibboleth/tool/xmlsectool/XSTJ51Test.java
+++ b/src/test/java/net/shibboleth/tool/xmlsectool/XSTJ51Test.java
@@ -47,7 +47,7 @@ public class XSTJ51Test extends BaseTest {
"--inFile", "in.xml",
"--outFile", "out.xml",
"--certificate", "sign.crt",
- "--key", "sign.key"
+ "--keyFile", "sign.key"
};
final CommandLineArguments cli = new CommandLineArguments();
cli.parseCommandLineArguments(args);
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list