os/security/crypto/weakcryptospi/test/tasymmetric/tsignatureinput.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
     1 /*
     2 * Copyright (c) 2005-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 the License "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: 
    15 *
    16 */
    17 
    18 
    19 
    20 
    21 /**
    22  @file
    23 */
    24 
    25 #ifndef __TSIGNATUREINPUT_H__
    26 #define __TSIGNATUREINPUT_H__
    27 
    28 #include <e32base.h>
    29 #include <hash.h>
    30 /** An abstract class capable of representing a message to be signed or verified. */
    31 class CSignatureInput : public CBase
    32     {
    33 public:
    34     virtual void Update(const TDesC8& aInput) = 0;
    35     virtual TPtrC8 Final(void) = 0;
    36 protected:
    37 	CSignatureInput(void) {}
    38 private:
    39     CSignatureInput(const CSignatureInput&);
    40     CSignatureInput& operator=(const CSignatureInput&);
    41     };
    42 
    43 class CHashingSignatureInput : public CSignatureInput
    44     {
    45 public:
    46     static CHashingSignatureInput* NewL(CMessageDigest::THashId aHashId);
    47     static CHashingSignatureInput* NewLC(CMessageDigest::THashId aHashId);
    48     virtual void Update(const TDesC8& aInput);
    49     virtual TPtrC8 Final(void);
    50     ~CHashingSignatureInput(void);
    51 protected:
    52     CHashingSignatureInput(void);
    53     void ConstructL(CMessageDigest::THashId aHashId);
    54 private:
    55     CMessageDigest* iHash;
    56 private:
    57     CHashingSignatureInput(const CHashingSignatureInput&);
    58     CHashingSignatureInput& operator=(const CHashingSignatureInput&);
    59     };
    60 
    61 #endif