Puede alguien me proporcione un ejemplo de cómo crear un certificado firmado, que sería aceptada por el siguiente código:Cómo utilizar makecert para crear un certificado X509 aceptado por la WCF
ServiceHost svh = new ServiceHost(typeof(MyClass));
var tcpbinding = new NetTcpBinding(SecurityMode.TransportWithMessageCredential, true);
//security
tcpbinding.Security.Message.ClientCredentialType = MessageCredentialType.UserName;
svh.Credentials.UserNameAuthentication.CustomUserNamePasswordValidator = new BWUserNamePasswordValidator();
svh.Credentials.UserNameAuthentication.UserNamePasswordValidationMode =UserNamePasswordValidationMode.Custom;
svh.Credentials.ServiceCertificate.Certificate = BookmarkWizSettings.TcpBindingCertificate;
....
svh.Open();
tengo utilizado
makecert -pe myCertificate
y
makecert -sv SignRoot.pvk -cy authority -r signroot.cer -a sha1 -n "CN=Dev Certification Authority" -ss my -sr localmachine
y
makecert -r -pe -n "CN=Client" -ss MyApp -sky Exchange
y he tratado de generar el certificado con BouncyCastle, pero cada vez que estoy poniendo siguiente excepción:
It is likely that certificate 'CN=Dev Certification Authority' may not have a
private key that is capable of key exchange or the process may not have access
rights for the private key. Please see inner exception for detail.
y la excepción interna es nula.
Es probable que haya un truco, pero no lo estoy obteniendo.
¿Cómo puedo generar un certificado adecuado para mi servicio WCF?
Tome un vistazo a esta forma de vincular. http://msdn.microsoft.com/en-us/library/ff648498.aspx –
Este enlace fue de lo más útil para configurar el mío. Recorre todos los pasos. http://www.codeproject.com/Articles/96028/WCF-Service-with-custom-username-password-authenti – vikingben