EXPORT KEY (bSQL) | Blockpoint Docs
Exports the specified key to the bSQL command line or to a specified file. For examples, see Examples.
Syntax​
EXPORT KEY "key_name" [TO "export_file"] [ <encryption_clause> ]
<encryption_clause> ::=
[ { ENC | ENCRYPT } = "enc_key_name" [HMAC = "hmac_name"] ]
Arguments​
key_name
The name of the key to be exported.
enc_key_name
The name of the encryption key.
hmac_name
The name of a secondary hmac encryption key.
Remarks​
If export_file
is not specified the command will default to a bSQL command line output, exporting the key as a byte array
.
If specified the export_file
will be created following any provided path specifications and will be written using raw bytes.
Permissions​
The user must have access to the target key and any subsequent encryption keys in order to export it.
Examples​
Exporting a key in the command line.​
The following example exports "base key" as command line output; encryption and validity tracking are done with the key "admin key".
EXPORT KEY "base key" ENC = "admin key" HMAC = "admin key"
Output.​
Your key named "base key" is [48 231 249 169 248 200 192 128 251 95 48 67 19
6 57 81 208 184 157 73 72 213 86 64 245 15 175 126 177 72 157 101 205 122 39 0 1
43 213 253 82 129 150 0 229 154 130 195 53 4 39 168 111 198 62 56 205 148 28 45
91 224 2 87 78 48 20 147 155 136 114 80 147 211 45 83 125 18 221 16 193 136 223
147 187 140 48 199 23 24 123 38 139 49 154 215 189 180 32 78 148 169 11 60 137 9
5 216 87 53 94 120 214 146 69] and encrypted with the key "admin key" with
additional security using the hmac key "admin key"
Exporting a key to a file.​
The following example exports the same key to the file "admin_key_bytes" using the same encryption and hmac specifications.
EXPORT KEY "base key" TO "admin_key_bytes" ENC = "admin key" HMAC = "admin key"