MailBee.NET Objects 4.0

Certificate.SaveToFile Method 

Saves the certificate into a file on disk.

public bool SaveToFile(
   string filename,
   CertFileType fileType,
   string pfxPassword
);

Parameters

filename
The path to the file.
fileType
The format of the file to save.
pfxPassword
PFX password if fileType is Pfx, or a null reference (Nothing in Visual Basic).

Return Value

true if the certificate was successfully saved to disk; otherwise, false.

Exceptions

Exception Type Condition
MailBeeInvalidArgumentException is a null reference (Nothing in Visual Basic) or an empty string.
MailBeeIOException The specified file can not be written to.
MailBeeCertificateWin32Exception Win32 returned an error during during processing the certificate data.

See Also

Certificate Class | MailBee.Security Namespace | Certificate | Certificate