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)  

설명

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

채널을 만든 후 인터페이스에서 메서드를 IChannelCredentials 호출하는 것은 합법적이지 않습니다. 이는 WCF(Windows Communication Foundation)가 이미 열려 있는 채널에서 보안 설정 변경을 지원하지 않기 때문입니다. 서비스 모니커 클라이언트가 프록시를 가져오면 채널이 아직 만들어지지 않습니다. 따라서 클라이언트는 서비스 메서드를 호출하기 전에 메서드를 호출 IChannelCredentials 해야 합니다. 서비스 메서드가 호출된 후 클라이언트가 메서드를 호출 IChannelCredentials 하면 예외 RPC_E_TOO_LATE throw됩니다.

메서드

Name Description
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 자격 증명을 설정합니다.

적용 대상