< Back

Test-X509Certificate

Sat Jan 18, 2020 9:33 pm

NAME Test-X509Certificate



SYNOPSIS

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





SYNTAX

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





DESCRIPTION

The Test-X509Certificate cmdlet performs a X.509 chain validation using basic validation policy.



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

IsValid boolean of True or False.





PARAMETERS

-Certificate <X509Certificate2>

Specifies the X509Certificate2 object type for certificate 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 msn.com | Test-X509Certificate



Thumbprint IsValid

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

EB5DC974F9AA001BFAC09F792B3A8C41C3874B63 True



This command gets the certificate from msn.com website domain name and pipelining to Test-X509Certificate cmdlet

to perform a X.509 chain basic validation test.



RELATED LINKS

X509Certificate2.Verify Method https://docs.microsoft.com/en-gb/dotnet ... 509certifi

cates.x509certificate2.verify?view=netcore-2.0