pub fn new(
        identity: Vec<u8>,
        credential_type: CredentialType,
        signature_scheme: SignatureScheme,
        backend: &impl OpenMlsCryptoProvider,
    ) -> Result<Self, CredentialError> {
        let (private_key, public_key) =
            SignatureKeypair::new(signature_scheme, backend)?.into_tuple();
        let mls_credential = match credential_type {
            CredentialType::Basic => BasicCredential {
                identity: identity.into(),
                signature_scheme,
                public_key,
            },
            _ => return Err(CredentialError::UnsupportedCredentialType),
        };
        let credential = Credential {
            credential_type,
            credential: MlsCredentialType::Basic(mls_credential),
        };
        Ok(CredentialBundle {
            credential,
            signature_private_key: private_key,
        })
    }
/// Create a new `CredentialBundle` of the given credential type for the
/// given identity and ciphersuite. The corresponding `SignatureKeyPair` is
/// freshly generated.
Create a new `CredentialBundle` of the given credential type for the
given identity and ciphersuite. The corresponding `SignatureKeyPair` is
freshly generated.
Create a new ` CredentialBundle ` of the given credential type for the given identity and ciphersuite . The corresponding ` SignatureKeyPair ` is freshly generated .
pub fn new(
        identity: Vec<u8>,
        credential_type: CredentialType,
        signature_scheme: SignatureScheme,
        backend: &impl OpenMlsCryptoProvider,
    ) -> Result<Self, CredentialError> {
        let (private_key, public_key) =
            SignatureKeypair::new(signature_scheme, backend)?.into_tuple();
        let mls_credential = match credential_type {
            CredentialType::Basic => BasicCredential {
                identity: identity.into(),
                signature_scheme,
                public_key,
            },
            _ => return Err(CredentialError::UnsupportedCredentialType),
        };
        let credential = Credential {
            credential_type,
            credential: MlsCredentialType::Basic(mls_credential),
        };
        Ok(CredentialBundle {
            credential,
            signature_private_key: private_key,
        })
    }
pub fn new ( identity : Vec < u8 > , credential_type : CredentialType , signature_scheme : SignatureScheme , backend : & impl OpenMlsCryptoProvider , ) -> Result < Self , CredentialError > { let ( private_key , public_key ) = SignatureKeypair :: new ( signature_scheme , backend ) ? . into_tuple ( ) ; let mls_credential = match credential_type { CredentialType :: Basic => BasicCredential { identity : identity . into ( ) , signature_scheme , public_key , } , _ => return Err ( CredentialError :: UnsupportedCredentialType ) , } ; let credential = Credential { credential_type , credential : MlsCredentialType :: Basic ( mls_credential ) , } ; Ok ( CredentialBundle { credential , signature_private_key : private_key , } ) }
Create a new `CredentialBundle` of the given credential type for the
given identity and ciphersuite.
Create a new ` CredentialBundle ` of the given credential type for the given identity and ciphersuite .
identity
Vec<u8>
credential_type
CredentialType
signature_scheme
SignatureScheme
backend
&impl OpenMlsCryptoProvider
identity
Vec<u8>
credential_type
CredentialType
signature_scheme
SignatureScheme
backend
&impl OpenMlsCryptoProvider