[java-identity-provider] branch main updated: IDP-2059 Property to set AES key size setting for the Data Sealer Key Store
Rod Widdowson
rdw at steadingsoftware.com
Wed May 24 09:10:55 UTC 2023
This is an automated email from the git hooks/post-receive script.
rdw pushed a commit to branch main
in repository java-identity-provider.
View the commit online:
http://git.shibboleth.net/view/?p=java-identity-provider.git;a=commit;h=b1a39d4d25172b58a63425ca1987dfeebc697198
The following commit(s) were added to refs/heads/main by this push:
new b1a39d4d2 IDP-2059 Property to set AES key size setting for the Data Sealer Key Store
b1a39d4d2 is described below
commit b1a39d4d25172b58a63425ca1987dfeebc697198
Author: Rod Widdowson <rdw at steadingsoftware.com>
AuthorDate: Wed May 24 10:10:24 2023 +0100
IDP-2059 Property to set AES key size setting for the Data Sealer Key Store
https://shibboleth.atlassian.net/browse/IDP-2059
---
.../idp/installer/impl/InstallerProperties.java | 21 +++++++++++++++++++++
.../shibboleth/idp/installer/impl/V5Install.java | 4 ++++
.../shibboleth/idp/installer/TestInstallerCLI.java | 2 +-
3 files changed, 26 insertions(+), 1 deletion(-)
diff --git a/idp-installer/src/main/java/net/shibboleth/idp/installer/impl/InstallerProperties.java b/idp-installer/src/main/java/net/shibboleth/idp/installer/impl/InstallerProperties.java
index 3134462e9..afd00f0c2 100644
--- a/idp-installer/src/main/java/net/shibboleth/idp/installer/impl/InstallerProperties.java
+++ b/idp-installer/src/main/java/net/shibboleth/idp/installer/impl/InstallerProperties.java
@@ -92,6 +92,9 @@ public class InstallerProperties {
/** The sealer alias to use. */
public static final String SEALER_ALIAS = "idp.sealer.alias";
+ /** The sealer alias to use. */
+ public static final String SEALER_KEYSIZE = "idp.sealer.keysize";
+
/** The the key size to generate. */
public static final String KEY_SIZE = "idp.keysize";
@@ -527,6 +530,24 @@ public class InstallerProperties {
return InstallerProperties.CORE_MODULES;
}
+ /** Return the sealer key size, if this has been specified.
+ * @return the key size or null if non specified
+ */
+ @Nullable Integer getSealerKeySize() throws BuildException {
+ final String val = installerProperties.getProperty(SEALER_KEYSIZE);
+ if (val == null) {
+ return null;
+ }
+ final Integer result;
+ try {
+ result = Integer.valueOf(val);
+ }
+ catch (final NumberFormatException e) {
+ log.error("Provided value for property {} ({}') was not an integer", SEALER_ALIAS, val);
+ throw new BuildException(e);
+ }
+ return result;
+ }
/** Get the alias for the sealer key.
* @return the alias
diff --git a/idp-installer/src/main/java/net/shibboleth/idp/installer/impl/V5Install.java b/idp-installer/src/main/java/net/shibboleth/idp/installer/impl/V5Install.java
index bea5ca366..383f6727f 100644
--- a/idp-installer/src/main/java/net/shibboleth/idp/installer/impl/V5Install.java
+++ b/idp-installer/src/main/java/net/shibboleth/idp/installer/impl/V5Install.java
@@ -651,6 +651,10 @@ public class V5Install {
final BasicKeystoreKeyStrategyTool generator = new BasicKeystoreKeyStrategyTool();
generator.setKeystoreFile(sealerFile);
generator.setVersionFile(versionFile);
+ final Integer keySize = installerProps.getSealerKeySize();
+ if (keySize != null) {
+ generator.setKeySize(keySize);
+ }
generator.setKeyAlias(installerProps.getSealerAlias());
generator.setKeystorePassword(installerProps.getSealerPassword());
log.info("Creating Sealer KeyStore");
diff --git a/idp-installer/src/test/java/net/shibboleth/idp/installer/TestInstallerCLI.java b/idp-installer/src/test/java/net/shibboleth/idp/installer/TestInstallerCLI.java
index 305ff5bbd..32e124b4b 100644
--- a/idp-installer/src/test/java/net/shibboleth/idp/installer/TestInstallerCLI.java
+++ b/idp-installer/src/test/java/net/shibboleth/idp/installer/TestInstallerCLI.java
@@ -32,7 +32,7 @@ public class TestInstallerCLI {
System.setProperty(InstallerProperties.KEY_STORE_PASSWORD, "p1");
System.setProperty(InstallerProperties.SEALER_PASSWORD, "p1");
System.setProperty(InstallerProperties.HOST_NAME, "machine.org.uk");
-
+// System.setProperty(InstallerProperties.SEALER_KEYSIZE, "256");
IdPInstallerCLI.runMain(new String[] {
"-s",
"h:\\Perforce\\Juno\\V5\\java-identity-provider\\idp-distribution\\target\\shibboleth-identity-provider-5.0.0-SNAPSHOT",
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list