我用sun.security.rsa.RSAPrivateCrtKeyImpl生成的私钥是:
Sun RSA private CRT key, 1024 bits
modulus: 138366379149556651529264271167627776457858687036310253186931869304419603614951358029547428616757746198297697875913048009038184919740987891480058872914394404915587279803233281027437510321771042949607120103195234015711071571988324336148543386523834345645243818986713709872730288332630296741272814978967784227069
public exponent: 65537
private exponent: 42719461002367048950106554508228640750237463928661697407332948464312163503744843040875576706768332950491411245879802453802869122267408471492553995980131161214511462311734362828791207487713091891247523690000639130500727826563207418480253226225770800959630617332844053134859474011020593763546737667241605692353
prime p: 12328255750467409079439999946855416527752220578348085943641220874092282814221107307763063782943023994024352849447350893011386589468551567820268908160666649
prime q: 11223516282448202627172567079868338655590947431343348299631403007622560460960897697238209565043893795422382080101688621632572201910848518746489341371496581
prime exponent p: 11342552100125629266872052074332683070233236861813243482975032348828026562843738763388459296582320181999273750143078212245106995821982298317877753869779161
prime exponent q: 10962866698520251021231546784530443856716885115544569348626032066358823380814072448978500470059429960388235483127234952985475525357019209416917393043568573
crt coefficient: 9846384935336789835421613764561920058092382419046835586571926435630761621549010920801606578374340325376094171901765997004256787408492951976065590820418727
而需要的格式和OpenSSH的格式一直,类似:
-----BEGIN RSA PRIVATE KEY-----
MIICWgIBAAKBgQCXDrez72Y4/1WCe3SECKLhNup+JjXdTgxtVqMBX6XZIWrh7sVx
30U+y7BcOR//QVKrvV5J9KORKGli0XTr79MHK/CRxwZpIwySaf/bK1s/XbOezM8u
tawMmIpZG2oeHmCh6ApiW0I8bK687iqHSU9iHFrrb6izt0j5G+vrlJb5WQIBJQKB
gHJQU6rDAT/j0gHg4o1uUb8wehpGbfOVAnxBkBy3FbkSXrjQXhD7/QztK4QPjdXs
Po/Nk3Y8l3TEosdSZlGukdq83uuyBYpJz0KKT2RLEt1iGboWSWKD7f8WvKYeXTO7
EZV5U8t/gaVj5O19FYumAGa+VOjq0Iyg/Yak8UFqxwptAkEA5LL5F2Az4IdHNuWo
WP+xxNMLTT4H0zQCKnpWDdmABsK79lz/CTWbXjtxDJOE95m67E27o314tBmJ1+Kj
R1E/dQJBAKkXBc2MmfNFs0V6bkqU6Q4aAitCdv1GsDSWudMnvk4iF0g1hCBqdDgp
WzMoQKQQjSJBjky8OAngaw6l6LcH2dUCQQDL+ZIN7gTBVg8VSV7L6vh/HRfq8iKn
nRawQ5jb64AGB6C5IoKZgtat/aoETDhSdFqbZ+yK5YdUhXrw+pGgeOWRAkAf/W/M
8RY08YLH9JFoDlWa4lNv99FSgv6911OWpqd2kNP454ezGw8Ri0ia+ccKSFINZlkx
HLCn7C/uA7Zn0Q2JAkAxs57iha1SYG8eUwN/C6eUnCU3WY9y9k6v8SA+5GQBm/Hn
e/mTZkU/4+IjgbZzA/N/eWou6MAlYBshC+1oHtUn
-----END RSA PRIVATE KEY-----
我想知道这两个形式是如何转换的??
------解决方案--------------------
帮你顶顶吧 复杂的加密 看有高手来不
------解决方案--------------------
这个太高深不会,期待高手
------解决方案--------------------
留个印记 记得以后来补习
------解决方案--------------------
看看rsa加密算法。这个不是简单就转换成的,何况加密都有现成的程序模块了,还用费这个脑筋么?
------解决方案--------------------
帮你顶一下,我也正要知道这个,期待高手
------解决方案--------------------
期待高手正解 rsa 哈哈 非对称加密算法 经典
------解决方案--------------------
感觉是进制的问题。。
你把modulus: 138366379149556651529264271167627776457858687036310253186931869304419603614951358029547428616757746198297697875913048009038184919740987891480058872914394404915587279803233281027437510321771042949607120103195234015711071571988324336148543386523834345645243818986713709872730288332630296741272814978967784227069
变成16进制显示就可以了 应该
------解决方案--------------------