os/security/contentmgmt/cafstreamingsupport/inc/keyassociation.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     4 // under the terms of the License "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 //
    15 
    16 /**
    17  @file
    18  @publishedPartner
    19  @released
    20 */
    21 
    22 #include <e32base.h>
    23 
    24 #ifndef KEYASSOCIATION_H
    25 #define KEYASSOCIATION_H
    26 
    27 namespace StreamAccess
    28 	{
    29 	/**
    30  	Defines the key association abstraction. In streaming protection, keys can be used slightly differently
    31 	for different protection layers. In IPSec they are used as a part of SA (Security Associations), while in SRTP they
    32 	are used as the Master Key - used for deriving the decryption and the authentication keys.
    33  	*/
    34 	class CKeyAssociation : public CBase
    35 		{
    36 	public:	 
    37 		IMPORT_C virtual ~CKeyAssociation();
    38 		};
    39 
    40 
    41 	/**
    42  	Defines a key association for the IPSec protocol.
    43  	*/
    44 	class CIpSecKeyAssociation : public CKeyAssociation
    45 		{
    46 	friend class CIpSecKeyStreamSink;
    47 	public:
    48 		 /** Constructs a new key association for IPSec.
    49 		 @param aSpi The SPI (security parameter index) to be used.
    50 		 @param aEncryptionKey The encryption key to be used in this association. Please note that the ownership on aEncryptionKey is passed to the newly created object.
    51 		 @param aAuthenticationKey The authentication key to be used in this association. Please note that the ownership on aAuthenticationKey is passed to the newly created object.		 
    52 		 @leave One of the system-wide error codes.
    53 		 */
    54 		 IMPORT_C static CIpSecKeyAssociation* NewL(TInt32 aSpi, HBufC8* aEncryptionKey, HBufC8* aAuthenticationKey);
    55 
    56 		 /**
    57 		 @see CIpSecKeyAssociation::NewL
    58 		 */
    59 		 IMPORT_C static CIpSecKeyAssociation* NewLC(TInt32 aSpi, HBufC8* aEncryptionKey, HBufC8* aAuthenticationKey);
    60 
    61 	private:
    62 		 TInt32 GetSpiL() const;
    63 		 const HBufC8* GetEncryptionKeyL() const;
    64 		 const HBufC8* GetAuthenticationKeyL() const;
    65 	private:
    66 		 CIpSecKeyAssociation(TInt32 aSpi, HBufC8* aEncryptionKey, HBufC8* aAuthenticationKey);
    67 	private:
    68 		 TInt32 iSpi;
    69 		 HBufC8 *iEncryptionKey;
    70 		 HBufC8 *iAuthenticationKey;
    71 		};
    72 
    73 	} // namespace StreamAccess
    74 #endif // KEYASSOCIATION_H
    75