|
Botan 3.14.1
Crypto and TLS for C&
|
#include <pk_options.h>
Public Member Functions | |
| PK_Encryption_Options & | operator= (const PK_Encryption_Options &other)=default |
| PK_Encryption_Options & | operator= (PK_Encryption_Options &&other)=default |
| PK_Encryption_Options ()=default | |
| PK_Encryption_Options (const PK_Encryption_Options &)=default | |
| PK_Encryption_Options (PK_Encryption_Options &&other)=default | |
| std::string | to_string () const |
| PK_Encryption_Options | with_context (std::span< const uint8_t > context) |
| PK_Encryption_Options | with_context (std::string_view context) |
| PK_Encryption_Options | with_hash (std::string_view hash) |
| PK_Encryption_Options | with_mgf1_hash (std::string_view hash) |
| PK_Encryption_Options | with_padding (std::string_view padding) |
| PK_Encryption_Options | with_provider (std::string_view provider) |
| ~PK_Encryption_Options () | |
Friends | |
| class | PK_Encryption_Options_Reader |
Public key encryption/decryption options
The normal usage of this is in a builder style, eg
PK_Encryption_Options() .with_padding("OAEP") .with_hash("SHA-256") .with_context(label)
As with PK_Signature_Options, every option that is set must be understood by the encryption scheme in use; constructing the PK_Encryptor_EME or PK_Decryptor_EME throws an exception otherwise. An option is never silently ignored.
Definition at line 219 of file pk_options.h.
|
default |
|
default |
References PK_Encryption_Options().
|
default |
References PK_Encryption_Options().
|
default |
References PK_Encryption_Options(), to_string(), with_context(), with_hash(), with_mgf1_hash(), with_padding(), and with_provider().
|
default |
References PK_Encryption_Options().
|
default |
References PK_Encryption_Options().
| std::string Botan::PK_Encryption_Options::to_string | ( | ) | const |
Format this PK_Encryption_Options as a string
This is primarily intended for debugging and error messages; the format is not fixed
Definition at line 372 of file pk_options.cpp.
References Botan::hex_encode(), and name.
Referenced by ~PK_Encryption_Options().
| PK_Encryption_Options Botan::PK_Encryption_Options::with_context | ( | std::span< const uint8_t > | context | ) |
Specify a context
For OAEP this is the label ("L" in RFC 8017). Schemes without such a parameter reject this option.
Definition at line 299 of file pk_options.cpp.
References BOTAN_STATE_CHECK_MSG, and PK_Encryption_Options().
Referenced by with_context(), and ~PK_Encryption_Options().
| PK_Encryption_Options Botan::PK_Encryption_Options::with_context | ( | std::string_view | context | ) |
Specify a context as a string
Equivalent to the version taking a span above; just uses the bytes of the string instead.
Definition at line 306 of file pk_options.cpp.
References Botan::as_span_of_bytes(), PK_Encryption_Options(), and with_context().
| PK_Encryption_Options Botan::PK_Encryption_Options::with_hash | ( | std::string_view | hash | ) |
Specify the hash function
For OAEP this selects the hash used for the label and (unless with_mgf1_hash is also used) for the mask generation function. For SM2 it selects the KDF hash, and defaults to SM3.
Definition at line 280 of file pk_options.cpp.
References BOTAN_STATE_CHECK_MSG, and PK_Encryption_Options().
Referenced by Botan::parse_legacy_enc_options(), and ~PK_Encryption_Options().
| PK_Encryption_Options Botan::PK_Encryption_Options::with_mgf1_hash | ( | std::string_view | hash | ) |
Specify a different hash function for OAEP's MGF1
Only OAEP supports this; by default MGF1 uses the same hash as OAEP
Definition at line 289 of file pk_options.cpp.
References BOTAN_STATE_CHECK_MSG, and PK_Encryption_Options().
Referenced by ~PK_Encryption_Options().
| PK_Encryption_Options Botan::PK_Encryption_Options::with_padding | ( | std::string_view | padding | ) |
Specify the padding scheme
For RSA (and ElGamal) this is required, and is one of "OAEP", "PKCS1v15" or "Raw". Other schemes do not use padding.
Definition at line 271 of file pk_options.cpp.
References BOTAN_STATE_CHECK_MSG, and PK_Encryption_Options().
Referenced by Botan::parse_legacy_enc_options(), and ~PK_Encryption_Options().
| PK_Encryption_Options Botan::PK_Encryption_Options::with_provider | ( | std::string_view | provider | ) |
Specify a provider that should be used
This is rarely relevant
Definition at line 310 of file pk_options.cpp.
References BOTAN_STATE_CHECK_MSG, and PK_Encryption_Options().
Referenced by Botan::Private_Key::create_decryption_op(), Botan::Public_Key::create_encryption_op(), and ~PK_Encryption_Options().
|
friend |
Definition at line 272 of file pk_options.h.
References PK_Encryption_Options_Reader.
Referenced by PK_Encryption_Options_Reader.