pub struct DeviceKey(/* private fields */);Expand description
The P-256 public key the Attestation Gateway attested, from the token’s cnf.jwk.
Implementations§
Source§impl DeviceKey
impl DeviceKey
Sourcepub const fn new(key: VerifyingKey) -> Self
pub const fn new(key: VerifyingKey) -> Self
Wraps a P-256 verifying key.
Sourcepub const fn verifying_key(&self) -> &VerifyingKey
pub const fn verifying_key(&self) -> &VerifyingKey
The underlying P-256 verifying key.
Sourcepub fn thumbprint(&self) -> String
pub fn thumbprint(&self) -> String
The RFC 7638 JWK thumbprint (base64url SHA-256): a stable identifier for this device key, for example to rate limit on.
Sourcepub fn verify(
&self,
platform: Platform,
client_data_hash: &[u8; 32],
signature: &[u8],
) -> Result<(), PlatformSignatureError>
pub fn verify( &self, platform: Platform, client_data_hash: &[u8; 32], signature: &[u8], ) -> Result<(), PlatformSignatureError>
Verifies a platform signature over client_data_hash, which is SHA-256(signature base).
Android keys sign the hash directly. App Attest signs SHA-256(authenticatorData ‖ clientDataHash) and wraps the signature in a CBOR assertion. The rpId and counter inside
authenticatorData are not checked: App Attest keys are app-scoped, the Attestation
Gateway verified the app when it attested this key, and freshness comes from created.
§Errors
Returns a PlatformSignatureError when the signature is malformed or does not verify.
Trait Implementations§
impl Eq for DeviceKey
impl StructuralPartialEq for DeviceKey
Auto Trait Implementations§
impl Freeze for DeviceKey
impl RefUnwindSafe for DeviceKey
impl Send for DeviceKey
impl Sync for DeviceKey
impl Unpin for DeviceKey
impl UnsafeUnpin for DeviceKey
impl UnwindSafe for DeviceKey
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.