将RSA密钥转换为PEM格式 [英] Convert rsa keys into pem format

查看:2837
本文介绍了将RSA密钥转换为PEM格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个十进制格式的RSA密钥对,如下所示:

I have an RSA keypair in decimal format like this:

N:  131380300130444423689465024460852313971098730922811994958210650530501686748132880102503190365296216968351535889369502651601697016994057094307459860310817213533755054007252477133258682280599098830508996183566745393684789271087614478241425320061726198137426426490142200235611844869472546908487777450913733956847
E:  65537
D:  80297204963989065579466889768824319637950465647088430322583084471355799970954766200860052948440422519604509972209521777162610037317804551817832746460011635684494412969232268215156141089492528372187753214602862715747188949826914338588271329247689858629892142371556575928454002581316958535707202236560574870513
P:  1224584489781086541356110467036625215751324632060784958572680296867401248241071907258999049522896850209985495153134079568147009917335592949603533318035603
Q:  10728561502026755927334064184961854822182870744919733441933716834397978727498603128211162084788541605856166966893670172798846339557261092973389679407794073

尽管OpenSSL(对于PHP)要求密钥应为PEM格式.我如何转换它们?公众与公众非常重要.私钥保持不变"(因为我的意思是我不能仅仅创建一个新的密钥对).

While OpenSSL (for PHP) requires that the key should be in PEM format. How do i convert them? It is very important that the public & private key "stays the same" (By that i mean that i can't just make a new keypair).

还是更容易进行pem化处理并以十进制格式提取所有这些值?如果可以,怎么办?

Or is it easier to make a pem cartificate and extracting all of those values in decimal format? And if so, how?

推荐答案

您可以自己完成操作(编写一个小的utitlity程序以将密钥转换为PEM格式),您可以在以下URL使用Java工具: http://www.platanus.cz/blog/converting-rsa-xml-key -对-佩姆

Short of doing it yourself (writing a small utitlity program to convert the key to PEM format) you could use the Java tool at this URL: http://www.platanus.cz/blog/converting-rsa-xml-key-to-pem

它要求输入必须在XML文件中,但是对于您生成的输入来说应该是微不足道的.

It requires the input to be in an XML file but that should be trivial for you to generate.

这篇关于将RSA密钥转换为PEM格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆