如何将 XML RSA 密钥转换为 PEM 文件? [英] How do I convert an XML RSA key to a PEM file?

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

问题描述

我有两个 XML 文件,结构如下:

I have two XML files, structured as follows:

我的钥匙

<RSAKeyValue>
  <Modulus> ... </Modulus>
  <Exponent> ... </Exponent>
  <P> ... </P>
  <Q> ... </Q>
  <DP> ... </DP>
  <DQ> ... </DQ>
  <InverseQ> ... </InverseQ>
  <D> ... </D>
</RSAKeyValue>

公钥

<RSAKeyValue>
   <Modulus> ... </Modulus>
   <Exponent> ... </Exponent>
</RSAKeyValue>

我正在使用 Robert Richards 的 xmlseclibs 库,它需要密钥的 .PEM 表示来加密和解密.

I am using the xmlseclibs library by Robert Richards which requires a .PEM representation of the key in order to encrypt and decrypt things.

作为一个加密新手,我不知道从哪里开始,粗略的谷歌搜索并没有发现任何特别明显的东西......

As an encryption novice, I'm not sure where to begin, and a cursory Google search did not reveal anything particularly obvious...

谢谢!

推荐答案

我找到了一个 Java 实用程序 可以做到.

I have found a Java utility that can do it.

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

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