X509ChainPolicy.ApplicationPolicy 속성
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
인증서가 지원해야 하는 애플리케이션 정책이나 EKU(Enhanced Key Usage)를 지정하는 OID(개체 식별자) 컬렉션을 가져옵니다.
public:
property System::Security::Cryptography::OidCollection ^ ApplicationPolicy { System::Security::Cryptography::OidCollection ^ get(); };
public System.Security.Cryptography.OidCollection ApplicationPolicy { get; }
member this.ApplicationPolicy : System.Security.Cryptography.OidCollection
Public ReadOnly Property ApplicationPolicy As OidCollection
속성 값
OidCollection 개체입니다.
예제
다음 예제에서는 현재 사용자의 개인 인증서 저장소를 열고, 사용자가 인증서를 선택할 수 있도록 한 다음, 인증서 및 인증서 체인 정보를 콘솔에 씁니다. 출력은 선택한 인증서에 따라 달라집니다.
//Output chain information of the selected certificate.
X509Chain ^ ch = gcnew X509Chain;
ch->ChainPolicy->RevocationMode = X509RevocationMode::Online;
ch->Build( certificate );
Console::WriteLine( "Chain Information" );
Console::WriteLine( "Chain revocation flag: {0}", ch->ChainPolicy->RevocationFlag );
Console::WriteLine( "Chain revocation mode: {0}", ch->ChainPolicy->RevocationMode );
Console::WriteLine( "Chain verification flag: {0}", ch->ChainPolicy->VerificationFlags );
Console::WriteLine( "Chain verification time: {0}", ch->ChainPolicy->VerificationTime );
Console::WriteLine( "Chain status length: {0}", ch->ChainStatus->Length );
Console::WriteLine( "Chain application policy count: {0}", ch->ChainPolicy->ApplicationPolicy->Count );
Console::WriteLine( "Chain certificate policy count: {0} {1}", ch->ChainPolicy->CertificatePolicy->Count, Environment::NewLine );
//Output chain information of the selected certificate.
X509Chain ch = new X509Chain();
ch.ChainPolicy.RevocationMode = X509RevocationMode.Online;
ch.Build (certificate);
Console.WriteLine ("Chain Information");
Console.WriteLine ("Chain revocation flag: {0}", ch.ChainPolicy.RevocationFlag);
Console.WriteLine ("Chain revocation mode: {0}", ch.ChainPolicy.RevocationMode);
Console.WriteLine ("Chain verification flag: {0}", ch.ChainPolicy.VerificationFlags);
Console.WriteLine ("Chain verification time: {0}", ch.ChainPolicy.VerificationTime);
Console.WriteLine ("Chain status length: {0}", ch.ChainStatus.Length);
Console.WriteLine ("Chain application policy count: {0}", ch.ChainPolicy.ApplicationPolicy.Count);
Console.WriteLine ("Chain certificate policy count: {0} {1}", ch.ChainPolicy.CertificatePolicy.Count, Environment.NewLine);
'Output chain information of the selected certificate.
Dim ch As New X509Chain()
ch.ChainPolicy.RevocationMode = X509RevocationMode.Online
ch.Build(certificate)
Console.WriteLine("Chain Information")
Console.WriteLine("Chain revocation flag: {0}", ch.ChainPolicy.RevocationFlag)
Console.WriteLine("Chain revocation mode: {0}", ch.ChainPolicy.RevocationMode)
Console.WriteLine("Chain verification flag: {0}", ch.ChainPolicy.VerificationFlags)
Console.WriteLine("Chain verification time: {0}", ch.ChainPolicy.VerificationTime)
Console.WriteLine("Chain status length: {0}", ch.ChainStatus.Length)
Console.WriteLine("Chain application policy count: {0}", ch.ChainPolicy.ApplicationPolicy.Count)
Console.WriteLine("Chain certificate policy count: {0} {1}", ch.ChainPolicy.CertificatePolicy.Count, Environment.NewLine)
설명
기본적으로 이 컬렉션은 비어 있습니다. 다음 코드를 사용하여 컬렉션에 OID(개체 식별자)를 추가할 수 있습니다.
X509Chain^ ch = gcnew X509Chain();
ch->ChainPolicy->ApplicationPolicy->Add(gcnew Oid("1.2.1.1"));
X509Chain ch = new X509Chain();
ch.ChainPolicy.ApplicationPolicy.Add(new Oid("1.2.1.1"));
Dim ch As new X509Chain()
ch.ChainPolicy.ApplicationPolicy.Add(new Oid("1.2.1.1"))