Create PFX (PKCS-12) file in PEM format suitable for a Cancelación.
Namespace: FirmaSATAssembly: diFirmaSatNet (in diFirmaSatNet.dll) Version: 10.70.0.38178 (10.70.0.0)
Syntaxpublic static int WritePfxFile(
string pfxFile,
string pfxPassword,
string keyFile,
string keyPassword,
string certFile,
PfxFormat pfxFormat = PfxFormat.Default
)
Public Shared Function WritePfxFile (
pfxFile As String,
pfxPassword As String,
keyFile As String,
keyPassword As String,
certFile As String,
Optional pfxFormat As PfxFormat = PfxFormat.Default
) As Integer
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
Int32Zero (0) if output file is successfully created, or a negative
error code.
Examplestring 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"));
See Also