xmlsecurityengine/xmlsecwrapper/inc/xmlsecwtemplate.h
changeset 0 e35f40988205
child 24 74f0b3eb154c
equal deleted inserted replaced
-1:000000000000 0:e35f40988205
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: Class with methods used in encryption and decryption process.       
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef C_TEMPLATE_H
       
    19 #define C_TEMPLATE_H
       
    20 
       
    21 #include <e32std.h>
       
    22 #include <f32file.h>
       
    23  
       
    24 #include <xmlengdom.h>
       
    25 #include <libxml2_tree.h>
       
    26 #include <libxml2_xmlmemory.h>
       
    27 #include <libxml2_parser.h>
       
    28 #include <libxml2_globals.h>
       
    29 
       
    30 class XmlSecTemplate
       
    31     {
       
    32 public:
       
    33     /**
       
    34      * Sets template.
       
    35      * This template will be used until new template will be set.
       
    36      *
       
    37      * @since S60 v3.2
       
    38      * @param aTemplate template document
       
    39      * @param aInput DOM tree with template document
       
    40      */
       
    41     static void SetTemplateL(RXmlEngDocument& aTemplate, const RXmlEngDocument& aInput);
       
    42     
       
    43     
       
    44     /**
       
    45      * Sets template from file.
       
    46      * This template will be used until new template will be set.
       
    47      *
       
    48      * @since S60 v3.2
       
    49      * @param aTemplate template document
       
    50      * @param aFile name of the file with template inside 
       
    51      * @param aRFs handle to a file server session
       
    52      */
       
    53     static void SetTemplateFromFileL(RXmlEngDocument& aTemplate, const TDesC8& aFile, RFs& aRFs);
       
    54     
       
    55     /**
       
    56      * Sets template from file.
       
    57      * This template will be used until new template will be set.
       
    58      *
       
    59      * @since S60 v3.2
       
    60      * @param aTemplate  template document
       
    61      * @param aFile name of the file with template inside 
       
    62      */
       
    63     static void SetTemplateFromFileL(RXmlEngDocument& aTemplate, const TDesC8& aFile);
       
    64     
       
    65     /**
       
    66      * Sets template from buffer.
       
    67      * This template will be used until new template will be set.
       
    68      *
       
    69      * @since S60 v3.2
       
    70      * @param aTemplate template document
       
    71      * @param aBuffer template in buffer 
       
    72      */  
       
    73     static void SetTemplateFromBufferL(RXmlEngDocument& aTemplate,const TDesC8& aBuffer);
       
    74     
       
    75     /**
       
    76      * Destroys current template.
       
    77      *
       
    78      * @since S60 v3.2
       
    79      * @param aTemplate template to destroy
       
    80      */
       
    81     static void DestroyTemplate(RXmlEngDocument& aTemplate);
       
    82     
       
    83     /**
       
    84      * Adds <KeyName> element to <KeyInfo> node and sets the value of it.
       
    85      * The element will be added to aTemplate template.
       
    86      *
       
    87      * @since S60 v3.2
       
    88      * @param aTemplate template document.
       
    89      * @param aKeyName Key name that should be set.
       
    90      */
       
    91     static void SetKeyInfoL(RXmlEngDocument& aTemplate, const TDesC8& aKeyName);
       
    92     
       
    93     /**
       
    94      * Adds element to <KeyInfo> node. 
       
    95      * This method allow to add specific data to <KeyInfo> element.
       
    96      * The element will be added to aTemplate template.
       
    97      * 
       
    98      * @since S60 v3.2
       
    99      * @param aTemplate template document
       
   100      * @param aKeyProp TElement that should be set in template document.
       
   101      */  
       
   102     static void SetKeyInfoL(RXmlEngDocument& aTemplate, TXmlEngElement aKeyProp);
       
   103     };
       
   104     
       
   105 #endif // C_TEMPLATE_H