将密钥对条目中的公钥替换为受信任的证书,密钥库

huangapple go评论51阅读模式
英文:

Replace public key in key pair entry with trusted certificate, keystore

问题

我做错了些什么,但我不太确定我做了什么。目前,我有一对密钥,私钥是正确的,但公钥是错误的。我不知道我做错了什么。无论如何,我有一个带有正确SHA-1代码的受信任证书。我想要完成的目标是用受信任证书中的正确详细信息替换密钥对上的公钥。显然,我不太了解这些密钥的工作原理,所以任何帮助都将不胜感激。谢谢

我尝试过的事情:

  • 仅删除公钥(最终删除整个密钥对)
  • 分别提取私钥和公钥,然后重新构建密钥对
  • 提取每个部分并尝试组合在一起

另外:

  • 我有.der / .cer文件

在密钥库浏览器中,当前附在这里

英文:

I've done something wrong but I'm not quite sure what I did. Currently, I have a key pair that has the correct private key but the wrong public key. I have no idea what I did wrong to get this. Anyways I have a trusted certificate with the correct SHA-1 code I need. What I'm trying to accomplish is to replace the public key, on the key pair with the correct details from the trusted certificate. Obviously I don't know a ton about how these keys work so any help is appreciated. Thanks

Things I've tried:

  • delete just the public key (ends up deleting the whole pair)
  • extracting the private key and public key separately and rebuilding a key pair
  • extract each part and try to combine separate

Also:

  • I have the .der / .cer file

In Keystore explorer, currently attached here

答案1

得分: 1

公钥和私钥对是不可分割的。你无法验证私钥而没有公钥。

看起来你说你有一对密钥,以及一个可以用密钥对中的私钥验证的公共证书,但与密钥对中的公钥不匹配。我不知道这是如何可能的,但如果是这样的情况,你应该不会有认证问题。

如果不是这种情况,你需要生成一个新的密钥。密钥认证的整个目的是防止逆向工程。

英文:

A public and private key pair are inseparable. You can't verify the private key without the public key.

It seems you are saying you have a key pair, and a public certificate that can be verified with the private key in the key pair, but doesn't match the public key in the key pair. I don't know how this is possible, but if that is the case, you should have no auth issue.

If this is not the case, you need to generate a new key. The whole point of key auth is to prevent reverse-engineering.

huangapple
  • 本文由 发表于 2020年7月29日 05:50:27
  • 转载请务必保留本文链接:https://go.coder-hub.com/63143309.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定