Connectivity Software User's Guide and Reference
CryptImportKey Method



OpcLabs.BaseLibPrimitives Assembly > OpcLabs.BaseLib.Licensing Namespace > Crypto.NativeMethods Class : CryptImportKey Method

The value of this parameter cannot be null (Nothing in Visual Basic).

Syntax
'Declaration
 
Public Shared Function CryptImportKey( _
   ByVal hProv As IntPtr, _
   ByVal pbData() As Byte, _
   ByVal dwDataLen As Integer, _
   ByVal hPubKey As IntPtr, _
   ByVal dwFlags As Integer, _
   ByRef phKey As IntPtr _
) As Boolean
'Usage
 
Dim hProv As IntPtr
Dim pbData() As Byte
Dim dwDataLen As Integer
Dim hPubKey As IntPtr
Dim dwFlags As Integer
Dim phKey As IntPtr
Dim value As Boolean
 
value = Crypto.NativeMethods.CryptImportKey(hProv, pbData, dwDataLen, hPubKey, dwFlags, phKey)
public static bool CryptImportKey( 
   IntPtr hProv,
   byte[] pbData,
   int dwDataLen,
   IntPtr hPubKey,
   int dwFlags,
   ref IntPtr phKey
)
public:
static bool CryptImportKey( 
   IntPtr hProv,
   array<byte>^ pbData,
   int dwDataLen,
   IntPtr hPubKey,
   int dwFlags,
   IntPtr% phKey
) 

Parameters

hProv
pbData

The value of this parameter cannot be null (Nothing in Visual Basic).

dwDataLen
hPubKey
dwFlags
phKey
Requirements

Target Platforms: .NET Framework: Windows 10 (selected versions), Windows 11 (selected versions), Windows Server 2016, Windows Server 2022; .NET: Linux, macOS, Microsoft Windows

See Also