// Using the old algorithms to make sure the file is recognized // by the certutil command on old versions of Windows.
SecurityTools.keytool( "-J-Dkeystore.pkcs12.legacy"
+ " -genkeypair -storetype pkcs12 -keystore ks"
+ " -storepass changeit -keyalg RSA -dname CN=A -alias "
+ alias);
String id = ((X509Certificate)KeyStore.getInstance( new File("ks"), "changeit".toCharArray())
.getCertificate(alias)).getSerialNumber().toString(16); try { // Importing pkcs12 file. Long alias is only supported by CNG.
ProcessTools.executeCommand("certutil", "-v", "-p", "changeit", "-csp", "Microsoft Software Key Storage Provider", "-user", "-importpfx", "MY", "ks", "NoRoot,NoExport")
.shouldHaveExitValue(0);
test();
} finally {
ProcessTools.executeCommand("certutil", "-user", "-delstore", "MY",
id);
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.