|
Botan 3.14.1
Crypto and TLS for C&
|
#include <p11_sig_stream.h>
Public Types | |
| enum class | Direction : uint8_t { Sign , Verify } |
Public Member Functions | |
| Signature_Stream & | operator= (const Signature_Stream &)=delete |
| Signature_Stream & | operator= (Signature_Stream &&)=delete |
| std::vector< uint8_t > | sign () |
| Only valid for Direction::Sign. | |
| Signature_Stream (const Signature_Stream &)=delete | |
| Signature_Stream (Direction direction, const Object &key, const MechanismWrapper &mechanism) | |
| Signature_Stream (Signature_Stream &&)=delete | |
| void | update (std::span< const uint8_t > input) |
| bool | verify (std::span< const uint8_t > signature) |
| Only valid for Direction::Verify. | |
| ~Signature_Stream () noexcept | |
Maps the streaming update() interface of a signature or verification operation onto the PKCS #11 single and multiple part functions.
Input is buffered until a second nonempty update() call so that the common case of a single update() uses C_Sign/C_Verify. Mechanisms which only support single part operations (such as CKM_ECDSA) always buffer the entire input.
The token operation is only initialized once it is actually needed, and an abandoned multiple part operation is terminated on destruction so the session remains usable.
Definition at line 30 of file p11_sig_stream.h.
|
strong |
| Botan::PKCS11::Signature_Stream::Signature_Stream | ( | Direction | direction, |
| const Object & | key, | ||
| const MechanismWrapper & | mechanism ) |
| direction | whether signatures are created or verified |
| key | the key object; must outlive this object |
| mechanism | the mechanism; must outlive this object |
Definition at line 38 of file p11_sig_stream.cpp.
Referenced by operator=(), operator=(), Signature_Stream(), and Signature_Stream().
|
noexcept |
Definition at line 44 of file p11_sig_stream.cpp.
References Sign.
|
delete |
References Signature_Stream().
|
delete |
References Signature_Stream().
|
delete |
References Signature_Stream().
|
delete |
References sign(), Signature_Stream(), update(), and verify().
| std::vector< uint8_t > Botan::PKCS11::Signature_Stream::sign | ( | ) |
Only valid for Direction::Sign.
Definition at line 112 of file p11_sig_stream.cpp.
References BOTAN_STATE_CHECK, and Sign.
Referenced by operator=().
| void Botan::PKCS11::Signature_Stream::update | ( | std::span< const uint8_t > | input | ) |
Definition at line 88 of file p11_sig_stream.cpp.
Referenced by operator=().
| bool Botan::PKCS11::Signature_Stream::verify | ( | std::span< const uint8_t > | signature | ) |
Only valid for Direction::Verify.
Definition at line 131 of file p11_sig_stream.cpp.
References BOTAN_STATE_CHECK, Botan::PKCS11::checked_ulong_cast(), Botan::PKCS11::OK, Botan::PKCS11::SignatureInvalid, Botan::PKCS11::SignatureLenRange, and Verify.
Referenced by operator=().