.NET使用OpenSSL生成的pem密钥文件【做电子商务的朋友可能需要】(3)
byte[] pemPrivateExponent = new byte[128];
Array.Copy(keyData, index , pemPrivateExponent, 0, 128);
index += 128;
index += ((int)keyData[index+1] == 64?2: 3);//279
byte[] pemPrime1 = new byte[64];
Array.Copy(keyData, index, pemPrime1, 0, 64);
index += 64;
index += ((int)keyData[index + 1] == 64 ? 2 : 3);//346
byte[] pemPrime2 = new byte[64];
Array.Copy(keyData, index , pemPrime2, 0, 64);
index += 64;
index += ((int)keyData[index + 1] == 64 ? 2 : 3);//412/413
byte[] pemExponent1 = new byte[64];
Array.Copy(keyData,index, pemExponent1, 0, 64);
index += 64;
index += ((int)keyData[index + 1] == 64 ? 2 : 3);//479/480
byte[] pemExponent2 = new byte[64];
Array.Copy(keyData, index, pemExponent2, 0, 64);
index += 64;
index += ((int)keyData[index + 1] == 64 ? 2 : 3);//545/546
byte[] pemCoefficient = new byte[64];
Array.Copy(keyData, index, pemCoefficient, 0, 64);
RSAParameters para = new RSAParameters();
para.Modulus = pemModulus;
para.Exponent = pemPublicExponent;
para.D = pemPrivateExponent;
para.P = pemPrime1;
para.Q = pemPrime2;
相关新闻>>
- 发表评论
-
- 最新评论 进入详细评论页>>
今日头条
更多>>您可能感兴趣的文章
- 用OpenXml在文档的尾部添加一个Rich Text Content Con
- ASP.NET之Gridview图解(1)
- Request.Cookies 和 Response.Cookies 的区别
- ASP.NET FormsAuthentication跨站点登录时绝对地址返
- 向Excel文档中嵌入VBA控件和UserForm并显示
- 使用ASP.NET MVC3+EF+Jquery制作文字直播系统(一
- Spring.Net学习系列一: 统一异常处理
- ASP.NET生成高质量缩略图通用函数(c#代码)
- 步步为营 SharePoint 开发学习笔记系列&nb
- ASP.net页面中请求远程Web站点



