Botan 2.19.2
Crypto and TLS for C&
Public Member Functions | List of all members
Botan::ISO_9796_DS2 Class Referencefinal

#include <iso9796.h>

Inheritance diagram for Botan::ISO_9796_DS2:

Public Member Functions

EMSAclone () override
virtual AlgorithmIdentifier config_for_x509 (const Private_Key &key, const std::string &cert_hash_name) const
 ISO_9796_DS2 (HashFunction *hash, bool implicit, size_t salt_size)
 ISO_9796_DS2 (HashFunction *hash, bool implicit=false)
std::string name () const override

Detailed Description

ISO-9796-2 - Digital signature scheme 2 (probabilistic)

Definition at line 21 of file iso9796.h.

Constructor & Destructor Documentation

◆ ISO_9796_DS2() [1/2]

Botan::ISO_9796_DS2::ISO_9796_DS2 ( HashFunction hash,
bool  implicit = false 
hashfunction to use
implicitwhether or not the trailer is implicit

Definition at line 28 of file iso9796.h.

28 : m_hash(hash), m_implicit(implicit),
29 m_SALT_SIZE(hash->output_length()) {}
MechanismType hash

Referenced by clone().

◆ ISO_9796_DS2() [2/2]

Botan::ISO_9796_DS2::ISO_9796_DS2 ( HashFunction hash,
bool  implicit,
size_t  salt_size 
hashfunction to use
implicitwhether or not the trailer is implicit
salt_sizesize of the salt to use in bytes

Definition at line 36 of file iso9796.h.

36 : m_hash(hash), m_implicit(implicit),
37 m_SALT_SIZE(salt_size) {}
size_t salt_size

Member Function Documentation

◆ clone()

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

Implements Botan::EMSA.

Definition at line 219 of file iso9796.cpp.

220 {
221 return new ISO_9796_DS2(m_hash->clone(), m_implicit, m_SALT_SIZE);
222 }
ISO_9796_DS2(HashFunction *hash, bool implicit=false)
Definition: iso9796.h:28

References ISO_9796_DS2().

◆ 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::ISO_9796_DS2::name ( ) const
the SCAN name of the encoding/padding scheme

Implements Botan::EMSA.

Definition at line 266 of file iso9796.cpp.

267 {
268 return "ISO_9796_DS2(" + m_hash->name() + ","
269 + (m_implicit ? "imp" : "exp") + "," + std::to_string(m_SALT_SIZE) + ")";
270 }
std::string to_string(const BER_Object &obj)
Definition: asn1_obj.cpp:213

References Botan::ASN1::to_string().

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