java 如何更改证书中的颁发者名称(我使用过keytool)?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2956959/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-29 23:41:12  来源:igfitidea点击:

How to change Issuer name in certificate (i have used keytool)?

java

提问by Rahul

Owner: CN=gateway, OU=gateway, O=gateway, C=ss

Issuer: CN=gateway, OU=gateway, O=gateway, C=ss

Serial number: 4c05ed66

Valid from: Wed Jun 02 11:04:30 IST 2010 until: Fri Jun 03 11:04:30 IST 2011

Certificate fingerprints:

     MD5:  E3:27:75:8D:96:CB:C3:67:EF:F0:5D:E1:D6:85:CD:0C
     SHA1: 2E:8B:67:0D:AC:25:E2:99:50:61:60:88:BA:1F:1C:10:8F:41:7C:27

     Signature algorithm name: SHA1withDSA
     Version: 3

Trust this certificate? [no]: yes

Certificate was added to keystore

所有者:CN=网关,OU=网关,O=网关,C=ss

颁发者:CN=网关,OU=网关,O=网关,C=ss

序列号:4c05ed66

有效期自:IST 2010 年 6 月 2 日星期三 11:04:30 至:IST 2011 年 6 月 3 日星期五 11:04:30

证书指纹:

     MD5:  E3:27:75:8D:96:CB:C3:67:EF:F0:5D:E1:D6:85:CD:0C
     SHA1: 2E:8B:67:0D:AC:25:E2:99:50:61:60:88:BA:1F:1C:10:8F:41:7C:27

     Signature algorithm name: SHA1withDSA
     Version: 3

信任这个证书?[否]:是

证书已添加到密钥库

Using Keytool i am generating KeyPair and Certificate. Below is the content of my certificate now i want to change the only Issuer name suppose i am verifying it and i want to make myself as a issuer so i want to enter my info here...Owner should be same only Issuer i want to change ..plz tell me how to do it??

使用 Keytool 我正在生成 KeyPair 和证书。下面是我的证书的内容,现在我想更改唯一的发行人名称,假设我正在验证它并且我想使自己成为发行人,所以我想在这里输入我的信息......所有者应该是我想要的唯一发行人改变..请告诉我怎么做??

回答by Joachim Sauer

You can't, you have to create a new certificate.

你不能,你必须创建一个新证书。

The certificate contains a signature of the data it presents (including Owner, Issuer, Fingerpint, ...) and that's what makes up the certificate in the first place.

证书包含它所呈现的数据的签名(包括所有者、发行者、Fingerpint 等),这首先构成了证书。

Put differently: A certificate is designed specificallyso that this data can't be modified after its creation.

换句话说:证书是专门设计的,因此在创建后无法修改此数据。

回答by Smrithi Komalan

Using BurpSuite, you can modify the certificates Issuer Name. Step 1: Copy paste the certificate data from Begin Certificate to End certificate Step 2: Decode the certificate information Step 3: Use the ASN.1 format to get details on Certificate information Step 4: Modify the information and encode it back to B-64 format.

使用 BurpSuite,您可以修改证书颁发者名称。步骤 1:将证书数据从开始证书复制粘贴到结束证书步骤 2:解码证书信息步骤 3:使用 ASN.1 格式获取证书信息的详细信息步骤 4:修改信息并将其编码回 B-64格式。

But anyways the loading to the library will fail .

但无论如何加载到库将失败。