다음을 통해 공유


IChannelCredentials 인터페이스

정의

서비스 프록시에 특정 보안 기능을 설정할 수 있는 인터페이스입니다.

public interface class IChannelCredentials
[System.Runtime.InteropServices.Guid("181b448c-c17c-4b17-ac6d-06699b93198f")]
[System.Runtime.InteropServices.InterfaceType(System.Runtime.InteropServices.ComInterfaceType.InterfaceIsIDispatch)]
public interface IChannelCredentials
[<System.Runtime.InteropServices.Guid("181b448c-c17c-4b17-ac6d-06699b93198f")>]
[<System.Runtime.InteropServices.InterfaceType(System.Runtime.InteropServices.ComInterfaceType.InterfaceIsIDispatch)>]
type IChannelCredentials = interface
Public Interface IChannelCredentials
특성

예제

monString = "service:mexAddress=http://localhost:8000/ServiceModelSamples/Service?wsdl"  
    monString = monString + ", address=http://localhost:8000/ServiceModelSamples/Service"  
    monString = monString + ", binding=BasicHttpBinding_ICalculator, bindingNamespace=http://Microsoft.ServiceModel.Samples"  
    monString = monString + ", contract=ICalculator, contractNamespace=http://Microsoft.ServiceModel.Samples"  

    Set monikerProxy = GetObject(monString)  

    'Set the Service Certificate.  
    monikerProxy.ChannelCredentials.SetServiceCertificateAuthentication "CurrentUser", "NoCheck", "PeerOrChainTrust"  
    monikerProxy.ChannelCredentials.SetDefaultServiceCertificateFromStore "CurrentUser", "TrustedPeople", "FindBySubjectName", "localhost"  

    'Set the Client Certificate.  
    monikerProxy.ChannelCredentials.SetClientCertificateFromStoreByName "CN=client.com", "CurrentUser", "My"  
    MsgBox monikerProxy.Add(3, 4)  

설명

관리 되지 않는 클라이언트는 Windows Communication Foundation (WCF) 서비스에 액세스 하도록 "서비스" 모니커를 사용 합니다. 이러한 클라이언트는 COM 보안 모델 보다는 WCF 보안 모델은 적용 됩니다. IChannelCredentials 인터페이스는 채널 자격 증명을 지정하기 위해 제공됩니다. COM 모니커는 관리 되는 WCF 보안 개체 모델에 액세스할 수 없습니다 때문에 이것이 필요 합니다.

채널이 생성된 후에는 IChannelCredentials 인터페이스에서 메서드를 호출할 수 없습니다. 즉, Windows Communication Foundation (WCF)는 이미 열려 있는 채널의 보안 설정 변경를 지원 하지 않습니다. 서비스 모니커 클라이언트에 프록시가 할당되면 채널이 아직 생성되지 않은 것입니다. 따라서 클라이언트는 서비스 메서드를 호출하기 전에 IChannelCredentials 메서드를 호출해야 합니다. 서비스 메서드가 호출된 후에 클라이언트가 IChannelCredentials 메서드를 호출할 경우 RPC_E_TOO_LATE 예외가 throw됩니다.

메서드

SetClientCertificateFromFile(String, String, String)

파일에서 인증서를 검색하여 클라이언트 자격 증명에 추가합니다.

SetClientCertificateFromStore(String, String, String, Object)

인증서 저장소에서 인증서를 검색하여 클라이언트 자격 증명에 추가합니다.

SetClientCertificateFromStoreByName(String, String, String)

인증서 저장소에서 이름으로 인증서를 검색하여 클라이언트 자격 증명에 추가합니다.

SetDefaultServiceCertificateFromFile(String, String, String)

파일에서 인증서를 검색하여 서비스 자격 증명에 기본 인증서로 추가합니다.

SetDefaultServiceCertificateFromStore(String, String, String, Object)

인증서 저장소에서 인증서를 검색하여 서비스 자격 증명에 기본 인증서로 추가합니다.

SetDefaultServiceCertificateFromStoreByName(String, String, String)

인증서 저장소에서 이름으로 인증서를 검색하여 서비스 자격 증명에 기본 인증서로 추가합니다.

SetIssuedToken(String, String, String)

발급된 토큰에 대한 매개 변수를 설정합니다.

SetServiceCertificateAuthentication(String, String, String)

서비스 인증서 인증 매개 변수를 설정합니다.

SetUserNameCredential(String, String)

사용자 이름 자격 증명을 설정합니다.

SetWindowsCredential(String, String, String, Int32, Boolean)

Windows 자격 증명을 설정합니다.

적용 대상