Straightforward C14N
3.1.0
Performs the C14N transformation of a straightforward XML document
|
The C/C++ interface to the diSc14n.dll library. More...
Macros | |
#define | SC14N_DIG_DEFAULT 0 |
Use default digest algorithm (SHA-1) | |
#define | SC14N_DIG_SHA1 0 |
Use SHA-1 digest algorithm (default) | |
#define | SC14N_DIG_SHA256 0x2000 |
Use SHA-256 digest algorithm. | |
#define | SC14N_DIG_SHA384 0x3000 |
Use SHA-384 digest algorithm. | |
#define | SC14N_DIG_SHA512 0x5000 |
Use SHA-512 digest algorithm. | |
#define | SC14N_MAX_DIGEST_CHARS 88 |
Maximum number of characters in base64-encoded hash digest value. | |
#define | SC14N_MAX_ERROR_CHARS 4073 |
Maximum number of characters in an error message. | |
#define | SC14N_METHOD_EXCLUSIVE 0x100 |
Use exclusive c14n method [RFC 3741]. | |
#define | SC14N_METHOD_INCLUSIVE 0 |
Use inclusive c14n method [RFC 3076] (default) | |
#define | SC14N_METHOD_WITHCOMMENTS 0x800 |
Include comments in c14n form (#WithComments ) | |
#define | SC14N_OPT_FLATTEN 0x10000 |
Flatten the XML - remove all ignorable whitespace between tags. | |
#define | SC14N_TRAN_ENTIRE 0 |
Transform the entire document (default) | |
#define | SC14N_TRAN_OMITBYID 0x11 |
Omit the element with the given Id. | |
#define | SC14N_TRAN_OMITBYTAG 0x01 |
Omit the element with the given tag name. | |
#define | SC14N_TRAN_SUBSETBYID 0x12 |
Transform the subset with the given Id. | |
#define | SC14N_TRAN_SUBSETBYTAG 0x02 |
Transform the subset with the given tag name. | |
Functions | |
long | C14N_File2Digest (char *szOut, long nOutChars, const char *szInputFile, const char *szNameOrId, const char *szParams, long nOptions) |
Computes digest value of C14N transformation (file-to-digest). More... | |
long | C14N_File2File (const char *szOutputFile, const char *szInputFile, const char *szNameOrId, const char *szParams, long nOptions) |
Performs C14N transformation of XML document (file-to-file). More... | |
long | C14N_File2String (char *szOut, long nOutChars, const char *szInputFile, const char *szNameOrId, const char *szParams, long nOptions) |
Performs C14N transformation of XML document (file-to-memory). More... | |
long | C14N_String2Digest (char *szOut, long nOutChars, const void *lpDataIn, long nDataLen, const char *szNameOrId, const char *szParams, long nOptions) |
Computes digest value of C14N transformation (memory-to-digest). More... | |
long | C14N_String2String (char *szOut, long nOutChars, const void *lpDataIn, long nDataLen, const char *szNameOrId, const char *szParams, long nOptions) |
Performs C14N transformation of XML document (memory-to-memory). More... | |
long | SC14N_Err_ErrorLookup (char *szOut, long nOutChars, long nErrCode) |
Looks up description for error code. More... | |
long | SC14N_Err_LastError (char *szOut, long nOutChars) |
Retrieves the last error message (if available). More... | |
long | SC14N_Gen_CompileTime (char *szOut, long nOutChars) |
Gets date and time the core DLL module was last compiled. More... | |
long | SC14N_Gen_LicenceType (void) |
Gets licence type. More... | |
long | SC14N_Gen_ModuleName (char *szOut, long nOutChars, long nOptions) |
Gets full path name of core DLL module. More... | |
long | SC14N_Gen_Platform (char *szOut, long nOutChars) |
Gets platform on which the core DLL is running ("Win32" or "Win64"). More... | |
long | SC14N_Gen_Version (void) |
Gets version number of the core DLL. More... | |
long | SC14N_Utf8FromWide (char *szOut, long nOutChars, const wchar_t *wstr) |
Maps a UTF-16 (wide character) string to a UTF-8-encoded string. More... | |
The C/C++ interface to the diSc14n.dll library.
http://www.w3.org/TR/2001/REC-xml-c14n-20010315 http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments"exclusive canonicalization" from Exclusive XML Canonicalization Version 1.0 (reproduced as RFC 3741) with identifiers
http://www.w3.org/2001/10/xml-exc-c14n# http://www.w3.org/2001/10/xml-exc-c14n#WithComments
I
dentifier | nOptions |
---|---|
http://www.w3.org/TR/2001/REC-xml-c14n-20010315 | 0 |
http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments | #SC14N_METHOD_WITHCOMMENTS |
http://www.w3.org/2001/10/xml-exc-c14n# | #SC14N_METHOD_EXCLUSIVE |
http://www.w3.org/2001/10/xml-exc-c14n#WithComments | #SC14N_METHOD_EXCLUSIVE | #SC14N_METHOD_WITHCOMMENTS |
UTF-8
, ISO-8859-1
and US-ASCII
. szOut
require the buffer to be pre-dimensioned (i.e. allocated) to at least the specified length nOutChars
PLUS one extra for the null-terminating byte. These functions always return the total length in bytes of the string they tried to create. To find the required length, pass a NULL szOut
or zero nOutChars
argument, then add one to the result for the required buffer size.For example:
or, for an output buffer of a known length:
szNameOrId
parameter to specify the element of the XML document to include or omit.szNameOrId
specifies the element's tag name.tagname[N]
where N=1,2,3,...
szNameOrId
specifies the element's IdId
, so the argument myvalue
will find the element with Id="myvalue"
.ID
– write in the form ID=myvalue
with no quotes.""
or NULL
.Exactly one element will be omitted or included. Tag names and Id values are case sensitive. It is an error (NO_DATA_ERROR
) if no matching element is found.
long C14N_File2Digest | ( | char * | szOut, |
long | nOutChars, | ||
const char * | szInputFile, | ||
const char * | szNameOrId, | ||
const char * | szParams, | ||
long | nOptions | ||
) |
Computes digest value of C14N transformation (file-to-digest).
[out] | szOut | Buffer to receive digest value output |
[in] | nOutChars | Length of output buffer in bytes |
[in] | szInputFile | Name of input file containing XML document to be processed |
[in] | szNameOrId | To specify the tag name or Id. See Specifying the tag name or Id. |
[in] | szParams | InclusiveNamespaces PrefixList parameter (exclusive C14n only). Use "" or NULL to ignore. |
[in] | nOptions | Option flags. Select exactly one of:#SC14N_TRAN_ENTIRE (0) to transform the entire document (default)#SC14N_TRAN_OMITBYTAG to omit the element with tag name specified in szNameOrId #SC14N_TRAN_SUBSETBYTAG to transform subset with tag name specified in szNameOrId #SC14N_TRAN_OMITBYID to omit the element with Id specified in szNameOrId #SC14N_TRAN_SUBSETBYID to transform subset with Id specified in szNameOrId and add one of: #SC14N_DIG_SHA1 (0) to use SHA-1 algorithm (default) or#SC14N_DIG_SHA256 to use SHA-256.and optionally add any of the following. Use the | operator to combine:#SC14N_METHOD_EXCLUSIVE to use exclusive c14n method (default is inclusive c14n method)#SC14N_METHOD_WITHCOMMENTS to include comments in c14n form (#WithComments )#SC14N_OPT_FLATTEN to remove all ignorable whitespace between tags |
SC14N_MAX_DIGEST_CHARS
. long C14N_File2File | ( | const char * | szOutputFile, |
const char * | szInputFile, | ||
const char * | szNameOrId, | ||
const char * | szParams, | ||
long | nOptions | ||
) |
Performs C14N transformation of XML document (file-to-file).
[in] | szOutputFile | Name of output file to create (will be overwritten if exists) |
[in] | szInputFile | Name of input file containing XML document to be processed |
[in] | szNameOrId | To specify the tag name or Id. See Specifying the tag name or Id. |
[in] | szParams | InclusiveNamespaces PrefixList parameter (exclusive C14n only). Use "" or NULL to ignore. |
[in] | nOptions | Option flags. Select exactly one of:#SC14N_TRAN_ENTIRE (0) to transform the entire document (default)#SC14N_TRAN_OMITBYTAG to omit the element with tag name specified in szNameOrId #SC14N_TRAN_SUBSETBYTAG to transform subset with tag name specified in szNameOrId #SC14N_TRAN_OMITBYID to omit the element with Id specified in szNameOrId #SC14N_TRAN_SUBSETBYID to transform subset with Id specified in szNameOrId and optionally add any of the following. Use the | operator to combine:#SC14N_METHOD_EXCLUSIVE to use exclusive c14n method (default is inclusive c14n method)#SC14N_METHOD_WITHCOMMENTS to include comments in c14n form (#WithComments )#SC14N_OPT_FLATTEN to remove all ignorable whitespace between tags |
long C14N_File2String | ( | char * | szOut, |
long | nOutChars, | ||
const char * | szInputFile, | ||
const char * | szNameOrId, | ||
const char * | szParams, | ||
long | nOptions | ||
) |
Performs C14N transformation of XML document (file-to-memory).
[out] | szOut | Buffer to receive output as UTF-8 encoded bytes |
[in] | nOutChars | Length of output buffer in bytes |
[in] | szInputFile | Name of input file containing XML document to be processed |
[in] | szNameOrId | To specify the tag name or Id. See Specifying the tag name or Id. |
[in] | szParams | InclusiveNamespaces PrefixList parameter (exclusive C14n only). Use "" or NULL to ignore. |
[in] | nOptions | Option flags. Select exactly one of:#SC14N_TRAN_ENTIRE (0) to transform the entire document (default)#SC14N_TRAN_OMITBYTAG to omit the element with tag name specified in szNameOrId #SC14N_TRAN_SUBSETBYTAG to transform subset with tag name specified in szNameOrId #SC14N_TRAN_OMITBYID to omit the element with Id specified in szNameOrId #SC14N_TRAN_SUBSETBYID to transform subset with Id specified in szNameOrId and optionally add any of the following. Use the | operator to combine:#SC14N_METHOD_EXCLUSIVE to use exclusive c14n method (default is inclusive c14n method)#SC14N_METHOD_WITHCOMMENTS to include comments in c14n form (#WithComments )#SC14N_OPT_FLATTEN to remove all ignorable whitespace between tags |
long C14N_String2Digest | ( | char * | szOut, |
long | nOutChars, | ||
const void * | lpDataIn, | ||
long | nDataLen, | ||
const char * | szNameOrId, | ||
const char * | szParams, | ||
long | nOptions | ||
) |
Computes digest value of C14N transformation (memory-to-digest).
[out] | szOut | Buffer to receive digest value output |
[in] | nOutChars | Length of output buffer in bytes |
[in] | lpDataIn | Pointer to XML data to be processed |
[in] | nDataLen | Length of input data in bytes |
[in] | szNameOrId | To specify the tag name or Id. See Specifying the tag name or Id. |
[in] | szParams | InclusiveNamespaces PrefixList parameter (exclusive C14n only). Use "" or NULL to ignore. |
[in] | nOptions | Option flags. Select exactly one of:#SC14N_TRAN_ENTIRE (0) to transform the entire document (default)#SC14N_TRAN_OMITBYTAG to omit the element with tag name specified in szNameOrId #SC14N_TRAN_SUBSETBYTAG to transform subset with tag name specified in szNameOrId #SC14N_TRAN_OMITBYID to omit the element with Id specified in szNameOrId #SC14N_TRAN_SUBSETBYID to transform subset with Id specified in szNameOrId and add one of: #SC14N_DIG_SHA1 (0) to use SHA-1 algorithm (default) or#SC14N_DIG_SHA256 to use SHA-256.and optionally add any of the following. Use the | operator to combine:#SC14N_METHOD_EXCLUSIVE to use exclusive c14n method (default is inclusive c14n method)#SC14N_METHOD_WITHCOMMENTS to include comments in c14n form (#WithComments )#SC14N_OPT_FLATTEN to remove all ignorable whitespace between tags |
SC14N_MAX_DIGEST_CHARS
. long C14N_String2String | ( | char * | szOut, |
long | nOutChars, | ||
const void * | lpDataIn, | ||
long | nDataLen, | ||
const char * | szNameOrId, | ||
const char * | szParams, | ||
long | nOptions | ||
) |
Performs C14N transformation of XML document (memory-to-memory).
[out] | szOut | Buffer to receive output as UTF-8 encoded bytes |
[in] | nOutChars | Length of output buffer in bytes |
[in] | lpDataIn | Pointer to XML data to be processed |
[in] | nDataLen | Length of input data in bytes |
[in] | szNameOrId | To specify the tag name or Id. See Specifying the tag name or Id. |
[in] | szParams | InclusiveNamespaces PrefixList parameter (exclusive C14n only). Use "" or NULL to ignore. |
[in] | nOptions | Option flags. Select exactly one of:#SC14N_TRAN_ENTIRE (0) to transform the entire document (default)#SC14N_TRAN_OMITBYTAG to omit the element with tag name specified in szNameOrId #SC14N_TRAN_SUBSETBYTAG to transform subset with tag name specified in szNameOrId #SC14N_TRAN_OMITBYID to omit the element with Id specified in szNameOrId #SC14N_TRAN_SUBSETBYID to transform subset with Id specified in szNameOrId and optionally add any of the following. Use the | operator to combine:#SC14N_METHOD_EXCLUSIVE to use exclusive c14n method (default is inclusive c14n method)#SC14N_METHOD_WITHCOMMENTS to include comments in c14n form (#WithComments )#SC14N_OPT_FLATTEN to remove all ignorable whitespace between tags |
long SC14N_Err_ErrorLookup | ( | char * | szOut, |
long | nOutChars, | ||
long | nErrCode | ||
) |
Looks up description for error code.
[out] | szOut | Buffer to receive output string |
[in] | nOutChars | Maximum length of output string in bytes |
[in] | nErrCode | Value of error code to lookup (may be positive or negative) |
long SC14N_Err_LastError | ( | char * | szOut, |
long | nOutChars | ||
) |
Retrieves the last error message (if available).
[out] | szOut | Buffer to receive output string |
[in] | nOutChars | Maximum length of output string in bytes. Will not exceed SC14N_MAX_ERROR_CHARS . |
long SC14N_Gen_CompileTime | ( | char * | szOut, |
long | nOutChars | ||
) |
Gets date and time the core DLL module was last compiled.
[out] | szOut | Buffer to receive output string |
[in] | nOutChars | Maximum length of output string in bytes |
long SC14N_Gen_LicenceType | ( | void | ) |
Gets licence type.
long SC14N_Gen_ModuleName | ( | char * | szOut, |
long | nOutChars, | ||
long | nOptions | ||
) |
Gets full path name of core DLL module.
[out] | szOut | Buffer to receive output string |
[in] | nOutChars | Maximum length of output string in bytes. |
[in] | nOptions | Not used. Specify zero. |
long SC14N_Gen_Platform | ( | char * | szOut, |
long | nOutChars | ||
) |
Gets platform on which the core DLL is running ("Win32" or "Win64").
[out] | szOut | Buffer to receive output string |
[in] | nOutChars | Maximum length of output string in bytes |
long SC14N_Gen_Version | ( | void | ) |
Gets version number of the core DLL.
major*10000+minor*100+revision
e.g. DLL file version 1.2.x.3 will return 10203 long SC14N_Utf8FromWide | ( | char * | szOut, |
long | nOutChars, | ||
const wchar_t * | wstr | ||
) |
Maps a UTF-16 (wide character) string to a UTF-8-encoded string.
[out] | szOut | Buffer to receive null-terminated UTF-8-encoded string. |
[in] | nOutChars | Maximum length of output string in bytes (excluding the terminating null). |
[in] | wstr | String of wide characters to be processed. |
szOut
or zero nOutChars
to find the required output length in bytes. Allocate one extra byte for the terminating null.