pub enum SerialSource {
Stored(SlotAddress),
DeviceSerial,
SignerId,
PubKeyHash,
DeviceSerialHash,
}Expand description
Source of certificate serial number
Variants§
Stored(SlotAddress)
Serial is stored in a Data08 block on the device
DeviceSerial
Serial is 0x40 | device_sn[0..9] (device certificates only)
SignerId
Serial is 0x40 | signer_id[0..2] (signer certificates only)
PubKeyHash
Serial is SHA256(subject public key + encoded dates) with upper 2 bits = 01
DeviceSerialHash
Serial is SHA256(device SN + encoded dates) with upper 2 bits = 01
Implementations§
Source§impl SerialSource
impl SerialSource
Sourcepub fn generate<'a>(
&self,
device_serial: &Serial,
signer_id: u16,
output: &'a mut [u8; 16],
) -> Result<&'a [u8], Error>
pub fn generate<'a>( &self, device_serial: &Serial, signer_id: u16, output: &'a mut [u8; 16], ) -> Result<&'a [u8], Error>
Generate serial number into provided buffer.
Returns the slice of the buffer containing the serial number.
Stored variants cannot be generated — they are read from the
device by Memory::read_certificate transparently.
Trait Implementations§
Source§impl Clone for SerialSource
impl Clone for SerialSource
impl Copy for SerialSource
Source§impl Debug for SerialSource
impl Debug for SerialSource
impl Eq for SerialSource
Source§impl PartialEq for SerialSource
impl PartialEq for SerialSource
impl StructuralPartialEq for SerialSource
Auto Trait Implementations§
impl Forget for SerialSource
impl Freeze for SerialSource
impl Move for SerialSource
impl RefUnwindSafe for SerialSource
impl Send for SerialSource
impl Sync for SerialSource
impl Unpin for SerialSource
impl UnsafeUnpin for SerialSource
impl UnwindSafe for SerialSource
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more