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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
24 #ifndef KEYASSOCIATION_H
25 #define KEYASSOCIATION_H
27 namespace StreamAccess
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.
34 class CKeyAssociation : public CBase
37 IMPORT_C virtual ~CKeyAssociation();
42 Defines a key association for the IPSec protocol.
44 class CIpSecKeyAssociation : public CKeyAssociation
46 friend class CIpSecKeyStreamSink;
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.
54 IMPORT_C static CIpSecKeyAssociation* NewL(TInt32 aSpi, HBufC8* aEncryptionKey, HBufC8* aAuthenticationKey);
57 @see CIpSecKeyAssociation::NewL
59 IMPORT_C static CIpSecKeyAssociation* NewLC(TInt32 aSpi, HBufC8* aEncryptionKey, HBufC8* aAuthenticationKey);
62 TInt32 GetSpiL() const;
63 const HBufC8* GetEncryptionKeyL() const;
64 const HBufC8* GetAuthenticationKeyL() const;
66 CIpSecKeyAssociation(TInt32 aSpi, HBufC8* aEncryptionKey, HBufC8* aAuthenticationKey);
69 HBufC8 *iEncryptionKey;
70 HBufC8 *iAuthenticationKey;
73 } // namespace StreamAccess
74 #endif // KEYASSOCIATION_H