将公钥转换为可读的内容以供共享

发布于 2024-09-03 12:17:11 字数 62 浏览 3 评论 0原文

如何将 RSAPublicKey 转换为可读的内容(公钥共享原因),然后将其转换回 RSAPublicKey?

How can I convert RSAPublicKey into something readable (public key sharing reasons) and then convert it back to RSAPublicKey?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

嗼ふ静 2024-09-10 12:17:11

getEncoded() 方法获取一个字节数组,然后您可以将其转换为十六进制表示的字符串(或者,如果您想更聪明地了解它,可以使用一组 256 个单词来代表每个字节!)回来的路上有类似的想法。将其转换回字节数组后,应该有一个可以将其传递给的构造函数。

The getEncoded() method gets you a byte array, which you can then convert to a string in hexadecimal representation (or, if you want to get cleverer about it, have a set 256 words you can use to represent each byte!) Similar idea on the way back. Once you convert it back to a byte array there should be a constructor you can pass it to.

谁的新欢旧爱 2024-09-10 12:17:11

Java程序之间共享密钥的最简单方法是在keytool中生成密钥并共享keystore文件。

The easiest way to share the key between Java programs is to generate the key in keytool and share the keystore file.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文