vpnengine/pkiservice/inc/pkiservicesigner.h
changeset 0 33413c0669b9
equal deleted inserted replaced
-1:000000000000 0:33413c0669b9
       
     1 /*
       
     2 * Copyright (c) 2008 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: A class that provides a signing operation.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef C_PKISERVICESIGNER_H
       
    21 #define C_PKISERVICESIGNER_H
       
    22 
       
    23 #include <e32base.h>
       
    24 
       
    25 #include "pkidefs.h"
       
    26 
       
    27 class MCTKeyStoreManager;
       
    28 class CLogonServices;
       
    29 
       
    30 /**
       
    31  * This class signs a given data by using a stored private key.
       
    32  */
       
    33 class CPkiServiceSigner : public CActive
       
    34     {
       
    35 public:
       
    36     static CPkiServiceSigner* NewL(CLogonServices& aLogonServices);
       
    37     ~CPkiServiceSigner();
       
    38 
       
    39     void Sign(const TPKIKeyIdentifier& aKeyId,
       
    40               const TDesC8& aDataToBeSigned,
       
    41               HBufC8*& aSignature,
       
    42               CUnifiedKeyStore& aUnifiedKeyStore,
       
    43               TInt aUsedKeyStore, 
       
    44               TRequestStatus& aStatus);
       
    45 
       
    46 
       
    47     void DoCancel();
       
    48     void RunL();
       
    49 
       
    50 private:
       
    51     enum TSignerState
       
    52         {
       
    53         ESignerIdle = 0,
       
    54         ESignerGettingKey,
       
    55 		ESignerOpeningSigner,
       
    56 		ESignerSigning		        
       
    57         };
       
    58         
       
    59     CPkiServiceSigner(CLogonServices& aLogonServices);    
       
    60     void Cleanup();
       
    61 
       
    62     CLogonServices&  iLogonServices;
       
    63         
       
    64     TSignerState     iState;
       
    65     TRequestStatus*  iClientStatus;
       
    66     CUnifiedKeyStore* iKeyStore; //Not owned by this class
       
    67     TInt              iUsedKeyStore;
       
    68     TPtrC8              iInput;    //Not owned by this class
       
    69     HBufC8**            iOutputBuffer;//Not owned by this class
       
    70     
       
    71     const CCTKeyInfo*          iUsedKeyInfo;
       
    72     
       
    73     MRSASigner*                iRsaSigner;
       
    74     MDSASigner*                iDsaSigner;    
       
    75     
       
    76     CRSASignature*             iRsaSignature;
       
    77     CDSASignature*             iDsaSignature;    
       
    78     
       
    79     RMPointerArray<CCTKeyInfo> iKeysList; 
       
    80     };
       
    81 
       
    82 #endif //C_PKISERVICESIGNER_H
       
    83 
       
    84