Test-Certificate

업데이트 날짜: 2015년 9월

Test-Certificate

Verifies a certificate according to the input parameters.

구문

Parameter Set: Default
Test-Certificate [-Cert] <Certificate> [-AllowUntrustedRoot] [-DNSName <String> ] [-EKU <String[]> ] [-Policy <TestCertificatePolicy> {BASE | SSL | AUTHENTICODE | NTAUTH} ] [-User] [ <CommonParameters>]

자세한 설명

The Test-Certificate cmdlet verifies a certificate according to input parameters. The revocation status of the certificate is verified by default. If the AllowUntrustedRoot parameter is specified, then a certificate chain is built but an untrusted root is allowed. Other errors are still verified against in this case, such as expired. If the DNSName parameter is used, then the DNS subject alternative name is used to verify SSL policy. If the EKU parameter is used, then the specified application policy object identifiers are used to verify the chain. If the User parameter is used, then the specified user context is used is to build and verify the chain.

Delegation may be required when using this cmdlet with Windows PowerShell® remoting and changing user configuration.

매개 변수

-AllowUntrustedRoot

Specifies whether the root certificate is required to be trusted in chain building. When this parameter is used, the certificate chain is built but an untrusted root is allowed. Other errors are still verified against in this case, such as expired. If this parameter is not specified, then revocation status is checked by default.

별칭

none

필수 여부

false

위치

named

기본값

none

파이프라인 입력 허용 여부

false

와일드카드 문자 허용 여부

false

-Cert<Certificate>

Specifies the certificate to test. Either the certificate object or a path to the certificate in a certificate store can be specified.

별칭

PsPath

필수 여부

true

위치

1

기본값

none

파이프라인 입력 허용 여부

true (ByPropertyName)

와일드카드 문자 허용 여부

false

-DNSName<String>

Specifies the DNS name to verify as valid for the certificate.
If this parameter is specified but not the Policy parameter, then the CERT_CHAIN_POLICY_SSL policy is applied and the DNS name is validated for the certificate. If a CERT_CHAIN_POLICY_SSL policy does not exist, then the cmdlet will fail.
If this parameter is not used and the Policy parameter is not specified, the default CERT_CHAIN_POLICY_BASE policy is applied.

별칭

none

필수 여부

false

위치

named

기본값

none

파이프라인 입력 허용 여부

false

와일드카드 문자 허용 여부

false

-EKU<String[]>

Specifies a list of enhanced key usage (EKU) object identifiers to verify for the certificate chain.

별칭

none

필수 여부

false

위치

named

기본값

none

파이프라인 입력 허용 여부

false

와일드카드 문자 허용 여부

false

-Policy<TestCertificatePolicy>

Specifies the policies that will be applied to verify the certificate. 이 매개 변수에 허용되는 값은 다음과 같습니다. AUTHENTICODE, BASE, NTAUTH, and SSL. If this parameter is not specified, then the BASE policy is used.

별칭

none

필수 여부

false

위치

named

기본값

none

파이프라인 입력 허용 여부

false

와일드카드 문자 허용 여부

false

-User

Specifies whether the user or machine context is used to test the certificate. If this parameter is not specified, then the machine context is used.

별칭

none

필수 여부

false

위치

named

기본값

none

파이프라인 입력 허용 여부

false

와일드카드 문자 허용 여부

false

<CommonParameters>

이 cmdlet은 -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, -OutVariable 등의 일반 매개 변수를 지원합니다. 자세한 내용은 TechNet의 about_CommonParameters(https://go.microsoft.com/fwlink/p/?LinkID=113216)

입력

입력 형식은 cmdlet으로 파이프할 수 있는 개체의 형식입니다.

  • Microsoft.CertificateServices.Commands.Certificate

    The Certificate object can either be provided as a Path object to a certificate or an X509Certificate2 object.

출력

출력 형식은 cmdlet 실행 시 출력되는 개체의 형식입니다.

  • System.Boolean

    If the verification succeeds, then the return value is True; otherwise the return value is False.

EXAMPLE 1

This example verifies each certificate in the MY store of the local machine and verifies that it is valid for SSL with the DNS name specified.

PS C:\> Get-ChildItem -Path Cert:\localMachine\My | Test-Certificate -Policy SSL -DNSName "dns=contoso.com"

EXAMPLE 2

This example verifies that the provided EKU is valid for the specified certificate and its chain. Revocation checking is not performed.

PS C:\> Test-Certificate –Cert cert:\currentuser\my\191c46f680f08a9e6ef3f6783140f60a979c7d3b -AllowUntrustedRoot -EKU "1.3.6.1.5.5.7.3.1" –User

관련 항목

Get-ChildItem