alguien sabe como pasar "openssl rsa -in filekey.pem -des3 -out fileenc.key -passout pass:'wordpaswors'" a instrucciones de chilkat.
cabe mencionar que esa instrucción es para encriptar llaves de certificados según lo requiere el pac FINKOK para la cancelación.
* Objetos
TRY
loPkey = CreateObject('Chilkat.PrivateKey')
CATCH
aux_error = .t.
ENDTRY
IF aux_error
DO FORM LOCFILE('formularios\mensaje_eli.scx') WITH "No se puede crear el objeto Chilkat.PrivateKey" + RIGHT(aux_tex_crearxml,26),.t.
RETURN .f.
ENDIF
*
TRY
locrypt = CreateObject('Chilkat.Crypt2')
CATCH
aux_error = .t.
ENDTRY
IF aux_error
DO FORM LOCFILE('formularios\mensaje_eli.scx') WITH "No se puede crear el objeto Chilkat.PrivateKey" + RIGHT(aux_tex_crearxml,26),.t.
RETURN .f.
ENDIF
*
TRY
loCert = CreateObject('Chilkat.Cert')
CATCH
aux_error = .t.
ENDTRY
IF aux_error
DO FORM LOCFILE('formularios\mensaje_eli.scx') WITH "No se puede crear el objeto Chilkat.Cert" + RIGHT(aux_tex_crearxml,26),.t.
RETURN .f.
ENDIF
* Load the Certificado
TRY
loCert.LoadFromFile(arcer)
CATCH
aux_error = .t.
ENDTRY
IF aux_error
DO FORM LOCFILE('formularios\mensaje_eli.scx') WITH "No se encontro el archivo de certificado." + RIGHT(aux_tex_crearxml,26),.t.
RETURN .f.
ENDIF
* Load the private key from an RSA PEM file:
TRY
loPkey.LoadPkcs8EncryptedFile(arkey, PasswordKey)
CATCH
aux_error = .t.
ENDTRY
IF aux_error
DO FORM LOCFILE('formularios\mensaje_eli.scx') WITH "No se encontro el archivo de Llave (*.key)." + RIGHT(aux_tex_crearxml,26),.t.
RETURN .f.
ENDIF
*
* Get the private key in XML format:
TRY
lcPkeypem = loPkey.GetPkcs8EncryptedPem('NewPasswordkey')
CATCH
aux_error = .t.
ENDTRY
IF aux_error
RETURN .f.
ENDIF
*
locrypt.CryptAlgorithm = '3des'
key_can = locrypt.Encode(lcPkeypem, 'base64')
cer_can = SubStr(loCert.GetEncoded(), 1, Len(loCert.GetEncoded()) - 2)