Validates a certificate by walking the certificate chain for all trust anchor chain, validating the leaf certificate against the chain.

Namespace: NHINDirect.Agent
Assembly: nhinAgent (in nhinAgent.dll) Version: 1.0.0.0 (1.0.0.0)

Syntax

C#
public bool IsTrustedCertificate(
	X509Certificate2 certificate,
	X509Certificate2Collection anchors
)
Visual Basic
Public Function IsTrustedCertificate ( _
	certificate As X509Certificate2, _
	anchors As X509Certificate2Collection _
) As Boolean
Visual C++
public:
bool IsTrustedCertificate(
	X509Certificate2^ certificate, 
	X509Certificate2Collection^ anchors
)

Parameters

certificate
Type: System.Security.Cryptography.X509Certificates..::..X509Certificate2
The leaf X509Certificate2 to validate
anchors
Type: System.Security.Cryptography.X509Certificates..::..X509Certificate2Collection
The collection of certificates representing anchors or roots of trust.

Return Value

true if at least one anchor has a valid chain of certs that verify trust in the leaf certificate, false if no anchors validate trust in the leaf cert.

Remarks

Currently, all intermediate certificates must be stored in the system.

See Also