MCPcopy Create free account
hub / github.com/brainboxdotcc/DPP / CredentialBinding

Method CredentialBinding

mlspp/src/credential.cpp:186–204  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

184};
185
186CredentialBinding::CredentialBinding(CipherSuite cipher_suite_in,
187 Credential credential_in,
188 const SignaturePrivateKey& credential_priv,
189 const SignaturePublicKey& signature_key)
190 : cipher_suite(cipher_suite_in)
191 , credential(std::move(credential_in))
192 , credential_key(credential_priv.public_key)
193{
194 if (credential.type() == CredentialType::multi_draft_00) {
195 throw InvalidParameterError("Multi-credentials cannot be nested");
196 }
197
198 if (!credential.valid_for(credential_key)) {
199 throw InvalidParameterError("Credential key does not match credential");
200 }
201
202 signature = credential_priv.sign(
203 cipher_suite, sign_label::multi_credential, to_be_signed(signature_key));
204}
205
206bytes
207CredentialBinding::to_be_signed(const SignaturePublicKey& signature_key) const

Callers

nothing calls this directly

Calls 4

valid_forMethod · 0.80
typeMethod · 0.45
signMethod · 0.45

Tested by

no test coverage detected