webservices/wsframework/inc/senpasswordtransform.h
changeset 0 62f9d29f7211
equal deleted inserted replaced
-1:000000000000 0:62f9d29f7211
       
     1 /*
       
     2 * Copyright (c) 2002-2006 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:        Defines the ECom interface for Sen Security Mechanism plug-ins
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 
       
    25 #ifndef SEN_PASSWORD_TRANSFORM_H
       
    26 #define SEN_PASSWORD_TRANSFORM_H
       
    27 
       
    28 // INCLUDES
       
    29 #include <ecom/ecom.h>
       
    30 
       
    31 #include "msencoreservicemanager.h"
       
    32 
       
    33 // CLASS DECLARATION
       
    34 
       
    35 /**
       
    36 * Custom ECOM interface definition. This interface is used by
       
    37 * clients to find specific security mechanism plugin instance
       
    38 * implementations which implement pure virtual functions.
       
    39 */
       
    40 class CSenPasswordTransform : public CBase
       
    41     {
       
    42     public: // Constructors and destructor
       
    43 
       
    44         /**
       
    45         * Wraps ECom object instantiation, which returns the
       
    46         * default interface implementation.
       
    47         * Note: This is not a "normal" NewL method, since normally NewL
       
    48         * methods are only defined for concrete classes.
       
    49         * Note that the implementations of this interface
       
    50         * ALSO provide NewL methods. They are the familiar
       
    51         * EPOC NewL's, which create instance of classes.
       
    52         */
       
    53         static CSenPasswordTransform* NewL(MSenCoreServiceManager& aManager);
       
    54 
       
    55         /**
       
    56         * Wraps ECom object instantitation, which returns the
       
    57         * interface implementation matching to given aCue.
       
    58         * IMPLEMENTATION_INFO::default_data.
       
    59         * For details, see EcomSIFDefinition.inl comments.
       
    60         * Note: This is not a "normal" NewL method, since normally NewL
       
    61         * methods are only defined for concrete classes.
       
    62         * Note that the implementations of this interface ALSO
       
    63         * provide NewL methods. They are the familiar EPOC NewL's,
       
    64         * which create instances of classes.
       
    65         * @param: aCue is the "name" of the requested implementation.
       
    66         *              Implementations advertise their cue as specified
       
    67         *              in their resource file field
       
    68         */
       
    69         static CSenPasswordTransform* NewL(const TDesC8& aCue,
       
    70                                            MSenCoreServiceManager& aManager);
       
    71         /**
       
    72         * Destructor.
       
    73         */
       
    74         virtual ~CSenPasswordTransform();
       
    75 
       
    76         // New functions
       
    77         
       
    78         // the actual security mechanism interface methods
       
    79 
       
    80         /**
       
    81         * Set transform parameters
       
    82         *  @return KErrNone or one of the system-wide error codes,
       
    83         *          KErrNotSupported, if parameter name is unknown!
       
    84         */
       
    85         virtual TInt SetParameterL(TPtrC8 aName, TPtrC8 aValue) = 0;
       
    86 
       
    87         /**
       
    88         * Does the actual tranform
       
    89         * @return the transformed password.
       
    90         * Caller takes ownership of the returned object. Never returns NULL.
       
    91         */
       
    92         virtual HBufC8* TransformL(TPtrC8 aPassphrase) const = 0;
       
    93 
       
    94     protected:
       
    95 
       
    96         /**
       
    97         * C++ default constructor.
       
    98         */
       
    99         CSenPasswordTransform(MSenCoreServiceManager& aServiceManager);
       
   100 
       
   101     protected: // Data
       
   102         // to access base64, encoding/decoding
       
   103         MSenCoreServiceManager& iServiceManager;    
       
   104 
       
   105     private: // Data
       
   106         /** 
       
   107         * Instance identifier key. When instance of an implementation is created 
       
   108         * by ECOM framework, the framework will assign UID for it. 
       
   109         * The UID is used in destructor to notify framework that this instance is
       
   110       * being destroyed and resources can be released.
       
   111       */
       
   112         TUid iDtor_ID_Key;
       
   113     };
       
   114 
       
   115 // This includes the implementation of the instantiation functions and destructor
       
   116 #include "senpasswordtransform.inl"
       
   117 
       
   118 #endif // SEN_PASSWORD_TRANSFORM_H
       
   119 
       
   120 // End of File