#include <revolution/nwc24.h>
#define NWC24_DL_PUBLICKEY_LENGTH (2048 / 8)
#define NWC24_DL_SECRETKEY_LENGTH (128 / 8)
NWC24Err NWC24SetDlKeys( const u8 publicKey[NWC24_DL_PUBLICKEY_LENGTH], const u8 secretKey[NWC24_DL_SECRETKEY_LENGTH] );
Specifies 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. Use the NWC24SetDlFlags function to enable specified keys for use.
A check must be made using the NANDCheck function in order to create the file (wc24pubk.mod) that contains a key to the home directory when executing for the first time.
The key file consumes 1 FS block and 1 i-node.
If a key has already been set (the key file exists), it will be overwritten by a new key. Only one public key and shared key can be set per one application.
To delete a key file, use the NWC24ClearDlKeys function. Key files are handled in the same way as save data. They will not automatically be deleted, even if tasks have been cleared.
publicKey |
Specifies 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.) If NULL is specified, the contents are zeroed out.
|
secretKey |
Specifies the shared secret key for the application. Specify NULL to zero-clear its contents.
|
NWC24_OK: Ended normally.
NWC24_ERR_LIB_NOT_OPENED: The library has not been opened.
NWC24_ERR_FILE_*: Error related to internal file operations.
NWC24_ERR_FATAL: A fatal error has occurred.
NWC24SetDlFlags, NWC24ClearDlKeys
2008/08/20 Added indication that there is one key per application, and that it is not automatically deleted.
2007/12/21 Corrected mistake in function declaration.
2007/07/13 Initial version
CONFIDENTIAL