Botan 2.19.5 Crypto and TLS for C&

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

`#include <emsa_x931.h>`

Inheritance diagram for Botan::EMSA_X931:

## Public Member Functions
EMSA * | clone () override
virtual AlgorithmIdentifier | config_for_x509 (const Private_Key &key, const std::string &cert_hash_name) const
| EMSA_X931 (HashFunction *hash)
std::string | name () const override

## Detailed Description

EMSA from X9.31 (EMSA2 in IEEE 1363) Useful for Rabin-Williams, also sometimes used with RSA in odd protocols.

Definition at line 23 of file emsa_x931.h.

## Constructor & Destructor Documentation

## ◆ EMSA_X931()

Botan::EMSA_X931::EMSA_X931 | ( | HashFunction * | hash | ) |
| explicit

Parameters

  hash | the hash function to use

Definition at line 92 of file emsa_x931.cpp.

92 : m_hash(hash)
93 {
94 m_empty_hash = m_hash->final();
95
96 m_hash_id = ieee1363_hash_id(hash->name());
97
98 if(!m_hash_id)
99 throw Encoding_Error("EMSA_X931 no hash identifier for " + hash->name());
100 }
Botan::ieee1363_hash_id
uint8_t ieee1363_hash_id(const std::string &name)
Definition: hash_id.cpp:146
hash
MechanismType hash
Definition: p11_mechanism.cpp:64

## Member Function Documentation

## ◆ clone()

EMSA * Botan::EMSA_X931::clone | ( |  | ) |
| inline override virtual

Returns
  a new object representing the same encoding method as *this

Implements Botan::EMSA.

Definition at line 31 of file emsa_x931.h.

31{ return new EMSA_X931(m_hash->clone()); }
Botan::EMSA_X931::EMSA_X931
EMSA_X931(HashFunction *hash)
Definition: emsa_x931.cpp:92

## ◆ config_for_x509()

AlgorithmIdentifier Botan::EMSA::config_for_x509 | ( | const Private_Key & | key,
|  | const std::string & | cert_hash_name
| ) |  | const
| virtual inherited

Prepare sig_algo for use in choose_sig_format for x509 certs

Parameters

  key | used for checking compatibility with the encoding scheme
  cert_hash_name | is checked to equal the hash for the encoding

Returns
  algorithm identifier to signatures created using this key, padding method and hash.

Reimplemented in Botan::EMSA1, Botan::EMSA_PKCS1v15, and Botan::PSSR.

Definition at line 38 of file emsa.cpp.

40 {
41 throw Not_Implemented("Encoding " + name() + " not supported for signing X509 objects");
42 }
Botan::EMSA::name
virtual std::string name() const =0

References Botan::EMSA::name().

## ◆ name()

std::string Botan::EMSA_X931::name | ( |  | ) | const
| override virtual

Returns
  the SCAN name of the encoding/padding scheme

Implements Botan::EMSA.

Definition at line 46 of file emsa_x931.cpp.

47 {
48 return "EMSA2(" + m_hash->name() + ")";
49 }

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

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