Export Key in C
The TEExportKey() function is used to export a single key. You need to login as a certificate user in order to export a key. You need to provide the system id, principal id and the T-tag (referred to as HiddenLink in methods and attributes) when you call the TEExportKey() function. The returned key is encrypted with the public key of the certificate user. You can use the certificate user's private key to decrypt the exported key.
Code Samples
See the C environment settings for details on setting the project environment.
c_exportkey.c
The complete source for this sample, together with its console output, is published in the SDK reference and is the maintained copy:
Output
Connected to localhost at 8888 as certificate user with /test_key.pfx.
sid = 1
pid = 5009
hiddenlink (len = 40) :
[ 0] [ 0] [ 0] [ 1] [56] [92] [f3] [5d] [e6] [ b] [6a] [94] [41] [b4] [12] [d2] [db] [81] [3f] [25] [ 5] [ab] [a0] [eb]
[14] [40] [cf] [b3] [e8] [fe] [5e] [b7] [9c] [20] [fa] [8c] [c1] [bf] [dd] [c5]
tekeybuffer.key.buffer (len = 128) :
[a9] [eb] [3d] [42] [55] [c3] [b4] [70] [f1] [89] [c7] [4d] [e9] [39] [a2] [fe] [ca] [f6] [ 6] [ 4] [3d] [d9] [f4] [22]
[2b] [11] [eb] [c4] [7f] [e6] [70] [38] [33] [47] [93] [c1] [56] [51] [29] [ e] [67] [b9] [32] [2d] [38] [67] [51] [9a]
[1f] [be] [df] [28] [6e] [1c] [26] [51] [e2] [90] [b0] [17] [eb] [ac] [5e] [7b] [8e] [1d] [7f] [f2] [d4] [de] [99] [74]
[ce] [45] [74] [da] [32] [39] [ 4] [1e] [dd] [cf] [de] [4b] [cf] [19] [11] [da] [ a] [f0] [db] [5a] [5c] [44] [b9] [52]
[ 3] [2f] [f0] [46] [6b] [ 8] [fd] [a9] [62] [94] [2b] [92] [ 5] [bc] [33] [6b] [54] [5e] [fe] [7a] [b6] [93] [57] [28]
[19] [e1] [8c] [de] [8e] [19] [cc] [25]
Disconnected from server