What is the difference between X509Certificate2 and X509Certificate in .NET?

后端 未结 4 739
走了就别回头了
走了就别回头了 2020-12-13 16:31

What is the difference between the two?

4条回答
  •  爱一瞬间的悲伤
    2020-12-13 17:37

    The x509Certificate was introduced in .NET v1.0/1.1 and was (comparatively) limited in its functionality. It can be used to get information about an existing certificate (valid dates, issuer, etc.). It had simple methods/operations (i.e. reading a cert from disk).

    The x509Certificate2 is a subclass of x509Certificate with additional functionality.

    • It represents an actual X509 certificate.
    • It was new in the .NET Framework v2.0.
    • This class gives you access to all the V2 and V3 properties (authority key identifier and key usage).
    • It supports loading a certificate from a certificate store.

提交回复
热议问题