/**
 * Windows API header module
 *
 * Translated from MinGW-w64 Windows headers
 *
 * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost License 1.0)
 * Source: $(DRUNTIMESRC core/sys/windows/_ncrypt.d)
 */
module core.sys.windows.ncrypt;
version (Windows):

pragma(lib, "ncrypt");

public import core.sys.windows.basetsd : SIZE_T;
public import core.sys.windows.bcrypt;
public import core.sys.windows.security : SECURITY_STATUS;
public import core.sys.windows.sdkddkver;
public import core.sys.windows.windef;

extern (Windows):
@nogc:
nothrow:

enum NCRYPT_MAX_KEY_NAME_LENGTH = 512;
enum NCRYPT_MAX_ALG_ID_LENGTH = 512;

enum {
    MS_KEY_STORAGE_PROVIDER = "Microsoft Software Key Storage Provider"w,
    MS_SMART_CARD_KEY_STORAGE_PROVIDER = "Microsoft Smart Card Key Storage Provider"w,
    MS_PLATFORM_KEY_STORAGE_PROVIDER = "Microsoft Platform Crypto Provider"w,
}

enum NCRYPT_RSA_ALGORITHM = BCRYPT_RSA_ALGORITHM;
enum NCRYPT_RSA_SIGN_ALGORITHM = BCRYPT_RSA_SIGN_ALGORITHM;
enum NCRYPT_DH_ALGORITHM = BCRYPT_DH_ALGORITHM;
enum NCRYPT_DSA_ALGORITHM = BCRYPT_DSA_ALGORITHM;
enum NCRYPT_MD2_ALGORITHM = BCRYPT_MD2_ALGORITHM;
enum NCRYPT_MD4_ALGORITHM = BCRYPT_MD4_ALGORITHM;
enum NCRYPT_MD5_ALGORITHM = BCRYPT_MD5_ALGORITHM;
enum NCRYPT_SHA1_ALGORITHM = BCRYPT_SHA1_ALGORITHM;
enum NCRYPT_SHA256_ALGORITHM = BCRYPT_SHA256_ALGORITHM;
enum NCRYPT_SHA384_ALGORITHM = BCRYPT_SHA384_ALGORITHM;
enum NCRYPT_SHA512_ALGORITHM = BCRYPT_SHA512_ALGORITHM;
enum NCRYPT_ECDSA_P256_ALGORITHM = BCRYPT_ECDSA_P256_ALGORITHM;
enum NCRYPT_ECDSA_P384_ALGORITHM = BCRYPT_ECDSA_P384_ALGORITHM;
enum NCRYPT_ECDSA_P521_ALGORITHM = BCRYPT_ECDSA_P521_ALGORITHM;
enum NCRYPT_ECDH_P256_ALGORITHM = BCRYPT_ECDH_P256_ALGORITHM;
enum NCRYPT_ECDH_P384_ALGORITHM = BCRYPT_ECDH_P384_ALGORITHM;
enum NCRYPT_ECDH_P521_ALGORITHM = BCRYPT_ECDH_P521_ALGORITHM;

static if (NTDDI_VERSION >= NTDDI_WIN8) {
    enum NCRYPT_AES_ALGORITHM = BCRYPT_AES_ALGORITHM;
    enum NCRYPT_RC2_ALGORITHM = BCRYPT_RC2_ALGORITHM;
    enum NCRYPT_3DES_ALGORITHM = BCRYPT_3DES_ALGORITHM;
    enum NCRYPT_DES_ALGORITHM = BCRYPT_DES_ALGORITHM;
    enum NCRYPT_DESX_ALGORITHM = BCRYPT_DESX_ALGORITHM;
    enum NCRYPT_3DES_112_ALGORITHM = BCRYPT_3DES_112_ALGORITHM;
    enum NCRYPT_SP800108_CTR_HMAC_ALGORITHM = BCRYPT_SP800108_CTR_HMAC_ALGORITHM;
    enum NCRYPT_SP80056A_CONCAT_ALGORITHM = BCRYPT_SP80056A_CONCAT_ALGORITHM;
    enum NCRYPT_PBKDF2_ALGORITHM = BCRYPT_PBKDF2_ALGORITHM;
    enum NCRYPT_CAPI_KDF_ALGORITHM = BCRYPT_CAPI_KDF_ALGORITHM;
}

enum NCRYPT_KEY_STORAGE_ALGORITHM = "KEY_STORAGE"w;

enum NCRYPT_CIPHER_INTERFACE = BCRYPT_CIPHER_INTERFACE;
enum NCRYPT_HASH_INTERFACE = BCRYPT_HASH_INTERFACE;
enum NCRYPT_ASYMMETRIC_ENCRYPTION_INTERFACE = BCRYPT_ASYMMETRIC_ENCRYPTION_INTERFACE;
enum NCRYPT_SECRET_AGREEMENT_INTERFACE = BCRYPT_SECRET_AGREEMENT_INTERFACE;
enum NCRYPT_SIGNATURE_INTERFACE = BCRYPT_SIGNATURE_INTERFACE;
static if (NTDDI_VERSION >= NTDDI_WIN8)
    enum NCRYPT_KEY_DERIVATION_INTERFACE = BCRYPT_KEY_DERIVATION_INTERFACE;

enum NCRYPT_KEY_STORAGE_INTERFACE = 0x00010001;
enum NCRYPT_SCHANNEL_INTERFACE = 0x00010002;
enum NCRYPT_SCHANNEL_SIGNATURE_INTERFACE = 0x00010003;
static if (NTDDI_VERSION >= NTDDI_WIN8)
    enum NCRYPT_KEY_PROTECTION_INTERFACE = 0x00010004;

enum NCRYPT_RSA_ALGORITHM_GROUP = NCRYPT_RSA_ALGORITHM;
enum NCRYPT_DH_ALGORITHM_GROUP = NCRYPT_DH_ALGORITHM;
enum NCRYPT_DSA_ALGORITHM_GROUP = NCRYPT_DSA_ALGORITHM;
enum NCRYPT_ECDSA_ALGORITHM_GROUP = "ECDSA"w;
enum NCRYPT_ECDH_ALGORITHM_GROUP = "ECDH"w;

static if (NTDDI_VERSION >= NTDDI_WIN8) {
    enum NCRYPT_AES_ALGORITHM_GROUP = NCRYPT_AES_ALGORITHM;
    enum NCRYPT_RC2_ALGORITHM_GROUP = NCRYPT_RC2_ALGORITHM;
    enum NCRYPT_DES_ALGORITHM_GROUP = "DES"w;
    enum NCRYPT_KEY_DERIVATION_GROUP = "KEY_DERIVATION"w;
}

enum NCRYPTBUFFER_VERSION = 0;
enum NCRYPTBUFFER_EMPTY = 0;
enum NCRYPTBUFFER_DATA = 1;
enum NCRYPTBUFFER_PROTECTION_DESCRIPTOR_STRING = 3;
enum NCRYPTBUFFER_PROTECTION_FLAGS = 4;
enum NCRYPTBUFFER_SSL_CLIENT_RANDOM = 20;
enum NCRYPTBUFFER_SSL_SERVER_RANDOM = 21;
enum NCRYPTBUFFER_SSL_HIGHEST_VERSION = 22;
enum NCRYPTBUFFER_SSL_CLEAR_KEY = 23;
enum NCRYPTBUFFER_SSL_KEY_ARG_DATA = 24;
enum NCRYPTBUFFER_PKCS_OID = 40;
enum NCRYPTBUFFER_PKCS_ALG_OID = 41;
enum NCRYPTBUFFER_PKCS_ALG_PARAM = 42;
enum NCRYPTBUFFER_PKCS_ALG_ID = 43;
enum NCRYPTBUFFER_PKCS_ATTRS = 44;
enum NCRYPTBUFFER_PKCS_KEY_NAME = 45;
enum NCRYPTBUFFER_PKCS_SECRET = 46;
enum NCRYPTBUFFER_CERT_BLOB = 47;

enum NCRYPT_NO_PADDING_FLAG = 0x1;
enum NCRYPT_PAD_PKCS1_FLAG = 0x2;
enum NCRYPT_PAD_OAEP_FLAG = 0x4;
enum NCRYPT_PAD_PSS_FLAG = 0x8;
static if (NTDDI_VERSION >= NTDDI_WIN8) {
    enum NCRYPT_PAD_CIPHER_FLAG = 0x10;
    enum NCRYPT_CIPHER_NO_PADDING_FLAG = 0x0;
    enum NCRYPT_CIPHER_BLOCK_PADDING_FLAG = 0x1;
    enum NCRYPT_CIPHER_OTHER_PADDING_FLAG = 0x2;
}

alias HCRYPTPROV = ULONG_PTR;
alias HCRYPTKEY = ULONG_PTR;
alias HCRYPTHASH = ULONG_PTR;

extern (Windows) alias PFN_NCRYPT_ALLOC = LPVOID function(SIZE_T cbSize);
extern (Windows) alias PFN_NCRYPT_FREE = VOID function(LPVOID pv);

struct NCRYPT_ALLOC_PARA {
    DWORD cbSize;
    PFN_NCRYPT_ALLOC pfnAlloc;
    PFN_NCRYPT_FREE pfnFree;
}

alias NCryptBuffer = BCryptBuffer;
alias PNCryptBuffer = BCryptBuffer*;
alias NCryptBufferDesc = BCryptBufferDesc;
alias PNCryptBufferDesc = BCryptBufferDesc*;

alias NCRYPT_HANDLE = ULONG_PTR;
alias NCRYPT_PROV_HANDLE = ULONG_PTR;
alias NCRYPT_KEY_HANDLE = ULONG_PTR;
alias NCRYPT_HASH_HANDLE = ULONG_PTR;
alias NCRYPT_SECRET_HANDLE = ULONG_PTR;

static if (NTDDI_VERSION >= NTDDI_WIN8) {
    struct NCRYPT_CIPHER_PADDING_INFO {
        ULONG cbSize;
        DWORD dwFlags;
        PUCHAR pbIV;
        ULONG cbIV;
        PUCHAR pbOtherInfo;
        ULONG cbOtherInfo;
    }
    alias PNCRYPT_CIPHER_PADDING_INFO = NCRYPT_CIPHER_PADDING_INFO*;
}

enum NCRYPT_NO_KEY_VALIDATION = BCRYPT_NO_KEY_VALIDATION;
enum NCRYPT_MACHINE_KEY_FLAG = 0x20;
enum NCRYPT_SILENT_FLAG = 0x40;
enum NCRYPT_OVERWRITE_KEY_FLAG = 0x80;
enum NCRYPT_WRITE_KEY_TO_LEGACY_STORE_FLAG = 0x200;
enum NCRYPT_DO_NOT_FINALIZE_FLAG = 0x400;
enum NCRYPT_PERSIST_ONLY_FLAG = 0x40000000;
enum NCRYPT_PERSIST_FLAG = 0x80000000;
enum NCRYPT_REGISTER_NOTIFY_FLAG = 0x1;
enum NCRYPT_UNREGISTER_NOTIFY_FLAG = 0x2;

enum NCRYPT_CIPHER_OPERATION = BCRYPT_CIPHER_OPERATION;
enum NCRYPT_HASH_OPERATION = BCRYPT_HASH_OPERATION;
enum NCRYPT_ASYMMETRIC_ENCRYPTION_OPERATION = BCRYPT_ASYMMETRIC_ENCRYPTION_OPERATION;
enum NCRYPT_SECRET_AGREEMENT_OPERATION = BCRYPT_SECRET_AGREEMENT_OPERATION;
enum NCRYPT_SIGNATURE_OPERATION = BCRYPT_SIGNATURE_OPERATION;
enum NCRYPT_RNG_OPERATION = BCRYPT_RNG_OPERATION;
static if (NTDDI_VERSION >= NTDDI_WIN8)
    enum NCRYPT_KEY_DERIVATION_OPERATION = BCRYPT_KEY_DERIVATION_OPERATION;

struct NCryptAlgorithmName {
    LPWSTR pszName;
    DWORD dwClass;
    DWORD dwAlgOperations;
    DWORD dwFlags;
}
alias PNCryptAlgorithmName = NCryptAlgorithmName*;

struct NCryptKeyName {
    LPWSTR pszName;
    LPWSTR pszAlgid;
    DWORD dwLegacyKeySpec;
    DWORD dwFlags;
}
alias PNCryptKeyName = NCryptKeyName*;

struct NCryptProviderName {
    LPWSTR pszName;
    LPWSTR pszComment;
}
alias PNCryptProviderName = NCryptProviderName*;

enum {
    NCRYPT_NAME_PROPERTY = "Name"w,
    NCRYPT_UNIQUE_NAME_PROPERTY = "Unique Name"w,
    NCRYPT_ALGORITHM_PROPERTY = "Algorithm Name"w,
    NCRYPT_LENGTH_PROPERTY = "Length"w,
    NCRYPT_LENGTHS_PROPERTY = "Lengths"w,
    NCRYPT_BLOCK_LENGTH_PROPERTY = "Block Length"w,
    NCRYPT_UI_POLICY_PROPERTY = "UI Policy"w,
    NCRYPT_EXPORT_POLICY_PROPERTY = "Export Policy"w,
    NCRYPT_WINDOW_HANDLE_PROPERTY = "HWND Handle"w,
    NCRYPT_USE_CONTEXT_PROPERTY = "Use Context"w,
    NCRYPT_IMPL_TYPE_PROPERTY = "Impl Type"w,
    NCRYPT_KEY_USAGE_PROPERTY = "Key Usage"w,
    NCRYPT_KEY_TYPE_PROPERTY = "Key Type"w,
    NCRYPT_VERSION_PROPERTY = "Version"w,
    NCRYPT_SECURITY_DESCR_SUPPORT_PROPERTY = "Security Descr Support"w,
    NCRYPT_SECURITY_DESCR_PROPERTY = "Security Descr"w,
    NCRYPT_USE_COUNT_ENABLED_PROPERTY = "Enabled Use Count"w,
    NCRYPT_USE_COUNT_PROPERTY = "Use Count"w,
    NCRYPT_LAST_MODIFIED_PROPERTY = "Modified"w,
    NCRYPT_MAX_NAME_LENGTH_PROPERTY = "Max Name Length"w,
    NCRYPT_ALGORITHM_GROUP_PROPERTY = "Algorithm Group"w,
    NCRYPT_PROVIDER_HANDLE_PROPERTY = "Provider Handle"w,
    NCRYPT_PIN_PROPERTY = "SmartCardPin"w,
    NCRYPT_READER_PROPERTY = "SmartCardReader"w,
    NCRYPT_SMARTCARD_GUID_PROPERTY = "SmartCardGuid"w,
    NCRYPT_CERTIFICATE_PROPERTY = "SmartCardKeyCertificate"w,
    NCRYPT_PIN_PROMPT_PROPERTY = "SmartCardPinPrompt"w,
    NCRYPT_USER_CERTSTORE_PROPERTY = "SmartCardUserCertStore"w,
    NCRYPT_ROOT_CERTSTORE_PROPERTY = "SmartcardRootCertStore"w,
    NCRYPT_SECURE_PIN_PROPERTY = "SmartCardSecurePin"w,
    NCRYPT_ASSOCIATED_ECDH_KEY = "SmartCardAssociatedECDHKey"w,
    NCRYPT_SCARD_PIN_ID = "SmartCardPinId"w,
    NCRYPT_SCARD_PIN_INFO = "SmartCardPinInfo"w,
}

enum NCRYPT_DH_PARAMETERS_PROPERTY = BCRYPT_DH_PARAMETERS;

static if (NTDDI_VERSION >= NTDDI_WIN8) {
    enum {
        NCRYPT_CHAINING_MODE_PROPERTY = "Chaining Mode"w,
        NCRYPT_AUTH_TAG_LENGTH = "AuthTagLength"w,
        NCRYPT_READER_ICON_PROPERTY = "SmartCardReaderIcon"w,
        NCRYPT_KDF_SECRET_VALUE = "KDFKeySecret"w,
        NCRYPT_PCP_PLATFORM_TYPE_PROPERTY = "PCP_PLATFORM_TYPE"w,
        NCRYPT_PCP_PROVIDER_VERSION_PROPERTY = "PCP_PROVIDER_VERSION"w,
        NCRYPT_PCP_EKPUB_PROPERTY = "PCP_EKPUB"w,
        NCRYPT_PCP_EKCERT_PROPERTY = "PCP_EKCERT"w,
        NCRYPT_PCP_EKNVCERT_PROPERTY = "PCP_EKNVCERT"w,
        NCRYPT_PCP_SRKPUB_PROPERTY = "PCP_SRKPUB"w,
        NCRYPT_PCP_PCRTABLE_PROPERTY = "PCP_PCRTABLE"w,
        NCRYPT_PCP_CHANGEPASSWORD_PROPERTY = "PCP_CHANGEPASSWORD"w,
        NCRYPT_PCP_PASSWORD_REQUIRED_PROPERTY = "PCP_PASSWORD_REQUIRED"w,
        NCRYPT_PCP_USAGEAUTH_PROPERTY = "PCP_USAGEAUTH"w,
        NCRYPT_PCP_MIGRATIONPASSWORD_PROPERTY = "PCP_MIGRATIONPASSWORD"w,
        NCRYPT_PCP_EXPORT_ALLOWED_PROPERTY = "PCP_EXPORT_ALLOWED"w,
        NCRYPT_PCP_STORAGEPARENT_PROPERTY = "PCP_STORAGEPARENT"w,
        NCRYPT_PCP_PROVIDERHANDLE_PROPERTY = "PCP_PROVIDERMHANDLE"w,
        NCRYPT_PCP_PLATFORMHANDLE_PROPERTY = "PCP_PLATFORMHANDLE"w,
        NCRYPT_PCP_PLATFORM_BINDING_PCRMASK_PROPERTY = "PCP_PLATFORM_BINDING_PCRMASK"w,
        NCRYPT_PCP_PLATFORM_BINDING_PCRDIGESTLIST_PROPERTY = "PCP_PLATFORM_BINDING_PCRDIGESTLIST"w,
        NCRYPT_PCP_PLATFORM_BINDING_PCRDIGEST_PROPERTY = "PCP_PLATFORM_BINDING_PCRDIGEST"w,
        NCRYPT_PCP_KEY_USAGE_POLICY_PROPERTY = "PCP_KEY_USAGE_POLICY"w,
        NCRYPT_PCP_TPM12_IDBINDING_PROPERTY = "PCP_TPM12_IDBINDING"w,
        NCRYPT_PCP_TPM12_IDACTIVATION_PROPERTY = "PCP_TPM12_IDACTIVATION"w,
        NCRYPT_PCP_KEYATTESTATION_PROPERTY = "PCP_TPM12_KEYATTESTATION"w,
        NCRYPT_PCP_ALTERNATE_KEY_STORAGE_LOCATION_PROPERTY = "PCP_ALTERNATE_KEY_STORAGE_LOCATION"w,
    }

    enum NCRYPT_TPM12_PROVIDER = 0x00010000;
    enum NCRYPT_PCP_SIGNATURE_KEY = 0x1;
    enum NCRYPT_PCP_ENCRYPTION_KEY = 0x2;
    enum NCRYPT_PCP_GENERIC_KEY = NCRYPT_PCP_SIGNATURE_KEY | NCRYPT_PCP_ENCRYPTION_KEY;
    enum NCRYPT_PCP_STORAGE_KEY = 0x00000004;
    enum NCRYPT_PCP_IDENTITY_KEY = 0x00000008;

    enum NCRYPT_INITIALIZATION_VECTOR = BCRYPT_INITIALIZATION_VECTOR;
}

enum NCRYPT_MAX_PROPERTY_NAME = 64;
enum NCRYPT_MAX_PROPERTY_DATA = 0x100000;

enum NCRYPT_ALLOW_EXPORT_FLAG = 0x1;
enum NCRYPT_ALLOW_PLAINTEXT_EXPORT_FLAG = 0x2;
enum NCRYPT_ALLOW_ARCHIVING_FLAG = 0x00000004;
enum NCRYPT_ALLOW_PLAINTEXT_ARCHIVING_FLAG = 0x00000008;

enum NCRYPT_IMPL_HARDWARE_FLAG = 0x1;
enum NCRYPT_IMPL_SOFTWARE_FLAG = 0x2;
enum NCRYPT_IMPL_REMOVABLE_FLAG = 0x00000008;
enum NCRYPT_IMPL_HARDWARE_RNG_FLAG = 0x00000010;

enum NCRYPT_ALLOW_DECRYPT_FLAG = 0x1;
enum NCRYPT_ALLOW_SIGNING_FLAG = 0x2;
enum NCRYPT_ALLOW_KEY_AGREEMENT_FLAG = 0x00000004;
enum NCRYPT_ALLOW_ALL_USAGES = 0x00ff_ffff;

enum NCRYPT_UI_PROTECT_KEY_FLAG = 0x1;
enum NCRYPT_UI_FORCE_HIGH_PROTECTION_FLAG = 0x2;

struct NCRYPT_UI_POLICY {
    DWORD dwVersion;
    DWORD dwFlags;
    LPCWSTR pszCreationTitle;
    LPCWSTR pszFriendlyName;
    LPCWSTR pszDescription;
}
alias PNCRYPT_UI_POLICY = NCRYPT_UI_POLICY*;

struct NCRYPT_SUPPORTED_LENGTHS {
    DWORD dwMinLength;
    DWORD dwMaxLength;
    DWORD dwIncrement;
    DWORD dwDefaultLength;
}
alias PNCRYPT_SUPPORTED_LENGTHS = NCRYPT_SUPPORTED_LENGTHS*;

static if (NTDDI_VERSION >= NTDDI_WIN8) {
    struct NCRYPT_KEY_BLOB_HEADER {
        ULONG cbSize;
        ULONG dwMagic;
        ULONG cbAlgName;
        ULONG cbKeyData;
    }
    alias PNCRYPT_KEY_BLOB_HEADER = NCRYPT_KEY_BLOB_HEADER*;

    enum NCRYPT_CIPHER_KEY_BLOB_MAGIC = 0x52485043;
    enum NCRYPT_PROTECTED_KEY_BLOB_MAGIC = 0x4b545250;

    enum NCRYPT_CIPHER_KEY_BLOB = "CipherKeyBlob"w;
    enum NCRYPT_PROTECTED_KEY_BLOB = "ProtectedKeyBlob"w;
}

enum NCRYPT_PKCS7_ENVELOPE_BLOB = "PKCS7_ENVELOPE"w;
enum NCRYPT_PKCS8_PRIVATE_KEY_BLOB = "PKCS8_PRIVATEKEY"w;
enum NCRYPT_OPAQUETRANSPORT_BLOB = "OpaqueTransport"w;

enum NCRYPT_EXPORT_LEGACY_FLAG = 0x00000800;

enum NCRYPT_KEY_STORAGE_INTERFACE_VERSION = BCRYPT_MAKE_INTERFACE_VERSION(1, 0);
enum NCRYPT_KEY_STORAGE_INTERFACE_VERSION_2 = BCRYPT_MAKE_INTERFACE_VERSION(2, 0);

SECURITY_STATUS NCryptOpenStorageProvider(scope NCRYPT_PROV_HANDLE* phProvider, scope LPCWSTR pszProviderName, DWORD dwFlags);
SECURITY_STATUS NCryptEnumAlgorithms(NCRYPT_PROV_HANDLE hProvider, DWORD dwAlgOperations, scope DWORD* pdwAlgCount, scope NCryptAlgorithmName** ppAlgList, DWORD dwFlags);
SECURITY_STATUS NCryptIsAlgSupported(NCRYPT_PROV_HANDLE hProvider, scope LPCWSTR pszAlgId, DWORD dwFlags);
SECURITY_STATUS NCryptEnumKeys(NCRYPT_PROV_HANDLE hProvider, scope LPCWSTR pszScope, scope NCryptKeyName** ppKeyName, scope PVOID* ppEnumState, DWORD dwFlags);
SECURITY_STATUS NCryptEnumStorageProviders(scope DWORD* pdwProviderCount, scope NCryptProviderName** ppProviderList, DWORD dwFlags);
SECURITY_STATUS NCryptFreeBuffer(PVOID pvInput);
SECURITY_STATUS NCryptOpenKey(NCRYPT_PROV_HANDLE hProvider, scope NCRYPT_KEY_HANDLE* phKey, scope LPCWSTR pszKeyName, DWORD dwLegacyKeySpec, DWORD dwFlags);
SECURITY_STATUS NCryptCreatePersistedKey(NCRYPT_PROV_HANDLE hProvider, scope NCRYPT_KEY_HANDLE* phKey, scope LPCWSTR pszAlgId, scope LPCWSTR pszKeyName, DWORD dwLegacyKeySpec, DWORD dwFlags);
SECURITY_STATUS NCryptGetProperty(NCRYPT_HANDLE hObject, scope LPCWSTR pszProperty, scope PBYTE pbOutput, DWORD cbOutput, scope DWORD* pcbResult, DWORD dwFlags);
SECURITY_STATUS NCryptSetProperty(NCRYPT_HANDLE hObject, scope LPCWSTR pszProperty, scope PBYTE pbInput, DWORD cbInput, DWORD dwFlags);
SECURITY_STATUS NCryptFinalizeKey(NCRYPT_KEY_HANDLE hKey, DWORD dwFlags);
SECURITY_STATUS NCryptEncrypt(NCRYPT_KEY_HANDLE hKey, scope PBYTE pbInput, DWORD cbInput, scope VOID* pPaddingInfo, scope PBYTE pbOutput, DWORD cbOutput, scope DWORD* pcbResult, DWORD dwFlags);
SECURITY_STATUS NCryptDecrypt(NCRYPT_KEY_HANDLE hKey, scope PBYTE pbInput, DWORD cbInput, scope VOID* pPaddingInfo, scope PBYTE pbOutput, DWORD cbOutput, scope DWORD* pcbResult, DWORD dwFlags);
SECURITY_STATUS NCryptImportKey(NCRYPT_PROV_HANDLE hProvider, NCRYPT_KEY_HANDLE hImportKey, scope LPCWSTR pszBlobType, scope NCryptBufferDesc* pParameterList, scope NCRYPT_KEY_HANDLE* phKey, scope PBYTE pbData, DWORD cbData, DWORD dwFlags);
SECURITY_STATUS NCryptExportKey(NCRYPT_KEY_HANDLE hKey, NCRYPT_KEY_HANDLE hExportKey, scope LPCWSTR pszBlobType, scope NCryptBufferDesc* pParameterList, scope PBYTE pbOutput, DWORD cbOutput, scope DWORD* pcbResult, DWORD dwFlags);
SECURITY_STATUS NCryptSignHash(NCRYPT_KEY_HANDLE hKey, scope VOID* pPaddingInfo, scope PBYTE pbHashValue, DWORD cbHashValue, scope PBYTE pbSignature, DWORD cbSignature, scope DWORD* pcbResult, DWORD dwFlags);
SECURITY_STATUS NCryptVerifySignature(NCRYPT_KEY_HANDLE hKey, scope VOID* pPaddingInfo, scope PBYTE pbHashValue, DWORD cbHashValue, scope PBYTE pbSignature, DWORD cbSignature, DWORD dwFlags);
SECURITY_STATUS NCryptDeleteKey(NCRYPT_KEY_HANDLE hKey, DWORD dwFlags);
SECURITY_STATUS NCryptFreeObject(NCRYPT_HANDLE hObject);
WINBOOL NCryptIsKeyHandle(NCRYPT_KEY_HANDLE hKey);
SECURITY_STATUS NCryptTranslateHandle(scope NCRYPT_PROV_HANDLE* phProvider, scope NCRYPT_KEY_HANDLE* phKey, HCRYPTPROV hLegacyProv, HCRYPTKEY hLegacyKey, DWORD dwLegacyKeySpec, DWORD dwFlags);
SECURITY_STATUS NCryptNotifyChangeKey(NCRYPT_PROV_HANDLE hProvider, scope HANDLE* phEvent, DWORD dwFlags);
SECURITY_STATUS NCryptSecretAgreement(NCRYPT_KEY_HANDLE hPrivKey, NCRYPT_KEY_HANDLE hPubKey, scope NCRYPT_SECRET_HANDLE* phAgreedSecret, DWORD dwFlags);
SECURITY_STATUS NCryptDeriveKey(NCRYPT_SECRET_HANDLE hSharedSecret, scope LPCWSTR pwszKDF, scope NCryptBufferDesc* pParameterList, scope PBYTE pbDerivedKey, DWORD cbDerivedKey, scope DWORD* pcbResult, ULONG dwFlags);
static if (NTDDI_VERSION >= NTDDI_WIN8)
    SECURITY_STATUS NCryptKeyDerivation(NCRYPT_KEY_HANDLE hKey, scope NCryptBufferDesc* pParameterList, scope PUCHAR pbDerivedKey, DWORD cbDerivedKey, scope DWORD* pcbResult, ULONG dwFlags);
static if (NTDDI_VERSION >= NTDDI_WINTHRESHOLD) {
    SECURITY_STATUS NCryptCreateClaim(NCRYPT_KEY_HANDLE hSubjectKey, NCRYPT_KEY_HANDLE hAuthorityKey, DWORD dwClaimType, scope NCryptBufferDesc* pParameterList, scope PBYTE pbClaimBlob, DWORD cbClaimBlob, scope DWORD* pcbResult, DWORD dwFlags);
    SECURITY_STATUS NCryptVerifyClaim(NCRYPT_KEY_HANDLE hSubjectKey, NCRYPT_KEY_HANDLE hAuthorityKey, DWORD dwClaimType, scope NCryptBufferDesc* pParameterList, scope PBYTE pbClaimBlob, DWORD cbClaimBlob, scope NCryptBufferDesc* pOutput, DWORD dwFlags);
}
