os/security/crypto/weakcrypto/test/tasymmetric/tsignatureinput.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     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
    31 * verified.
    32 * @publishedPartner
    33 * @released
    34 */
    35 class CSignatureInput : public CBase
    36     {
    37 public:
    38     virtual void Update(const TDesC8& aInput) = 0;
    39     virtual TPtrC8 Final(void) = 0;
    40 protected:
    41 	CSignatureInput(void) {}
    42 private:
    43     CSignatureInput(const CSignatureInput&);
    44     CSignatureInput& operator=(const CSignatureInput&);
    45     };
    46 
    47 /**
    48 * @publishedPartner
    49 * @released
    50 */
    51 class CHashingSignatureInput : public CSignatureInput
    52     {
    53 public:
    54     static CHashingSignatureInput* NewL(CMessageDigest::THashId aHashId);
    55     static CHashingSignatureInput* NewLC(CMessageDigest::THashId aHashId);
    56     virtual void Update(const TDesC8& aInput);
    57     virtual TPtrC8 Final(void);
    58     ~CHashingSignatureInput(void);
    59 protected:
    60     CHashingSignatureInput(void);
    61     void ConstructL(CMessageDigest::THashId aHashId);
    62 private:
    63     CMessageDigest* iHash;
    64 private:
    65     CHashingSignatureInput(const CHashingSignatureInput&);
    66     CHashingSignatureInput& operator=(const CHashingSignatureInput&);
    67     };
    68 
    69 #endif