- Home
- Download
- News
- Documentation

- FAQ
- Tutorial
- API reference
- Examples

- XML Digital Signature

- Online Verifier

- XML Encryption
- XML Canonicalization
- Reporting Bugs
- Mailing list
- Related
- Authors

# bignum

## Name

bignum -- Big numbers helper functions.

## Synopsis

    SECItem*            xmlSecNssNodeGetBigNumValue         (PRArenaPool *arena,
                                                             const xmlNodePtr cur,
                                                             SECItem *a);
    intxmlSecNssNodeSetBigNumValue         (xmlNodePtr cur,
                                                             const SECItem *a,
                                                             int addLineBreaks);

## Description

Big numbers helper functions.

## Details

### xmlSecNssNodeGetBigNumValue ()

    SECItem*            xmlSecNssNodeGetBigNumValue         (PRArenaPool *arena,
                                                             const xmlNodePtr cur,
                                                             SECItem *a);

Converts the node content from CryptoBinary format (http://www.w3.org/TR/xmldsig-core/sec-CryptoBinary) to a SECItem. If no SECItem object provided then a new one is created (caller is responsible for freeing it).

`arena` : | the arena from which to allocate memory
`cur` : | the poitner to an XML node.
`a` : | a SECItem object to hold the BigNum value
Returns : | a pointer to SECItem produced from CryptoBinary string or NULL if an error occurs.

### xmlSecNssNodeSetBigNumValue ()

    int                 xmlSecNssNodeSetBigNumValue         (xmlNodePtr cur,
                                                             const SECItem *a,
                                                             int addLineBreaks);

Converts SECItem to CryptoBinary string (http://www.w3.org/TR/xmldsig-core/sec-CryptoBinary) and sets it as the content of the given node. If the addLineBreaks is set then line breaks are added before and after the CryptoBinary string.

`cur` : | the pointer to an XML node.
`a` : | a SECItem containing the BigNum value.
`addLineBreaks` : | if the flag is equal to 1 then linebreaks will be added before and after new buffer content.
Returns : | 0 on success or -1 otherwise.