private void Common (int dwKeySize, CspParameters p)
{
// Microsoft RSA CSP can do between 384 and 16384 bits keypair
LegalKeySizesValue = new KeySizes [1];
LegalKeySizesValue [0] = new KeySizes (384, 16384, 8);
base.KeySize = dwKeySize;
rsa = new RSAManaged (KeySize);
rsa.KeyGenerated += new RSAManaged.KeyGeneratedEventHandler (OnKeyGenerated);
persistKey = (p != null);
if (p == null) {
p = new CspParameters (PROV_RSA_FULL);
#if NET_1_1
if (useMachineKeyStore)
p.Flags |= CspProviderFlags.UseMachineKeyStore;
#endif
store = new KeyPairPersistence (p);
// no need to load - it cannot exists
}
else {
store = new KeyPairPersistence (p);
store.Load ();
if (store.KeyValue != null) {
persisted = true;
this.FromXmlString (store.KeyValue);
}
}
}