Struct enclave_runner::EnclaveBuilder

source ·
pub struct EnclaveBuilder<'a> { /* private fields */ }

Implementations§

source§

impl<'a> EnclaveBuilder<'a>

source

pub fn new(enclave_path: &'a Path) -> EnclaveBuilder<'a>

source

pub fn new_from_memory(enclave_data: &'a [u8]) -> EnclaveBuilder<'a>

source

pub fn dummy_signature(&mut self) -> &mut Self

source

pub fn with_dummy_signature_signer<H, S, F, E, T>(&mut self, load_key: F)
where H: SgxHashOps, E: Error + Send + Sync + 'static, S: SgxRsaOps<Error = E>, T: AsRef<S>, F: 'static + FnOnce(&[u8]) -> T,

Use custom implemetations of SgxHashOps and SgxRsaOps for producing dummy signature.

The hasher is specified through type parameter H, and the signer through S. load_key is used to parse an RSA private key in DER format and should return a type T that implements AsRef<S> where S is a type that implements SgxRsaOps. E is the associated Error type of S when implementing SgxRsaOps.

source

pub fn coresident_signature(&mut self) -> IoResult<&mut Self>

source

pub fn signature<P: AsRef<Path>>(&mut self, path: P) -> IoResult<&mut Self>

source

pub fn sigstruct(&mut self, sigstruct: Sigstruct) -> &mut Self

source

pub fn attributes(&mut self, attributes: Attributes) -> &mut Self

source

pub fn miscselect(&mut self, miscselect: Miscselect) -> &mut Self

source

pub fn usercall_extension<T: Into<Box<dyn UsercallExtension>>>( &mut self, extension: T )

source

pub fn forward_panics(&mut self, fp: bool) -> &mut Self

Whether to panic the runner if any enclave thread panics. Defaults to false. Note: If multiple enclaves are loaded, and an enclave with this set to true panics, then all enclaves handled by this runner will exit because the runner itself will panic.

source

pub fn args<I, S>(&mut self, args: I) -> &mut Self
where I: IntoIterator<Item = S>, S: AsRef<[u8]>,

Adds multiple arguments to pass to enclave’s fn main. NOTE: This is not an appropriate channel for passing secrets or security configurations to the enclave.

NOTE: This is only applicable to Command enclaves. Adding command arguments and then calling build_library will cause a panic.

source

pub fn arg<S: AsRef<[u8]>>(&mut self, arg: S) -> &mut Self

Adds an argument to pass to enclave’s fn main. NOTE: This is not an appropriate channel for passing secrets or security configurations to the enclave.

NOTE: This is only applicable to Command enclaves. Adding command arguments and then calling build_library will cause a panic.

source

pub fn build<T: Load>(self, loader: &mut T) -> Result<Command, Error>

source

pub fn build_library<T: Load>(self, loader: &mut T) -> Result<Library, Error>

Panics if you have previously called arg or args.

Auto Trait Implementations§

§

impl<'a> Freeze for EnclaveBuilder<'a>

§

impl<'a> !RefUnwindSafe for EnclaveBuilder<'a>

§

impl<'a> !Send for EnclaveBuilder<'a>

§

impl<'a> !Sync for EnclaveBuilder<'a>

§

impl<'a> Unpin for EnclaveBuilder<'a>

§

impl<'a> !UnwindSafe for EnclaveBuilder<'a>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.