Crypto++ 8.7
Free C++ class library of cryptographic schemes
|
Interface for public-key encryptors. More...
#include <cryptlib.h>
Classes | |
class | InvalidPlaintextLength |
Exception thrown when trying to encrypt plaintext of invalid length. More... | |
Public Member Functions | |
virtual void | Encrypt (RandomNumberGenerator &rng, const byte *plaintext, size_t plaintextLength, byte *ciphertext, const NameValuePairs ¶meters=g_nullNameValuePairs) const =0 |
Encrypt a byte string. More... | |
virtual BufferedTransformation * | CreateEncryptionFilter (RandomNumberGenerator &rng, BufferedTransformation *attachment=NULL, const NameValuePairs ¶meters=g_nullNameValuePairs) const |
Create a new encryption filter. More... | |
![]() | |
virtual size_t | MaxPlaintextLength (size_t ciphertextLength) const =0 |
Provides the maximum length of plaintext for a given ciphertext length. More... | |
virtual size_t | CiphertextLength (size_t plaintextLength) const =0 |
Calculate the length of ciphertext given length of plaintext. More... | |
virtual bool | ParameterSupported (const char *name) const =0 |
Determines whether this object supports the use of a named parameter. More... | |
virtual size_t | FixedCiphertextLength () const |
Provides the fixed ciphertext length, if one exists. More... | |
virtual size_t | FixedMaxPlaintextLength () const |
Provides the maximum plaintext length given a fixed ciphertext length. More... | |
![]() | |
CryptoMaterial & | AccessMaterial () |
Retrieves a reference to a Public Key. More... | |
const CryptoMaterial & | GetMaterial () const |
Retrieves a reference to a Public Key. More... | |
virtual PublicKey & | AccessPublicKey ()=0 |
Retrieves a reference to a Public Key. More... | |
virtual const PublicKey & | GetPublicKey () const |
Retrieves a reference to a Public Key. More... | |
virtual CryptoMaterial & | AccessMaterial ()=0 |
Retrieves a reference to CryptoMaterial. More... | |
virtual const CryptoMaterial & | GetMaterial () const =0 |
Retrieves a reference to CryptoMaterial. More... | |
![]() | |
Algorithm (bool checkSelfTestStatus=true) | |
Interface for all crypto algorithms. More... | |
virtual std::string | AlgorithmName () const |
Provides the name of this algorithm. More... | |
virtual std::string | AlgorithmProvider () const |
Retrieve the provider of this algorithm. More... | |
![]() | |
virtual Clonable * | Clone () const |
Copies this object. More... | |
Interface for public-key encryptors.
Definition at line 2697 of file cryptlib.h.
|
pure virtual |
Encrypt a byte string.
rng | a RandomNumberGenerator derived class |
plaintext | the plaintext byte buffer |
plaintextLength | the size of the plaintext byte buffer |
ciphertext | a byte buffer to hold the encrypted string |
parameters | a set of NameValuePairs to initialize this object |
CiphertextLength(plaintextLength) != 0
ensures the plaintext isn't too large COUNTOF(ciphertext) == CiphertextLength(plaintextLength)
ensures the output byte buffer is large enough. Implemented in TF_EncryptorBase, DL_EncryptorBase< T >, and DL_EncryptorBase< SCHEME_OPTIONS::Element >.
|
virtual |
Create a new encryption filter.
rng | a RandomNumberGenerator derived class |
attachment | an attached transformation |
parameters | a set of NameValuePairs to initialize this object |
attachment
can be NULL
. The caller is responsible for deleting the returned pointer. Encoding parameters should be passed in the "EP" channel.