#include <xmltooling/encryption/Encrypter.h>
Public Member Functions | |
EncryptedData * | encryptElement (xercesc::DOMElement *element, EncryptionParams &encParams, KeyEncryptionParams *kencParams=0) |
Encrypts the supplied element and returns the resulting object. | |
EncryptedData * | encryptElementContent (xercesc::DOMElement *element, EncryptionParams &encParams, KeyEncryptionParams *kencParams=0) |
Encrypts the supplied element's children and returns the resulting object. | |
EncryptedData * | encryptStream (std::istream &input, EncryptionParams &encParams, KeyEncryptionParams *kencParams=0) |
Encrypts the supplied input stream and returns the resulting object. | |
EncryptedKey * | encryptKey (const unsigned char *keyBuffer, unsigned int keyBufferSize, KeyEncryptionParams &kencParams, bool compact=false) |
Encrypts the supplied key and returns the resulting object. | |
Static Public Member Functions | |
static const XMLCh * | getKeyTransportAlgorithm (const xmltooling::Credential &credential, const XMLCh *encryptionAlg) |
Maps a data encryption algorithm to an appropriate key transport algorithm to use. | |
Classes | |
struct | EncryptionParams |
Structure to collect encryption requirements. More... | |
struct | KeyEncryptionParams |
Structure to collect key wrapping/transport requirements. More... |
Designed to allow both external and internal key generation as follows:
If no keying material is supplied, then the algorithm MAY be recognized and a key can be generated internally. This is only done if a KeyEncryptionParams structure is also supplied to the operation (otherwise the key would be lost).
If an XSECCryptoKey is supplied, then it is used directly, but if KeyEncryptionParams are supplied, an exception will result unless the raw key buffer is also supplied.
If a raw key is provided, then a key object can also be created internally if the algorithm is recognized.
Summing up, if KeyEncryptionParams are used, a raw key must be available or the key can be generated when the encryption algorithm itself is a standard one. If no KeyEncryptionParams are supplied, then the key must be supplied either in raw or object form.
Finally, when encrypting data, the key transport algorithm can be left blank to derive it from the data encryption algorithm.
|
Encrypts the supplied element and returns the resulting object. If an encryption algorithm is set, but no key, a random key will be generated iff kencParams is non-NULL and the algorithm is known. If key encryption parameters are supplied, then the encryption key is wrapped and the result placed into an EncryptedKey object in the KeyInfo of the returned EncryptedData.
|
|
Encrypts the supplied element's children and returns the resulting object. If an encryption algorithm is set, but no key, a random key will be generated iff kencParams is non-NULL and the algorithm is known. If key encryption parameters are supplied, then the encryption key is wrapped and the result placed into an EncryptedKey object in the KeyInfo of the returned EncryptedData.
|
|
Encrypts the supplied key and returns the resulting object.
|
|
Encrypts the supplied input stream and returns the resulting object. If an encryption algorithm is set, but no key, a random key will be generated iff kencParams is non-NULL and the algorithm is known. If key encryption parameters are supplied, then the encryption key is wrapped and the result placed into an EncryptedKey object in the KeyInfo of the returned EncryptedData.
|
|
Maps a data encryption algorithm to an appropriate key transport algorithm to use.
|