diff options
Diffstat (limited to 'embeddable-dll-service/csharp/Win32.cs')
-rw-r--r-- | embeddable-dll-service/csharp/Win32.cs | 70 |
1 files changed, 0 insertions, 70 deletions
diff --git a/embeddable-dll-service/csharp/Win32.cs b/embeddable-dll-service/csharp/Win32.cs index 3dd9cfca..76395f7e 100644 --- a/embeddable-dll-service/csharp/Win32.cs +++ b/embeddable-dll-service/csharp/Win32.cs @@ -171,75 +171,5 @@ namespace Tunnel [DllImport("advapi32.dll", EntryPoint = "ChangeServiceConfig2", CharSet = CharSet.Unicode, SetLastError = true, CallingConvention = CallingConvention.StdCall)] [return: MarshalAs(UnmanagedType.Bool)] public static extern bool ChangeServiceConfig2(IntPtr hService, ServiceConfigType dwInfoLevel, ref ServiceDescription lpInfo); - - [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] - public class KeyBlob - { - BCRYPT_ECCKEY_BLOB Header; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] - public byte[] Public; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] - public byte[] Unused; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] - public byte[] Private; - } - - public const string BCRYPT_ECC_CURVE_NAME = "ECCCurveName"; - public const string BCRYPT_ECDH_ALGORITHM = "ECDH"; - public const string BCRYPT_ECC_CURVE_25519 = "curve25519"; - public const string BCRYPT_ECCPRIVATE_BLOB = "ECCPRIVATEBLOB"; - - [DllImport("bcrypt.dll", SetLastError = true, ExactSpelling = true, CharSet = CharSet.Unicode)] - public static extern uint BCryptSetProperty(IntPtr hObject, string property, string input, int inputSize, uint Flags = 0); - - [DllImport("bcrypt.dll", CharSet = CharSet.Auto, SetLastError = true)] - public static extern uint BCryptOpenAlgorithmProvider(ref IntPtr hAlgorithm, string AlgId, string Implementation, uint Flags); - - [DllImport("bcrypt.dll", SetLastError = true)] - public static extern uint BCryptGenerateKeyPair(IntPtr hObject, ref IntPtr hKey, uint length, uint Flags); - - [DllImport("bcrypt.dll", SetLastError = true)] - public static extern uint BCryptFinalizeKeyPair(IntPtr hKey, uint Flags); - - [DllImport("bcrypt.dll", SetLastError = true, ExactSpelling = true, CharSet = CharSet.Unicode)] - public static extern uint BCryptExportKey(IntPtr hKey, IntPtr hExportKey, [MarshalAs(UnmanagedType.LPWStr)] string pszBlobType, [Out] KeyBlob pbOutput, int cbOutput, out int pcbResult, uint Flags = 0); - - [DllImport("bcrypt.dll", SetLastError = true)] - public static extern uint BCryptDestroyKey(IntPtr hKey); - - [DllImport("bcrypt.dll", SetLastError = true)] - public static extern uint BCryptCloseAlgorithmProvider(IntPtr hAlgorithm, uint Flags); - - [DllImport("bcrypt.dll", SetLastError = true)] - public static extern uint BCryptDestroySecret(IntPtr hSecretAgreement); - - [DllImport("bcrypt.dll", CharSet = CharSet.Auto, SetLastError = true)] - public static extern uint BCryptImportKeyPair(IntPtr hAlgorithm, IntPtr hImportKey, string BlobType, ref IntPtr hPublicKey, byte[] Input, uint InputByteLength, uint Flags); - - [DllImport("bcrypt.dll", CharSet = CharSet.Auto, SetLastError = true)] - public static extern uint BCryptSecretAgreement(IntPtr hPrivKey, IntPtr hPublicKey, ref IntPtr phSecret, uint Flags); - - [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)] - public class BCryptBufferDesc - { - public uint ulVersion; - public uint cBuffers; - public IntPtr pBuffers; - } - - [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)] - public class BCryptBuffer - { - public uint cbBuffer; - public uint bufferType; - public IntPtr pvBuffer; - } - - [StructLayout(LayoutKind.Sequential)] - public class BCRYPT_ECCKEY_BLOB - { - uint magic; - uint cbKey; - } } } |