diff options
author | lloyd <[email protected]> | 2009-10-13 11:07:08 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2009-10-13 11:07:08 +0000 |
commit | 8f95a003ad84d28132c1753243a074fd22d2463c (patch) | |
tree | 420428cbad4bac6f2d292b95a86cb3ae3322213c | |
parent | 87e25c7e270a52fda8c39296be01918bb6aa75d6 (diff) |
Document rng& argument to PKCS8::load_key
-rw-r--r-- | doc/api.tex | 13 | ||||
-rw-r--r-- | doc/tutorial.tex | 4 |
2 files changed, 14 insertions, 3 deletions
diff --git a/doc/api.tex b/doc/api.tex index d86fa79e2..556e76aa0 100644 --- a/doc/api.tex +++ b/doc/api.tex @@ -1360,12 +1360,18 @@ private key: \begin{verbatim} namespace PKCS8 { - PKCS8_PrivateKey* load_key(DataSource& in, const User_Interface& ui); - PKCS8_PrivateKey* load_key(DataSource& in, std::string passphrase = ""); + PKCS8_PrivateKey* load_key(DataSource& in, + RandomNumberGenerator& rng, + const User_Interface& ui); + PKCS8_PrivateKey* load_key(DataSource& in, + RandomNumberGenerator& rng, + std::string passphrase = ""); PKCS8_PrivateKey* load_key(const std::string& filename, + RandomNumberGenerator& rng, const User_Interface& ui); PKCS8_PrivateKey* load_key(const std::string& filename, + RandomNumberGenerator& rng, const std::string& passphrase = ""); } \end{verbatim} @@ -1384,6 +1390,9 @@ using. You can think of it as a user interface interface. The default \type{User\_Interface} is actually very dumb, and effectively acts just like the versions taking the \type{std::string}. +All versions need access to a \type{RandomNumberGenerator} in order to +perform probabilistic tests on the loaded key material. + After loading a key, you can use \function{dynamic\_cast} to find out what operations it supports, and use it appropriately. Remember to \function{delete} it once you are done with it. diff --git a/doc/tutorial.tex b/doc/tutorial.tex index 244461994..9229cb853 100644 --- a/doc/tutorial.tex +++ b/doc/tutorial.tex @@ -626,9 +626,11 @@ This is very similar to reading raw public keys, with the difference that the key may be encrypted with a user passphrase: \begin{verbatim} + // rng is a RandomNumberGenerator, like AutoSeeded_RNG + DataSource_Stream somefile("somefile"); std::string a_passphrase = /* get from the user */ - PKCS8_PrivateKey* key = PKCS8::load_key(somefile, a_passphrase); + PKCS8_PrivateKey* key = PKCS8::load_key(somefile, rng, a_passphrase); \end{verbatim} You can, by the way, convert a \type{PKCS8\_PrivateKey} to a |