Botan  2.4.0
Crypto and TLS for C++11
Public Member Functions | List of all members
Botan::EMSA Class Referenceabstract

#include <emsa.h>

Inheritance diagram for Botan::EMSA:
Botan::EMSA1 Botan::EMSA_PKCS1v15 Botan::EMSA_PKCS1v15_Raw Botan::EMSA_Raw Botan::EMSA_X931 Botan::ISO_9796_DS2 Botan::ISO_9796_DS3 Botan::PSSR Botan::PSSR_Raw

Public Member Functions

virtual EMSAclone ()=0
 
virtual AlgorithmIdentifier config_for_x509 (const Private_Key &key, const std::string &cert_hash_name) const
 
virtual secure_vector< uint8_t > encoding_of (const secure_vector< uint8_t > &msg, size_t output_bits, RandomNumberGenerator &rng)=0
 
virtual std::string name () const =0
 
virtual secure_vector< uint8_t > raw_data ()=0
 
virtual void update (const uint8_t input[], size_t length)=0
 
virtual bool verify (const secure_vector< uint8_t > &coded, const secure_vector< uint8_t > &raw, size_t key_bits)=0
 
virtual ~EMSA ()=default
 

Detailed Description

EMSA, from IEEE 1363s Encoding Method for Signatures, Appendix

Any way of encoding/padding signatures

Definition at line 24 of file emsa.h.

Constructor & Destructor Documentation

◆ ~EMSA()

virtual Botan::EMSA::~EMSA ( )
virtualdefault

Member Function Documentation

◆ clone()

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

Implemented in Botan::PSSR_Raw, Botan::ISO_9796_DS3, Botan::EMSA_PKCS1v15_Raw, Botan::ISO_9796_DS2, Botan::PSSR, Botan::EMSA_PKCS1v15, Botan::EMSA_X931, Botan::EMSA1, and Botan::EMSA_Raw.

◆ config_for_x509()

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

Prepare sig_algo for use in choose_sig_format for x509 certs

Parameters
keyused for checking compatibility with the encoding scheme
cert_hash_nameis checked to equal the hash for the encoding
Returns
algorithm identifier to signatures created using this key, padding method and hash.

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

Definition at line 38 of file emsa.cpp.

References name().

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

◆ encoding_of()

virtual secure_vector<uint8_t> Botan::EMSA::encoding_of ( const secure_vector< uint8_t > &  msg,
size_t  output_bits,
RandomNumberGenerator rng 
)
pure virtual

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

Implemented in Botan::EMSA_PKCS1v15_Raw, and Botan::EMSA_PKCS1v15.

◆ name()

virtual std::string Botan::EMSA::name ( ) const
pure virtual

◆ raw_data()

virtual secure_vector<uint8_t> Botan::EMSA::raw_data ( )
pure virtual
Returns
raw hash

Implemented in Botan::EMSA_PKCS1v15_Raw, and Botan::EMSA_PKCS1v15.

◆ update()

virtual void Botan::EMSA::update ( const uint8_t  input[],
size_t  length 
)
pure virtual

Add more data to the signature computation

Parameters
inputsome data
lengthlength of input in bytes

Implemented in Botan::EMSA_PKCS1v15_Raw, and Botan::EMSA_PKCS1v15.

◆ verify()

virtual bool Botan::EMSA::verify ( const secure_vector< uint8_t > &  coded,
const secure_vector< uint8_t > &  raw,
size_t  key_bits 
)
pure virtual

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

Implemented in Botan::EMSA_PKCS1v15_Raw, and Botan::EMSA_PKCS1v15.


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