[英]Key length not 128/192/256 bits
I am trying to encrypt the final mdm profile using the Identity certificate(got in the response after SCEP payload). 我正在尝试使用身份证书(在SCEP有效负载后的响应中得到)加密最终的mdm配置文件。 I have the following code: 我有以下代码:
context.Request.InputStream.CopyTo(deviceResponse);
var signer = new SignedCms();
signer.Decode(deviceResponse.ToArray());
X509Certificate2 certificate = signer.Certificates[0];
string str= sonething; //my final configuraton profile
encryptedProfile = AESEncryption(str, cerificate.GetPublicKeyString(), true, Encoding.Default, pkcs);
I got the exception: Key length not 128/192/256 bits. 我有一个例外:密钥长度不是128/192/256位。
How can I encrypt the final profile(I am using Bouncy Castle library)? 如何加密最终配置文件(我正在使用Bouncy Castle库)?
Regards 问候
Mag 马格
It seems like your "cerificate.GetPublicKeyString()" is not returning a key with the propper length (128/192/256 bits). 似乎您的“ cerificate.GetPublicKeyString()”未返回具有适当长度(128/192/256位)的键。 The minimum you need is 128 bits (16 bytes = 16 length). 您需要的最小值是128位(16个字节= 16个长度)。
This should not be AES encryption. 这不应该是AES加密。 It has to be CMSAlgorithm.DES_EDE3_CBC encrypted. 它必须是CMSAlgorithm.DES_EDE3_CBC加密的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.