Click or drag to resize

SatWritePfxFile Method

Create PFX (PKCS-12) file in PEM format suitable for a Cancelación.

Namespace: FirmaSAT
Assembly: diFirmaSatNet (in diFirmaSatNet.dll) Version: 10.70.0.38178 (10.70.0.0)
Syntax
public static int WritePfxFile(
	string pfxFile,
	string pfxPassword,
	string keyFile,
	string keyPassword,
	string certFile,
	PfxFormat pfxFormat = PfxFormat.Default
)

Parameters

pfxFile  String
Name of output PFX file to be created
pfxPassword  String
Password to open new PFX file
keyFile  String
Name of encrypted key file
keyPassword  String
Password for encrypted key file
certFile  String
Name of X.509 certificate file
pfxFormat  PfxFormat  (Optional)
Output format for PFX file (optional, default=plain base64)

Return Value

Int32
Zero (0) if output file is successfully created, or a negative error code.
Example
C#
string password = "12345678a";
string newpassword = "clavedesalida";
int n = Sat.WritePfxFile("archivo_new-pfx.txt", newpassword, "emisor.key", password, "emisor.cer");
Debug.Assert(n == 0, "Sat.WritePfxFile failed");
Console.WriteLine(File.ReadAllText("archivo_new-pfx.txt"));
// MIIMOQIBAzCCC/8GCSqGSIb3DQEHAaCCC/AEggvsMIIL6DCCBp8GCSqGSIb3DQEH ...
See Also