Botan  2.1.0
Crypto and TLS for C++11
Public Member Functions | List of all members
Botan::EMSA_PKCS1v15_Raw Class Referencefinal

#include <emsa_pkcs1.h>

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

Public Member Functions

EMSAclone () override
 
secure_vector< uint8_t > encoding_of (const secure_vector< uint8_t > &, size_t, RandomNumberGenerator &rng) override
 
secure_vector< uint8_t > raw_data () override
 
void update (const uint8_t[], size_t) override
 
bool verify (const secure_vector< uint8_t > &, const secure_vector< uint8_t > &, size_t) override
 

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 50 of file emsa_pkcs1.h.

Member Function Documentation

EMSA* Botan::EMSA_PKCS1v15_Raw::clone ( )
inlineoverridevirtual
Returns
a new object representing the same encoding method as *this

Implements Botan::EMSA.

Definition at line 53 of file emsa_pkcs1.h.

53 { return new EMSA_PKCS1v15_Raw(); }
secure_vector< uint8_t > Botan::EMSA_PKCS1v15_Raw::encoding_of ( const secure_vector< uint8_t > &  msg,
size_t  output_bits,
RandomNumberGenerator rng 
)
overridevirtual

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 101 of file emsa_pkcs1.cpp.

104  {
105  return emsa3_encoding(msg, output_bits, nullptr, 0);
106  }
secure_vector< uint8_t > Botan::EMSA_PKCS1v15_Raw::raw_data ( )
overridevirtual
Returns
raw hash

Implements Botan::EMSA.

Definition at line 93 of file emsa_pkcs1.cpp.

94  {
95  secure_vector<uint8_t> ret;
96  std::swap(ret, m_message);
97  return ret;
98  }
void Botan::EMSA_PKCS1v15_Raw::update ( const uint8_t  input[],
size_t  length 
)
overridevirtual

Add more data to the signature computation

Parameters
inputsome data
lengthlength of input in bytes

Implements Botan::EMSA.

Definition at line 88 of file emsa_pkcs1.cpp.

89  {
90  m_message += std::make_pair(input, length);
91  }
bool Botan::EMSA_PKCS1v15_Raw::verify ( const secure_vector< uint8_t > &  coded,
const secure_vector< uint8_t > &  raw,
size_t  key_bits 
)
overridevirtual

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 108 of file emsa_pkcs1.cpp.

111  {
112  try
113  {
114  return (coded == emsa3_encoding(raw, key_bits, nullptr, 0));
115  }
116  catch(...)
117  {
118  return false;
119  }
120  }

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