core.sys.windows.bcrypt
Cryptographic primitives
Translated from MinGW-w64 Windows headers
License
var BCRYPT_AUTHENTICATED_CIPHER_MODE_INFO_VERSION BCRYPT_BLOCK_PADDING BCRYPT_NO_KEY_VALIDATION BCRYPT_OBJECT_ALIGNMENT BCRYPT_PROV_DISPATCH BCRYPT_RSAFULLPRIVATE_BLOB BCRYPT_RSAFULLPRIVATE_MAGIC BCRYPTBUFFER_VERSION CRYPT_DEFAULT_CONTEXT CRYPT_OVERWRITE KDF_USE_SECRET_AS_HMAC_KEY_FLAG TLS_13_PRE_SHARED_KEY
alias BCRYPT_ALG_HANDLE BCRYPT_AUTH_TAG_LENGTHS_STRUCT BCRYPT_HANDLE BCRYPT_HASH_HANDLE BCRYPT_HASH_OPERATION_TYPE BCRYPT_KEY_HANDLE BCRYPT_MULTI_OPERATION_TYPE BCRYPT_SECRET_HANDLE DSAFIPSVERSION_ENUM HASHALGORITHM_ENUM PBCRYPT_AUTHENTICATED_CIPHER_MODE_INFO PBCRYPT_DH_KEY_BLOB PBCRYPT_DSA_KEY_BLOB PBCRYPT_DSA_KEY_BLOB_V2 PBCRYPT_ECCKEY_BLOB PBCRYPT_INTERFACE_VERSION PBCRYPT_KEY_DATA_BLOB_HEADER PBCryptBuffer PBCryptBufferDesc PCRYPT_CONTEXT_CONFIG PCRYPT_CONTEXT_FUNCTION_CONFIG PCRYPT_CONTEXT_FUNCTION_PROVIDERS PCRYPT_CONTEXT_FUNCTIONS PCRYPT_CONTEXTS PCRYPT_IMAGE_REF PCRYPT_IMAGE_REG PCRYPT_INTERFACE_REG PCRYPT_PROPERTY_REF PCRYPT_PROVIDER_REF PCRYPT_PROVIDER_REFS PCRYPT_PROVIDER_REG PCRYPT_PROVIDERS
struct BCRYPT_ALGORITHM_IDENTIFIER BCRYPT_AUTHENTICATED_CIPHER_MODE_INFO BCRYPT_DH_KEY_BLOB BCRYPT_DH_PARAMETER_HEADER BCRYPT_DSA_KEY_BLOB BCRYPT_DSA_KEY_BLOB_V2 BCRYPT_DSA_PARAMETER_HEADER BCRYPT_DSA_PARAMETER_HEADER_V2 BCRYPT_ECC_CURVE_NAMES BCRYPT_ECCKEY_BLOB BCRYPT_INTERFACE_VERSION BCRYPT_KEY_BLOB BCRYPT_KEY_DATA_BLOB_HEADER BCRYPT_KEY_LENGTHS_STRUCT BCRYPT_MULTI_HASH_OPERATION BCRYPT_MULTI_OBJECT_LENGTH_STRUCT BCRYPT_OAEP_PADDING_INFO BCRYPT_OID BCRYPT_OID_LIST BCRYPT_PKCS1_PADDING_INFO BCRYPT_PROVIDER_NAME BCRYPT_PSS_PADDING_INFO BCRYPT_RSAKEY_BLOB BCryptBuffer BCryptBufferDesc CRYPT_CONTEXT_CONFIG CRYPT_CONTEXT_FUNCTION_CONFIG CRYPT_CONTEXT_FUNCTION_PROVIDERS CRYPT_CONTEXT_FUNCTIONS CRYPT_CONTEXTS CRYPT_IMAGE_REF CRYPT_IMAGE_REG CRYPT_INTERFACE_REG CRYPT_PROPERTY_REF CRYPT_PROVIDER_REF CRYPT_PROVIDER_REFS CRYPT_PROVIDER_REG CRYPT_PROVIDERS
fn BCRYPT_INIT_AUTH_MODE_INFO BCRYPT_IS_INTERFACE_VERSION_COMPATIBLE BCRYPT_MAKE_INTERFACE_VERSION BCRYPT_SUCCESS BCryptAddContextFunction BCryptCloseAlgorithmProvider BCryptConfigureContext BCryptConfigureContextFunction BCryptCreateContext BCryptCreateHash BCryptDecrypt BCryptDeleteContext BCryptDeriveKey BCryptDeriveKeyCapi BCryptDeriveKeyPBKDF2 BCryptDestroyHash BCryptDestroyKey BCryptDestroySecret BCryptDuplicateHash BCryptDuplicateKey BCryptEncrypt BCryptEnumAlgorithms BCryptEnumContextFunctionProviders BCryptEnumContextFunctions BCryptEnumContexts BCryptEnumProviders BCryptEnumRegisteredProviders BCryptExportKey BCryptFinalizeKeyPair BCryptFinishHash BCryptFreeBuffer BCryptGenerateKeyPair BCryptGenerateSymmetricKey BCryptGenRandom BCryptGetFipsAlgorithmMode BCryptGetProperty BCryptHashData BCryptImportKey BCryptImportKeyPair BCryptKeyDerivation BCryptOpenAlgorithmProvider BCryptQueryContextConfiguration BCryptQueryContextFunctionConfiguration BCryptQueryContextFunctionProperty BCryptQueryProviderRegistration BCryptRegisterConfigChangeNotify BCryptRemoveContextFunction BCryptResolveProviders BCryptSecretAgreement BCryptSetContextFunctionProperty BCryptSetProperty BCryptSignHash BCryptUnregisterConfigChangeNotify BCryptVerifySignature
Types 70
structBCRYPT_OID
structBCRYPT_OID_LIST
Fields
LPCWSTR pszAlgIdstructBCRYPT_PSS_PADDING_INFO
structBCRYPT_OAEP_PADDING_INFO
structBCryptBuffer
aliasPBCryptBuffer = BCryptBuffer *
structBCryptBufferDesc
aliasPBCryptBufferDesc = BCryptBufferDesc *
aliasBCRYPT_HANDLE = PVOID
aliasBCRYPT_ALG_HANDLE = PVOID
aliasBCRYPT_KEY_HANDLE = PVOID
aliasBCRYPT_HASH_HANDLE = PVOID
aliasBCRYPT_SECRET_HANDLE = PVOID
structBCRYPT_KEY_BLOB
Fields
ULONG MagicstructBCRYPT_RSAKEY_BLOB
structBCRYPT_ECCKEY_BLOB
aliasPBCRYPT_ECCKEY_BLOB = BCRYPT_ECCKEY_BLOB *
structBCRYPT_DH_KEY_BLOB
aliasPBCRYPT_DH_KEY_BLOB = BCRYPT_DH_KEY_BLOB *
aliasPBCRYPT_DSA_KEY_BLOB = BCRYPT_DSA_KEY_BLOB *
aliasHASHALGORITHM_ENUM = int
aliasDSAFIPSVERSION_ENUM = int
structBCRYPT_DSA_KEY_BLOB_V2
Fields
ULONG dwMagicULONG cbKeyHASHALGORITHM_ENUM hashAlgorithmDSAFIPSVERSION_ENUM standardVersionULONG cbSeedLengthULONG cbGroupSizeUCHAR[4] CountFields
ULONG cbLengthULONG dwMagicULONG cbKeyLengthHASHALGORITHM_ENUM hashAlgorithmDSAFIPSVERSION_ENUM standardVersionULONG cbSeedLengthULONG cbGroupSizeUCHAR[4] CountstructBCRYPT_ECC_CURVE_NAMES
aliasBCRYPT_HASH_OPERATION_TYPE = int
aliasBCRYPT_MULTI_OPERATION_TYPE = int
structBCRYPT_PROVIDER_NAME
Fields
LPWSTR pszProviderNamestructBCRYPT_INTERFACE_VERSION
structCRYPT_INTERFACE_REG
aliasPCRYPT_INTERFACE_REG = CRYPT_INTERFACE_REG *
structCRYPT_IMAGE_REG
aliasPCRYPT_IMAGE_REG = CRYPT_IMAGE_REG *
structCRYPT_PROVIDER_REG
aliasPCRYPT_PROVIDER_REG = CRYPT_PROVIDER_REG *
structCRYPT_PROVIDERS
aliasPCRYPT_PROVIDERS = CRYPT_PROVIDERS *
structCRYPT_CONTEXT_CONFIG
structCRYPT_CONTEXTS
aliasPCRYPT_CONTEXTS = CRYPT_CONTEXTS *
structCRYPT_CONTEXT_FUNCTIONS
structCRYPT_PROPERTY_REF
aliasPCRYPT_PROPERTY_REF = CRYPT_PROPERTY_REF *
structCRYPT_IMAGE_REF
aliasPCRYPT_IMAGE_REF = CRYPT_IMAGE_REF *
structCRYPT_PROVIDER_REF
Fields
ULONG dwInterfacePWSTR pszFunctionPWSTR pszProviderULONG cPropertiesPCRYPT_PROPERTY_REF * rgpPropertiesPCRYPT_IMAGE_REF pUMPCRYPT_IMAGE_REF pKMaliasPCRYPT_PROVIDER_REF = CRYPT_PROVIDER_REF *
structCRYPT_PROVIDER_REFS
aliasPCRYPT_PROVIDER_REFS = CRYPT_PROVIDER_REFS *
Functions 54
fn
void BCRYPT_INIT_AUTH_MODE_INFO(ref BCRYPT_AUTHENTICATED_CIPHER_MODE_INFO _AUTH_INFO_STRUCT_) @nogc nothrow pure @safefn
BCRYPT_INTERFACE_VERSION BCRYPT_MAKE_INTERFACE_VERSION(int major, int minor)fn
bool BCRYPT_IS_INTERFACE_VERSION_COMPATIBLE(BCRYPT_INTERFACE_VERSION loader, BCRYPT_INTERFACE_VERSION provider)fn
NTSTATUS BCryptOpenAlgorithmProvider(scope BCRYPT_ALG_HANDLE * phAlgorithm, scope LPCWSTR pszAlgId, scope LPCWSTR pszImplementation, ULONG dwFlags)fn
NTSTATUS BCryptEnumAlgorithms(ULONG dwAlgOperations, scope ULONG * pAlgCount, scope BCRYPT_ALGORITHM_IDENTIFIER * * ppAlgList, ULONG dwFlags)fn
NTSTATUS BCryptEnumProviders(scope LPCWSTR pszAlgId, scope ULONG * pImplCount, scope BCRYPT_PROVIDER_NAME * * ppImplList, ULONG dwFlags)fn
NTSTATUS BCryptGetProperty(BCRYPT_HANDLE hObject, scope LPCWSTR pszProperty, scope PUCHAR pbOutput, ULONG cbOutput, scope ULONG * pcbResult, ULONG dwFlags)fn
NTSTATUS BCryptSetProperty(BCRYPT_HANDLE hObject, scope LPCWSTR pszProperty, scope PUCHAR pbInput, ULONG cbInput, ULONG dwFlags)fn
NTSTATUS BCryptCloseAlgorithmProvider(BCRYPT_ALG_HANDLE hAlgorithm, ULONG dwFlags)fn
VOID BCryptFreeBuffer(PVOID pvBuffer)fn
NTSTATUS BCryptGenerateSymmetricKey(BCRYPT_ALG_HANDLE hAlgorithm, scope BCRYPT_KEY_HANDLE * phKey, scope PUCHAR pbKeyObject, ULONG cbKeyObject, scope PUCHAR pbSecret, ULONG cbSecret, ULONG dwFlags)fn
NTSTATUS BCryptGenerateKeyPair(BCRYPT_ALG_HANDLE hAlgorithm, scope BCRYPT_KEY_HANDLE * phKey, ULONG dwLength, ULONG dwFlags)fn
NTSTATUS BCryptEncrypt(BCRYPT_KEY_HANDLE hKey, scope PUCHAR pbInput, ULONG cbInput, scope VOID * pPaddingInfo, scope PUCHAR pbIV, ULONG cbIV, scope PUCHAR pbOutput, ULONG cbOutput, scope ULONG * pcbResult, ULONG dwFlags)fn
NTSTATUS BCryptDecrypt(BCRYPT_KEY_HANDLE hKey, scope PUCHAR pbInput, ULONG cbInput, scope VOID * pPaddingInfo, scope PUCHAR pbIV, ULONG cbIV, scope PUCHAR pbOutput, ULONG cbOutput, scope ULONG * pcbResult, ULONG dwFlags)fn
NTSTATUS BCryptExportKey(BCRYPT_KEY_HANDLE hKey, BCRYPT_KEY_HANDLE hExportKey, scope LPCWSTR pszBlobType, scope PUCHAR pbOutput, ULONG cbOutput, scope ULONG * pcbResult, ULONG dwFlags)fn
NTSTATUS BCryptImportKey(BCRYPT_ALG_HANDLE hAlgorithm, BCRYPT_KEY_HANDLE hImportKey, scope LPCWSTR pszBlobType, scope BCRYPT_KEY_HANDLE * phKey, scope PUCHAR pbKeyObject, ULONG cbKeyObject, scope PUCHAR pbInput, ULONG cbInput, ULONG dwFlags)fn
NTSTATUS BCryptImportKeyPair(BCRYPT_ALG_HANDLE hAlgorithm, BCRYPT_KEY_HANDLE hImportKey, scope LPCWSTR pszBlobType, scope BCRYPT_KEY_HANDLE * phKey, scope PUCHAR pbInput, ULONG cbInput, ULONG dwFlags)fn
NTSTATUS BCryptDuplicateKey(BCRYPT_KEY_HANDLE hKey, scope BCRYPT_KEY_HANDLE * phNewKey, scope PUCHAR pbKeyObject, ULONG cbKeyObject, ULONG dwFlags)fn
NTSTATUS BCryptFinalizeKeyPair(BCRYPT_KEY_HANDLE hKey, ULONG dwFlags)fn
NTSTATUS BCryptDestroySecret(BCRYPT_SECRET_HANDLE hSecret)fn
NTSTATUS BCryptSignHash(BCRYPT_KEY_HANDLE hKey, scope VOID * pPaddingInfo, scope PUCHAR pbInput, ULONG cbInput, scope PUCHAR pbOutput, ULONG cbOutput, scope ULONG * pcbResult, ULONG dwFlags)fn
NTSTATUS BCryptVerifySignature(BCRYPT_KEY_HANDLE hKey, scope VOID * pPaddingInfo, scope PUCHAR pbHash, ULONG cbHash, scope PUCHAR pbSignature, ULONG cbSignature, ULONG dwFlags)fn
NTSTATUS BCryptSecretAgreement(BCRYPT_KEY_HANDLE hPrivKey, BCRYPT_KEY_HANDLE hPubKey, scope BCRYPT_SECRET_HANDLE * phAgreedSecret, ULONG dwFlags)fn
NTSTATUS BCryptDeriveKey(BCRYPT_SECRET_HANDLE hSharedSecret, LPCWSTR pwszKDF, scope BCryptBufferDesc * pParameterList, scope PUCHAR pbDerivedKey, ULONG cbDerivedKey, scope ULONG * pcbResult, ULONG dwFlags)fn
NTSTATUS BCryptKeyDerivation(BCRYPT_KEY_HANDLE hKey, scope BCryptBufferDesc * pParameterList, scope PUCHAR pbDerivedKey, ULONG cbDerivedKey, scope ULONG * pcbResult, ULONG dwFlags)fn
NTSTATUS BCryptCreateHash(BCRYPT_ALG_HANDLE hAlgorithm, scope BCRYPT_HASH_HANDLE * phHash, scope PUCHAR pbHashObject, ULONG cbHashObject, scope PUCHAR pbSecret, ULONG cbSecret, ULONG dwFlags)fn
NTSTATUS BCryptHashData(BCRYPT_HASH_HANDLE hHash, scope PUCHAR pbInput, ULONG cbInput, ULONG dwFlags)fn
NTSTATUS BCryptFinishHash(BCRYPT_HASH_HANDLE hHash, scope PUCHAR pbOutput, ULONG cbOutput, ULONG dwFlags)fn
NTSTATUS BCryptDuplicateHash(BCRYPT_HASH_HANDLE hHash, scope BCRYPT_HASH_HANDLE * phNewHash, scope PUCHAR pbHashObject, ULONG cbHashObject, ULONG dwFlags)fn
NTSTATUS BCryptDestroyHash(BCRYPT_HASH_HANDLE hHash)fn
NTSTATUS BCryptGenRandom(BCRYPT_ALG_HANDLE hAlgorithm, scope PUCHAR pbBuffer, ULONG cbBuffer, ULONG dwFlags)fn
NTSTATUS BCryptDeriveKeyCapi(BCRYPT_HASH_HANDLE hHash, BCRYPT_ALG_HANDLE hTargetAlg, scope PUCHAR pbDerivedKey, ULONG cbDerivedKey, ULONG dwFlags)fn
NTSTATUS BCryptDeriveKeyPBKDF2(BCRYPT_ALG_HANDLE hPrf, scope PUCHAR pbPassword, ULONG cbPassword, scope PUCHAR pbSalt, ULONG cbSalt, ULONGLONG cIterations, scope PUCHAR pbDerivedKey, ULONG cbDerivedKey, ULONG dwFlags)fn
NTSTATUS BCryptResolveProviders(scope LPCWSTR pszContext, ULONG dwInterface, scope LPCWSTR pszFunction, scope LPCWSTR pszProvider, ULONG dwMode, ULONG dwFlags, scope ULONG * pcbBuffer, scope PCRYPT_PROVIDER_REFS * ppBuffer)fn
NTSTATUS BCryptGetFipsAlgorithmMode(scope BOOLEAN * pfEnabled)fn
NTSTATUS BCryptQueryProviderRegistration(scope LPCWSTR pszProvider, ULONG dwMode, ULONG dwInterface, scope ULONG * pcbBuffer, scope PCRYPT_PROVIDER_REG * ppBuffer)fn
NTSTATUS BCryptEnumRegisteredProviders(scope ULONG * pcbBuffer, scope PCRYPT_PROVIDERS * ppBuffer)fn
NTSTATUS BCryptCreateContext(ULONG dwTable, scope LPCWSTR pszContext, PCRYPT_CONTEXT_CONFIG pConfig)fn
NTSTATUS BCryptDeleteContext(ULONG dwTable, scope LPCWSTR pszContext)fn
NTSTATUS BCryptEnumContexts(ULONG dwTable, scope ULONG * pcbBuffer, scope PCRYPT_CONTEXTS * ppBuffer)fn
NTSTATUS BCryptConfigureContext(ULONG dwTable, scope LPCWSTR pszContext, PCRYPT_CONTEXT_CONFIG pConfig)fn
NTSTATUS BCryptQueryContextConfiguration(ULONG dwTable, scope LPCWSTR pszContext, scope ULONG * pcbBuffer, scope PCRYPT_CONTEXT_CONFIG * ppBuffer)fn
NTSTATUS BCryptAddContextFunction(ULONG dwTable, scope LPCWSTR pszContext, ULONG dwInterface, scope LPCWSTR pszFunction, ULONG dwPosition)fn
NTSTATUS BCryptRemoveContextFunction(ULONG dwTable, scope LPCWSTR pszContext, ULONG dwInterface, scope LPCWSTR pszFunction)fn
NTSTATUS BCryptEnumContextFunctions(ULONG dwTable, scope LPCWSTR pszContext, ULONG dwInterface, scope ULONG * pcbBuffer, scope PCRYPT_CONTEXT_FUNCTIONS * ppBuffer)fn
NTSTATUS BCryptConfigureContextFunction(ULONG dwTable, scope LPCWSTR pszContext, ULONG dwInterface, scope LPCWSTR pszFunction, PCRYPT_CONTEXT_FUNCTION_CONFIG pConfig)fn
NTSTATUS BCryptQueryContextFunctionConfiguration(ULONG dwTable, scope LPCWSTR pszContext, ULONG dwInterface, scope LPCWSTR pszFunction, scope ULONG * pcbBuffer, scope PCRYPT_CONTEXT_FUNCTION_CONFIG * ppBuffer)fn
NTSTATUS BCryptEnumContextFunctionProviders(ULONG dwTable, scope LPCWSTR pszContext, ULONG dwInterface, scope LPCWSTR pszFunction, scope ULONG * pcbBuffer, scope PCRYPT_CONTEXT_FUNCTION_PROVIDERS * ppBuffer)fn
NTSTATUS BCryptSetContextFunctionProperty(ULONG dwTable, scope LPCWSTR pszContext, ULONG dwInterface, scope LPCWSTR pszFunction, LPCWSTR pszProperty, ULONG cbValue, scope PUCHAR pbValue)fn
NTSTATUS BCryptQueryContextFunctionProperty(ULONG dwTable, scope LPCWSTR pszContext, ULONG dwInterface, scope LPCWSTR pszFunction, LPCWSTR pszProperty, ULONG * pcbValue, scope PUCHAR * ppbValue)fn
NTSTATUS BCryptUnregisterConfigChangeNotify(HANDLE hEvent)Variables 12
enumvar
BCRYPT_OBJECT_ALIGNMENT = 16enumvar
KDF_USE_SECRET_AS_HMAC_KEY_FLAG = 1enumvar
BCRYPT_AUTHENTICATED_CIPHER_MODE_INFO_VERSION = 1enumvar
BCRYPT_PROV_DISPATCH = 0x00000001enumvar
BCRYPT_BLOCK_PADDING = 0x00000001enumvar
BCRYPTBUFFER_VERSION = 0enumvar
BCRYPT_RSAFULLPRIVATE_BLOB = "RSAFULLPRIVATEBLOB"wenumvar
BCRYPT_RSAFULLPRIVATE_MAGIC = 0x33415352enumvar
TLS_13_PRE_SHARED_KEY = "TLS13PRESHAREDKEY"wenumvar
BCRYPT_NO_KEY_VALIDATION = 0x00000008enumvar
CRYPT_OVERWRITE = 0x00000001enumvar
CRYPT_DEFAULT_CONTEXT = "Default"w