author | Dominic Pinkman <dominic.pinkman@nokia.com> |
Fri, 13 Aug 2010 16:47:46 +0100 | |
changeset 14 | 578be2adaf3e |
parent 13 | 48780e181b38 |
permissions | -rw-r--r-- |
13
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
1 |
<?xml version="1.0" encoding="utf-8"?> |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
2 |
<!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. --> |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
3 |
<!-- This component and the accompanying materials are made available under the terms of the License |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
4 |
"Eclipse Public License v1.0" which accompanies this distribution, |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
5 |
and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". --> |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
6 |
<!-- Initial Contributors: |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
7 |
Nokia Corporation - initial contribution. |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
8 |
Contributors: |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
9 |
--> |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
10 |
<!DOCTYPE task |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
11 |
PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd"> |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
12 |
<task id="GUID-5927A119-C520-572D-83AF-7265DEEF4553" xml:lang="en"><title>Using |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
13 |
Pre-Shared Keys with Transport Layer Security : Tutorial</title><shortdesc>This topic describes how to use Pre-Shared Keys (PSKs) with Transport |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
14 |
Layer Security (TLS). This tutorial is useful for licensees and third-party |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
15 |
developers. </shortdesc><prolog><metadata><keywords/></metadata></prolog><taskbody> |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
16 |
<context><p>TLS_PSK is a standard for using PSKs with Transport Layer Security |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
17 |
(TLS). You can use TLS_PSK instead of certificate authentication. The benefits |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
18 |
of using TLS_PSK are as follows: </p> <ul> |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
19 |
<li id="GUID-F752EC0E-19B2-5C8E-9F0F-AC1131CC9437"><p>Easy to manage - For |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
20 |
example, PSK can derive from a "secret key" that vendors deploy in the SIM |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
21 |
card of each phone. </p> </li> |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
22 |
<li id="GUID-9964A601-5724-58D0-856C-B2401AD171D3"><p>It improves the connection |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
23 |
setup performance and battery life, as the key exchange algorithm takes less |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
24 |
time to run. </p> </li> |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
25 |
</ul> <p>Symbian maintains the following TLS_PSK ciphersuites: </p> <ul> |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
26 |
<li id="GUID-AF102861-2863-5189-AEA0-738797280D3A"><p>TLS_PSK_WITH_RC4_128_SHA </p> </li> |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
27 |
<li id="GUID-D305CBF6-87F1-5895-AFE6-F8067340E489"><p>TLS_PSK_WITH_3DES_EDE_CBC_SHA </p> </li> |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
28 |
<li id="GUID-EA4EC83B-5B58-53D6-A1AD-D408CBBC25BA"><p>TLS_PSK_WITH_AES_128_CBC_SHA </p> </li> |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
29 |
<li id="GUID-4B4E0A69-8F73-5D41-AE50-A231F2E73A00"><p>TLS_PSK_WITH_AES_256_CBC_SHA </p> </li> |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
30 |
</ul> <p>The ciphersuite is made up of a key exchange (for example PSK), a |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
31 |
cipher (for example RC4_128) and a hash (for example SHA). </p> <p>Note: TLS_PSK |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
32 |
operation is specified by <xref href="http://www.ietf.org/rfc/rfc4279.txt" scope="external">RFC4279</xref>. </p><p>For a client to make a secure connection |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
33 |
with a TLS_PSK server, it must provide a pre-shared key and an identity. To |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
34 |
provide a pre-shared key and an identity, do the following steps: |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
35 |
</p> </context> |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
36 |
<steps id="GUID-460D5C5A-7C5D-552F-87B1-5E1ED199EEBD"> |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
37 |
<step id="GUID-12A544C1-3A69-5EB5-A546-A03B95B27909"><cmd>Configure a PSK |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
38 |
key handler </cmd> |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
39 |
</step> |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
40 |
<step id="GUID-6D6DADE7-457D-5885-8448-AF515B58C381"><cmd/> |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
41 |
<info>Set available ciphersuites. There are two possibilities for offering |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
42 |
PSK ciphersuites: </info> |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
43 |
<substeps id="GUID-505F5F7A-60D5-55BC-9F46-8A0BDE0A8F2F"> |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
44 |
<substep id="GUID-5B057120-5AC9-5EAA-929C-F01C9E5036AA"><cmd>Specify an explicit |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
45 |
ordered list of ciphersuites for the server to select from.</cmd> |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
46 |
<info>To do this call <xref href="GUID-6D5FEC74-C9EB-3A5B-96B0-65E92564F387.dita"><apiname>SetAvailableCipherSuites()</apiname></xref>. You can |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
47 |
do this only after configuring the PSK key handler. </info> |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
48 |
</substep> |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
49 |
<substep id="GUID-72D09EBC-0ACB-533D-B43D-CBDD7A173E95"><cmd>Use the default |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
50 |
list, which is automatically generated.</cmd> |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
51 |
<info>If you do not specify an explicit list, the stack automatically includes |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
52 |
the PSK ciphersuites in addition to any other ciphersuites supported. </info> |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
53 |
</substep> |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
54 |
</substeps> |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
55 |
<info>If you specify an explicit list by calling <xref href="GUID-6D5FEC74-C9EB-3A5B-96B0-65E92564F387.dita"><apiname>SetAvailableCipherSuites()</apiname></xref>, |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
56 |
and you later deconfigure the PSK key handler, you must remove the PSK ciphersuites |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
57 |
from the list by calling <xref href="GUID-6D5FEC74-C9EB-3A5B-96B0-65E92564F387.dita"><apiname>SetAvailableCipherSuites()</apiname></xref> again. </info> |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
58 |
</step> |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
59 |
<step id="GUID-CD1A725D-55EA-5F89-9552-C4DC629E9365"><cmd/> |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
60 |
<info>Start a connection. </info> |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
61 |
<info>The server chooses a ciphersuite from those offered by the client. If |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
62 |
the server chooses a PSK ciphersuite, the following sequence of events occurs: </info> |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
63 |
|
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
64 |
<substeps id="GUID-8BA50D23-A34D-5E02-BA1C-33B9C503E83C"> |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
65 |
<substep id="GUID-A0F4A26A-FA91-58DC-9EFF-6F131F473E63"><cmd>The server can |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
66 |
optionally send a “PSK identity hint” to the client.</cmd> |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
67 |
<info> This PSK identity hint might influence the choice of key and identity |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
68 |
the client makes. If the server sends one, it is passed to the key handler. |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
69 |
If it does not send one, NULL is passed to the key handler. </info> |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
70 |
<info>Note: The PSK identity hint is optional and its meaning is not defined |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
71 |
(format must be UTF8). Applications using TLS-PSK may left out it or use it |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
72 |
for any action (for example SUPL uses it to indicate the SUPL protocol version |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
73 |
and to present a list of allowed PSK generators). </info> |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
74 |
</substep> |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
75 |
<substep id="GUID-30DD1846-5C91-577A-9D1F-EE535A9B4DC2"><cmd>The TLS stack |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
76 |
on the client calls <xref href="GUID-1A7C31AC-B493-394E-BB9C-CB6F0DBAE6CF.dita"><apiname>ptrToKeyHandler->getPskL()</apiname></xref></cmd> |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
77 |
<info>The TLS stack on the client calls getPskL() for the instance of the |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
78 |
key handler (in this case ptrToKeyHandler). See <xref href="GUID-9580646B-FDFA-3515-B3CF-39B16880CF6F.dita#GUID-9580646B-FDFA-3515-B3CF-39B16880CF6F/GUID-0EC110F3-D2A6-3FD4-8E59-9E6F5741A61C"><apiname>MSoPskKeyHandler:: |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
79 |
GetPskL()</apiname></xref> for the prototype. This call returns the PSK identity |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
80 |
and value to be used to secure the connection. </info> |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
81 |
</substep> |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
82 |
<substep id="GUID-F52F987A-E500-5579-A5D4-E26F27F7390A"><cmd>The TLS stack |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
83 |
sends the PSK identity to the server.</cmd> |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
84 |
<info>The TLS stack sends the PSK identity (chosen in Step 2) to the server |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
85 |
so it can retrieve the matching PSK value to secure the connection. </info> |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
86 |
</substep> |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
87 |
</substeps> |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
88 |
<info>After the client has chosen which PSK to use, it sends an identity to |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
89 |
the server and the server can use this to obtain a matching PSK. Again the |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
90 |
meaning of the identity field is not specified, but its format must be UTF8. |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
91 |
An application may choose to use it or leave it empty. </info> |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
92 |
<info>Note: In the example, the server must select a PSK ciphersuite, because |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
93 |
the client provides only PSK ciphersuites. The connection fails, if the server |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
94 |
selects a PSK ciphersuite and fails to get a key that matches with the client. |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
95 |
The TLS assumes that the first common ciphersuite cannot fail and does not |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
96 |
implement connection retry. </info> |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
97 |
</step> |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
98 |
</steps> |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
99 |
<example><title>TLS_PSK example</title> <p>The following example code shows |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
100 |
how to configure TLS_PSK: </p> <codeblock id="GUID-61425E22-BD86-5913-BB16-55D933556969" xml:space="preserve"> |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
101 |
|
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
102 |
|
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
103 |
//Configure a PSK key handler |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
104 |
|
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
105 |
TPckgBuf<MSoPskKeyHandler *> pskConfigPkg; |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
106 |
pskConfigPkg() = ptrToKeyHandler; |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
107 |
User::LeaveIfError(secureSocket->SetOpt(KSoPskConfig, KSolInetSSL, pskConfigPkg)); |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
108 |
|
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
109 |
//set available ciphersuites |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
110 |
|
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
111 |
TBuf8<8> buf; |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
112 |
for(TInt i=0; i<4; ++i) |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
113 |
{ |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
114 |
// The supported PSK ciphersuites are as follows:- |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
115 |
// TLS_PSK_WITH_RC4_128_SHA = { 0x00, 0x8A }; |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
116 |
// TLS_PSK_WITH_3DES_EDE_CBC_SHA = { 0x00, 0x8B }; |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
117 |
// TLS_PSK_WITH_AES_128_CBC_SHA = { 0x00, 0x8C }; |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
118 |
// TLS_PSK_WITH_AES_256_CBC_SHA = { 0x00, 0x8D }; |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
119 |
buf[i*2]=0; |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
120 |
buf[i*2+1]=0x8a+i; |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
121 |
} |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
122 |
secureSocket->SetAvailableCipherSuites( buf ); |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
123 |
|
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
124 |
//Start a connection |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
125 |
|
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
126 |
secureSocket->StartClientHandshake( iStatus ); |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
127 |
|
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
128 |
</codeblock> </example> |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
diff
changeset
|
129 |
</taskbody></task> |