Botan  1.11.15
Public Types | Public Member Functions
Botan::EMSA_PKCS1v15_Raw Class Reference

#include <emsa_pkcs1.h>

Inheritance diagram for Botan::EMSA_PKCS1v15_Raw:
Botan::EMSA

List of all members.

Public Types

typedef SCAN_Name Spec

Public Member Functions

secure_vector< byteencoding_of (const secure_vector< byte > &, size_t, RandomNumberGenerator &rng)
secure_vector< byteraw_data ()
void update (const byte[], size_t)
bool verify (const secure_vector< byte > &, const secure_vector< byte > &, size_t)

Detailed Description

EMSA_PKCS1v15_Raw which is EMSA_PKCS1v15 without a hash or digest id (which according to QCA docs is "identical to PKCS#11's CKM_RSA_PKCS mechanism", something I have not confirmed)

Definition at line 48 of file emsa_pkcs1.h.


Member Typedef Documentation

typedef SCAN_Name Botan::EMSA::Spec [inherited]

Definition at line 23 of file emsa.h.


Member Function Documentation

secure_vector< byte > Botan::EMSA_PKCS1v15_Raw::encoding_of ( const secure_vector< byte > &  msg,
size_t  output_bits,
RandomNumberGenerator rng 
) [virtual]

Return the encoding of a message

Parameters:
msgthe result of raw_data()
output_bitsthe desired output bit size
rnga random number generator
Returns:
encoded signature

Implements Botan::EMSA.

Definition at line 109 of file emsa_pkcs1.cpp.

   {
   return emsa3_encoding(msg, output_bits, nullptr, 0);
   }
secure_vector< byte > Botan::EMSA_PKCS1v15_Raw::raw_data ( ) [virtual]
Returns:
raw hash

Implements Botan::EMSA.

Definition at line 101 of file emsa_pkcs1.cpp.

   {
   secure_vector<byte> ret;
   std::swap(ret, message);
   return ret;
   }
void Botan::EMSA_PKCS1v15_Raw::update ( const byte  input[],
size_t  length 
) [virtual]

Add more data to the signature computation

Parameters:
inputsome data
lengthlength of input in bytes

Implements Botan::EMSA.

Definition at line 96 of file emsa_pkcs1.cpp.

   {
   message += std::make_pair(input, length);
   }
bool Botan::EMSA_PKCS1v15_Raw::verify ( const secure_vector< byte > &  coded,
const secure_vector< byte > &  raw,
size_t  key_bits 
) [virtual]

Verify the encoding

Parameters:
codedthe received (coded) message representative
rawthe computed (local, uncoded) message representative
key_bitsthe size of the key in bits
Returns:
true if coded is a valid encoding of raw, otherwise false

Implements Botan::EMSA.

Definition at line 116 of file emsa_pkcs1.cpp.

   {
   try
      {
      return (coded == emsa3_encoding(raw, key_bits, nullptr, 0));
      }
   catch(...)
      {
      return false;
      }
   }

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