Struct Measurement
pub struct Measurement(/* private fields */);Expand description
An enclave measurement.
Get the current enclave measurement with [measurement].
Get the current signer measurement with [signer].
Implementations§
§impl Measurement
impl Measurement
pub const MOCK_ENCLAVE: Measurement
pub const MOCK_SIGNER: Measurement
pub const DEV_SIGNER: Measurement
pub const DEV_SIGNER: Measurement
The enclave signer measurement our debug enclaves are signed with. This is also the measurement of the fortanix/rust-sgx dummy key: https://github.com/fortanix/rust-sgx/blob/master/intel-sgx/enclave-runner/src/dummy.key
Running an enclave with run-sgx .. --debug will automatically sign
with this key just before running.
pub const PROD_SIGNER: Measurement
pub const PROD_SIGNER: Measurement
The enclave signer measurement our production enclaves should be signed
with. Inside an enclave, get the signer with [signer].
pub const fn expected_signer(use_sgx: bool, env: DeployEnv) -> Measurement
pub const fn expected_signer(use_sgx: bool, env: DeployEnv) -> Measurement
Return the expected signer measurement by [DeployEnv] and whether
we’re in mock or sgx mode.
pub fn compute_from_sgxs(sgxs_reader: impl Read) -> Result<Measurement, Error>
pub fn compute_from_sgxs(sgxs_reader: impl Read) -> Result<Measurement, Error>
Compute an enclave measurement from an .sgxs file stream
std::io::Read.
- Enclave binaries are first converted to
.sgxsfiles, which exactly mirror the memory layout of the loaded enclave binaries right before running. - Conveniently, the SHA-256 hash of an enclave
.sgxsbinary is exactly the same as the actual enclave measurement hash, since the memory layout is identical (caveat: unless we use some more sophisticated extendable enclave features).
pub const fn new(bytes: [u8; 32]) -> Measurement
pub fn short(&self) -> MrShort
Trait Implementations§
§impl AsRef<[u8]> for Measurement
impl AsRef<[u8]> for Measurement
§impl AsRef<[u8; 32]> for Measurement
impl AsRef<[u8; 32]> for Measurement
§impl ByteArray<32> for Measurement
impl ByteArray<32> for Measurement
fn from_array(array: [u8; 32]) -> Measurement
fn to_array(&self) -> [u8; 32]
fn as_array(&self) -> &[u8; 32]
fn from_array_ref(array: &[u8; N]) -> &Self
fn as_slice(&self) -> &[u8] ⓘ
fn to_vec(&self) -> Vec<u8> ⓘ
fn try_from_slice(slice: &[u8]) -> Result<Self, TryFromSliceError>
fn try_from_vec(vec: Vec<u8>) -> Result<Self, TryFromSliceError>
fn hex_display(&self) -> HexDisplay<'_>
fn try_from_hexstr(s: &str) -> Result<Self, DecodeError>
fn fmt_hexstr(&self, f: &mut Formatter<'_>) -> Result<(), Error>
§impl Clone for Measurement
impl Clone for Measurement
§fn clone(&self) -> Measurement
fn clone(&self) -> Measurement
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for Measurement
impl Debug for Measurement
§impl<'de> Deserialize<'de> for Measurement
impl<'de> Deserialize<'de> for Measurement
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Measurement, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Measurement, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
§impl Display for Measurement
impl Display for Measurement
§impl FromHex for Measurement
impl FromHex for Measurement
fn from_hex(s: &str) -> Result<Measurement, DecodeError>
§impl FromStr for Measurement
impl FromStr for Measurement
§impl Hash for Measurement
impl Hash for Measurement
§impl Ord for Measurement
impl Ord for Measurement
§impl PartialEq for Measurement
impl PartialEq for Measurement
§impl PartialOrd for Measurement
impl PartialOrd for Measurement
§impl RefCast for Measurement
impl RefCast for Measurement
type From = [u8; 32]
fn ref_cast(_from: &<Measurement as RefCast>::From) -> &Measurement
fn ref_cast_mut(_from: &mut <Measurement as RefCast>::From) -> &mut Measurement
§impl Serialize for Measurement
impl Serialize for Measurement
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl Copy for Measurement
impl Eq for Measurement
impl StructuralPartialEq for Measurement
Auto Trait Implementations§
impl Freeze for Measurement
impl RefUnwindSafe for Measurement
impl Send for Measurement
impl Sync for Measurement
impl Unpin for Measurement
impl UnwindSafe for Measurement
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.