⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 validatecertificate.vb

📁 一个用于网络安全方面的SSL,TLS库.可以用来做FTPS, WEB Server等等d
💻 VB
字号:
imports System
imports Org.Mentalis.Security.Certificates

' <summary>
' This example shows how you can validate a certificate.
' </summary>
class ValidateCertificate
	public shared sub Main(args as string())
		Console.WriteLine("This example shows how you can validate a certificate.")
		' load the certificate from a file
		dim cert as Certificate = Certificate.CreateFromCerFile("client.cer")
		' build a certificate chain
		dim cc as CertificateChain = new CertificateChain(cert)
		' validate the chain
		dim status as CertificateStatus = cc.VerifyChain(nothing, AuthType.Client)
		' interpret the result
		if (status = CertificateStatus.ValidCertificate)
			Console.WriteLine("The certificate is valid.")
		else
			Console.WriteLine("The certificate is not valid [" + status.ToString() + "].")
		end if
	end sub
end class

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -