Botan 2.19.1
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

EMSAclone () 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)
hashthe 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();
96 m_hash_id = ieee1363_hash_id(hash->name());
98 if(!m_hash_id)
99 throw Encoding_Error("EMSA_X931 no hash identifier for " + hash->name());
100 }
uint8_t ieee1363_hash_id(const std::string &name)
Definition: hash_id.cpp:146
MechanismType hash

Member Function Documentation

◆ clone()

EMSA * Botan::EMSA_X931::clone ( )
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()); }
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

Prepare sig_algo for use in choose_sig_format for x509 certs

keyused for checking compatibility with the encoding scheme
cert_hash_nameis checked to equal the hash for the encoding
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 }
virtual std::string name() const =0

References Botan::EMSA::name().

◆ name()

std::string Botan::EMSA_X931::name ( ) const
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: