What is the cause of this error?
ChilkatLog: OpenSslSignStringENC: DllDate: Aug 15 2013 ChilkatVersion: 220.127.116.11 UnlockPrefix: xxx Username: xxx Architecture: Little Endian; 32-bit Language: ActiveX VerboseLogging: 0 inputNumBytes: 16 modulusBitlen: 1024 RSA_padAndSign: KeyType: Private HashInSize: 16 modulusBitlen: 1024 paddedInSize: 128 Private key required, but not provided sigOutSize: 0 --RSA_padAndSign signatureNumBytes: 0 Failed. --OpenSslSignStringENC --ChilkatLog
this is my script using PowerBuilder (all declarations and results checks omitted):
loo_Cert.ConnectToNewObject("Chilkat_9_5_0.Cert") loo_Cert.LoadFromFile("x.cer") loo_PubKey = loo_Cert.ExportPublicKey()
BUT ls_Sig IS EMPTY !!!
asked Nov 26 '15 at 10:31
The problem is that a private key is required for creating signatures. A .cer file contains only a certificate (and by default the cert's public key). It does not contain the associated private key. Typically, private keys are stored in .pfx/.p12 files, or in Java KeyStore files. (They may also be pre-installed on Windows systems.) The solution is to load the private key and call loo_Rsa.ImportPrivateKey before trying to create the signature via OpenSslSignStringENC.
answered Nov 26 '15 at 10:34
I've got the same problem, trying to duplicate the openssl rsautl command using a .cer file.
it works, and the certificate is the same!
answered Dec 10 '15 at 04:27