Module xmlsec
[frames | no frames]

Module xmlsec

PyXMLSec - Python bindings for XML Security library (XMLSec)
Copyright (C) 2003-2005 Easter-eggs, Valery Febvre

Author   : Valéry Febvre <vfebvre@easter-eggs.com>
Homepage : http://pyxmlsec.labs.libre-entreprise.org

PyXMLSec was originally developped for Glasnost project.
http://glasnost.entrouvert.org

In 2003, the development of Glasnost is supported by the French Department of
Economy, Finance and Industry, as part of the UCIP - Collective Use of Internet
by SMEs - programme.

Classes
Base64Ctx  
Buffer  
DSigCtx  
DSigReferenceCtx  
EncCtx  
Key  
KeyData  
KeyDataId  
KeyInfoCtx  
KeyReq  
KeysMngr  
KeyStore  
KeyStoreId  
NodeSet  
PtrList  
PtrListId  
TmplCipherReference  
TmplEncData  
TmplKeyInfo  
TmplManifest  
TmplObject  
TmplReference  
TmplRetrievalMethod  
TmplSignature  
TmplTransform  
Transform  
TransformCtx  
TransformId  

Exceptions
Error  

Function Summary
  addChild(parent, name, ns)
Adds a child to the node parent with given name and namespace ns.
  addIDs(doc, cur, ids)
Walks thru all children of the cur node and adds all attributes from the ids list to the doc document IDs attributes hash.
  addNextSibling(node, name, ns)
Adds next sibling to the node node with given name and namespace ns.
  addPrevSibling(node, name, ns)
Adds prev sibling to the node node with given name and namespace ns.
  base64Decode(str)
Decodes input base64 encoded string.
  base64Encode(buf, columns)
Encodes the data from input buffer.
  bufferSetDefaultAllocMode(defAllocMode, defInitialSize)
Sets new global default allocation mode and minimal intial size.
  checkNodeName(cur, name, ns)
Checks that the node has a given name and a given namespace href.
  checkVersion()
Returns 1 if the loaded xmlsec library version ABI compatible with the one used to compile the caller, 0 if it does not or a negative value if an error occurs.
  checkVersionExact()
Returns 1 if the loaded xmlsec library version exactly matches the one used to compile the caller, 0 if it does not or a negative value if an error occurs.
  checkVersionExt(major, minor, subminor, mode)
Checks if the loaded version of xmlsec library could be used.
  createTree(rootNodeName, rootNodeNs)
Creates a new XML tree with one root node rootNodeName.
  cryptoAppDefaultKeysMngrAdoptKey(mngr, key)
Adds key to the keys manager mngr created with cryptoAppDefaultKeysMngrInit function.
  cryptoAppDefaultKeysMngrInit(mngr)
Initializes mngr with simple keys store simpleKeysStoreId and a default crypto key data stores.
  cryptoAppDefaultKeysMngrLoad(mngr, uri)
Loads XML keys file from uri to the keys manager mngr created with cryptoAppDefaultKeysMngrInit function.
  cryptoAppDefaultKeysMngrSave(mngr, filename, type)
Saves keys from mngr to XML keys file.
  cryptoAppGetDefaultPwdCallback()
Gets default password callback.
  cryptoAppInit(config)
General crypto engine initialization.
  cryptoAppKeyCertLoad(key, filename, format)
Reads the certificate from filename and adds it to key.
  cryptoAppKeyLoad(filename, format, pwd, pwdCallback, pwdCallbackCtx)
Reads key from filename.
  cryptoAppKeysMngrCertLoad(mngr, filename, format, type)
Reads cert from filename and adds to the list of trusted or known untrusted certs in store.
  cryptoAppPkcs12Load(filename, pwd, pwdCallback, pwdCallbackCtx)
Reads key and all associated certificates from the PKCS12 file.
  cryptoAppShutdown()
General crypto engine shutdown.
  cryptoInit()
XMLSec library specific crypto engine initialization.
  cryptoKeysMngrInit(mngr)
Adds crypto specific key data stores in keys manager.
  cryptoShutdown()
XMLSec library specific crypto engine shutdown.
  dsigReferenceCtxListId()
Returns : <dsig:Reference/> element processing context list id.
  errorsSetCallback(callback)
Sets the errors callback function to callback that will be called every time an error occurs.
  findChild(parent, name, ns)
Searches a direct child of the parent node having given name and namespace href.
  findNode(parent, name, ns)
Searches all children of the parent node having given name and namespace href.
  findParent(cur, name, ns)
Searches the ancestors axis of the cur node for a node having given name and namespace href.
  getHex(c)
Gets the hex value of a character.
  getNextElementNode(cur)
Seraches for the next element node.
  getNodeNsHref(cur)
Gets node's namespace href.
  init()
Initializes XML Security Library.
  isEmptyNode(node)
Checks whethere the node is empty (i.e.
  isEmptyString(str)
Checks whethere the str is empty (i.e.
  isHex(c)
Returns 1 if a character is a hex digit or 0 otherwise.
  keyCopy(keyDst, keySrc)
Copies key data from keySrc to keyDst.
  keyDataAesId()
The AES key data id.
  keyDataBinRead(id, key, buf, bufSize, keyInfoCtx)
Reads the key data of klass id from binary buffer buf to key.
  keyDataBinWrite(id, key, buf, bufSize, keyInfoCtx)
Writes the key data of klass id from the key to a binary buffer buf.
  keyDataDesId()
The DES key data id.
  keyDataDsaId()
The DSA key data id.
  keyDataEncryptedKeyId()
The <enc:EncryptedKey/> element key data id (http://www.w3.org/TR/xmlenc-core/sec-EncryptedKey) The EncryptedKey element is used to transport encryption keys from the originator to a known recipient(s).
  keyDataHmacId()
The HMAC key data id.
  keyDataIdsGet()
Gets global registered key data klasses list.
  keyDataIdsInit()
Initializes the key data klasses.
  keyDataIdsRegister(id)
Registers id in the global list of key data klasses.
  keyDataIdsRegisterDefault()
Registers default (implemented by XML Security Library) key data klasses: <dsig:KeyName/> element processing klass, <dsig:KeyValue/> element processing klass, ...
  keyDataIdsShutdown()
Shuts down the keys data klasses.
  keyDataNameId()
The <dsig:KeyName/> element key data id (http://www.w3.org/TR/xmldsig-core/sec-KeyName) The KeyName element contains a string value (in which white space is significant) which may be used by the signer to communicate a key identifier to the recipient.
  keyDataRawX509CertId()
The raw X509 cert key data id.
  keyDataRetrievalMethodId()
The <dsig:RetrievalMethod/> element key data id (http://www.w3.org/TR/xmldsig-core/sec-RetrievalMethod) A RetrievalMethod element within KeyInfo is used to convey a reference to KeyInfo information that is stored at another location.
  keyDataRsaId()
The RSA key data id.
  keyDataValueId()
The <dsig:KeyValue/> element key data id (http://www.w3.org/TR/xmldsig-core/sec-KeyValue) The KeyValue element contains a single public key that may be useful in validating the signature.
  keyDataX509Id()
The X509 key data id.
  keyDataXmlRead(id, key, node, keyInfoCtx)
Reads the key data of klass id from XML node and adds them to key.
  keyDataXmlWrite(id, key, node, keyInfoCtx)
Writes the key data of klass id from key to an XML node.
  keyGenerate(dataId, sizeBits, type)
Generates new key of requested klass dataId and type.
  keyGenerateByName(name, sizeBits, type)
Generates new key of requested klass and type.
  keyInfoCtxCopyUserPref(dst, src)
Copies user preferences from src context to dst context.
  keyInfoNodeRead(keyInfoNode, key, keyInfoCtx)
Parses the <dsig:KeyInfo/> element keyInfoNode, extracts the key data and stores into key.
  keyInfoNodeWrite(keyInfoNode, key, keyInfoCtx)
Writes the key into the <dsig:KeyInfo/> element template keyInfoNode.
  keyPtrListId()
Returns the keys list klass.
  keyReadBinaryFile(dataId, filename)
Reads the key value of klass dataId from a binary file filename.
  keyReadBuffer(dataId, buffer)
Reads the key value of klass dataId from a buffer.
  keyReadMemory(dataId, data, dataSize)
Reads the key value of klass dataId from a memory block data.
  keyReqCopy(dst, src)
Copies key requirements from src object to dst object.
  keysMngrGetKey(keyInfoNode, keyInfoCtx)
Reads the <dsig:KeyInfo/> node keyInfoNode and extracts the key.
  nodeGetName(node)
Gets node's name.
  nodeSetAdd(nset, newNSet, op)
Adds newNSet to the nset using operation op.
  nodeSetAddList(nset, newNSet, op)
Adds newNSet to the nset as child using operation op.
  nodeSetGetChildren(doc, parent, withComments, invert)
Creates a new nodes set that contains: - if withComments is not 0 and invert is 0: all nodes in the parent subtree; - if withComments is 0 and invert is 0: all nodes in the parent subtree except comment nodes; - if withComments is not 0 and invert not is 0: all nodes in the doc except nodes in the parent subtree; - if withComments is 0 and invert is 0: all nodes in the doc except nodes in the parent subtree and comment nodes.
  parseFile(filename)
Loads XML Doc from file filename.
  parseMemory(buffer, size, recovery)
Loads XML Doc from memory.
  parseMemoryExt(prefix, prefixSize, buffer, bufferSize, postfix, postfixSize)
Loads XML Doc from 3 chunks of memory: prefix, buffer and postfix.
  ptrListCopy(dst, src)
Copies src list items to dst list using duplicateItem method of the list klass.
  replaceContent(node, newNode)
Swaps the content of node and newNode.
  replaceNode(node, newNode)
Swaps the node and newNode in the XML tree.
  replaceNodeBuffer(node, buffer, size)
Swaps the node and the parsed XML data from the buffer in the XML tree.
  shutdown()
Clean ups the XML Security Library.
  simpleKeysStoreId()
Returns a simple keys store klass id.
  transformAes128CbcId()
AES 128 CBC encryption transform id.
  transformAes192CbcId()
AES 192 CBC encryption transform id.
  transformAes256CbcId()
AES 256 CBC encryption transform id.
  transformBase64Id()
The Base64 transform id (http://www.w3.org/TR/xmldsig-core/sec-Base-64).
  transformDes3CbcId()
Triple DES CBC encryption transform id.
  transformDsaSha1Id()
The DSA-SHA1 signature transform id.
  transformEnvelopedId()
The enveloped transform id (http://www.w3.org/TR/xmldsig-core/sec-EnvelopedSignature).
  transformExclC14NId()
Exclusive canoncicalization that ommits comments transform id (http://www.w3.org/TR/xml-exc-c14n/).
  transformExclC14NWithCommentsId()
Exclusive canoncicalization that includes comments transform id (http://www.w3.org/TR/xml-exc-c14n/).
  transformHmacMd5Id()
The HMAC-MD5 transform id.
  transformHmacRipemd160Id()
The HMAC-RIPEMD160 transform id.
  transformHmacSha1Id()
The HMAC-SHA1 transform id.
  transformHmacSha224Id()
The HMAC-SHA224 transform id.
  transformHmacSha256Id()
The HMAC-SHA256 transform id.
  transformHmacSha384Id()
The HMAC-SHA384 transform id.
  transformHmacSha512Id()
The HMAC-SHA512 transform id.
  transformInclC14NId()
Inclusive (regular) canonicalization that omits comments transform id (http://www.w3.org/TR/xmldsig-core/sec-c14nAlg and http://www.w3.org/TR/2001/REC-xml-c14n-20010315).
  transformInclC14NWithCommentsId()
Inclusive (regular) canonicalization that includes comments transform id (http://www.w3.org/TR/xmldsig-core/sec-c14nAlg and http://www.w3.org/TR/2001/REC-xml-c14n-20010315).
  transformKWAes128Id()
The AES-128 kew wrapper transform id.
  transformKWAes192Id()
The AES-192 kew wrapper transform id.
  transformKWAes256Id()
The AES-256 kew wrapper transform id.
  transformKWDes3Id()
The Triple DES key wrapper transform id.
  transformMd5Id()
The MD5 digest transform id.
  transformMemBufGetBuffer(transform)
Gets the memory buffer transform buffer.
  transformMemBufId()
Returns the memory buffer transform id (used to store the data that go through it).
  transformRemoveXmlTagsC14NId()
The 'remove xml tags' transform id (used before base64 transforms) (http://www.w3.org/TR/xmldsig-core/sec-Base-64).
  transformRipemd160Id()
RIPEMD-160 digest transform id.
  transformRsaMd5Id()
The RSA-MD5 signature transform id.
  transformRsaOaepId()
The RSA-OAEP key transport transform id.
  transformRsaPkcs1Id()
The RSA-PKCS1 key transport transform id.
  transformRsaRipemd160Id()
The RSA-RIPEMD160 signature transform id.
  transformRsaSha1Id()
The RSA-SHA1 signature transform id.
  transformRsaSha224Id()
The RSA-SHA224 signature transform id.
  transformRsaSha256Id()
The RSA-SHA256 signature transform id.
  transformRsaSha384Id()
The RSA-SHA384 signature transform id.
  transformRsaSha512Id()
The RSA-SHA512 signature transform id.
  transformSha1Id()
SHA-1 digest transform id.
  transformSha224Id()
The SHA224 digest transform id.
  transformSha256Id()
The SHA256 digest transform id.
  transformSha384Id()
The SHA384 digest transform id.
  transformSha512Id()
The SHA512 digest transform id.
  transformUriTypeCheck(type, uri)
Checks if uri matches expected type type.
  transformVisa3DHackId()
Selects node subtree by given node id string.
  transformXmlParserId()
Returns the XML parser transform id.
  transformXPath2Id()
The XPath2 transform id (http://www.w3.org/TR/xmldsig-filter2/).
  transformXPathId()
The XPath transform evaluates given XPath expression and intersects the result with the previous nodes set.
  transformXPointerId()
The XPointer transform id (http://www.ietf.org/internet-drafts/draft-eastlake-xmldsig-uri-02.txt).
  transformXsltId()
XSLT transform id (http://www.w3.org/TR/xmldsig-core/sec-XSLT).
  x509DataGetNodeContent(node, deleteChildren, keyInfoCtx)
Reads the contents of <dsig:X509Data/> node and returns it as a bits mask.
  x509StoreId()
The X509 certificates key data store id.

Function Details

addChild(parent, name, ns=None)

Adds a child to the node parent with given name and namespace ns.
parent  : the XML node.
name    : the new node name.
ns      : the new node namespace.
Returns : the new node or None if an error occurs.

addIDs(doc, cur, ids)

Walks thru all children of the cur node and adds all attributes from the
ids list to the doc document IDs attributes hash.
doc : the XML document.
cur : the XML node.
ids : the list of ID attributes.

addNextSibling(node, name, ns=None)

Adds next sibling to the node node with given name and namespace ns.
node    : the XML node.
name    : the new node name.
ns      : the new node namespace.
Returns : the new node or None if an error occurs.

addPrevSibling(node, name, ns=None)

Adds prev sibling to the node node with given name and namespace ns.
node    : the XML node.
name    : the new node name.
ns      : the new node namespace.
Returns : the new node or None if an error occurs.

base64Decode(str)

Decodes input base64 encoded string.
str     : the input buffer with base64 encoded string.
Returns : a string with decoded data or None if an error occurs.

base64Encode(buf, columns)

Encodes the data from input buffer.
buf     : the input buffer.
columns : the output max line length (if 0 then no line breaks would be
inserted)
Returns : a string with base64 encoded data or None if an error occurs.

bufferSetDefaultAllocMode(defAllocMode, defInitialSize)

Sets new global default allocation mode and minimal intial size.
defAllocMode   : the new default buffer allocation mode.
defInitialSize : the new default buffer minimal intial size.

checkNodeName(cur, name, ns=None)

Checks that the node has a given name and a given namespace href.
cur     : the XML node.
name    : the name,
ns      : the namespace href.
Returns : 1 if the node matches or 0 otherwise.

checkVersion()

Returns 1 if the loaded xmlsec library version ABI compatible with the one
used to compile the caller, 0 if it does not or a negative value if an error occurs.

checkVersionExact()

Returns 1 if the loaded xmlsec library version exactly matches the one used
to compile the caller, 0 if it does not or a negative value if an error occurs.

checkVersionExt(major, minor, subminor, mode)

Checks if the loaded version of xmlsec library could be used.
major    : the major version number.
minor    : the minor version number.
subminor : the subminor version number.
mode     : the version check mode.
Returns  : 1 if the loaded xmlsec library version is OK to use 0 if it is
not or a negative value if an error occurs.

createTree(rootNodeName, rootNodeNs)

Creates a new XML tree with one root node rootNodeName.
rootNodeName : the root node name.
rootNodeNs   : the root node namespace (otpional).
Returns      : the newly created tree or None if an error occurs.

cryptoAppDefaultKeysMngrAdoptKey(mngr, key)

Adds key to the keys manager mngr created with cryptoAppDefaultKeysMngrInit
function.
  - mngr : the keys manager.
  - key  : the key.
Returns : 0 on success or a negative value otherwise.

cryptoAppDefaultKeysMngrInit(mngr)

Initializes mngr with simple keys store simpleKeysStoreId and a default
crypto key data stores.
mngr    : the keys manager.
Returns : 0 on success or a negative value otherwise.

cryptoAppDefaultKeysMngrLoad(mngr, uri)

Loads XML keys file from uri to the keys manager mngr created with
cryptoAppDefaultKeysMngrInit function.
mngr    : the keys manager.
uri     : the uri.
Returns : 0 on success or a negative value otherwise.

cryptoAppDefaultKeysMngrSave(mngr, filename, type)

Saves keys from mngr to XML keys file.
mngr     : the keys manager.
filename : the destination filename.
type     : the type of keys to save (public/private/symmetric).
Returns  : 0 on success or a negative value otherwise.

cryptoAppGetDefaultPwdCallback()

Gets default password callback.

cryptoAppInit(config=None)

General crypto engine initialization. This function is used by XMLSec
command line utility and called before init function.
config  : the path to crypto library configuration.
Returns : 0 on success or a negative value otherwise.

cryptoAppKeyCertLoad(key, filename, format)

Reads the certificate from filename and adds it to key.
key      : the key.
filename : the certificate filename.
format   : the certificate file format.
Returns  : 0 on success or a negative value otherwise.

cryptoAppKeyLoad(filename, format, pwd, pwdCallback, pwdCallbackCtx)

Reads key from filename.
filename       : the key filename.
format         : the key file format.
pwd            : the key file password.
pwdCallback    : the key password callback.
pwdCallbackCtx : the user context for password callback.
Returns        : the key or None if an error occurs.

cryptoAppKeysMngrCertLoad(mngr, filename, format, type)

Reads cert from filename and adds to the list of trusted or known untrusted
certs in store.
mngr     : the keys manager.
filename : the certificate file.
format   : the certificate file format.
type     : the flag that indicates if the certificate in filename trusted or not.
Returns  : 0 on success or a negative value otherwise.

cryptoAppPkcs12Load(filename, pwd, pwdCallback, pwdCallbackCtx)

Reads key and all associated certificates from the PKCS12 file.
For uniformity, call cryptoAppKeyLoad instead of this function.
Pass in format=xmlsec.KeyDataFormatPkcs12.
filename       : the PKCS12 key filename.
pwd            : the PKCS12 file password.
pwdCallback    : the password callback.
pwdCallbackCtx : the user context for password callback.
Returns        : the key or None if an error occurs.

cryptoAppShutdown()

General crypto engine shutdown. This function is used by XMLSec command
line utility and called after shutdown function.
Returns : 0 on success or a negative value otherwise.

cryptoInit()

XMLSec library specific crypto engine initialization.
Returns : 0 on success or a negative value otherwise.

cryptoKeysMngrInit(mngr)

Adds crypto specific key data stores in keys manager.
mngr    : the keys manager.
Returns : 0 on success or a negative value otherwise.

cryptoShutdown()

XMLSec library specific crypto engine shutdown.
Returns : 0 on success or a negative value otherwise.

dsigReferenceCtxListId()

Returns : <dsig:Reference/> element processing context list id.

errorsSetCallback(callback)

Sets the errors callback function to callback that will be called every
time an error occurs.
callback : the new errors callback function.

findChild(parent, name, ns=None)

Searches a direct child of the parent node having given name and namespace
href.
parent  : the XML node.
name    : the name.
ns      : the namespace href (may be None).
Returns : the found node or None if an error occurs or node is not found.

findNode(parent, name, ns=None)

Searches all children of the parent node having given name and namespace href.
parent  : the XML node.
name    : the name.
ns      : the namespace href (may be None).
Returns : the found node or None if an error occurs or node is not found.

findParent(cur, name, ns=None)

Searches the ancestors axis of the cur node for a node having given name
and namespace href.
cur     : the XML node.
name    : the name.
ns      : the namespace href (may be None).
Returns : the found node or None if an error occurs or node is not found.

getHex(c)

Gets the hex value of a character.
c       : the character.
Returns : the hex value of the c.

getNextElementNode(cur)

Seraches for the next element node.
cur     : the XML node.
Returns : the next element node or None if it is not found.

getNodeNsHref(cur)

Gets node's namespace href.
cur     : the node.
Returns : node's namespace href.

init()

Initializes XML Security Library. The depended libraries (LibXML and LibXSLT)
must be initialized before.
Returns : 0 on success or a negative value otherwise.

isEmptyNode(node)

Checks whethere the node is empty (i.e. has only whitespaces children).
node    : the node to check
Returns : 1 if node is empty, 0 otherwise or a negative value if an error
occurs.

isEmptyString(str)

Checks whethere the str is empty (i.e. has only whitespaces children).
str     : the string to check
Returns : 1 if str is empty, 0 otherwise or a negative value if an error
occurs.

isHex(c)

Returns 1 if a character is a hex digit or 0 otherwise.
c       : the character.
Returns : 1 if c is a hex digit or 0 otherwise.

keyCopy(keyDst, keySrc)

Copies key data from keySrc to keyDst.
keyDst  : the destination key.
keySrc  : the source key.
Returns : 0 on success or a negative value if an error occurs.

keyDataAesId()

The AES key data id.
Returns : AES key data id or None if an error occurs (xmlsec-crypto library
is not loaded or the AES key data id is not implemented).

keyDataBinRead(id, key, buf, bufSize, keyInfoCtx)

Reads the key data of klass id from binary buffer buf to key.
id         : the data klass.
key        : the destination key.
buf        : the input binary buffer.
bufSize    : the input buffer size.
keyInfoCtx : the <dsig:KeyInfo/> node processing context.
Returns    : 0 on success or a negative value if an error occurs.

keyDataBinWrite(id, key, buf, bufSize, keyInfoCtx)

Writes the key data of klass id from the key to a binary buffer buf.
id         : the data klass.
key        : the source key.
buf        : the output binary buffer.
bufSize    : the output buffer size.
keyInfoCtx : the <dsig:KeyInfo/> node processing context.
Returns    : 0 on success or a negative value if an error occurs.

keyDataDesId()

The DES key data id.
Returns : DES key data id or None if an error occurs (xmlsec-crypto library
is not loaded or the DES key data id is not implemented).

keyDataDsaId()

The DSA key data id.
Returns : DSA key data id or None if an error occurs (xmlsec-crypto library
is not loaded or the DSA key data id is not implemented).

keyDataEncryptedKeyId()

The <enc:EncryptedKey/> element key data id
(http://www.w3.org/TR/xmlenc-core/sec-EncryptedKey)

The EncryptedKey element is used to transport encryption keys from the
originator to a known recipient(s). It may be used as a stand-alone XML
document, be placed within an application document, or appear inside an
EncryptedData element as a child of a ds:KeyInfo element. The key value
is always encrypted to the recipient(s). When EncryptedKey is decrypted
the resulting octets are made available to the EncryptionMethod algorithm
without any additional processing.

Returns : the <enc:EncryptedKey/> element processing key data id.

keyDataHmacId()

The HMAC key data id.
Returns : HMAC key data id or None if an error occurs (xmlsec-crypto
library is not loaded or the HMAC key data id is not implemented).

keyDataIdsGet()

Gets global registered key data klasses list.
Returns : the list of all registered key data klasses.

keyDataIdsInit()

Initializes the key data klasses. This function is called from the init
function and the application should not call it directly.
Returns : 0 on success or a negative value if an error occurs.

keyDataIdsRegister(id)

Registers id in the global list of key data klasses.
id      : the key data klass.
Returns : 0 on success or a negative value if an error occurs.

keyDataIdsRegisterDefault()

Registers default (implemented by XML Security Library) key data klasses:
<dsig:KeyName/> element processing klass, <dsig:KeyValue/> element
processing klass, ...
Returns : 0 on success or a negative value if an error occurs.

keyDataIdsShutdown()

Shuts down the keys data klasses. This function is called from the shutdown
function and the application should not call it directly.

keyDataNameId()

The <dsig:KeyName/> element key data id
(http://www.w3.org/TR/xmldsig-core/sec-KeyName)

The KeyName element contains a string value (in which white space is
significant) which may be used by the signer to communicate a key identifier
to the recipient. Typically, KeyName contains an identifier related to the
key pair used to sign the message, but it may contain other protocol-related
information that indirectly identifies a key pair. (Common uses of KeyName
include simple string names for keys, a key index, a distinguished name (DN),
an email address, etc.)

Returns : the <dsig:KeyName/> element processing key data id.

keyDataRawX509CertId()

The raw X509 cert key data id.
Returns : raw x509 cert key data id or None if an error occurs
(xmlsec-crypto library is not loaded or the raw X509 cert key data id is
not implemented).

keyDataRetrievalMethodId()

The <dsig:RetrievalMethod/> element key data id
(http://www.w3.org/TR/xmldsig-core/sec-RetrievalMethod)

A RetrievalMethod element within KeyInfo is used to convey a reference to
KeyInfo information that is stored at another location. For example, several
signatures in a document might use a key verified by an X.509v3 certificate
chain appearing once in the document or remotely outside the document; each
signature's KeyInfo can reference this chain using a single RetrievalMethod
element instead of including the entire chain with a sequence of
X509Certificate elements.

RetrievalMethod uses the same syntax and dereferencing behavior as
Reference's URI and The Reference Processing Model.

Returns : the <dsig:RetrievalMethod/> element processing key data id.

keyDataRsaId()

The RSA key data id.
Returns : RSA key data id or None if an error occurs (xmlsec-crypto library
is not loaded or the RSA key data id is not implemented).

keyDataValueId()

The <dsig:KeyValue/> element key data id
(http://www.w3.org/TR/xmldsig-core/sec-KeyValue)

The KeyValue element contains a single public key that may be useful in
validating the signature.

Returns : the <dsig:KeyValue/> element processing key data id.

keyDataX509Id()

The X509 key data id.
Returns : X509 key data id or None if an error occurs (xmlsec-crypto
library is not loaded or the X509 key data id is not implemented).

keyDataXmlRead(id, key, node, keyInfoCtx)

Reads the key data of klass id from XML node and adds them to key.
id         : the data klass.
key        : the destination key.
node       : the XML node.
keyInfoCtx : the <dsig:KeyInfo/> element processing context.
Returns    : 0 on success or a negative value otherwise.

keyDataXmlWrite(id, key, node, keyInfoCtx)

Writes the key data of klass id from key to an XML node.
id         : the data klass.
key        : the source key.
node       : the XML node.
keyInfoCtx : the <dsig:KeyInfo/> element processing context.
Returns    : 0 on success or a negative value otherwise.

keyGenerate(dataId, sizeBits, type)

Generates new key of requested klass dataId and type.
dataId   : the requested key klass (rsa, dsa, aes, ...).
sizeBits : the new key size (in bits!).
type     : the new key type (session, permanent, ...).
Returns  : the newly created key or None if an error occurs.

keyGenerateByName(name, sizeBits, type)

Generates new key of requested klass and type.
name     : the requested key klass name (rsa, dsa, aes, ...).
sizeBits : the new key size (in bits!).
type     : the new key type (session, permanent, ...).
Returns  : the newly created key or None if an error occurs.

keyInfoCtxCopyUserPref(dst, src)

Copies user preferences from src context to dst context.
dst     : the destination context object.
src     : the source context object.
Returns : 0 on success and a negative value if an error occurs.

keyInfoNodeRead(keyInfoNode, key, keyInfoCtx)

Parses the <dsig:KeyInfo/> element keyInfoNode, extracts the key data and
stores into key.
keyInfoNode : the <dsig:KeyInfo/> node.
key         : the result key object.
keyInfoCtx  : the <dsig:KeyInfo/> element processing context.
Returns     : 0 on success or -1 if an error occurs.

keyInfoNodeWrite(keyInfoNode, key, keyInfoCtx)

Writes the key into the <dsig:KeyInfo/> element template keyInfoNode.
keyInfoNode : the <dsig:KeyInfo/> node.
key         : the result key object.
keyInfoCtx  : the <dsig:KeyInfo/> element processing context.
Returns     : 0 on success or -1 if an error occurs.

keyPtrListId()

Returns the keys list klass.

keyReadBinaryFile(dataId, filename)

Reads the key value of klass dataId from a binary file filename.
dataId   : the key value data klass.
filename : the key binary filename.
Returns  : newly created key or None if an error occurs.

keyReadBuffer(dataId, buffer)

Reads the key value of klass dataId from a buffer.
dataId  : the key value data klass.
buffer  : the buffer that contains the binary data.
Returns : newly created key or None if an error occurs.

keyReadMemory(dataId, data, dataSize)

Reads the key value of klass dataId from a memory block data.
dataId   : the key value data klass.
data     : the memory containing the key
dataSize : the size of the memory block
Returns  : newly created key or None if an error occurs.

keyReqCopy(dst, src)

Copies key requirements from src object to dst object.
dst     : the destination object.
src     : the source object.
Returns : 0 on success and a negative value if an error occurs.

keysMngrGetKey(keyInfoNode, keyInfoCtx)

Reads the <dsig:KeyInfo/> node keyInfoNode and extracts the key.
keyInfoNode : the <dsig:KeyInfo/> node.
keyInfoCtx  : the <dsig:KeyInfo/> node processing context.
Returns     : the key or None if the key is not found or an error occurs.

nodeGetName(node)

Gets node's name.
node    : the node.
Returns : the node's name.

nodeSetAdd(nset, newNSet, op)

Adds newNSet to the nset using operation op.
nset    : the currrent nodes set (or None).
newNSet : the new nodes set.
op      : the operation type.
Returns : the combined nodes set or None if an error occurs.

nodeSetAddList(nset, newNSet, op)

Adds newNSet to the nset as child using operation op.
nset    : the currrent nodes set (or None).
newNSet : the new nodes set.
op      : the operation type.
Returns : the combined nodes set or None if an error occurs.

nodeSetGetChildren(doc, parent, withComments, invert)

Creates a new nodes set that contains:
- if withComments is not 0 and invert is 0: all nodes in the parent subtree;
- if withComments is 0 and invert is 0: all nodes in the parent subtree
except comment nodes;
- if withComments is not 0 and invert not is 0: all nodes in the doc except
nodes in the parent subtree;
- if withComments is 0 and invert is 0: all nodes in the doc except nodes in
the parent subtree and comment nodes.
doc          : the XML document.
parent       : the parent XML node or None if we want to include all document nodes.
withComments : the flag include comments or not.
invert       : the 'invert' flag.
Returns      : the newly created NodeSet or None if an error occurs.

parseFile(filename)

Loads XML Doc from file filename. We need a special version because of c14n
issue. The code is copied from xmlSAXParseFileWithData() function.
filename : the filename.
Returns  : the loaded XML document or None if an error occurs.

parseMemory(buffer, size, recovery)

Loads XML Doc from memory. We need a special version because of c14n issue.
The code is copied from xmlSAXParseMemory() function.
buffer   : the input buffer.
size     : the input buffer size.
recovery : the flag.
Returns  : the loaded XML document or None if an error occurs.

parseMemoryExt(prefix, prefixSize, buffer, bufferSize, postfix, postfixSize)

Loads XML Doc from 3 chunks of memory: prefix, buffer and postfix.
prefix      : the first part of the input.
prefixSize  : the size of the first part of the input.
buffer      : the second part of the input.
bufferSize  : the size of the second part of the input.
postfix     : the third part of the input.
postfixSize : the size of the third part of the input.
Returns     : the loaded XML document or None if an error occurs.

ptrListCopy(dst, src)

Copies src list items to dst list using duplicateItem method of the list klass.
If duplicateItem method is None then we jsut copy pointers to items.
dst     : the destination list.
src     : the source list.
Returns : 0 on success or a negative value if an error occurs.

replaceContent(node, newNode)

Swaps the content of node and newNode.
node    : the current node.
newNode : the new node.
Returns : 0 on success or a negative value if an error occurs.

replaceNode(node, newNode)

Swaps the node and newNode in the XML tree.
node    : the current node.
newNode : the new node.
Returns : 0 on success or a negative value if an error occurs.

replaceNodeBuffer(node, buffer, size)

Swaps the node and the parsed XML data from the buffer in the XML tree.
node    : the current node.
buffer  : the XML data.
size    : the XML data size.
Returns : 0 on success or a negative value if an error occurs.

shutdown()

Clean ups the XML Security Library.
Returns : 0 on success or a negative value otherwise.

simpleKeysStoreId()

Returns a simple keys store klass id.

transformAes128CbcId()

AES 128 CBC encryption transform id.
Returns : AES 128 CBC encryption transform id or None if an error occurs
(the xmlsec-crypto library is not loaded or this transform is not
implemented).

transformAes192CbcId()

AES 192 CBC encryption transform id.
Returns : AES 192 CBC encryption transform id or None if an error occurs
(the xmlsec-crypto library is not loaded or this transform is not
implemented).

transformAes256CbcId()

AES 256 CBC encryption transform id.
Returns : AES 256 CBC encryption transform id or None if an error occurs
(the xmlsec-crypto library is not loaded or this transform is not
implemented).

transformBase64Id()

The Base64 transform id (http://www.w3.org/TR/xmldsig-core/sec-Base-64).
The normative specification for base64 decoding transforms is RFC 2045
(http://www.ietf.org/rfc/rfc2045.txt).
Returns : base64 transform id.

transformDes3CbcId()

Triple DES CBC encryption transform id.
Returns : Triple DES encryption transform id or None if an error occurs
(the xmlsec-crypto library is not loaded or this transform is not
implemented).

transformDsaSha1Id()

The DSA-SHA1 signature transform id.
Returns : DSA-SHA1 signature transform id or None if an error occurs (the
xmlsec-crypto library is not loaded or this transform is not implemented).

transformEnvelopedId()

The enveloped transform id
(http://www.w3.org/TR/xmldsig-core/sec-EnvelopedSignature).
Returns : enveloped transform id.

transformExclC14NId()

Exclusive canoncicalization that ommits comments transform id
(http://www.w3.org/TR/xml-exc-c14n/).
Returns : exclusive c14n transform id.

transformExclC14NWithCommentsId()

Exclusive canoncicalization that includes comments transform id
(http://www.w3.org/TR/xml-exc-c14n/).
Returns : exclusive c14n with comments transform id.

transformHmacMd5Id()

The HMAC-MD5 transform id.
Returns : HMAC-MD5 transform id or None if an error occurs (the
xmlsec-crypto library is not loaded or this transform is not implemented).

transformHmacRipemd160Id()

The HMAC-RIPEMD160 transform id.
Returns : HMAC-RIPEMD160 transform id or None if an error occurs (the
xmlsec-crypto library is not loaded or this transform is not implemented).

transformHmacSha1Id()

The HMAC-SHA1 transform id.
Returns : HMAC-SHA1 transform id or None if an error occurs
(the xmlsec-crypto library is not loaded or this transform is not
implemented).

transformHmacSha224Id()

The HMAC-SHA224 transform id.
Returns : HMAC-SHA224 transform id or None if an error occurs
(the xmlsec-crypto library is not loaded or this transform is not
implemented).

transformHmacSha256Id()

The HMAC-SHA256 transform id.
Returns : HMAC-SHA256 transform id or None if an error occurs
(the xmlsec-crypto library is not loaded or this transform is not
implemented).

transformHmacSha384Id()

The HMAC-SHA384 transform id.
Returns : HMAC-SHA384 transform id or None if an error occurs
(the xmlsec-crypto library is not loaded or this transform is not
implemented).

transformHmacSha512Id()

The HMAC-SHA512 transform id.
Returns : HMAC-SHA512 transform id or None if an error occurs
(the xmlsec-crypto library is not loaded or this transform is not
implemented).

transformInclC14NId()

Inclusive (regular) canonicalization that omits comments transform id
(http://www.w3.org/TR/xmldsig-core/sec-c14nAlg and
http://www.w3.org/TR/2001/REC-xml-c14n-20010315).
Returns : c14n transform id.

transformInclC14NWithCommentsId()

Inclusive (regular) canonicalization that includes comments transform id
(http://www.w3.org/TR/xmldsig-core/sec-c14nAlg and
http://www.w3.org/TR/2001/REC-xml-c14n-20010315).
Returns : c14n with comments transform id.

transformKWAes128Id()

The AES-128 kew wrapper transform id.
Returns : AES-128 kew wrapper transform id is or None if an error occurs
(the xmlsec-crypto library is not loaded or this transform is not
implemented).

transformKWAes192Id()

The AES-192 kew wrapper transform id.
Returns : AES-192 kew wrapper transform id is or None if an error occurs
(the xmlsec-crypto library is not loaded or this transform is not
implemented).

transformKWAes256Id()

The AES-256 kew wrapper transform id.
Returns : AES-256 kew wrapper transform id is or None if an error occurs
(the xmlsec-crypto library is not loaded or this transform is not
implemented).

transformKWDes3Id()

The Triple DES key wrapper transform id.
Returns : Triple DES key wrapper transform id or None if an error occurs
(the xmlsec-crypto library is not loaded or this transform is not
implemented).

transformMd5Id()

The MD5 digest transform id.
Returns : MD5 digest transform id or None if an error occurs
(the xmlsec-crypto library is not loaded or this transform is not
implemented).

transformMemBufGetBuffer(transform)

Gets the memory buffer transform buffer.
transform : the memory buffer transform.
Returns   : the transform's buffer.

transformMemBufId()

Returns the memory buffer transform id (used to store the data that go
through it).

transformRemoveXmlTagsC14NId()

The 'remove xml tags' transform id (used before base64 transforms)
(http://www.w3.org/TR/xmldsig-core/sec-Base-64).
Returns : 'remove xml tags' transform id.

transformRipemd160Id()

RIPEMD-160 digest transform id.
Returns : RIPEMD-160 digest transform id or None if an error occurs (the
xmlsec-crypto library is not loaded or this transform is not implemented).

transformRsaMd5Id()

The RSA-MD5 signature transform id.
Returns : RSA-MD5 signature transform id or None if an error occurs (the
xmlsec-crypto library is not loaded or this transform is not implemented).

transformRsaOaepId()

The RSA-OAEP key transport transform id.
Returns : RSA-OAEP key transport transform id or None if an error occurs
(the xmlsec-crypto library is not loaded or this transform is not
implemented).

transformRsaPkcs1Id()

The RSA-PKCS1 key transport transform id.
Returns : RSA-PKCS1 key transport transform id or None if an error occurs
(the xmlsec-crypto library is not loaded or this transform is not
implemented).

transformRsaRipemd160Id()

The RSA-RIPEMD160 signature transform id.
Returns : RSA-RIPEMD160 signature transform id or None if an error occurs
(the xmlsec-crypto library is not loaded or this transform is not
implemented).

transformRsaSha1Id()

The RSA-SHA1 signature transform id.
Returns : RSA-SHA1 signature transform id or None if an error occurs (the
xmlsec-crypto library is not loaded or this transform is not implemented).

transformRsaSha224Id()

The RSA-SHA224 signature transform id.
Returns : RSA-SHA224 signature transform id or None if an error occurs (the
xmlsec-crypto library is not loaded or this transform is not implemented).

transformRsaSha256Id()

The RSA-SHA256 signature transform id.
Returns : RSA-SHA256 signature transform id or None if an error occurs (the
xmlsec-crypto library is not loaded or this transform is not implemented).

transformRsaSha384Id()

The RSA-SHA384 signature transform id.
Returns : RSA-SHA384 signature transform id or None if an error occurs (the
xmlsec-crypto library is not loaded or this transform is not implemented).

transformRsaSha512Id()

The RSA-SHA512 signature transform id.
Returns : RSA-SHA512 signature transform id or None if an error occurs (the
xmlsec-crypto library is not loaded or this transform is not implemented).

transformSha1Id()

SHA-1 digest transform id.
Returns : SHA-1 digest transform id or None if an error occurs (the
xmlsec-crypto library is not loaded or this transform is not implemented).

transformSha224Id()

The SHA224 digest transform id.
Returns : SHA224 digest transform id or None if an error occurs
(the xmlsec-crypto library is not loaded or this transform is not
implemented).

transformSha256Id()

The SHA256 digest transform id.
Returns : SHA256 digest transform id or None if an error occurs
(the xmlsec-crypto library is not loaded or this transform is not
implemented).

transformSha384Id()

The SHA384 digest transform id.
Returns : SHA384 digest transform id or None if an error occurs
(the xmlsec-crypto library is not loaded or this transform is not
implemented).

transformSha512Id()

The SHA512 digest transform id.
Returns : SHA512 digest transform id or None if an error occurs
(the xmlsec-crypto library is not loaded or this transform is not
implemented).

transformUriTypeCheck(type, uri)

Checks if uri matches expected type type.
type    : the expected URI type.
uri     : the uri for checking.
Returns : 1 if uri matches type, 0 if not or a negative value if an error
occurs.

transformVisa3DHackId()

Selects node subtree by given node id string. The only reason why we need
this is Visa3D protocol. It doesn't follow XML/XPointer/XMLDSig specs and
allows something like '12345' in the URI attribute. Since we couldn't
evaluate such expressions thru XPath/XPointer engine, we need to have this
hack here.
Returns : Visa3DHack transform id.

transformXmlParserId()

Returns the XML parser transform id.

transformXPath2Id()

The XPath2 transform id (http://www.w3.org/TR/xmldsig-filter2/).
Returns : XPath2 transform id.

transformXPathId()

The XPath transform evaluates given XPath expression and intersects the
result with the previous nodes set.
(http://www.w3.org/TR/xmldsig-core/sec-XPath).
Returns : XPath transform id.

transformXPointerId()

The XPointer transform id
(http://www.ietf.org/internet-drafts/draft-eastlake-xmldsig-uri-02.txt).
Returns : XPointer transform id.

transformXsltId()

XSLT transform id (http://www.w3.org/TR/xmldsig-core/sec-XSLT).
Returns : XSLT transform id.

x509DataGetNodeContent(node, deleteChildren, keyInfoCtx)

Reads the contents of <dsig:X509Data/> node and returns it as a bits mask.
node           : the <dsig:X509Data/> node.
deleteChildren : the flag that indicates whether to remove node children
after reading.
keyInfoCtx     : the <dsig:KeyInfo/> node processing context.
Returns        : the bit mask representing the <dsig:X509Data/> node content
or a negative value if an error occurs.

x509StoreId()

The X509 certificates key data store id.
Returns : X509 certificates key data store id or None if an error occurs
(xmlsec-crypto library is not loaded or the raw X509 cert key data id is
not implemented).

Generated by Epydoc 2.1 on Sun Jan 1 18:42:41 2006 http://epydoc.sf.net