公钥和私钥的使用 [英] Public key and private key uses

查看:161
本文介绍了公钥和私钥的使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

他们,

我已经在Java中生成了私钥和公钥.而公钥大小为1kb,私钥大小为2kb.我用谷歌搜索了很多,但无法理解其核心.

帮帮我.


在此先谢谢您:)

hi their ,

I have generated private and public key in java. whereas public key size is 1kb and private key size is 2kb. i googled lot but unable to understand the core.

help me out.


Thanks in advance:)

推荐答案

除了有关您的实际密钥的加密信息之外,密钥文件始终包含一些元数据,例如何时生成密钥,是否生成密钥.已打包,如果是,则使用哪种类型的打包(base64等)来打包密钥等.
尝试在记事本中打开钥匙,以查看是否可以获得任何人类可读的信息.
通常,您可以阅读以下内容:

Besides the cryptographic information about your actual key, the key files always contain some metadata, as to when the key was generated, whether it is packed, if so what kind of packing (base64 etc) was used to pack the key etc.
Try to open your key in a notepad to see if you can get any human-readable info.
Often you can read something like:

-----BEGIN RSA PRIVATE KEY-----
Proc-Type: 4,ENCRYPTED
DEK-Info: DES-EDE3-CBC,7BC....

JHQ8U0pDbeFM9h2jZSmiugxdqOa2q/MiX43Xa4Es6nKmzu9oI/ZfpIdAHi8qwtsD
mZ5bQRIXD9AXeIRy+0tG2ibUaphQEsvI995PWUsh8N9dVumsqykmMXSwND7tkbHB
iO/VVSAAD9bV3dbl5nbMwMnPG+YC3S90GAK4ZRIqrHRQ94fd/ZAvP8kV9ilwCmX6
swFlNBLGuKFllJ9qkyr+OOQqulrAyZAB2UThGCJJetELFtV4mLmIaHdgDIcUqpJp==
-----END RSA PRIVATE KEY-----



RSA私钥开头之后的两行是元数据,其大小可能会有所不同.
如果密钥是二进制格式,则通常可以使用某些密钥管理工具来获取元信息.



The two lines just after the beginning of RSA private key are metadata, that can vary in size.
If the key is in a binary format, you can usually get the meta information using some key management tool.


这篇关于公钥和私钥的使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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