1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
//! The device-key interface: signing happens outside the core, so hardware and
//! async keystores fit. The core asks with `Output::NeedDeviceSignature { request, message }`
//! (or a [`crate::SignRequest`]) and takes the raw `r‖s` signature (IEEE P1363, 64 bytes).
use fmt;
use Signer as _;
use ;
use ;
use Zeroizing;
/// A platform device key (P-256, non-exportable where the platform allows; no user-presence
/// requirement).
/// A software P-256 device key: the private scalar lives in this process's memory (zeroized on
/// drop) and [`SoftwareSigner::to_bytes`] exports it. It is not hardware-backed, so it gives none
/// of a platform keystore's protection: use it where no platform key is available (a native host
/// may persist it in the OS credential store, as `sew-call-client` does) and in tests. Prefer a
/// platform [`DeviceSigner`] where one exists.