pub struct PathInitializer;
Expand description
Initialization of the paths for the quoting enclaves and quote provider library
This should only be called once during process start up utilizing
PathInitializer::with_paths()
or PathInitializer::try_default()
.
If a consumer of this crate does not explicitly initialize the paths, then
they will be defaulted on the first call to an SGX function that needs the
paths set.
Implementations§
Source§impl PathInitializer
impl PathInitializer
Sourcepub fn try_default() -> Result<(), Error>
pub fn try_default() -> Result<(), Error>
Try to initialize the paths to the default for the system
Currently the defaults assume the default DCAP install on an Ubuntu machine.
§Errors
Error::PathsInitialized
if the paths have been previously initialized.Error::QuoteLibrary
if any of the default paths don’t exist on the system.
Sourcepub fn with_paths<P1, P2, P3, P4>(
quoting_enclave: P1,
provisioning_certificate_enclave: P2,
quote_provider_library: Option<P3>,
id_enclave: P4,
) -> Result<(), Error>
pub fn with_paths<P1, P2, P3, P4>( quoting_enclave: P1, provisioning_certificate_enclave: P2, quote_provider_library: Option<P3>, id_enclave: P4, ) -> Result<(), Error>
Initialize the DCAP quoting library paths with provided values
§Arguments
quoting_enclave
- The full file path to the quoting enclaveprovisioning_certificate_enclave
- The full file path to the provisioning certificate enclavequote_provider_library
- The full file path to the quote provider library. When this isNone
then no quote provider library will be used limiting quote generation to local quote generation only.id_enclave
- The full file path to the ID enclave.
§Errors
Error::PathsInitialized
if the paths have been previously initialized.Error::PathStringConversion
if one of the paths cannot be converted to aCString
Error::QuoteLibrary
if- one of the paths does not point to a file
- one of the paths is longer than 259 (bytes)
- one of the paths contains a null (0) byte.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PathInitializer
impl RefUnwindSafe for PathInitializer
impl Send for PathInitializer
impl Sync for PathInitializer
impl Unpin for PathInitializer
impl UnwindSafe for PathInitializer
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