diff --git a/include/jwt-cpp/jwt.h b/include/jwt-cpp/jwt.h index 4dac8f7..65f21c2 100644 --- a/include/jwt-cpp/jwt.h +++ b/include/jwt-cpp/jwt.h @@ -337,16 +337,16 @@ namespace jwt { if (!private_key.empty()) { std::unique_ptr privkey_bio(BIO_new(BIO_s_mem()), BIO_free_all); if ((size_t)BIO_write(privkey_bio.get(), private_key.data(), private_key.size()) != private_key.size()) - throw rsa_exception("failed to load private key: bio_write failed"); + throw ecdsa_exception("failed to load private key: bio_write failed"); pkey.reset(PEM_read_bio_ECPrivateKey(privkey_bio.get(), nullptr, nullptr, const_cast(private_key_password.c_str())), EC_KEY_free); if (!pkey) - throw rsa_exception("failed to load private key: PEM_read_bio_ECPrivateKey failed"); + throw ecdsa_exception("failed to load private key: PEM_read_bio_ECPrivateKey failed"); size_t keysize = EC_GROUP_get_degree(EC_KEY_get0_group(pkey.get())); if(keysize != signature_length*4 && (signature_length != 132 || keysize != 521)) throw ecdsa_exception("invalid key size"); } if(!pkey) - throw rsa_exception("at least one of public or private key need to be present"); + throw ecdsa_exception("at least one of public or private key need to be present"); if(EC_KEY_check_key(pkey.get()) == 0) throw ecdsa_exception("failed to load key: key is invalid");