X509CertificateRecipientClientCredential.SetDefaultCertificate 메서드
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
서비스에 사용할 기본 인증서를 지정합니다.
오버로드
| Name | Description |
|---|---|
| SetDefaultCertificate(String, StoreLocation, StoreName) |
서비스에 사용할 기본 인증서를 지정합니다. 인증서 기반 메시지 보안을 사용하는 바인딩의 경우 이 인증서는 서비스에 대한 메시지를 암호화하는 데 사용되며 클라이언트에 회신을 서명하는 데 서비스에서 사용해야 합니다. |
| SetDefaultCertificate(StoreLocation, StoreName, X509FindType, Object) |
서비스에 사용할 기본 인증서를 지정합니다. 인증서 기반 메시지 보안을 사용하는 바인딩의 경우 이 인증서는 서비스에 대한 메시지를 암호화하는 데 사용되며 클라이언트에 회신을 서명하는 데 서비스에서 사용해야 합니다. |
설명
이러한 메서드는 지정된 매개 변수와 일치하는 지정된 위치에 있는 저장소에서 인증서를 가져옵니다.
인증서 기반 메시지 보안을 사용하는 바인딩의 경우 이 인증서는 서비스에 대한 메시지를 암호화하는 데 사용되며 클라이언트에 회신을 서명하는 데 서비스에서 사용해야 합니다.
SetDefaultCertificate(String, StoreLocation, StoreName)
서비스에 사용할 기본 인증서를 지정합니다. 인증서 기반 메시지 보안을 사용하는 바인딩의 경우 이 인증서는 서비스에 대한 메시지를 암호화하는 데 사용되며 클라이언트에 회신을 서명하는 데 서비스에서 사용해야 합니다.
public:
void SetDefaultCertificate(System::String ^ subjectName, System::Security::Cryptography::X509Certificates::StoreLocation storeLocation, System::Security::Cryptography::X509Certificates::StoreName storeName);
public void SetDefaultCertificate(string subjectName, System.Security.Cryptography.X509Certificates.StoreLocation storeLocation, System.Security.Cryptography.X509Certificates.StoreName storeName);
member this.SetDefaultCertificate : string * System.Security.Cryptography.X509Certificates.StoreLocation * System.Security.Cryptography.X509Certificates.StoreName -> unit
Public Sub SetDefaultCertificate (subjectName As String, storeLocation As StoreLocation, storeName As StoreName)
매개 변수
- subjectName
- String
주체 고유 이름입니다.
- storeLocation
- StoreLocation
서비스에서 서비스 인증서를 가져오는 데 사용하는 인증서 저장소의 위치입니다.
- storeName
- StoreName
열 X.509 인증서 저장소의 이름입니다.
예외
subjectName은 null입니다.
자격 증명이 읽기 전용일 때 설정하려고 했습니다.
예제
다음 코드는 이 메서드를 사용하여 사용할 X.509 인증서를 지정합니다.
public void snippet23(CalculatorClient cc)
{
X509CertificateRecipientClientCredential rcc = cc.ClientCredentials.ServiceCertificate;
rcc.SetDefaultCertificate("http://fabrikam.com/sts",
StoreLocation.CurrentUser,
StoreName.TrustedPeople);
}
설명
이 메서드는 매개 변수와 일치하는 지정된 위치에 있는 저장소에서 인증서를 subjectName 가져옵니다.
값 storeLocation 은 열거형에 StoreLocation 포함됩니다.
LocalMachine: 로컬 컴퓨터에 할당된 인증서 저장소입니다.
CurrentUser: 현재 사용자가 사용하는 인증서 저장소(기본값)입니다.
애플리케이션이 시스템 계정으로 실행되는 경우 인증서는 일반적으로 .에 있습니다 LocalMachine. 애플리케이션이 사용자 계정으로 실행되는 경우 인증서는 일반적으로 .에 있습니다 CurrentUser.
값 storeName 은 열거형에 StoreName 포함됩니다.
적용 대상
SetDefaultCertificate(StoreLocation, StoreName, X509FindType, Object)
서비스에 사용할 기본 인증서를 지정합니다. 인증서 기반 메시지 보안을 사용하는 바인딩의 경우 이 인증서는 서비스에 대한 메시지를 암호화하는 데 사용되며 클라이언트에 회신을 서명하는 데 서비스에서 사용해야 합니다.
public:
void SetDefaultCertificate(System::Security::Cryptography::X509Certificates::StoreLocation storeLocation, System::Security::Cryptography::X509Certificates::StoreName storeName, System::Security::Cryptography::X509Certificates::X509FindType findType, System::Object ^ findValue);
public void SetDefaultCertificate(System.Security.Cryptography.X509Certificates.StoreLocation storeLocation, System.Security.Cryptography.X509Certificates.StoreName storeName, System.Security.Cryptography.X509Certificates.X509FindType findType, object findValue);
member this.SetDefaultCertificate : System.Security.Cryptography.X509Certificates.StoreLocation * System.Security.Cryptography.X509Certificates.StoreName * System.Security.Cryptography.X509Certificates.X509FindType * obj -> unit
Public Sub SetDefaultCertificate (storeLocation As StoreLocation, storeName As StoreName, findType As X509FindType, findValue As Object)
매개 변수
- storeLocation
- StoreLocation
서비스에서 서비스 인증서를 가져오는 데 사용하는 인증서 저장소의 위치입니다.
- storeName
- StoreName
열 X.509 인증서 저장소의 이름입니다.
- findType
- X509FindType
실행할 X.509 검색의 형식입니다.
- findValue
- Object
X.509 인증서 저장소에서 검색할 값입니다.
예외
findValue은 null입니다.
자격 증명이 읽기 전용일 때 설정하려고 했습니다.
예제
다음 코드는 이 메서드를 사용하여 사용할 X.509 인증서를 지정합니다.
public void snippet22(CalculatorClient cc)
{
X509CertificateRecipientClientCredential rcc = cc.ClientCredentials.ServiceCertificate;
rcc.SetDefaultCertificate(StoreLocation.CurrentUser,
StoreName.TrustedPeople,
X509FindType.FindBySubjectName,
"FabrikamSTS");
}
설명
이 메서드는 지정된 위치 및 매개 변수와 findType 일치하는 저장소에서 인증서를 findValue 가져옵니다.
값 storeLocation 은 열거형에 StoreLocation 포함됩니다.
LocalMachine: 로컬 컴퓨터에 할당된 인증서 저장소입니다.
CurrentUser: 현재 사용자가 사용하는 인증서 저장소(기본값)입니다.
애플리케이션이 시스템 계정으로 실행되는 경우 인증서는 일반적으로 .에 있습니다 LocalMachine. 애플리케이션이 사용자 계정으로 실행되는 경우 인증서는 일반적으로 .에 있습니다 CurrentUser.
값 storeName 은 열거형에 StoreName 포함됩니다.
값 findType 은 열거형에 X509FindType 포함됩니다.
가장 일반적으로 사용되는 열거형은 FindBySubjectName지정된 저장소에 있는 인증서의 주체 이름에 대해 대/소문자를 구분하지 않는 검색을 수행하는 열거형입니다. 이는 부정확한 검색일 수 있습니다. 조건과 일치하는 인증서 또는 여러 인증서를 찾을 InvalidOperationException 수 없으면 throw됩니다.