Hi
I am trying to encrypt a soap message using x509certificate, But i am
getting Error that
"Cannot find certificate and privat key for decryption". i am using the code
given by msdn
i am getting error at following place.

else if ((IsTokenForSigning) && (!cert.SupportsDigitalSignature ||
(cert.Key == null)))
{
MessageBox.Show("The certificate must support " + "digital
signatures and have a private key available.");
securityToken = null;
}
cert.key throwing an exception "Cannot find certificate and privat key for
decryption".
I have private key in another file having extension .key how can i import
this key for specific certificate to encrypt the message.

Please send me the solution as early as possible.