[xmlsec] [PATCH] Load keys from memory and question about keys
Aleksey Sanin
aleksey at aleksey.com
Fri Aug 8 09:22:07 PDT 2003
> here is a patch that allows loading of keys from memory.
Thanks! The patch is applied and commited with a minor change to replace
"const xmlSecBuffer" with just "xmlSecBuffer" in xmlSecKeyReadBuffer ()
function parameters list. The reason is that xmlSecBuffer operations might
not be const due to internal implementation. For example, it might,
xmlSecBuffer
implementationn might be optimized for "append" operation and it would keep
a list of memory blocks instead one re-allocated block. Thus when you can
xmlSecBufferGetData () this causes the creation of one big memory block
from a list of blocks. This is not implemented yet but it might be at
some point :)
> Now my question:
> Is there a way to determine the xmlSecKeyDataId from the "Algorithm"
> attribute
> in an encrypted XML file?
Yes, you already did almost everything :) If you have transform klass
(transform id)
then you can call xmlSecTransformSetKeyRequirementsMethod () function to
populate
xmlSecKeyReqPtr structure with the key requirements for this transorm.
Now look
inside the xmlSecKeyReqPtr structure and you'll have the keyId, keyType
(public/private)
and keyBitsSize.
Thanks again for the patch!
Aleksey
More information about the xmlsec
mailing list