Key Size in RSA C# is not changing ! -
i generating key pair , store them in xml file using
toxmlstring(true);
i need set key size 2048 according msdn place constructor of rsacryptoserviceprovider
private void assignparameter(providertype providertype) { cspparameters cspparams; cspparams = new cspparameters((int)providertype); cspparams.keycontainername = rsaencryption.containername; cspparams.flags = cspproviderflags.usemachinekeystore; cspparams.providername = "microsoft strong cryptographic provider"; cspparams.keynumber = (int)keynumber.exchange; this.rsa = new rsacryptoserviceprovider(2048, cspparams); }
when check key size using
int x = this.rsa.keysize;
i 1024 whats wrong here??
i've seen before, try changing container name or try
using (this.rsa = new rsacryptoserviceprovider(2048, cspparams)) { }
or this.rsa.clear();
after done it.
if have container same name re-use container believe.
Comments
Post a Comment