os/security/crypto/weakcryptospi/inc/spi/keypair.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 /*
     2 * Copyright (c) 2006-2010 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 * crypto key pair definition - asymmetric key pair
    16 *
    17 */
    18 
    19 
    20 /**
    21  @file
    22  @publishedPartner
    23  @released
    24 */
    25 
    26 #ifndef __CRYPTOAPI_KEYPAIR_H__
    27 #define __CRYPTOAPI_KEYPAIR_H__
    28 
    29 #include <cryptospi/keys.h>
    30 
    31 namespace CryptoSpi
    32 	{
    33 	
    34 	/**
    35 	The Asymmetric Key Pair Definition
    36 	*/
    37 	NONSHARABLE_CLASS(CKeyPair) : public CBase
    38 		{
    39 	public:
    40 
    41 		/**
    42 		Create a CKeyPair instance from a public and private key. The 
    43 		CKeyPair takes ownership of both keys.
    44 		@param aPublicKey	The public key in the key pair.
    45 		@param aPrivateKey	The private key in the key pair.
    46 		@return a pointer to a CKeyPair instance
    47 		*/
    48 		IMPORT_C static CKeyPair* NewL(CKey* aPublicKey, CKey* aPrivateKey);
    49 
    50 		/**
    51 		Retrieve the public key
    52 		*/
    53 		IMPORT_C const CKey& PublicKey() const;
    54 
    55 		/**
    56 		Retrieve the private key
    57 		*/
    58 		IMPORT_C const CKey& PrivateKey() const;
    59 
    60 		~CKeyPair();
    61 
    62 	private:
    63 		/**
    64 		constructor
    65 		*/
    66 		CKeyPair();
    67 
    68 		/**
    69 		2nd Phase Constructor
    70 		*/
    71 		void ConstructL(CKey*, CKey*);
    72 
    73 	private:
    74 		/**
    75 		The public key in the key pair
    76 		*/
    77 		CKey* iPublicKey;
    78 
    79 		/**
    80 		The private key in the key pair
    81 		*/
    82 		CKey* iPrivateKey;
    83 		};
    84 
    85 	} // namespace CryptoSpi
    86 
    87 #endif //__CRYPTOAPI_KEYPAIR_H__