Skip to content

Commit a0cd966

Browse files
committed
Add new overloads for VerifyCertificate
1 parent 410bb29 commit a0cd966

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

src/EasySign/Bundle.cs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,17 @@ public bool VerifyCertificate(string certificateHash, out X509ChainStatus[] stat
321321
return VerifyCertificate(certificate, out statuses, policy);
322322
}
323323

324+
/// <summary>
325+
/// Verifies the validity of a certificate using the specified certificate hash.
326+
/// </summary>
327+
/// <param name="certificateHash">The hash of the certificate to verify.</param>
328+
/// <param name="policy">The chain policy to use for verification.</param>
329+
/// <returns>True if the certificate is valid; otherwise, false.</returns>
330+
public bool VerifyCertificate(string certificateHash, X509ChainPolicy policy = null)
331+
{
332+
return VerifyCertificate(certificateHash, out _, policy);
333+
}
334+
324335
/// <summary>
325336
/// Verifies the validity of a certificate.
326337
/// </summary>
@@ -340,6 +351,17 @@ public bool VerifyCertificate(X509Certificate2 certificate, out X509ChainStatus[
340351
return isValid;
341352
}
342353

354+
/// <summary>
355+
/// Verifies the validity of a certificate.
356+
/// </summary>
357+
/// <param name="certificate">The certificate to verify.</param>
358+
/// <param name="policy">The chain policy to use for verification.</param>
359+
/// <returns>True if the certificate is valid; otherwise, false.</returns>
360+
public bool VerifyCertificate(X509Certificate2 certificate, X509ChainPolicy policy = null)
361+
{
362+
return VerifyCertificate(certificate, out _, policy);
363+
}
364+
343365
/// <summary>
344366
/// Gets a certificate from the bundle using the specified certificate hash.
345367
/// </summary>

0 commit comments

Comments
 (0)