#include <XENCCipher.hpp>
The XENCCipher class not something that is directly defined in the XML Encryption standard. It is a control class used by the library to generate encrypted XML information and to decrypt information held in XML Encryption structures.
All encryption and decryption work performed by the library is handled within this class. The other XENC classes simply handle marshalling and unmarshalling of the DOM data.
Public Member Functions | |
Constructors and Destructors | |
virtual | ~XENCCipher () |
Decryption Functions | |
virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * | decryptElement (XERCES_CPP_NAMESPACE_QUALIFIER DOMElement *element)=0 |
Decrypt the nominated element. | |
virtual XSECBinTXFMInputStream * | decryptToBinInputStream (XERCES_CPP_NAMESPACE_QUALIFIER DOMElement *element)=0 |
Decrypt the nominated element and put the output to an InputStream. | |
virtual int | decryptKey (XENCEncryptedKey *encryptedKey, XMLByte *rawKey, int maxKeySize)=0 |
Decrypt a key. | |
virtual int | decryptKey (XERCES_CPP_NAMESPACE_QUALIFIER DOMElement *keyNode, XMLByte *rawKey, int maxKeySize)=0 |
Decrypt a key directly from DOM. | |
Encryption Functions | |
virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * | encryptElement (XERCES_CPP_NAMESPACE_QUALIFIER DOMElement *element, encryptionMethod em, const XMLCh *algorithmURI=NULL)=0 |
Encrypt the nominated element. | |
virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * | encryptElementContent (XERCES_CPP_NAMESPACE_QUALIFIER DOMElement *element, encryptionMethod em, const XMLCh *algorithmURI=NULL)=0 |
Encrypt the children of the nominated element. | |
virtual XENCEncryptedKey * | encryptKey (const unsigned char *keyBuffer, unsigned int keyLen, encryptionMethod em, const XMLCh *algorithmURI=NULL)=0 |
Encrypt a buffer of data as a key. | |
virtual XENCEncryptedData * | encryptBinInputStream (XERCES_CPP_NAMESPACE_QUALIFIER BinInputStream *plainText, encryptionMethod em, const XMLCh *algorithmURI=NULL)=0 |
Encrypt an input stream to a CipherValue. | |
virtual XENCEncryptedData * | encryptTXFMChain (TXFMChain *plainText, encryptionMethod em, const XMLCh *algorithmURI=NULL)=0 |
Encrypt a TXFMChain to a CipherValue. | |
Getter Functions | |
virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * | getDocument (void)=0 |
Get owning document. | |
virtual const XMLCh * | getXENCNSPrefix (void) const =0 |
Get namespace prefix for XENC nodes. | |
virtual XENCEncryptedData * | getEncryptedData (void)=0 |
Get the EncryptedData element. | |
virtual bool | getPrettyPrint (void)=0 |
Tell caller whether PrettyPrinting is active. | |
Setter Functions | |
virtual void | setKey (XSECCryptoKey *key)=0 |
Set decryption key for next operation. | |
virtual void | setKEK (XSECCryptoKey *key)=0 |
Set Key Encryption Key for next operation. | |
virtual void | setKeyInfoResolver (const XSECKeyInfoResolver *resolver)=0 |
Register a KeyInfoResolver. | |
virtual void | setXENCNSPrefix (const XMLCh *prefix)=0 |
Set prefix for XENC nodes. | |
virtual void | setPrettyPrint (bool flag)=0 |
Set Pretty Print. | |
Creation and loading Functions | |
virtual XENCEncryptedData * | createEncryptedData (XENCCipherData::XENCCipherDataType type, const XMLCh *algorithm, const XMLCh *value)=0 |
Create a new EncryptedData element. | |
virtual XENCEncryptedKey * | loadEncryptedKey (XERCES_CPP_NAMESPACE_QUALIFIER DOMElement *keyNode)=0 |
Load an EncryptedKey element. |
|
|
|
Create a new EncryptedData element. Method for creating a basic Encrypted Data element. Can be used in cases where an application needs to build this from scratch. In general, applications should use the higher level methods such as encryptElement or encryptElementContent.
|
|
Decrypt the nominated element. Decrypts the passed in element, which must be the root node of a <EncryptedData> method with a type of "#Element". If not, the library will throw an XSECException exception. This is an "all in one method". The library will replace the passed in Element (i.e. the encrypted XML data) with the resultant plain text, after it has been parsed back into DOM nodes
|
|
Decrypt a key directly from DOM. Loads an EncryptedKey from DOM and then decrypts the key. If a NULL buffer is passed in, will simply load the key and return
|
|
Decrypt a key. Reads in the passed in KeyInfo structure for an EncryptedKey and decrypts the key to a buffer.
|
|
Decrypt the nominated element and put the output to an InputStream. Decrypts the passed in element, which must be the root node of a <EncryptedData> method. This call does not change the source DOM in any way. It simply processes the encrypted data and provides an InputStream that the caller can read from to read the plain text data.
|
|
Encrypt an input stream to a CipherValue. Encrypts the data passed in via a Xerces BinInputStream and places it directly into a new EncryptedData element that contains a CipherValue
|
|
Encrypt the nominated element. Encrypts the passed in element and all children. The element is replaced with an EncryptedData element
|
|
Encrypt the children of the nominated element. Encrypts the all children of the passed in element, but leaves the element itself in place, with one new child - an EncryptedData node of type #content
|
|
Encrypt a buffer of data as a key. Encrypts the passed in data and creates an EncryptedKey element
|
|
Encrypt a TXFMChain to a CipherValue. Encrypts the data passed in via a TXFMChain and places it directly into a new EncryptedData element that contains a CipherValue.
|
|
Get owning document. Every Cipher object is associated with an owning document (for generation of nodes etc.) This allows callers to retrieve this value.
|
|
Get the EncryptedData element. Allows the user to get the EncryptedData element that was last processed/ created by this XENCCipher object.
|
|
Tell caller whether PrettyPrinting is active.
|
|
Get namespace prefix for XENC nodes. Find the string being used by the library to prefix nodes in the xenc: namespace.
|
|
Load an EncryptedKey element. Take a passed in EncryptedKey DOMNode and return a loaded XENCEncryptedKey object based on the DOMNode from the passed in element.
|
|
Set Key Encryption Key for next operation. Set the passed in key for the next key decryption/encryption operation.
|
|
Set decryption key for next operation. Set the passed in key for the next decryption/encryption operation.
|
|
Register a KeyInfoResolver. Registers a KeyInfoResolver to be used by the cipher when it needs to find a key to be used to decrypt some ciper text
|
|
Set Pretty Print. The pretty print functions controls whether the library will output CR/LF after the elements it adds to a document By default the library will do pretty printing (flag is true)
|
|
Set prefix for XENC nodes. Set the namespace prefix the library will use when creating nodes in the XENC namespace |