Botan 2.1.0 Crypto and TLS for C++11

- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | List of all members
Botan::EMSA_PKCS1v15_Raw Class Referencefinal

`#include <emsa_pkcs1.h>`

Inheritance diagram for Botan::EMSA_PKCS1v15_Raw:

## Public Member Functions
EMSA * | clone () 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 | ( |  | ) |
| inline override virtual

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
| ) |  |
| override virtual

Return the encoding of a message

Parameters

  msg | the result of raw_data()
  output_bits | the desired output bit size
  rng | a 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 | ( |  | ) |
| override virtual

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
| ) |  |
| override virtual

Add more data to the signature computation

Parameters

  input | some data
  length | length 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
| ) |  |
| override virtual

Verify the encoding

Parameters

  coded | the received (coded) message representative
  raw | the computed (local, uncoded) message representative
  key_bits | the 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:

- src/lib/pk_pad/emsa_pkcs1/emsa_pkcs1.h
- src/lib/pk_pad/emsa_pkcs1/emsa_pkcs1.cpp