pub struct DeviceSignature(/* private fields */);Expand description
Public types of device identity.
Device identity lives in qualia_dik — an independent, reusable crate that any
project needing “a pair of P-256 identity keys in platform hardware” can use
without accepting this crate’s vault format or sync protocol. They are re-exported
here so that downstream code does not have to depend on both crates.
DevicePublicKey and DeviceSignature are not secret — they are meant to be
printed on QR codes, written to logs, and propagated between devices — so they are
exported separately from the secret types, which makes it visible in an import
list which types may be printed freely.
设备身份签名(ECDSA P-256 原始 r||s,64 字节)。
Implementations§
Source§impl DeviceSignature
impl DeviceSignature
Sourcepub fn from_bytes(bytes: &[u8]) -> Result<DeviceSignature, Error>
pub fn from_bytes(bytes: &[u8]) -> Result<DeviceSignature, Error>
从原始 r||s 构造。
不在这里做范围校验:r/s 必须是 [1, n-1] 内的整数这一约束由
验签负责,而验签本来就要重新计算并比对,重复一次没有意义。构造这个
类型只是说「这 64 个字节声称是一个签名」。
§错误
长度不是 64 字节时返回 Error::DeviceSignatureInvalid。
Trait Implementations§
Source§impl Clone for DeviceSignature
impl Clone for DeviceSignature
Source§fn clone(&self) -> DeviceSignature
fn clone(&self) -> DeviceSignature
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more