You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 26, 2023. It is now read-only.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+
4
+
namespacePInvoke
5
+
{
6
+
/// <content>
7
+
/// Contains the <see cref="BCryptKeyDerivationFlags"/> nested type.
8
+
/// </content>
9
+
publicpartialclassBCrypt
10
+
{
11
+
/// <summary>
12
+
/// Flags that may be passed to the <see cref="BCryptKeyDerivation(SafeKeyHandle, BCryptBufferDesc*, byte*, int, out int, BCryptKeyDerivationFlags)"/> method.
13
+
/// </summary>
14
+
publicenumBCryptKeyDerivationFlags:uint
15
+
{
16
+
/// <summary>
17
+
/// No flags.
18
+
/// </summary>
19
+
None=0x0,
20
+
21
+
/// <summary>
22
+
/// Specifies that the target algorithm is AES and that the key therefore must be double expanded. This flag is only valid with the CAPI_KDF algorithm.
Copy file name to clipboardExpand all lines: src/BCrypt/BCrypt.cs
+20Lines changed: 20 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -108,6 +108,26 @@ public static extern unsafe NTSTATUS BCryptCreateHash(
108
108
intcbSecret,
109
109
BCryptCreateHashFlagsdwFlags);
110
110
111
+
/// <summary>
112
+
/// Derives a key without requiring a secret agreement. It is similar in functionality to <see cref="BCryptDeriveKey(SafeSecretHandle, string, BCryptBufferDesc*, byte*, int, out int, BCryptDeriveKeyFlags)"/>
113
+
/// but does not require a BCRYPT_SECRET_HANDLE value as input.
114
+
/// </summary>
115
+
/// <param name="hKey">Handle of the input key.</param>
116
+
/// <param name="pParameterList">Pointer to a BCryptBufferDesc structure that contains the KDF parameters. This parameter is optional and can be NULL if it is not needed. The parameters can be specific to a key derivation function (KDF) or generic. See <see href="https://docs.microsoft.com/en-us/windows/win32/api/bcrypt/nf-bcrypt-bcryptkeyderivation">online docs</see> for more information.</param>
117
+
/// <param name="pbDerivedKey">Address of a buffer that receives the key. The <paramref name="cbDerivedKey"/> parameter contains the size of this buffer.</param>
118
+
/// <param name="cbDerivedKey">Size, in bytes, of the buffer pointed to by the <paramref name="pbDerivedKey" /> parameter.</param>
119
+
/// <param name="pcbResult">Pointer to a variable that receives the number of bytes that were copied to the buffer pointed to by the <paramref name="pbDerivedKey"/> parameter.</param>
120
+
/// <param name="dwFlags">Flags that modify the behavior of this function. <see cref="BCryptKeyDerivationFlags.BCRYPT_CAPI_AES_FLAG"/> may be used with the Microsoft Primitive provider.</param>
121
+
/// <returns>Returns a status code that indicates the success or failure of the function.</returns>
/// The <see cref="BCryptCreateMultiHash(SafeAlgorithmHandle, out SafeHashHandle, int, byte*, int, byte*, int, BCryptCreateHashFlags)"/> function creates a multi-hash state that allows for the parallel computation of multiple hash operations.
static PInvoke.BCrypt.BCryptImportKey(PInvoke.BCrypt.SafeAlgorithmHandle hAlgorithm, PInvoke.BCrypt.SafeKeyHandle hImportKey, string pszBlobType, out PInvoke.BCrypt.SafeKeyHandle phKey, System.IntPtr pbKeyObject, int cbKeyObject, System.IntPtr pbInput, int cbInput, PInvoke.BCrypt.BCryptImportKeyFlags dwFlags = PInvoke.BCrypt.BCryptImportKeyFlags.None) -> PInvoke.NTSTATUS
29
32
static PInvoke.BCrypt.BCryptImportKeyPair(PInvoke.BCrypt.SafeAlgorithmHandle hAlgorithm, PInvoke.BCrypt.SafeKeyHandle hImportKey, string pszBlobType, out PInvoke.BCrypt.SafeKeyHandle phKey, System.IntPtr pbInput, int cbInput, PInvoke.BCrypt.BCryptImportKeyPairFlags dwFlags) -> PInvoke.NTSTATUS
33
+
static PInvoke.BCrypt.BCryptKeyDerivation(PInvoke.BCrypt.SafeKeyHandle hKey, PInvoke.BCrypt.BCryptBufferDesc? pParameterList, byte[] pbDerivedKey, int cbDerivedKey, out int pcbResult, PInvoke.BCrypt.BCryptKeyDerivationFlags dwFlags) -> PInvoke.NTSTATUS
34
+
static PInvoke.BCrypt.BCryptKeyDerivation(PInvoke.BCrypt.SafeKeyHandle hKey, System.IntPtr pParameterList, System.IntPtr pbDerivedKey, int cbDerivedKey, out int pcbResult, PInvoke.BCrypt.BCryptKeyDerivationFlags dwFlags) -> PInvoke.NTSTATUS
30
35
static PInvoke.BCrypt.BCryptProcessMultiOperations(PInvoke.BCrypt.SafeHashHandle hHash, PInvoke.BCrypt.BCRYPT_MULTI_OPERATION_TYPE operationType, PInvoke.BCrypt.BCRYPT_MULTI_HASH_OPERATION[] pOperations, int cbOperations, int dwFlags = 0) -> PInvoke.NTSTATUS
31
36
static PInvoke.BCrypt.BCryptProcessMultiOperations(PInvoke.BCrypt.SafeHashHandle hHash, PInvoke.BCrypt.BCRYPT_MULTI_OPERATION_TYPE operationType, System.IntPtr pOperations, int cbOperations, int dwFlags = 0) -> PInvoke.NTSTATUS
32
37
static PInvoke.BCrypt.BCryptSignHash(PInvoke.BCrypt.SafeKeyHandle hKey, System.IntPtr pPaddingInfo, System.IntPtr pbInput, int cbInput, System.IntPtr pbOutput, int cbOutput, out int pcbResult, PInvoke.BCrypt.BCryptSignHashFlags dwFlags) -> PInvoke.NTSTATUS
0 commit comments