@@ -191,15 +191,23 @@ jobs:
191191 - name : Convert JKS to PFX
192192 shell : pwsh
193193 run : |
194- & "${env:JAVA_HOME}\bin\keytool.exe" -importkeystore `
195- -srckeystore "$PWD\signing.jks" `
196- -srcstorepass $env:JKS_PASS `
197- -srcalias $env:ALIAS `
198- -srckeypass $env:JKS_PASS `
199- -destkeystore "$PWD\cert.pfx" `
200- -deststoretype PKCS12 `
201- -deststorepass $env:PFX_PASS `
202- -destkeypass $env:PFX_PASS
194+ if (($env:JKS_PASS).Length -lt 6) { throw "JKS_PASS must be at least 6 characters." }
195+ if (($env:PFX_PASS).Length -lt 6) { throw "PFX_PASS must be at least 6 characters." }
196+
197+ $kt = Join-Path $env:JAVA_HOME 'bin\keytool.exe'
198+
199+ $args = @(
200+ '-importkeystore',
201+ '-srckeystore', "$PWD\signing.jks",
202+ '-srcstorepass', $env:JKS_PASS,
203+ '-srcalias', $env:ALIAS,
204+ '-srckeypass', $env:JKS_PASS,
205+ '-destkeystore', "$PWD\cert.pfx",
206+ '-deststoretype','PKCS12',
207+ '-deststorepass',$env:PFX_PASS,
208+ '-destkeypass', $env:PFX_PASS
209+ )
210+ & $kt @args
203211 if (-not (Test-Path "$PWD\cert.pfx")) { throw "cert.pfx not created" }
204212
205213 - name : Prove PFX has a private key (fail fast)
0 commit comments