ExportKey
| Description: | The ExportKey function exports a cryptographic key or a key pair from a CSP in a secure manner as a Key BLOB. It is the VTScada analog of the Crypto API ExportKey call. |
| Returns: | Text |
Usage: ![]() |
Script Only. |
| Function Groups: | Cryptography |
| Related to: | DeriveKey | Decrypt | Encrypt | GenerateKey | GetCryptoProvider | GetKeyParam | ImportKey | SetKeyParam |
Format: ![]() |
ExportKey(Key, BlobType [, EncryptKey, Flags, Error]) |
| Parameters: |
| Key | ||||||||
| Required. The handle to the key which is to be exported. | ||||||||
| BlobType | ||||||||
| Required. A parameter specifying the type of key BLOB to be exported. Values are defined in WinCrypt.h | ||||||||
| EncryptKey | ||||||||
| Required. An optional parameter containing a Key handle for a key to be used to encrypt the exported key so that it may only be encrypted by the destination user. If omitted or invalid, then the value NULL is used. | ||||||||
| Flags | ||||||||
| Required. An optional parameter specifying the flags to be passed to CryptExportKey. If omitted or invalid then the value 0 is used. Flags values are defined in WinCrypt.h. | ||||||||
| Error | ||||||||
Required. An optional variable in which the error code for the function is returned. It has the following meaning:
|
| Comments: |
The exported key is returned as a text string. If an error occurs, the return value is invalid. Does not support CNG (Cryptography New Generation). |
Example:
[
PubKey1;
Constant PUBLICKEYBLOB = 0x6;
]
Init [
If 1 Main;
[
{ Export the public key }
PubKey1 = ExportKey(Key1, PUBLICKEYBLOB);
]
]
