pub struct Security<P: CheckedPermissions> { /* private fields */ }Implementations§
Source§impl<P: CheckedPermissions> Security<P>
impl<P: CheckedPermissions> Security<P>
Sourcepub fn set_seed_and_pin(
&self,
seed: Seed,
pin: String,
pin_entry: PinEntryMode,
) -> Result<(), PinError>where
P: MessageAllowed<SetSeedAndPin>,
pub fn set_seed_and_pin(
&self,
seed: Seed,
pin: String,
pin_entry: PinEntryMode,
) -> Result<(), PinError>where
P: MessageAllowed<SetSeedAndPin>,
User does not need to be logged in. Use this when setting the seed and PIN for the first time.
Sourcepub fn change_pin(
&self,
raw_pin: String,
seed: Option<Seed>,
pin_entry: PinEntryMode,
) -> Result<(), PinError>where
P: MessageAllowed<ChangePin>,
pub fn change_pin(
&self,
raw_pin: String,
seed: Option<Seed>,
pin_entry: PinEntryMode,
) -> Result<(), PinError>where
P: MessageAllowed<ChangePin>,
User must be logged in to set a new pin.
pub fn is_pin_set(&self) -> Result<bool, AccessDenied>where
P: MessageAllowed<IsPinSet>,
pub fn get_pin_entry_mode(&self) -> PinEntryModewhere
P: MessageAllowed<GetPinEntryMode>,
pub fn log_in(&self, pin: String) -> Result<(), LoginFailed>where
P: MessageAllowed<Login>,
pub fn log_out(&self)where
P: MessageAllowed<Logout>,
pub fn logged_in(&self) -> boolwhere
P: MessageAllowed<LoggedIn>,
pub fn attempts_remaining(&self) -> Result<u32, AccessDenied>where
P: MessageAllowed<GetAttemptsRemaining>,
pub fn factory_reset_counter(&self) -> Result<u32, AccessDenied>where
P: MessageAllowed<GetFactoryResetCounter>,
Sourcepub fn seed(&self) -> Result<Option<Seed>, AccessDenied>where
P: MessageAllowed<GetSeed>,
pub fn seed(&self) -> Result<Option<Seed>, AccessDenied>where
P: MessageAllowed<GetSeed>,
Sourcepub fn set_seed(&self, seed: Seed) -> Result<(), AccessDenied>where
P: MessageAllowed<SetSeed>,
pub fn set_seed(&self, seed: Seed) -> Result<(), AccessDenied>where
P: MessageAllowed<SetSeed>,
User must be logged in to change the seed. This is because a XOR operation will be performed between the seed and the PIN hash before storing it in the SE.
In case the user is setting the seed for the first time, use SetSeedAndPin instead.
pub fn app_seed(&self) -> Result<[u8; 32], AccessDenied>where
P: MessageAllowed<GetAppSeed>,
pub fn lockout(
&self,
lockout_options: LockoutOptions,
) -> Result<(), AccessDenied>where
P: MessageAllowed<Lockout>,
pub fn sign_with_security_check_key(
&self,
data: [u8; 32],
) -> Result<[u8; 64], AccessDenied>where
P: MessageAllowed<SignWithSecurityCheckKey>,
pub fn sign_with_fido_key(
&self,
data: [u8; 32],
) -> Result<[u8; 64], AccessDenied>where
P: MessageAllowed<SignWithFidoKey>,
pub fn get_fido_pubkey(&self) -> Result<[u8; 64], AccessDenied>where
P: MessageAllowed<GetFidoPubkey>,
pub fn security_words(
&self,
pin_prefix: &str,
) -> Result<[SecurityWord; 2], AccessDenied>where
P: MessageAllowed<GetSecurityWords>,
pub fn firmware_timestamp(&self) -> Result<FirmwareTimestamp, AccessDenied>where
P: MessageAllowed<GetFirmwareTimestamp>,
pub fn set_firmware_timestamp(
&self,
timestamp: FirmwareTimestamp,
) -> Result<(), AccessDenied>where
P: MessageAllowed<SetFirmwareTimestamp>,
pub fn seed_fingerprint(&self) -> Result<[u8; 32], AccessDenied>where
P: MessageAllowed<GetSeedFingerprint>,
pub fn fingerprint(&self, seed: &Seed) -> Result<[u8; 32], AccessDenied>where
P: MessageAllowed<ComputeSeedFingerprint>,
pub fn os_version_info(&self) -> Result<Option<OsVersionInfo>, AccessDenied>where
P: MessageAllowed<GetOsVersionInfo>,
pub fn bootloader_build_date(&self) -> Result<Option<u64>, AccessDenied>where
P: MessageAllowed<GetBootloaderBuildDate>,
pub fn sc_challenge(
&self,
challenge: [u8; 104],
) -> Result<ScProof, ScChallengeError>where
P: MessageAllowed<ScChallenge>,
pub fn device_id(&self) -> Result<DeviceId, GetDeviceIdError>where
P: MessageAllowed<GetDeviceId>,
pub fn get_random(&self) -> Result<[u8; 32], AccessDenied>where
P: MessageAllowed<GetRandom>,
pub fn keycard_authenticity_mac(
&self,
msg: [u8; 32],
) -> Result<[u8; 32], AccessDenied>where
P: MessageAllowed<KeycardAuthenticityMac>,
pub fn get_pin(&self) -> Stringwhere
P: MessageAllowed<GetPin>,
pub fn set_attempts_remaining(&self, attempts: u32) -> Result<(), SecurityError>where
P: MessageAllowed<SetAttempts>,
Sourcepub fn bluetooth_challenge_secret(&self) -> BluetoothChallengeSecretwhere
P: MessageAllowed<GetBluetoothChallengeSecret>,
pub fn bluetooth_challenge_secret(&self) -> BluetoothChallengeSecretwhere
P: MessageAllowed<GetBluetoothChallengeSecret>,
Get the bluetooth HMAC challenge secret and whether it was shared with the BT chip already.
pub fn set_bluetooth_challenge_secret_sent(&self)where
P: MessageAllowed<SetBluetoothCheckSecretSent>,
pub fn set_bluetooth_device_id(&self, device_id: [u8; 8])where
P: MessageAllowed<SetBluetoothDeviceId>,
pub fn master_key_state(&self) -> MasterKeyStatewhere
P: MessageAllowed<GetMasterKeyState>,
Sourcepub fn subscribe_disk_encryption_keys_ready<SR>(
&self,
context: &mut ServerContext<SR>,
)
pub fn subscribe_disk_encryption_keys_ready<SR>( &self, context: &mut ServerContext<SR>, )
Subscribe to the DiskEncryptionKeysReady event. The event fires once, when the security server
has written disk encryption keys into SECURAM. Subscribers that arrive after the event has already
fired receive it immediately on subscription.
Trait Implementations§
Auto Trait Implementations§
impl<P> Freeze for Security<P>
impl<P> RefUnwindSafe for Security<P>
impl<P> Send for Security<P>
impl<P> Sync for Security<P>
impl<P> Unpin for Security<P>
impl<P> UnwindSafe for Security<P>
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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
§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Returns the layout of the type.