ipappsrv_plat/media_control_api/inc/mmccsrtpmasterkey.h
changeset 0 1bce908db942
equal deleted inserted replaced
-1:000000000000 0:1bce908db942
       
     1 /*
       
     2 * Copyright (c) 2006 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 "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:    Class is used for configuring MCC SRTP master key
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #ifndef MCCSRTPMASTERKEY_H
       
    22 #define MCCSRTPMASTERKEY_H
       
    23 
       
    24 // INCLUDES
       
    25 #include <e32base.h>
       
    26 
       
    27 // SRTP Master key length
       
    28 // 16 octets (128 bits) 
       
    29 const TUint KMasterKeyMaxLength = 16;
       
    30 
       
    31 // default SRTP SESSION key lengths:
       
    32 // default bit length (n_e) for session encryption key (k_e):
       
    33 // 128 bits (16 octets)
       
    34 const TUint KMccSRTPDefSessionEncryptionKeyLength = 0x80;
       
    35 
       
    36 // default bit length (n_a) for session authentication key (k_a):
       
    37 // 160 bits (20 octets)
       
    38 const TUint KMccSRTPDefSessionAuthenticationKeyLength = 0xa0;
       
    39 
       
    40 // default SRTP MASTER key lengths:
       
    41 // default bit length for SRTP master key (128-bit AES):
       
    42 // 128 bits (16 octets)
       
    43 const TUint16 KMccSRTPDefaultMasterKeyLength = 0x80;
       
    44 
       
    45 // Master key identifier length
       
    46 // 128 octets 
       
    47 const TUint KMKIMaxLength = 128;
       
    48 
       
    49 /**
       
    50  * The TMccSrtpMasterKey captures the MCC SRTP master key params
       
    51  * into one class
       
    52  *
       
    53  * @lib N/A
       
    54  * @since Series 60 3.2
       
    55  */    
       
    56 class TMccSrtpMasterKey
       
    57 	{
       
    58 public: 
       
    59 	
       
    60     inline TMccSrtpMasterKey( const TDesC8& aMasterKey,
       
    61                               const TDesC8& aMKI,
       
    62                               TUint aEncKeyBitLength =
       
    63                                   KMccSRTPDefSessionEncryptionKeyLength,
       
    64                               TUint aAuthKeyBitLength =
       
    65                                   KMccSRTPDefSessionAuthenticationKeyLength ) :
       
    66         iMasterKey( aMasterKey ),
       
    67         iMKI( aMKI ),
       
    68         iEncKeyBitLength( aEncKeyBitLength ),
       
    69         iAuthKeyBitLength( aAuthKeyBitLength )                    
       
    70     	{
       
    71     	};
       
    72     	
       
    73 private:
       
    74 
       
    75     TMccSrtpMasterKey() :
       
    76         iMasterKey( KNullDesC8 ),
       
    77         iMKI( KNullDesC8 ), 
       
    78         iEncKeyBitLength( KMccSRTPDefSessionEncryptionKeyLength ),
       
    79         iAuthKeyBitLength( KMccSRTPDefSessionAuthenticationKeyLength )                 
       
    80     	{
       
    81     	};
       
    82 
       
    83 public:
       
    84     
       
    85     /**
       
    86      * The master key value.
       
    87      */
       
    88     TBuf8< KMasterKeyMaxLength > iMasterKey; 
       
    89     
       
    90     /**
       
    91      * The master key identifier value
       
    92      */
       
    93     TBuf8< KMKIMaxLength > iMKI;
       
    94     
       
    95     /**
       
    96      * The bit length of the encryption key
       
    97      */
       
    98     TUint iEncKeyBitLength;
       
    99 
       
   100     /**
       
   101      * The bit length of the authentication key
       
   102      */
       
   103     TUint iAuthKeyBitLength;
       
   104     	
       
   105 	};
       
   106 		
       
   107 typedef TPckgBuf<TMccSrtpMasterKey> TMccSrtpMasterKeyPckg;
       
   108 
       
   109 
       
   110 #endif /* MCCSRTPMASTERKEY_H */
       
   111             
       
   112 // End of File