#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 XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * | decryptElementDetached (XERCES_CPP_NAMESPACE_QUALIFIER DOMElement *element)=0 |
Decrypt the nominated element without replacing it. | |
virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * | decryptElement (void)=0 |
Decrypt currently loaded element. | |
virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * | decryptElementDetached (void)=0 |
Decrypt currently loaded element without replacing it. | |
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 DOMNode * | encryptElementDetached (XERCES_CPP_NAMESPACE_QUALIFIER DOMElement *element, encryptionMethod em, const XMLCh *algorithmURI=NULL)=0 |
Encrypt the nominated element without affecting the current document. | |
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 XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * | encryptElementContentDetached (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. | |
virtual bool | getExclusiveC14nSerialisation (void)=0 |
Tell caller whether the serialisation routines will use exclusive or normal canonicalisation. | |
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. | |
virtual void | setExclusiveC14nSerialisation (bool flag)=0 |
Set whether the serialisation routines will use exclusive or normal canonicalisation. | |
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. | |
virtual XENCEncryptedData * | loadEncryptedData (XERCES_CPP_NAMESPACE_QUALIFIER DOMElement *dataNode)=0 |
Load an EncryptedData 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 currently loaded element. Decrypts the an element that was previously passed in via loadEncryptedData 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 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 currently loaded element without replacing it. Decrypts the an element that was previously passed in via loadEncryptedData with a type of "#Element". If not, the library will throw an XSECException exception. This does not replace the currently existing DOM document. It returns an "orphaned" document fragment containing the serialised version of the decrypted data.
|
|
Decrypt the nominated element without replacing it. 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. Rather than replacing the element with the decrypted content, the result is passed to the caller as an orphaned document fragment.
|
|
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 the children of the nominated element. Encrypts the all children of the passed in element. The input DOM node set is untouched, but the function returns an orphaned sub-tree owned by the passed in document containing the encrypted data.
|
|
Encrypt the nominated element without affecting the current document. Encrypts the passed in element and all children. The element is not replaced - the return node is an "orphaned" subtree from the passed in document and the original document is untouched.
|
|
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 the serialisation routines will use exclusive or normal canonicalisation. When serialising an element prior to encryption, the c14n canonicalisation routines are used. By default, exclusive c14n is used, however this can be turned off using the setExclusiveC14nSerialisation call. This function returns the current state of the associated flag.
|
|
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 EncryptedData element. Take a passed in EncryptedData DOMNode and return a loaded XENCEncryptedData object based on the DOMNode from the passed in element.
|
|
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 whether the serialisation routines will use exclusive or normal canonicalisation. When serialising an element prior to encryption, the c14n canonicalisation routines are used. By default, exclusive c14n is used, however this can be turned off using the setExclusiveC14nSerialisation call.
|
|
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 |