aboutsummaryrefslogtreecommitdiffstats
path: root/doc/examples/ecdsa.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'doc/examples/ecdsa.cpp')
-rw-r--r--doc/examples/ecdsa.cpp19
1 files changed, 13 insertions, 6 deletions
diff --git a/doc/examples/ecdsa.cpp b/doc/examples/ecdsa.cpp
index 1c1715f1b..83cdad967 100644
--- a/doc/examples/ecdsa.cpp
+++ b/doc/examples/ecdsa.cpp
@@ -8,13 +8,20 @@ using namespace Botan;
int main()
{
- std::auto_ptr<RandomNumberGenerator> rng(RandomNumberGenerator::make_rng());
+ try
+ {
+ std::auto_ptr<RandomNumberGenerator> rng(
+ RandomNumberGenerator::make_rng());
- EC_Domain_Params params = get_EC_Dom_Pars_by_oid("1.3.132.8");
+ EC_Domain_Params params = get_EC_Dom_Pars_by_oid("1.3.132.8");
- std::cout << params.get_curve().get_p() << "\n";
- std::cout << params.get_order() << "\n";
-
- ECDSA_PrivateKey ecdsa(*rng, params);
+ std::cout << params.get_curve().get_p() << "\n";
+ std::cout << params.get_order() << "\n";
+ ECDSA_PrivateKey ecdsa(*rng, params);
+ }
+ catch(std::exception& e)
+ {
+ std::cout << e.what() << "\n";
+ }
}