sl@0: // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of the License "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // sl@0: sl@0: /** sl@0: @file sl@0: @publishedPartner sl@0: @released sl@0: */ sl@0: sl@0: #include sl@0: sl@0: #ifndef KEYASSOCIATION_H sl@0: #define KEYASSOCIATION_H sl@0: sl@0: namespace StreamAccess sl@0: { sl@0: /** sl@0: Defines the key association abstraction. In streaming protection, keys can be used slightly differently sl@0: for different protection layers. In IPSec they are used as a part of SA (Security Associations), while in SRTP they sl@0: are used as the Master Key - used for deriving the decryption and the authentication keys. sl@0: */ sl@0: class CKeyAssociation : public CBase sl@0: { sl@0: public: sl@0: IMPORT_C virtual ~CKeyAssociation(); sl@0: }; sl@0: sl@0: sl@0: /** sl@0: Defines a key association for the IPSec protocol. sl@0: */ sl@0: class CIpSecKeyAssociation : public CKeyAssociation sl@0: { sl@0: friend class CIpSecKeyStreamSink; sl@0: public: sl@0: /** Constructs a new key association for IPSec. sl@0: @param aSpi The SPI (security parameter index) to be used. sl@0: @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. sl@0: @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. sl@0: @leave One of the system-wide error codes. sl@0: */ sl@0: IMPORT_C static CIpSecKeyAssociation* NewL(TInt32 aSpi, HBufC8* aEncryptionKey, HBufC8* aAuthenticationKey); sl@0: sl@0: /** sl@0: @see CIpSecKeyAssociation::NewL sl@0: */ sl@0: IMPORT_C static CIpSecKeyAssociation* NewLC(TInt32 aSpi, HBufC8* aEncryptionKey, HBufC8* aAuthenticationKey); sl@0: sl@0: private: sl@0: TInt32 GetSpiL() const; sl@0: const HBufC8* GetEncryptionKeyL() const; sl@0: const HBufC8* GetAuthenticationKeyL() const; sl@0: private: sl@0: CIpSecKeyAssociation(TInt32 aSpi, HBufC8* aEncryptionKey, HBufC8* aAuthenticationKey); sl@0: private: sl@0: TInt32 iSpi; sl@0: HBufC8 *iEncryptionKey; sl@0: HBufC8 *iAuthenticationKey; sl@0: }; sl@0: sl@0: } // namespace StreamAccess sl@0: #endif // KEYASSOCIATION_H sl@0: