OPENSSH PRIVATE KEY转换为RSA PRIVATE KEY

OPENSSH PRIVATE KEY转换为RSA PRIVATE KEY

一、解决问题

部分库(如:JSch)不支持OPENSSH PRIVATE KEY格式的私钥

二、涉及工具

puttygen

三、具体内容

1、OPENSSH PRIVATE KEY格式

形如:

-----BEGIN OPENSSH PRIVATE KEY-----
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
-----END OPENSSH PRIVATE KEY-----

2、RSA PRIVATE KEY格式

形如:
-----BEGIN RSA PRIVATE KEY-----
Proc-Type: 4,ENCRYPTED
DEK-Info: DES-EDE3-CBC,C3B1810B8A3C9EF3
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
-----END RSA PRIVATE KEY-----

3、使用puttygen转换

  • 下载windows putty
  • 假设有OPENSSH PRIVATE KEY格式文件:demo.private
  • load文件:puttygen demo.private
  • 导出为RSA PRIVATE KEY格式:Conversions -> Export OpenSSH key

你可能感兴趣的:(加密,openssh,private,key,puttygen,rsa,private,key)