Save keyfile with a new password.
Namespace: FirmaSATAssembly: diFirmaSatNet (in diFirmaSatNet.dll) Version: 10.70.0.38178 (10.70.0.0)
Syntaxpublic static int NewKeyFile(
string newFile,
string newPassword,
string keyFile,
string keyPassword,
KeyFormat format
)
Public Shared Function NewKeyFile (
newFile As String,
newPassword As String,
keyFile As String,
keyPassword As String,
format As KeyFormat
) As Integer
Parameters
- newFile String
- Name of new output file to be created.
- newPassword String
- Password for new key file.
- keyFile String
- Name of input key file (or a string containing the key in PEM form).
- keyPassword String
- Password for existing key file.
- format KeyFormat
- Format to save file [default = DER binary].
Return Value
Int32Zero (0) if output file is successfully created, or a negative
error code.
Examplestring password = "12345678a";
string newpassword = "password123";
int n = Sat.NewKeyFile("emisor_new.pem", newpassword, "emisor.key", password, KeyFormat.PEM);
Debug.Assert(n == 0, "Sat.NewKeyFile failed");
Console.WriteLine(File.ReadAllText("emisor_new.pem"));
See Also