如何在两种公钥格式之间转换,一种格式是: —–BEGIN PUBLIC KEY—– … —–END PUBLIC KEY—– 另一种格式是: —–BEGIN RSA PUBLIC KEY—– … —–END RSA PUBLIC KEY—– 例如我使用ssh-keygen命令生成了id_rsa / id_rsa.pub对,我使用以下命令计算了id_rsa中的公钥: openssl rsa -in id_rsa -pubout -out pub2 然后再次从id_rsa.pub计算公钥使用: ssh-keygen -f id_rsa.pub -e -m pem > pub1 内容是pub1是: —–BEGIN RSA PUBLIC KEY—– MIIBCgKCAQEA61BjmfXGEvWmegnBGSuS+rU9soUg2FnODva32D1AqhwdziwHINFa D1MVlcrYG6XRKfkcxnaXGfFDWHLEvNBSEVCgJjtHAGZIm5GL/KA86KDp/CwDFMSw luowcXwDwoyinmeOY9eKyh6aY72xJh7noLBBq1N0bWi1e2i+83txOCg4yV2oVXhB o8pYEJ8LT3el6Smxol3C1oFMVdwPgc0vTl25XucMcG/ALE/KNY6pqC2AQ6R2ERlV gPiUWOPatVkt7+Bs3h5Ramxh7XjBOXeulmCpGSynXNcpZ/06+vofGi/2MlpQZNhH Ao8eayMp6FcvNucIpUndo1X8dKMv3Y26ZQIDAQAB —–END RSA PUBLIC KEY—– pub2的内容是: —–BEGIN PUBLIC […]