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

Interface for public-key decryptors. More...

#include <cryptlib.h>

Inheritance diagram for PK_Decryptor:
PK_CryptoSystem PrivateKeyAlgorithm AsymmetricAlgorithm Algorithm Clonable DL_CryptoSystemBase< PK_Decryptor, DL_PrivateKey< T > > DL_CryptoSystemBase< PK_Decryptor, DL_PrivateKey< SCHEME_OPTIONS::Element > > PK_FixedLengthCryptoSystemImpl< PK_Decryptor > DL_DecryptorBase< T >

Public Member Functions

virtual DecodingResult Decrypt (RandomNumberGenerator &rng, const byte *ciphertext, size_t ciphertextLength, byte *plaintext, const NameValuePairs &parameters=g_nullNameValuePairs) const =0
 Decrypt a byte string.
 
virtual BufferedTransformationCreateDecryptionFilter (RandomNumberGenerator &rng, BufferedTransformation *attachment=NULLPTR, const NameValuePairs &parameters=g_nullNameValuePairs) const
 Create a new decryption filter.
 
DecodingResult FixedLengthDecrypt (RandomNumberGenerator &rng, const byte *ciphertext, byte *plaintext, const NameValuePairs &parameters=g_nullNameValuePairs) const
 Decrypt a fixed size ciphertext.
 
- 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 PrivateKeyAlgorithm
CryptoMaterialAccessMaterial ()
 Retrieves a reference to a Private Key.
 
const CryptoMaterialGetMaterial () const
 Retrieves a reference to a Private Key.
 
virtual PrivateKeyAccessPrivateKey ()=0
 Retrieves a reference to a Private Key.
 
virtual const PrivateKeyGetPrivateKey () const
 Retrieves a reference to a Private 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 decryptors.

Definition at line 2732 of file cryptlib.h.

Constructor & Destructor Documentation

◆ ~PK_Decryptor()

virtual PK_Decryptor::~PK_Decryptor ( )
inlinevirtual

Definition at line 2735 of file cryptlib.h.

Member Function Documentation

◆ CreateDecryptionFilter()

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

Create a new decryption filter.

Parameters
rnga RandomNumberGenerator derived class
attachmentan attached transformation
parametersa set of NameValuePairs to initialize this object
Returns
the newly created decryption filter
Note
the caller is responsible for deleting the returned pointer

Definition at line 933 of file cryptlib.cpp.

◆ Decrypt()

virtual DecodingResult PK_Decryptor::Decrypt ( RandomNumberGenerator rng,
const byte ciphertext,
size_t  ciphertextLength,
byte plaintext,
const NameValuePairs parameters = g_nullNameValuePairs 
) const
pure virtual

Decrypt a byte string.

Parameters
rnga RandomNumberGenerator derived class
ciphertextthe encrypted byte buffer
ciphertextLengththe size of the encrypted byte buffer
plaintexta byte buffer to hold the decrypted string
parametersa set of NameValuePairs to initialize this object
Returns
the result of the decryption operation

If DecodingResult::isValidCoding is true, then DecodingResult::messageLength is valid and holds the actual length of the plaintext recovered. The result is undefined if decryption failed. If DecodingResult::isValidCoding is false, then DecodingResult::messageLength is undefined.

Precondition
COUNTOF(plaintext) == MaxPlaintextLength(ciphertextLength) ensures the output byte buffer is large enough
See also
PK_Encryptor

Implemented in DL_DecryptorBase< T >.

◆ FixedLengthDecrypt()

DecodingResult PK_Decryptor::FixedLengthDecrypt ( RandomNumberGenerator rng,
const byte ciphertext,
byte plaintext,
const NameValuePairs parameters = g_nullNameValuePairs 
) const
inline

Decrypt a fixed size ciphertext.

Parameters
rnga RandomNumberGenerator derived class
ciphertextthe encrypted byte buffer
plaintexta byte buffer to hold the decrypted string
parametersa set of NameValuePairs to initialize this object
Returns
the result of the decryption operation

If DecodingResult::isValidCoding is true, then DecodingResult::messageLength is valid and holds the actual length of the plaintext recovered. The result is undefined if decryption failed. If DecodingResult::isValidCoding is false, then DecodingResult::messageLength is undefined.

Precondition
COUNTOF(plaintext) == MaxPlaintextLength(ciphertextLength) ensures the output byte buffer is large enough
See also
PK_Encryptor

Definition at line 2777 of file cryptlib.h.


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