草庐IT

ParseCertificateRequest

全部标签

c# - 使用 x509.ParseCertificateRequest 解码失败但 openssl 可以吗?

当我尝试加载PEM编码的CSR时,Golang没有正确解析CSR中的ASN.1数据。它吐出序列被截断。另一方面,OpenSSL可以处理CSR并打印出正确的CN。这是生成代码(在c#中):publicstringgenerateCSR(stringcn){try{AsymmetricCipherKeyPairpair=this.keyHolder.keypair;varsubject=newX509Name("CN="+cn);varpkcs10CertificationRequest=newPkcs10CertificationRequest(PkcsObjectIdentifiers