16 #ifndef _UtlCryptoKeyRsa_h_ 17 #define _UtlCryptoKeyRsa_h_ 62 int encrypt(
const unsigned char* pSrc,
73 int decrypt(
const unsigned char* pSrc,
82 int sign(
const unsigned char* pSrc,
88 int verify(
const unsigned char* pSrc,
90 const unsigned char* pSig,
111 unsigned char* pDest,
112 int* pDestLen)
const;
126 unsigned char* pDest,
127 int* pDestLen)
const;
141 unsigned char* pDest,
142 int* pDestLen)
const;
185 #endif // _UtlCryptoKeyRsa_h_ int decryptPublic(const unsigned char *pSrc, int srcLen, unsigned char *pDest, int *pDestLen) const
Decrypts the given source data with the current PUBLIC key.
UtlCryptoKeyRsa()
Constructor.
struct rsa_st RSA
Definition: UtlCryptoKey.h:24
A generic cryptography key base class.
Definition: UtlCryptoKey.h:36
int encryptPublic(const unsigned char *pSrc, int srcLen, unsigned char *pDest, int *pDestLen) const
Encrypts the given source data with the current PUBLIC key.
int encryptPrivate(const unsigned char *pSrc, int srcLen, unsigned char *pDest, int *pDestLen) const
Decrypts the given source data with the current PRIVATE key.
~UtlCryptoKeyRsa()
Destructor.
int encrypt(const unsigned char *pSrc, int srcLen, unsigned char *pDest, int *pDestLen) const
Encrypts the given source data with the current key.
int verify(const unsigned char *pSrc, int srcLen, const unsigned char *pSig, int sigLen) const
Verifies that the signature is valid for the source data.
Definition: UtlString.h:48
int decrypt(const unsigned char *pSrc, int srcLen, unsigned char *pDest, int *pDestLen) const
Decrypts the given source data with the current key.
int getMaxEncryptedSize(int srcLen) const
Returns the max encrypted size of srcLen bytes from encrypt()
int decryptPrivate(const unsigned char *pSrc, int srcLen, unsigned char *pDest, int *pDestLen) const
Decrypts the given source data with the current PRIVATE key.
int getMaxSignatureSize(int srcLen) const
Returns the max size of a signature that sign() will return.
int getMaxDecryptedSize(int srcLen) const
Returns the max decrypted size of srcLen bytes from decrypt()
int generateKey()
Generates a new RSA private/public key pair.
int sign(const unsigned char *pSrc, int srcLen, unsigned char *pDest, int *pDestLen) const
Signs source data.
UtlString output() const
Get humane-readable describe.
int importFromFile(const char *pFilename)
Imports a key from the given file.
Rsa private/public keypairs.
Definition: UtlCryptoKeyRsa.h:34