.Net Core 中的 CERTENROLLLib 替代品 [英] CERTENROLLLib alternatives in .Net Core
问题描述
我想解码证书请求 PCKS #10 以获得所有必要的信息,例如通用名称、密钥长度和最重要的主题备用名称.
I would like to decode Certificate Requests PCKS #10 to obtain all necessary information such Common Name, Key Length and most important Subject Alternate Names.
以前在 .Net WebFroms 上我使用 CERTENROLLLib 库和 CX509ExtensionAlternativeNames/CX509CertificateRequestPkcs10 类.现在我正在 .Net Core 中寻找替代品
Previously on .Net WebFroms I used CERTENROLLLib library and CX509ExtensionAlternativeNames/CX509CertificateRequestPkcs10 classes. Now I'm looking for replacement in .Net Core
推荐答案
.NET Core 和 .NET Framework 都没有内置支持读取 PKCS#10 blob/证书签名请求.您需要使用 3rd 方库(Portable.BouncyCastle 可能工作,并且可能有您需要的),或阅读 RFC 2986 并自己解析数据.
Neither .NET Core nor .NET Framework has built-in support for reading PKCS#10 blobs / certificate signing requests. You'll need to use a 3rd party library (Portable.BouncyCastle might work, and might have what you need), or read RFC 2986 and parse the data yourself.
如果您不知道如何读取 DER 编码的数据,ITU X.680 将解释 ASN.1 语法:
If you don't know how to read DER encoded data, ITU X.680 will explain the ASN.1 syntax:
CertificationRequestInfo ::= SEQUENCE {
version INTEGER { v1(0) } (v1,...),
subject Name,
subjectPKInfo SubjectPublicKeyInfo{{ PKInfoAlgorithms }},
attributes [0] Attributes{{ CRIAttributes }}
}
和ITU X.690将解释 ASN.1 中的结构如何根据可分辨编码规则 (DER) 进行编码.
And ITU X.690 will explain how the structures from ASN.1 are encoded under the Distinguished Encoding Rules (DER).
这篇关于.Net Core 中的 CERTENROLLLib 替代品的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!