1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<HTML>
3<HEAD>
4<META http-equiv="Content-Type" content="text/html; charset=windows-1252">
5<META http-equiv="Content-Style-Type" content="text/css">
6<TITLE>NWC24SetDlKeys</TITLE>
7<LINK rel="stylesheet" type="text/css" href="../../CSS/revolution.css">
8<LINK rel="stylesheet" type="text/css" href="../nwc24.css">
9</HEAD>
10<BODY>
11<H1>NWC24SetDlKeys</H1>
12
13<H2>C Specification</H2>
14<DL>
15<DD><PRE><CODE>#include &lt;revolution/nwc24.h&gt;</CODE></PRE>
16<DD><PRE><CODE>#define NWC24_DL_PUBLICKEY_LENGTH               (2048 / 8)
17#define NWC24_DL_SECRETKEY_LENGTH               (128 / 8)
18
19<A HREF="../Types/NWC24Err.html">NWC24Err</A> NWC24SetDlSecretKey( const u8 <VAR>publicKey[NWC24_DL_PUBLICKEY_LENGTH]</VAR>, const u8 <VAR>secretKey[NWC24_DL_SECRETKEY_LENGTH]</VAR> );</CODE></PRE>
20</DL>
21
22<H2>Description</H2>
23<P>
24Specifies the RSA public key that the application will use for signature verification as well as the AES shared key for decryption. The specified key will not be used merely by calling this function. Specified keys should be set for use with <A href="NWC24SetDlFlags.html"><CODE>NWC24SetDlFlags()</CODE></A>.
25<P>
26The first time the function executes, it creates a file with a 2KB maximum size in the Home directory that can be confirmed using <CODE>NANDCheck</CODE>.<BR>
27</P>
28
29<H2>Arguments</H2>
30<TABLE border="1" cellpadding="3" cellspacing="0.1" class="argument">
31  <TR>
32<TD class="name"><code><VAR>taskPublic</VAR></code></TD>
33    <TD class="description">
34Pointer to the download task.
35    </TD>
36  </TR>
37  <TR>
38<TD class="name"><code><VAR>publicKey</VAR></code></TD>
39    <TD class="description">
40Specifies the public key for the application. Do not directly specify in ASN.1 format. Rather, use only the 2048-bit public coefficient portion. (Takes the ASN.1 format if created with OpenSSL.)<BR>If <CODE>NULL</CODE> is specified, the contents are zeroed out.
41    </TD>
42  </TR>
43  <TR>
44<TD class="name"><code><VAR>secretKey</VAR></code></TD>
45    <TD class="description">
46Specifies the shared secret key for the application. When <CODE>NULL<CODE> is specified, the content is zeroed out.
47    </TD>
48  </TR>
49</TABLE>
50
51<h2>Return Values</h2>
52<P>
53<code>NWC24_OK</code>: Ended normally.<BR> <code>NWC24_ERR_LIB_NOT_OPENED</code>: The library has not been opened.<BR> <code>NWC24_ERR_FILE_*</code>: Error related to internal file operations.<BR> <code>NWC24_ERR_FATAL</code>: A fatal error has occurred.<BR>
54</P>
55
56<H2>See Also</H2>
57<P>
58</P>
59
60<H2>Revision History</H2>
61<P>
622007/07/13 Initial version.
63</P>
64
65<hr><p>CONFIDENTIAL</p></body>
66</HTML>