Skip to content

API XMLSec Core Keysdata

Aleksey Sanin edited this page Jun 22, 2026 · 5 revisions

Key Data

API Group: xmlsec_core_keysdata

Key data containers and key-data processing.

Crypto key data object functions.

Macros

xmlSecKeyDataUsageUnknown

Defined as: 0x00000

Source: include/xmlsec/keysdata.h

The key data usage is unknown.


xmlSecKeyDataUsageKeyInfoNodeRead

Defined as: 0x00001

Source: include/xmlsec/keysdata.h

The key data can be read from a KeyInfo child.

The key data could be read from a dsig:KeyInfo/ child.


xmlSecKeyDataUsageKeyInfoNodeWrite

Defined as: 0x00002

Source: include/xmlsec/keysdata.h

The key data can be written to a KeyInfo child.

The key data could be written to a <dsig:KeyInfo /> child.


xmlSecKeyDataUsageKeyValueNodeRead

Defined as: 0x00004

Source: include/xmlsec/keysdata.h

The key data can be read from a KeyValue child.

The key data could be read from a <dsig:KeyValue /> child.


xmlSecKeyDataUsageKeyValueNodeWrite

Defined as: 0x00008

Source: include/xmlsec/keysdata.h

The key data can be written to a KeyValue child.

The key data could be written to a <dsig:KeyValue /> child.


xmlSecKeyDataUsageRetrievalMethodNodeXml

Defined as: 0x00010

Source: include/xmlsec/keysdata.h

The key data can be retrieved via RetrievalMethod in XML format.

The key data could be retrieved using <dsig:RetrievalMethod /> node in XML format.


xmlSecKeyDataUsageRetrievalMethodNodeBin

Defined as: 0x00020

Source: include/xmlsec/keysdata.h

The key data can be retrieved via RetrievalMethod in binary format.

The key data could be retrieved using <dsig:RetrievalMethod /> node in binary format.


xmlSecKeyDataUsageReadFromFile

Defined as: 0x00040

Source: include/xmlsec/keysdata.h

The key data could be read from a file.


xmlSecKeyDataUsageAny

Defined as: 0xFFFFF

Source: include/xmlsec/keysdata.h

Any key data usage.


xmlSecKeyDataUsageKeyInfoNode

Defined as: (xmlSecKeyDataUsageKeyInfoNodeRead | xmlSecKeyDataUsageKeyInfoNodeWrite)

Source: include/xmlsec/keysdata.h

The key data can be read and written from/to a KeyInfo child.

The key data could be read and written from/to a <dsig:KeyInfo /> child.


xmlSecKeyDataUsageKeyValueNode

Defined as: (xmlSecKeyDataUsageKeyValueNodeRead | xmlSecKeyDataUsageKeyValueNodeWrite)

Source: include/xmlsec/keysdata.h

The key data can be read and written from/to a KeyValue child.

The key data could be read and written from/to a <dsig:KeyValue /> child.


xmlSecKeyDataUsageRetrievalMethodNode

Defined as: (xmlSecKeyDataUsageRetrievalMethodNodeXml | xmlSecKeyDataUsageRetrievalMethodNodeBin)

Source: include/xmlsec/keysdata.h

The key data can be retrieved via RetrievalMethod in any format.

The key data could be retrieved using <dsig:RetrievalMethod /> node in any format.


xmlSecKeyDataTypeUnknown

Defined as: 0x0000

Source: include/xmlsec/keysdata.h

The key data type is unknown (same as none).

The key data type is unknown (same as xmlSecKeyDataTypeNone).


xmlSecKeyDataTypeNone

Defined as: xmlSecKeyDataTypeUnknown

Source: include/xmlsec/keysdata.h

The key data type is unknown (same as unknown).

The key data type is unknown (same as xmlSecKeyDataTypeUnknown).


xmlSecKeyDataTypePublic

Defined as: 0x0001

Source: include/xmlsec/keysdata.h

The key data contain a public key.


xmlSecKeyDataTypePrivate

Defined as: 0x0002

Source: include/xmlsec/keysdata.h

The key data contain a private key.


xmlSecKeyDataTypeSymmetric

Defined as: 0x0004

Source: include/xmlsec/keysdata.h

The key data contain a symmetric key.


xmlSecKeyDataTypeSession

Defined as: 0x0008

Source: include/xmlsec/keysdata.h

The key data contains a session (one-time) key.

The key data contain session key (one time key, not stored in keys manager).


xmlSecKeyDataTypePermanent

Defined as: 0x0010

Source: include/xmlsec/keysdata.h

The key data contains a permanent key.

The key data contain permanent key (stored in keys manager).


xmlSecKeyDataTypeTrusted

Defined as: 0x0100

Source: include/xmlsec/keysdata.h

The key data is trusted.


xmlSecKeyDataTypeAny

Defined as: 0xFFFF

Source: include/xmlsec/keysdata.h

Any key data.


xmlSecKeyDataGetName

Defined as: ((xmlSecKeyDataIsValid((data))) ? \ xmlSecKeyDataKlassGetName((data)->id) : NULL)

Source: include/xmlsec/keysdata.h

Macro. Returns the key data name.

Parameters:

  • data — the pointer to key data.

xmlSecKeyDataIsValid

Defined as: ((( data ) != NULL) && \ (( data )->id != NULL) && \ (( data )->id->klassSize >= sizeof(xmlSecKeyDataKlass)) && \ (( data )->id->objSize >= sizeof(xmlSecKeyData)) && \ (( data )->id->name != NULL))

Source: include/xmlsec/keysdata.h

Macro. Returns 1 if data is valid.

Macro. Returns 1 if data is not NULL and data->id is not NULL or 0 otherwise.

Parameters:

  • data — the pointer to data.

xmlSecKeyDataCheckId

Defined as: (xmlSecKeyDataIsValid(( data )) && \ ((( data )->id) == ( dataId )))

Source: include/xmlsec/keysdata.h

Macro. Returns 1 if data's id equals dataId.

Macro. Returns 1 if data is valid and data's id is equal to dataId.

Parameters:

  • data — the pointer to data.
  • dataId — the data Id.

xmlSecKeyDataCheckUsage

Defined as: (xmlSecKeyDataIsValid(( data )) && \ (((( data )->id->usage) & ( usg )) != 0))

Source: include/xmlsec/keysdata.h

Macro. Returns 1 if data can be used for usg.

Macro. Returns 1 if data is valid and could be used for usg.

Parameters:

  • data — the pointer to data.
  • usg — the data usage.

xmlSecKeyDataCheckSize

Defined as: (xmlSecKeyDataIsValid(( data )) && \ (( data )->id->objSize >= size))

Source: include/xmlsec/keysdata.h

Macro. Returns 1 if data's object has at least size bytes.

Macro. Returns 1 if data is valid and data's object has at least size bytes.

Parameters:

  • data — the pointer to data.
  • size — the expected size.

xmlSecKeyDataIdUnknown

Defined as: ((xmlSecKeyDataId)NULL)

Source: include/xmlsec/keysdata.h

The "unknown" id.


xmlSecKeyDataKlassGetName

Defined as: (((klass)) ? ((klass)->name) : NULL)

Source: include/xmlsec/keysdata.h

Macro. Returns data klass name.

Parameters:

  • klass — the data klass.

xmlSecKeyDataListId

Defined as: xmlSecKeyDataListGetKlass()

Source: include/xmlsec/keysdata.h

The key data klasses list klass id.


xmlSecKeyDataIdListId

Defined as: xmlSecKeyDataIdListGetKlass()

Source: include/xmlsec/keysdata.h

The key data list klass id.


xmlSecKeyDataStoreGetName

Defined as: ((xmlSecKeyDataStoreIsValid((store))) ? \ xmlSecKeyDataStoreKlassGetName((store)->id) : NULL)

Source: include/xmlsec/keysdata.h

Macro. Returns key data store name.

Parameters:

  • store — the pointer to store.

xmlSecKeyDataStoreIsValid

Defined as: ((( store ) != NULL) && ((( store )->id) != NULL))

Source: include/xmlsec/keysdata.h

Macro. Returns 1 if store is valid.

Macro. Returns 1 if store is not NULL and store->id is not NULL or 0 otherwise.

Parameters:

  • store — the pointer to store.

xmlSecKeyDataStoreCheckId

Defined as: (xmlSecKeyDataStoreIsValid(( store )) && \ ((( store )->id) == ( storeId )))

Source: include/xmlsec/keysdata.h

Macro. Returns 1 if store's id equals storeId.

Macro. Returns 1 if store is valid and store's id is equal to storeId.

Parameters:

  • store — the pointer to store.
  • storeId — the store Id.

xmlSecKeyDataStoreCheckSize

Defined as: (xmlSecKeyDataStoreIsValid(( store )) && \ (( store )->id->objSize >= size))

Source: include/xmlsec/keysdata.h

Macro. Returns 1 if store's object has at least size bytes.

Macro. Returns 1 if data is valid and stores's object has at least size bytes.

Parameters:

  • store — the pointer to store.
  • size — the expected size.

xmlSecKeyDataStoreIdUnknown

Defined as: NULL

Source: include/xmlsec/keysdata.h

The "unknown" id.


xmlSecKeyDataStoreKlassGetName

Defined as: (((klass)) ? ((klass)->name) : NULL)

Source: include/xmlsec/keysdata.h

Macro. Returns store klass name.

Parameters:

  • klass — the pointer to store klass.

xmlSecKeyDataStorePtrListId

Defined as: xmlSecKeyDataStorePtrListGetKlass()

Source: include/xmlsec/keysdata.h

The data store list id (klass).


Typedefs

xmlSecKeyDataKlass

typedef const struct _xmlSecKeyDataKlass xmlSecKeyDataKlass;

Source: include/xmlsec/keysdata.h

The key data klass.


xmlSecKeyDataId

typedef const struct _xmlSecKeyDataKlass* xmlSecKeyDataId;

Source: include/xmlsec/keysdata.h

Pointer to xmlSecKeyDataKlass.


xmlSecKeyDataStoreKlass

typedef const struct _xmlSecKeyDataStoreKlass xmlSecKeyDataStoreKlass;

Source: include/xmlsec/keysdata.h

The key data store klass.


xmlSecKeyDataStoreId

typedef const struct _xmlSecKeyDataStoreKlass* xmlSecKeyDataStoreId;

Source: include/xmlsec/keysdata.h

Pointer to xmlSecKeyDataStoreKlass.


xmlSecKeyDataList

typedef struct _xmlSecKeyDataList xmlSecKeyDataList;

Source: include/xmlsec/keysdata.h

The key data list.


xmlSecKeyDataListPtr

typedef struct _xmlSecKeyDataList* xmlSecKeyDataListPtr;

Source: include/xmlsec/keysdata.h

Pointer to xmlSecKeyDataList.


xmlSecKeyDataUsage

typedef unsigned int xmlSecKeyDataUsage;

Source: include/xmlsec/keysdata.h

The key data usage bitmask.

The bits mask that determines possible keys data usage.


xmlSecKeyDataType

typedef unsigned int xmlSecKeyDataType;

Source: include/xmlsec/keysdata.h

The key data type.

The key data type (public/private, session/permanent, etc.).


xmlSecKeyDataInitMethod

typedef int(* xmlSecKeyDataInitMethod) (xmlSecKeyDataPtr data))(xmlSecKeyDataPtr data);

Source: include/xmlsec/keysdata.h

Key data specific initialization method.

Parameters:

  • data — the pointer to key data.

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


xmlSecKeyDataDuplicateMethod

typedef int(* xmlSecKeyDataDuplicateMethod) (xmlSecKeyDataPtr dst, xmlSecKeyDataPtr src))(xmlSecKeyDataPtr dst, xmlSecKeyDataPtr src);

Source: include/xmlsec/keysdata.h

Key data specific duplication (copy) method.

Parameters:

  • dst — the pointer to destination key data.
  • src — the pointer to source key data.

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


xmlSecKeyDataFinalizeMethod

typedef void(* xmlSecKeyDataFinalizeMethod) (xmlSecKeyDataPtr data))(xmlSecKeyDataPtr data);

Source: include/xmlsec/keysdata.h

Key data specific finalization method.

Key data specific finalization method. All the objects and resources allocated by the key data object must be freed inside this method.

Parameters:

  • data — the data.

xmlSecKeyDataXmlReadMethod

typedef int(* xmlSecKeyDataXmlReadMethod) (xmlSecKeyDataId id, xmlSecKeyPtr key, xmlNodePtr node, xmlSecKeyInfoCtxPtr keyInfoCtx))(xmlSecKeyDataId id, xmlSecKeyPtr key, xmlNodePtr node, xmlSecKeyInfoCtxPtr keyInfoCtx);

Source: include/xmlsec/keysdata.h

Key data specific method for reading XML node.

Parameters:

  • id — the data id.
  • key — the key.
  • node — the pointer to data's value XML node.
  • keyInfoCtx — the dsig:KeyInfo/ node processing context.

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


xmlSecKeyDataXmlWriteMethod

typedef int(* xmlSecKeyDataXmlWriteMethod) (xmlSecKeyDataId id, xmlSecKeyPtr key, xmlNodePtr node, xmlSecKeyInfoCtxPtr keyInfoCtx))(xmlSecKeyDataId id, xmlSecKeyPtr key, xmlNodePtr node, xmlSecKeyInfoCtxPtr keyInfoCtx);

Source: include/xmlsec/keysdata.h

Key data specific method for writing XML node.

Parameters:

  • id — the data id.
  • key — the key.
  • node — the pointer to data's value XML node.
  • keyInfoCtx — the dsig:KeyInfo/ node processing context.

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


xmlSecKeyDataBinReadMethod

typedef int(* xmlSecKeyDataBinReadMethod) (xmlSecKeyDataId id, xmlSecKeyPtr key, const xmlSecByte *buf, xmlSecSize bufSize, xmlSecKeyInfoCtxPtr keyInfoCtx))(xmlSecKeyDataId id, xmlSecKeyPtr key, const xmlSecByte *buf, xmlSecSize bufSize, xmlSecKeyInfoCtxPtr keyInfoCtx);

Source: include/xmlsec/keysdata.h

Key data specific method to read a binary buffer.

Key data specific method for reading binary buffer.

Parameters:

  • id — the data id.
  • key — the key.
  • buf — the input buffer.
  • bufSize — the buffer size.
  • keyInfoCtx — the dsig:KeyInfo/ node processing context.

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


xmlSecKeyDataBinWriteMethod

typedef int(* xmlSecKeyDataBinWriteMethod) (xmlSecKeyDataId id, xmlSecKeyPtr key, xmlSecByte **buf, xmlSecSize *bufSize, xmlSecKeyInfoCtxPtr keyInfoCtx))(xmlSecKeyDataId id, xmlSecKeyPtr key, xmlSecByte **buf, xmlSecSize *bufSize, xmlSecKeyInfoCtxPtr keyInfoCtx);

Source: include/xmlsec/keysdata.h

Key data specific method to write a binary buffer.

Key data specific method for reading binary buffer.

Parameters:

  • id — the data id.
  • key — the key.
  • buf — the output buffer.
  • bufSize — the buffer size.
  • keyInfoCtx — the dsig:KeyInfo/ node processing context.

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


xmlSecKeyDataGenerateMethod

typedef int(* xmlSecKeyDataGenerateMethod) (xmlSecKeyDataPtr data, xmlSecSize sizeBits, xmlSecKeyDataType type))(xmlSecKeyDataPtr data, xmlSecSize sizeBits, xmlSecKeyDataType type);

Source: include/xmlsec/keysdata.h

Key data specific key generation method.

Key data specific method for generating new key data.

Parameters:

  • data — the pointer to key data.
  • sizeBits — the key data specific size.
  • type — the required key type (session/permanent, etc.)

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


xmlSecKeyDataGetTypeMethod

typedef xmlSecKeyDataType(* xmlSecKeyDataGetTypeMethod) (xmlSecKeyDataPtr data))(xmlSecKeyDataPtr data);

Source: include/xmlsec/keysdata.h

Key data specific method to get the key type.

Parameters:

  • data — the data.

Returns: the key type.


xmlSecKeyDataGetSizeMethod

typedef xmlSecSize(* xmlSecKeyDataGetSizeMethod) (xmlSecKeyDataPtr data))(xmlSecKeyDataPtr data);

Source: include/xmlsec/keysdata.h

Key data specific method to get the key size.

Parameters:

  • data — the pointer to key data.

Returns: the key size in bits.


xmlSecKeyDataDebugDumpMethod

typedef void(* xmlSecKeyDataDebugDumpMethod) (xmlSecKeyDataPtr data, FILE *output))(xmlSecKeyDataPtr data, FILE *output);

Source: include/xmlsec/keysdata.h

Key data specific method for printing debug info.

Parameters:

  • data — the data.
  • output — the FILE to print debug info (should be open for writing).

xmlSecKeyDataStoreInitializeMethod

typedef int(* xmlSecKeyDataStoreInitializeMethod) (xmlSecKeyDataStorePtr store))(xmlSecKeyDataStorePtr store);

Source: include/xmlsec/keysdata.h

Key data store specific initialization method.

Parameters:

  • store — the data store.

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


xmlSecKeyDataStoreFinalizeMethod

typedef void(* xmlSecKeyDataStoreFinalizeMethod) (xmlSecKeyDataStorePtr store))(xmlSecKeyDataStorePtr store);

Source: include/xmlsec/keysdata.h

Key data store specific finalization method.

Key data store specific finalization (destroy) method.

Parameters:

  • store — the data store.

Enumerations

xmlSecKeyDataFormat

Source: include/xmlsec/keysdata.h

The key data format (binary, der, pem, etc.).

Value Initializer Description
xmlSecKeyDataFormatUnknown = 0
xmlSecKeyDataFormatBinary ``
xmlSecKeyDataFormatPem ``
xmlSecKeyDataFormatDer ``
xmlSecKeyDataFormatPkcs8Pem ``
xmlSecKeyDataFormatPkcs8Der ``
xmlSecKeyDataFormatPkcs12 ``
xmlSecKeyDataFormatCertPem ``
xmlSecKeyDataFormatCertDer ``
xmlSecKeyDataFormatEngine ``
xmlSecKeyDataFormatStore ``

Functions

xmlSecKeyDataIdsGet

xmlSecPtrListPtr xmlSecKeyDataIdsGet(void);

Source: include/xmlsec/keysdata.h

Gets global registered key data klasses list.

Returns: the pointer to list of all registered key data klasses.


xmlSecKeyDataIdsGetEnabled

xmlSecPtrListPtr xmlSecKeyDataIdsGetEnabled(void);

Source: include/xmlsec/keysdata.h

Gets global enabled key data klasses list.

Returns: the pointer to list of all enabled key data klasses.


xmlSecKeyDataIdsInit

int xmlSecKeyDataIdsInit(void);

Source: include/xmlsec/keysdata.h

Initializes the key data klasses.

Initializes the key data klasses. This function is called from the xmlSecInit function and the application should not call it directly.

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


xmlSecKeyDataIdsShutdown

void xmlSecKeyDataIdsShutdown(void);

Source: include/xmlsec/keysdata.h

Shuts down the key data klasses.

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


xmlSecKeyDataIdsRegisterDefault

int xmlSecKeyDataIdsRegisterDefault(void);

Source: include/xmlsec/keysdata.h

Registers default key data klasses.

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.


xmlSecKeyDataIdsRegister

int xmlSecKeyDataIdsRegister(xmlSecKeyDataId id);

Source: include/xmlsec/keysdata.h

Registers a key data klass in the global list (enabled).

Registers id in the global list of key data klasses and enable this key data.

Parameters:

  • id — the key data klass.

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


xmlSecKeyDataIdsRegisterDisabled

int xmlSecKeyDataIdsRegisterDisabled(xmlSecKeyDataId id);

Source: include/xmlsec/keysdata.h

Registers a key data klass in the global list (disabled).

Registers id in the global list of key data klasses and but DO NOT enable this key data.

Parameters:

  • id — the key data klass.

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


xmlSecKeyDataCreate

xmlSecKeyDataPtr xmlSecKeyDataCreate(xmlSecKeyDataId id);

Source: include/xmlsec/keysdata.h

Allocates and initializes new key data of the specified type.

Allocates and initializes new key data of the specified type id. Caller is responsible for destroying returned object with xmlSecKeyDataDestroy function.

Parameters:

  • id — the data id.

Returns: the pointer to newly allocated key data structure or NULL if an error occurs.


xmlSecKeyDataDuplicate

xmlSecKeyDataPtr xmlSecKeyDataDuplicate(xmlSecKeyDataPtr data);

Source: include/xmlsec/keysdata.h

Creates a duplicate of the given key data.

Creates a duplicate of the given data. Caller is responsible for destroying returned object with xmlSecKeyDataDestroy function.

Parameters:

  • data — the pointer to the key data.

Returns: the pointer to newly allocated key data structure or NULL if an error occurs.


xmlSecKeyDataDestroy

void xmlSecKeyDataDestroy(xmlSecKeyDataPtr data);

Source: include/xmlsec/keysdata.h

Destroys the data and frees all allocated memory.

Parameters:

  • data — the pointer to the key data.

xmlSecKeyDataGenerate

int xmlSecKeyDataGenerate(xmlSecKeyDataPtr data, xmlSecSize sizeBits, xmlSecKeyDataType type);

Source: include/xmlsec/keysdata.h

Generates new key data of given size and type.

Parameters:

  • data — the pointer to key data.
  • sizeBits — the desired key data size (in bits).
  • type — the desired key data type.

Returns: 0 on success or a negative value otherwise.


xmlSecKeyDataGetType

xmlSecKeyDataType xmlSecKeyDataGetType(xmlSecKeyDataPtr data);

Source: include/xmlsec/keysdata.h

Gets key data type.

Parameters:

  • data — the pointer to key data.

Returns: key data type.


xmlSecKeyDataGetSize

xmlSecSize xmlSecKeyDataGetSize(xmlSecKeyDataPtr data);

Source: include/xmlsec/keysdata.h

Gets key data size (in bits).

Parameters:

  • data — the pointer to key data.

Returns: key data size (in bits).


xmlSecKeyDataDebugDump

void xmlSecKeyDataDebugDump(xmlSecKeyDataPtr data, FILE *output);

Source: include/xmlsec/keysdata.h

Prints key data debug info.

Parameters:

  • data — the pointer to key data.
  • output — the pointer to output FILE.

xmlSecKeyDataDebugXmlDump

void xmlSecKeyDataDebugXmlDump(xmlSecKeyDataPtr data, FILE *output);

Source: include/xmlsec/keysdata.h

Prints key data debug info in XML format.

Parameters:

  • data — the pointer to key data.
  • output — the pointer to output FILE.

xmlSecKeyDataXmlRead

int xmlSecKeyDataXmlRead(xmlSecKeyDataId id, xmlSecKeyPtr key, xmlNodePtr node, xmlSecKeyInfoCtxPtr keyInfoCtx);

Source: include/xmlsec/keysdata.h

Reads key data from an XML node into a key.

Reads the key data of klass id from XML node and adds them to key.

Parameters:

  • id — the data klass.
  • key — the destination key.
  • node — the pointer to an XML node.
  • keyInfoCtx — the pointer to dsig:KeyInfo/ element processing context.

Returns: 0 on success or a negative value otherwise.


xmlSecKeyDataXmlWrite

int xmlSecKeyDataXmlWrite(xmlSecKeyDataId id, xmlSecKeyPtr key, xmlNodePtr node, xmlSecKeyInfoCtxPtr keyInfoCtx);

Source: include/xmlsec/keysdata.h

Writes key data from a key into an XML node.

Writes the key data of klass id from key to an XML node.

Parameters:

  • id — the data klass.
  • key — the source key.
  • node — the pointer to an XML node.
  • keyInfoCtx — the pointer to dsig:KeyInfo/ element processing context.

Returns: 0 on success or a negative value otherwise.


xmlSecKeyDataBinRead

int xmlSecKeyDataBinRead(xmlSecKeyDataId id, xmlSecKeyPtr key, const xmlSecByte *buf, xmlSecSize bufSize, xmlSecKeyInfoCtxPtr keyInfoCtx);

Source: include/xmlsec/keysdata.h

Reads key data from a binary buffer into a key.

Reads the key data of klass id from binary buffer buf to key.

Parameters:

  • 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.


xmlSecKeyDataBinWrite

int xmlSecKeyDataBinWrite(xmlSecKeyDataId id, xmlSecKeyPtr key, xmlSecByte **buf, xmlSecSize *bufSize, xmlSecKeyInfoCtxPtr keyInfoCtx);

Source: include/xmlsec/keysdata.h

Writes key data from a key into a binary buffer.

Writes the key data of klass id from the key to a binary buffer buf.

Parameters:

  • 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.


xmlSecKeyDataBinaryValueGetSize

xmlSecSize xmlSecKeyDataBinaryValueGetSize(xmlSecKeyDataPtr data);

Source: include/xmlsec/keysdata.h

Gets the binary key data size.

Parameters:

  • data — the pointer to binary key data.

Returns: binary key data size in bits.


xmlSecKeyDataBinaryValueGetBuffer

xmlSecBufferPtr xmlSecKeyDataBinaryValueGetBuffer(xmlSecKeyDataPtr data);

Source: include/xmlsec/keysdata.h

Gets the binary key data buffer.

Parameters:

  • data — the pointer to binary key data.

Returns: pointer to binary key data buffer.


xmlSecKeyDataBinaryValueSetBuffer

int xmlSecKeyDataBinaryValueSetBuffer(xmlSecKeyDataPtr data, const xmlSecByte *buf, xmlSecSize bufSize);

Source: include/xmlsec/keysdata.h

Sets the value of data to buf.

Parameters:

  • data — the pointer to binary key data.
  • buf — the pointer to binary buffer.
  • bufSize — the binary buffer size.

Returns: 0 on success or a negative value otherwise.


xmlSecKeyDataListGetKlass

xmlSecPtrListId xmlSecKeyDataListGetKlass(void);

Source: include/xmlsec/keysdata.h

The key data list klass.

Returns: pointer to the key data list klass.


xmlSecKeyDataIdListGetKlass

xmlSecPtrListId xmlSecKeyDataIdListGetKlass(void);

Source: include/xmlsec/keysdata.h

The key data id list klass.

Returns: pointer to the key data id list klass.


xmlSecKeyDataIdListFind

int xmlSecKeyDataIdListFind(xmlSecPtrListPtr list, xmlSecKeyDataId dataId);

Source: include/xmlsec/keysdata.h

Lookups dataId in list.

Parameters:

  • list — the pointer to key data ids list.
  • dataId — the key data klass.

Returns: 1 if dataId is found in the list, 0 if not and a negative value if an error occurs.


xmlSecKeyDataIdListFindByNode

xmlSecKeyDataId xmlSecKeyDataIdListFindByNode(xmlSecPtrListPtr list, const xmlChar *nodeName, const xmlChar *nodeNs, xmlSecKeyDataUsage usage);

Source: include/xmlsec/keysdata.h

Looks up a key data klass by XML node name, namespace, and usage.

Lookups data klass in the list with given nodeName, nodeNs and usage in the list.

Parameters:

  • list — the pointer to key data ids list.
  • nodeName — the desired key data klass XML node name.
  • nodeNs — the desired key data klass XML node namespace.
  • usage — the desired key data usage.

Returns: key data klass is found and NULL otherwise.


xmlSecKeyDataIdListFindByHref

xmlSecKeyDataId xmlSecKeyDataIdListFindByHref(xmlSecPtrListPtr list, const xmlChar *href, xmlSecKeyDataUsage usage);

Source: include/xmlsec/keysdata.h

Looks up a key data klass by href and usage.

Lookups data klass in the list with given href and usage in list.

Parameters:

  • list — the pointer to key data ids list.
  • href — the desired key data klass href.
  • usage — the desired key data usage.

Returns: key data klass is found and NULL otherwise.


xmlSecKeyDataIdListFindByName

xmlSecKeyDataId xmlSecKeyDataIdListFindByName(xmlSecPtrListPtr list, const xmlChar *name, xmlSecKeyDataUsage usage);

Source: include/xmlsec/keysdata.h

Looks up a key data klass by name and usage.

Lookups data klass in the list with given name and usage in list.

Parameters:

  • list — the pointer to key data ids list.
  • name — the desired key data klass name.
  • usage — the desired key data usage.

Returns: key data klass is found and NULL otherwise.


xmlSecKeyDataIdListDebugDump

void xmlSecKeyDataIdListDebugDump(xmlSecPtrListPtr list, FILE *output);

Source: include/xmlsec/keysdata.h

Prints key data ID list debug information.

Prints binary key data debug information to output.

Parameters:

  • list — the pointer to key data ids list.
  • output — the pointer to output FILE.

xmlSecKeyDataIdListDebugXmlDump

void xmlSecKeyDataIdListDebugXmlDump(xmlSecPtrListPtr list, FILE *output);

Source: include/xmlsec/keysdata.h

Prints key data ID list debug information in XML format.

Prints binary key data debug information to output in XML format.

Parameters:

  • list — the pointer to key data ids list.
  • output — the pointer to output FILE.

xmlSecKeyDataStoreCreate

xmlSecKeyDataStorePtr xmlSecKeyDataStoreCreate(xmlSecKeyDataStoreId id);

Source: include/xmlsec/keysdata.h

Creates a new key data store of the specified klass.

Creates new key data store of the specified klass id. Caller is responsible for freeing returned object with xmlSecKeyDataStoreDestroy function.

Parameters:

  • id — the store id.

Returns: the pointer to newly allocated key data store structure or NULL if an error occurs.


xmlSecKeyDataStoreDestroy

void xmlSecKeyDataStoreDestroy(xmlSecKeyDataStorePtr store);

Source: include/xmlsec/keysdata.h

Destroys a key data store.

Destroys the key data store created with xmlSecKeyDataStoreCreate function.

Parameters:

  • store — the pointer to the key data store..

xmlSecKeyDataStorePtrListGetKlass

xmlSecPtrListId xmlSecKeyDataStorePtrListGetKlass(void);

Source: include/xmlsec/keysdata.h

Key data stores list.

Returns: key data stores list klass.


xmlSecImportSetPersistKey

void xmlSecImportSetPersistKey(void);

Source: include/xmlsec/keysdata.h

Sets global flag to import keys to persistent storage.

Sets global flag to import keys to persistent storage (MSCrypto and MSCNG). Also see PKCS12_NO_PERSIST_KEY.


xmlSecImportGetPersistKey

int xmlSecImportGetPersistKey(void);

Source: include/xmlsec/keysdata.h

Gets global flag for importing keys to persistent storage.

Gets global flag to import keys to persistent storage (MSCrypto and MSCNG). Also see PKCS12_NO_PERSIST_KEY.

Returns: 1 if keys should be imported into persistent storage and 0 otherwise.


xmlSecKeyDataGetIdentifier

const xmlChar * xmlSecKeyDataGetIdentifier(xmlSecKeyDataPtr data);

Source: include/xmlsec/keysdata.h

DEPRECATED. Gets key data identifier string.

Parameters:

  • data — the pointer to key data.

Returns: key data id string.


Clone this wiki locally