Creates a new instance of the Certificate class by reading a certificate from a PEM encoded file.

Namespace: LLCryptoLib.Security.Certificates
Assembly: LLCryptoLib (in LLCryptoLib.dll) Version: 2.0.1024.0 (2.0.1024)

Syntax

C#
public static Certificate CreateFromPemFile(
	string filename
)
Visual Basic
Public Shared Function CreateFromPemFile ( _
	filename As String _
) As Certificate
Visual C++
public:
static Certificate^ CreateFromPemFile(
	String^ filename
)

Parameters

filename
Type: System..::..String
The path to the PEM file.

Return Value

A Certificate instance.

Remarks

This implementation only reads certificates from PEM files. It does not read the private key from the certificate file, if one is present.

Exceptions

ExceptionCondition
System..::..ArgumentNullExceptionfilename if a null reference (Nothing in Visual Basic).
System.IO..::..IOExceptionAn error occurs while reading from the file.
LLCryptoLib.Security.Certificates..::..CertificateExceptionAn error occurs while reading the certificate from the PEM blob.

See Also