pub trait CredentialHolder: Send + Sync {
// Required methods
fn sig_type(&self) -> &'static str;
fn reserve_size(&self) -> usize;
fn sign<'life0, 'life1, 'async_trait>(
&'life0 self,
signer_payload: &'life1 SignerPayload,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, IdentityBuilderError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}
Expand description
An implementation of CredentialHolder
is able to generate a signature over
the SignerPayload
data structure on behalf of a credential holder.
Implementations of this trait will specialize based on the kind of credential as specified in §8. Credentials, signatures, and validation methods from the CAWG Identity Assertion specification.
Required Methods§
Sourcefn sig_type(&self) -> &'static str
fn sig_type(&self) -> &'static str
Returns the designated sig_type
value for this kind of credential.
Sourcefn reserve_size(&self) -> usize
fn reserve_size(&self) -> usize
Returns the maximum expected size in bytes of the signature
field for the identity assertion which will be subsequently
returned by the sign
function. Signing will fail if the
subsequent signature is larger than this number of bytes.
Sourcefn sign<'life0, 'life1, 'async_trait>(
&'life0 self,
signer_payload: &'life1 SignerPayload,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, IdentityBuilderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn sign<'life0, 'life1, 'async_trait>(
&'life0 self,
signer_payload: &'life1 SignerPayload,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, IdentityBuilderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Signs the SignerPayload
data structure on behalf of the credential
holder.
If successful, returns the exact binary content to be placed in
the signature
field for this identity assertion.
The signature MUST NOT be larger than the size previously stated
by the reserve_size
function.