Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
3341 lines (3081 sloc) 246 KB
<Type Name="X509Certificate" FullName="System.Security.Cryptography.X509Certificates.X509Certificate">
<TypeSignature Language="C#" Value="public class X509Certificate : IDisposable, System.Runtime.Serialization.IDeserializationCallback, System.Runtime.Serialization.ISerializable" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi serializable beforefieldinit X509Certificate extends System.Object implements class System.IDisposable, class System.Runtime.Serialization.IDeserializationCallback, class System.Runtime.Serialization.ISerializable" />
<TypeSignature Language="DocId" Value="T:System.Security.Cryptography.X509Certificates.X509Certificate" />
<TypeSignature Language="VB.NET" Value="Public Class X509Certificate&#xA;Implements IDeserializationCallback, IDisposable, ISerializable" />
<TypeSignature Language="C++ CLI" Value="public ref class X509Certificate : IDisposable, System::Runtime::Serialization::IDeserializationCallback, System::Runtime::Serialization::ISerializable" />
<TypeSignature Language="F#" Value="type X509Certificate = class&#xA; interface IDeserializationCallback&#xA; interface ISerializable&#xA; interface IDisposable" />
<AssemblyInfo>
<AssemblyName>System.Security.Cryptography.X509Certificates</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Base>
<BaseTypeName>System.Object</BaseTypeName>
</Base>
<Interfaces>
<Interface>
<InterfaceName>System.IDisposable</InterfaceName>
</Interface>
<Interface>
<InterfaceName>System.Runtime.Serialization.IDeserializationCallback</InterfaceName>
</Interface>
<Interface>
<InterfaceName>System.Runtime.Serialization.ISerializable</InterfaceName>
</Interface>
</Interfaces>
<Attributes>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netframework-4.8">
<AttributeName>System.Runtime.InteropServices.ComVisible(true)</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-1.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0">
<AttributeName>System.Serializable</AttributeName>
</Attribute>
</Attributes>
<Docs>
<summary>Provides methods that help you use X.509 v.3 certificates.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
ASN.1 DER is the only certificate format supported by this class.
For most scenarios, you should use the <xref:System.Security.Cryptography.X509Certificates.X509Certificate2> class instead.
> [!IMPORTANT]
> Starting with the [!INCLUDE[net_v46](~/includes/net-v46-md.md)], this type implements the <xref:System.IDisposable> interface. When you have finished using the type, you should dispose of it either directly or indirectly. To dispose of the type directly, call its <xref:System.IDisposable.Dispose%2A> method in a `try`/`catch` block. To dispose of it indirectly, use a language construct such as `using` (in C#) or `Using` (in Visual Basic). For more information, see the "Using an Object that Implements IDisposable" section in the <xref:System.IDisposable> interface topic.
>
> For apps that target the [!INCLUDE[net_v452](~/includes/net-v452-md.md)] and earlier versions, the <xref:System.Security.Cryptography.X509Certificates.X509Certificate> class does not implement the <xref:System.IDisposable> interface and therefore does not have a `Dispose` method.
## Examples
The following example loads an X.509 certificate from a file, calls the <xref:System.Security.Cryptography.X509Certificates.X509Certificate.ToString%2A> method, and displays the results to the console.
[!code-cpp[Cryptography.X509Certificates.X509Certificate#1](~/samples/snippets/cpp/VS_Snippets_CLR/Cryptography.X509Certificates.X509Certificate/CPP/example.cpp#1)]
[!code-csharp[Cryptography.X509Certificates.X509Certificate#1](~/samples/snippets/csharp/VS_Snippets_CLR/Cryptography.X509Certificates.X509Certificate/CS/example.cs#1)]
[!code-vb[Cryptography.X509Certificates.X509Certificate#1](~/samples/snippets/visualbasic/VS_Snippets_CLR/Cryptography.X509Certificates.X509Certificate/VB/example.vb#1)]
]]></format>
</remarks>
</Docs>
<Members>
<MemberGroup MemberName=".ctor">
<AssemblyInfo>
<AssemblyName>System.Security.Cryptography.X509Certificates</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.X509Certificates.X509Certificate" /> class.</summary>
</Docs>
</MemberGroup>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public X509Certificate ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Security.Cryptography.X509Certificates.X509Certificate.#ctor" />
<MemberSignature Language="VB.NET" Value="Public Sub New ()" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; X509Certificate();" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Security.Cryptography.X509Certificates</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters />
<Docs>
<summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.X509Certificates.X509Certificate" /> class.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
ASN.1 DER is the only certificate format supported by this class.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public X509Certificate (byte[] data);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(unsigned int8[] data) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Security.Cryptography.X509Certificates.X509Certificate.#ctor(System.Byte[])" />
<MemberSignature Language="VB.NET" Value="Public Sub New (data As Byte())" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; X509Certificate(cli::array &lt;System::Byte&gt; ^ data);" />
<MemberSignature Language="F#" Value="new System.Security.Cryptography.X509Certificates.X509Certificate : byte[] -&gt; System.Security.Cryptography.X509Certificates.X509Certificate" Usage="new System.Security.Cryptography.X509Certificates.X509Certificate data" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Security.Cryptography.X509Certificates</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters>
<Parameter Name="data" Type="System.Byte[]" />
</Parameters>
<Docs>
<param name="data">A byte array containing data from an X.509 certificate.</param>
<summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.X509Certificates.X509Certificate" /> class defined from a sequence of bytes representing an X.509v3 certificate.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
ASN.1 DER is the only certificate format supported by this class.
If you create an <xref:System.Security.Cryptography.X509Certificates.X509Certificate> certificate by specifying a PKCS7 signed file store for `data`, the <xref:System.Security.Cryptography.X509Certificates.X509Certificate> is created for the certificate that signed the store rather than for any of the certificates within the store.
## Examples
The following example loads an X.509 certificate file into an <xref:System.Security.Cryptography.X509Certificates.X509Certificate> object, exports the certificate as a byte array, and then imports the byte array into another <xref:System.Security.Cryptography.X509Certificates.X509Certificate> object.
[!code-cpp[Cryptography.X509Certificates.X509Certificate.Import-Export#1](~/samples/snippets/cpp/VS_Snippets_CLR/Cryptography.X509Certificates.X509Certificate.Import-Export/CPP/sample.cpp#1)]
[!code-csharp[Cryptography.X509Certificates.X509Certificate.Import-Export#1](~/samples/snippets/csharp/VS_Snippets_CLR/Cryptography.X509Certificates.X509Certificate.Import-Export/CS/sample.cs#1)]
[!code-vb[Cryptography.X509Certificates.X509Certificate.Import-Export#1](~/samples/snippets/visualbasic/VS_Snippets_CLR/Cryptography.X509Certificates.X509Certificate.Import-Export/VB/sample.vb#1)]
]]></format>
</remarks>
<exception cref="T:System.Security.Cryptography.CryptographicException">An error with the certificate occurs. For example:
- The certificate file does not exist.
- The certificate is invalid.
- The certificate's password is incorrect.</exception>
<exception cref="T:System.ArgumentException">The <paramref name="rawData" /> parameter is <see langword="null" />.
-or-
The length of the <paramref name="rawData" /> parameter is 0.</exception>
<permission cref="T:System.Security.Permissions.KeyContainerPermission">for permission to create a key container. Security action: <see cref="F:System.Security.Permissions.SecurityAction.Demand" />. Associated enumeration: <see cref="F:System.Security.Permissions.KeyContainerPermissionFlags.Create" /></permission>
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public X509Certificate (IntPtr handle);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(native int handle) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Security.Cryptography.X509Certificates.X509Certificate.#ctor(System.IntPtr)" />
<MemberSignature Language="VB.NET" Value="Public Sub New (handle As IntPtr)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; X509Certificate(IntPtr handle);" />
<MemberSignature Language="F#" Value="new System.Security.Cryptography.X509Certificates.X509Certificate : nativeint -&gt; System.Security.Cryptography.X509Certificates.X509Certificate" Usage="new System.Security.Cryptography.X509Certificates.X509Certificate handle" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Security.Cryptography.X509Certificates</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netcore-1.0;netcore-1.1;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netstandard-1.3;netstandard-1.4;netstandard-1.6;netframework-4.8">
<AttributeName>System.Security.SecurityCritical</AttributeName>
</Attribute>
</Attributes>
<Parameters>
<Parameter Name="handle" Type="System.IntPtr" />
</Parameters>
<Docs>
<param name="handle">A handle to an unmanaged <see langword="PCCERT_CONTEXT" /> structure.</param>
<summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.X509Certificates.X509Certificate" /> class using a handle to an unmanaged <see langword="PCCERT_CONTEXT" /> structure.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This constructor creates a new <xref:System.Security.Cryptography.X509Certificates.X509Certificate> object using a handle for the Microsoft Cryptographic API certificate context, `PCCERT_CONTEXT`.
> [!IMPORTANT]
> This constructor creates a copy of the certificate context. Do not assume that the context structure you passed to the constructor is valid; it may have been released. You can get a copy of the current `PCCERT_CONTEXT` structure from the <xref:System.Security.Cryptography.X509Certificates.X509Certificate.Handle%2A> property, but it is valid only during the lifetime of the <xref:System.Security.Cryptography.X509Certificates.X509Certificate> object.
]]></format>
</remarks>
<exception cref="T:System.Security.Cryptography.CryptographicException">An error with the certificate occurs. For example:
- The certificate file does not exist.
- The certificate is invalid.
- The certificate's password is incorrect.</exception>
<exception cref="T:System.ArgumentException">The handle parameter does not represent a valid <see langword="PCCERT_CONTEXT" /> structure.</exception>
<permission cref="T:System.Security.SecurityCriticalAttribute">requires full trust for the immediate caller. This class cannot be used by partially trusted or transparent code.</permission>
<permission cref="F:System.Security.Permissions.SecurityAction.InheritanceDemand">for the ability of inheritors to execute unmanaged code. Associated enumeration: <see cref="F:System.Security.Permissions.SecurityPermissionFlag.UnmanagedCode" /></permission>
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public X509Certificate (System.Security.Cryptography.X509Certificates.X509Certificate cert);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(class System.Security.Cryptography.X509Certificates.X509Certificate cert) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Security.Cryptography.X509Certificates.X509Certificate.#ctor(System.Security.Cryptography.X509Certificates.X509Certificate)" />
<MemberSignature Language="VB.NET" Value="Public Sub New (cert As X509Certificate)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; X509Certificate(System::Security::Cryptography::X509Certificates::X509Certificate ^ cert);" />
<MemberSignature Language="F#" Value="new System.Security.Cryptography.X509Certificates.X509Certificate : System.Security.Cryptography.X509Certificates.X509Certificate -&gt; System.Security.Cryptography.X509Certificates.X509Certificate" Usage="new System.Security.Cryptography.X509Certificates.X509Certificate cert" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Security.Cryptography.X509Certificates</AssemblyName>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8">
<AttributeName>System.Security.SecuritySafeCritical</AttributeName>
</Attribute>
</Attributes>
<Parameters>
<Parameter Name="cert" Type="System.Security.Cryptography.X509Certificates.X509Certificate" Index="0" FrameworkAlternate="netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-1.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netstandard-2.1" />
</Parameters>
<Docs>
<param name="cert">A <see cref="T:System.Security.Cryptography.X509Certificates.X509Certificate" /> class from which to initialize this class.</param>
<summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.X509Certificates.X509Certificate" /> class using another <see cref="T:System.Security.Cryptography.X509Certificates.X509Certificate" /> class.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
ASN.1 DER is the only certificate format supported by this class.
]]></format>
</remarks>
<exception cref="T:System.Security.Cryptography.CryptographicException">An error with the certificate occurs. For example:
- The certificate file does not exist.
- The certificate is invalid.
- The certificate's password is incorrect.</exception>
<exception cref="T:System.ArgumentNullException">The value of the <paramref name="cert" /> parameter is <see langword="null" />.</exception>
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public X509Certificate (string fileName);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(string fileName) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Security.Cryptography.X509Certificates.X509Certificate.#ctor(System.String)" />
<MemberSignature Language="VB.NET" Value="Public Sub New (fileName As String)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; X509Certificate(System::String ^ fileName);" />
<MemberSignature Language="F#" Value="new System.Security.Cryptography.X509Certificates.X509Certificate : string -&gt; System.Security.Cryptography.X509Certificates.X509Certificate" Usage="new System.Security.Cryptography.X509Certificates.X509Certificate fileName" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Security.Cryptography.X509Certificates</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8">
<AttributeName>System.Security.SecuritySafeCritical</AttributeName>
</Attribute>
</Attributes>
<Parameters>
<Parameter Name="fileName" Type="System.String" Index="0" FrameworkAlternate="netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-1.3;netstandard-1.4;netstandard-1.6;netstandard-2.0;netstandard-2.1;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
</Parameters>
<Docs>
<param name="fileName">The name of a PKCS7 signed file.</param>
<summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.X509Certificates.X509Certificate" /> class using the name of a PKCS7 signed file.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
ASN.1 DER is the only certificate format supported by this class.
If you create an <xref:System.Security.Cryptography.X509Certificates.X509Certificate> certificate by specifying a PKCS7 signed file store for `fileName`, the <xref:System.Security.Cryptography.X509Certificates.X509Certificate> is created for the certificate that signed the store rather than for any of the certificates within the store.
## Examples
The following example loads an X.509 certificate from a file, calls the <xref:System.Security.Cryptography.X509Certificates.X509Certificate.ToString%2A> method, and displays the results to the console.
[!code-cpp[Cryptography.X509Certificates.X509Certificate#1](~/samples/snippets/cpp/VS_Snippets_CLR/Cryptography.X509Certificates.X509Certificate/CPP/example.cpp#1)]
[!code-csharp[Cryptography.X509Certificates.X509Certificate#1](~/samples/snippets/csharp/VS_Snippets_CLR/Cryptography.X509Certificates.X509Certificate/CS/example.cs#1)]
[!code-vb[Cryptography.X509Certificates.X509Certificate#1](~/samples/snippets/visualbasic/VS_Snippets_CLR/Cryptography.X509Certificates.X509Certificate/VB/example.vb#1)]
]]></format>
</remarks>
<exception cref="T:System.Security.Cryptography.CryptographicException">An error with the certificate occurs. For example:
- The certificate file does not exist.
- The certificate is invalid.
- The certificate's password is incorrect.</exception>
<exception cref="T:System.ArgumentException">The <paramref name="fileName" /> parameter is <see langword="null" />.</exception>
<permission cref="T:System.Security.Permissions.FileIOPermission">for permission to read the file described by the <paramref name="fileName" /> parameter. Security action: <see cref="F:System.Security.Permissions.SecurityAction.Demand" />. Associated enumeration: <see cref="F:System.Security.Permissions.EnvironmentPermissionAccess.Read" /></permission>
<permission cref="T:System.Security.Permissions.KeyContainerPermission">for permission to create a key container. Security action: <see cref="F:System.Security.Permissions.SecurityAction.Demand" />. Associated enumeration: <see cref="F:System.Security.Permissions.KeyContainerPermissionFlags.Create" /></permission>
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public X509Certificate (byte[] rawData, System.Security.SecureString password);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(unsigned int8[] rawData, class System.Security.SecureString password) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Security.Cryptography.X509Certificates.X509Certificate.#ctor(System.Byte[],System.Security.SecureString)" />
<MemberSignature Language="VB.NET" Value="Public Sub New (rawData As Byte(), password As SecureString)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; X509Certificate(cli::array &lt;System::Byte&gt; ^ rawData, System::Security::SecureString ^ password);" />
<MemberSignature Language="F#" Value="new System.Security.Cryptography.X509Certificates.X509Certificate : byte[] * System.Security.SecureString -&gt; System.Security.Cryptography.X509Certificates.X509Certificate" Usage="new System.Security.Cryptography.X509Certificates.X509Certificate (rawData, password)" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Security.Cryptography.X509Certificates</AssemblyName>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netstandard-2.1">
<AttributeName>System.CLSCompliant(false)</AttributeName>
</Attribute>
</Attributes>
<Parameters>
<Parameter Name="rawData" Type="System.Byte[]" Index="0" FrameworkAlternate="netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netstandard-2.1" />
<Parameter Name="password" Type="System.Security.SecureString" Index="1" FrameworkAlternate="netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netstandard-2.1" />
</Parameters>
<Docs>
<param name="rawData">A byte array that contains data from an X.509 certificate.</param>
<param name="password">The password required to access the X.509 certificate data.</param>
<summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.X509Certificates.X509Certificate" /> class using a byte array and a password.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
ASN.1 DER is the only certificate format supported by this class.
> [!IMPORTANT]
> Never hard code a password within your source code. Hard-coded passwords can be retrieved from an assembly using the [Ildasm.exe (IL Disassembler)](~/docs/framework/tools/ildasm-exe-il-disassembler.md), a hex editor, or by simply opening the assembly in a text editor such as Notepad.exe.
If you create an <xref:System.Security.Cryptography.X509Certificates.X509Certificate> certificate by specifying a PKCS7 signed file store for `rawData`, the <xref:System.Security.Cryptography.X509Certificates.X509Certificate> is created for the certificate that signed the store rather than for any of the certificates within the store.
]]></format>
</remarks>
<exception cref="T:System.Security.Cryptography.CryptographicException">An error with the certificate occurs. For example:
- The certificate file does not exist.
- The certificate is invalid.
- The certificate's password is incorrect.</exception>
<exception cref="T:System.ArgumentException">The <paramref name="rawData" /> parameter is <see langword="null" />.
-or-
The length of the <paramref name="rawData" /> parameter is 0.</exception>
<permission cref="T:System.Security.Permissions.SecurityPermission">for the ability to call unmanaged code. Security action: <see cref="F:System.Security.Permissions.SecurityAction.Demand" />. Associated enumeration: <see cref="F:System.Security.Permissions.SecurityPermissionFlag.UnmanagedCode" /></permission>
<permission cref="T:System.Security.Permissions.KeyContainerPermission">for permission to create a key container. Security action: <see cref="F:System.Security.Permissions.SecurityAction.Demand" />. Associated enumeration: <see cref="F:System.Security.Permissions.KeyContainerPermissionFlags.Create" /></permission>
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public X509Certificate (byte[] rawData, string password);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(unsigned int8[] rawData, string password) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Security.Cryptography.X509Certificates.X509Certificate.#ctor(System.Byte[],System.String)" />
<MemberSignature Language="VB.NET" Value="Public Sub New (rawData As Byte(), password As String)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; X509Certificate(cli::array &lt;System::Byte&gt; ^ rawData, System::String ^ password);" />
<MemberSignature Language="F#" Value="new System.Security.Cryptography.X509Certificates.X509Certificate : byte[] * string -&gt; System.Security.Cryptography.X509Certificates.X509Certificate" Usage="new System.Security.Cryptography.X509Certificates.X509Certificate (rawData, password)" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Security.Cryptography.X509Certificates</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters>
<Parameter Name="rawData" Type="System.Byte[]" Index="0" FrameworkAlternate="netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-1.3;netstandard-1.4;netstandard-1.6;netstandard-2.0;netstandard-2.1;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
<Parameter Name="password" Type="System.String" Index="1" FrameworkAlternate="netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-1.3;netstandard-1.4;netstandard-1.6;netstandard-2.0;netstandard-2.1;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
</Parameters>
<Docs>
<param name="rawData">A byte array containing data from an X.509 certificate.</param>
<param name="password">The password required to access the X.509 certificate data.</param>
<summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.X509Certificates.X509Certificate" /> class using a byte array and a password.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
ASN.1 DER is the only certificate format supported by this class.
> [!IMPORTANT]
> Never hard code a password within your source code. Hard-coded passwords can be retrieved from an assembly using the [Ildasm.exe (IL Disassembler)](~/docs/framework/tools/ildasm-exe-il-disassembler.md), a hex editor, or by simply opening the assembly in a text editor such as Notepad.exe.
If you create an <xref:System.Security.Cryptography.X509Certificates.X509Certificate> certificate by specifying a PKCS7 signed file store for `rawData`, the <xref:System.Security.Cryptography.X509Certificates.X509Certificate> is created for the certificate that signed the store rather than for any of the certificates within the store.
]]></format>
</remarks>
<exception cref="T:System.Security.Cryptography.CryptographicException">An error with the certificate occurs. For example:
- The certificate file does not exist.
- The certificate is invalid.
- The certificate's password is incorrect.</exception>
<exception cref="T:System.ArgumentException">The <paramref name="rawData" /> parameter is <see langword="null" />.
-or-
The length of the <paramref name="rawData" /> parameter is 0.</exception>
<permission cref="T:System.Security.Permissions.SecurityPermission">for the ability to call unmanaged code. Security action: <see cref="F:System.Security.Permissions.SecurityAction.Demand" />. Associated enumeration: <see cref="F:System.Security.Permissions.SecurityPermissionFlag.UnmanagedCode" /></permission>
<permission cref="T:System.Security.Permissions.KeyContainerPermission">for permission to create a key container. Security action: <see cref="F:System.Security.Permissions.SecurityAction.Demand" />. Associated enumeration: <see cref="F:System.Security.Permissions.KeyContainerPermissionFlags.Create" /></permission>
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public X509Certificate (System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(class System.Runtime.Serialization.SerializationInfo info, valuetype System.Runtime.Serialization.StreamingContext context) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Security.Cryptography.X509Certificates.X509Certificate.#ctor(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)" />
<MemberSignature Language="VB.NET" Value="Public Sub New (info As SerializationInfo, context As StreamingContext)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; X509Certificate(System::Runtime::Serialization::SerializationInfo ^ info, System::Runtime::Serialization::StreamingContext context);" />
<MemberSignature Language="F#" Value="new System.Security.Cryptography.X509Certificates.X509Certificate : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -&gt; System.Security.Cryptography.X509Certificates.X509Certificate" Usage="new System.Security.Cryptography.X509Certificates.X509Certificate (info, context)" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Security.Cryptography.X509Certificates</AssemblyName>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<Parameters>
<Parameter Name="info" Type="System.Runtime.Serialization.SerializationInfo" Index="0" FrameworkAlternate="netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netstandard-2.1" />
<Parameter Name="context" Type="System.Runtime.Serialization.StreamingContext" Index="1" FrameworkAlternate="netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netstandard-2.1" />
</Parameters>
<Docs>
<param name="info">A <see cref="T:System.Runtime.Serialization.SerializationInfo" /> object that describes serialization information.</param>
<param name="context">A <see cref="T:System.Runtime.Serialization.StreamingContext" /> structure that describes how serialization should be performed.</param>
<summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.X509Certificates.X509Certificate" /> class using a <see cref="T:System.Runtime.Serialization.SerializationInfo" /> object and a <see cref="T:System.Runtime.Serialization.StreamingContext" /> structure.</summary>
<remarks>To be added.</remarks>
<exception cref="T:System.Security.Cryptography.CryptographicException">An error with the certificate occurs. For example:
- The certificate file does not exist.
- The certificate is invalid.
- The certificate's password is incorrect.</exception>
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public X509Certificate (string fileName, System.Security.SecureString password);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(string fileName, class System.Security.SecureString password) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Security.Cryptography.X509Certificates.X509Certificate.#ctor(System.String,System.Security.SecureString)" />
<MemberSignature Language="VB.NET" Value="Public Sub New (fileName As String, password As SecureString)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; X509Certificate(System::String ^ fileName, System::Security::SecureString ^ password);" />
<MemberSignature Language="F#" Value="new System.Security.Cryptography.X509Certificates.X509Certificate : string * System.Security.SecureString -&gt; System.Security.Cryptography.X509Certificates.X509Certificate" Usage="new System.Security.Cryptography.X509Certificates.X509Certificate (fileName, password)" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Security.Cryptography.X509Certificates</AssemblyName>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netstandard-2.1">
<AttributeName>System.CLSCompliant(false)</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8">
<AttributeName>System.Security.SecuritySafeCritical</AttributeName>
</Attribute>
</Attributes>
<Parameters>
<Parameter Name="fileName" Type="System.String" Index="0" FrameworkAlternate="netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netstandard-2.1" />
<Parameter Name="password" Type="System.Security.SecureString" Index="1" FrameworkAlternate="netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netstandard-2.1" />
</Parameters>
<Docs>
<param name="fileName">The name of a certificate file.</param>
<param name="password">The password required to access the X.509 certificate data.</param>
<summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.X509Certificates.X509Certificate" /> class using a certificate file name and a password.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
ASN.1 DER is the only certificate format supported by this class. Calling this constructor with the correct password decrypts the private key and saves it to a key container.
> [!IMPORTANT]
> Never hard code a password within your source code. Hard-coded passwords can be retrieved from an assembly using the [Ildasm.exe (IL Disassembler)](~/docs/framework/tools/ildasm-exe-il-disassembler.md), a hex editor, or by simply opening the assembly in a text editor such as Notepad.exe.
If you create an <xref:System.Security.Cryptography.X509Certificates.X509Certificate> certificate by specifying a PKCS7 signed file store for `fileName`, the <xref:System.Security.Cryptography.X509Certificates.X509Certificate> is created for the certificate that signed the store rather than for any of the certificates within the store.
]]></format>
</remarks>
<exception cref="T:System.Security.Cryptography.CryptographicException">An error with the certificate occurs. For example:
- The certificate file does not exist.
- The certificate is invalid.
- The certificate's password is incorrect.</exception>
<exception cref="T:System.ArgumentException">The <paramref name="fileName" /> parameter is <see langword="null" />.</exception>
<permission cref="T:System.Security.Permissions.FileIOPermission">for permission to read the file described by the <paramref name="fileName" /> parameter. Security action: <see cref="F:System.Security.Permissions.SecurityAction.Demand" />. Associated enumeration: <see cref="F:System.Security.Permissions.EnvironmentPermissionAccess.Read" /></permission>
<permission cref="T:System.Security.Permissions.KeyContainerPermission">for permission to create a key container. Security action: <see cref="F:System.Security.Permissions.SecurityAction.Demand" />. Associated enumeration: <see cref="F:System.Security.Permissions.KeyContainerPermissionFlags.Create" /></permission>
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public X509Certificate (string fileName, string password);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(string fileName, string password) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Security.Cryptography.X509Certificates.X509Certificate.#ctor(System.String,System.String)" />
<MemberSignature Language="VB.NET" Value="Public Sub New (fileName As String, password As String)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; X509Certificate(System::String ^ fileName, System::String ^ password);" />
<MemberSignature Language="F#" Value="new System.Security.Cryptography.X509Certificates.X509Certificate : string * string -&gt; System.Security.Cryptography.X509Certificates.X509Certificate" Usage="new System.Security.Cryptography.X509Certificates.X509Certificate (fileName, password)" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Security.Cryptography.X509Certificates</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8">
<AttributeName>System.Security.SecuritySafeCritical</AttributeName>
</Attribute>
</Attributes>
<Parameters>
<Parameter Name="fileName" Type="System.String" Index="0" FrameworkAlternate="netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-1.3;netstandard-1.4;netstandard-1.6;netstandard-2.0;netstandard-2.1;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
<Parameter Name="password" Type="System.String" Index="1" FrameworkAlternate="netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-1.3;netstandard-1.4;netstandard-1.6;netstandard-2.0;netstandard-2.1;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
</Parameters>
<Docs>
<param name="fileName">The name of a PKCS7 signed file.</param>
<param name="password">The password required to access the X.509 certificate data.</param>
<summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.X509Certificates.X509Certificate" /> class using the name of a PKCS7 signed file and a password to access the certificate.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
ASN.1 DER is the only certificate format supported by this class. Calling this constructor with the correct password decrypts the private key and saves it to a key container.
If you create an <xref:System.Security.Cryptography.X509Certificates.X509Certificate> certificate by specifying a PKCS7 signed file store for `fileName`, the <xref:System.Security.Cryptography.X509Certificates.X509Certificate> is created for the certificate that signed the store rather than for any of the certificates within the store.
]]></format>
</remarks>
<exception cref="T:System.Security.Cryptography.CryptographicException">An error with the certificate occurs. For example:
- The certificate file does not exist.
- The certificate is invalid.
- The certificate's password is incorrect.</exception>
<exception cref="T:System.ArgumentException">The <paramref name="fileName" /> parameter is <see langword="null" />.</exception>
<permission cref="T:System.Security.Permissions.FileIOPermission">for permission to read the file described by the <paramref name="fileName" /> parameter. Security action: <see cref="F:System.Security.Permissions.SecurityAction.Demand" />. Associated enumeration: <see cref="F:System.Security.Permissions.EnvironmentPermissionAccess.Read" /></permission>
<permission cref="T:System.Security.Permissions.KeyContainerPermission">for permission to create a key container. Security action: <see cref="F:System.Security.Permissions.SecurityAction.Demand" />. Associated enumeration: <see cref="F:System.Security.Permissions.KeyContainerPermissionFlags.Create" /></permission>
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public X509Certificate (byte[] rawData, System.Security.SecureString password, System.Security.Cryptography.X509Certificates.X509KeyStorageFlags keyStorageFlags);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(unsigned int8[] rawData, class System.Security.SecureString password, valuetype System.Security.Cryptography.X509Certificates.X509KeyStorageFlags keyStorageFlags) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Security.Cryptography.X509Certificates.X509Certificate.#ctor(System.Byte[],System.Security.SecureString,System.Security.Cryptography.X509Certificates.X509KeyStorageFlags)" />
<MemberSignature Language="VB.NET" Value="Public Sub New (rawData As Byte(), password As SecureString, keyStorageFlags As X509KeyStorageFlags)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; X509Certificate(cli::array &lt;System::Byte&gt; ^ rawData, System::Security::SecureString ^ password, System::Security::Cryptography::X509Certificates::X509KeyStorageFlags keyStorageFlags);" />
<MemberSignature Language="F#" Value="new System.Security.Cryptography.X509Certificates.X509Certificate : byte[] * System.Security.SecureString * System.Security.Cryptography.X509Certificates.X509KeyStorageFlags -&gt; System.Security.Cryptography.X509Certificates.X509Certificate" Usage="new System.Security.Cryptography.X509Certificates.X509Certificate (rawData, password, keyStorageFlags)" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Security.Cryptography.X509Certificates</AssemblyName>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netstandard-2.1">
<AttributeName>System.CLSCompliant(false)</AttributeName>
</Attribute>
</Attributes>
<Parameters>
<Parameter Name="rawData" Type="System.Byte[]" Index="0" FrameworkAlternate="netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netstandard-2.1" />
<Parameter Name="password" Type="System.Security.SecureString" Index="1" FrameworkAlternate="netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netstandard-2.1" />
<Parameter Name="keyStorageFlags" Type="System.Security.Cryptography.X509Certificates.X509KeyStorageFlags" Index="2" FrameworkAlternate="netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netstandard-2.1" />
</Parameters>
<Docs>
<param name="rawData">A byte array that contains data from an X.509 certificate.</param>
<param name="password">The password required to access the X.509 certificate data.</param>
<param name="keyStorageFlags">A bitwise combination of the enumeration values that control where and how to import the certificate.</param>
<summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.X509Certificates.X509Certificate" /> class using a byte array, a password, and a key storage flag.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Calling this constructor with the correct password decrypts the private key and saves it to a Microsoft Cryptographic API Cryptographic Service Provider (CSP).
ASN.1 DER is the only certificate format supported by this class.
> [!IMPORTANT]
> Never hard code a password within your source code. Hard-coded passwords can be retrieved from an assembly using the [Ildasm.exe (IL Disassembler)](~/docs/framework/tools/ildasm-exe-il-disassembler.md), a hex editor, or by simply opening the assembly in a text editor such as Notepad.exe.
If you create an <xref:System.Security.Cryptography.X509Certificates.X509Certificate> certificate by specifying a PKCS7 signed file store for `rawData`, the <xref:System.Security.Cryptography.X509Certificates.X509Certificate> is created for the certificate that signed the store rather than for any of the certificates within the store.
]]></format>
</remarks>
<exception cref="T:System.Security.Cryptography.CryptographicException">An error with the certificate occurs. For example:
- The certificate file does not exist.
- The certificate is invalid.
- The certificate's password is incorrect.</exception>
<exception cref="T:System.ArgumentException">The <paramref name="rawData" /> parameter is <see langword="null" />.
-or-
The length of the <paramref name="rawData" /> parameter is 0.</exception>
<permission cref="T:System.Security.Permissions.KeyContainerPermission">for permission to create a key container. Security action: <see cref="F:System.Security.Permissions.SecurityAction.Demand" />. Associated enumeration: <see cref="F:System.Security.Permissions.KeyContainerPermissionFlags.Create" /></permission>
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public X509Certificate (byte[] rawData, string password, System.Security.Cryptography.X509Certificates.X509KeyStorageFlags keyStorageFlags);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(unsigned int8[] rawData, string password, valuetype System.Security.Cryptography.X509Certificates.X509KeyStorageFlags keyStorageFlags) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Security.Cryptography.X509Certificates.X509Certificate.#ctor(System.Byte[],System.String,System.Security.Cryptography.X509Certificates.X509KeyStorageFlags)" />
<MemberSignature Language="VB.NET" Value="Public Sub New (rawData As Byte(), password As String, keyStorageFlags As X509KeyStorageFlags)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; X509Certificate(cli::array &lt;System::Byte&gt; ^ rawData, System::String ^ password, System::Security::Cryptography::X509Certificates::X509KeyStorageFlags keyStorageFlags);" />
<MemberSignature Language="F#" Value="new System.Security.Cryptography.X509Certificates.X509Certificate : byte[] * string * System.Security.Cryptography.X509Certificates.X509KeyStorageFlags -&gt; System.Security.Cryptography.X509Certificates.X509Certificate" Usage="new System.Security.Cryptography.X509Certificates.X509Certificate (rawData, password, keyStorageFlags)" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Security.Cryptography.X509Certificates</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters>
<Parameter Name="rawData" Type="System.Byte[]" Index="0" FrameworkAlternate="netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-1.3;netstandard-1.4;netstandard-1.6;netstandard-2.0;netstandard-2.1;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
<Parameter Name="password" Type="System.String" Index="1" FrameworkAlternate="netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-1.3;netstandard-1.4;netstandard-1.6;netstandard-2.0;netstandard-2.1;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
<Parameter Name="keyStorageFlags" Type="System.Security.Cryptography.X509Certificates.X509KeyStorageFlags" Index="2" FrameworkAlternate="netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-1.3;netstandard-1.4;netstandard-1.6;netstandard-2.0;netstandard-2.1;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
</Parameters>
<Docs>
<param name="rawData">A byte array containing data from an X.509 certificate.</param>
<param name="password">The password required to access the X.509 certificate data.</param>
<param name="keyStorageFlags">A bitwise combination of the enumeration values that control where and how to import the certificate.</param>
<summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.X509Certificates.X509Certificate" /> class using a byte array, a password, and a key storage flag.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This constructor creates a new <xref:System.Security.Cryptography.X509Certificates.X509Certificate> object using a byte array, a password that is needed to access the certificate data, and a key storage flag. Calling this constructor with the correct password decrypts the private key and saves it to a Microsoft Cryptographic API Cryptographic Service Provider (CSP).
The <xref:System.Security.Cryptography.X509Certificates.X509KeyStorageFlags> value can be used to control where and how the private key is imported.
ASN.1 DER is the only certificate format supported by this class.
> [!IMPORTANT]
> Never hard code a password within your source code. Hard-coded passwords can be retrieved from an assembly using the [Ildasm.exe (IL Disassembler)](~/docs/framework/tools/ildasm-exe-il-disassembler.md), a hex editor, or by simply opening the assembly in a text editor such as Notepad.exe.
If you create an <xref:System.Security.Cryptography.X509Certificates.X509Certificate> certificate by specifying a PKCS7 signed file store for `rawData`, the <xref:System.Security.Cryptography.X509Certificates.X509Certificate> is created for the certificate that signed the store rather than for any of the certificates within the store.
]]></format>
</remarks>
<exception cref="T:System.Security.Cryptography.CryptographicException">An error with the certificate occurs. For example:
- The certificate file does not exist.
- The certificate is invalid.
- The certificate's password is incorrect.</exception>
<exception cref="T:System.ArgumentException">The <paramref name="rawData" /> parameter is <see langword="null" />.
-or-
The length of the <paramref name="rawData" /> parameter is 0.</exception>
<permission cref="T:System.Security.Permissions.KeyContainerPermission">for permission to create a key container. Security action: <see cref="F:System.Security.Permissions.SecurityAction.Demand" />. Associated enumeration: <see cref="F:System.Security.Permissions.KeyContainerPermissionFlags.Create" /></permission>
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public X509Certificate (string fileName, System.Security.SecureString password, System.Security.Cryptography.X509Certificates.X509KeyStorageFlags keyStorageFlags);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(string fileName, class System.Security.SecureString password, valuetype System.Security.Cryptography.X509Certificates.X509KeyStorageFlags keyStorageFlags) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Security.Cryptography.X509Certificates.X509Certificate.#ctor(System.String,System.Security.SecureString,System.Security.Cryptography.X509Certificates.X509KeyStorageFlags)" />
<MemberSignature Language="VB.NET" Value="Public Sub New (fileName As String, password As SecureString, keyStorageFlags As X509KeyStorageFlags)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; X509Certificate(System::String ^ fileName, System::Security::SecureString ^ password, System::Security::Cryptography::X509Certificates::X509KeyStorageFlags keyStorageFlags);" />
<MemberSignature Language="F#" Value="new System.Security.Cryptography.X509Certificates.X509Certificate : string * System.Security.SecureString * System.Security.Cryptography.X509Certificates.X509KeyStorageFlags -&gt; System.Security.Cryptography.X509Certificates.X509Certificate" Usage="new System.Security.Cryptography.X509Certificates.X509Certificate (fileName, password, keyStorageFlags)" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Security.Cryptography.X509Certificates</AssemblyName>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netstandard-2.1">
<AttributeName>System.CLSCompliant(false)</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8">
<AttributeName>System.Security.SecuritySafeCritical</AttributeName>
</Attribute>
</Attributes>
<Parameters>
<Parameter Name="fileName" Type="System.String" Index="0" FrameworkAlternate="netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netstandard-2.1" />
<Parameter Name="password" Type="System.Security.SecureString" Index="1" FrameworkAlternate="netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netstandard-2.1" />
<Parameter Name="keyStorageFlags" Type="System.Security.Cryptography.X509Certificates.X509KeyStorageFlags" Index="2" FrameworkAlternate="netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netstandard-2.1" />
</Parameters>
<Docs>
<param name="fileName">The name of a certificate file.</param>
<param name="password">The password required to access the X.509 certificate data.</param>
<param name="keyStorageFlags">A bitwise combination of the enumeration values that control where and how to import the certificate.</param>
<summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.X509Certificates.X509Certificate" /> class using a certificate file name, a password, and a key storage flag.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
If you create an <xref:System.Security.Cryptography.X509Certificates.X509Certificate> certificate by specifying a PKCS7 signed file store for `fileName`, the <xref:System.Security.Cryptography.X509Certificates.X509Certificate> is created for the certificate that signed the store rather than for any of the certificates within the store.
]]></format>
</remarks>
<exception cref="T:System.Security.Cryptography.CryptographicException">An error with the certificate occurs. For example:
- The certificate file does not exist.
- The certificate is invalid.
- The certificate's password is incorrect.</exception>
<exception cref="T:System.ArgumentException">The <paramref name="fileName" /> parameter is <see langword="null" />.</exception>
<permission cref="T:System.Security.Permissions.FileIOPermission">for permission to read the file described by the <paramref name="fileName" /> parameter. Security action: <see cref="F:System.Security.Permissions.SecurityAction.Demand" />. Associated enumeration: <see cref="F:System.Security.Permissions.EnvironmentPermissionAccess.Read" /></permission>
<permission cref="T:System.Security.Permissions.KeyContainerPermission">for permission to create a key container. Security action: <see cref="F:System.Security.Permissions.SecurityAction.Demand" />. Associated enumeration: <see cref="F:System.Security.Permissions.KeyContainerPermissionFlags.Create" /></permission>
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public X509Certificate (string fileName, string password, System.Security.Cryptography.X509Certificates.X509KeyStorageFlags keyStorageFlags);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(string fileName, string password, valuetype System.Security.Cryptography.X509Certificates.X509KeyStorageFlags keyStorageFlags) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Security.Cryptography.X509Certificates.X509Certificate.#ctor(System.String,System.String,System.Security.Cryptography.X509Certificates.X509KeyStorageFlags)" />
<MemberSignature Language="VB.NET" Value="Public Sub New (fileName As String, password As String, keyStorageFlags As X509KeyStorageFlags)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; X509Certificate(System::String ^ fileName, System::String ^ password, System::Security::Cryptography::X509Certificates::X509KeyStorageFlags keyStorageFlags);" />
<MemberSignature Language="F#" Value="new System.Security.Cryptography.X509Certificates.X509Certificate : string * string * System.Security.Cryptography.X509Certificates.X509KeyStorageFlags -&gt; System.Security.Cryptography.X509Certificates.X509Certificate" Usage="new System.Security.Cryptography.X509Certificates.X509Certificate (fileName, password, keyStorageFlags)" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Security.Cryptography.X509Certificates</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8">
<AttributeName>System.Security.SecuritySafeCritical</AttributeName>
</Attribute>
</Attributes>
<Parameters>
<Parameter Name="fileName" Type="System.String" Index="0" FrameworkAlternate="netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-1.3;netstandard-1.4;netstandard-1.6;netstandard-2.0;netstandard-2.1;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
<Parameter Name="password" Type="System.String" Index="1" FrameworkAlternate="netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-1.3;netstandard-1.4;netstandard-1.6;netstandard-2.0;netstandard-2.1;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
<Parameter Name="keyStorageFlags" Type="System.Security.Cryptography.X509Certificates.X509KeyStorageFlags" Index="2" FrameworkAlternate="netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-1.3;netstandard-1.4;netstandard-1.6;netstandard-2.0;netstandard-2.1;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
</Parameters>
<Docs>
<param name="fileName">The name of a PKCS7 signed file.</param>
<param name="password">The password required to access the X.509 certificate data.</param>
<param name="keyStorageFlags">A bitwise combination of the enumeration values that control where and how to import the certificate.</param>
<summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.X509Certificates.X509Certificate" /> class using the name of a PKCS7 signed file, a password to access the certificate, and a key storage flag.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
If you create an <xref:System.Security.Cryptography.X509Certificates.X509Certificate> certificate by specifying a PKCS7 signed file store for `fileName`, the <xref:System.Security.Cryptography.X509Certificates.X509Certificate> is created for the certificate that signed the store rather than for any of the certificates within the store.
]]></format>
</remarks>
<exception cref="T:System.Security.Cryptography.CryptographicException">An error with the certificate occurs. For example:
- The certificate file does not exist.
- The certificate is invalid.
- The certificate's password is incorrect.</exception>
<exception cref="T:System.ArgumentException">The <paramref name="fileName" /> parameter is <see langword="null" />.</exception>
<permission cref="T:System.Security.Permissions.FileIOPermission">for permission to read the file described by the <paramref name="fileName" /> parameter. Security action: <see cref="F:System.Security.Permissions.SecurityAction.Demand" />. Associated enumeration: <see cref="F:System.Security.Permissions.EnvironmentPermissionAccess.Read" /></permission>
<permission cref="T:System.Security.Permissions.KeyContainerPermission">for permission to create a key container. Security action: <see cref="F:System.Security.Permissions.SecurityAction.Demand" />. Associated enumeration: <see cref="F:System.Security.Permissions.KeyContainerPermissionFlags.Create" /></permission>
</Docs>
</Member>
<Member MemberName="CreateFromCertFile">
<MemberSignature Language="C#" Value="public static System.Security.Cryptography.X509Certificates.X509Certificate CreateFromCertFile (string filename);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.Security.Cryptography.X509Certificates.X509Certificate CreateFromCertFile(string filename) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Security.Cryptography.X509Certificates.X509Certificate.CreateFromCertFile(System.String)" />
<MemberSignature Language="VB.NET" Value="Public Shared Function CreateFromCertFile (filename As String) As X509Certificate" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; static System::Security::Cryptography::X509Certificates::X509Certificate ^ CreateFromCertFile(System::String ^ filename);" />
<MemberSignature Language="F#" Value="static member CreateFromCertFile : string -&gt; System.Security.Cryptography.X509Certificates.X509Certificate" Usage="System.Security.Cryptography.X509Certificates.X509Certificate.CreateFromCertFile filename" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Security.Cryptography.X509Certificates</AssemblyName>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>System.Security.SecuritySafeCritical</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Security.Cryptography.X509Certificates.X509Certificate</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="filename" Type="System.String" Index="0" FrameworkAlternate="netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-1.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netstandard-2.1" />
</Parameters>
<Docs>
<param name="filename">The path of the PKCS7 signed file from which to create the X.509 certificate.</param>
<summary>Creates an X.509v3 certificate from the specified PKCS7 signed file.</summary>
<returns>The newly created X.509 certificate.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
ASN.1 DER is the only certificate format supported by this class.
> [!NOTE]
> The certificate file is not restricted to .cer files. Any PKCS7 signed file can be used, including an Authenticode signed .pfx file.
## Examples
The following example creates an <xref:System.Security.Cryptography.X509Certificates.X509Certificate> from a specified certification file.
[!code-cpp[X509Certificate.ToString Method#1](~/samples/snippets/cpp/VS_Snippets_CLR/X509Certificate.ToString Method/CPP/example.cpp#1)]
[!code-csharp[X509Certificate.ToString Method#1](~/samples/snippets/csharp/VS_Snippets_CLR/X509Certificate.ToString Method/CS/example.cs#1)]
[!code-vb[X509Certificate.ToString Method#1](~/samples/snippets/visualbasic/VS_Snippets_CLR/X509Certificate.ToString Method/VB/example.vb#1)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentException">The <paramref name="filename" /> parameter is <see langword="null" />.</exception>
</Docs>
</Member>
<Member MemberName="CreateFromSignedFile">
<MemberSignature Language="C#" Value="public static System.Security.Cryptography.X509Certificates.X509Certificate CreateFromSignedFile (string filename);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.Security.Cryptography.X509Certificates.X509Certificate CreateFromSignedFile(string filename) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Security.Cryptography.X509Certificates.X509Certificate.CreateFromSignedFile(System.String)" />
<MemberSignature Language="VB.NET" Value="Public Shared Function CreateFromSignedFile (filename As String) As X509Certificate" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; static System::Security::Cryptography::X509Certificates::X509Certificate ^ CreateFromSignedFile(System::String ^ filename);" />
<MemberSignature Language="F#" Value="static member CreateFromSignedFile : string -&gt; System.Security.Cryptography.X509Certificates.X509Certificate" Usage="System.Security.Cryptography.X509Certificates.X509Certificate.CreateFromSignedFile filename" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Security.Cryptography.X509Certificates</AssemblyName>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>System.Security.SecuritySafeCritical</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Security.Cryptography.X509Certificates.X509Certificate</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="filename" Type="System.String" Index="0" FrameworkAlternate="netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-1.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netstandard-2.1" />
</Parameters>
<Docs>
<param name="filename">The path of the signed file from which to create the X.509 certificate.</param>
<summary>Creates an X.509v3 certificate from the specified signed file.</summary>
<returns>The newly created X.509 certificate.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
ASN.1 DER is the only certificate format supported by this class.
]]></format>
</remarks>
<permission cref="T:System.Security.Permissions.FileIOPermission">for the ability to read the file specified by the <paramref name="filename" /> parameter. Associated enumeration: <see cref="F:System.Security.Permissions.FileIOPermissionAccess.Read" /></permission>
</Docs>
</Member>
<MemberGroup MemberName="Dispose">
<AssemblyInfo>
<AssemblyName>System.Security.Cryptography.X509Certificates</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Releases the resources used by the current <see cref="T:System.Security.Cryptography.X509Certificates.X509Certificate" /> object.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
> [!NOTE]
> <xref:System.Security.Cryptography.X509Certificates.X509Certificate> implements the <xref:System.IDisposable> interface starting with the [!INCLUDE[net_v46](~/includes/net-v46-md.md)]; in previous versions of the .NET Framework, the <xref:System.Security.Cryptography.X509Certificates.X509Certificate> class does not implement this interface, and therefore the `Dispose` method does not exist.
]]></format>
</remarks>
</Docs>
</MemberGroup>
<Member MemberName="Dispose">
<MemberSignature Language="C#" Value="public void Dispose ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void Dispose() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Security.Cryptography.X509Certificates.X509Certificate.Dispose" />
<MemberSignature Language="VB.NET" Value="Public Sub Dispose ()" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual void Dispose();" />
<MemberSignature Language="F#" Value="abstract member Dispose : unit -&gt; unit&#xA;override this.Dispose : unit -&gt; unit" Usage="x509Certificate.Dispose " />
<MemberType>Method</MemberType>
<Implements>
<InterfaceMember>M:System.IDisposable.Dispose</InterfaceMember>
</Implements>
<AssemblyInfo>
<AssemblyName>System.Security.Cryptography.X509Certificates</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Releases all resources used by the current <see cref="T:System.Security.Cryptography.X509Certificates.X509Certificate" /> object.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
> [!NOTE]
> <xref:System.Security.Cryptography.X509Certificates.X509Certificate> implements the <xref:System.IDisposable> interface starting with the [!INCLUDE[net_v46](~/includes/net-v46-md.md)]; in previous versions of the .NET Framework, the <xref:System.Security.Cryptography.X509Certificates.X509Certificate> class does not implement this interface, and therefore the `Dispose` method does not exist.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="Dispose">
<MemberSignature Language="C#" Value="protected virtual void Dispose (bool disposing);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance void Dispose(bool disposing) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Security.Cryptography.X509Certificates.X509Certificate.Dispose(System.Boolean)" />
<MemberSignature Language="VB.NET" Value="Protected Overridable Sub Dispose (disposing As Boolean)" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; virtual void Dispose(bool disposing);" />
<MemberSignature Language="F#" Value="abstract member Dispose : bool -&gt; unit&#xA;override this.Dispose : bool -&gt; unit" Usage="x509Certificate.Dispose disposing" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Security.Cryptography.X509Certificates</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8">
<AttributeName>System.Security.SecuritySafeCritical</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="disposing" Type="System.Boolean" Index="0" FrameworkAlternate="netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-1.3;netstandard-1.4;netstandard-1.6;netstandard-2.0;netstandard-2.1;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
</Parameters>
<Docs>
<param name="disposing">
<see langword="true" /> to release both managed and unmanaged resources; <see langword="false" /> to release only unmanaged resources.</param>
<summary>Releases all of the unmanaged resources used by this <see cref="T:System.Security.Cryptography.X509Certificates.X509Certificate" /> and optionally releases the managed resources.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
> [!NOTE]
> <xref:System.Security.Cryptography.X509Certificates.X509Certificate> implements the <xref:System.IDisposable> interface starting with the [!INCLUDE[net_v46](~/includes/net-v46-md.md)]; in previous versions of the .NET Framework, the <xref:System.Security.Cryptography.X509Certificates.X509Certificate> class does not implement this interface, and therefore the `Dispose` method does not exist.
]]></format>
</remarks>
</Docs>
</Member>
<MemberGroup MemberName="Equals">
<AssemblyInfo>
<AssemblyName>System.Security.Cryptography.X509Certificates</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Compares two <see cref="T:System.Security.Cryptography.X509Certificates.X509Certificate" /> objects for equality.</summary>
</Docs>
</MemberGroup>
<Member MemberName="Equals">
<MemberSignature Language="C#" Value="public override bool Equals (object obj);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance bool Equals(object obj) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Security.Cryptography.X509Certificates.X509Certificate.Equals(System.Object)" />
<MemberSignature Language="VB.NET" Value="Public Overrides Function Equals (obj As Object) As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; override bool Equals(System::Object ^ obj);" />
<MemberSignature Language="F#" Value="override this.Equals : obj -&gt; bool" Usage="x509Certificate.Equals obj" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Security.Cryptography.X509Certificates</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netframework-4.8">
<AttributeName>System.Runtime.InteropServices.ComVisible(false)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="obj" Type="System.Object" Index="0" FrameworkAlternate="netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-1.3;netstandard-1.4;netstandard-1.6;netstandard-2.0;netstandard-2.1;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
</Parameters>
<Docs>
<param name="obj">An <see cref="T:System.Security.Cryptography.X509Certificates.X509Certificate" /> object to compare to the current object.</param>
<summary>Compares two <see cref="T:System.Security.Cryptography.X509Certificates.X509Certificate" /> objects for equality.</summary>
<returns>
<see langword="true" /> if the current <see cref="T:System.Security.Cryptography.X509Certificates.X509Certificate" /> object is equal to the object specified by the <paramref name="other" /> parameter; otherwise, <see langword="false" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Two objects are considered equal if they are <xref:System.Security.Cryptography.X509Certificates.X509Certificate> objects and they have the same issuer and serial number.
> [!IMPORTANT]
> The `Equals` method should not be used when comparing certificates for security purposes. Instead, use a hash of the <xref:System.Security.Cryptography.X509Certificates.X509Certificate2.RawData> property, or the <xref:System.Security.Cryptography.X509Certificates.X509Certificate2.Thumbprint> property.
## Examples
The following example compares two certificates for equality.
[!code-cpp[X509Certificate.Equals Method#1](~/samples/snippets/cpp/VS_Snippets_CLR/X509Certificate.Equals Method/CPP/example.cpp#1)]
[!code-csharp[X509Certificate.Equals Method#1](~/samples/snippets/csharp/VS_Snippets_CLR/X509Certificate.Equals Method/CS/example.cs#1)]
[!code-vb[X509Certificate.Equals Method#1](~/samples/snippets/visualbasic/VS_Snippets_CLR/X509Certificate.Equals Method/VB/example.vb#1)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="Equals">
<MemberSignature Language="C#" Value="public virtual bool Equals (System.Security.Cryptography.X509Certificates.X509Certificate other);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance bool Equals(class System.Security.Cryptography.X509Certificates.X509Certificate other) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Security.Cryptography.X509Certificates.X509Certificate.Equals(System.Security.Cryptography.X509Certificates.X509Certificate)" />
<MemberSignature Language="VB.NET" Value="Public Overridable Function Equals (other As X509Certificate) As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual bool Equals(System::Security::Cryptography::X509Certificates::X509Certificate ^ other);" />
<MemberSignature Language="F#" Value="override this.Equals : System.Security.Cryptography.X509Certificates.X509Certificate -&gt; bool" Usage="x509Certificate.Equals other" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Security.Cryptography.X509Certificates</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8">
<AttributeName>System.Security.SecuritySafeCritical</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="other" Type="System.Security.Cryptography.X509Certificates.X509Certificate" />
</Parameters>
<Docs>
<param name="other">An <see cref="T:System.Security.Cryptography.X509Certificates.X509Certificate" /> object to compare to the current object.</param>
<summary>Compares two <see cref="T:System.Security.Cryptography.X509Certificates.X509Certificate" /> objects for equality.</summary>
<returns>
<see langword="true" /> if the current <see cref="T:System.Security.Cryptography.X509Certificates.X509Certificate" /> object is equal to the object specified by the <paramref name="other" /> parameter; otherwise, <see langword="false" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Two <xref:System.Security.Cryptography.X509Certificates.X509Certificate> objects are considered equal if they have the same issuer and serial number.
> [!IMPORTANT]
> The `Equals` method should not be used when comparing certificates for security purposes. Instead, use a hash of the <xref:System.Security.Cryptography.X509Certificates.X509Certificate2.RawData> property, or the <xref:System.Security.Cryptography.X509Certificates.X509Certificate2.Thumbprint> property.
## Examples
The following example compares two certificates for equality.
[!code-cpp[X509Certificate.Equals Method#1](~/samples/snippets/cpp/VS_Snippets_CLR/X509Certificate.Equals Method/CPP/example.cpp#1)]
[!code-csharp[X509Certificate.Equals Method#1](~/samples/snippets/csharp/VS_Snippets_CLR/X509Certificate.Equals Method/CS/example.cs#1)]
[!code-vb[X509Certificate.Equals Method#1](~/samples/snippets/visualbasic/VS_Snippets_CLR/X509Certificate.Equals Method/VB/example.vb#1)]
]]></format>
</remarks>
</Docs>
</Member>
<MemberGroup MemberName="Export">
<AssemblyInfo>
<AssemblyName>System.Security.Cryptography.X509Certificates</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Exports the current <see cref="T:System.Security.Cryptography.X509Certificates.X509Certificate" /> object to a byte array.</summary>
</Docs>
</MemberGroup>
<Member MemberName="Export">
<MemberSignature Language="C#" Value="public virtual byte[] Export (System.Security.Cryptography.X509Certificates.X509ContentType contentType);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance unsigned int8[] Export(valuetype System.Security.Cryptography.X509Certificates.X509ContentType contentType) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Security.Cryptography.X509Certificates.X509Certificate.Export(System.Security.Cryptography.X509Certificates.X509ContentType)" />
<MemberSignature Language="VB.NET" Value="Public Overridable Function Export (contentType As X509ContentType) As Byte()" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual cli::array &lt;System::Byte&gt; ^ Export(System::Security::Cryptography::X509Certificates::X509ContentType contentType);" />
<MemberSignature Language="F#" Value="abstract member Export : System.Security.Cryptography.X509Certificates.X509ContentType -&gt; byte[]&#xA;override this.Export : System.Security.Cryptography.X509Certificates.X509ContentType -&gt; byte[]" Usage="x509Certificate.Export contentType" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Security.Cryptography.X509Certificates</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netframework-4.8">
<AttributeName>System.Runtime.InteropServices.ComVisible(false)</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8">
<AttributeName>System.Security.SecuritySafeCritical</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Byte[]</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="contentType" Type="System.Security.Cryptography.X509Certificates.X509ContentType" Index="0" FrameworkAlternate="netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-1.3;netstandard-1.4;netstandard-1.6;netstandard-2.0;netstandard-2.1;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
</Parameters>
<Docs>
<param name="contentType">One of the <see cref="T:System.Security.Cryptography.X509Certificates.X509ContentType" /> values that describes how to format the output data.</param>
<summary>Exports the current <see cref="T:System.Security.Cryptography.X509Certificates.X509Certificate" /> object to a byte array in a format described by one of the <see cref="T:System.Security.Cryptography.X509Certificates.X509ContentType" /> values.</summary>
<returns>An array of bytes that represents the current <see cref="T:System.Security.Cryptography.X509Certificates.X509Certificate" /> object.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The `contentType` parameter accepts only the following values of the <xref:System.Security.Cryptography.X509Certificates.X509ContentType> enumeration: <xref:System.Security.Cryptography.X509Certificates.X509ContentType.Cert>, <xref:System.Security.Cryptography.X509Certificates.X509ContentType.SerializedCert>, and <xref:System.Security.Cryptography.X509Certificates.X509ContentType.Pkcs12>. Passing any other value causes a <xref:System.Security.Cryptography.CryptographicException> to be thrown.
## Examples
The following example loads an X.509 certificate file into an <xref:System.Security.Cryptography.X509Certificates.X509Certificate> object, exports the certificate as a byte array, and then imports the byte array into another <xref:System.Security.Cryptography.X509Certificates.X509Certificate> object.
[!code-cpp[Cryptography.X509Certificates.X509Certificate.Import-Export#1](~/samples/snippets/cpp/VS_Snippets_CLR/Cryptography.X509Certificates.X509Certificate.Import-Export/CPP/sample.cpp#1)]
[!code-csharp[Cryptography.X509Certificates.X509Certificate.Import-Export#1](~/samples/snippets/csharp/VS_Snippets_CLR/Cryptography.X509Certificates.X509Certificate.Import-Export/CS/sample.cs#1)]
[!code-vb[Cryptography.X509Certificates.X509Certificate.Import-Export#1](~/samples/snippets/visualbasic/VS_Snippets_CLR/Cryptography.X509Certificates.X509Certificate.Import-Export/VB/sample.vb#1)]
]]></format>
</remarks>
<exception cref="T:System.Security.Cryptography.CryptographicException">A value other than <see cref="F:System.Security.Cryptography.X509Certificates.X509ContentType.Cert" />, <see cref="F:System.Security.Cryptography.X509Certificates.X509ContentType.SerializedCert" />, or <see cref="F:System.Security.Cryptography.X509Certificates.X509ContentType.Pkcs12" /> was passed to the <paramref name="contentType" /> parameter.
-or-
The certificate could not be exported.</exception>
<permission cref="T:System.Security.Permissions.KeyContainerPermission">for permission to open a key container and export a certificate when you pass the <see cref="F:System.Security.Cryptography.X509Certificates.X509ContentType.SerializedCert" /> value to the <paramref name="contentType" /> parameter. Security action: <see cref="F:System.Security.Permissions.SecurityAction.Demand" />. Associated enumerations: <see cref="F:System.Security.Permissions.KeyContainerPermissionFlags.Open" />, <see cref="F:System.Security.Permissions.KeyContainerPermissionFlags.Export" /></permission>
</Docs>
</Member>
<Member MemberName="Export">
<MemberSignature Language="C#" Value="public virtual byte[] Export (System.Security.Cryptography.X509Certificates.X509ContentType contentType, System.Security.SecureString password);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance unsigned int8[] Export(valuetype System.Security.Cryptography.X509Certificates.X509ContentType contentType, class System.Security.SecureString password) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Security.Cryptography.X509Certificates.X509Certificate.Export(System.Security.Cryptography.X509Certificates.X509ContentType,System.Security.SecureString)" />
<MemberSignature Language="VB.NET" Value="Public Overridable Function Export (contentType As X509ContentType, password As SecureString) As Byte()" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual cli::array &lt;System::Byte&gt; ^ Export(System::Security::Cryptography::X509Certificates::X509ContentType contentType, System::Security::SecureString ^ password);" />
<MemberSignature Language="F#" Value="abstract member Export : System.Security.Cryptography.X509Certificates.X509ContentType * System.Security.SecureString -&gt; byte[]&#xA;override this.Export : System.Security.Cryptography.X509Certificates.X509ContentType * System.Security.SecureString -&gt; byte[]" Usage="x509Certificate.Export (contentType, password)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Security.Cryptography.X509Certificates</AssemblyName>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netstandard-2.1">
<AttributeName>System.CLSCompliant(false)</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8">
<AttributeName>System.Security.SecuritySafeCritical</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Byte[]</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="contentType" Type="System.Security.Cryptography.X509Certificates.X509ContentType" Index="0" FrameworkAlternate="netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netstandard-2.1" />
<Parameter Name="password" Type="System.Security.SecureString" Index="1" FrameworkAlternate="netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netstandard-2.1" />
</Parameters>
<Docs>
<param name="contentType">One of the <see cref="T:System.Security.Cryptography.X509Certificates.X509ContentType" /> values that describes how to format the output data.</param>
<param name="password">The password required to access the X.509 certificate data.</param>
<summary>Exports the current <see cref="T:System.Security.Cryptography.X509Certificates.X509Certificate" /> object to a byte array using the specified format and a password.</summary>
<returns>A byte array that represents the current <see cref="T:System.Security.Cryptography.X509Certificates.X509Certificate" /> object.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The `contentType` parameter accepts only the following values of the <xref:System.Security.Cryptography.X509Certificates.X509ContentType> enumeration: <xref:System.Security.Cryptography.X509Certificates.X509ContentType.Cert>, <xref:System.Security.Cryptography.X509Certificates.X509ContentType.SerializedCert>, and <xref:System.Security.Cryptography.X509Certificates.X509ContentType.Pkcs12>. Passing any other value causes a <xref:System.Security.Cryptography.CryptographicException> to be thrown.
> [!IMPORTANT]
> Never hard code a password within your source code. Hard-coded passwords can be retrieved from an assembly using the [Ildasm.exe (IL Disassembler)](~/docs/framework/tools/ildasm-exe-il-disassembler.md), a hex editor, or by simply opening the assembly in a text editor such as Notepad.exe.
]]></format>
</remarks>
<exception cref="T:System.Security.Cryptography.CryptographicException">A value other than <see cref="F:System.Security.Cryptography.X509Certificates.X509ContentType.Cert" />, <see cref="F:System.Security.Cryptography.X509Certificates.X509ContentType.SerializedCert" />, or <see cref="F:System.Security.Cryptography.X509Certificates.X509ContentType.Pkcs12" /> was passed to the <paramref name="contentType" /> parameter.
-or-
The certificate could not be exported.</exception>
<permission cref="T:System.Security.Permissions.KeyContainerPermission">for permission to open a key container and export a certificate when you pass the <see cref="F:System.Security.Cryptography.X509Certificates.X509ContentType.SerializedCert" /> value to the <paramref name="contentType" /> parameter. Security action: <see cref="F:System.Security.Permissions.SecurityAction.Demand" />. Associated enumerations: <see cref="F:System.Security.Permissions.KeyContainerPermissionFlags.Open" />, <see cref="F:System.Security.Permissions.KeyContainerPermissionFlags.Export" /></permission>
</Docs>
</Member>
<Member MemberName="Export">
<MemberSignature Language="C#" Value="public virtual byte[] Export (System.Security.Cryptography.X509Certificates.X509ContentType contentType, string password);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance unsigned int8[] Export(valuetype System.Security.Cryptography.X509Certificates.X509ContentType contentType, string password) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Security.Cryptography.X509Certificates.X509Certificate.Export(System.Security.Cryptography.X509Certificates.X509ContentType,System.String)" />
<MemberSignature Language="VB.NET" Value="Public Overridable Function Export (contentType As X509ContentType, password As String) As Byte()" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual cli::array &lt;System::Byte&gt; ^ Export(System::Security::Cryptography::X509Certificates::X509ContentType contentType, System::String ^ password);" />
<MemberSignature Language="F#" Value="abstract member Export : System.Security.Cryptography.X509Certificates.X509ContentType * string -&gt; byte[]&#xA;override this.Export : System.Security.Cryptography.X509Certificates.X509ContentType * string -&gt; byte[]" Usage="x509Certificate.Export (contentType, password)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Security.Cryptography.X509Certificates</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netframework-4.8">
<AttributeName>System.Runtime.InteropServices.ComVisible(false)</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8">
<AttributeName>System.Security.SecuritySafeCritical</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Byte[]</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="contentType" Type="System.Security.Cryptography.X509Certificates.X509ContentType" Index="0" FrameworkAlternate="netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-1.3;netstandard-1.4;netstandard-1.6;netstandard-2.0;netstandard-2.1;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
<Parameter Name="password" Type="System.String" Index="1" FrameworkAlternate="netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-1.3;netstandard-1.4;netstandard-1.6;netstandard-2.0;netstandard-2.1;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
</Parameters>
<Docs>
<param name="contentType">One of the <see cref="T:System.Security.Cryptography.X509Certificates.X509ContentType" /> values that describes how to format the output data.</param>
<param name="password">The password required to access the X.509 certificate data.</param>
<summary>Exports the current <see cref="T:System.Security.Cryptography.X509Certificates.X509Certificate" /> object to a byte array in a format described by one of the <see cref="T:System.Security.Cryptography.X509Certificates.X509ContentType" /> values, and using the specified password.</summary>
<returns>An array of bytes that represents the current <see cref="T:System.Security.Cryptography.X509Certificates.X509Certificate" /> object.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The `contentType` parameter accepts only the following values of the <xref:System.Security.Cryptography.X509Certificates.X509ContentType> enumeration: <xref:System.Security.Cryptography.X509Certificates.X509ContentType.Cert>, <xref:System.Security.Cryptography.X509Certificates.X509ContentType.SerializedCert>, and <xref:System.Security.Cryptography.X509Certificates.X509ContentType.Pkcs12>. Passing any other value causes a <xref:System.Security.Cryptography.CryptographicException> to be thrown.
> [!IMPORTANT]
> Never hard code a password within your source code. Hard-coded passwords can be retrieved from an assembly using the [Ildasm.exe (IL Disassembler)](~/docs/framework/tools/ildasm-exe-il-disassembler.md), a hex editor, or by simply opening the assembly in a text editor such as Notepad.exe.
]]></format>
</remarks>
<exception cref="T:System.Security.Cryptography.CryptographicException">A value other than <see cref="F:System.Security.Cryptography.X509Certificates.X509ContentType.Cert" />, <see cref="F:System.Security.Cryptography.X509Certificates.X509ContentType.SerializedCert" />, or <see cref="F:System.Security.Cryptography.X509Certificates.X509ContentType.Pkcs12" /> was passed to the <paramref name="contentType" /> parameter.
-or-
The certificate could not be exported.</exception>
<permission cref="T:System.Security.Permissions.KeyContainerPermission">for permission to open a key container and export a certificate when you pass the <see cref="F:System.Security.Cryptography.X509Certificates.X509ContentType.SerializedCert" /> value to the <paramref name="contentType" /> parameter. Security action: <see cref="F:System.Security.Permissions.SecurityAction.Demand" />. Associated enumerations: <see cref="F:System.Security.Permissions.KeyContainerPermissionFlags.Open" />, <see cref="F:System.Security.Permissions.KeyContainerPermissionFlags.Export" /></permission>
</Docs>
</Member>
<Member MemberName="FormatDate">
<MemberSignature Language="C#" Value="protected static string FormatDate (DateTime date);" />
<MemberSignature Language="ILAsm" Value=".method familystatic hidebysig string FormatDate(valuetype System.DateTime date) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Security.Cryptography.X509Certificates.X509Certificate.FormatDate(System.DateTime)" />
<MemberSignature Language="VB.NET" Value="Protected Shared Function FormatDate (date As DateTime) As String" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; static System::String ^ FormatDate(DateTime date);" />
<MemberSignature Language="F#" Value="static member FormatDate : DateTime -&gt; string" Usage="System.Security.Cryptography.X509Certificates.X509Certificate.FormatDate date" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Security.Cryptography.X509Certificates</AssemblyName>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="date" Type="System.DateTime" Index="0" FrameworkAlternate="netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netstandard-2.1" />
</Parameters>
<Docs>
<param name="date">The date and time to convert.</param>
<summary>Converts the specified date and time to a string.</summary>
<returns>A string representation of the value of the <see cref="T:System.DateTime" /> object.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Some cultures cannot convert future dates into strings. If the expiration date of an X.509 certificate is beyond the range of the culture, <xref:System.Security.Cryptography.X509Certificates.X509Certificate.FormatDate%2A> falls back to a calendar that can express the date. If the <xref:System.Globalization.CultureInfo.Calendar%2A> value is <xref:System.Globalization.UmAlQuraCalendar>, the calendar is changed to the <xref:System.Globalization.HijriCalendar> class; otherwise, it is changed to the <xref:System.Globalization.CultureInfo.InvariantCulture%2A>.
]]></format>
</remarks>
</Docs>
</Member>
<MemberGroup MemberName="GetCertHash">
<Docs>
<summary>Returns the hash value for an <see cref="T:System.Security.Cryptography.X509Certificates.X509Certificate" /> object.</summary>
</Docs>
</MemberGroup>
<Member MemberName="GetCertHash">
<MemberSignature Language="C#" Value="public virtual byte[] GetCertHash ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance unsigned int8[] GetCertHash() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Security.Cryptography.X509Certificates.X509Certificate.GetCertHash" />
<MemberSignature Language="VB.NET" Value="Public Overridable Function GetCertHash () As Byte()" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual cli::array &lt;System::Byte&gt; ^ GetCertHash();" />
<MemberSignature Language="F#" Value="abstract member GetCertHash : unit -&gt; byte[]&#xA;override this.GetCertHash : unit -&gt; byte[]" Usage="x509Certificate.GetCertHash " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Security.Cryptography.X509Certificates</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Byte[]</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Returns the hash value for the X.509v3 certificate as an array of bytes.</summary>
<returns>The hash value for the X.509 certificate.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following example uses the <xref:System.Security.Cryptography.X509Certificates.X509Certificate.GetCertHash%2A> method to fill an array of bytes with the hash value for an X.509 certificate.
[!code-cpp[X509Certificate.GetCertHash Method#1](~/samples/snippets/cpp/VS_Snippets_CLR/X509Certificate.GetCertHash Method/CPP/example.cpp#1)]
[!code-csharp[X509Certificate.GetCertHash Method#1](~/samples/snippets/csharp/VS_Snippets_CLR/X509Certificate.GetCertHash Method/CS/example.cs#1)]
[!code-vb[X509Certificate.GetCertHash Method#1](~/samples/snippets/visualbasic/VS_Snippets_CLR/X509Certificate.GetCertHash Method/VB/example.vb#1)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="GetCertHash">
<MemberSignature Language="C#" Value="public virtual byte[] GetCertHash (System.Security.Cryptography.HashAlgorithmName hashAlgorithm);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance unsigned int8[] GetCertHash(valuetype System.Security.Cryptography.HashAlgorithmName hashAlgorithm) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Security.Cryptography.X509Certificates.X509Certificate.GetCertHash(System.Security.Cryptography.HashAlgorithmName)" />
<MemberSignature Language="VB.NET" Value="Public Overridable Function GetCertHash (hashAlgorithm As HashAlgorithmName) As Byte()" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual cli::array &lt;System::Byte&gt; ^ GetCertHash(System::Security::Cryptography::HashAlgorithmName hashAlgorithm);" />
<MemberSignature Language="F#" Value="abstract member GetCertHash : System.Security.Cryptography.HashAlgorithmName -&gt; byte[]&#xA;override this.GetCertHash : System.Security.Cryptography.HashAlgorithmName -&gt; byte[]" Usage="x509Certificate.GetCertHash hashAlgorithm" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Security.Cryptography.X509Certificates</AssemblyName>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.8">
<AttributeName>System.Security.SecuritySafeCritical</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Byte[]</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="hashAlgorithm" Type="System.Security.Cryptography.HashAlgorithmName" Index="0" FrameworkAlternate="netcore-2.1;netcore-2.2;netcore-3.0;netframework-4.8;netstandard-2.1" />
</Parameters>
<Docs>
<param name="hashAlgorithm">The name of the cryptographic hash algorithm to use.</param>
<summary>Returns the hash value for the X.509v3 certificate that is computed by using the specified cryptographic hash algorithm.</summary>
<returns>A byte array that contains the hash value for the X.509 certificate.</returns>
<remarks>To be added.</remarks>
</Docs>
</Member>
<MemberGroup MemberName="GetCertHashString">
<Docs>
<summary>Returns a hexadecimal string that contains the hash value for the X.509v3 certificate.</summary>
</Docs>
</MemberGroup>
<Member MemberName="GetCertHashString">
<MemberSignature Language="C#" Value="public virtual string GetCertHashString ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance string GetCertHashString() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Security.Cryptography.X509Certificates.X509Certificate.GetCertHashString" />
<MemberSignature Language="VB.NET" Value="Public Overridable Function GetCertHashString () As String" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual System::String ^ GetCertHashString();" />
<MemberSignature Language="F#" Value="abstract member GetCertHashString : unit -&gt; string&#xA;override this.GetCertHashString : unit -&gt; string" Usage="x509Certificate.GetCertHashString " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Security.Cryptography.X509Certificates</AssemblyName>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Returns the SHA1 hash value for the X.509v3 certificate as a hexadecimal string.</summary>
<returns>The hexadecimal string representation of the X.509 certificate hash value.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following example uses the <xref:System.Security.Cryptography.X509Certificates.X509Certificate.GetCertHashString%2A> method to get an X.509 certificate hash value, convert it to a string, and display it to the console.
[!code-cpp[X509Certificate.GetCertHashString Method#1](~/samples/snippets/cpp/VS_Snippets_CLR/X509Certificate.GetCertHashString Method/CPP/example.cpp#1)]
[!code-csharp[X509Certificate.GetCertHashString Method#1](~/samples/snippets/csharp/VS_Snippets_CLR/X509Certificate.GetCertHashString Method/CS/example.cs#1)]
[!code-vb[X509Certificate.GetCertHashString Method#1](~/samples/snippets/visualbasic/VS_Snippets_CLR/X509Certificate.GetCertHashString Method/VB/example.vb#1)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="GetCertHashString">
<MemberSignature Language="C#" Value="public virtual string GetCertHashString (System.Security.Cryptography.HashAlgorithmName hashAlgorithm);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance string GetCertHashString(valuetype System.Security.Cryptography.HashAlgorithmName hashAlgorithm) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Security.Cryptography.X509Certificates.X509Certificate.GetCertHashString(System.Security.Cryptography.HashAlgorithmName)" />
<MemberSignature Language="VB.NET" Value="Public Overridable Function GetCertHashString (hashAlgorithm As HashAlgorithmName) As String" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual System::String ^ GetCertHashString(System::Security::Cryptography::HashAlgorithmName hashAlgorithm);" />
<MemberSignature Language="F#" Value="abstract member GetCertHashString : System.Security.Cryptography.HashAlgorithmName -&gt; string&#xA;override this.GetCertHashString : System.Security.Cryptography.HashAlgorithmName -&gt; string" Usage="x509Certificate.GetCertHashString hashAlgorithm" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Security.Cryptography.X509Certificates</AssemblyName>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="hashAlgorithm" Type="System.Security.Cryptography.HashAlgorithmName" Index="0" FrameworkAlternate="netcore-2.1;netcore-2.2;netcore-3.0;netframework-4.8;netstandard-2.1" />
</Parameters>
<Docs>
<param name="hashAlgorithm">The name of the cryptographic hash algorithm to use.</param>
<summary>Returns a hexadecimal string containing the hash value for the X.509v3 certificate computed using the specified cryptographic hash algorithm.</summary>
<returns>The hexadecimal string representation of the X.509 certificate hash value.</returns>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="GetEffectiveDateString">
<MemberSignature Language="C#" Value="public virtual string GetEffectiveDateString ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance string GetEffectiveDateString() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Security.Cryptography.X509Certificates.X509Certificate.GetEffectiveDateString" />
<MemberSignature Language="VB.NET" Value="Public Overridable Function GetEffectiveDateString () As String" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual System::String ^ GetEffectiveDateString();" />
<MemberSignature Language="F#" Value="abstract member GetEffectiveDateString : unit -&gt; string&#xA;override this.GetEffectiveDateString : unit -&gt; string" Usage="x509Certificate.GetEffectiveDateString " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Security.Cryptography.X509Certificates</AssemblyName>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Returns the effective date of this X.509v3 certificate.</summary>
<returns>The effective date for this X.509 certificate.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The effective date is the date after which the X.509 certificate is considered valid.
The <xref:System.Security.Cryptography.X509Certificates.X509Certificate.GetEffectiveDateString%2A> method returns a string that shows the date formatted in Short Date Pattern followed by the time formatted in Long Time Pattern. The date and time are formatted using the current culture and time zone.
## Examples
The following example uses the <xref:System.Security.Cryptography.X509Certificates.X509Certificate.GetEffectiveDateString%2A> method to get the effective date of a certificate and displays it to the console.
[!code-cpp[X509Certificate.GetEffectiveDateString Method#1](~/samples/snippets/cpp/VS_Snippets_CLR/X509Certificate.GetEffectiveDateString Method/CPP/example.cpp#1)]
[!code-csharp[X509Certificate.GetEffectiveDateString Method#1](~/samples/snippets/csharp/VS_Snippets_CLR/X509Certificate.GetEffectiveDateString Method/CS/example.cs#1)]
[!code-vb[X509Certificate.GetEffectiveDateString Method#1](~/samples/snippets/visualbasic/VS_Snippets_CLR/X509Certificate.GetEffectiveDateString Method/VB/example.vb#1)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="GetExpirationDateString">
<MemberSignature Language="C#" Value="public virtual string GetExpirationDateString ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance string GetExpirationDateString() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Security.Cryptography.X509Certificates.X509Certificate.GetExpirationDateString" />
<MemberSignature Language="VB.NET" Value="Public Overridable Function GetExpirationDateString () As String" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual System::String ^ GetExpirationDateString();" />
<MemberSignature Language="F#" Value="abstract member GetExpirationDateString : unit -&gt; string&#xA;override this.GetExpirationDateString : unit -&gt; string" Usage="x509Certificate.GetExpirationDateString " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Security.Cryptography.X509Certificates</AssemblyName>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Returns the expiration date of this X.509v3 certificate.</summary>
<returns>The expiration date for this X.509 certificate.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The expiration date is the date after which the X.509 certificate is no longer considered valid.
The <xref:System.Security.Cryptography.X509Certificates.X509Certificate.GetExpirationDateString%2A> method returns a string that shows the date formatted in Short Date Pattern followed by the time formatted in Long Time Pattern. The date and time are formatted using the current culture and time zone.
> [!NOTE]
> This method may return a different string format on Macintosh computers, although the underlying <xref:System.DateTime> object will represent the same value.
## Examples
The following example uses the <xref:System.Security.Cryptography.X509Certificates.X509Certificate.GetExpirationDateString%2A> method to get the expiration date of a certificate and displays it to the console.
[!code-cpp[X509Certificate.GetExpirationDateString Method#1](~/samples/snippets/cpp/VS_Snippets_CLR/X509Certificate.GetExpirationDateString Method/CPP/example.cpp#1)]
[!code-csharp[X509Certificate.GetExpirationDateString Method#1](~/samples/snippets/csharp/VS_Snippets_CLR/X509Certificate.GetExpirationDateString Method/CS/example.cs#1)]
[!code-vb[X509Certificate.GetExpirationDateString Method#1](~/samples/snippets/visualbasic/VS_Snippets_CLR/X509Certificate.GetExpirationDateString Method/VB/example.vb#1)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="GetFormat">
<MemberSignature Language="C#" Value="public virtual string GetFormat ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance string GetFormat() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Security.Cryptography.X509Certificates.X509Certificate.GetFormat" />
<MemberSignature Language="VB.NET" Value="Public Overridable Function GetFormat () As String" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual System::String ^ GetFormat();" />
<MemberSignature Language="F#" Value="abstract member GetFormat : unit -&gt; string&#xA;override this.GetFormat : unit -&gt; string" Usage="x509Certificate.GetFormat " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Security.Cryptography.X509Certificates</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Returns the name of the format of this X.509v3 certificate.</summary>
<returns>The format of this X.509 certificate.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The format X.509 is always returned in this implementation.
## Examples
The following example uses the <xref:System.Security.Cryptography.X509Certificates.X509Certificate.GetFormat%2A> method to get the format of a certificate and displays it to the console.
[!code-cpp[X509Certificate.GetFormat Method#1](~/samples/snippets/cpp/VS_Snippets_CLR/X509Certificate.GetFormat Method/CPP/example.cpp#1)]
[!code-csharp[X509Certificate.GetFormat Method#1](~/samples/snippets/csharp/VS_Snippets_CLR/X509Certificate.GetFormat Method/CS/example.cs#1)]
[!code-vb[X509Certificate.GetFormat Method#1](~/samples/snippets/visualbasic/VS_Snippets_CLR/X509Certificate.GetFormat Method/VB/example.vb#1)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="GetHashCode">
<MemberSignature Language="C#" Value="public override int GetHashCode ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance int32 GetHashCode() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Security.Cryptography.X509Certificates.X509Certificate.GetHashCode" />
<MemberSignature Language="VB.NET" Value="Public Overrides Function GetHashCode () As Integer" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; override int GetHashCode();" />
<MemberSignature Language="F#" Value="override this.GetHashCode : unit -&gt; int" Usage="x509Certificate.GetHashCode " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Security.Cryptography.X509Certificates</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8">
<AttributeName>System.Security.SecuritySafeCritical</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Returns the hash code for the X.509v3 certificate as an integer.</summary>
<returns>The hash code for the X.509 certificate as an integer.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
If the X.509 certificate hash is an array of more than 4 bytes, any byte after the fourth byte is not seen in this integer representation.
## Examples
The following example uses the <xref:System.Security.Cryptography.X509Certificates.X509Certificate.GetHashCode%2A> method to return an integer representation of a certificate's hash code and displays it to the console.
[!code-cpp[X509Certificate.GetHashCode Method#1](~/samples/snippets/cpp/VS_Snippets_CLR/X509Certificate.GetHashCode Method/CPP/example.cpp#1)]
[!code-csharp[X509Certificate.GetHashCode Method#1](~/samples/snippets/csharp/VS_Snippets_CLR/X509Certificate.GetHashCode Method/CS/example.cs#1)]
[!code-vb[X509Certificate.GetHashCode Method#1](~/samples/snippets/visualbasic/VS_Snippets_CLR/X509Certificate.GetHashCode Method/VB/example.vb#1)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="GetIssuerName">
<MemberSignature Language="C#" Value="public virtual string GetIssuerName ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance string GetIssuerName() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Security.Cryptography.X509Certificates.X509Certificate.GetIssuerName" />
<MemberSignature Language="VB.NET" Value="Public Overridable Function GetIssuerName () As String" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual System::String ^ GetIssuerName();" />
<MemberSignature Language="F#" Value="abstract member GetIssuerName : unit -&gt; string&#xA;override this.GetIssuerName : unit -&gt; string" Usage="x509Certificate.GetIssuerName " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Security.Cryptography.X509Certificates</AssemblyName>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0">
<AttributeName>System.Obsolete("Use the Issuer property.")</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netcore-2.0;netcore-2.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netstandard-2.0;netframework-4.8;netcore-2.2">
<AttributeName>System.Obsolete("This method has been deprecated. Please use the Issuer property instead. http://go.microsoft.com/fwlink/?linkid=14202")</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8">
<AttributeName>System.Security.SecuritySafeCritical</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netcore-3.0;netstandard-2.1">
<AttributeName>System.Obsolete("This method has been deprecated. Please use the Issuer property instead. https://go.microsoft.com/fwlink/?linkid=14202")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Returns the name of the certification authority that issued the X.509v3 certificate.</summary>
<returns>The name of the certification authority that issued the X.509 certificate.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following example uses the <xref:System.Security.Cryptography.X509Certificates.X509Certificate.GetIssuerName%2A> method to return the certificate issuer's name and displays it to the console.
[!code-cpp[X509Certificate.GetIssuerName Method#1](~/samples/snippets/cpp/VS_Snippets_CLR/X509Certificate.GetIssuerName Method/CPP/example.cpp#1)]
[!code-csharp[X509Certificate.GetIssuerName Method#1](~/samples/snippets/csharp/VS_Snippets_CLR/X509Certificate.GetIssuerName Method/CS/example.cs#1)]
[!code-vb[X509Certificate.GetIssuerName Method#1](~/samples/snippets/visualbasic/VS_Snippets_CLR/X509Certificate.GetIssuerName Method/VB/example.vb#1)]
]]></format>
</remarks>
<exception cref="T:System.Security.Cryptography.CryptographicException">An error with the certificate occurs. For example:
- The certificate file does not exist.
- The certificate is invalid.
- The certificate's password is incorrect.</exception>
</Docs>
</Member>
<Member MemberName="GetKeyAlgorithm">
<MemberSignature Language="C#" Value="public virtual string GetKeyAlgorithm ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance string GetKeyAlgorithm() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Security.Cryptography.X509Certificates.X509Certificate.GetKeyAlgorithm" />
<MemberSignature Language="VB.NET" Value="Public Overridable Function GetKeyAlgorithm () As String" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual System::String ^ GetKeyAlgorithm();" />
<MemberSignature Language="F#" Value="abstract member GetKeyAlgorithm : unit -&gt; string&#xA;override this.GetKeyAlgorithm : unit -&gt; string" Usage="x509Certificate.GetKeyAlgorithm " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Security.Cryptography.X509Certificates</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8">
<AttributeName>System.Security.SecuritySafeCritical</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Returns the key algorithm information for this X.509v3 certificate as a string.</summary>
<returns>The key algorithm information for this X.509 certificate as a string.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following example uses the <xref:System.Security.Cryptography.X509Certificates.X509Certificate.GetKeyAlgorithm%2A> method to get a certificate's key algorithm in string format and displays it to the console.
[!code-cpp[X509Certificate.GetKeyAlgorithm Method#1](~/samples/snippets/cpp/VS_Snippets_CLR/X509Certificate.GetKeyAlgorithm Method/CPP/example.cpp#1)]
[!code-csharp[X509Certificate.GetKeyAlgorithm Method#1](~/samples/snippets/csharp/VS_Snippets_CLR/X509Certificate.GetKeyAlgorithm Method/CS/example.cs#1)]
[!code-vb[X509Certificate.GetKeyAlgorithm Method#1](~/samples/snippets/visualbasic/VS_Snippets_CLR/X509Certificate.GetKeyAlgorithm Method/VB/example.vb#1)]
]]></format>
</remarks>
<exception cref="T:System.Security.Cryptography.CryptographicException">The certificate context is invalid.</exception>
</Docs>
</Member>
<Member MemberName="GetKeyAlgorithmParameters">
<MemberSignature Language="C#" Value="public virtual byte[] GetKeyAlgorithmParameters ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance unsigned int8[] GetKeyAlgorithmParameters() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Security.Cryptography.X509Certificates.X509Certificate.GetKeyAlgorithmParameters" />
<MemberSignature Language="VB.NET" Value="Public Overridable Function GetKeyAlgorithmParameters () As Byte()" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual cli::array &lt;System::Byte&gt; ^ GetKeyAlgorithmParameters();" />
<MemberSignature Language="F#" Value="abstract member GetKeyAlgorithmParameters : unit -&gt; byte[]&#xA;override this.GetKeyAlgorithmParameters : unit -&gt; byte[]" Usage="x509Certificate.GetKeyAlgorithmParameters " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Security.Cryptography.X509Certificates</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8">
<AttributeName>System.Security.SecuritySafeCritical</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Byte[]</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Returns the key algorithm parameters for the X.509v3 certificate as an array of bytes.</summary>
<returns>The key algorithm parameters for the X.509 certificate as an array of bytes.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following example uses the <xref:System.Security.Cryptography.X509Certificates.X509Certificate.GetKeyAlgorithmParameters%2A> method to return a certificate's key algorithm parameters as an array of bytes and displays it to the console.
[!code-cpp[X509Certificate.GetKeyAlgorithmParameters Method#1](~/samples/snippets/cpp/VS_Snippets_CLR/X509Certificate.GetKeyAlgorithmParameters Method/CPP/example.cpp#1)]
[!code-csharp[X509Certificate.GetKeyAlgorithmParameters Method#1](~/samples/snippets/csharp/VS_Snippets_CLR/X509Certificate.GetKeyAlgorithmParameters Method/CS/example.cs#1)]
[!code-vb[X509Certificate.GetKeyAlgorithmParameters Method#1](~/samples/snippets/visualbasic/VS_Snippets_CLR/X509Certificate.GetKeyAlgorithmParameters Method/VB/example.vb#1)]
]]></format>
</remarks>
<exception cref="T:System.Security.Cryptography.CryptographicException">The certificate context is invalid.</exception>
</Docs>
</Member>
<Member MemberName="GetKeyAlgorithmParametersString">
<MemberSignature Language="C#" Value="public virtual string GetKeyAlgorithmParametersString ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance string GetKeyAlgorithmParametersString() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Security.Cryptography.X509Certificates.X509Certificate.GetKeyAlgorithmParametersString" />
<MemberSignature Language="VB.NET" Value="Public Overridable Function GetKeyAlgorithmParametersString () As String" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual System::String ^ GetKeyAlgorithmParametersString();" />
<MemberSignature Language="F#" Value="abstract member GetKeyAlgorithmParametersString : unit -&gt; string&#xA;override this.GetKeyAlgorithmParametersString : unit -&gt; string" Usage="x509Certificate.GetKeyAlgorithmParametersString " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Security.Cryptography.X509Certificates</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8">
<AttributeName>System.Security.SecuritySafeCritical</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Returns the key algorithm parameters for the X.509v3 certificate as a hexadecimal string.</summary>
<returns>The key algorithm parameters for the X.509 certificate as a hexadecimal string.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following example uses the <xref:System.Security.Cryptography.X509Certificates.X509Certificate.GetKeyAlgorithmParametersString%2A> method to return a certificate's key algorithm parameters in string format and displays it to the console.
[!code-cpp[X509Certificate.GetKeyAlgorithmParametersString#1](~/samples/snippets/cpp/VS_Snippets_CLR/X509Certificate.GetKeyAlgorithmParametersString/CPP/example.cpp#1)]
[!code-csharp[X509Certificate.GetKeyAlgorithmParametersString#1](~/samples/snippets/csharp/VS_Snippets_CLR/X509Certificate.GetKeyAlgorithmParametersString/CS/example.cs#1)]
[!code-vb[X509Certificate.GetKeyAlgorithmParametersString#1](~/samples/snippets/visualbasic/VS_Snippets_CLR/X509Certificate.GetKeyAlgorithmParametersString/VB/example.vb#1)]
]]></format>
</remarks>
<exception cref="T:System.Security.Cryptography.CryptographicException">The certificate context is invalid.</exception>
</Docs>
</Member>
<Member MemberName="GetName">
<MemberSignature Language="C#" Value="public virtual string GetName ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance string GetName() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Security.Cryptography.X509Certificates.X509Certificate.GetName" />
<MemberSignature Language="VB.NET" Value="Public Overridable Function GetName () As String" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual System::String ^ GetName();" />
<MemberSignature Language="F#" Value="abstract member GetName : unit -&gt; string&#xA;override this.GetName : unit -&gt; string" Usage="x509Certificate.GetName " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Security.Cryptography.X509Certificates</AssemblyName>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0">
<AttributeName>System.Obsolete("Use the Subject property.")</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netcore-2.0;netcore-2.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netstandard-2.0;netframework-4.8;netcore-2.2">
<AttributeName>System.Obsolete("This method has been deprecated. Please use the Subject property instead. http://go.microsoft.com/fwlink/?linkid=14202")</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8">
<AttributeName>System.Security.SecuritySafeCritical</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netcore-3.0;netstandard-2.1">
<AttributeName>System.Obsolete("This method has been deprecated. Please use the Subject property instead. https://go.microsoft.com/fwlink/?linkid=14202")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Returns the name of the principal to which the certificate was issued.</summary>
<returns>The name of the principal to which the certificate was issued.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following example uses the <xref:System.Security.Cryptography.X509Certificates.X509Certificate.GetName%2A> method to return the name of a certificate's principal and displays it to the console.
[!code-cpp[X509Certificate.GetName Method#1](~/samples/snippets/cpp/VS_Snippets_CLR/X509Certificate.GetName Method/CPP/example.cpp#1)]
[!code-csharp[X509Certificate.GetName Method#1](~/samples/snippets/csharp/VS_Snippets_CLR/X509Certificate.GetName Method/CS/example.cs#1)]
[!code-vb[X509Certificate.GetName Method#1](~/samples/snippets/visualbasic/VS_Snippets_CLR/X509Certificate.GetName Method/VB/example.vb#1)]
]]></format>
</remarks>
<exception cref="T:System.Security.Cryptography.CryptographicException">The certificate context is invalid.</exception>
</Docs>
</Member>
<Member MemberName="GetPublicKey">
<MemberSignature Language="C#" Value="public virtual byte[] GetPublicKey ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance unsigned int8[] GetPublicKey() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Security.Cryptography.X509Certificates.X509Certificate.GetPublicKey" />
<MemberSignature Language="VB.NET" Value="Public Overridable Function GetPublicKey () As Byte()" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual cli::array &lt;System::Byte&gt; ^ GetPublicKey();" />
<MemberSignature Language="F#" Value="abstract member GetPublicKey : unit -&gt; byte[]&#xA;override this.GetPublicKey : unit -&gt; byte[]" Usage="x509Certificate.GetPublicKey " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Security.Cryptography.X509Certificates</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8">
<AttributeName>System.Security.SecuritySafeCritical</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Byte[]</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Returns the public key for the X.509v3 certificate as an array of bytes.</summary>
<returns>The public key for the X.509 certificate as an array of bytes.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following example uses the <xref:System.Security.Cryptography.X509Certificates.X509Certificate.GetPublicKey%2A> method to return a certificate's public key as an array of bytes and displays it to the console.
[!code-cpp[X509Certificate.GetPublicKey Method#1](~/samples/snippets/cpp/VS_Snippets_CLR/X509Certificate.GetPublicKey Method/CPP/example.cpp#1)]
[!code-csharp[X509Certificate.GetPublicKey Method#1](~/samples/snippets/csharp/VS_Snippets_CLR/X509Certificate.GetPublicKey Method/CS/example.cs#1)]
[!code-vb[X509Certificate.GetPublicKey Method#1](~/samples/snippets/visualbasic/VS_Snippets_CLR/X509Certificate.GetPublicKey Method/VB/example.vb#1)]
]]></format>
</remarks>
<exception cref="T:System.Security.Cryptography.CryptographicException">The certificate context is invalid.</exception>
</Docs>
</Member>
<Member MemberName="GetPublicKeyString">
<MemberSignature Language="C#" Value="public virtual string GetPublicKeyString ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance string GetPublicKeyString() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Security.Cryptography.X509Certificates.X509Certificate.GetPublicKeyString" />
<MemberSignature Language="VB.NET" Value="Public Overridable Function GetPublicKeyString () As String" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual System::String ^ GetPublicKeyString();" />
<MemberSignature Language="F#" Value="abstract member GetPublicKeyString : unit -&gt; string&#xA;override this.GetPublicKeyString : unit -&gt; string" Usage="x509Certificate.GetPublicKeyString " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Security.Cryptography.X509Certificates</AssemblyName>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Returns the public key for the X.509v3 certificate as a hexadecimal string.</summary>
<returns>The public key for the X.509 certificate as a hexadecimal string.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following example uses the <xref:System.Security.Cryptography.X509Certificates.X509Certificate.GetPublicKeyString%2A> method to return a certificate's public key as a string and displays it to the console.
[!code-cpp[X509Certificate.GetPublicKeyString Method#1](~/samples/snippets/cpp/VS_Snippets_CLR/X509Certificate.GetPublicKeyString Method/CPP/example.cpp#1)]
[!code-csharp[X509Certificate.GetPublicKeyString Method#1](~/samples/snippets/csharp/VS_Snippets_CLR/X509Certificate.GetPublicKeyString Method/CS/example.cs#1)]
[!code-vb[X509Certificate.GetPublicKeyString Method#1](~/samples/snippets/visualbasic/VS_Snippets_CLR/X509Certificate.GetPublicKeyString Method/VB/example.vb#1)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="GetRawCertData">
<MemberSignature Language="C#" Value="public virtual byte[] GetRawCertData ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance unsigned int8[] GetRawCertData() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Security.Cryptography.X509Certificates.X509Certificate.GetRawCertData" />
<MemberSignature Language="VB.NET" Value="Public Overridable Function GetRawCertData () As Byte()" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual cli::array &lt;System::Byte&gt; ^ GetRawCertData();" />
<MemberSignature Language="F#" Value="abstract member GetRawCertData : unit -&gt; byte[]&#xA;override this.GetRawCertData : unit -&gt; byte[]" Usage="x509Certificate.GetRawCertData " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Security.Cryptography.X509Certificates</AssemblyName>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8">
<AttributeName>System.Security.SecuritySafeCritical</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Byte[]</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Returns the raw data for the entire X.509v3 certificate as an array of bytes.</summary>
<returns>A byte array containing the X.509 certificate data.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following example uses the <xref:System.Security.Cryptography.X509Certificates.X509Certificate.GetRawCertData%2A> method to return a certificate's raw data as an array of bytes and displays it to the console.
[!code-cpp[X509Certificate.GetRawCertData Method#1](~/samples/snippets/cpp/VS_Snippets_CLR/X509Certificate.GetRawCertData Method/CPP/example.cpp#1)]
[!code-csharp[X509Certificate.GetRawCertData Method#1](~/samples/snippets/csharp/VS_Snippets_CLR/X509Certificate.GetRawCertData Method/CS/example.cs#1)]
[!code-vb[X509Certificate.GetRawCertData Method#1](~/samples/snippets/visualbasic/VS_Snippets_CLR/X509Certificate.GetRawCertData Method/VB/example.vb#1)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="GetRawCertDataString">
<MemberSignature Language="C#" Value="public virtual string GetRawCertDataString ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance string GetRawCertDataString() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Security.Cryptography.X509Certificates.X509Certificate.GetRawCertDataString" />
<MemberSignature Language="VB.NET" Value="Public Overridable Function GetRawCertDataString () As String" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual System::String ^ GetRawCertDataString();" />
<MemberSignature Language="F#" Value="abstract member GetRawCertDataString : unit -&gt; string&#xA;override this.GetRawCertDataString : unit -&gt; string" Usage="x509Certificate.GetRawCertDataString " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Security.Cryptography.X509Certificates</AssemblyName>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Returns the raw data for the entire X.509v3 certificate as a hexadecimal string.</summary>
<returns>The X.509 certificate data as a hexadecimal string.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following example uses the <xref:System.Security.Cryptography.X509Certificates.X509Certificate.GetRawCertDataString%2A> method to return a certificate's raw data as a string and displays it to the console.
[!code-cpp[X509Certificate.GetRawCertDataString Method#1](~/samples/snippets/cpp/VS_Snippets_CLR/X509Certificate.GetRawCertDataString Method/CPP/example.cpp#1)]
[!code-csharp[X509Certificate.GetRawCertDataString Method#1](~/samples/snippets/csharp/VS_Snippets_CLR/X509Certificate.GetRawCertDataString Method/CS/example.cs#1)]
[!code-vb[X509Certificate.GetRawCertDataString Method#1](~/samples/snippets/visualbasic/VS_Snippets_CLR/X509Certificate.GetRawCertDataString Method/VB/example.vb#1)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="GetSerialNumber">
<MemberSignature Language="C#" Value="public virtual byte[] GetSerialNumber ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance unsigned int8[] GetSerialNumber() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Security.Cryptography.X509Certificates.X509Certificate.GetSerialNumber" />
<MemberSignature Language="VB.NET" Value="Public Overridable Function GetSerialNumber () As Byte()" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual cli::array &lt;System::Byte&gt; ^ GetSerialNumber();" />
<MemberSignature Language="F#" Value="abstract member GetSerialNumber : unit -&gt; byte[]&#xA;override this.GetSerialNumber : unit -&gt; byte[]" Usage="x509Certificate.GetSerialNumber " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Security.Cryptography.X509Certificates</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8">
<AttributeName>System.Security.SecuritySafeCritical</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Byte[]</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Returns the serial number of the X.509v3 certificate as an array of bytes in little-endian order.</summary>
<returns>The serial number of the X.509 certificate as an array of bytes in little-endian order.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following example uses the <xref:System.Security.Cryptography.X509Certificates.X509Certificate.GetSerialNumber%2A> method to return a certificate's serial number as an array of bytes and displays it to the console.
[!code-cpp[X509Certificate.GetSerialNumber Method#1](~/samples/snippets/cpp/VS_Snippets_CLR/X509Certificate.GetSerialNumber Method/CPP/example.cpp#1)]
[!code-csharp[X509Certificate.GetSerialNumber Method#1](~/samples/snippets/csharp/VS_Snippets_CLR/X509Certificate.GetSerialNumber Method/CS/example.cs#1)]
[!code-vb[X509Certificate.GetSerialNumber Method#1](~/samples/snippets/visualbasic/VS_Snippets_CLR/X509Certificate.GetSerialNumber Method/VB/example.vb#1)]
]]></format>
</remarks>
<exception cref="T:System.Security.Cryptography.CryptographicException">The certificate context is invalid.</exception>
</Docs>
</Member>
<Member MemberName="GetSerialNumberString">
<MemberSignature Language="C#" Value="public virtual string GetSerialNumberString ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance string GetSerialNumberString() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Security.Cryptography.X509Certificates.X509Certificate.GetSerialNumberString" />
<MemberSignature Language="VB.NET" Value="Public Overridable Function GetSerialNumberString () As String" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual System::String ^ GetSerialNumberString();" />
<MemberSignature Language="F#" Value="abstract member GetSerialNumberString : unit -&gt; string&#xA;override this.GetSerialNumberString : unit -&gt; string" Usage="x509Certificate.GetSerialNumberString " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Security.Cryptography.X509Certificates</AssemblyName>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Returns the serial number of the X.509v3 certificate as a little-endian hexadecimal string .</summary>
<returns>The serial number of the X.509 certificate as a little-endian hexadecimal string.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following example uses the <xref:System.Security.Cryptography.X509Certificates.X509Certificate.GetSerialNumberString%2A> method to return a certificate's serial number as a string and displays it to the console.
[!code-cpp[X509Certificate.GetSerialNumberString Method#1](~/samples/snippets/cpp/VS_Snippets_CLR/X509Certificate.GetSerialNumberString Method/CPP/example.cpp#1)]
[!code-csharp[X509Certificate.GetSerialNumberString Method#1](~/samples/snippets/csharp/VS_Snippets_CLR/X509Certificate.GetSerialNumberString Method/CS/example.cs#1)]
[!code-vb[X509Certificate.GetSerialNumberString Method#1](~/samples/snippets/visualbasic/VS_Snippets_CLR/X509Certificate.GetSerialNumberString Method/VB/example.vb#1)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="Handle">
<MemberSignature Language="C#" Value="public IntPtr Handle { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance native int Handle" />
<MemberSignature Language="DocId" Value="P:System.Security.Cryptography.X509Certificates.X509Certificate.Handle" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property Handle As IntPtr" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property IntPtr Handle { IntPtr get(); };" />
<MemberSignature Language="F#" Value="member this.Handle : nativeint" Usage="System.Security.Cryptography.X509Certificates.X509Certificate.Handle" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Security.Cryptography.X509Certificates</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netframework-4.8">
<AttributeName>System.Runtime.InteropServices.ComVisible(false)</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netcore-1.0;netcore-1.1;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netstandard-1.3;netstandard-1.4;netstandard-1.6;netframework-4.8">
<AttributeName>get: System.Security.SecurityCritical</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.IntPtr</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets a handle to a Microsoft Cryptographic API certificate context described by an unmanaged <see langword="PCCERT_CONTEXT" /> structure.</summary>
<value>An <see cref="T:System.IntPtr" /> structure that represents an unmanaged <see langword="PCCERT_CONTEXT" /> structure.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The handle is valid only for the lifetime of the <xref:System.Security.Cryptography.X509Certificates.X509Certificate> object.
]]></format>
</remarks>
<permission cref="T:System.Security.SecurityCriticalAttribute">requires full trust for the immediate caller. This class cannot be used by partially trusted or transparent code.</permission>
<permission cref="F:System.Security.Permissions.SecurityAction.InheritanceDemand">for the ability to execute unmanaged code. Associated enumeration: <see cref="F:System.Security.Permissions.SecurityPermissionFlag.UnmanagedCode" /></permission>
</Docs>
</Member>
<MemberGroup MemberName="Import">
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Populates an <see cref="T:System.Security.Cryptography.X509Certificates.X509Certificate" /> object.</summary>
</Docs>
</MemberGroup>
<Member MemberName="Import">
<MemberSignature Language="C#" Value="public virtual void Import (byte[] rawData);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void Import(unsigned int8[] rawData) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Security.Cryptography.X509Certificates.X509Certificate.Import(System.Byte[])" />
<MemberSignature Language="VB.NET" Value="Public Overridable Sub Import (rawData As Byte())" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual void Import(cli::array &lt;System::Byte&gt; ^ rawData);" />
<MemberSignature Language="F#" Value="abstract member Import : byte[] -&gt; unit&#xA;override this.Import : byte[] -&gt; unit" Usage="x509Certificate.Import rawData" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Security.Cryptography.X509Certificates</AssemblyName>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netframework-4.8">
<AttributeName>System.Runtime.InteropServices.ComVisible(false)</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8">
<AttributeName>System.Security.SecurityCritical</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="rawData" Type="System.Byte[]" Index="0" FrameworkAlternate="netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netstandard-2.1" />
</Parameters>
<Docs>
<param name="rawData">A byte array containing data from an X.509 certificate.</param>
<summary>Populates the <see cref="T:System.Security.Cryptography.X509Certificates.X509Certificate" /> object with data from a byte array.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method can be used to take the raw byte array of an X.509 certificate and populate the <xref:System.Security.Cryptography.X509Certificates.X509Certificate> object with its associated values.
]]></format>
</remarks>
<exception cref="T:System.ArgumentException">The <paramref name="rawData" /> parameter is <see langword="null" />.
-or-
The length of the <paramref name="rawData" /> parameter is 0.</exception>
<permission cref="T:System.Security.SecurityCriticalAttribute">requires full trust for the immediate caller. This class cannot be used by partially trusted or transparent code.</permission>
<permission cref="F:System.Security.Permissions.SecurityAction.InheritanceDemand">for full trust for inheritors. This member cannot be inherited by partially trusted code.</permission>
<permission cref="T:System.Security.Permissions.KeyContainerPermission">for permission to create a key container. Security action: <see cref="F:System.Security.Permissions.SecurityAction.Demand" />. Associated enumeration: <see cref="F:System.Security.Permissions.KeyContainerPermissionFlags.Create" /></permission>
</Docs>
</Member>
<Member MemberName="Import">
<MemberSignature Language="C#" Value="public virtual void Import (string fileName);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void Import(string fileName) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Security.Cryptography.X509Certificates.X509Certificate.Import(System.String)" />
<MemberSignature Language="VB.NET" Value="Public Overridable Sub Import (fileName As String)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual void Import(System::String ^ fileName);" />
<MemberSignature Language="F#" Value="abstract member Import : string -&gt; unit&#xA;override this.Import : string -&gt; unit" Usage="x509Certificate.Import fileName" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Security.Cryptography.X509Certificates</AssemblyName>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netframework-4.8">
<AttributeName>System.Runtime.InteropServices.ComVisible(false)</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8">
<AttributeName>System.Security.SecurityCritical</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="fileName" Type="System.String" Index="0" FrameworkAlternate="netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netstandard-2.1" />
</Parameters>
<Docs>
<param name="fileName">The name of a certificate file represented as a string.</param>
<summary>Populates the <see cref="T:System.Security.Cryptography.X509Certificates.X509Certificate" /> object with information from a certificate file.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method uses a certificate file (such as a file with a .cer extension) that represents an X.509 certificate, and populates the <xref:System.Security.Cryptography.X509Certificates.X509Certificate> object with the certificate that the file contains.
## Examples
The following example loads an X.509 certificate from a file, calls the <xref:System.Security.Cryptography.X509Certificates.X509Certificate.ToString%2A> method, and displays the results to the console.
[!code-cpp[Cryptography.X509Certificates.X509Certificate.Import#1](~/samples/snippets/cpp/VS_Snippets_CLR/Cryptography.X509Certificates.X509Certificate.Import/CPP/sample.cpp#1)]
[!code-csharp[Cryptography.X509Certificates.X509Certificate.Import#1](~/samples/snippets/csharp/VS_Snippets_CLR/Cryptography.X509Certificates.X509Certificate.Import/CS/sample.cs#1)]
[!code-vb[Cryptography.X509Certificates.X509Certificate.Import#1](~/samples/snippets/visualbasic/VS_Snippets_CLR/Cryptography.X509Certificates.X509Certificate.Import/VB/sample.vb#1)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentException">The <paramref name="fileName" /> parameter is <see langword="null" />.</exception>
<permission cref="T:System.Security.SecurityCriticalAttribute">requires full trust for the immediate caller. This class cannot be used by partially trusted or transparent code.</permission>
<permission cref="F:System.Security.Permissions.SecurityAction.InheritanceDemand">for full trust for inheritors. This member cannot be inherited by partially trusted code.</permission>
<permission cref="T:System.Security.Permissions.FileIOPermission">for permission to read the file described by the <paramref name="fileName" /> parameter. Security action: <see cref="F:System.Security.Permissions.SecurityAction.Demand" />. Associated enumeration: <see cref="F:System.Security.Permissions.EnvironmentPermissionAccess.Read" /></permission>
<permission cref="T:System.Security.Permissions.KeyContainerPermission">for permission to create a key container. Security action: <see cref="F:System.Security.Permissions.SecurityAction.Demand" />. Associated enumeration: <see cref="F:System.Security.Permissions.KeyContainerPermissionFlags.Create" /></permission>
</Docs>
</Member>
<Member MemberName="Import">
<MemberSignature Language="C#" Value="public virtual void Import (byte[] rawData, System.Security.SecureString password, System.Security.Cryptography.X509Certificates.X509KeyStorageFlags keyStorageFlags);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void Import(unsigned int8[] rawData, class System.Security.SecureString password, valuetype System.Security.Cryptography.X509Certificates.X509KeyStorageFlags keyStorageFlags) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Security.Cryptography.X509Certificates.X509Certificate.Import(System.Byte[],System.Security.SecureString,System.Security.Cryptography.X509Certificates.X509KeyStorageFlags)" />
<MemberSignature Language="VB.NET" Value="Public Overridable Sub Import (rawData As Byte(), password As SecureString, keyStorageFlags As X509KeyStorageFlags)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual void Import(cli::array &lt;System::Byte&gt; ^ rawData, System::Security::SecureString ^ password, System::Security::Cryptography::X509Certificates::X509KeyStorageFlags keyStorageFlags);" />
<MemberSignature Language="F#" Value="abstract member Import : byte[] * System.Security.SecureString * System.Security.Cryptography.X509Certificates.X509KeyStorageFlags -&gt; unit&#xA;override this.Import : byte[] * System.Security.SecureString * System.Security.Cryptography.X509Certificates.X509KeyStorageFlags -&gt; unit" Usage="x509Certificate.Import (rawData, password, keyStorageFlags)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Security.Cryptography.X509Certificates</AssemblyName>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netstandard-2.1">
<AttributeName>System.CLSCompliant(false)</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8">
<AttributeName>System.Security.SecurityCritical</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="rawData" Type="System.Byte[]" Index="0" FrameworkAlternate="netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netstandard-2.1" />
<Parameter Name="password" Type="System.Security.SecureString" Index="1" FrameworkAlternate="netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netstandard-2.1" />
<Parameter Name="keyStorageFlags" Type="System.Security.Cryptography.X509Certificates.X509KeyStorageFlags" Index="2" FrameworkAlternate="netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netstandard-2.1" />
</Parameters>
<Docs>
<param name="rawData">A byte array that contains data from an X.509 certificate.</param>
<param name="password">The password required to access the X.509 certificate data.</param>
<param name="keyStorageFlags">A bitwise combination of the enumeration values that control where and how to import the certificate.</param>
<summary>Populates an <see cref="T:System.Security.Cryptography.X509Certificates.X509Certificate" /> object using data from a byte array, a password, and a key storage flag.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks