[Pyxmlsec-devel] xmlsec in python
dieter at handshake.de
Wed Feb 22 07:56:31 CET 2012
> I am trying to decrypt an xml message in python using PyXMLSec.
> I have found the examples on
> and accordingly did the following, but am receiving errors from the c
> library, which I really don't understand.
> != NULL:error=100:assertion:
> library function failed:
> library function failed:filename=my.private.key
I agree that the problem messages from "xmlsec" are mostly helpful
for the developer (or other people who have its source at hand
and are willing to consult it).
In your case, the function "xmlSecKeyDataBinRead" (called from
"xmlSecKeyReadBinaryFile" via intermediate "xmlSecKeyReadBuffer"
-- i.e. the problem message is similar to a Python traceback with
the most recent call at the top) is obviously unhappy
with your key data: Something which should be "NULL" is not.
If you are using "xmlsec" on a 64 bit architecture, then this
might result from "xmlsec" and "pyxmlsec" being compiled with
incompatible compile time options. The archive of this mailing
list contains a patch for "pyxmlsec" to fix this problem.
If not, I would guess that for some reason, your private key file
does not contain a binary RSA key. Maybe, it uses another format, e.g.
the "PEM" format. Have a look at the file content: the "PEM" format
is human readable (it essentially contains the base64 encoded key)
while a true binary key is unreadable.
More information about the Pyxmlsec-devel