Putty密钥生成器命令行界面?

4

是否可以通过命令行界面使用Putty密钥生成器?我找不到任何文档。

有什么提示吗?

顺便说一下,我只想在Windows机器上生成一个openssh格式的密钥对。

3个回答

5
阅读源代码,似乎有一个命令行界面。
在主要部分。
if (argc > 0) {
if (!strcmp(argv[0], "-pgpfp")) {
    pgp_fingerprints();
    exit(1);
} else {
    /*
     * Assume the first argument to be a private key file, and
     * attempt to load it.
     */
    cmdline_keyfile = argv[0];
}
}

你有一个选择

  • -pgpfp

这将输出一条消息:

void pgp_fingerprints(void)
{
    fputs("These are the fingerprints of the PuTTY PGP Master Keys. They can\n"
      "be used to establish a trust path from this executable to another\n"
      "one. See the manual for more information.\n"
      "(Note: these fingerprints have nothing to do with SSH!)\n"
      "\n"
      "PuTTY Master Key (RSA), 1024-bit:\n"
      "  " PGP_RSA_MASTER_KEY_FP "\n"
      "PuTTY Master Key (DSA), 1024-bit:\n"
      "  " PGP_DSA_MASTER_KEY_FP "\n", stdout);
}
  • 一个关键文件名,稍后将用于

    if (cmdline_keyfile) load_key_file(hwnd, state, filename_from_str(cmdline_keyfile), 0); return 1;`

我的建议是跟随代码并了解其中的含义。


你正在查看putty的源代码,它不用于生成密钥。你需要查看puttygen。-pgpfp显示PGP密钥指纹。 - Claus
1
我下载了整个源代码 - 它包括putty gen。 - Preet Sangha

4

4
您可能会很遗憾:puttygen(出于很好的原因)实际上没有一个稳定的命令行界面。
对于您需要的内容,Windows 上的 ssh-keygen 可能是您需要的。虽然需要一些工作,但您可以从 http://code.google.com/p/msysgit/downloads/list 的 mSysGit 安装中提取它并使用它。

1
ssh-key非常好用,所需文件位于“C:\ Program Files(x86)\ Git \ bin”中,包括:
  • ssh-keygen.exe
  • msys-1.0.dll
  • msys-crypto-0.9.8.dll
  • msys-minires.dll
- Julien Pierre
1
@femi 这里的“好理由”是什么,Femi? - silkfire

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接