|
1 <?xml version="1.0" encoding="utf-8"?> |
|
2 <!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. --> |
|
3 <!-- This component and the accompanying materials are made available under the terms of the License |
|
4 "Eclipse Public License v1.0" which accompanies this distribution, |
|
5 and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". --> |
|
6 <!-- Initial Contributors: |
|
7 Nokia Corporation - initial contribution. |
|
8 Contributors: |
|
9 --> |
|
10 <!DOCTYPE concept |
|
11 PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd"> |
|
12 <concept id="GUID-425A208C-5D2D-55FD-8623-9E00006E2781" xml:lang="en"><title>Creating |
|
13 Cryptographic Context</title><prolog><metadata><keywords/></metadata></prolog><conbody> |
|
14 <p>SRTP library generates SRTP packets from the RTP or RTCP stream and forwards |
|
15 the packets to the receiver. SRTP transforms incoming SRTP packets to RTP/RTCP |
|
16 packets and passes them up the stack. The cryptographic state information |
|
17 associated with each SRTP stream is termed the cryptographic context. The |
|
18 state information is maintained by both the sender and receiver of SRTP streams. </p> |
|
19 <p>A cryptographic context includes a session key used in encryption and message |
|
20 authentication. A cryptographic context also includes a securely exchanged |
|
21 random bit string used to derive session keys called the master key. In addition |
|
22 to the session and master key the cryptographic context includes other working |
|
23 session parameters. </p> |
|
24 |
|
25 <section><title>Required background</title> <p>Prior to cryptographic context |
|
26 creation: </p> <ul> |
|
27 <li id="GUID-2958EA10-E760-59DE-AC4B-BE8B99CCA660"><p>The master key,master |
|
28 salt and parameters (ie. TSrtpCryptoParams) required to create the cryptographic |
|
29 context must be created and initalised. </p> </li> |
|
30 </ul> </section> |
|
31 <section><title>Procedure</title><p>The following steps describe the steps |
|
32 involved in creating a cryptographic context: </p><ul> |
|
33 <li id="GUID-C6379A93-A005-51B2-8CDA-49A7110C2717"><p>Create a cryptographic |
|
34 context by invoking the API <xref href="GUID-E9F66C90-C0BF-3713-8BA0-810A362A1774.dita"><apiname>NewL()</apiname></xref> or <xref href="GUID-E9F66C90-C0BF-3713-8BA0-810A362A1774.dita"><apiname>NewLC()</apiname></xref> of the class <xref href="GUID-E9F66C90-C0BF-3713-8BA0-810A362A1774.dita"><apiname>CSRTPCryptoContext</apiname></xref>. </p> <ol id="GUID-13319A29-DE4C-50D3-A0F4-02C0E71986ED"> |
|
35 <li id="GUID-195D2061-6DF7-58CC-BEB8-F321134B0325"><p><codeblock id="GUID-13CEC739-A557-520B-8AD6-6523BCFCF1B7" xml:space="preserve"> |
|
36 IMPORT_C static CSRTPCryptoContext* NewL( const CSRTPMasterKey* aKey, |
|
37 const CSRTPMasterSalt* aSalt, |
|
38 const TSrtpCryptoParams& aCryptoParams);</codeblock> </p> <p>aKey |
|
39 is the input parameter that contains the master key. </p> <p>aSalt is the |
|
40 input parameter that contains the master salt key. </p> <p>aCryptoParams is |
|
41 the input parameter that contains the Crypto Context parameters. </p> <p>The |
|
42 API leaves with KErrNone if successfully executed, else returns a valid system-wide |
|
43 error code. </p> </li> |
|
44 <li id="GUID-2F0536E7-0074-52FC-BB9E-0A9A3F03B395"><p><codeblock id="GUID-3F31AFE2-9E0C-5D62-8217-861D7CE59964" xml:space="preserve"> |
|
45 IMPORT_C static CSRTPCryptoContext* NewLC( const CSRTPMasterKey* aKey, |
|
46 const CSRTPMasterSalt* aSalt, |
|
47 const TSrtpCryptoParams& aCryptoParams );</codeblock> </p> <p>aKey |
|
48 is the input parameter that contains the master key. </p> <p>aSalt is the |
|
49 input parameter that contains the master salt key. </p> <p>aCryptoParams is |
|
50 the input parameter that contains the Crypto Context parameters. </p> <p>The |
|
51 API leaves with KErrNone if successfully executed, else returns a valid system-wide |
|
52 error code. </p> </li> |
|
53 </ol> </li> |
|
54 </ul><p><b>Creating Master Key</b></p><p> The master key can be created using |
|
55 the following API's:</p><ul> |
|
56 <li><codeblock xml:space="preserve">IMPORT_C static CSRTPMasterKey* NewL( const TDesC8& aKey,const TDesC8& aMKI,TUint aN_E = KSRTPDefSessionEncryptionKeyLength,Uint aN_A = KSRTPDefSessionAuthenticationKeyLength );</codeblock></li> |
|
57 <li><codeblock xml:space="preserve">IMPORT_C static CSRTPMasterKey* NewLC( const TDesC8& aKey,const TDesC8& aMKI,TUint aN_E = KSRTPDefSessionEncryptionKeyLength,TUint aN_A = KSRTPDefSessionAuthenticationKeyLength);</codeblock></li> |
|
58 <li><codeblock xml:space="preserve">IMPORT_C static CSRTPMasterSalt* NewLC( const TDesC8& aKey, TUint aN_S = KSRTPDefSessionSaltingKeyLength );</codeblock></li> |
|
59 </ul><p><b>Creating Master Salt Key</b></p><p>The master salt key can be created |
|
60 using the following API's:</p><ul> |
|
61 <li><codeblock xml:space="preserve">IMPORT_C static CSRTPMasterSalt* NewL( const TDesC8& aKey,TUint aN_S = KSRTPDefSessionSaltingKeyLength )</codeblock></li> |
|
62 </ul> </section> |
|
63 |
|
64 <section><title>Results</title> <p>On successful execution of the API, a cryptographic |
|
65 context is created. </p> <p>The cryptographic context can be used by a SRTP |
|
66 session or Stream. In other words, the cryptographic context is owned by the |
|
67 session or stream. </p> <p>The master keys and the master salt are always |
|
68 owned by the cryptographic context. </p> </section> |
|
69 |
|
70 <section> <p>For more information on cryptographic context management also |
|
71 refer: </p> <p> <xref href="GUID-E9F66C90-C0BF-3713-8BA0-810A362A1774.dita"><apiname>MasterKey()</apiname></xref> </p> <p> <xref href="GUID-E9F66C90-C0BF-3713-8BA0-810A362A1774.dita"><apiname>SetMasterKey()</apiname></xref> </p> <p> <xref href="GUID-E9F66C90-C0BF-3713-8BA0-810A362A1774.dita"><apiname> MasterSalt()</apiname></xref> </p> <p> <xref href="GUID-E9F66C90-C0BF-3713-8BA0-810A362A1774.dita"><apiname>SetMasterSalt()</apiname></xref> </p> <p> <xref href="GUID-E9F66C90-C0BF-3713-8BA0-810A362A1774.dita"><apiname>SetRCCm3Sync()</apiname></xref> </p> <p> <xref href="GUID-E9F66C90-C0BF-3713-8BA0-810A362A1774.dita"><apiname>CryptoParams()</apiname></xref> </p> <p> <xref href="GUID-E9F66C90-C0BF-3713-8BA0-810A362A1774.dita"><apiname> AddCryptoChangeObserver()</apiname></xref> </p> <p> <xref href="GUID-E9F66C90-C0BF-3713-8BA0-810A362A1774.dita"><apiname>RemoveCryptoChangeObserver()</apiname></xref> </p> <p> <xref href="GUID-E9F66C90-C0BF-3713-8BA0-810A362A1774.dita"><apiname>UpdateCryptoParams()</apiname></xref> </p> </section> |
|
72 </conbody><related-links> |
|
73 <link href="GUID-06370120-7738-5694-9A8C-3B5B1E3A4352.dita"><linktext>Creating |
|
74 an SRTP Session</linktext></link> |
|
75 <link href="GUID-372B7A9F-261E-5F3F-B114-4BE2FE2EF7C7.dita"><linktext>Creating |
|
76 an SRTP Stream</linktext></link> |
|
77 <link href="GUID-79846EA2-33CD-5D01-8E96-6092C15BD839.dita"><linktext>Encrypting |
|
78 RTCP Packet Data</linktext></link> |
|
79 <link href="GUID-922F292E-9420-593B-B226-2764C5F29DF9.dita"><linktext>Encrypting |
|
80 RTP Packet Data</linktext></link> |
|
81 <link href="GUID-6E1AC4C9-7CA3-503A-AFC0-BAF29CCA8290.dita"><linktext>Decrypting |
|
82 RTP Packet Data</linktext></link> |
|
83 <link href="GUID-F9A24A47-7A0B-5F6E-8B0A-B7A7BCC4EAFC.dita"><linktext>Decrypting |
|
84 RTCP Packet Data</linktext></link> |
|
85 <link href="GUID-B9BD2E0A-F214-5344-91A6-E4E99F0D74C8.dita"><linktext>Updating |
|
86 Master Key</linktext></link> |
|
87 <link href="GUID-F9A24A47-7A0B-5F6E-8B0A-B7A7BCC4EAFC.dita"><linktext>Managing |
|
88 Master Key</linktext></link> |
|
89 </related-links></concept> |