< Back

Test-X509CertificateChain

Sat Jan 18, 2020 9:33 pm

NAME Test-X509CertificateChain



SYNOPSIS

Test the certificate X.509 chain using comprehensive validation policy.





SYNTAX

Test-X509CertificateChain [-Certificate] <X509Certificate2> [-Confirm] [-WhatIf] [<CommonParameters>]





DESCRIPTION

The Test-X509CertificateChain cmdlet performs a X.509 chain validation using comprehensive validation policy. The

validation test will apply the validation policy during the rebuild of the certificate chain.



The execution of X.509 chain validation using comprehensive validation policy will returns a PSObject containing

chain element status information if an issue is found. If no issue is found, the cmdlet will not return any output.





PARAMETERS

-Certificate <X509Certificate2>

Specifies the X509Certificate2 object type for certificate chain testing.



Required? true

Position? 0

Default value None

Accept pipeline input? True (ByPropertyName, ByValue)

Accept wildcard characters? false



-Confirm [<SwitchParameter>]

Prompts you for confirmation before running the cmdlet.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-WhatIf [<SwitchParameter>]

Shows what would happen if the cmdlet runs. The cmdlet is not run.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

System.Security.Cryptography.X509Certificates.X509Certificate2







OUTPUTS

System.Management.Automation.PSObject







NOTES





Author : Ryen Kia Zhi Tang



Blog : ryentang.wordpress.com (http://ryentang.wordpress.com/)



Example 1



PS C:\\> Get-X509Certificate -U https://untrusted-root.badssl.com/ | Test-X509CertificateChain07FBE8F4AA7".



Thumbprint Status Information



---------- ------ -----------



4F4806AA4CB2980DA19F1B8EF84B607FBE8F4AA7 PartialChain One or more certificates required to validate this

certificate cannot be found.



This command gets the certificate from untrusted-root.badssl.com website sub-domain name and pipelining to

Test-X509CertificateChain cmdlet to perform a X.509 chain comprehensive validation test.



RELATED LINKS

X509ChainPolicy Class https://docs.microsoft.com/en-gb/dotnet ... icates.x50

9chainpolicy?view=netcore-2.0

X509ChainStatus Structure https://docs.microsoft.com/en-gb/dotnet ... rtificates

.x509chainstatus?view=netcore-2.0

X509Chain.Build Method https://docs.microsoft.com/en-gb/dotnet ... ficates.x5

09chain.build?view=netcore-2.0