libcmutils 0.6.5
Multi-platform C99 utility library
Loading...
Searching...
No Matches
CMUTIL_RSACrypto Struct Reference

RSA encryption/decryption and signature object. More...

Data Fields

CMUTIL_String *(* EncryptWithPublicKey )(CMUTIL_RSACrypto *crypto, CMUTIL_String *plain, CMUTIL_PublicKey *pubKey)
 Encrypts plain text using an RSA public key.
 
CMUTIL_String *(* EncryptWithPrivateKey )(CMUTIL_RSACrypto *crypto, CMUTIL_String *plain, CMUTIL_PrivateKey *privKey)
 Encrypts plain text using an RSA private key.
 
CMUTIL_String *(* DecryptWithPublicKey )(CMUTIL_RSACrypto *crypto, CMUTIL_String *encrypted, CMUTIL_PublicKey *pubKey)
 Decrypts data using an RSA public key.
 
CMUTIL_String *(* DecryptWithPrivateKey )(CMUTIL_RSACrypto *crypto, CMUTIL_String *encrypted, CMUTIL_PrivateKey *privKey)
 Decrypts data using an RSA private key.
 
CMUTIL_String *(* Sign )(CMUTIL_RSACrypto *crypto, CMUTIL_String *plain, CMUTIL_PrivateKey *privKey)
 Digitally signs plain text using an RSA private key.
 
CMBool(* VerifySignature )(CMUTIL_RSACrypto *crypto, CMUTIL_String *plain, CMUTIL_String *signature, CMUTIL_PublicKey *pubKey)
 Verifies a digital signature using an RSA public key.
 
void(* Destroy )(CMUTIL_RSACrypto *crypto)
 Destroys the RSA crypto object.
 

Detailed Description

RSA encryption/decryption and signature object.

Field Documentation

◆ EncryptWithPublicKey

CMUTIL_String *(* CMUTIL_RSACrypto::EncryptWithPublicKey) (CMUTIL_RSACrypto *crypto, CMUTIL_String *plain, CMUTIL_PublicKey *pubKey)

Encrypts plain text using an RSA public key.

Parameters
cryptoThe RSA crypto object.
plainThe plain text to encrypt.
pubKeyThe public key to use for encryption.
Returns
The encrypted data as a CMUTIL_String object, or NULL on failure.

◆ EncryptWithPrivateKey

CMUTIL_String *(* CMUTIL_RSACrypto::EncryptWithPrivateKey) (CMUTIL_RSACrypto *crypto, CMUTIL_String *plain, CMUTIL_PrivateKey *privKey)

Encrypts plain text using an RSA private key.

Parameters
cryptoThe RSA crypto object.
plainThe plain text to encrypt.
privKeyThe private key to use for encryption.
Returns
The encrypted data as a CMUTIL_String object, or NULL on failure.

◆ DecryptWithPublicKey

CMUTIL_String *(* CMUTIL_RSACrypto::DecryptWithPublicKey) (CMUTIL_RSACrypto *crypto, CMUTIL_String *encrypted, CMUTIL_PublicKey *pubKey)

Decrypts data using an RSA public key.

Parameters
cryptoThe RSA crypto object.
encryptedThe encrypted data to decrypt.
pubKeyThe public key to use for decryption.
Returns
The decrypted data as a CMUTIL_String object, or NULL on failure.

◆ DecryptWithPrivateKey

CMUTIL_String *(* CMUTIL_RSACrypto::DecryptWithPrivateKey) (CMUTIL_RSACrypto *crypto, CMUTIL_String *encrypted, CMUTIL_PrivateKey *privKey)

Decrypts data using an RSA private key.

Parameters
cryptoThe RSA crypto object.
encryptedThe encrypted data to decrypt.
privKeyThe private key to use for decryption.
Returns
The decrypted data as a CMUTIL_String object, or NULL on failure.

◆ Sign

CMUTIL_String *(* CMUTIL_RSACrypto::Sign) (CMUTIL_RSACrypto *crypto, CMUTIL_String *plain, CMUTIL_PrivateKey *privKey)

Digitally signs plain text using an RSA private key.

Parameters
cryptoThe RSA crypto object.
plainThe data to sign.
privKeyThe private key to use for signing.
Returns
The digital signature as a CMUTIL_String object, or NULL on failure.

◆ VerifySignature

CMBool(* CMUTIL_RSACrypto::VerifySignature) (CMUTIL_RSACrypto *crypto, CMUTIL_String *plain, CMUTIL_String *signature, CMUTIL_PublicKey *pubKey)

Verifies a digital signature using an RSA public key.

Parameters
cryptoThe RSA crypto object.
plainThe original data that was signed.
signatureThe signature to verify.
pubKeyThe public key to use for verification.
Returns
CMTrue if the signature is valid, CMFalse otherwise.

◆ Destroy

void(* CMUTIL_RSACrypto::Destroy) (CMUTIL_RSACrypto *crypto)

Destroys the RSA crypto object.

Parameters
cryptoThe RSA crypto object to destroy.

The documentation for this struct was generated from the following file: