- Home
- Download
- News
- Documentation

- FAQ
- Tutorial
- API reference
- Examples

- XML Digital Signature

- Online Verifier

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

# crypto

## Name

crypto -- Crypto transforms implementation for NSS.

## Synopsis

    xmlSecCryptoDLFunctionsPtrxmlSecCryptoGetFunctions_nss (void);
    voidxmlSecNssErrorsDefaultCallback      (const char *file,
                                                             int line,
                                                             const char *func,
                                                             const char *errorObject,
                                                             const char *errorSubject,
                                                             int reason,
                                                             const char *msg);
    intxmlSecNssGenerateRandom             (xmlSecBufferPtr buffer,
                                                             xmlSecSize size);
    PK11SlotInfo *      xmlSecNssGetInternalKeySlot         (void);
    intxmlSecNssHmacGetMinOutputLength     (void);
    voidxmlSecNssHmacSetMinOutputLength     (int min_length);
    intxmlSecNssInit                       (void);
    xmlSecKeyDataIdxmlSecNssKeyDataAesGetKlass         (void);
    #define             xmlSecNssKeyDataAesId
    intxmlSecNssKeyDataAesSet              (xmlSecKeyDataPtr data,
                                                             const xmlSecByte *buf,
                                                             xmlSecSize bufSize);
    xmlSecKeyDataIdxmlSecNssKeyDataDesGetKlass         (void);
    #define             xmlSecNssKeyDataDesId
    intxmlSecNssKeyDataDesSet              (xmlSecKeyDataPtr data,
                                                             const xmlSecByte *buf,
                                                             xmlSecSize bufSize);
    xmlSecKeyDataIdxmlSecNssKeyDataDsaGetKlass         (void);
    #define             xmlSecNssKeyDataDsaId
    xmlSecKeyDataIdxmlSecNssKeyDataHmacGetKlass        (void);
    #define             xmlSecNssKeyDataHmacId
    intxmlSecNssKeyDataHmacSet             (xmlSecKeyDataPtr data,
                                                             const xmlSecByte *buf,
                                                             xmlSecSize bufSize);
    xmlSecKeyDataIdxmlSecNssKeyDataRsaGetKlass         (void);
    #define             xmlSecNssKeyDataRsaId
    intxmlSecNssKeysMngrInit               (xmlSecKeysMngrPtr mngr);
    intxmlSecNssShutdown                   (void);
    xmlSecTransformIdxmlSecNssTransformAes128CbcGetKlass (void);
    #define             xmlSecNssTransformAes128CbcId
    xmlSecTransformIdxmlSecNssTransformAes192CbcGetKlass (void);
    #define             xmlSecNssTransformAes192CbcId
    xmlSecTransformIdxmlSecNssTransformAes256CbcGetKlass (void);
    #define             xmlSecNssTransformAes256CbcId
    xmlSecTransformIdxmlSecNssTransformDes3CbcGetKlass   (void);
    #define             xmlSecNssTransformDes3CbcId
    xmlSecTransformIdxmlSecNssTransformDsaSha1GetKlass   (void);
    #define             xmlSecNssTransformDsaSha1Id
    xmlSecTransformIdxmlSecNssTransformHmacMd5GetKlass   (void);
    #define             xmlSecNssTransformHmacMd5Id
    xmlSecTransformIdxmlSecNssTransformHmacRipemd160GetKlass
                                                            (void);
    #define             xmlSecNssTransformHmacRipemd160Id
    xmlSecTransformIdxmlSecNssTransformHmacSha1GetKlass  (void);
    #define             xmlSecNssTransformHmacSha1Id
    xmlSecTransformIdxmlSecNssTransformHmacSha256GetKlass
                                                            (void);
    #define             xmlSecNssTransformHmacSha256Id
    xmlSecTransformIdxmlSecNssTransformHmacSha384GetKlass
                                                            (void);
    #define             xmlSecNssTransformHmacSha384Id
    xmlSecTransformIdxmlSecNssTransformHmacSha512GetKlass
                                                            (void);
    #define             xmlSecNssTransformHmacSha512Id
    xmlSecTransformIdxmlSecNssTransformKWAes128GetKlass  (void);
    #define             xmlSecNssTransformKWAes128Id
    xmlSecTransformIdxmlSecNssTransformKWAes192GetKlass  (void);
    #define             xmlSecNssTransformKWAes192Id
    xmlSecTransformIdxmlSecNssTransformKWAes256GetKlass  (void);
    #define             xmlSecNssTransformKWAes256Id
    xmlSecTransformIdxmlSecNssTransformKWDes3GetKlass    (void);
    #define             xmlSecNssTransformKWDes3Id
    xmlSecTransformIdxmlSecNssTransformMd5GetKlass       (void);
    #define             xmlSecNssTransformMd5Id
    xmlSecTransformIdxmlSecNssTransformRsaMd5GetKlass    (void);
    #define             xmlSecNssTransformRsaMd5Id
    xmlSecTransformIdxmlSecNssTransformRsaOaepGetKlass   (void);
    #define             xmlSecNssTransformRsaOaepId
    xmlSecTransformIdxmlSecNssTransformRsaPkcs1GetKlass  (void);
    #define             xmlSecNssTransformRsaPkcs1Id
    xmlSecTransformIdxmlSecNssTransformRsaSha1GetKlass   (void);
    #define             xmlSecNssTransformRsaSha1Id
    xmlSecTransformIdxmlSecNssTransformRsaSha256GetKlass (void);
    #define             xmlSecNssTransformRsaSha256Id
    xmlSecTransformIdxmlSecNssTransformRsaSha384GetKlass (void);
    #define             xmlSecNssTransformRsaSha384Id
    xmlSecTransformIdxmlSecNssTransformRsaSha512GetKlass (void);
    #define             xmlSecNssTransformRsaSha512Id
    xmlSecTransformIdxmlSecNssTransformSha1GetKlass      (void);
    #define             xmlSecNssTransformSha1Id
    xmlSecTransformIdxmlSecNssTransformSha256GetKlass    (void);
    #define             xmlSecNssTransformSha256Id
    xmlSecTransformIdxmlSecNssTransformSha384GetKlass    (void);
    #define             xmlSecNssTransformSha384Id
    xmlSecTransformIdxmlSecNssTransformSha512GetKlass    (void);
    #define             xmlSecNssTransformSha512Id

## Description

Crypto transforms implementation for NSS.

## Details

### xmlSecCryptoGetFunctions_nss ()

    xmlSecCryptoDLFunctionsPtr xmlSecCryptoGetFunctions_nss (void);

Gets the pointer to xmlsec-nss functions table.

Returns : | the xmlsec-nss functions table or NULL if an error occurs.

### xmlSecNssErrorsDefaultCallback ()

    void                xmlSecNssErrorsDefaultCallback      (const char *file,
                                                             int line,
                                                             const char *func,
                                                             const char *errorObject,
                                                             const char *errorSubject,
                                                             int reason,
                                                             const char *msg);

The default errors reporting callback function.

`file` : | the error location file name (__FILE__ macro).
`line` : | the error location line number (__LINE__ macro).
`func` : | the error location function name (__FUNCTION__ macro).
`errorObject` : | the error specific error object
`errorSubject` : | the error specific error subject.
`reason` : | the error code.
`msg` : | the additional error message.

### xmlSecNssGenerateRandom ()

    int                 xmlSecNssGenerateRandom             (xmlSecBufferPtr buffer,
                                                             xmlSecSize size);

Generates `size` random bytes and puts result in `buffer`.

`buffer` : | the destination buffer.
`size` : | the numer of bytes to generate.
Returns : | 0 on success or a negative value otherwise.

### xmlSecNssGetInternalKeySlot ()

    PK11SlotInfo *      xmlSecNssGetInternalKeySlot         (void);

Gets internal NSS key slot.

Returns : | internal key slot and initializes it if needed.

### xmlSecNssHmacGetMinOutputLength ()

    int                 xmlSecNssHmacGetMinOutputLength     (void);

Gets the value of min HMAC length.

Returns : | the min HMAC output length

### xmlSecNssHmacSetMinOutputLength ()

    void                xmlSecNssHmacSetMinOutputLength     (int min_length);

Sets the min HMAC output length

`min_length` : | the new min length

### xmlSecNssInit ()

    int                 xmlSecNssInit                       (void);

XMLSec library specific crypto engine initialization.

Returns : | 0 on success or a negative value otherwise.

### xmlSecNssKeyDataAesGetKlass ()

    xmlSecKeyDataId     xmlSecNssKeyDataAesGetKlass         (void);

The AES key data klass.

Returns : | AES key data klass.

### xmlSecNssKeyDataAesId

    #define             xmlSecNssKeyDataAesId

The AES key data klass.

### xmlSecNssKeyDataAesSet ()

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

Sets the value of AES key data.

`data` : | the pointer to AES key data.
`buf` : | the pointer to key value.
`bufSize` : | the key value size (in bytes).
Returns : | 0 on success or a negative value if an error occurs.

### xmlSecNssKeyDataDesGetKlass ()

    xmlSecKeyDataId     xmlSecNssKeyDataDesGetKlass         (void);

The DES key data klass.

Returns : | DES key data klass.

### xmlSecNssKeyDataDesId

    #define             xmlSecNssKeyDataDesId

The DES key data klass.

### xmlSecNssKeyDataDesSet ()

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

Sets the value of DES key data.

`data` : | the pointer to DES key data.
`buf` : | the pointer to key value.
`bufSize` : | the key value size (in bytes).
Returns : | 0 on success or a negative value if an error occurs.

### xmlSecNssKeyDataDsaGetKlass ()

    xmlSecKeyDataId     xmlSecNssKeyDataDsaGetKlass         (void);

The DSA key data klass.

Returns : | pointer to DSA key data klass.

### xmlSecNssKeyDataDsaId

    #define             xmlSecNssKeyDataDsaId

The DSA key klass.

### xmlSecNssKeyDataHmacGetKlass ()

    xmlSecKeyDataId     xmlSecNssKeyDataHmacGetKlass        (void);

The HMAC key data klass.

Returns : | HMAC key data klass.

### xmlSecNssKeyDataHmacId

    #define             xmlSecNssKeyDataHmacId

The DHMAC key data klass.

### xmlSecNssKeyDataHmacSet ()

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

Sets the value of HMAC key data.

`data` : | the pointer to HMAC key data.
`buf` : | the pointer to key value.
`bufSize` : | the key value size (in bytes).
Returns : | 0 on success or a negative value if an error occurs.

### xmlSecNssKeyDataRsaGetKlass ()

    xmlSecKeyDataId     xmlSecNssKeyDataRsaGetKlass         (void);

The RSA key data klass.

Returns : | pointer to RSA key data klass.

### xmlSecNssKeyDataRsaId

    #define             xmlSecNssKeyDataRsaId

The RSA key klass.

### xmlSecNssKeysMngrInit ()

    int                 xmlSecNssKeysMngrInit               (xmlSecKeysMngrPtr mngr);

Adds NSS specific key data stores in keys manager.

`mngr` : | the pointer to keys manager.
Returns : | 0 on success or a negative value otherwise.

### xmlSecNssShutdown ()

    int                 xmlSecNssShutdown                   (void);

XMLSec library specific crypto engine shutdown.

Returns : | 0 on success or a negative value otherwise.

### xmlSecNssTransformAes128CbcGetKlass ()

    xmlSecTransformId   xmlSecNssTransformAes128CbcGetKlass (void);

AES 128 CBC encryption transform klass.

Returns : | pointer to AES 128 CBC encryption transform.

### xmlSecNssTransformAes128CbcId

    #define             xmlSecNssTransformAes128CbcId

The AES128 CBC cipher transform klass.

### xmlSecNssTransformAes192CbcGetKlass ()

    xmlSecTransformId   xmlSecNssTransformAes192CbcGetKlass (void);

AES 192 CBC encryption transform klass.

Returns : | pointer to AES 192 CBC encryption transform.

### xmlSecNssTransformAes192CbcId

    #define             xmlSecNssTransformAes192CbcId

The AES192 CBC cipher transform klass.

### xmlSecNssTransformAes256CbcGetKlass ()

    xmlSecTransformId   xmlSecNssTransformAes256CbcGetKlass (void);

AES 256 CBC encryption transform klass.

Returns : | pointer to AES 256 CBC encryption transform.

### xmlSecNssTransformAes256CbcId

    #define             xmlSecNssTransformAes256CbcId

The AES256 CBC cipher transform klass.

### xmlSecNssTransformDes3CbcGetKlass ()

    xmlSecTransformId   xmlSecNssTransformDes3CbcGetKlass   (void);

Triple DES CBC encryption transform klass.

Returns : | pointer to Triple DES encryption transform.

### xmlSecNssTransformDes3CbcId

    #define             xmlSecNssTransformDes3CbcId

The Triple DES CBC cipher transform klass.

### xmlSecNssTransformDsaSha1GetKlass ()

    xmlSecTransformId   xmlSecNssTransformDsaSha1GetKlass   (void);

The DSA-SHA1 signature transform klass.

Returns : | DSA-SHA1 signature transform klass.

### xmlSecNssTransformDsaSha1Id

    #define             xmlSecNssTransformDsaSha1Id

The DSA SHA1 signature transform klass.

### xmlSecNssTransformHmacMd5GetKlass ()

    xmlSecTransformId   xmlSecNssTransformHmacMd5GetKlass   (void);

The HMAC-MD5 transform klass.

Returns : | the HMAC-MD5 transform klass.

### xmlSecNssTransformHmacMd5Id

    #define             xmlSecNssTransformHmacMd5Id

The HMAC with MD5 signature transform klass.

### xmlSecNssTransformHmacRipemd160GetKlass ()

    xmlSecTransformId   xmlSecNssTransformHmacRipemd160GetKlass
                                                            (void);

The HMAC-RIPEMD160 transform klass.

Returns : | the HMAC-RIPEMD160 transform klass.

### xmlSecNssTransformHmacRipemd160Id

    #define             xmlSecNssTransformHmacRipemd160Id

The HMAC with RipeMD160 signature transform klass.

### xmlSecNssTransformHmacSha1GetKlass ()

    xmlSecTransformId   xmlSecNssTransformHmacSha1GetKlass  (void);

The HMAC-SHA1 transform klass.

Returns : | the HMAC-SHA1 transform klass.

### xmlSecNssTransformHmacSha1Id

    #define             xmlSecNssTransformHmacSha1Id

The HMAC with SHA1 signature transform klass.

### xmlSecNssTransformHmacSha256GetKlass ()

    xmlSecTransformId   xmlSecNssTransformHmacSha256GetKlass
                                                            (void);

The HMAC-SHA256 transform klass.

Returns : | the HMAC-SHA256 transform klass.

### xmlSecNssTransformHmacSha256Id

    #define             xmlSecNssTransformHmacSha256Id

The HMAC with SHA256 signature transform klass.

### xmlSecNssTransformHmacSha384GetKlass ()

    xmlSecTransformId   xmlSecNssTransformHmacSha384GetKlass
                                                            (void);

The HMAC-SHA384 transform klass.

Returns : | the HMAC-SHA384 transform klass.

### xmlSecNssTransformHmacSha384Id

    #define             xmlSecNssTransformHmacSha384Id

The HMAC with SHA384 signature transform klass.

### xmlSecNssTransformHmacSha512GetKlass ()

    xmlSecTransformId   xmlSecNssTransformHmacSha512GetKlass
                                                            (void);

The HMAC-SHA512 transform klass.

Returns : | the HMAC-SHA512 transform klass.

### xmlSecNssTransformHmacSha512Id

    #define             xmlSecNssTransformHmacSha512Id

The HMAC with SHA512 signature transform klass.

### xmlSecNssTransformKWAes128GetKlass ()

    xmlSecTransformId   xmlSecNssTransformKWAes128GetKlass  (void);

The AES-128 key wrapper transform klass.

Returns : | AES-128 key wrapper transform klass.

### xmlSecNssTransformKWAes128Id

    #define             xmlSecNssTransformKWAes128Id

The AES 128 key wrap transform klass.

### xmlSecNssTransformKWAes192GetKlass ()

    xmlSecTransformId   xmlSecNssTransformKWAes192GetKlass  (void);

The AES-192 key wrapper transform klass.

Returns : | AES-192 key wrapper transform klass.

### xmlSecNssTransformKWAes192Id

    #define             xmlSecNssTransformKWAes192Id

The AES 192 key wrap transform klass.

### xmlSecNssTransformKWAes256GetKlass ()

    xmlSecTransformId   xmlSecNssTransformKWAes256GetKlass  (void);

The AES-256 key wrapper transform klass.

Returns : | AES-256 key wrapper transform klass.

### xmlSecNssTransformKWAes256Id

    #define             xmlSecNssTransformKWAes256Id

The AES 256 key wrap transform klass.

### xmlSecNssTransformKWDes3GetKlass ()

    xmlSecTransformId   xmlSecNssTransformKWDes3GetKlass    (void);

The Triple DES key wrapper transform klass.

Returns : | Triple DES key wrapper transform klass.

### xmlSecNssTransformKWDes3Id

    #define             xmlSecNssTransformKWDes3Id

The DES3 KW transform klass.

### xmlSecNssTransformMd5GetKlass ()

    xmlSecTransformId   xmlSecNssTransformMd5GetKlass       (void);

MD5 digest transform klass.

Returns : | pointer to MD5 digest transform klass.

### xmlSecNssTransformMd5Id

    #define             xmlSecNssTransformMd5Id

The MD5 digest transform klass.

### xmlSecNssTransformRsaMd5GetKlass ()

    xmlSecTransformId   xmlSecNssTransformRsaMd5GetKlass    (void);

The RSA-MD5 signature transform klass.

Returns : | RSA-MD5 signature transform klass.

### xmlSecNssTransformRsaMd5Id

    #define             xmlSecNssTransformRsaMd5Id

The RSA-MD5 signature transform klass.

### xmlSecNssTransformRsaOaepGetKlass ()

    xmlSecTransformId   xmlSecNssTransformRsaOaepGetKlass   (void);

The RSA-PKCS1 key transport transform klass.

Returns : | RSA-PKCS1 key transport transform klass.

### xmlSecNssTransformRsaOaepId

    #define             xmlSecNssTransformRsaOaepId

The RSA OAEP key transport transform klass.

### xmlSecNssTransformRsaPkcs1GetKlass ()

    xmlSecTransformId   xmlSecNssTransformRsaPkcs1GetKlass  (void);

The RSA-PKCS1 key transport transform klass.

Returns : | RSA-PKCS1 key transport transform klass.

### xmlSecNssTransformRsaPkcs1Id

    #define             xmlSecNssTransformRsaPkcs1Id

The RSA PKCS1 key transport transform klass.

### xmlSecNssTransformRsaSha1GetKlass ()

    xmlSecTransformId   xmlSecNssTransformRsaSha1GetKlass   (void);

The RSA-SHA1 signature transform klass.

Returns : | RSA-SHA1 signature transform klass.

### xmlSecNssTransformRsaSha1Id

    #define             xmlSecNssTransformRsaSha1Id

The RSA-SHA1 signature transform klass.

### xmlSecNssTransformRsaSha256GetKlass ()

    xmlSecTransformId   xmlSecNssTransformRsaSha256GetKlass (void);

The RSA-SHA256 signature transform klass.

Returns : | RSA-SHA256 signature transform klass.

### xmlSecNssTransformRsaSha256Id

    #define             xmlSecNssTransformRsaSha256Id

The RSA-SHA256 signature transform klass.

### xmlSecNssTransformRsaSha384GetKlass ()

    xmlSecTransformId   xmlSecNssTransformRsaSha384GetKlass (void);

The RSA-SHA384 signature transform klass.

Returns : | RSA-SHA384 signature transform klass.

### xmlSecNssTransformRsaSha384Id

    #define             xmlSecNssTransformRsaSha384Id

The RSA-SHA384 signature transform klass.

### xmlSecNssTransformRsaSha512GetKlass ()

    xmlSecTransformId   xmlSecNssTransformRsaSha512GetKlass (void);

The RSA-SHA512 signature transform klass.

Returns : | RSA-SHA512 signature transform klass.

### xmlSecNssTransformRsaSha512Id

    #define             xmlSecNssTransformRsaSha512Id

The RSA-SHA512 signature transform klass.

### xmlSecNssTransformSha1GetKlass ()

    xmlSecTransformId   xmlSecNssTransformSha1GetKlass      (void);

SHA-1 digest transform klass.

Returns : | pointer to SHA-1 digest transform klass.

### xmlSecNssTransformSha1Id

    #define             xmlSecNssTransformSha1Id

The SHA1 digest transform klass.

### xmlSecNssTransformSha256GetKlass ()

    xmlSecTransformId   xmlSecNssTransformSha256GetKlass    (void);

SHA256 digest transform klass.

Returns : | pointer to SHA256 digest transform klass.

### xmlSecNssTransformSha256Id

    #define             xmlSecNssTransformSha256Id

The SHA256 digest transform klass.

### xmlSecNssTransformSha384GetKlass ()

    xmlSecTransformId   xmlSecNssTransformSha384GetKlass    (void);

SHA384 digest transform klass.

Returns : | pointer to SHA384 digest transform klass.

### xmlSecNssTransformSha384Id

    #define             xmlSecNssTransformSha384Id

The SHA384 digest transform klass.

### xmlSecNssTransformSha512GetKlass ()

    xmlSecTransformId   xmlSecNssTransformSha512GetKlass    (void);

SHA512 digest transform klass.

Returns : | pointer to SHA512 digest transform klass.

### xmlSecNssTransformSha512Id

    #define             xmlSecNssTransformSha512Id

The SHA512 digest transform klass.