RSA私钥文件(PEM-PKCS#1)解析

本文详细介绍了RSA私钥文件(PEM-PKCS#1)的结构和解析过程,包括数据实例、各域值以及如何组装成PEM文件。通过示例数据展示了TLV结构的组装步骤,并提供了生成PEM文件的实例,同时提到了使用OpenSSL命令获取私钥参数的方法。
摘要由CSDN通过智能技术生成

在PKCS#1 RSA算法标准中定义RSA私钥语法

RSAPrivateKey ::= SEQUENCE { 
version Version, //版本 
modulus INTEGER, // RSA合数模 n 
publicExponent INTEGER, //RSA公开幂 e 
privateExponent INTEGER, //RSA私有幂 d 
prime1 INTEGER, //n的素数因子p 
prime2 INTEGER, //n的素数因子q 
exponent1 INTEGER, //值 d mod (p-1) 
exponent2 INTEGER, //值 d mod (q-1) 
coefficient INTEGER, //CRT系数 (inverse of q) mod p 
otherPrimeInfos OtherPrimeInfos OPTIONAL 
}

otherPrimeInfos 按顺序包含了其它素数r3, …, ru的信息。如果version是0 ,它应该被忽略;而如果version是1,它应该至少包含OtherPrimeInfo的一个实例。 
OtherPrimeInfos ::= SEQUENCE SIZE(1..MAX) OF OtherPrimeInfo 
OtherPrimeInfo ::= SEQUENCE { 
prime INTEGER, //ri – n的一个素数因子ri ,其中i ≥ 3 

RSA公司的PKCS(Public Key Cryptography Standards)系列标准。 官方网站的相关页面和链接好像已经失效。经过精心查找和整理,这可能是目前能收集到的最全的版本,包括如下版本: PKCS #1 v2.2: RSA Cryptography Standard PKCS #1 v2.1: RSA Cryptography Standard PKCS #1 v2.0: RSA Cryptography Standard PKCS #1 v2.0 Amendment 1: Multi-Prime RSA PKCS #1: RSA Encryption Standard PKCS #3: Diffie-Hellman Key-Agreement Standard PKCS #5 v2.1: Password-Based Cryptography Standard PKCS #5 v2.0: Password-Based Cryptography Standard PKCS #5: Password-Based Encryption Standard PKCS #6: Extended-Certificate Syntax Standard PKCS #7: Cryptographic Message Syntax Standard PKCS #8: Private-Key Information Syntax Standard PKCS #9 v2.0: Selected Object Classes and Attribute Types PKCS #9 v2.0 Amendment 1 PKCS #9: Selected Attribute Types PKCS #10 v1.7: Certification Request Syntax Standard PKCS #10: Certification Request Syntax Standard PKCS #11 v2.20: Cryptographic Token Interface Standard PKCS #11 v2.11: Cryptographic Token Interface Standard PKCS #11 Profiles For Mobile Devices PKCS #11 v2.10: Cryptographic Token Interface Standard PKCS #11: Cryptographic Token Interface Standard PKCS #11: Cryptographic Token Interface Standard PKCS #11: Cryptographic Token Interface Standard PKCS #12 v1.1: Personal Information Exchange Syntax PKCS 12 v1.0: Personal Information Exchange Syntax PKCS #12 v1.0 Technical Corrigendum 1 PKCS #15: Conformance Profile Specification PKCS #15 v1.1 Technical Corrigendum 1 PKCS #15 v1.1 Technical Corrigendum 2 PKCS #15 v1.0: Cryptographic Token Information Format Standard PKCS #15 v1.0 Amendment 1 PKCS #15 v1.1: Cryptographic Token Information Syntax Standard
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

neo_will_mvp

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值