31 OID GetAlgorithmID()
const;
37 bool GetVoidValue(
const char *name,
const std::type_info &valueType,
void *pValue)
const;
46 const Integer & GetModulus()
const {
return m_n;}
47 const Integer & GetPublicExponent()
const {
return m_e;}
49 void SetModulus(
const Integer &n) {m_n = n;}
50 void SetPublicExponent(
const Integer &e) {m_e = e;}
64 {m_n = n; m_e = e; m_d = d; m_p = p; m_q = q; m_dp = dp; m_dq = dq; m_u = u;}
77 OID GetAlgorithmID()
const {
return RSAFunction::GetAlgorithmID();}
88 bool GetVoidValue(
const char *name,
const std::type_info &valueType,
void *pValue)
const;
92 const Integer& GetPrime1()
const {
return m_p;}
93 const Integer& GetPrime2()
const {
return m_q;}
94 const Integer& GetPrivateExponent()
const {
return m_d;}
95 const Integer& GetModPrime1PrivateExponent()
const {
return m_dp;}
96 const Integer& GetModPrime2PrivateExponent()
const {
return m_dq;}
97 const Integer& GetMultiplicativeInverseOfPrime2ModPrime1()
const {
return m_u;}
99 void SetPrime1(
const Integer &p) {m_p = p;}
100 void SetPrime2(
const Integer &q) {m_q = q;}
101 void SetPrivateExponent(
const Integer &d) {m_d = d;}
102 void SetModPrime1PrivateExponent(
const Integer &dp) {m_dp = dp;}
103 void SetModPrime2PrivateExponent(
const Integer &dq) {m_dq = dq;}
104 void SetMultiplicativeInverseOfPrime2ModPrime1(
const Integer &u) {m_u = u;}
107 Integer m_d, m_p, m_q, m_dp, m_dq, m_u;
127 static const char * CRYPTOPP_API StaticAlgorithmName() {
return "RSA";}
133 template <
class STANDARD>
140 template <
class STANDARD,
class H>
147 static const char * CRYPTOPP_API StaticAlgorithmName() {
return "RSA-ISO";}
virtual void AssignFrom(const NameValuePairs &source)=0
Assign values to this object.
virtual void BERDecodePrivateKey(BufferedTransformation &bt, bool parametersPresent, size_t size)=0
decode privateKey part of privateKeyInfo, without the OCTET STRING header
void DEREncode(BufferedTransformation &bt) const
Encode this object into a BufferedTransformation.
void Load(BufferedTransformation &bt)
Loads a key from a BufferedTransformation.
Trapdoor Function Based Encryption Scheme.
Classes and functions for various padding schemes used in public key algorithms.
This file contains helper classes/functions for implementing public key algorithms.
encodes/decodes privateKeyInfo
Abstract base classes that provide a uniform interface to this library.
virtual bool GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const =0
Get a named value.
virtual void DEREncodePrivateKey(BufferedTransformation &bt) const =0
encode privateKey part of privateKeyInfo, without the OCTET STRING header
void DEREncode(BufferedTransformation &bt) const
Encode this object into a BufferedTransformation.
Interface for random number generators.
void BERDecode(BufferedTransformation &bt)
Decode this object from a BufferedTransformation.
Applies the inverse of the trapdoor function.
void Save(BufferedTransformation &bt) const
Saves a key to a BufferedTransformation.
Multiple precision integer with arithmetic operations.
Applies the trapdoor function.
void BERDecode(BufferedTransformation &bt)
Decode this object from a BufferedTransformation.
Classes and functions for working with ANS.1 objects.
Integer PreimageBound() const
Returns the maximum size of a message before the trapdoor function is applied.
RSA signature scheme with appendix
virtual bool Validate(RandomNumberGenerator &rng, unsigned int level) const =0
Check this object for errors.
virtual void GenerateRandom(RandomNumberGenerator &rng, const NameValuePairs ¶ms=g_nullNameValuePairs)
Generate a random key or crypto parameters.
Integer ImageBound() const
Returns the maximum size of a message after the trapdoor function is applied.
Crypto++ library namespace.
Integer ApplyFunction(const Integer &x) const
Applies the trapdoor.
encodes/decodes subjectPublicKeyInfo
Integer PreimageBound() const
Returns the maximum size of a message before the trapdoor function is applied.
Integer PreimageBound() const
Returns the maximum size of a message before the trapdoor function is applied.
Namespace containing weak and wounded algorithms.
Interface for retrieving values given their names.
A template implementing constructors for public key algorithm classes.
Trapdoor Function Based Signature Scheme.