Struct tss2_fapi_rs::SignCallback
pub struct SignCallback { /* private fields */ }
Expand description
A callback function that allows the FAPI to request signatures.
Signatures are requested for authorizing TPM objects.
Registered to a FAPI context via the set_sign_callback()
function.
Implementations§
§impl SignCallback
impl SignCallback
pub fn new(
sign_fn: impl Fn(SignCallbackParam<'_>) -> Option<Vec<u8>> + 'static + Send,
) -> Self
pub fn new( sign_fn: impl Fn(SignCallbackParam<'_>) -> Option<Vec<u8>> + 'static + Send, ) -> Self
Creates a new callback instance.
The supplied sign_fn
will be called whenever the FAPI requests a signature from the application. The purpose of this signature is to authorize a policy execution containing a PolicySigned element. This function receives a SignCallbackParam
as parameter; it shall return Some(value)
, if a signature value is provided by the application, or None
, if no signature value is provided.
pub fn with_data<T: 'static + Send>(
sign_fn: impl Fn(SignCallbackParam<'_>, &T) -> Option<Vec<u8>> + 'static + Send,
extra_data: T,
) -> Self
pub fn with_data<T: 'static + Send>( sign_fn: impl Fn(SignCallbackParam<'_>, &T) -> Option<Vec<u8>> + 'static + Send, extra_data: T, ) -> Self
Creates a new callback instance with additional data.
The supplied sign_fn
will be called whenever the FAPI requests a signature from the application. The purpose of this signature is to authorize a policy execution containing a PolicySigned element. This function receives a SignCallbackParam
as parameter; it shall return Some(value)
, if a signature value is provided by the application, or None
, if no signature value is provided.
The application-defined extra_data
argument will be passed to each invocation of sign_fn
as an additional parameter.