chilkat decryptStringENC TypeError: in method 'CkRsa_decryptStringENC'
Question: I downloaded a trial version for 64-bit Python 2.7:
chilkat-9.3.2-python-2.7-x86_64-linux.tar.gz. I found a strange problem: when
I wrote one method (decrypRSA() as follow) which will decode given RSA
encrypted string, it works only if I call it directly in command line in
linux. It will difinitely throw exception when it was called in other method
to response an http request. I haven't found any trouble shoot for this issue
on website.

    
    
    Here is the exception stack track:
    
    File "/data/api_test.xxx.com/0/v0/share/auth/utils.py", line 301, in decrypRSA
        return rsa.decryptStringENC(encodedText,False)
      File "/usr/local/lib/python2.7/site-packages/chilkat.py", line 1319, in decryptStringENC
        def decryptStringENC(self, *args): return _chilkat.CkRsa_decryptStringENC(self, *args)
    
    TypeError: in method 'CkRsa_decryptStringENC', argument 2 of type 'char const *'
    
    
    And here is the definition for decrypRSA() method:
    
    
        @staticmethod
        def decrypRSA(encodedText, publicKey):
            print ('Utils.decrypRSA()-parameters: encodeText=%s, public key=%s' % (encodedText, publicKey,))
            rsa = CkRsa()
            success = rsa.UnlockComponent("30-day trial")
            if (success != True):
                logging.info("Utils.decrypRSA(): RSA component unlock failed")
                return ''
            #  Import the public key into the RSA object:
            success = rsa.ImportPublicKey(publicKey)
            if (success != True):
                logging.info("Utils.decrypRSA(): RSA failed to import public key: %s" % rsa.lastErrorText())
                return ''
            rsa.put_EncodingMode("base64")
            rsa.put_LittleEndian(True)
            return rsa.decryptStringENC(encodedText,False)
    


Answer: I don't know if it's something internal, or if the encodedText is something
you're passing in. It could be an issue with a unicode string being cast to
something other than 'char const *'. In this case, you could either encode the
string, or use a regular ascii string instead of a unicode string.

Saw this: <https://github.com/chokkan/simstring/issues/6>

