ServiceCredentials Class
Configures a service credential. Use this class to specify the credential for the service such as an X.509 certificate. Also, use this class to specify the authentication model for various client credentials such as user name and password validation.
Assembly: System.ServiceModel (in System.ServiceModel.dll)
This class is used as a parameter in the BuildChannelListenerCore(Of TChannel) method, by methods of the ServiceCredentialsSecurityTokenManager, and is returned by the ServiceHostBase.Credentials property.
The following code shows how to override this class to implement custom service credentials.
public class MyServiceCredentials : ServiceCredentials { X509Certificate2 additionalCertificate; public MyServiceCredentials() { } protected MyServiceCredentials(MyServiceCredentials other) : base(other) { this.additionalCertificate = other.additionalCertificate; } public X509Certificate2 AdditionalCertificate { get { return this.additionalCertificate; } set { if (value == null) { throw new ArgumentNullException("value"); } this.additionalCertificate = value; } } public override SecurityTokenManager CreateSecurityTokenManager() { return base.CreateSecurityTokenManager(); } protected override ServiceCredentials CloneCore() { return new MyServiceCredentials(this); } }
System.ServiceModel.Security.SecurityCredentialsManager
System.ServiceModel.Description.ServiceCredentials
Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows CE, Windows Mobile for Smartphone, Windows Mobile for Pocket PC
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.