S.Mehdi Sheikhalishahi wrote:
Hi All
 I want to create a RSA class that have the following
member and methods:
class RSAAgent{
public:
 RSA* rsa;
 RSASign();
 RSAVerify();
 RSAEncrypt();
 RSADecrypt();
 RSAGenerate();

}
Do you know any ready class to use it.
Thanks.

Dear Mr. Sheikhalishahi,


You're writing to the OpenSSL development list, where people discuss
questions related to the development of OpenSSL library. This list is
clearly marked as "Not for application development questions!",
(check http://www.openssl.org/support/). Moreover, the language you're
trying to employ to write this piece of code (C++) is not the language
OpenSSL development is based upon.

Please use openssl-users list for the questions related to the usage
of OpenSSL library. Please use other mailing list or newsgroup for
questions related to generic C++ programming.

To answer your question: the OpenSSL library provides several methods
to deal with RSA keys, namely, RSA_public_encrypt, RSA_private_decrypt
and others. You may combine these appropriately and build your own class
out of it:

class RSAAgent {
public:
        RSA *rsa;

        int RSASign(int type, unsigned char *m, unsigned int m_len,
           unsigned char *sigret, unsigned int *siglen) {
                ::RSA_sign(type, m, m_len, sigret, siglen, rsa);
        }

        int RSAVerify(int type, unsigned char *m, unsigned int m_len,
           unsigned char *sigbuf, unsigned int siglen) {
                ::RSA_verify(type, m, m_len, sigbuf siglen, rsa);
        }

        // ... continue as shown above ...
}

--
Lev Walkin
[EMAIL PROTECTED]

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to