X509CertificateLoader.LoadCertificateFromFile(String) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Loads a single X.509 certificate (in either the PEM or DER encoding) from the specified file.
public:
static System::Security::Cryptography::X509Certificates::X509Certificate2 ^ LoadCertificateFromFile(System::String ^ path);
public static System.Security.Cryptography.X509Certificates.X509Certificate2 LoadCertificateFromFile (string path);
static member LoadCertificateFromFile : string -> System.Security.Cryptography.X509Certificates.X509Certificate2
Public Shared Function LoadCertificateFromFile (path As String) As X509Certificate2
Parameters
- path
- String
The path of the file to open.
Returns
The loaded certificate.
Exceptions
path
is null
.
The data did not load as a valid X.509 certificate.
An error occurred while loading the specified file.
Remarks
This method only loads plain certificates, which are identified as Cert by GetCertContentType(String)
Applies to
See also
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.