[英]How to create CX509PublicKey object from a public key byte array
I have created a RSA key pair, fetched the public key, cahnged it to byte array and sent it to another API for further flow.我创建了一个 RSA 密钥对,获取了公钥,将其转换为字节数组并将其发送到另一个 API 以进行进一步的流程。 There i need a CX509PublicKey to be generated from the received byte array.
我需要从接收到的字节数组生成 CX509PublicKey。 How to do that?
怎么做?
Following is the code以下是代码
RSACryptoServiceProvider RSA = new RSACryptoServiceProvider();
var pk = RSA.ExportRSAPublicKey();
return pk;
AND和
CX509PublicKey cpk = new CX509PublicKey(pk);
var objPkcs10 = new CX509CertificateRequestPkcs10();
objPkcs10.InitializeFromPublicKeyTemplate(
X509CertificateEnrollmentContext.ContextUser,
pk, objPolicyServer,
template);
The above code doesn't work!上面的代码不起作用! need to convert that pk to CX509PublicKey object.
需要将该 pk 转换为 CX509PublicKey 对象。 Please Help!
请帮忙!
PublicKey将例如 base64 作为输入。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.