10Duke Enterprise C++ SDK
Loading...
Searching...
No Matches
tenduke::crypto::win::cng::BCryptAlgorithm Class Reference

#include <BCryptAlgorithm.h>

Detailed Description

RAII wrapper for BCRYPT_ALG_HANDLE.

Manages the lifecycle of a BCrypt algorithm provider handle. Automatically opens the algorithm provider on construction and closes it on destruction. Move-only type: supports move semantics but prevents copying to avoid double-release.

Public Member Functions

 BCryptAlgorithm (LPCWSTR algorithmName, ULONG flags=0)
 Opens a BCrypt algorithm provider.
 ~BCryptAlgorithm ()
 Closes the algorithm provider handle.
 BCryptAlgorithm (BCryptAlgorithm &&other) noexcept
 Move constructor.
BCryptAlgorithmoperator= (BCryptAlgorithm &&other) noexcept
 Move assignment operator.
BCRYPT_ALG_HANDLE get () const
 Gets the underlying BCRYPT_ALG_HANDLE.

Constructor & Destructor Documentation

◆ BCryptAlgorithm() [1/2]

tenduke::crypto::win::cng::BCryptAlgorithm::BCryptAlgorithm ( LPCWSTR algorithmName,
ULONG flags = 0 )
explicit

Opens a BCrypt algorithm provider.

Parameters
algorithmNamethe name of the algorithm (e.g., BCRYPT_AES_ALGORITHM)
flagsoptional flags for BCryptOpenAlgorithmProvider (e.g., BCRYPT_ALG_HANDLE_HMAC_FLAG)
Exceptions
CryptoExceptionif the algorithm provider cannot be opened

◆ BCryptAlgorithm() [2/2]

tenduke::crypto::win::cng::BCryptAlgorithm::BCryptAlgorithm ( BCryptAlgorithm && other)
noexcept

Move constructor.

Transfers ownership of the handle.

Member Function Documentation

◆ get()

BCRYPT_ALG_HANDLE tenduke::crypto::win::cng::BCryptAlgorithm::get ( ) const

Gets the underlying BCRYPT_ALG_HANDLE.

Returns
the BCrypt algorithm handle

◆ operator=()

xdwincng::BCryptAlgorithm & tenduke::crypto::win::cng::BCryptAlgorithm::operator= ( BCryptAlgorithm && other)
noexcept

Move assignment operator.

Transfers ownership of the handle.


The documentation for this class was generated from the following files:
  • core/services/windows/src/crypto/bcrypt/BCryptAlgorithm.h
  • core/services/windows/src/crypto/bcrypt/BCryptAlgorithm.cpp