Mentalis.org Security Library documentation

Certificate.CreateFromPemFile Method (Byte[])

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

[Visual Basic]
Overloads Public Shared Function CreateFromPemFile( _
   ByVal file As Byte() _
) As Certificate
[C#]
public static Certificate CreateFromPemFile(
   byte[] file
);

Parameters

file
The contents of 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

Exception TypeCondition
ArgumentNullExceptionfile if a null reference (Nothing in Visual Basic).
CertificateExceptionAn error occurs while reading the certificate from the PEM blob.

See Also

Certificate Class | Org.Mentalis.Security.Certificates Namespace | Certificate.CreateFromPemFile Overload List