class axl::cry::Rsa

#include <axl_cry_Rsa.h>

class Rsa: public axl::sl::Handle
{
public:
    // construction

    Rsa();

    // methods

    size_t
    getSize();

    bool
    create();

    bool
    readPublicKey(BIO* bio);

    bool
    readPublicKey(
        const void* pem,
        size_t size
        );

    bool
    readPublicKey(const sl::StringRef& pem);

    bool
    readPrivateKey(BIO* bio);

    bool
    readPrivateKey(
        const void* pem,
        size_t size
        );

    bool
    readPrivateKey(const sl::StringRef& pem);

    bool
    generate(
        uint_t keyLength,
        BIGNUM* publicExponent,
        BN_GENCB* callback = NULL
        );

    bool
    generate(
        uint_t keyLength,
        uint_t publicExponent = RSA_F4,
        BN_GENCB* callback = NULL
        );

    size_t
    publicEncrypt(
        void* dst,
        const void* src,
        size_t size,
        int padding = RSA_PKCS1_PADDING
        );

    size_t
    privateEncrypt(
        void* dst,
        const void* src,
        size_t size,
        int padding = RSA_PKCS1_PADDING
        );

    size_t
    publicDecrypt(
        void* dst,
        const void* src,
        size_t size,
        int padding = RSA_PKCS1_PADDING
        );

    size_t
    privateDecrypt(
        void* dst,
        const void* src,
        size_t size,
        int padding = RSA_PKCS1_PADDING
        );

    size_t
    signHash(
        int type,
        void* signature,
        size_t signatureSize,
        const void* hash,
        size_t hashSize
        );

    bool
    signHash(
        int type,
        sl::Array<char>* signature,
        const void* hash,
        size_t hashSize
        );

    sl::Array<char>
    signHash(
        int type,
        const void* hash,
        size_t hashSize
        );

    bool
    sign(
        sl::Array<char>* signature,
        const void* p,
        size_t size
        );

    sl::Array<char>
    sign(
        const void* p,
        size_t size
        );

    bool
    verifyHash(
        int type,
        const void* hash,
        size_t hashSize,
        const void* signature,
        size_t signatureSize
        );

    bool
    verify(
        const void* p,
        size_t size,
        const void* signature,
        size_t signatureSize
        );
};

Inherited Members

public:
    // typedefs

    typedef T H;

    // methods

    operator T() const;

    T
    operator->() const;

    const Handle&
    operator=(T h);

    bool
    isOpen() const;

    void
    close();

    void
    attach(T h);

    T
    detach();

    T*
    p();

    static
    T
    getInvalidHandle();