scclib
Stable Cloud Computing C++ Library
Public Member Functions | List of all members
scc::crypto::RsaOaepEncrypt Class Reference

RSA OAEP encryption. More...

#include <rsa.h>

Public Member Functions

 RsaOaepEncrypt (RsaPublicKey &, Hash::Algorithm=Hash::sha1_type)
 Construct an RSA encryptor. More...
 
int max_msg_size () const
 The maximum allowable plain text size in bytes. More...
 
int cipher_size () const
 Cipher text size in bytes. More...
 
void encrypt (const void *, int, void *, int, const void *=nullptr, int=0)
 Encrypt a message. More...
 

Detailed Description

RSA OAEP encryption.

Encrypts using OAEP scheme. Requires a public key, and choice of hash algorithm.

Definition at line 328 of file rsa.h.

Constructor & Destructor Documentation

◆ RsaOaepEncrypt()

scc::crypto::RsaOaepEncrypt::RsaOaepEncrypt ( RsaPublicKey ,
Hash::Algorithm  = Hash::sha1_type 
)

Construct an RSA encryptor.

Parameters
keyValid public key.
hash_typeHash algorithm from scc::crypto::Hash.

Member Function Documentation

◆ cipher_size()

int scc::crypto::RsaOaepEncrypt::cipher_size ( ) const

Cipher text size in bytes.

len(public key width)

◆ encrypt()

void scc::crypto::RsaOaepEncrypt::encrypt ( const void *  ,
int  ,
void *  ,
int  ,
const void *  = nullptr,
int  = 0 
)

Encrypt a message.

Parameters
msg_locPlaintext message buffer
msg_lenPlaintext size, must be <= max_msg_len()
cipher_locEncrypted ciphertext buffer
cipher_lenCiphertext size, must be exactly cipher_len()
label_locOptional label, which will be verified but not encrypted
label_lenLabel length

Throws exception on parameter error.

◆ max_msg_size()

int scc::crypto::RsaOaepEncrypt::max_msg_size ( ) const

The maximum allowable plain text size in bytes.

len(public key width) - 2*size(hash output) - 2


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