|
|
| | UtlCryptoKeyRsa () |
| | Constructor. More...
|
| |
| | ~UtlCryptoKeyRsa () |
| | Destructor. More...
|
| |
|
| int | generateKey () |
| | Generates a new RSA private/public key pair. More...
|
| |
| int | importFromFile (const char *pFilename) |
| | Imports a key from the given file. More...
|
| |
| int | getMaxEncryptedSize (int srcLen) const |
| | Returns the max encrypted size of srcLen bytes from encrypt() More...
|
| |
| int | encrypt (const unsigned char *pSrc, int srcLen, unsigned char *pDest, int *pDestLen) const |
| | Encrypts the given source data with the current key. More...
|
| |
| int | getMaxDecryptedSize (int srcLen) const |
| | Returns the max decrypted size of srcLen bytes from decrypt() More...
|
| |
| int | decrypt (const unsigned char *pSrc, int srcLen, unsigned char *pDest, int *pDestLen) const |
| | Decrypts the given source data with the current key. More...
|
| |
| int | getMaxSignatureSize (int srcLen) const |
| | Returns the max size of a signature that sign() will return. More...
|
| |
| int | sign (const unsigned char *pSrc, int srcLen, unsigned char *pDest, int *pDestLen) const |
| | Signs source data. More...
|
| |
| 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. More...
|
| |
| int | encryptPrivate (const unsigned char *pSrc, int srcLen, unsigned char *pDest, int *pDestLen) const |
| | Decrypts the given source data with the current PRIVATE key. More...
|
| |
| int | decryptPrivate (const unsigned char *pSrc, int srcLen, unsigned char *pDest, int *pDestLen) const |
| | Decrypts the given source data with the current PRIVATE key. More...
|
| |
| int | encryptPublic (const unsigned char *pSrc, int srcLen, unsigned char *pDest, int *pDestLen) const |
| | Encrypts the given source data with the current PUBLIC key. More...
|
| |
| int | decryptPublic (const unsigned char *pSrc, int srcLen, unsigned char *pDest, int *pDestLen) const |
| | Decrypts the given source data with the current PUBLIC key. More...
|
| |
|
| UtlString | output () const |
| | Get humane-readable describe. More...
|
| |
| | UtlCryptoKey () |
| | Constructor. More...
|
| |
| virtual | ~UtlCryptoKey () |
| | Destructor. More...
|
| |
| virtual int | loadBinaryKey (const unsigned char *pSrc, int srcLen) |
| | Loads a binary key value. More...
|
| |
| virtual UtlCryptoData * | getBinaryKey () const |
| | Retrieves a binary key value (for later use by loadBinaryKey) More...
|
| |
| virtual UtlCryptoData * | encrypt (const unsigned char *pSrc, int srcLen) const |
| | Encrypts the given source data with the current key. More...
|
| |
| virtual UtlCryptoData * | decrypt (const unsigned char *pSrc, int srcLen) const |
| | Decrypts the given source data with the current key. More...
|
| |
| virtual UtlCryptoData * | sign (const unsigned char *pSrc, int srcLen) const |
| | Signs source data. More...
|
| |
| bool | isValid () const |
| |
| bool | isPrivate () const |
| |
| bool | isPublic () const |
| |
| bool | isSymmetric () const |
| |
| KeyType | getKeyType () const |
| |
| unsigned long | getLastError () const |
| |
|
| enum | KeyType {
KEY_INVALID,
KEY_SYMMETRIC,
KEY_PRIVATE,
KEY_PUBLIC,
NUM_KEY_TYPES
} |
| | What type of Key is this? More...
|
| |
| static int | getDigestAlgType () |
| | Returns the digest algorithm type that computeDigest() will return. More...
|
| |
| static int | getMaxDigestSize (int srcLen) |
| | Returns the max size of a digest that computeDigest() will return. More...
|
| |
| static int | computeDigest (const unsigned char *pSrc, int srcLen, unsigned char *pDest, int *pDestLen) |
| | Computes message digest (MD) of given data. More...
|
| |
| static UtlCryptoData * | computeDigest (const unsigned char *pSrc, int srcLen) |
| | Computes message digest (MD) of given data. More...
|
| |
| static int | getMaxBase64EncodedSize (int srcLen) |
| | Returns the max base64-encoded size of srcLen bytes from base64Encode. More...
|
| |
| static int | base64Encode (const unsigned char *pSrc, int srcLen, unsigned char *pDest, int *pDestLen) |
| | Encodes the given binary data in base64 format. More...
|
| |
| static UtlString | base64Encode (const unsigned char *pSrc, int srcLen) |
| | Encodes the given binary data in base64 format. More...
|
| |
| static int | getMaxBase64DecodedSize (int srcLen) |
| | Returns the max decoded size of srcLen bytes from base64Decode. More...
|
| |
| static int | base64Decode (const unsigned char *pSrc, int srcLen, unsigned char *pDest, int *pDestLen) |
| | Decodes the given base64 data into binary format. More...
|
| |
| static int | base64Decode (const UtlString &pSrc, unsigned char *pDest, int *pDestLen) |
| | Decodes the given base64 data into binary format. More...
|
| |
| static UtlCryptoData * | base64Decode (const unsigned char *pSrc, int srcLen) |
| | Decodes the given base64 data into binary format. More...
|
| |
| static UtlCryptoData * | base64Decode (const UtlString &pSrc) |
| | Decodes the given base64 data into binary format. More...
|
| |
| KeyType | setKeyType (KeyType type) |
| |
| unsigned long | setLastError (unsigned long err) const |
| |
| static int | getBase64Idx (unsigned char c) |
| | Decode base64 character. More...
|
| |
| static bool | isBase64 (unsigned char c) |
| | Returns true if the given char is a base64 char. More...
|
| |
| static const char | sBase64Chars [] |
| | Set of base64 chars. More...
|
| |
Rsa private/public keypairs.