Difference between revisions of "AMNet:Sign"

From 3dbrew
Jump to navigation Jump to search
(Created page with "=Request= {| class="wikitable" border="1" |- ! Index Word ! Description |- | 0 | Header code [0x08160146] |- | 1 |? Size 1 |- | 2 |? Size 2 |- | 3-4 | u64, ? |- | 5 |? Size...")
 
m
 
(One intermediate revision by one other user not shown)
Line 9: Line 9:
 
|-
 
|-
 
| 1
 
| 1
|? Size 1
+
|0x3C (Signature output size)
 
|-
 
|-
 
| 2
 
| 2
|? Size 2
+
|0x180 (Certificate output size)
 
|-
 
|-
 
| 3-4
 
| 3-4
| u64, ?
+
| u64, Title id
 
|-
 
|-
 
| 5
 
| 5
|? Size 3
+
|Data input size
 
|-
 
|-
 
| 6
 
| 6
| (? Size 3 << 4) <nowiki>|</nowiki> 0xA
+
| (Input size << 4) <nowiki>|</nowiki> 0xA
 
|-
 
|-
 
| 7
 
| 7
|? Input Pointer 3
+
|Data input pointer
 
|-
 
|-
 
| 8
 
| 8
| (? Size 1 << 4) <nowiki>|</nowiki> 0xC
+
| (0x3C << 4) <nowiki>|</nowiki> 0xC
 
|-
 
|-
 
| 9
 
| 9
|? Output Pointer 1
+
|Signature output pointer
 
|-
 
|-
 
| 10
 
| 10
| (? Size 2 << 4) <nowiki>|</nowiki> 0xC
+
| (0x180 << 4) <nowiki>|</nowiki> 0xC
 
|-
 
|-
 
| 11
 
| 11
|? Output Pointer 2
+
|Certificate output pointer
 
|}
 
|}
  
Line 52: Line 52:
 
|-
 
|-
 
| 2
 
| 2
|?
+
|AM internal error value (? Treated like an error value by NIM)
 
|}
 
|}
 +
 +
=Description=
 +
Wraps [[AMPXI:Sign]].
 +
 +
Signs given data with ECC, returning generated signature and [[Certificates|certificate]].
 +
 +
Certificate is signed with ECDSA with SHA256 and holds an ECC public key.
 +
Signed with the [[AMNet:GetDeviceCert|device certificate]].
 +
ECC public key on certificate appears to be randomly generated on call(?).
 +
 +
Used by NIM to sign a message that's not sent over SOAP, however the device certificate, output signature and output certificate of the message are.

Latest revision as of 21:39, 27 December 2021

Request[edit]

Index Word Description
0 Header code [0x08160146]
1 0x3C (Signature output size)
2 0x180 (Certificate output size)
3-4 u64, Title id
5 Data input size
6 (Input size << 4) | 0xA
7 Data input pointer
8 (0x3C << 4) | 0xC
9 Signature output pointer
10 (0x180 << 4) | 0xC
11 Certificate output pointer

Response[edit]

Index Word Description
0 Header code
1 Result code
2 AM internal error value (? Treated like an error value by NIM)

Description[edit]

Wraps AMPXI:Sign.

Signs given data with ECC, returning generated signature and certificate.

Certificate is signed with ECDSA with SHA256 and holds an ECC public key. Signed with the device certificate. ECC public key on certificate appears to be randomly generated on call(?).

Used by NIM to sign a message that's not sent over SOAP, however the device certificate, output signature and output certificate of the message are.