xmlsec_keyinfo.c File Reference

xmlSecKeyInfoNodeRead(xmlNodePtr, xmlSecKeyPtr, xmlSecKeyInfoCtxPtr)

EXPORT_C intxmlSecKeyInfoNodeRead(xmlNodePtrkeyInfoNode,
xmlSecKeyPtrkey,
xmlSecKeyInfoCtxPtrkeyInfoCtx
)

xmlSecKeyInfoNodeRead: : the pointer to <dsig:KeyInfo/> node. : the pointer to result key object. : the pointer to <dsig:KeyInfo/> element processing context.

Parses the <dsig:KeyInfo/> element , extracts the key data and stores into .

Returns 0 on success or -1 if an error occurs.

Parameters

xmlNodePtr keyInfoNode
xmlSecKeyPtr key
xmlSecKeyInfoCtxPtr keyInfoCtx

xmlSecKeyInfoNodeWrite(xmlNodePtr, xmlSecKeyPtr, xmlSecKeyInfoCtxPtr)

EXPORT_C intxmlSecKeyInfoNodeWrite(xmlNodePtrkeyInfoNode,
xmlSecKeyPtrkey,
xmlSecKeyInfoCtxPtrkeyInfoCtx
)

xmlSecKeyInfoNodeWrite: : the pointer to <dsig:KeyInfo/> node. : the pointer to key object. : the pointer to <dsig:KeyInfo/> element processing context.

Writes the into the <dsig:KeyInfo/> element template .

Returns 0 on success or -1 if an error occurs.

Parameters

xmlNodePtr keyInfoNode
xmlSecKeyPtr key
xmlSecKeyInfoCtxPtr keyInfoCtx

xmlSecKeyInfoCtxCreate(xmlSecKeysMngrPtr)

EXPORT_C xmlSecKeyInfoCtxPtrxmlSecKeyInfoCtxCreate(xmlSecKeysMngrPtrkeysMngr)

xmlSecKeyInfoCtxCreate: : the pointer to keys manager (may be NULL).

Allocates and initializes <dsig:KeyInfo/> element processing context. Caller is responsible for freeing it by calling xmlSecKeyInfoCtxDestroy function.

Returns pointer to newly allocated object or NULL if an error occurs.

Parameters

xmlSecKeysMngrPtr keysMngr

xmlSecKeyInfoCtxDestroy(xmlSecKeyInfoCtxPtr)

EXPORT_C voidxmlSecKeyInfoCtxDestroy(xmlSecKeyInfoCtxPtrkeyInfoCtx)

xmlSecKeyInfoCtxDestroy: : the pointer to <dsig:KeyInfo/> element processing context.

Destroys object created with xmlSecKeyInfoCtxCreate function.

Parameters

xmlSecKeyInfoCtxPtr keyInfoCtx

xmlSecKeyInfoCtxInitialize(xmlSecKeyInfoCtxPtr, xmlSecKeysMngrPtr)

EXPORT_C intxmlSecKeyInfoCtxInitialize(xmlSecKeyInfoCtxPtrkeyInfoCtx,
xmlSecKeysMngrPtrkeysMngr
)

xmlSecKeyInfoCtxInitialize: : the pointer to <dsig:KeyInfo/> element processing context. : the pointer to keys manager (may be NULL).

Initializes <dsig:KeyInfo/> element processing context. Caller is responsible for cleaning it up by xmlSecKeyInfoCtxFinalize function.

Returns 0 on success and a negative value if an error occurs.

Parameters

xmlSecKeyInfoCtxPtr keyInfoCtx
xmlSecKeysMngrPtr keysMngr

xmlSecKeyInfoCtxFinalize(xmlSecKeyInfoCtxPtr)

EXPORT_C voidxmlSecKeyInfoCtxFinalize(xmlSecKeyInfoCtxPtrkeyInfoCtx)

xmlSecKeyInfoCtxFinalize: : the pointer to <dsig:KeyInfo/> element processing context.

Cleans up the initialized with xmlSecKeyInfoCtxInitialize function.

Parameters

xmlSecKeyInfoCtxPtr keyInfoCtx

xmlSecKeyInfoCtxReset(xmlSecKeyInfoCtxPtr)

EXPORT_C voidxmlSecKeyInfoCtxReset(xmlSecKeyInfoCtxPtrkeyInfoCtx)

xmlSecKeyInfoCtxReset: : the pointer to <dsig:KeyInfo/> element processing context.

Resets the state. User settings are not changed.

Parameters

xmlSecKeyInfoCtxPtr keyInfoCtx

xmlSecKeyInfoCtxCreateEncCtx(xmlSecKeyInfoCtxPtr)

EXPORT_C intxmlSecKeyInfoCtxCreateEncCtx(xmlSecKeyInfoCtxPtrkeyInfoCtx)

xmlSecKeyInfoCtxCreateEncCtx: : the pointer to <dsig:KeyInfo/> element processing context.

Creates encryption context form processing <enc:EncryptedKey/> child of <dsig:KeyInfo/> element.

Returns 0 on success and a negative value if an error occurs.

Parameters

xmlSecKeyInfoCtxPtr keyInfoCtx

xmlSecKeyInfoCtxCopyUserPref(xmlSecKeyInfoCtxPtr, xmlSecKeyInfoCtxPtr)

EXPORT_C intxmlSecKeyInfoCtxCopyUserPref(xmlSecKeyInfoCtxPtrdst,
xmlSecKeyInfoCtxPtrsrc
)

xmlSecKeyInfoCtxCopyUserPref: : the pointer to destination context object. : the pointer to source context object.

Copies user preferences from context to context.

Returns 0 on success and a negative value if an error occurs.

xmlSecKeyInfoCtxDebugDump(xmlSecKeyInfoCtxPtr, FILE *)

EXPORT_C voidxmlSecKeyInfoCtxDebugDump(xmlSecKeyInfoCtxPtrkeyInfoCtx,
FILE *output
)

xmlSecKeyInfoCtxDebugDump: : the pointer to <dsig:KeyInfo/> element processing context. : the output file pointer.

Prints user settings and current context state to .

Parameters

xmlSecKeyInfoCtxPtr keyInfoCtx
FILE * output

xmlSecKeyInfoCtxDebugXmlDump(xmlSecKeyInfoCtxPtr, FILE *)

EXPORT_C voidxmlSecKeyInfoCtxDebugXmlDump(xmlSecKeyInfoCtxPtrkeyInfoCtx,
FILE *output
)

xmlSecKeyInfoCtxDebugXmlDump: : the pointer to <dsig:KeyInfo/> element processing context. : the output file pointer.

Prints user settings and current context state in XML format to .

Parameters

xmlSecKeyInfoCtxPtr keyInfoCtx
FILE * output

xmlSecKeyDataNameXmlRead(xmlSecKeyDataId, xmlSecKeyPtr, xmlNodePtr, xmlSecKeyInfoCtxPtr)

intxmlSecKeyDataNameXmlRead(xmlSecKeyDataIdid,
xmlSecKeyPtrkey,
xmlNodePtrnode,
xmlSecKeyInfoCtxPtrkeyInfoCtx
)[static]

xmlSecKeyDataNameXmlWrite(xmlSecKeyDataId, xmlSecKeyPtr, xmlNodePtr, xmlSecKeyInfoCtxPtr)

intxmlSecKeyDataNameXmlWrite(xmlSecKeyDataIdid,
xmlSecKeyPtrkey,
xmlNodePtrnode,
xmlSecKeyInfoCtxPtrkeyInfoCtx
)[static]

xmlSecKeyDataKlass xmlSecKeyDataNameKlass

xmlSecKeyDataKlass xmlSecKeyDataNameKlass[static]

xmlSecKeyDataNameGetKlass(void)

EXPORT_C xmlSecKeyDataIdxmlSecKeyDataNameGetKlass(void)

xmlSecKeyDataNameGetKlass:

The <dsig:KeyName/> element key data klass (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 klass.

Parameters

void

xmlSecKeyDataValueXmlRead(xmlSecKeyDataId, xmlSecKeyPtr, xmlNodePtr, xmlSecKeyInfoCtxPtr)

intxmlSecKeyDataValueXmlRead(xmlSecKeyDataIdid,
xmlSecKeyPtrkey,
xmlNodePtrnode,
xmlSecKeyInfoCtxPtrkeyInfoCtx
)[static]

xmlSecKeyDataValueXmlWrite(xmlSecKeyDataId, xmlSecKeyPtr, xmlNodePtr, xmlSecKeyInfoCtxPtr)

intxmlSecKeyDataValueXmlWrite(xmlSecKeyDataIdid,
xmlSecKeyPtrkey,
xmlNodePtrnode,
xmlSecKeyInfoCtxPtrkeyInfoCtx
)[static]

xmlSecKeyDataKlass xmlSecKeyDataValueKlass

xmlSecKeyDataKlass xmlSecKeyDataValueKlass[static]

xmlSecKeyDataValueGetKlass(void)

EXPORT_C xmlSecKeyDataIdxmlSecKeyDataValueGetKlass(void)

xmlSecKeyDataValueGetKlass:

The <dsig:KeyValue/> element key data klass (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 klass.

Parameters

void

xmlSecKeyDataRetrievalMethodXmlRead(xmlSecKeyDataId, xmlSecKeyPtr, xmlNodePtr, xmlSecKeyInfoCtxPtr)

intxmlSecKeyDataRetrievalMethodXmlRead(xmlSecKeyDataIdid,
xmlSecKeyPtrkey,
xmlNodePtrnode,
xmlSecKeyInfoCtxPtrkeyInfoCtx
)[static]

xmlSecKeyDataRetrievalMethodXmlWrite(xmlSecKeyDataId, xmlSecKeyPtr, xmlNodePtr, xmlSecKeyInfoCtxPtr)

intxmlSecKeyDataRetrievalMethodXmlWrite(xmlSecKeyDataIdid,
xmlSecKeyPtrkey,
xmlNodePtrnode,
xmlSecKeyInfoCtxPtrkeyInfoCtx
)[static]

xmlSecKeyDataKlass xmlSecKeyDataRetrievalMethodKlass

xmlSecKeyDataKlass xmlSecKeyDataRetrievalMethodKlass[static]

xmlSecKeyDataRetrievalMethodReadXmlResult(xmlSecKeyDataId, xmlSecKeyPtr, const xmlChar *, xmlSecSize, xmlSecKeyInfoCtxPtr)

intxmlSecKeyDataRetrievalMethodReadXmlResult(xmlSecKeyDataIdtypeId,
xmlSecKeyPtrkey,
const xmlChar *buffer,
xmlSecSizebufferSize,
xmlSecKeyInfoCtxPtrkeyInfoCtx
)[static]

Parameters

xmlSecKeyDataId typeId
xmlSecKeyPtr key
const xmlChar * buffer
xmlSecSize bufferSize
xmlSecKeyInfoCtxPtr keyInfoCtx

xmlSecKeyDataRetrievalMethodGetKlass(void)

EXPORT_C xmlSecKeyDataIdxmlSecKeyDataRetrievalMethodGetKlass(void)

xmlSecKeyDataRetrievalMethodGetKlass:

The <dsig:RetrievalMethod/> element key data klass (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 klass.

Parameters

void

xmlSecKeyDataEncryptedKeyXmlRead(xmlSecKeyDataId, xmlSecKeyPtr, xmlNodePtr, xmlSecKeyInfoCtxPtr)

intxmlSecKeyDataEncryptedKeyXmlRead(xmlSecKeyDataIdid,
xmlSecKeyPtrkey,
xmlNodePtrnode,
xmlSecKeyInfoCtxPtrkeyInfoCtx
)[static]

xmlSecKeyDataEncryptedKeyXmlWrite(xmlSecKeyDataId, xmlSecKeyPtr, xmlNodePtr, xmlSecKeyInfoCtxPtr)

intxmlSecKeyDataEncryptedKeyXmlWrite(xmlSecKeyDataIdid,
xmlSecKeyPtrkey,
xmlNodePtrnode,
xmlSecKeyInfoCtxPtrkeyInfoCtx
)[static]

xmlSecKeyDataKlass xmlSecKeyDataEncryptedKeyKlass

xmlSecKeyDataKlass xmlSecKeyDataEncryptedKeyKlass[static]

xmlSecKeyDataEncryptedKeyGetKlass(void)

EXPORT_C xmlSecKeyDataIdxmlSecKeyDataEncryptedKeyGetKlass(void)

xmlSecKeyDataEncryptedKeyGetKlass:

The <enc:EncryptedKey/> element key data klass (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 klass.

Parameters

void