crypto/weakcrypto/test/tasymmetric/tsignatureinput.h
author hgs
Thu, 12 Aug 2010 21:07:10 +0530
changeset 90 8c545fea2798
parent 72 de46a57f75fb
permissions -rw-r--r--
201031_01
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
72
de46a57f75fb 201023_02
hgs
parents:
diff changeset
     1
/*
de46a57f75fb 201023_02
hgs
parents:
diff changeset
     2
* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
de46a57f75fb 201023_02
hgs
parents:
diff changeset
     3
* All rights reserved.
de46a57f75fb 201023_02
hgs
parents:
diff changeset
     4
* This component and the accompanying materials are made available
de46a57f75fb 201023_02
hgs
parents:
diff changeset
     5
* under the terms of the License "Eclipse Public License v1.0"
de46a57f75fb 201023_02
hgs
parents:
diff changeset
     6
* which accompanies this distribution, and is available
de46a57f75fb 201023_02
hgs
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
de46a57f75fb 201023_02
hgs
parents:
diff changeset
     8
*
de46a57f75fb 201023_02
hgs
parents:
diff changeset
     9
* Initial Contributors:
de46a57f75fb 201023_02
hgs
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
de46a57f75fb 201023_02
hgs
parents:
diff changeset
    11
*
de46a57f75fb 201023_02
hgs
parents:
diff changeset
    12
* Contributors:
de46a57f75fb 201023_02
hgs
parents:
diff changeset
    13
*
de46a57f75fb 201023_02
hgs
parents:
diff changeset
    14
* Description: 
de46a57f75fb 201023_02
hgs
parents:
diff changeset
    15
*
de46a57f75fb 201023_02
hgs
parents:
diff changeset
    16
*/
de46a57f75fb 201023_02
hgs
parents:
diff changeset
    17
de46a57f75fb 201023_02
hgs
parents:
diff changeset
    18
de46a57f75fb 201023_02
hgs
parents:
diff changeset
    19
de46a57f75fb 201023_02
hgs
parents:
diff changeset
    20
de46a57f75fb 201023_02
hgs
parents:
diff changeset
    21
/**
de46a57f75fb 201023_02
hgs
parents:
diff changeset
    22
 @file
de46a57f75fb 201023_02
hgs
parents:
diff changeset
    23
*/
de46a57f75fb 201023_02
hgs
parents:
diff changeset
    24
de46a57f75fb 201023_02
hgs
parents:
diff changeset
    25
#ifndef __TSIGNATUREINPUT_H__
de46a57f75fb 201023_02
hgs
parents:
diff changeset
    26
#define __TSIGNATUREINPUT_H__
de46a57f75fb 201023_02
hgs
parents:
diff changeset
    27
de46a57f75fb 201023_02
hgs
parents:
diff changeset
    28
#include <e32base.h>
de46a57f75fb 201023_02
hgs
parents:
diff changeset
    29
#include <hash.h>
de46a57f75fb 201023_02
hgs
parents:
diff changeset
    30
/** An abstract class capable of representing a message to be signed or
de46a57f75fb 201023_02
hgs
parents:
diff changeset
    31
* verified.
de46a57f75fb 201023_02
hgs
parents:
diff changeset
    32
* @publishedPartner
de46a57f75fb 201023_02
hgs
parents:
diff changeset
    33
* @released
de46a57f75fb 201023_02
hgs
parents:
diff changeset
    34
*/
de46a57f75fb 201023_02
hgs
parents:
diff changeset
    35
class CSignatureInput : public CBase
de46a57f75fb 201023_02
hgs
parents:
diff changeset
    36
    {
de46a57f75fb 201023_02
hgs
parents:
diff changeset
    37
public:
de46a57f75fb 201023_02
hgs
parents:
diff changeset
    38
    virtual void Update(const TDesC8& aInput) = 0;
de46a57f75fb 201023_02
hgs
parents:
diff changeset
    39
    virtual TPtrC8 Final(void) = 0;
de46a57f75fb 201023_02
hgs
parents:
diff changeset
    40
protected:
de46a57f75fb 201023_02
hgs
parents:
diff changeset
    41
	CSignatureInput(void) {}
de46a57f75fb 201023_02
hgs
parents:
diff changeset
    42
private:
de46a57f75fb 201023_02
hgs
parents:
diff changeset
    43
    CSignatureInput(const CSignatureInput&);
de46a57f75fb 201023_02
hgs
parents:
diff changeset
    44
    CSignatureInput& operator=(const CSignatureInput&);
de46a57f75fb 201023_02
hgs
parents:
diff changeset
    45
    };
de46a57f75fb 201023_02
hgs
parents:
diff changeset
    46
de46a57f75fb 201023_02
hgs
parents:
diff changeset
    47
/**
de46a57f75fb 201023_02
hgs
parents:
diff changeset
    48
* @publishedPartner
de46a57f75fb 201023_02
hgs
parents:
diff changeset
    49
* @released
de46a57f75fb 201023_02
hgs
parents:
diff changeset
    50
*/
de46a57f75fb 201023_02
hgs
parents:
diff changeset
    51
class CHashingSignatureInput : public CSignatureInput
de46a57f75fb 201023_02
hgs
parents:
diff changeset
    52
    {
de46a57f75fb 201023_02
hgs
parents:
diff changeset
    53
public:
de46a57f75fb 201023_02
hgs
parents:
diff changeset
    54
    static CHashingSignatureInput* NewL(CMessageDigest::THashId aHashId);
de46a57f75fb 201023_02
hgs
parents:
diff changeset
    55
    static CHashingSignatureInput* NewLC(CMessageDigest::THashId aHashId);
de46a57f75fb 201023_02
hgs
parents:
diff changeset
    56
    virtual void Update(const TDesC8& aInput);
de46a57f75fb 201023_02
hgs
parents:
diff changeset
    57
    virtual TPtrC8 Final(void);
de46a57f75fb 201023_02
hgs
parents:
diff changeset
    58
    ~CHashingSignatureInput(void);
de46a57f75fb 201023_02
hgs
parents:
diff changeset
    59
protected:
de46a57f75fb 201023_02
hgs
parents:
diff changeset
    60
    CHashingSignatureInput(void);
de46a57f75fb 201023_02
hgs
parents:
diff changeset
    61
    void ConstructL(CMessageDigest::THashId aHashId);
de46a57f75fb 201023_02
hgs
parents:
diff changeset
    62
private:
de46a57f75fb 201023_02
hgs
parents:
diff changeset
    63
    CMessageDigest* iHash;
de46a57f75fb 201023_02
hgs
parents:
diff changeset
    64
private:
de46a57f75fb 201023_02
hgs
parents:
diff changeset
    65
    CHashingSignatureInput(const CHashingSignatureInput&);
de46a57f75fb 201023_02
hgs
parents:
diff changeset
    66
    CHashingSignatureInput& operator=(const CHashingSignatureInput&);
de46a57f75fb 201023_02
hgs
parents:
diff changeset
    67
    };
de46a57f75fb 201023_02
hgs
parents:
diff changeset
    68
de46a57f75fb 201023_02
hgs
parents:
diff changeset
    69
#endif