transforms.h

Name

transforms.h -- The transforms functions.

Synopsis



enum        xmlSecTransformStatus;
typedef     xmlSecTransformId;
#define     xmlSecTransformUnknown
extern      xmlSecTransformId 		xmlSecEncAes128Cbc;
extern      xmlSecTransformId 		xmlSecEncAes192Cbc;
extern      xmlSecTransformId 		xmlSecEncAes256Cbc;
extern      xmlSecTransformId 		xmlSecKWAes128;
extern      xmlSecTransformId 		xmlSecKWAes192;
extern      xmlSecTransformId 		xmlSecKWAes256;
extern      xmlSecTransformId 		xmlSecEncBase64Encode;
extern      xmlSecTransformId 		xmlSecEncBase64Decode;
extern      xmlSecTransformId 		xmlSecC14NInclusive;
extern      xmlSecTransformId 		xmlSecC14NInclusiveWithComments;
extern      xmlSecTransformId 		xmlSecC14NExclusive;
extern      xmlSecTransformId 		xmlSecC14NExclusiveWithComments;
extern      xmlSecTransformId 		xmlSecEncDes3Cbc;
extern      xmlSecTransformId 		xmlSecKWDes3Cbc;
extern      xmlSecTransformId 		xmlSecSignDsaSha1;
extern      xmlSecTransformId 		xmlSecTransformEnveloped;
extern      xmlSecTransformId 		xmlSecMacHmacSha1;
extern      xmlSecTransformId 		xmlSecMacHmacRipeMd160;
extern      xmlSecTransformId 		xmlSecMacHmacMd5;
extern      xmlSecTransformId 		xmlSecDigestRipemd160;
extern      xmlSecTransformId 		xmlSecSignRsaSha1;
extern      xmlSecTransformId 		xmlSecEncRsaPkcs1;
extern      xmlSecTransformId 		xmlSecEncRsaOaep;
extern      xmlSecTransformId 		xmlSecDigestSha1;
extern      xmlSecTransformId 		xmlSecTransformXPath;
extern      xmlSecTransformId 		xmlSecTransformXPath2;
extern      xmlSecTransformId 		xmlSecTransformXPointer;
extern      xmlSecTransformId 		xmlSecTransformXslt;
int         xmlSecC14NExclAddInclNamespaces (xmlNodePtr transformNode,
                                             const xmlChar *prefixList);
int         xmlSecHmacAddOutputLength       (xmlNodePtr transformNode,
                                             size_t bitsLen);
int         xmlSecEncRsaOaepAddParam        (xmlNodePtr transformNode,
                                             unsigned char *buf,
                                             size_t size);
int         xmlSecTransformXPathAdd         (xmlNodePtr transformNode,
                                             const xmlChar *expression,
                                             const xmlChar **namespaces);
enum        xmlSecXPath2TransformType;
int         xmlSecTransformXPath2Add        (xmlNodePtr transformNode,
                                             xmlSecXPath2TransformType type,
                                             const xmlChar *expression,
                                             const xmlChar **namespaces);
int         xmlSecTransformXPointerAdd      (xmlNodePtr transformNode,
                                             const xmlChar *expression,
                                             const xmlChar **namespaces);
int         xmlSecTransformXsltAdd          (xmlNodePtr transformNode,
                                             const xmlChar *xslt);
extern      xmlSecKeyId 	 		xmlSecAesKey;
extern      xmlSecKeyId 			xmlSecDesKey;
extern      xmlSecKeyId 			xmlSecDsaKey;
extern      xmlSecKeyId 			xmlSecHmacKey;
extern      xmlSecKeyId 			xmlSecRsaKey;
int         xmlSecAesKeyGenerate            (xmlSecKeyPtr key,
                                             unsigned char *buf,
                                             size_t size);
int         xmlSecDesKeyGenerate            (xmlSecKeyPtr key,
                                             unsigned char *buf,
                                             size_t size);
int         xmlSecDsaKeyGenerate            (xmlSecKeyPtr key,
                                             DSA *dsa);
int         xmlSecHmacKeyGenerate           (xmlSecKeyPtr key,
                                             unsigned char *buf,
                                             size_t size);
int         xmlSecRsaKeyGenerate            (xmlSecKeyPtr key,
                                             RSA *rsa);
#define     XMLSEC_BASE64_LINESIZE
void        xmlSecBase64EncodeSetLineSize   (xmlSecTransformPtr transform,
                                             size_t lineSize);

Description

Details

enum xmlSecTransformStatus

typedef enum  {
    xmlSecTransformStatusNone = 0,
    xmlSecTransformStatusOk,
    xmlSecTransformStatusFail
} xmlSecTransformStatus;

The transform execution result.

xmlSecTransformStatusNone the status unknown.
xmlSecTransformStatusOk success.
xmlSecTransformStatusFail an error occur.


xmlSecTransformId

typedef const struct _xmlSecTransformIdStruct xmlSecTransformIdStruct, *xmlSecTransformId;

The transform id structure.


xmlSecTransformUnknown

#define xmlSecTransformUnknown			NULL

The "unknown" transform id (NULL).


xmlSecEncAes128Cbc

extern xmlSecTransformId 		xmlSecEncAes128Cbc;

The AES-CBC with 128 bits key encryption transform id.


xmlSecEncAes192Cbc

extern xmlSecTransformId 		xmlSecEncAes192Cbc;

The AES-CBC with 192 bits key encryption transform id.


xmlSecEncAes256Cbc

extern xmlSecTransformId 		xmlSecEncAes256Cbc;

The AES-CBC with 256 bits key encryption transform id.


xmlSecKWAes128

extern xmlSecTransformId 		xmlSecKWAes128;

The AES with 128 bits key wrap transform id.


xmlSecKWAes192

extern xmlSecTransformId 		xmlSecKWAes192;

The AES with 192 bits key wrap transform id.


xmlSecKWAes256

extern xmlSecTransformId 		xmlSecKWAes256;

The AES with 256 bits key wrap transform id.


xmlSecEncBase64Encode

extern xmlSecTransformId 		xmlSecEncBase64Encode;

The base64 encode transform id.


xmlSecEncBase64Decode

extern xmlSecTransformId 		xmlSecEncBase64Decode;

The base64 decode transform id.


xmlSecC14NInclusive

extern xmlSecTransformId 		xmlSecC14NInclusive;

The regular (inclusive) C14N without comments transform id.


xmlSecC14NInclusiveWithComments

extern xmlSecTransformId 		xmlSecC14NInclusiveWithComments;

The regular (inclusive) C14N with comments transform id.


xmlSecC14NExclusive

extern xmlSecTransformId 		xmlSecC14NExclusive;

The exclusive C14N without comments transform id.


xmlSecC14NExclusiveWithComments

extern xmlSecTransformId 		xmlSecC14NExclusiveWithComments;

The exclusive C14N with comments transform id.


xmlSecEncDes3Cbc

extern xmlSecTransformId 		xmlSecEncDes3Cbc;

The DES3-CBC encryption transform id.


xmlSecKWDes3Cbc

extern xmlSecTransformId 		xmlSecKWDes3Cbc;

The DES3-CBC key wrap transform id.


xmlSecSignDsaSha1

extern xmlSecTransformId 		xmlSecSignDsaSha1;

The DSA with SHA1 signature transform id.


xmlSecTransformEnveloped

extern xmlSecTransformId 		xmlSecTransformEnveloped;

The "enveloped" transform id.


xmlSecMacHmacSha1

extern xmlSecTransformId 		xmlSecMacHmacSha1;

The HMAC with SHA1 signature transform id.


xmlSecMacHmacRipeMd160

extern xmlSecTransformId 		xmlSecMacHmacRipeMd160;

The HMAC with RipeMD160 signature transform id.


xmlSecMacHmacMd5

extern xmlSecTransformId 		xmlSecMacHmacMd5;

The HMAC with MD5 signature transform id.


xmlSecDigestRipemd160

extern xmlSecTransformId 		xmlSecDigestRipemd160;

The RIPEMD160 digest transform id.


xmlSecSignRsaSha1

extern xmlSecTransformId 		xmlSecSignRsaSha1;

The RSA with SHA1 signature transform id.


xmlSecEncRsaPkcs1

extern xmlSecTransformId 		xmlSecEncRsaPkcs1;

The RSA-PKCS1 key transport transform id.


xmlSecEncRsaOaep

extern xmlSecTransformId 		xmlSecEncRsaOaep;

The RSA-OAEP key transport transform id.


xmlSecDigestSha1

extern xmlSecTransformId 		xmlSecDigestSha1;

The SHA1 digest transform id.


xmlSecTransformXPath

extern xmlSecTransformId 		xmlSecTransformXPath;

The XPath transform id.


xmlSecTransformXPath2

extern xmlSecTransformId 		xmlSecTransformXPath2;

The XPath2 transform id.


xmlSecTransformXPointer

extern xmlSecTransformId 		xmlSecTransformXPointer;

The XPointer transform id.


xmlSecTransformXslt

extern xmlSecTransformId 		xmlSecTransformXslt;

The XSLT transform id.


xmlSecC14NExclAddInclNamespaces ()

int         xmlSecC14NExclAddInclNamespaces (xmlNodePtr transformNode,
                                             const xmlChar *prefixList);

Adds "inclusive" namespaces to the ExcC14N transform node transformNode.

transformNode : the pointer to <dsig:Transform> node.
prefixList : the white space delimited list of namespace prefixes, where "default" indicates the default namespace
Returns :0 if success or a negative value otherwise.


xmlSecHmacAddOutputLength ()

int         xmlSecHmacAddOutputLength       (xmlNodePtr transformNode,
                                             size_t bitsLen);

Creates <dsig:HMACOutputLength>child for the HMAC transform node transformNode.

transformNode : the pointer to <dsig:Transform> node
bitsLen : the required length in bits
Returns :0 on success and a negatie value otherwise.


xmlSecEncRsaOaepAddParam ()

int         xmlSecEncRsaOaepAddParam        (xmlNodePtr transformNode,
                                             unsigned char *buf,
                                             size_t size);

Creates <enc:OAEPParam> child node in the transformNode.

transformNode : the pointer to <dsig:Transform> node.
buf : the OAEP param buffer.
size : the OAEP param buffer size.
Returns :0 on success or a negative value if an error occurs.


xmlSecTransformXPathAdd ()

int         xmlSecTransformXPathAdd         (xmlNodePtr transformNode,
                                             const xmlChar *expression,
                                             const xmlChar **namespaces);

Writes XPath transform infromation to the <dsig:Transform> node transformNode.

transformNode : the pointer to the <dsig:Transform> node.
expression : the XPath expression.
namespaces : NULL terminated list of namespace prefix/href pairs.
Returns :0 for success or a negative value otherwise.


enum xmlSecXPath2TransformType

typedef enum {
    xmlSecXPathTransformIntersect = 0,
    xmlSecXPathTransformSubtract,
    xmlSecXPathTransformUnion
} xmlSecXPath2TransformType;

The XPath2 transform types.

xmlSecXPathTransformIntersect intersect.
xmlSecXPathTransformSubtract subtract.
xmlSecXPathTransformUnion union.


xmlSecTransformXPath2Add ()

int         xmlSecTransformXPath2Add        (xmlNodePtr transformNode,
                                             xmlSecXPath2TransformType type,
                                             const xmlChar *expression,
                                             const xmlChar **namespaces);

Writes XPath2 transform infromation to the <dsig:Transform> node transformNode.

transformNode : the pointer to the <dsig:Transform> node.
type : XPath2 transform type ("union", "intersect" or "subtract").
expression : the XPath expression.
namespaces : NULL terminated list of namespace prefix/href pairs.
Returns :0 for success or a negative value otherwise.


xmlSecTransformXPointerAdd ()

int         xmlSecTransformXPointerAdd      (xmlNodePtr transformNode,
                                             const xmlChar *expression,
                                             const xmlChar **namespaces);

Writes XPoniter transform infromation to the <dsig:Transform> node transformNode.

transformNode : the pointer to the <dsig:Transform> node.
expression : the XPath expression.
namespaces : NULL terminated list of namespace prefix/href pairs.
Returns :0 for success or a negative value otherwise.


xmlSecTransformXsltAdd ()

int         xmlSecTransformXsltAdd          (xmlNodePtr transformNode,
                                             const xmlChar *xslt);

Writes the XSLT transform expression to the transformNode.

transformNode : the pointer to <dsig:Transform> node.
xslt : the XSLT transform exspression.
Returns :0 on success or a negative value otherwise.


xmlSecAesKey

extern xmlSecKeyId 	 		xmlSecAesKey;

The AES key id.


xmlSecDesKey

extern xmlSecKeyId 			xmlSecDesKey;

The DES key id.


xmlSecDsaKey

extern xmlSecKeyId 			xmlSecDsaKey;

The DSA signature key id.


xmlSecHmacKey

extern xmlSecKeyId 			xmlSecHmacKey;

The HMAC key id.


xmlSecRsaKey

extern xmlSecKeyId 			xmlSecRsaKey;

The RSA key id.


xmlSecAesKeyGenerate ()

int         xmlSecAesKeyGenerate            (xmlSecKeyPtr key,
                                             unsigned char *buf,
                                             size_t size);

Sets the AES key to the given data or generates a new random key.

key : the pointer to AES key.
buf : the pointer to AES key data or NULL if new key should be generated.
size : the AES key data size or 0 if new key should be generated.
Returns :0 for success or a negative value otherwise.


xmlSecDesKeyGenerate ()

int         xmlSecDesKeyGenerate            (xmlSecKeyPtr key,
                                             unsigned char *buf,
                                             size_t size);

Reads the DES key from the input buffer or generates a new one.

key : the pointer to DES key.
buf : the input key data (or NULL if new key should be generated).
size : the input biffer size.
Returns :0 on success or a negative value if an error occurs.


xmlSecDsaKeyGenerate ()

int         xmlSecDsaKeyGenerate            (xmlSecKeyPtr key,
                                             DSA *dsa);

Sets the DSA key to geven value or generates a new one if dsa is NULL.

key : the pointer to a DSA key.
dsa : the pointer to OpenSSL DSA key structure or NULL.
Returns :0 on success or a negative value if an error occurs.


xmlSecHmacKeyGenerate ()

int         xmlSecHmacKeyGenerate           (xmlSecKeyPtr key,
                                             unsigned char *buf,
                                             size_t size);

Sets the HMAC key key to data in buf or generates a new HMAC key if buf is NULL.

key : the pointer to HMAC key.
buf : the HMAC key binary data or NULL.
size : the binary data size.
Returns :0 on success or a negative value otherwise.


xmlSecRsaKeyGenerate ()

int         xmlSecRsaKeyGenerate            (xmlSecKeyPtr key,
                                             RSA *rsa);

Sets the key to the value of rsa or generates a new RSA key if rsa is NULL.

key : the pointer to RSA key.
rsa : the pointer to OpenSSL RSA key or NULL.
Returns :0 on success or a negative value otherwise.


XMLSEC_BASE64_LINESIZE

#define XMLSEC_BASE64_LINESIZE			64

The default max line size for base64 encoding


xmlSecBase64EncodeSetLineSize ()

void        xmlSecBase64EncodeSetLineSize   (xmlSecTransformPtr transform,
                                             size_t lineSize);

Sets the max line size to lineSize.

transform : the pointer to BASE64 encode transform.
lineSize : the new max line size.