diff --git a/tools/tcg_rim_tool/src/main/java/hirs/swid/Main.java b/tools/tcg_rim_tool/src/main/java/hirs/swid/Main.java index 65ea328f..6070fa25 100644 --- a/tools/tcg_rim_tool/src/main/java/hirs/swid/Main.java +++ b/tools/tcg_rim_tool/src/main/java/hirs/swid/Main.java @@ -55,24 +55,6 @@ public class Main { boolean embeddedCert = commander.isEmbedded(); boolean defaultKey = commander.isDefaultKey(); String outputFile = commander.getOutFile(); - if (!trustStoreFile.isEmpty()) { - gateway.setDefaultCredentials(true); - gateway.setJksTruststoreFile(trustStoreFile); - } else if (!certificateFile.isEmpty() && !privateKeyFile.isEmpty()) { - gateway.setDefaultCredentials(false); - gateway.setPemCertificateFile(certificateFile); - gateway.setPemPrivateKeyFile(privateKeyFile); - if (embeddedCert) { - gateway.setEmbeddedCert(true); - } - } else if (defaultKey) { - gateway.setDefaultCredentials(true); - gateway.setJksTruststoreFile(SwidTagConstants.DEFAULT_KEYSTORE_FILE); - } else { - System.out.println("A private key (-k) and public certificate (-p) " + - "are required, or the default key (-d) must be indicated."); - System.exit(1); - } if (!commander.getSignFile().isEmpty()) { Document doc = gateway.signXMLDocument(commander.getSignFile()); gateway.writeSwidTagFile(doc, outputFile); diff --git a/tools/tcg_rim_tool/src/main/java/hirs/swid/SwidTagGateway.java b/tools/tcg_rim_tool/src/main/java/hirs/swid/SwidTagGateway.java index 81f8043b..d969fc16 100644 --- a/tools/tcg_rim_tool/src/main/java/hirs/swid/SwidTagGateway.java +++ b/tools/tcg_rim_tool/src/main/java/hirs/swid/SwidTagGateway.java @@ -626,7 +626,7 @@ public class SwidTagGateway { CredentialParser cp = new CredentialParser(); try { if (defaultCredentials) { - cp.parseJKSCredentials(jksTruststoreFile); + cp.parseDefaultCredentials(); privateKey = cp.getPrivateKey(); KeyName keyName = kiFactory.newKeyName(cp.getCertificateSubjectKeyIdentifier()); keyInfoElements.add(keyName); diff --git a/tools/tcg_rim_tool/src/test/resources/generated_truststore_embed.swidtag b/tools/tcg_rim_tool/src/test/resources/generated_truststore_embed.swidtag index 9387733a..0c10f304 100644 --- a/tools/tcg_rim_tool/src/test/resources/generated_truststore_embed.swidtag +++ b/tools/tcg_rim_tool/src/test/resources/generated_truststore_embed.swidtag @@ -1,5 +1,5 @@ - + @@ -17,14 +17,14 @@ - DJMc0n3VHHwU+F3HNpiY/l3EMcjRZAQOYlrjhD5v9qE= + f3ulvid12X4b4EqgAQrriXwqvqlNd1GXoSf/wI+zf2A= - ojJ6v8ToxLWWekCKmBoZ+Yg2V4MYMPbKB9FjDs/QG/AMP+LKjnb55Z7FSLhC8+CvvShKPAoS9mv1 -QepwI17NEqbfnC1U4WH0u578A3J6wiHMXIDnIQqKAAXb8v2c/wjMDArzFl8CXmDA7HUDIt+3C4VC -tA598YY7o0Hf6hK5qO8oWGQxXUKfpUwvtGLxHpbDWYFuVSPa+uk6OTzutt/QyzTERzxyO9Le1i6K -nrpzh4lgHn6EfGs6HR1ffdHQ069q0bE61zDx0VC18nK9DmszW6p6FlMzApiTVW/4PiVt+dSFeVGR -9///OdtxcoBCeofDDFPRyO+s+kY1pXd92Q3nfg== + GbvVCBhCDBa1Oz0HereVan1VzqFnkhQbG/QvYAtaPwWCpqtVqSTla0dvEW8LFKJtoLpE8ZQopshx +se53rd9Z4aR2ok7VKfhtFV6LCNseyvmzWypqzCvLaG0net7EpMCixj8i0A5e4zaAEgt5Jqg1Acew +hAY8XSnz9/e0EuzC3s9QlWSZHBtSvqlWUhsSVThf9KyHE3F/bwUGmEg6QdtREAr3c2jNK+LEN5MF +hx64fG/WLRaAkw0lEWnBbjCdiB1ao+1G/c9yzxUQ82EriJdRBYjuRVmMlIOFRtYqe7oc5148pAAY +qhol4MYlrmdjg9aW+2nv4KHHSDIhVgAAwRNJoQ== CN=example.RIM.signer,OU=PCClient,O=Example,ST=VA,C=US