StormByte-Crypto 3.1.0
C++26 cryptography module of the StormByte suite
Loading...
Searching...
No Matches
generic.hxx File Reference
#include <StormByte/safe/clonable.hxx>
#include <StormByte/crypto/secure/password.hxx>
#include <StormByte/crypto/typedefs.hxx>
#include <StormByte/crypto/visibility.h>
#include <StormByte/safe/optional.hxx>
#include <StormByte/safe/secure_binary.hxx>
#include <StormByte/safe/string.hxx>
#include <filesystem>
#include <string_view>
Include dependency graph for generic.hxx:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  StormByte::Crypto::KeyPair::Generic
 Abstract keypair. More...

Namespaces

namespace  StormByte
 Root namespace of the StormByte suite.
namespace  StormByte::Crypto
 Crypto module of the StormByte suite.
namespace  StormByte::Crypto::KeyPair
 Keypairs of the Crypto module.

Typedefs

using StormByte::Crypto::KeyPair::PathView = std::basic_string_view<std::filesystem::path::value_type>
 Borrowed native path characters for allocation-free DLL arguments.

Enumerations

enum class  StormByte::Crypto::KeyPair::Type {
  StormByte::Crypto::KeyPair::DSA , StormByte::Crypto::KeyPair::ECC , StormByte::Crypto::KeyPair::ECDH , StormByte::Crypto::KeyPair::ECDSA ,
  StormByte::Crypto::KeyPair::ED25519 , StormByte::Crypto::KeyPair::RSA , StormByte::Crypto::KeyPair::X25519
}
 Available keypair algorithms. More...
enum class  StormByte::Crypto::KeyPair::StorageFormat { StormByte::Crypto::KeyPair::PEM , StormByte::Crypto::KeyPair::DER }
 On-disk encoding. More...

Functions

Generic::PointerType StormByte::Crypto::KeyPair::Create (Type type, unsigned short bits) noexcept
 Generate a keypair.
Generic::PointerType StormByte::Crypto::KeyPair::Load (const StormByte::Safe::SecureBinary &data) noexcept
 Load from one in-memory key (public, private, or concatenated PEM).
Generic::PointerType StormByte::Crypto::KeyPair::Load (const StormByte::Safe::SecureBinary &data, const Secure::Password &password) noexcept
 Load from one in-memory key; decrypt if needed.
Generic::PointerType StormByte::Crypto::KeyPair::Load (const StormByte::Safe::SecureBinary &publicKey, const StormByte::Safe::SecureBinary &privateKey) noexcept
 Load from separate in-memory public and private keys.
Generic::PointerType StormByte::Crypto::KeyPair::Load (const StormByte::Safe::SecureBinary &publicKey, const StormByte::Safe::SecureBinary &privateKey, const Secure::Password &password) noexcept
 Load from separate in-memory keys; decrypt the private key if needed.
Generic::PointerType StormByte::Crypto::KeyPair::Load (PathView publicKeyPath, PathView privateKeyPath) noexcept
 Load from separate public and private files.
template<typename Compatibility = void>
Generic::PointerType StormByte::Crypto::KeyPair::Load (const std::filesystem::path &publicKeyPath, const std::filesystem::path &privateKeyPath) noexcept
 Caller-side filesystem path adapter for loading separate files.
Generic::PointerType StormByte::Crypto::KeyPair::Load (PathView publicKeyPath, PathView privateKeyPath, const Secure::Password &password) noexcept
 Load from separate files; decrypt the private key if needed.
template<typename Compatibility = void>
Generic::PointerType StormByte::Crypto::KeyPair::Load (const std::filesystem::path &publicKeyPath, const std::filesystem::path &privateKeyPath, const Secure::Password &password) noexcept
 Caller-side filesystem path adapter for loading separate encrypted files.
Generic::PointerType StormByte::Crypto::KeyPair::Load (PathView path) noexcept
 Load from one file (public, private, or concatenated PEM).
template<typename Compatibility = void>
Generic::PointerType StormByte::Crypto::KeyPair::Load (const std::filesystem::path &path) noexcept
 Caller-side filesystem path adapter for loading one file.
Generic::PointerType StormByte::Crypto::KeyPair::Load (PathView path, const Secure::Password &password) noexcept
 Load from one file; decrypt if needed.
template<typename Compatibility = void>
Generic::PointerType StormByte::Crypto::KeyPair::Load (const std::filesystem::path &path, const Secure::Password &password) noexcept
 Caller-side filesystem path adapter for loading one encrypted file.