| 184 | }; |
| 185 | |
| 186 | CredentialBinding::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 | |
| 206 | bytes |
| 207 | CredentialBinding::to_be_signed(const SignaturePublicKey& signature_key) const |
nothing calls this directly
no test coverage detected