Security Scol plugin
Classes | Public Member Functions | List of all members
PK_Encryptor Class Referenceabstract

Interface for public-key encryptors. More...

#include <cryptlib.h>

Inheritance diagram for PK_Encryptor:
PK_CryptoSystem PublicKeyAlgorithm AsymmetricAlgorithm Algorithm Clonable DL_CryptoSystemBase< PK_Encryptor, DL_PublicKey< T > > DL_CryptoSystemBase< PK_Encryptor, DL_PublicKey< SCHEME_OPTIONS::Element > > PK_FixedLengthCryptoSystemImpl< PK_Encryptor > DL_EncryptorBase< T >

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 &parameters=g_nullNameValuePairs) const =0
 Encrypt a byte string.
 
virtual BufferedTransformationCreateEncryptionFilter (RandomNumberGenerator &rng, BufferedTransformation *attachment=NULLPTR, const NameValuePairs &parameters=g_nullNameValuePairs) const
 Create a new encryption filter.
 
- Public Member Functions inherited from PK_CryptoSystem
virtual size_t MaxPlaintextLength (size_t ciphertextLength) const =0
 Provides the maximum length of plaintext for a given ciphertext length.
 
virtual size_t CiphertextLength (size_t plaintextLength) const =0
 Calculate the length of ciphertext given length of plaintext.
 
virtual bool ParameterSupported (const char *name) const =0
 Determines whether this object supports the use of a named parameter.
 
virtual size_t FixedCiphertextLength () const
 Provides the fixed ciphertext length, if one exists.
 
virtual size_t FixedMaxPlaintextLength () const
 Provides the maximum plaintext length given a fixed ciphertext length.
 
- Public Member Functions inherited from PublicKeyAlgorithm
CryptoMaterialAccessMaterial ()
 Retrieves a reference to a Public Key.
 
const CryptoMaterialGetMaterial () const
 Retrieves a reference to a Public Key.
 
virtual PublicKeyAccessPublicKey ()=0
 Retrieves a reference to a Public Key.
 
virtual const PublicKeyGetPublicKey () const
 Retrieves a reference to a Public Key.
 
- Public Member Functions inherited from Algorithm
 Algorithm (bool checkSelfTestStatus=true)
 Interface for all crypto algorithms.
 
virtual std::string AlgorithmName () const
 Provides the name of this algorithm.
 
virtual std::string AlgorithmProvider () const
 Retrieve the provider of this algorithm.
 
- Public Member Functions inherited from Clonable
virtual ClonableClone () const
 Copies this object.
 

Detailed Description

Interface for public-key encryptors.

Definition at line 2697 of file cryptlib.h.

Member Function Documentation

◆ CreateEncryptionFilter()

BufferedTransformation * PK_Encryptor::CreateEncryptionFilter ( RandomNumberGenerator rng,
BufferedTransformation attachment = NULLPTR,
const NameValuePairs parameters = g_nullNameValuePairs 
) const
virtual

Create a new encryption filter.

Parameters
rnga RandomNumberGenerator derived class
attachmentan attached transformation
parametersa 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.

Definition at line 885 of file cryptlib.cpp.

◆ Encrypt()

virtual void PK_Encryptor::Encrypt ( RandomNumberGenerator rng,
const byte plaintext,
size_t  plaintextLength,
byte ciphertext,
const NameValuePairs parameters = g_nullNameValuePairs 
) const
pure virtual

Encrypt a byte string.

Parameters
rnga RandomNumberGenerator derived class
plaintextthe plaintext byte buffer
plaintextLengththe size of the plaintext byte buffer
ciphertexta byte buffer to hold the encrypted string
parametersa set of NameValuePairs to initialize this object
Precondition
CiphertextLength(plaintextLength) != 0 ensures the plaintext isn't too large
COUNTOF(ciphertext) == CiphertextLength(plaintextLength) ensures the output byte buffer is large enough.
See also
PK_Decryptor

Implemented in DL_EncryptorBase< T >.


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