os/security/cryptoservices/filebasedcertificateandkeystores/test/thwkeystore/common/tkeydetails.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) 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 * Defines the class which represents the structure of the key on 
    16 * which Crypto Token HAI internally operates. It contains the key 
    17 * information relevant to Crypto Token HAI.
    18 *
    19 */
    20 
    21 
    22 /**
    23  @file
    24  @internalComponent
    25  @released
    26 */
    27 
    28 #ifndef TKEYDETAILS_H
    29 #define TKEYDETAILS_H
    30 
    31 #include <e32base.h>
    32 #include <mctkeystore.h>
    33 
    34 class CKeyDetails : public CKeyInfoBase
    35 	{
    36 public:
    37 	static CKeyDetails* NewL(	TInt aHandle, const TDesC& aLabel, 
    38 								const TDesC8& aPrivateKey, const TDesC8& aPublicKey );
    39 	static CKeyDetails* NewL(RStoreReadStream& aReadStream);
    40 	~CKeyDetails();
    41 
    42 public:
    43 	/** Get the handle of the key. */
    44 	TInt Handle() const;
    45 	HBufC8* PrivateKey() const;
    46 	HBufC8* PublicKey() const;
    47 	void ExternalizeL(RWriteStream&) const;
    48 	
    49 private:
    50 	CKeyDetails(TKeyIdentifier aID,
    51 				TKeyUsagePKCS15 aUsage,
    52 				TUint aSize, 
    53 				HBufC* aLabel,
    54 				TInt aHandle,
    55 				const TSecurityPolicy& aUsePolicy,
    56 				const TSecurityPolicy& aManagementPolicy,
    57 				EKeyAlgorithm aAlgorithm,
    58 				TInt aAccessType,
    59 				TBool aNative,
    60 				TTime aStartDate,
    61 				TTime aEndDate,
    62 				HBufC8* aPKCS8AttributeSet);
    63 		
    64 	void ConstructL(const TDesC8& aPrivateKey, const TDesC8& aPublicKey );
    65 	void ConstructL( RStoreReadStream& aReadStream);
    66 	CKeyDetails();
    67 	void InternalizeL(RReadStream& aReadStream);
    68 	
    69 private:
    70 	HBufC8* iPrivateKey;
    71 	HBufC8* iPublicKey;
    72 	};
    73 
    74 #endif // TKEYDETAILS_H