aboutsummaryrefslogtreecommitdiffstats
path: root/src/pubkey/if_algo/if_algo.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/pubkey/if_algo/if_algo.h')
-rw-r--r--src/pubkey/if_algo/if_algo.h39
1 files changed, 32 insertions, 7 deletions
diff --git a/src/pubkey/if_algo/if_algo.h b/src/pubkey/if_algo/if_algo.h
index c58b2cb8f..7afd7fed5 100644
--- a/src/pubkey/if_algo/if_algo.h
+++ b/src/pubkey/if_algo/if_algo.h
@@ -12,15 +12,25 @@
namespace Botan {
-/*************************************************
-* IF Public Key *
-*************************************************/
+/**
+* This class represents public keys
+* of integer factorization based (IF) public key schemes.
+*/
class BOTAN_DLL IF_Scheme_PublicKey : public virtual Public_Key
{
public:
bool check_key(RandomNumberGenerator& rng, bool) const;
+ /**
+ * Get n = p * q.
+ * @return n
+ */
const BigInt& get_n() const { return n; }
+
+ /**
+ * Get the public exponent used by the key.
+ * @return the public exponent
+ */
const BigInt& get_e() const { return e; }
u32bit max_input_bits() const { return (n.bits() - 1); }
@@ -33,17 +43,32 @@ class BOTAN_DLL IF_Scheme_PublicKey : public virtual Public_Key
IF_Core core;
};
-/*************************************************
-* IF Private Key *
-*************************************************/
+/**
+* This class represents public keys
+* of integer factorization based (IF) public key schemes.
+*/
class BOTAN_DLL IF_Scheme_PrivateKey : public virtual IF_Scheme_PublicKey,
- public virtual Private_Key
+ public virtual Private_Key
{
public:
bool check_key(RandomNumberGenerator& rng, bool) const;
+ /**
+ * Get the first prime p.
+ * @return the prime p
+ */
const BigInt& get_p() const { return p; }
+
+ /**
+ * Get the second prime q.
+ * @return the prime q
+ */
const BigInt& get_q() const { return q; }
+
+ /**
+ * Get d with exp * d = 1 mod (p - 1, q - 1).
+ * @return d
+ */
const BigInt& get_d() const { return d; }
PKCS8_Encoder* pkcs8_encoder() const;