Main Page | Modules | Class Hierarchy | Class List | Directories | File List | Class Members | File Members | Related Pages

XENCEncryptedType Class Reference
[XML Encryption Implementation]

#include <XENCEncryptedType.hpp>

Inheritance diagram for XENCEncryptedType:

Inheritance graph
[legend]
List of all members.

Detailed Description

Interface definition for the EncryptedType object.

The <EncryptedType> element is an abstract type on which EncryptedData and EncryptedKey objects are built.

This is the base class on which most of the XML Encryption standard is built. Using classes derived from this, calling programs can decrypt the content, determine KeyInfo references etc.

In general derived objects should not be used directly. The XENCCipher class should be used to operate on them.

The schema definition for EncryptedType is as follows :

  <complexType name='EncryptedType' abstract='true'>
    <sequence>
      <element name='EncryptionMethod' type='xenc:EncryptionMethodType' 
               minOccurs='0'/>
      <element ref='ds:KeyInfo' minOccurs='0'/>
      <element ref='xenc:CipherData'/>
      <element ref='xenc:EncryptionProperties' minOccurs='0'/>
    </sequence>
    <attribute name='Id' type='ID' use='optional'/>
    <attribute name='Type' type='anyURI' use='optional'/>
    <attribute name='MimeType' type='string' use='optional'/>
    <attribute name='Encoding' type='anyURI' use='optional'/> 
   </complexType>
  


Constructors and Destructors

virtual ~XENCEncryptedType ()
 XENCEncryptedType ()

Public Member Functions

Basic Interface Methods
virtual XENCCipherDatagetCipherData (void) const =0
 Retrieve the CipherData element.
virtual XENCEncryptionMethodgetEncryptionMethod (void) const =0
 Retrieve the EncryptionMethod element.
virtual XERCES_CPP_NAMESPACE_QUALIFIER
DOMElement * 
getElement (void) const =0
 Get the DOM Element Node of this structure.
Getter interface Methods
virtual const XMLCh * getType (void) const =0
 Get the Type URI for the EncryptedType.
virtual const XMLCh * getMimeType (void) const =0
 Get the MimeType of the EncryptedType.
virtual const XMLCh * getEncoding (void) const =0
 Get the Encoding of the EncryptedType.
Setter interface methods
virtual void setType (const XMLCh *uri)=0
 Set the Type URI for the EncryptedType.
virtual void setMimeType (const XMLCh *mimeType)=0
 Set the MimeType of the EncryptedType.
virtual void setEncoding (const XMLCh *uri)=0
 Set the Encoding of the EncryptedType.
KeyInfo Element Manipulation
virtual DSIGKeyInfoListgetKeyInfoList (void)=0
 Get the list of <KeyInfo> elements.
virtual void clearKeyInfo (void)=0
 Clear out all KeyInfo elements in the signature.
virtual DSIGKeyInfoValueappendDSAKeyValue (const XMLCh *P, const XMLCh *Q, const XMLCh *G, const XMLCh *Y)=0
 Append a DSA KeyValue element.
virtual DSIGKeyInfoValueappendRSAKeyValue (const XMLCh *modulus, const XMLCh *exponent)=0
 Append a RSA KeyValue element.
virtual DSIGKeyInfoX509appendX509Data (void)=0
 Append a X509Data element.
virtual DSIGKeyInfoNameappendKeyName (const XMLCh *name, bool isDName=false)=0
 Append a KeyName element.
virtual void appendEncryptedKey (XENCEncryptedKey *encryptedKey)=0
 Append an already created EncryptedKey.


Constructor & Destructor Documentation

XENCEncryptedType::XENCEncryptedType  )  [inline, protected]
 

virtual XENCEncryptedType::~XENCEncryptedType  )  [inline, virtual]
 


Member Function Documentation

virtual DSIGKeyInfoValue* XENCEncryptedType::appendDSAKeyValue const XMLCh *  P,
const XMLCh *  Q,
const XMLCh *  G,
const XMLCh *  Y
[pure virtual]
 

Append a DSA KeyValue element.

Add a new KeyInfo element for a DSA Value

Parameters:
P Base64 encoded value of P
Q Base64 encoded value of Q
G Base64 encoded value of G
Y Base64 encoded value of Y
Returns:
A pointer to the created object.

virtual void XENCEncryptedType::appendEncryptedKey XENCEncryptedKey encryptedKey  )  [pure virtual]
 

Append an already created EncryptedKey.

Add an already created EncryptedKey.

Note:
The encryptedKey becomes the property of the owning EncryptedType object and will be deleted upon its destruction.
Parameters:
encryptedKey A pointer to the encrypted Key

virtual DSIGKeyInfoName* XENCEncryptedType::appendKeyName const XMLCh *  name,
bool  isDName = false
[pure virtual]
 

Append a KeyName element.

Add a new KeyInfo element for a key name.

Parameters:
name The name of the key to set in the XML
isDName Treat the name as a Distinguished name and encode accordingly
Returns:
A pointer to the created object

virtual DSIGKeyInfoValue* XENCEncryptedType::appendRSAKeyValue const XMLCh *  modulus,
const XMLCh *  exponent
[pure virtual]
 

Append a RSA KeyValue element.

Add a new KeyInfo element for a RSA Value

Parameters:
modulus Base64 encoded value of the modulus
exponent Base64 encoded value of exponent
Returns:
A pointer to the created object.

virtual DSIGKeyInfoX509* XENCEncryptedType::appendX509Data void   )  [pure virtual]
 

Append a X509Data element.

Add a new KeyInfo element for X509 data.

Note:
The added element is empty. The caller must make use of the returned object to set the required values.
Returns:
A pointer to the created object.

virtual void XENCEncryptedType::clearKeyInfo void   )  [pure virtual]
 

Clear out all KeyInfo elements in the signature.

This function will delete all KeyInfo elements from both the EncryptedType object and the associated DOM.

virtual XENCCipherData* XENCEncryptedType::getCipherData void   )  const [pure virtual]
 

Retrieve the CipherData element.

CipherData elements are the sub part of the EncryptedData that hold the actual enciphered information.

Returns:
The CipherData object

virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMElement* XENCEncryptedType::getElement void   )  const [pure virtual]
 

Get the DOM Element Node of this structure.

Returns:
the DOM Element Node representing the <EncryptionType> element

virtual const XMLCh* XENCEncryptedType::getEncoding void   )  const [pure virtual]
 

Get the Encoding of the EncryptedType.

If this object is an EncryptedData, it may have an encoding attribute that describes how the data has been encoded prior to encryption. (E.g. http://www.w3.org/2000/09/xmldsig#base64)

The XML-Security-C library makes no use of this attribute, but it provides these functions to allow applications to set and get.

Returns:
A string (owned by the library) providing the encoding URI

virtual XENCEncryptionMethod* XENCEncryptedType::getEncryptionMethod void   )  const [pure virtual]
 

Retrieve the EncryptionMethod element.

The EncryptionMethod element holds information about the encryption algorithm to be used to encrypt/decrypt the data

This method provides a means to extract the EncryptionMethod element from the EncryptedType

Returns:
The EncryptionMethod element

virtual DSIGKeyInfoList* XENCEncryptedType::getKeyInfoList void   )  [pure virtual]
 

Get the list of <KeyInfo> elements.

This function recovers list that contains the KeyInfo elements read in from the DOM document.

This list should be used by calling applications to determine what key is appropriate for decrypting the document.

Note:
The list should never be modified directly. If you need to add keyInfo elements, call the appropriate functions in EncryptedType
Returns:
A pointer to the DSIGKeyInfoList object held by the XENCCipher

virtual const XMLCh* XENCEncryptedType::getMimeType void   )  const [pure virtual]
 

Get the MimeType of the EncryptedType.

If this object is an EncryptedData, it may have a MimeType attribute that "describes the media type of the data which has been encrypted" (from the XML Encryption spec).

The XML-Security-C library makes no use of this attribute, but it provides these functions to allow applications to set and get.

Returns:
a pointer to the MimeType string (owned by the library) or NULL if no MimeType is set

virtual const XMLCh* XENCEncryptedType::getType void   )  const [pure virtual]
 

Get the Type URI for the EncryptedType.

If this object is an EncryptedData, it may have a Type attribute that defines whether it is an encrypted Element or Element Content. This method allows the caller to see this type URI.

Returns:
a pointer to the URI string (owned by the library) or NULL if no type is set

virtual void XENCEncryptedType::setEncoding const XMLCh *  uri  )  [pure virtual]
 

Set the Encoding of the EncryptedType.

If this object is an EncryptedData, it may have an encoding attribute that describes how the data has been encoded prior to encryption. (E.g. http://www.w3.org/2000/09/xmldsig#base64)

The XML-Security-C library makes no use of this attribute, but it provides these functions to allow applications to set and get.

Parameters:
uri String (URI) to set in the Encoding attribute.
Note:
no checking of this string is done by the library - it simply sets the value of the Encoding attribute to this value.

virtual void XENCEncryptedType::setMimeType const XMLCh *  mimeType  )  [pure virtual]
 

Set the MimeType of the EncryptedType.

If this object is an EncryptedData, it may have a MimeType attribute that "describes the media type of the data which has been encrypted" (from the XML Encryption spec).

The XML-Security-C library makes no use of this attribute, but it provides these functions to allow applications to set and get.

Parameters:
mimeType String to set in the MimeType attribute.
Note:
no checking of this string is done by the library - it simply sets the value of the MimeType attribute to this value.

virtual void XENCEncryptedType::setType const XMLCh *  uri  )  [pure virtual]
 

Set the Type URI for the EncryptedType.

Allows a calling application to set a particular Type URI for the EncryptedType.

Note:
calls to encryptElement and encryptElementContent automatically set the appropriate Type URI.
Parameters:
uri The URI to set


The documentation for this class was generated from the following file:
Generated on Sun Jan 28 19:49:09 2007 for XML-Security-C by  doxygen 1.4.2