~ubuntu-branches/debian/lenny/fpc/lenny

« back to all changes in this revision

Viewing changes to fpcsrc/packages/base/oracle/nzt.inc

  • Committer: Bazaar Package Importer
  • Author(s): Mazen Neifer, Torsten Werner, Mazen Neifer
  • Date: 2008-05-17 17:12:11 UTC
  • mfrom: (3.1.9 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080517171211-9qi33xhd9evfa0kg
Tags: 2.2.0-dfsg1-9
[ Torsten Werner ]
* Add Mazen Neifer to Uploaders field.

[ Mazen Neifer ]
* Moved FPC sources into a version dependent directory from /usr/share/fpcsrc
  to /usr/share/fpcsrc/${FPCVERSION}. This allow installing more than on FPC
  release.
* Fixed far call issue in compiler preventing building huge binearies.
  (closes: #477743)
* Updated building dependencies, recomennded and suggested packages.
* Moved fppkg to fp-utils as it is just a helper tool and is not required by
  compiler.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
{
 
3
  Automatically converted by H2Pas 1.0.0 from nzt.h
 
4
  The following command line parameters were used:
 
5
    -p
 
6
    -D
 
7
    -l
 
8
    jojo.so
 
9
    nzt.h
 
10
}
 
11
 
 
12
{$PACKRECORDS C}
 
13
 
 
14
type
 
15
  Pnzctx         = pointer;
 
16
  PPub1          = pointer;
 
17
  PPnzttIdentity = pointer;
 
18
  PPnzttPersona  = pointer;
 
19
  PPtext         = pointer;
 
20
  Pnzstrc        = pointer;
 
21
 
 
22
  { DISABLE check_long_lines  }
 
23
  { Copyright (c) 1996, 2004, Oracle. All rights reserved.   }
 
24
  { Copyright (c) 1996, 2004, Oracle. All rights reserved.   }
 
25
  {
 
26
   * $Header: nzt.h 10-aug-2004.11:55:06 rchahal Exp $ 
 
27
    }
 
28
  { 
 
29
   * NAME
 
30
   *    nzt.h
 
31
   * 
 
32
   * DESCRIPTION
 
33
   *    Toolkit public declarations.
 
34
   *    
 
35
   * PUBLIC FUNCTIONS
 
36
   *    nztwOpenWallet           - Open a wallet based on a WRL and pwd.
 
37
   *    nztwCloseWallet          - Close a wallet.
 
38
   * +  nztwCreateWallet         - Create a new wallet.
 
39
   * +  nztwDestroyWallet        - Destroy an existing wallet.
 
40
   *    nztwRetrievePersonaCopy  - Retieve a copy of a particular persona.
 
41
   * +  nzteStorePersona         - Store a persona in the wallet.
 
42
   *    nzteOpenPersona          - Open a persona.
 
43
   *    nzteClosePersona         - Close a persona.
 
44
   * +  nzteRemovePersona        - Remove a persona from a wallet.
 
45
   * +  nzteCreatePersona        - Create a persona.
 
46
   *    nzteDestroyPersona       - Destroy a persona.
 
47
   *    nztiStoreTrustedIdentity - Store an identity with associated trust.
 
48
   *    nzteRetrieveTrustedIdentCopy - Retrieves a trusted identity from persona
 
49
   * +  nzteSetProtection        - Modify the protection set in a persona.
 
50
   * +  nzteGetProtection        - Get the protection set in a persona
 
51
   *    nztePriKey               - Get the Private Key (X509 Only)
 
52
   *    nzteMyCert               - Get the Certificate (X509 only)
 
53
   *    nzteX509CreatePersona    - Create a persona given an X509 Certificate.
 
54
   * +  nztiRemoveIdentity       - Remove an identity from a persona.
 
55
   *    nztiCreateIdentity       - Create an identity.
 
56
   *    nztiDuplicateIdentity    - Create a complete copy of an identity.
 
57
   *    nztiAbortIdentity        - Discard an unstored identity.
 
58
   *    nztidGetIdentityDesc     - Gets Identity Description from Identity.
 
59
   *    nztidFreeIdentityDesc    - Frees memory for Identity Desc object.
 
60
   *    nztSign                  - Generate an attached signature.
 
61
   * +  nztxSignExpansion        - Determine size of signature.
 
62
   *    nztVerify                - Verify an attached signature.               
 
63
   *    nztValidate              - Validate an identity.                       
 
64
   *    nztsd_SignDetached       - Generate a detached signature.
 
65
   * +  nztxsd_SignDetachedExpansion - Determine size of detached signature.
 
66
   *    nztved_VerifyDetached    - Verify a detached signature.                 
 
67
   * +  nztEncrypt               - Symmetric key encryption.   
 
68
   * +  nztxEncryptExpansion     - Determine the tdu length for encryption.
 
69
   * +  nztDecrypt               - Symmetric key decryption.                   
 
70
   * +  nztEnvelope              - Sign then encrypt data for recipient(s).    
 
71
   * +  nztDeEnvelope            - Reverse nztEnvelope.                        
 
72
   * +  nztKeyedHash             - Generate keyed hash.                        
 
73
   * +  nztxKeyedHashExpansion   - Determine size of TDU for keyed hash.
 
74
   *    nztHash                  - Generate hash.   
 
75
   * +  nztxHashExpansion        - Determine the size of the TDU for a hash.
 
76
   *    nztSeedRandom            - See the random number generator.
 
77
   *    nztrb_RandomBytes        - Generate a series of random bytes.          
 
78
   *    nztrn_RandomNumber       - Generate a random number.                   
 
79
   *    nztbbInitBlock           - Initialize a buffer block.                  
 
80
   *    nztbbReuseBlock          - Reuse a buffer block.           
 
81
   *    nztbbSizeBlock           - Find the size of the buffer block.
 
82
   *    nztbbGrowBlock           - Grow initialized buffer block by 'inc' bytes.
 
83
   *    nztbbPurgeBlock          - Purge the memory used within a buffer block.
 
84
   *    nztbbSetBlock            - Set block to known state.
 
85
   *    nztkec_PKEncrypt         - Encrypt data then encrypt key for recipient.
 
86
   *    nztkdc_PKDecrypt         - Decrypt PKEncrypt'ed data.                  
 
87
   *    nztific_FreeIdentityContent - Free the contents of an identity.
 
88
   *    nztifdn                  - Create an identity from a distinguished name
 
89
   *    nztcts_CipherSpecToStr   - Converts the Cipher Spec Code To String
 
90
   *    nztiae_IsAuthEnabled     - Checks to see if Authentication is Enabled
 
91
   *                               in the current Cipher Spec.
 
92
   *    nztiae_IsEncrEnabled     - Checks to see if Encryption is Enabled
 
93
   *                               in the current Cipher Spec.
 
94
   *    nztiae_IsHashEnabled     - Checks to see if Hashing is Enabled
 
95
   *                               in the current Cipher Spec.
 
96
   *    nztwGetCertInfo          - Get peer certificate info
 
97
   *
 
98
   * NOTE: the '+' indicates that these functions are UNSUPPORTED at this time.
 
99
   * 
 
100
   * NOTES
 
101
   *    
 
102
   * MODIFIED
 
103
   *    rchahal    07/27/04 - add keyusage 
 
104
   *    srtata     11/10/03 - fix nztSetAppDefaultLocation header 
 
105
   *    rchahal    10/15/03 - bug 2513821 
 
106
   *    rchahal    11/11/02 - pkcs11 support
 
107
   *    akoyfman   07/05/02 - adding secret store to persona
 
108
   *    supriya    10/11/01 - Fix for bug # 2015732
 
109
   *    ajacobs    04/04/01 - make NZT_REGISTRY_WRL always available
 
110
   *    ajacobs    03/06/01 - olint fix
 
111
   *    ajacobs    03/02/01 - Add GetCertInfo
 
112
   *    supriya    02/23/01 - Move nzttKPUsage from nzt0.h
 
113
   *    rchahal    01/26/01 - olint fixes
 
114
   *    supriya    12/07/00 - Change fn name
 
115
   *    supriya    12/01/00 - Certificate API's needed for iAS
 
116
   *    supriya    06/19/00 - Adding definitions for MCS and ENTR
 
117
   *    lkethana   05/31/00 - multiple cert support
 
118
   *    skanjila   06/25/99 - Remove nztcts_CipherSpecToStr() to NZOS.
 
119
   *    skanjila   06/23/99 - Change API of nztcts_CipherSpecToStr.
 
120
   *    lkethana   06/18/99 - rem nztIPrivateAlloc, etc
 
121
   *    lkethana   06/10/99 - changing size_t to ub4
 
122
   *    lkethana   06/02/99 - add api for getting auth/encry/hash capability of c
 
123
   *    arswamin   12/28/98 - add NZT_MAX_MD5.
 
124
   *    arswamin   12/21/98 - change signature of compareDN
 
125
   *    qdinh      12/21/98 - change size_t to ub4.
 
126
   *    inetwork   11/22/98 - Removing NZDEPRECATED definition
 
127
   *    amthakur   09/14/98 - deprecating and updating the c-structures.
 
128
   *    arswamin   09/24/98 - adding NZTTWRL_NULL for SSO support.
 
129
   *    amthakur   07/30/98 - changing the prototype of nztGetCertChain.
 
130
   *    qdinh      05/01/98 - add NZTTIDENTTYPE_INVALID_TYPE
 
131
   *    qdinh      04/17/98 - add NZTTWRL_ORACLE.
 
132
   *    ascott     10/08/97 - implement nztiStoreTrustedIdentity
 
133
   *    ascott     10/07/97 - add nztiGetIdentityDesc
 
134
   *    ascott     09/28/97 - clarify prototype comments and error codes
 
135
   *    ascott     09/05/97 - update identity: create, destroy, duplicate
 
136
   *    ascott     08/21/97 - add GetCert and GetPriKey
 
137
   *    ascott     08/07/97 - add other WRL settings
 
138
   *    asriniva   03/25/97 - Add ANSI prototypes
 
139
   *    rwessman   03/19/97 - Added prototypes for nztific_FreeIdentityContent()
 
140
   *    asriniva   03/11/97 - Fix olint errors
 
141
   *    sdange     02/28/97 - Removed inclusion of nz0decl.h
 
142
   *    sdange     02/18/97 - Moved nzt specific declarations from nz0decl.h
 
143
   *    asriniva   01/21/97 - Remove prototypes.
 
144
   *    asriniva   10/31/96 - Include oratypes.h
 
145
   *    asriniva   10/15/96 - Declare buffer block helper functions
 
146
   *    asriniva   10/08/96 - First pass at wallet open/close
 
147
   *    asriniva   10/04/96 - Add random number seed function
 
148
   *    asriniva   10/03/96 - Reorder parameters in nztbbSetBlock
 
149
   *    asriniva   10/03/96 - Keep editing.
 
150
   *    asriniva   10/03/96 - Continued edits.
 
151
   *    asriniva   10/02/96 - Continue editing.
 
152
   *    asriniva   09/26/96 -
 
153
    }
 
154
  { ENABLE check_long_lines  }
 
155
  { ORATYPES  }
 
156
{$include nzerror.inc}         // NZ error type
 
157
  { NZERROR_ORACLE  }
 
158
 
 
159
  const
 
160
     NZT_MAX_SHA1 = 20;     
 
161
     NZT_MAX_MD5 = 16;     
 
162
  {************************************* }
 
163
  { PUBLIC CONSTANTS, MACROS, AND TYPES  }
 
164
  {************************************* }
 
165
  {
 
166
   * Wallet Resource Locator Type Strings
 
167
   *
 
168
   * WRL TYPE        PARAMETERS      BEHAVIOR
 
169
   * ========        ==========      =====================================
 
170
   * default:          <none>        Uses directory defined by the parameter
 
171
   *                                 SNZD_DEFAULT_FILE_DIRECTORY which in 
 
172
   *                                 unix is "$HOME/oracle/oss"
 
173
   * 
 
174
   * file:            file path      Find the Oracle wallet in this directory.
 
175
   *                                 example: file:<dir-path>
 
176
   * 
 
177
   * sqlnet:           <none>        In this case, the directory path will be 
 
178
   *                                 retrieved from the sqlnet.ora file under
 
179
   *                                 the oss.source.my_wallet parameter.
 
180
   *
 
181
   * mcs:              <none>        Microsoft WRL.
 
182
   *
 
183
   * entr:             dir path      Entrust WRL. eg: ENTR:<dir-path>   
 
184
   * 
 
185
    }
 
186
  { Note that there is no NZT_NULL_WRL.  Instead look in snzd.h for DEFAULT_WRP
 
187
   * which is used in our new defaulting mechanism.  The NZT_DEFAULT_WRL
 
188
   * should be deprecated.
 
189
    }
 
190
 
 
191
  const
 
192
         NZT_DEFAULT_WRL:Ptext = 'default:';
 
193
         NZT_SQLNET_WRL:Ptext ='sqlnet:';
 
194
         NZT_FILE_WRL:Ptext='file:';
 
195
         NZT_ENTR_WRL:Ptext='entr:';
 
196
         NZT_MCS_WRL:Ptext='mcs:';
 
197
         NZT_ORACLE_WRL:Ptext='oracle:';
 
198
         NZT_REGISTRY_WRL:Ptext='reg:';
 
199
 
 
200
  { Default, use SNZD_DEFAULT_FILE_DIRECTORY  }
 
201
  { Use oss.source.my_wallet in sqlnet.ora file  }
 
202
  { Find the oracle wallet in this directory  }
 
203
  { Find the entrust profile in this directory  }
 
204
  { WRL for Microsoft  }
 
205
  { Get the wallet from OSS db  }
 
206
  { New SSO defaulting mechanism  }
 
207
  { Find the wallet in Windows Registry  }
 
208
 
 
209
  type
 
210
     nzttwrl = (NZTTWRL_DEFAULT := 1,NZTTWRL_SQLNET,
 
211
       NZTTWRL_FILE,NZTTWRL_ENTR,NZTTWRL_MCS,
 
212
       NZTTWRL_ORACLE,NZTTWRL_NULL,NZTTWRL_REGISTRY
 
213
       );
 
214
 
 
215
 
 
216
     Pnzttwrl = ^nzttwrl;
 
217
{$ifndef NZ0DECL_ORACLE}
 
218
  {
 
219
      * With the elimination of nz0decl.h from public, we need this
 
220
      * redundant typedef.
 
221
       }
 
222
 
 
223
{$endif}
 
224
  { NZ0DECL_ORACLE  }
 
225
  { Moved from nz0decl.h  }
 
226
 
 
227
  type
 
228
    PnzttIdentityPrivate = pointer;
 
229
    PnzttPersonaPrivate = pointer;
 
230
    PnzttWalletPrivate = pointer;
 
231
    PnzttWalletObj = pointer;        // For wallet object
 
232
    PnzssEntry = pointer;            // For secretstore
 
233
    Pnzpkcs11_Info = pointer;
 
234
 
 
235
  {
 
236
   * Crypto Engine State
 
237
   *
 
238
   * Once the crypto engine (CE) has been initialized for a particular
 
239
   * cipher, it is either at the initial state, or it is continuing to
 
240
   * use the cipher.  NZTCES_END is used to change the state back to
 
241
   * initialized and flush any remaining output.  NZTTCES_RESET can be
 
242
   * used to change the state back to initialized and throw away any
 
243
   * remaining output.
 
244
    }
 
245
  { Continue processing input  }
 
246
  { End processing input  }
 
247
  { Reset processing and skip generating output  }
 
248
     nzttces = (NZTTCES_CONTINUE := 1,NZTTCES_END,NZTTCES_RESET
 
249
       );
 
250
 
 
251
 
 
252
     Pnzttces = ^nzttces;
 
253
  {
 
254
   * Crypto Engine Functions
 
255
   *
 
256
   * List of crypto engine categories; used to index into protection
 
257
   * vector.
 
258
    }
 
259
  { Signature, detached from content  }
 
260
  { Signature combined with content  }
 
261
  { Signature and encryption with content  }
 
262
  { Encryption for one or more recipients  }
 
263
  { Symmetric encryption  }
 
264
  { Keyed hash/checkusm  }
 
265
  { Hash/checsum  }
 
266
  { Random byte generation  }
 
267
  { Used for array size  }
 
268
     nzttcef = (NZTTCEF_DETACHEDSIGNATURE := 1,NZTTCEF_SIGNATURE,
 
269
       NZTTCEF_ENVELOPING,NZTTCEF_PKENCRYPTION,
 
270
       NZTTCEF_ENCRYPTION,NZTTCEF_KEYEDHASH,
 
271
       NZTTCEF_HASH,NZTTCEF_RANDOM,NZTTCEF_LAST
 
272
       );
 
273
 
 
274
 
 
275
     Pnzttcef = ^nzttcef;
 
276
  {
 
277
   * State of the persona.
 
278
    }
 
279
  { is not in any state(senseless???)  }
 
280
  { cert-request  }
 
281
  { certificate  }
 
282
  { certificate  }
 
283
  { renewal-requested  }
 
284
     nzttState = (NZTTSTATE_EMPTY := 0,NZTTSTATE_REQUESTED,
 
285
       NZTTSTATE_READY,NZTTSTATE_INVALID,NZTTSTATE_RENEWAL
 
286
       );
 
287
 
 
288
 
 
289
     PnzttState = ^nzttState;
 
290
  {
 
291
   * Cert-version types
 
292
   * 
 
293
   * This is used to quickly look-up the cert-type
 
294
    }
 
295
  { X.509v1  }
 
296
  { X.509v3  }
 
297
{$ifdef NZDEPRECATED}
 
298
  { Symmetric  }
 
299
{$endif}
 
300
  { For Initialization  }
 
301
 
 
302
  type
 
303
     nzttVersion = (NZTTVERSION_X509v1 := 1,NZTTVERSION_X509v3,
 
304
       NZTTVERSION_SYMMETRIC,NZTTVERSION_INVALID_TYPE
 
305
       );
 
306
 
 
307
 
 
308
     PnzttVersion = ^nzttVersion;
 
309
  {
 
310
   * Cipher Types
 
311
   *
 
312
   * List of all cryptographic algorithms, some of which may not be
 
313
   * available.
 
314
    }
 
315
  { RSA public key  }
 
316
  { DES  }
 
317
  { RC4  }
 
318
  { DES encrypted MD5 with salt (PBE)  }
 
319
  { RC2 encrypted MD5 with salt (PBE)  }
 
320
  { MD5  }
 
321
  { SHA  }
 
322
     nzttCipherType = (NZTTCIPHERTYPE_RSA := 1,NZTTCIPHERTYPE_DES,
 
323
       NZTTCIPHERTYPE_RC4,NZTTCIPHERTYPE_MD5DES,
 
324
       NZTTCIPHERTYPE_MD5RC2,NZTTCIPHERTYPE_MD5,
 
325
       NZTTCIPHERTYPE_SHA);
 
326
 
 
327
 
 
328
     PnzttCipherType = ^nzttCipherType;
 
329
  {
 
330
   * TDU Formats
 
331
   *
 
332
   * List of possible toolkit data unit (TDU) formats.  Depending on the
 
333
   * function and cipher used some may be not be available.
 
334
    }
 
335
  { PKCS7 format  }
 
336
  { RSA padded format  }
 
337
  { Oracle v1 format  }
 
338
  { Used for array size  }
 
339
     nztttdufmt = (NZTTTDUFMT_PKCS7 := 1,NZTTTDUFMT_RSAPAD,
 
340
       NZTTTDUFMT_ORACLEv1,NZTTTDUFMT_LAST
 
341
       );
 
342
 
 
343
 
 
344
     Pnztttdufmt = ^nztttdufmt;
 
345
  {
 
346
   * Validate State
 
347
   *
 
348
   * Possible validation states an identity can be in.
 
349
    }
 
350
  { Needs to be validated  }
 
351
  { Validated  }
 
352
  { Failed to validate  }
 
353
     nzttValState = (NZTTVALSTATE_NONE := 1,NZTTVALSTATE_GOOD,
 
354
       NZTTVALSTATE_REVOKED);
 
355
 
 
356
 
 
357
     PnzttValState = ^nzttValState;
 
358
  {
 
359
   * Policy Fields <----NEW (09/14/98)
 
360
   *
 
361
   * Policies enforced
 
362
    }
 
363
  { number of retries for decryption = 1  }
 
364
  { number of retries for decryption = 2  }
 
365
  { number of retries for decryption = 3  }
 
366
     nzttPolicy = (NZTTPOLICY_NONE := 0,NZTTPOLICY_RETRY_1,
 
367
       NZTTPOLICY_RETRY_2,NZTTPOLICY_RETRY_3
 
368
       );
 
369
 
 
370
 
 
371
     PnzttPolicy = ^nzttPolicy;
 
372
  {
 
373
   * Persona Usage <----NEW (09/14/98)
 
374
   *
 
375
   * what a persona will be used for?
 
376
    }
 
377
{ $ifdef NZDEPRECATED_MULTIPLECERTS}
 
378
  { persona for SSL usage  }
 
379
 
 
380
  type
 
381
     nzttUsage = (NZTTUSAGE_NONE := 0,NZTTUSAGE_SSL);
 
382
 
 
383
 
 
384
     PnzttUsage = ^nzttUsage;
 
385
//     nzttUsage = nzttUsage;
 
386
{ $endif}
 
387
  {
 
388
   * Personas and identities have unique id's that are represented with
 
389
   * 128 bits.
 
390
    }
 
391
 
 
392
  type
 
393
 
 
394
     PnzttID = ^nzttID;
 
395
     nzttID = ub1;
 
396
  {
 
397
   * Identity Types
 
398
   *
 
399
   * List of all Identity types..
 
400
    }
 
401
     nzttIdentType = (NZTTIDENTITYTYPE_INVALID_TYPE := 0,
 
402
       NZTTIDENTITYTYPE_CERTIFICTAE,NZTTIDENTITYTYPE_CERT_REQ,
 
403
       NZTTIDENTITYTYPE_RENEW_CERT_REQ,NZTTIDENTITYTYPE_CLEAR_ETP,
 
404
       NZTTIDENTITYTYPE_CLEAR_UTP,NZTTIDENTITYTYPE_CLEAR_PTP
 
405
       );
 
406
 
 
407
 
 
408
     PnzttIdentType = ^nzttIdentType;
 
409
 
 
410
     PnzttKPUsage = ^nzttKPUsage;
 
411
     nzttKPUsage = ub4;
 
412
  { IF new types are added nztiMUS should be changed  }
 
413
 
 
414
  const
 
415
     NZTTKPUSAGE_NONE = 0;
 
416
  { SSL Server  }
 
417
     NZTTKPUSAGE_SSL = 1;
 
418
     NZTTKPUSAGE_SMIME_ENCR = 2;
 
419
     NZTTKPUSAGE_SMIME_SIGN = 4;
 
420
     NZTTKPUSAGE_CODE_SIGN = 8;
 
421
     NZTTKPUSAGE_CERT_SIGN = 16;
 
422
  { SSL Client  }
 
423
     NZTTKPUSAGE_SSL_CLIENT = 32;
 
424
     NZTTKPUSAGE_INVALID_USE = $ffff;
 
425
  {
 
426
   * Timestamp as 32 bit quantity in UTC.
 
427
    }
 
428
 
 
429
  type
 
430
 
 
431
     PnzttTStamp = ^nzttTStamp;
 
432
     nzttTStamp = ub1;
 
433
  {
 
434
   * Buffer Block
 
435
   *
 
436
   * A function that needs to fill (and possibly grow) an output buffer
 
437
   * uses an output parameter block to describe each buffer.
 
438
   *
 
439
   * The flags_nzttBufferBlock member tells the function whether the
 
440
   * buffer can be grown or not.  If flags_nzttBufferBlock is 0, then
 
441
   * the buffer will be realloc'ed automatically.  
 
442
   *
 
443
   * The buflen_nzttBufferBLock member is set to the length of the
 
444
   * buffer before the function is called and will be the length of the
 
445
   * buffer when the function is finished.  If buflen_nzttBufferBlock is
 
446
   * 0, then the initial pointer stored in pobj_nzttBufferBlock is
 
447
   * ignored.
 
448
   *
 
449
   * The objlen_nzttBufferBlock member is set to the length of the
 
450
   * object stored in the buffer when the function is finished.  If the
 
451
   * initial buffer had a non-0 length, then it is possible that the
 
452
   * object length is shorter than the buffer length.
 
453
   *
 
454
   * The pobj_nzttBufferBlock member is a pointer to the output object.
 
455
    }
 
456
  { # define NZT_NO_AUTO_REALLOC     0x1  }
 
457
  { Flags  }
 
458
  { Total length of buffer  }
 
459
  { Length of used buffer part  }
 
460
  { Pointer to buffer  }
 
461
     PnzttBufferBlock = ^nzttBufferBlock;
 
462
     nzttBufferBlock = record
 
463
          flags_nzttBufferBlock : uword;
 
464
          buflen_nzttBufferBlock : ub4;
 
465
          usedlen_nzttBufferBlock : ub4;
 
466
          buffer_nzttBufferBlock : Pub1;
 
467
       end;
 
468
 
 
469
  {
 
470
   * Wallet.
 
471
    }
 
472
  { user's LDAP Name  }
 
473
  { len of user's LDAP Name  }
 
474
  { secured-policy of the wallet  }
 
475
  { open-policy of the wallet  }
 
476
  { List of personas in wallet  }
 
477
  { Private wallet information  }
 
478
{$ifdef NZDEPRECATED}
 
479
  { Number of personas  }
 
480
{$endif}
 
481
 
 
482
  type
 
483
     PnzttPersona = ^nzttPersona;
 
484
     PnzttWallet = ^nzttWallet;
 
485
     PnzttIdentity = ^nzttIdentity;
 
486
     nzttWallet = record
 
487
          ldapName_nzttWallet : Pub1;
 
488
          ldapNamelen_nzttWallet : ub4;
 
489
          securePolicy_nzttWallet : nzttPolicy;
 
490
          openPolicy_nzttWallet : nzttPolicy;
 
491
          persona_nzttWallet : PnzttPersona;
 
492
          private_nzttWallet : PnzttWalletPrivate;
 
493
          npersona_nzttWallet : ub4;
 
494
       end;
 
495
 
 
496
  {
 
497
   * The wallet contains, one or more personas.  A persona always
 
498
   * contains its private key and its identity.  It may also contain
 
499
   * other 3rd party identites.  All identities qualified with trust
 
500
   * where the qualifier can indicate anything from untrusted to trusted
 
501
   * for specific operations.
 
502
    }
 
503
  {
 
504
   * Persona
 
505
   *
 
506
   * Structure containing information about a persona.
 
507
    }
 
508
  { user-friendly persona name   }
 
509
  { persona-name length  }
 
510
  { Opaque part of persona  }
 
511
  { My cert-requests  }
 
512
  { My certificates  }
 
513
  { List of trusted identities  }
 
514
  { List of secrets  }
 
515
  { PKCS11 token info  }
 
516
  { Next persona  }
 
517
{$ifdef NZDEPRECATED_MULTIPLECERTS}
 
518
  { As Persona has multiple certs for different
 
519
       usages, Persona Usage does not mean anything. Similarly
 
520
       each key pair has its own state and Persona state itself
 
521
       does not mean anything. - lk 5/31/00
 
522
     }
 
523
  { persona usage; SSL/SET/..  }
 
524
  { persona state-requested/ready  }
 
525
  { Num of trusted identities  }
 
526
{$endif}
 
527
 
 
528
     nzttPersona = record
 
529
          genericName_nzttPersona : Pub1;
 
530
          genericNamelen_nzttPersona : ub4;
 
531
          private_nzttPersona : PnzttPersonaPrivate;
 
532
          mycertreqs_nzttPersona : PnzttIdentity;
 
533
          mycerts_nzttPersona : PnzttIdentity;
 
534
          mytps_nzttPersona : PnzttIdentity;
 
535
          mystore_nzttPersona : PnzssEntry;
 
536
          mypkcs11Info_nzttPersona : Pnzpkcs11_Info;
 
537
          next_nzttPersona : PnzttPersona;
 
538
          usage_nzttPersona : nzttUsage;
 
539
          state_nzttPersona : nzttState;
 
540
          ntps_nzttPersona : ub4;
 
541
       end;
 
542
 
 
543
  {
 
544
   * Identity
 
545
   *
 
546
   * Structure containing information about an identity.
 
547
   *
 
548
   * NOTE
 
549
   *  -- the next_trustpoint field only applies to trusted identities and
 
550
   *     has no meaning (i.e. is NULL) for self identities.
 
551
    }
 
552
  { Alias  }
 
553
  { Length of alias  }
 
554
  { Comment   }
 
555
  { Length of comment  }
 
556
  { Opaque part of identity  }
 
557
  { next identity in list  }
 
558
     nzttIdentity = record
 
559
          dn_nzttIdentity : Ptext;
 
560
          dnlen_nzttIdentity : ub4;
 
561
          comment_nzttIdentity : Ptext;
 
562
          commentlen_nzttIdentity : ub4;
 
563
          private_nzttIdentity : PnzttIdentityPrivate;
 
564
          next_nzttIdentity : PnzttIdentity;
 
565
       end;
 
566
 
 
567
     PnzttB64Cert = ^nzttB64Cert;
 
568
     nzttB64Cert = record
 
569
          b64Cert_nzttB64Cert : Pub1;
 
570
          b64Certlen_nzttB64Cert : ub4;
 
571
          next_nzttB64Cert : PnzttB64Cert;
 
572
       end;
 
573
 
 
574
  { Hash cipher  }
 
575
  { Symmetric cipher  }
 
576
  { Length of key to use  }
 
577
     PnzttPKCS7ProtInfo = ^nzttPKCS7ProtInfo;
 
578
     nzttPKCS7ProtInfo = record
 
579
          mictype_nzttPKCS7ProtInfo : nzttCipherType;
 
580
          symmtype_nzttPKCS7ProtInfo : nzttCipherType;
 
581
          keylen_nzttPKCS7ProtInfo : ub4;
 
582
       end;
 
583
 
 
584
  {
 
585
   * Protection Information.
 
586
   *
 
587
   * Information specific to a type of protection.
 
588
    }
 
589
     PnzttProtInfo = ^nzttProtInfo;
 
590
     nzttProtInfo = record
 
591
         case longint of
 
592
            0 : ( pkcs7_nzttProtInfo : nzttPKCS7ProtInfo );
 
593
         end;
 
594
 
 
595
 
 
596
  {
 
597
   * A description of a persona so that the toolkit can create one.  A
 
598
   * persona can be symmetric or asymmetric and both contain an
 
599
   * identity.  The identity for an asymmetric persona will be the
 
600
   * certificate and the identity for the symmetric persona will be
 
601
   * descriptive information about the persona.  In either case, an
 
602
   * identity will have been created before the persona is created.
 
603
   *
 
604
   * A persona can be stored separately from the wallet that references
 
605
   * it.  By default, a persona is stored with the wallet (it inherits
 
606
   * with WRL used to open the wallet).  If a WRL is specified, then it
 
607
   * is used to store the actuall persona and the wallet will have a
 
608
   * reference to it.
 
609
    }
 
610
  { Length of private info (key) }
 
611
  { Private information  }
 
612
  { Length of PRL  }
 
613
  { PRL for storage  }
 
614
  { Length of alias  }
 
615
  { Alias  }
 
616
  { Length of longer description }
 
617
  { Longer persona description  }
 
618
     PnzttPersonaDesc = ^nzttPersonaDesc;
 
619
     nzttPersonaDesc = record
 
620
          privlen_nzttPersonaDesc : ub4;
 
621
          priv_nzttPersonaDesc : Pub1;
 
622
          prllen_nzttPersonaDesc : ub4;
 
623
          prl_nzttPersonaDesc : Ptext;
 
624
          aliaslen_nzttPersonaDesc : ub4;
 
625
          alias_nzttPersonaDesc : Ptext;
 
626
          longlen_nzttPersonaDesc : ub4;
 
627
          long_nzttPersonaDesc : Ptext;
 
628
       end;
 
629
 
 
630
  {
 
631
   * A description of an identity so that the toolkit can create one.
 
632
   * Since an identity can be symmetric or asymmetric, the asymmetric
 
633
   * identity information will not be used when a symmetric identity is
 
634
   * created.  This means the publen_nzttIdentityDesc and
 
635
   * pub_nzttIdentityDesc members will not be used when creating a
 
636
   * symmetric identity.
 
637
    }
 
638
  { Length of identity  }
 
639
  { Type specific identity  }
 
640
  { Length of alias  }
 
641
  { Alias  }
 
642
  { Length of longer description  }
 
643
  { Longer description  }
 
644
  { Length of trust qualifier  }
 
645
  { Trust qualifier  }
 
646
     PnzttIdentityDesc = ^nzttIdentityDesc;
 
647
     nzttIdentityDesc = record
 
648
          publen_nzttIdentityDesc : ub4;
 
649
          pub_nzttIdentityDesc : Pub1;
 
650
          dnlen_nzttIdentityDesc : ub4;
 
651
          dn_nzttIdentityDesc : Ptext;
 
652
          longlen_nzttIdentityDesc : ub4;
 
653
          long_nzttIdentityDesc : Ptext;
 
654
          quallen_nzttIdentityDesc : ub4;
 
655
          trustqual_nzttIdentityDesc : Ptext;
 
656
       end;
 
657
 
 
658
  {****************************** }
 
659
  { PUBLIC FUNCTION DECLARATIONS  }
 
660
  {****************************** }
 
661
  {---------------------- nztwOpenWallet ---------------------- }
 
662
  {
 
663
   * NAME
 
664
   *    nztwOpenWallet - Open a wallet based on a wallet Resource Locator (WRL).
 
665
   * 
 
666
   * PARAMETERS
 
667
   *    osscntxt IN     OSS context. 
 
668
   *    wrllen   IN     Length of WRL.
 
669
   *    wrl      IN     WRL.
 
670
   *    pwdlen   IN     Length of password.
 
671
   *    pwd      IN     Password.
 
672
   *    wallet   IN/OUT Initialized wallet structure.   
 
673
   * 
 
674
   * NOTES
 
675
   *    The syntax for a WRL is <Wallet Type>:<Wallet Type Parameters>.
 
676
   *
 
677
   *    Wallet Type       Wallet Type Parameters.
 
678
   *    -----------       ----------------------
 
679
   *    File              Pathname (e.g. "file:/home/asriniva")
 
680
   *    Oracle            Connect string (e.g. "oracle:scott/tiger@oss")
 
681
   *
 
682
   *    There are also defaults.  If the WRL is NZT_DEFAULT_WRL, then
 
683
   *    the platform specific WRL default is used.  If only the wallet
 
684
   *    type is specified, then the WRL type specific default is used
 
685
   *    (e.g. "oracle:")
 
686
   *
 
687
   *    There is an implication with Oracle that should be stated: An
 
688
   *    Oracle based wallet can be implemented in a user's private space
 
689
   *    or in world readable space.
 
690
   *
 
691
   *    When the wallet is opened, the password is verified by hashing
 
692
   *    it and comparing against the password hash stored with the
 
693
   *    wallet.  The list of personas (and their associated identities)
 
694
   *    is built and stored into the wallet structure.
 
695
   *    
 
696
   * RETURNS
 
697
   *    NZERROR_OK           Success.
 
698
   *    NZERROR_RIO_OPEN     RIO could not open wallet (see network trace file).
 
699
   *    NZERROR_TK_PASSWORD  Password verification failed.
 
700
   *    NZERROR_TK_WRLTYPE   WRL type is not known.
 
701
   *    NZERROR_TK_WRLPARM   WRL parm does not match type.
 
702
    }
 
703
{$IFNDEF LinkDynamically}
 
704
  function nztwOpenWallet(_para1:Pnzctx; _para2:ub4; _para3:Ptext; _para4:ub4; _para5:Ptext;
 
705
             _para6:PnzttWallet):nzerror;cdecl;external ocilib name 'nztwOpenWallet';
 
706
{$ELSE}
 
707
var nztwOpenWallet : function (_para1:Pnzctx; _para2:ub4; _para3:Ptext; _para4:ub4; _para5:Ptext;
 
708
             _para6:PnzttWallet):nzerror;cdecl;
 
709
{$ENDIF}
 
710
 
 
711
 
 
712
  {---------------------- nztwCloseWallet ---------------------- }
 
713
  {
 
714
   * NAME
 
715
   *    nztwCloseWallet - Close a wallet
 
716
   * 
 
717
   * PARAMETERS
 
718
   *    osscntxt IN     OSS context.
 
719
   *    wallet   IN/OUT Wallet.
 
720
   * 
 
721
   * NOTES
 
722
   *    Closing a wallet also closes all personas associated with that
 
723
   *    wallet.  It does not cause a persona to automatically be saved
 
724
   *    if it has changed.  The implication is that a persona can be
 
725
   *    modified by an application but if it is not explicitly saved it
 
726
   *    reverts back to what was in the wallet.
 
727
   *
 
728
   * RETURNS
 
729
   *    NZERROR_OK           Success.
 
730
   *    NZERROR_RIO_CLOSE    RIO could not close wallet (see network trace file).
 
731
    }
 
732
{$IFNDEF LinkDynamically}
 
733
  function nztwCloseWallet(_para1:Pnzctx; _para2:PnzttWallet):nzerror;cdecl;external ocilib name 'nztwCloseWallet';
 
734
{$ELSE}
 
735
  nztwCloseWallet : function (_para1:Pnzctx; _para2:PnzttWallet):nzerror;cdecl;
 
736
{$ENDIF}
 
737
  {--------------------nztwGetCertInfo---------------------------- }
 
738
  {***NOTE: This function is a temporary hack.*** }
 
739
  {***DO NOT CALL.  It will soon disappear.*** }
 
740
  {_ nzctx *nz_context,
 
741
                              nzosContext *nzosCtx,
 
742
                              nzttWallet *walletRef,
 
743
                              void *peerCert _ }(* error 
 
744
                            void *peerCert _*/);
 
745
 in declarator_list *)
 
746
  {------------------------ nztwConstructWallet ----------------------- }
 
747
  {
 
748
   * 
 
749
   * nzerror nztwConstructWallet( nzctx *oss_context,    
 
750
   *              nzttPolicy openPolicy,
 
751
   *              nzttPolicy securePolicy,
 
752
   *              ub1 *ldapName,
 
753
   *              ub4 ldapNamelen,
 
754
   *              nzstrc *wrl,
 
755
   *              nzttPersona *personas,
 
756
   *              nzttWallet **wallet );
 
757
    }
 
758
  {---------------------- nztwRetrievePersonaCopy ---------------------- }
 
759
  {
 
760
   * NAME
 
761
   *    nztwRetrievePersonaCopy - Retrieves a persona based from wallet
 
762
   * 
 
763
   * PARAMETERS
 
764
   *    osscntxt IN     OSS context. 
 
765
   *    wallet   IN     Wallet.
 
766
   *    index    IN     Which wallet index to remove (first persona is zero).
 
767
   *    persona  OUT    Persona found.
 
768
   * 
 
769
   * NOTES
 
770
   *    Retrieves a persona from the wallet based on the index number passed
 
771
   *    in.  This persona is a COPY of the one stored in the wallet, therefore
 
772
   *    it is perfectly fine for the wallet to be closed after this call is 
 
773
   *    made.
 
774
   *
 
775
   *    The caller is responsible for disposing of the persona when completed.
 
776
   *
 
777
   * RETURNS
 
778
   *    NZERROR_OK           Success.
 
779
    }
 
780
 
 
781
{$IFNDEF LinkDynamically}
 
782
  function nztwRetrievePersonaCopy(_para1:Pnzctx; _para2:PnzttWallet; _para3:ub4; _para4:PPnzttPersona):nzerror;cdecl;external ocilib name 'nztwRetrievePersonaCopy';
 
783
{$ELSE}
 
784
  nztwRetrievePersonaCopy : function (_para1:Pnzctx; _para2:PnzttWallet; _para3:ub4; _para4:PPnzttPersona):nzerror;cdecl;
 
785
{$ENDIF}
 
786
 
 
787
  {---------------------- nztwRetrievePersonaCopyByName ---------------------- }
 
788
  {
 
789
   * NAME
 
790
   *    nztwRetrievePersonaCopyByName - Retrieves a persona based on its name.
 
791
   *
 
792
   * PARAMETERS
 
793
   *    osscntxt IN     OSS context.
 
794
   *    wallet   IN     Wallet.
 
795
   *    name    IN     Name of the persona 
 
796
   *    persona  OUT    Persona found.
 
797
   *
 
798
   * NOTES
 
799
   *    Retrieves a persona from the wallet based on the name of the persona. 
 
800
   *    This persona is a COPY of the one stored in the wallet, therefore
 
801
   *    it is perfectly fine for the wallet to be closed after this call is
 
802
   *    made.
 
803
   *
 
804
   *    The caller is responsible for disposing of the persona when completed.
 
805
   *
 
806
   * RETURNS
 
807
   *    NZERROR_OK           Success.
 
808
    }
 
809
 
 
810
{$IFNDEF LinkDynamically}
 
811
  function nztwRetrievePersonaCopyByName(_para1:Pnzctx; _para2:PnzttWallet; _para3:Pchar; _para4:PPnzttPersona):nzerror;cdecl;external ocilib name 'nztwRetrievePersonaCopyByName';
 
812
{$ELSE}
 
813
  nztwRetrievePersonaCopyByName : function (_para1:Pnzctx; _para2:PnzttWallet; _para3:Pchar; _para4:PPnzttPersona):nzerror;cdecl;
 
814
{$ENDIF}
 
815
 
 
816
  {---------------------- nzteOpenPersona ---------------------- }
 
817
  {
 
818
   * NAME
 
819
   *    nzteOpenPersona - Open a persona.
 
820
   * 
 
821
   * PARAMETERS
 
822
   *    osscntxt IN     OSS context. 
 
823
   *    persona  IN/OUT Persona.
 
824
   * 
 
825
   * NOTES
 
826
   *    
 
827
   * RETURNS
 
828
   *    NZERROR_OK           Success.
 
829
   *    NZERROR_TK_PASSWORD  Password failed to decrypt persona.
 
830
   *    NZERROR_TK_BADPRL    Persona resource locator did not work.
 
831
   *    NZERROR_RIO_OPEN     Could not open persona (see network trace file).
 
832
    }
 
833
 
 
834
{$IFNDEF LinkDynamically}
 
835
  function nzteOpenPersona(_para1:Pnzctx; _para2:PnzttPersona):nzerror;cdecl;external ocilib name 'nzteOpenPersona';
 
836
{$ELSE}
 
837
  nzteOpenPersona : function (_para1:Pnzctx; _para2:PnzttPersona):nzerror;cdecl;
 
838
{$ENDIF}
 
839
 
 
840
  {--------------------- nzteClosePersona --------------------- }
 
841
  {
 
842
   * NAME
 
843
   *    nzteClosePersona - Close a persona.
 
844
   * 
 
845
   * PARAMETERS
 
846
   *    osscntxt IN     OSS context.
 
847
   *    persona  IN/OUT Persona.
 
848
   * 
 
849
   * NOTES
 
850
   *    Closing a persona does not store the persona, it simply releases
 
851
   *    the memory associated with the crypto engine.
 
852
   *    
 
853
   * RETURNS
 
854
   *    NZERROR_OK        Success.
 
855
    }
 
856
 
 
857
{$IFNDEF LinkDynamically}
 
858
  function nzteClosePersona(_para1:Pnzctx; _para2:PnzttPersona):nzerror;cdecl;external ocilib name 'nzteClosePersona';
 
859
{$ELSE}
 
860
  nzteClosePersona : function (_para1:Pnzctx; _para2:PnzttPersona):nzerror;cdecl;
 
861
{$ENDIF}
 
862
 
 
863
  {--------------------- nzteDestroyPersona --------------------- }
 
864
  {
 
865
   * NAME
 
866
   *    nzteDestroyPersona - Destroy a persona.
 
867
   * 
 
868
   * PARAMETERS
 
869
   *    osscntxt IN        OSS context.
 
870
   *    persona  IN/OUT    Persona.
 
871
   * 
 
872
   * NOTES
 
873
   *    The persona is destroyd in the open state, but it will
 
874
   *    not be associated with a wallet.
 
875
   *    
 
876
   *    The persona parameter is doubly indirect so that at the
 
877
   *    conclusion of the function, the pointer can be set to NULL.
 
878
   *
 
879
   *
 
880
   * RETURNS
 
881
   *    NZERROR_OK        Success.
 
882
   *    NZERROR_TK_TYPE   Unsupported itype/ctype combination.
 
883
   *    NZERROR_TK_PARMS  Error in persona description.
 
884
    }
 
885
 
 
886
{$IFNDEF LinkDynamically}
 
887
  function nzteDestroyPersona(_para1:Pnzctx; _para2:PPnzttPersona):nzerror;cdecl;external ocilib name 'nzteDestroyPersona';
 
888
{$ELSE}
 
889
  nzteDestroyPersona : function (_para1:Pnzctx; _para2:PPnzttPersona):nzerror;cdecl;
 
890
{$ENDIF}
 
891
 
 
892
  {---------------------- nzteRetrieveTrustedIdentCopy ---------------------- }
 
893
  {
 
894
   * NAME
 
895
   *    nzteRetrieveTrustedIdentCopy - Retrieves a trusted identity from persona
 
896
   * 
 
897
   * PARAMETERS
 
898
   *    osscntxt IN     OSS context. 
 
899
   *    persona  IN     Persona.
 
900
   *    index    IN     Which wallet index to remove (first element is zero).
 
901
   *    identity OUT    Trusted Identity from this persona.
 
902
   * 
 
903
   * NOTES
 
904
   *    Retrieves a trusted identity from the persona based on the index 
 
905
   *    number passed in.  This identity is a COPY of the one stored in 
 
906
   *    the persona, therefore it is perfectly fine to close the persona
 
907
   *    after this call is made.
 
908
   *
 
909
   *    The caller is responsible for freeing the memory of this object 
 
910
   *    by calling nztiAbortIdentity it is no longer needed
 
911
   *
 
912
   * RETURNS
 
913
   *    NZERROR_OK           Success.
 
914
    }
 
915
 
 
916
{$IFNDEF LinkDynamically}
 
917
  function nzteRetrieveTrustedIdentCopy(_para1:Pnzctx; _para2:PnzttPersona; _para3:ub4; _para4:PPnzttIdentity):nzerror;cdecl;external ocilib name 'nzteRetrieveTrustedIdentCopy';
 
918
{$ELSE}
 
919
  nzteRetrieveTrustedIdentCopy : function (_para1:Pnzctx; _para2:PnzttPersona; _para3:ub4; _para4:PPnzttIdentity):nzerror;cdecl;
 
920
{$ENDIF}
 
921
 
 
922
  {--------------------- nztePriKey --------------------- }
 
923
  {
 
924
   * NAME
 
925
   *    nztePriKey - Get the decrypted Private Key for the Persona
 
926
   * 
 
927
   * PARAMETERS
 
928
   *    osscntxt IN     OSS context.
 
929
   *    persona  IN     Persona.
 
930
   *    vkey     OUT    Private Key [B_KEY_OBJ]
 
931
   *    vkey_len OUT    Private Key Length
 
932
   * 
 
933
   * NOTES
 
934
   *    This funiction will only work for X.509 based persona which contain
 
935
   *    a private key.  
 
936
   *    A copy of the private key is returned to the caller so that they do not 
 
937
   *    have to worry about the key changeing "underneath them".
 
938
   *    Memory will be allocated for the vkey and therefore, the CALLER
 
939
   *    will be responsible for freeing this memory.
 
940
   *
 
941
   * RETURNS
 
942
   *    NZERROR_OK           Success.
 
943
   *    NZERROR_NO_MEMORY    ossctx is null.
 
944
   *    NZERROR_TK_BADPRL    Persona resource locator did not work.
 
945
    }
 
946
 
 
947
{$IFNDEF LinkDynamically}
 
948
  function nztePriKey(_para1:Pnzctx; _para2:PnzttPersona; _para3:PPub1; _para4:Pub4):nzerror;cdecl;external ocilib name 'nztePriKey';
 
949
{$ELSE}
 
950
  nztePriKey : function (_para1:Pnzctx; _para2:PnzttPersona; _para3:PPub1; _para4:Pub4):nzerror;cdecl;
 
951
{$ENDIF}
 
952
 
 
953
  {--------------------- nzteMyCert --------------------- }
 
954
  {
 
955
   * NAME
 
956
   *    nzteMyCert - Get the X.509 Certificate for a persona
 
957
   * 
 
958
   * PARAMETERS
 
959
   *    osscntxt IN     OSS context.
 
960
   *    persona  IN     Persona.
 
961
   *    cert     OUT    X.509 Certificate [BER encoded]
 
962
   *    cert_len OUT    Certificate length
 
963
   * 
 
964
   * NOTES
 
965
   *    This funiction will only work for X.509 based persona which contain
 
966
   *    a certificate for the self identity. 
 
967
   *    A copy of the certificate is returned to the caller so that they do not 
 
968
   *    have to worry about the certificate changeing "underneath them".
 
969
   *    Memory will be allocated for the cert and therefore, the CALLER
 
970
   *    will be responsible for freeing this memory.
 
971
   *
 
972
   * RETURNS
 
973
   *    NZERROR_OK           Success.
 
974
   *    NZERROR_NO_MEMORY    ossctx is null.
 
975
    }
 
976
 
 
977
{$IFNDEF LinkDynamically}
 
978
  function nzteMyCert(_para1:Pnzctx; _para2:PnzttPersona; _para3:PPub1; _para4:Pub4):nzerror;cdecl;external ocilib name 'nzteMyCert';
 
979
{$ELSE}
 
980
  nzteMyCert : function (_para1:Pnzctx; _para2:PnzttPersona; _para3:PPub1; _para4:Pub4):nzerror;cdecl;
 
981
{$ENDIF}
 
982
 
 
983
  {--------------------- nzteX509CreatePersona --------------------- }
 
984
  {
 
985
   * NAME
 
986
   *    nzteX509CreatePersona - Given a BER X.509 cert, create a persona
 
987
   * 
 
988
   * PARAMETERS
 
989
   *    osscntxt IN     OSS context.
 
990
   *    cert     IN     X.509 Certificate [BER encoded]
 
991
   *    cert_len IN     Certificate length
 
992
   *    persona  OUT    Persona.
 
993
   * 
 
994
   * NOTES
 
995
   *    Memory will be allocated for the persona and therefore, the CALLER
 
996
   *    will be responsible for freeing this memory.
 
997
   *
 
998
   * RETURNS
 
999
   *    NZERROR_OK           Success.
 
1000
   *    NZERROR_NO_MEMORY    ossctx is null.
 
1001
    }
 
1002
 
 
1003
{$IFNDEF LinkDynamically}
 
1004
  function nzteX509CreatePersona(_para1:Pnzctx; _para2:Pub1; _para3:ub4; _para4:PPnzttPersona):nzerror;cdecl;external ocilib name 'nzteX509CreatePersona';
 
1005
{$ELSE}
 
1006
  nzteX509CreatePersona : function (_para1:Pnzctx; _para2:Pub1; _para3:ub4; _para4:PPnzttPersona):nzerror;cdecl;
 
1007
{$ENDIF}
 
1008
 
 
1009
  {-------------------- nztiCreateIdentity -------------------- }
 
1010
  {
 
1011
   * NAME
 
1012
   *    nztiCreateIdentity - Create an identity.
 
1013
   * 
 
1014
   * PARAMETERS
 
1015
   *    osscntxt IN     OSS context.
 
1016
   *    itype    IN     Identity type.
 
1017
   *    desc     IN     Description of identity.
 
1018
   *    identity IN/OUT Identity.
 
1019
   * 
 
1020
   * NOTES
 
1021
   *    Memory is only allocated for the identity structure.  The elements in
 
1022
   *    the description struct are not copied.  Rather their pointers are copied
 
1023
   *    into the identity structure.  Therefore, the caller should not free
 
1024
   *    the elements referenced by the desc.  These elements will be freed
 
1025
   *    when the nztiDestroyIdentity is called.
 
1026
   *    
 
1027
   * RETURNS
 
1028
   *    NZERROR_OK        Success.
 
1029
   *    NZERROR_PARMS     Error in description.
 
1030
    }
 
1031
 
 
1032
{$IFNDEF LinkDynamically}
 
1033
  function nztiCreateIdentity(_para1:Pnzctx; _para2:nzttVersion; _para3:PnzttIdentityDesc; _para4:PPnzttIdentity):nzerror;cdecl;external ocilib name 'nztiCreateIdentity';
 
1034
{$ELSE}
 
1035
  nztiCreateIdentity : function (_para1:Pnzctx; _para2:nzttVersion; _para3:PnzttIdentityDesc; _para4:PPnzttIdentity):nzerror;cdecl;
 
1036
{$ENDIF}
 
1037
 
 
1038
{$ifdef NZ_OLD_TOOLS}
 
1039
  {-------------------- nztiDuplicateIdentity -------------------- }
 
1040
  {
 
1041
   * NAME
 
1042
   *    nztiDuplicateIdentity - Duplicate an identity.
 
1043
   * 
 
1044
   * PARAMETERS
 
1045
   *    osscntxt     IN     OSS context.
 
1046
   *    identity     IN     Target Identity.
 
1047
   *    new_identity IN     New Identity.
 
1048
   * 
 
1049
   * NOTES
 
1050
   *    Memory for the identity is allocated inside the function, and all
 
1051
   *    internal identity elements as well.
 
1052
   *    
 
1053
   * RETURNS
 
1054
   *    NZERROR_OK        Success.
 
1055
   *    NZERROR_TK_NOTFOUND  Identity not found.
 
1056
   *    NZERROR_PARMS     Error in description.
 
1057
    }
 
1058
 
 
1059
{$IFNDEF LinkDynamically}
 
1060
  function nztiDuplicateIdentity(_para1:Pnzctx; _para2:PnzttIdentity; _para3:PPnzttIdentity):nzerror;cdecl;external ocilib name 'nztiDuplicateIdentity';
 
1061
{$ELSE}
 
1062
  nztiDuplicateIdentity : function (_para1:Pnzctx; _para2:PnzttIdentity; _para3:PPnzttIdentity):nzerror;cdecl;
 
1063
{$ENDIF}
 
1064
 
 
1065
{$endif}
 
1066
  { NZ_OLD_TOOLS  }
 
1067
  {--------------------- nztiAbortIdentity --------------------- }
 
1068
  {
 
1069
   * NAME
 
1070
   *    nztiAbortIdentity - Abort an unassociated identity.
 
1071
   * 
 
1072
   * PARAMETERS
 
1073
   *    osscntxt IN     OSS context.
 
1074
   *    identity IN/OUT Identity.
 
1075
   * 
 
1076
   * NOTES
 
1077
   *    It is an error to try to abort an identity that can be
 
1078
   *    referenced through a persona.
 
1079
   *    
 
1080
   *    The identity pointer is set to NULL at the conclusion.
 
1081
   * 
 
1082
   * RETURNS
 
1083
   *    NZERROR_OK           Success.
 
1084
   *    NZERROR_CANTABORT    Identity is associated with persona.
 
1085
    }
 
1086
 
 
1087
{$IFNDEF LinkDynamically}
 
1088
  function nztiAbortIdentity(_para1:Pnzctx; _para2:PPnzttIdentity):nzerror;cdecl;external ocilib name 'nztiAbortIdentity';
 
1089
{$ELSE}
 
1090
  nztiAbortIdentity : function (_para1:Pnzctx; _para2:PPnzttIdentity):nzerror;cdecl;
 
1091
{$ENDIF}
 
1092
 
 
1093
{$ifdef NZ_OLD_TOOLS}
 
1094
  {----------------- nztidGetIdentityDesc ----------------- }
 
1095
  {
 
1096
   * NAME
 
1097
   *    nztidGetIdentityDesc - Gets an Identity Description from the identity
 
1098
   * 
 
1099
   * PARAMETERS
 
1100
   *    osscntxt    IN     Success.
 
1101
   *    identity    IN     Identity.
 
1102
   *    description IN/OUT Identity Description.
 
1103
   * 
 
1104
   * NOTES
 
1105
   *    Memory is allocated for the Identity Description. It
 
1106
   *    is the callers responsibility to free this memory by calling 
 
1107
   *    nztiFreeIdentityDesc.
 
1108
   *
 
1109
   * RETURNS
 
1110
   *    NZERROR_OK     Success.
 
1111
    }
 
1112
 
 
1113
{$IFNDEF LinkDynamically}
 
1114
  function nztidGetIdentityDesc(_para1:Pnzctx; _para2:PnzttIdentity; _para3:PPnzttIdentityDesc):nzerror;cdecl;external ocilib name 'nztidGetIdentityDesc';
 
1115
{$ELSE}
 
1116
  nztidGetIdentityDesc : function (_para1:Pnzctx; _para2:PnzttIdentity; _para3:PPnzttIdentityDesc):nzerror;cdecl;
 
1117
{$ENDIF}
 
1118
 
 
1119
  {----------------- nztidFreeIdentityDesc ----------------- }
 
1120
  {
 
1121
   * NAME
 
1122
   *    nztidFreeIdentityDesc - Frees memory for Identity Desc object.
 
1123
   * 
 
1124
   * PARAMETERS
 
1125
   *    osscntxt    IN     oss context.
 
1126
   *    description IN/OUT Identity Description.
 
1127
   * 
 
1128
   * NOTES
 
1129
   *    Memory is freed for all Identity description elements.  Pointer is 
 
1130
   *    then set to null.
 
1131
   *
 
1132
   * RETURNS
 
1133
   *    NZERROR_OK     Success.
 
1134
    }
 
1135
 
 
1136
{$IFNDEF LinkDynamically}
 
1137
  function nztidFreeIdentityDesc(_para1:Pnzctx; _para2:PPnzttIdentityDesc):nzerror;cdecl;external ocilib name 'nztidFreeIdentityDesc';
 
1138
{$ELSE}
 
1139
  nztidFreeIdentityDesc : fucntion (_para1:Pnzctx; _para2:PPnzttIdentityDesc):nzerror;cdecl;
 
1140
{$ENDIF}
 
1141
 
 
1142
{$endif}
 
1143
  { NZ_OLD_TOOLS  }
 
1144
  {---------------- nztific_FreeIdentityContent ---------------- }
 
1145
  {
 
1146
   * NAME
 
1147
   *     nztific_FreeIdentityContent - free the contents of an identity.
 
1148
   * 
 
1149
   * PARAMETERS
 
1150
   *    osscntxt         IN     OSS context.
 
1151
   *    identity         IN/OUT freed identity
 
1152
   * 
 
1153
   * NOTES
 
1154
   *    Free a created identity.
 
1155
   *
 
1156
   * RETURNS
 
1157
   *    NZERROR_OK     Success.
 
1158
    }
 
1159
  {
 
1160
   * Free the identity content.
 
1161
    }
 
1162
 
 
1163
{$IFNDEF LinkDynamically}
 
1164
  function nztific_FreeIdentityContent(ossctx:Pnzctx; identity:PnzttIdentity):nzerror;cdecl;external ocilib name 'nztific_FreeIdentityContent';
 
1165
{$ELSE}
 
1166
  nztific_FreeIdentityContent : function (ossctx:Pnzctx; identity:PnzttIdentity):nzerror;cdecl;
 
1167
{$ENDIF}
 
1168
 
 
1169
  {-------------------------- nztSign -------------------------- }
 
1170
  {
 
1171
   * NAME
 
1172
   *    nztSign - Create an attached signature.
 
1173
   * 
 
1174
   * PARAMETERS
 
1175
   *    osscntxt IN     OSS context.
 
1176
   *    persona  IN     Open persona acting as signer.
 
1177
   *    state    IN     State of signature.
 
1178
   *    inlen    IN     Length of this input part.
 
1179
   *    in       IN     This input part.
 
1180
   *    tdubuf   IN/OUT TDU buffer.
 
1181
   * 
 
1182
   * NOTES
 
1183
   *    
 
1184
   * RETURNS
 
1185
   *    NZERROR_OK           Success.
 
1186
   *    NZERROR_TK_CANTGROW  Needed to grow output buffer but could not.
 
1187
   *    NZERROR_TK_NOTOPEN   Persona is not open.
 
1188
   *    NZERROR_TK_NOTSUPP   Function not supported with persona.
 
1189
    }
 
1190
 
 
1191
{$IFNDEF LinkDynamically}
 
1192
  function nztSign(_para1:Pnzctx; _para2:PnzttPersona; _para3:nzttces; _para4:ub4; _para5:Pub1;
 
1193
             _para6:PnzttBufferBlock):nzerror;cdecl;external ocilib name 'nztSign';
 
1194
{$ELSE}
 
1195
  nztSign : function(_para1:Pnzctx; _para2:PnzttPersona; _para3:nzttces; _para4:ub4; _para5:Pub1;
 
1196
             _para6:PnzttBufferBlock):nzerror;cdecl;
 
1197
{$ENDIF}
 
1198
 
 
1199
  {------------------------- nztVerify ------------------------- }
 
1200
  {
 
1201
   * NAME
 
1202
   *    nztVerify - Verify an attached signature.
 
1203
   * 
 
1204
   * PARAMETERS
 
1205
   *    osscntxt IN     OSS context.
 
1206
   *    persona  IN     Persona.
 
1207
   *    state    IN     State of verification.
 
1208
   *    intdulen IN     TDU length.
 
1209
   *    intdu    IN     TDU.
 
1210
   *    out      IN/OUT Extracted message.
 
1211
   *    verified OUT    TRUE if signature verified.
 
1212
   *    validatedOUT    TRUE if signing identity validated.
 
1213
   *    identity OUT Identity of signing party.
 
1214
   * 
 
1215
   * NOTES
 
1216
   *    
 
1217
   * RETURNS
 
1218
   *    NZERROR_OK           Success.
 
1219
   *    NZERROR_TK_CANTGROW  Needed to grow outptu buffer but could not.
 
1220
   *    NZERROR_TK_NOTOPEN   Persona is not open.
 
1221
   *    NZERROR_TK_NOTSUPP   Function not supported with persona.
 
1222
    }
 
1223
 
 
1224
{$IFNDEF LinkDynamically}
 
1225
  function nztVerify(_para1:Pnzctx; _para2:PnzttPersona; _para3:nzttces; _para4:ub4; _para5:Pub1;
 
1226
             _para6:PnzttBufferBlock; _para7:Pboolean; _para8:Pboolean; _para9:PPnzttIdentity):nzerror;cdecl;external ocilib name 'nztVerify';
 
1227
{$ELSE}
 
1228
  nztVerify : function (_para1:Pnzctx; _para2:PnzttPersona; _para3:nzttces; _para4:ub4; _para5:Pub1;
 
1229
             _para6:PnzttBufferBlock; _para7:Pboolean; _para8:Pboolean; _para9:PPnzttIdentity):nzerror;cdecl;
 
1230
{$ENDIF}
 
1231
 
 
1232
  {------------------------ nztValidate ------------------------ }
 
1233
  {
 
1234
   * NAME
 
1235
   *    nztValidate - Validate an identity.
 
1236
   * 
 
1237
   * PARAMETERS
 
1238
   *    osscntxt IN  OSS context.
 
1239
   *    persona  IN  Persona.
 
1240
   *    identity IN  Identity.
 
1241
   *    validatedOUT TRUE if identity was validated.  
 
1242
   * 
 
1243
   * NOTES
 
1244
   *    
 
1245
   * RETURNS
 
1246
   *    NZERROR_OK           Success.
 
1247
   *    NZERROR_TK_NOTOPEN   Persona is not open.
 
1248
   *    NZERROR_TK_NOTSUPP   Function not supported with persona.
 
1249
    }
 
1250
 
 
1251
{$IFNDEF LinkDynamically}
 
1252
  function nztValidate(_para1:Pnzctx; _para2:PnzttPersona; _para3:PnzttIdentity; _para4:Pboolean):nzerror;cdecl;external ocilib name 'nztValidate';
 
1253
{$ELSE}
 
1254
  nztValidate : function (_para1:Pnzctx; _para2:PnzttPersona; _para3:PnzttIdentity; _para4:Pboolean):nzerror;cdecl;
 
1255
{$ENDIF}
 
1256
 
 
1257
  {-------------------- nztsd_SignDetached -------------------- }
 
1258
  {
 
1259
   * NAME
 
1260
   *    nztsd_SignDetached - Generate a detached signature.
 
1261
   * 
 
1262
   * PARAMETERS
 
1263
   *    osscntxt IN     OSS context.
 
1264
   *    persona  IN     Persona.
 
1265
   *    state    IN     State of signature.
 
1266
   *    inlen    IN     Length of this input part.
 
1267
   *    in       IN     This input part.
 
1268
   *    tdubuf   IN/OUT TDU buffer.
 
1269
   * 
 
1270
   * NOTES
 
1271
   *    
 
1272
   * RETURNS
 
1273
   *    NZERROR_OK           Success.
 
1274
   *    NZERROR_TK_CANTGROW  Needed to grow output buffer but could not.
 
1275
   *    NZERROR_TK_NOTOPEN   Persona is not open.
 
1276
   *    NZERROR_TK_NOTSUPP   Function not supported with persona.
 
1277
    }
 
1278
 
 
1279
{$IFNDEF LinkDynamically}
 
1280
  function nztsd_SignDetached(_para1:Pnzctx; _para2:PnzttPersona; _para3:nzttces; _para4:ub4; _para5:Pub1;
 
1281
             _para6:PnzttBufferBlock):nzerror;cdecl;external ocilib name 'nztsd_SignDetached';
 
1282
{$ELSE}
 
1283
  nztsd_SignDetached : function (_para1:Pnzctx; _para2:PnzttPersona; _para3:nzttces; _para4:ub4; _para5:Pub1;
 
1284
             _para6:PnzttBufferBlock):nzerror;cdecl;
 
1285
{$ENDIF}
 
1286
 
 
1287
  {------------------- nztved_VerifyDetached ------------------- }
 
1288
  {
 
1289
   * NAME
 
1290
   *    nztved_VerifyDetached - Verify a detached signature.
 
1291
   * 
 
1292
   * PARAMETERS
 
1293
   *    osscntxt IN     OSS context.
 
1294
   *    persona  IN     Persona.
 
1295
   *    state    IN     State of verification.
 
1296
   *    inlen    IN     Length of data.
 
1297
   *    in       IN     Data.
 
1298
   *    intdulen IN     Input TDU length.
 
1299
   *    tdu      IN     Input TDU.
 
1300
   *    verified OUT    TRUE if signature verified.
 
1301
   *    validatedOUT    TRUE if signing identity validated.
 
1302
   *    identity OUT Identity of signing party.
 
1303
   * 
 
1304
   * NOTES
 
1305
   *    
 
1306
   * RETURNS
 
1307
   *    NZERROR_OK           Success.
 
1308
   *    NZERROR_TK_NOTOPEN   Persona is not open.
 
1309
   *    NZERROR_TK_NOTSUPP   Function not supported with persona.
 
1310
    }
 
1311
 
 
1312
{$IFNDEF LinkDynamically}
 
1313
  function nztved_VerifyDetached(_para1:Pnzctx; _para2:PnzttPersona; _para3:nzttces; _para4:ub4; _para5:Pub1;
 
1314
             _para6:ub4; _para7:Pub1; _para8:Pboolean; _para9:Pboolean; _para10:PPnzttIdentity):nzerror;cdecl;external ocilib name 'nztved_VerifyDetached';
 
1315
{$ELSE}
 
1316
  nztved_VerifyDetached : function (_para1:Pnzctx; _para2:PnzttPersona; _para3:nzttces; _para4:ub4; _para5:Pub1;
 
1317
             _para6:ub4; _para7:Pub1; _para8:Pboolean; _para9:Pboolean; _para10:PPnzttIdentity):nzerror;cdecl;
 
1318
{$ENDIF}
 
1319
 
 
1320
  {--------------------- nztkec_PKEncrypt --------------------- }
 
1321
  {
 
1322
   * NAME
 
1323
   *    nztkec_PKEncrypt - Encrypt data symmetrically, encrypt key asymmetrically
 
1324
   * 
 
1325
   * PARAMETERS
 
1326
   *    osscntxt    IN     OSS context.
 
1327
   *    persona     IN     Persona.
 
1328
   *    nrecipients IN     Number of recipients for this encryption.
 
1329
   *    recipients  IN     List of recipients.
 
1330
   *    state       IN     State of encryption.
 
1331
   *    inlen       IN     Length of this input part.
 
1332
   *    in          IN     This input part.
 
1333
   *    tdubuf      IN/OUT TDU buffer.
 
1334
   * 
 
1335
   * NOTES
 
1336
   *    There is a limitation of 1 recipient (nrecipients = 1) at this
 
1337
   *    time.
 
1338
   *    
 
1339
   * RETURNS
 
1340
   *    NZERROR_OK           Success.
 
1341
   *    NZERROR_TK_CANTGROW  Needed to grow output buffer but could not.
 
1342
   *    NZERROR_TK_NOTOPEN   Persona is not open.
 
1343
   *    NZERROR_TK_NOTSUPP   Function not supported with persona.
 
1344
    }
 
1345
 
 
1346
{$IFNDEF LinkDynamically}
 
1347
  function nztkec_PKEncrypt(_para1:Pnzctx; _para2:PnzttPersona; _para3:ub4; _para4:PnzttIdentity; _para5:nzttces;
 
1348
             _para6:ub4; _para7:Pub1; _para8:PnzttBufferBlock):nzerror;cdecl;external ocilib name 'nztkec_PKEncrypt';
 
1349
{$ELSE}
 
1350
  nztkec_PKEncrypt : function (_para1:Pnzctx; _para2:PnzttPersona; _para3:ub4; _para4:PnzttIdentity; _para5:nzttces;
 
1351
             _para6:ub4; _para7:Pub1; _para8:PnzttBufferBlock):nzerror;cdecl;
 
1352
{$ENDIF}
 
1353
 
 
1354
  {---------------- nztxkec_PKEncryptExpansion ---------------- }
 
1355
  {
 
1356
   * NAME
 
1357
   *    nztxkec_PKEncryptExpansion - Determine the buffer needed for PKEncrypt
 
1358
   * 
 
1359
   * PARAMETERS
 
1360
   *    osscntxt    IN     OSS context. 
 
1361
   *    persona     IN     Persona.
 
1362
   *    nrecipients IN     Number of recipients.
 
1363
   *    inlen       IN     Length of input.
 
1364
   *    tdulen      out    Length of buffer need.
 
1365
   * 
 
1366
   * NOTES
 
1367
   *    
 
1368
   * RETURNS
 
1369
   *    NZERROR_OK           Success.
 
1370
   *    NZERROR_TK_NOTOPEN   Persona is not open.
 
1371
   *    NZERROR_TK_NOTSUPP   Function not supported with persona.
 
1372
    }
 
1373
 
 
1374
{$IFNDEF LinkDynamically}
 
1375
  function nztxkec_PKEncryptExpansion(_para1:Pnzctx; _para2:PnzttPersona; _para3:ub4; _para4:ub4; _para5:Pub4):nzerror;cdecl;external ocilib name 'nztxkec_PKEncryptExpansion';
 
1376
{$ELSE}
 
1377
  nztxkec_PKEncryptExpansion : function (_para1:Pnzctx; _para2:PnzttPersona; _para3:ub4; _para4:ub4; _para5:Pub4):nzerror;cdecl;
 
1378
{$ENDIF}
 
1379
 
 
1380
  {--------------------- nztkdc_PKDecrypt --------------------- }
 
1381
  {
 
1382
   * NAME
 
1383
   *    nztkdc_PKDecrypt - Decrypt a PKEncrypted message.
 
1384
   * 
 
1385
   * PARAMETERS
 
1386
   *    osscntxt    IN     OSS context.
 
1387
   *    persona     IN     Persona.
 
1388
   *    state       IN     State of encryption.
 
1389
   *    inlen       IN     Length of this input part.
 
1390
   *    in          IN     This input part.
 
1391
   *    tdubuf      IN/OUT TDU buffer.
 
1392
   * 
 
1393
   * NOTES
 
1394
   *    
 
1395
   * RETURNS
 
1396
   *    NZERROR_OK           Success.
 
1397
   *    NZERROR_TK_CANTGROW  Needed to grow output buffer but could not.
 
1398
   *    NZERROR_TK_NOTOPEN   Persona is not open.
 
1399
   *    NZERROR_TK_NOTSUPP   Function not supported with persona.
 
1400
    }
 
1401
 
 
1402
{$IFNDEF LinkDynamically}
 
1403
  function nztkdc_PKDecrypt(_para1:Pnzctx; _para2:PnzttPersona; _para3:nzttces; _para4:ub4; _para5:Pub1;
 
1404
             _para6:PnzttBufferBlock):nzerror;cdecl;external ocilib name 'nztkdc_PKDecrypt';
 
1405
{$ELSE}
 
1406
  nztkdc_PKDecrypt : function (_para1:Pnzctx; _para2:PnzttPersona; _para3:nzttces; _para4:ub4; _para5:Pub1;
 
1407
             _para6:PnzttBufferBlock):nzerror;cdecl;
 
1408
{$ENDIF}
 
1409
 
 
1410
  {-------------------------- nztHash -------------------------- }
 
1411
  {
 
1412
   * NAME
 
1413
   *    nztHash - Generate a hash.
 
1414
   * 
 
1415
   * PARAMETERS
 
1416
   *    osscntxt IN     OSS context.
 
1417
   *    persona  IN     Persona.
 
1418
   *    state    IN     State of hash.
 
1419
   *    inlen    IN     Length of this input.
 
1420
   *    in       IN     This input.
 
1421
   *    tdu      IN/OUT Output tdu.
 
1422
   * 
 
1423
   * NOTES
 
1424
   *    
 
1425
   * RETURNS
 
1426
   *    NZERROR_OK           Success.
 
1427
   *    NZERROR_TK_CANTGROW  Needed to grow TDU buffer but could not.
 
1428
   *    NZERROR_TK_NOTOPEN   Persona is not open.
 
1429
   *    NZERROR_TK_NOTSUPP   Function not supported with persona.
 
1430
    }
 
1431
 
 
1432
{$IFNDEF LinkDynamically}
 
1433
  function nztHash(_para1:Pnzctx; _para2:PnzttPersona; _para3:nzttces; _para4:ub4; _para5:Pub1;
 
1434
             _para6:PnzttBufferBlock):nzerror;cdecl;external ocilib name 'nztHash';
 
1435
{$ELSE}
 
1436
  nztHash : function (_para1:Pnzctx; _para2:PnzttPersona; _para3:nzttces; _para4:ub4; _para5:Pub1;
 
1437
             _para6:PnzttBufferBlock):nzerror;cdecl;
 
1438
{$ENDIF}
 
1439
 
 
1440
  {----------------------- nztSeedRandom ----------------------- }
 
1441
  {
 
1442
   * NAME
 
1443
   *    nztSeedRandom - Seed the random function
 
1444
   * 
 
1445
   * PARAMETERS
 
1446
   *    osscntxt IN  OSS context.
 
1447
   *    persona  IN  Persona.
 
1448
   *    seedlen  IN  Length of seed.
 
1449
   *    seed     IN  Seed.
 
1450
   * 
 
1451
   * NOTES
 
1452
   *    
 
1453
   * RETURNS
 
1454
   *    NZERROR_OK           Success.
 
1455
   *    NZERROR_TK_NOTOPEN   Persona is not open.
 
1456
   *    NZERROR_TK_NOTSUPP   Function not supported with persona.
 
1457
    }
 
1458
 
 
1459
{$IFNDEF LinkDynamically}
 
1460
  function nztSeedRandom(_para1:Pnzctx; _para2:PnzttPersona; _para3:ub4; _para4:Pub1):nzerror;cdecl;external ocilib name 'nztSeedRandom';
 
1461
{$ELSE}
 
1462
  nztSeedRandom : function (_para1:Pnzctx; _para2:PnzttPersona; _para3:ub4; _para4:Pub1):nzerror;cdecl;
 
1463
{$ENDIF}
 
1464
 
 
1465
  {--------------------- nztrb_RandomBytes --------------------- }
 
1466
  {
 
1467
   * NAME
 
1468
   *    nztrb_RandomBytes - Generate a buffer random bytes.
 
1469
   * 
 
1470
   * PARAMETERS
 
1471
   *    osscntxt IN     OSS context.
 
1472
   *    persona  IN     Persona.
 
1473
   *    nbytes   IN     Number of bytes desired.
 
1474
   *    out      IN/OUT Buffer block for bytes.
 
1475
   * 
 
1476
   * NOTES
 
1477
   *    
 
1478
   * RETURNS
 
1479
   *    NZERROR_OK           Success.
 
1480
   *    NZERROR_TK_CANTGROW  Needed to grow TDU buffer but could not.
 
1481
   *    NZERROR_TK_NOTOPEN   Persona is not open.
 
1482
   *    NZERROR_TK_NOTSUPP   Function not supported with persona.
 
1483
    }
 
1484
 
 
1485
{$IFNDEF LinkDynamically}
 
1486
  function nztrb_RandomBytes(_para1:Pnzctx; _para2:PnzttPersona; _para3:ub4; _para4:PnzttBufferBlock):nzerror;cdecl;external ocilib name 'nztrb_RandomBytes';
 
1487
{$ELSE}
 
1488
  nztrb_RandomBytes : function (_para1:Pnzctx; _para2:PnzttPersona; _para3:ub4; _para4:PnzttBufferBlock):nzerror;cdecl;
 
1489
{$ENDIF}
 
1490
 
 
1491
  {-------------------- nztrn_RandomNumber -------------------- }
 
1492
  {
 
1493
   * NAME
 
1494
   *    nztrn_RandomNumber - Generate a random number
 
1495
   * 
 
1496
   * PARAMETERS
 
1497
   *    osscntxt IN     OSS context.
 
1498
   *    persona  IN     Persona.
 
1499
   *    num      OUT    Number.
 
1500
   * 
 
1501
   * NOTES
 
1502
   *    
 
1503
   * RETURNS
 
1504
   *    NZERROR_OK           Success.
 
1505
   *    NZERROR_TK_NOTOPEN   Persona is not open.
 
1506
   *    NZERROR_TK_NOTSUPP   Function not supported with persona.
 
1507
    }
 
1508
 
 
1509
{$IFNDEF LinkDynamically}
 
1510
  function nztrn_RandomNumber(_para1:Pnzctx; _para2:PnzttPersona; _para3:Puword):nzerror;cdecl;external ocilib name 'nztrn_RandomNumber';
 
1511
{$ELSE}
 
1512
  nztrn_RandomNumber : function (_para1:Pnzctx; _para2:PnzttPersona; _para3:Puword):nzerror;cdecl;
 
1513
{$ENDIF}
 
1514
 
 
1515
  {---------------------- nztbbInitBlock ---------------------- }
 
1516
  {
 
1517
   * NAME
 
1518
   *    nztbbInitBlock - Initialize a buffer block.
 
1519
   * 
 
1520
   * PARAMETERS
 
1521
   *    osscntxt IN     OSS context.
 
1522
   *    block    IN/OUT Buffer block.
 
1523
   * 
 
1524
   * NOTES
 
1525
   *    The buffer block is initialized to be empty (all members are set
 
1526
   *    to 0/NULL).  Such a block will be allocated memory as needed.
 
1527
   *    
 
1528
   * RETURNS
 
1529
   *    NZERROR_OK        Success.
 
1530
    }
 
1531
 
 
1532
{$IFNDEF LinkDynamically}
 
1533
  function nztbbInitBlock(_para1:Pnzctx; _para2:PnzttBufferBlock):nzerror;cdecl;external ocilib name 'nztbbInitBlock';
 
1534
{$ELSE}
 
1535
  nztbbInitBlock : function (_para1:Pnzctx; _para2:PnzttBufferBlock):nzerror;cdecl;
 
1536
{$ENDIF}
 
1537
 
 
1538
  {---------------------- nztbbReuseBlock ---------------------- }
 
1539
  {
 
1540
   * NAME
 
1541
   *    nztbbReuseBlock - Reuse an already initialized and possibly used block.
 
1542
   * 
 
1543
   * PARAMETERS
 
1544
   *    osscntxt IN     OSS context.
 
1545
   *    block    IN/OUT Buffer block.
 
1546
   * 
 
1547
   * NOTES
 
1548
   *    This function simply sets the used length member of the buffer
 
1549
   *    block to 0.  If the block already has memory allocated to it,
 
1550
   *    this will cause it to be reused.
 
1551
   *    
 
1552
   * RETURNS
 
1553
   *    NZERROR_OK        Success.
 
1554
    }
 
1555
 
 
1556
{$IFNDEF LinkDynamically}
 
1557
  function nztbbReuseBlock(_para1:Pnzctx; _para2:PnzttBufferBlock):nzerror;cdecl;external ocilib name 'nztbbReuseBlock';
 
1558
{$ELSE}
 
1559
  nztbbReuseBlock : function (_para1:Pnzctx; _para2:PnzttBufferBlock):nzerror;cdecl;
 
1560
{$ENDIF}
 
1561
 
 
1562
  {---------------------- nztbbSizeBlock ---------------------- }
 
1563
  {
 
1564
   * NAME
 
1565
   *    nztbbSizeBlock - Size an initialized block to a particular size.
 
1566
   * 
 
1567
   * PARAMETERS
 
1568
   *    osscntxt IN     OSS context.
 
1569
   *    len      IN     Minimum number of unused bytes desired.
 
1570
   *    block    IN/OUT Buffer block.
 
1571
   *
 
1572
   * NOTES
 
1573
   *    
 
1574
   * RETURNS
 
1575
   *    NZERROR_OK        Success.
 
1576
    }
 
1577
 
 
1578
{$IFNDEF LinkDynamically}
 
1579
  function nztbbSizeBlock(_para1:Pnzctx; _para2:ub4; _para3:PnzttBufferBlock):nzerror;cdecl;external ocilib name 'nztbbSizeBlock';
 
1580
{$ELSE}
 
1581
  nztbbSizeBlock : function (_para1:Pnzctx; _para2:ub4; _para3:PnzttBufferBlock):nzerror;cdecl;
 
1582
{$ENDIF}
 
1583
 
 
1584
  {----------------------- nztbbGrowBlock ----------------------- }
 
1585
  {
 
1586
   * NAME
 
1587
   *    nzbbGrowBlock - Increase the size of the buffer block.
 
1588
   * 
 
1589
   * PARAMETERS
 
1590
   *    osscntxt IN     OSS context.
 
1591
   *    inc      IN     Number of bytes to increase.
 
1592
   *    block    IN/OUT Buffer block.
 
1593
   *
 
1594
   * NOTES
 
1595
   *    
 
1596
   * RETURNS
 
1597
   *    NZERROR_OK        Success.
 
1598
    }
 
1599
 
 
1600
{$IFNDEF LinkDynamically}
 
1601
  function nztbbGrowBlock(_para1:Pnzctx; _para2:ub4; _para3:PnzttBufferBlock):nzerror;cdecl;external ocilib name 'nztbbGrowBlock';
 
1602
{$ELSE}
 
1603
  nztbbGrowBlock : function (_para1:Pnzctx; _para2:ub4; _para3:PnzttBufferBlock):nzerror;cdecl;
 
1604
{$ENDIF}
 
1605
 
 
1606
  {---------------------- nztbbPurgeBlock ---------------------- }
 
1607
  {
 
1608
   * NAME
 
1609
   *    nztbbPurgeBlock - Purge a buffer block of its memory.
 
1610
   * 
 
1611
   * PARAMETERS
 
1612
   *    osscntxt IN     OSS context.
 
1613
   *    block    IN/OUT Buffer block.
 
1614
   * 
 
1615
   * NOTES
 
1616
   *    The memory used by the buffer block as the buffer is released.
 
1617
   *    The buffer block itself is not affected.
 
1618
   *    
 
1619
   * RETURNS
 
1620
   *    NZERROR_OK        Success.
 
1621
    }
 
1622
 
 
1623
{$IFNDEF LinkDynamically}
 
1624
  function nztbbPurgeBlock(_para1:Pnzctx; _para2:PnzttBufferBlock):nzerror;cdecl;external ocilib name 'nztbbPurgeBlock';
 
1625
{$ELSE}
 
1626
  nztbbPurgeBlock : function (_para1:Pnzctx; _para2:PnzttBufferBlock):nzerror;cdecl;
 
1627
{$ENDIF}
 
1628
 
 
1629
  {----------------------- nztbbSetBlock ----------------------- }
 
1630
  {
 
1631
   * NAME
 
1632
   *    nztbbSetBlock - Set a buffer block to a known state.
 
1633
   * 
 
1634
   * PARAMETERS
 
1635
   *    osscntxt IN     OSS context.
 
1636
   *    flags    IN     Flags to set.
 
1637
   *    buflen   IN     Length of buffer.
 
1638
   *    usedlen  IN     Used length.
 
1639
   *    buffer   IN     Buffer.
 
1640
   *    block    IN/OUT Buffer block
 
1641
   * 
 
1642
   * NOTES
 
1643
   *    If buflen > 0, objlen == 0, and obj == NULL, then buflen bytes
 
1644
   *    of memory is allocated and a pointer is stored in the buffer
 
1645
   *    block.
 
1646
   *
 
1647
   *    The buffer parameter remains unchanged.
 
1648
   *    
 
1649
   * RETURNS
 
1650
   *    NZERROR_OK        Success.
 
1651
    }
 
1652
 
 
1653
{$IFNDEF LinkDynamically}
 
1654
  function nztbbSetBlock(_para1:Pnzctx; _para2:uword; _para3:ub4; _para4:ub4; _para5:Pub1;
 
1655
             _para6:PnzttBufferBlock):nzerror;cdecl;external ocilib name 'nztbbSetBlock';
 
1656
{$ELSE}
 
1657
  nztbbSetBlock : function (_para1:Pnzctx; _para2:uword; _para3:ub4; _para4:ub4; _para5:Pub1;
 
1658
             _para6:PnzttBufferBlock):nzerror;cdecl;
 
1659
{$ENDIF}
 
1660
 
 
1661
  {--------------------- nztiGetSecInfo --------------------- }
 
1662
  {
 
1663
   * NAME
 
1664
   *    nztiGetSecInfo - Get some security information for SSL
 
1665
   * 
 
1666
   * PARAMETERS
 
1667
   *    Name   IN/OUT   Description
 
1668
   *       osscntxt IN        OSS context.
 
1669
   *       persona  IN      persona
 
1670
   *       dname    OUT       distinguished name of the certificate
 
1671
   *       dnamelen OUT       length of the distinguished name 
 
1672
   *       issuername OUT     issuer name of the certificate
 
1673
   *       certhash OUT      SHA1 hash of the certificate
 
1674
   *   certhashlenOUT   length of the hash
 
1675
   * NOTES
 
1676
   *    This function allocate memories for issuername, certhash, and dname.
 
1677
   *   To deallocate memory for those params, you should call nztdbuf_DestroyBuf.
 
1678
   * RETURNS
 
1679
   *    
 
1680
    }
 
1681
 
 
1682
{$IFNDEF LinkDynamically}
 
1683
  function nztiGetSecInfo(_para1:Pnzctx; _para2:PnzttPersona; _para3:PPtext; _para4:Pub4; _para5:PPtext;
 
1684
             _para6:Pub4; _para7:PPub1; _para8:Pub4):nzerror;cdecl;external ocilib name 'nztiGetSecInfo';
 
1685
{$ELSE}
 
1686
  nztiGetSecInfo : function (_para1:Pnzctx; _para2:PnzttPersona; _para3:PPtext; _para4:Pub4; _para5:PPtext;
 
1687
             _para6:Pub4; _para7:PPub1; _para8:Pub4):nzerror;cdecl;
 
1688
{$ENDIF}
 
1689
 
 
1690
  {---------------------- nztiGetDName ---------------------- }
 
1691
  {
 
1692
   * NAME
 
1693
   *    nztiGetDName - Get the distinguished name for the given identity
 
1694
   * 
 
1695
   * PARAMETERS
 
1696
   *    Name   IN/OUT   Description
 
1697
   *       osscntxt IN        OSS context.
 
1698
   *   identity IN      identity need to get dname from
 
1699
   *   dn   OUT      distinguished name
 
1700
   *   dnlen   OUT      length of the dname
 
1701
   *
 
1702
   * NOTES
 
1703
   *    
 
1704
   * RETURNS
 
1705
   *    
 
1706
    }
 
1707
 
 
1708
{$IFNDEF LinkDynamically}
 
1709
  function nztiGetDName(_para1:Pnzctx; _para2:PnzttIdentity; _para3:PPtext; _para4:Pub4):nzerror;cdecl;external ocilib name 'nztiGetDName';
 
1710
{$ELSE}
 
1711
  nztiGetDName : function (_para1:Pnzctx; _para2:PnzttIdentity; _para3:PPtext; _para4:Pub4):nzerror;cdecl;
 
1712
{$ENDIF}
 
1713
 
 
1714
  {------------------- nztiGetIssuerName ------------------- }
 
1715
  {
 
1716
   * NAME
 
1717
   *    nztiGetIssuerName -  Get IssuerName for the given identity 
 
1718
   * 
 
1719
   * PARAMETERS
 
1720
   *    Name   IN/OUT   Description
 
1721
   *       osscntxt IN        OSS context.
 
1722
   *   identity IN      identity need to get issuername from
 
1723
   *   issuername OUT          issuer's name
 
1724
   *   issuernamelen OUT   length of the issuer's name
 
1725
   * 
 
1726
   * NOTES
 
1727
   *    
 
1728
   * RETURNS
 
1729
   *    
 
1730
    }
 
1731
 
 
1732
{$IFNDEF LinkDynamically}
 
1733
  function nztiGetIssuerName(_para1:Pnzctx; _para2:PnzttIdentity; _para3:PPtext; _para4:Pub4):nzerror;cdecl;external ocilib name 'nztiGetIssuerName';
 
1734
{$ELSE}
 
1735
  nztiGetIssuerName : function (_para1:Pnzctx; _para2:PnzttIdentity; _para3:PPtext; _para4:Pub4):nzerror;cdecl;
 
1736
{$ENDIF}
 
1737
 
 
1738
  {-------------------- nztgch_GetCertHash -------------------- }
 
1739
  {
 
1740
   * NAME
 
1741
   *    nztgch_GetCertHash -  Get SHA1 hash for the certificate of the identity 
 
1742
   * 
 
1743
   * PARAMETERS
 
1744
   *    Name   IN/OUT   Description
 
1745
   *       osscntxt IN        OSS context.
 
1746
   *   identity IN      identity need to get issuername from
 
1747
   *   certHash OUT          certHash buffer 
 
1748
   *   hashLen OUT      length of the certHash 
 
1749
   * 
 
1750
   * NOTES
 
1751
   *    Need to call nztdbuf_DestroyBuf to deallocate memory for certHash.   
 
1752
   * RETURNS
 
1753
   *    
 
1754
    }
 
1755
 
 
1756
{$IFNDEF LinkDynamically}
 
1757
  function nztgch_GetCertHash(_para1:Pnzctx; _para2:PnzttIdentity; _para3:PPub1; _para4:Pub4):nzerror;cdecl;external ocilib name 'nztgch_GetCertHash';
 
1758
{$ELSE}
 
1759
  nztgch_GetCertHash : function (_para1:Pnzctx; _para2:PnzttIdentity; _para3:PPub1; _para4:Pub4):nzerror;cdecl;
 
1760
{$ENDIF}
 
1761
 
 
1762
  {-------------------- nztdbuf_DestroyBuf -------------------- }
 
1763
  {
 
1764
   * NAME
 
1765
   *    nztdbuf_DestroyBuf - Deallocation funtions for ub1 and text buffer 
 
1766
   * 
 
1767
   * PARAMETERS
 
1768
   *    Name   IN/OUT   Description
 
1769
   *       osscntxt IN        OSS context.
 
1770
   *   buf      IN      Allocated buffer to be destroyed.
 
1771
   * 
 
1772
   * NOTES
 
1773
   *    
 
1774
   * RETURNS
 
1775
   *    
 
1776
    }
 
1777
 
 
1778
{$IFNDEF LinkDynamically}
 
1779
  function nztdbuf_DestroyBuf(_para1:Pnzctx; _para2:PPdvoid):nzerror;cdecl;external ocilib name 'nztdbuf_DestroyBuf';
 
1780
{$ELSE}
 
1781
  nztdbuf_DestroyBuf : function (_para1:Pnzctx; _para2:PPdvoid):nzerror;cdecl;
 
1782
{$ENDIF}
 
1783
 
 
1784
  {----------------------- nztGetCertChain ----------------------- }
 
1785
  {
 
1786
   * NAME
 
1787
   *    nztGetCertChain - 
 
1788
   * 
 
1789
   * PARAMETERS
 
1790
   *    Name   IN/OUT   Description
 
1791
   *       osscntxt IN        OSS context.
 
1792
   * 
 
1793
   * NOTES
 
1794
   *    
 
1795
   * RETURNS
 
1796
   *    
 
1797
    }
 
1798
 
 
1799
{$IFNDEF LinkDynamically}
 
1800
  function nztGetCertChain(_para1:Pnzctx; _para2:PnzttWallet):nzerror;cdecl;external ocilib name 'nztGetCertChain';
 
1801
{$ELSE}
 
1802
  nztGetCertChain : function (_para1:Pnzctx; _para2:PnzttWallet):nzerror;cdecl;
 
1803
{$ENDIF}
 
1804
 
 
1805
  {----------------------- nztCompareDN ----------------------- }
 
1806
  {
 
1807
   * NAME
 
1808
   *    nztCompareDN - 
 
1809
   * 
 
1810
   * PARAMETERS
 
1811
   *    Name   IN/OUT   Description
 
1812
   *       osscntxt IN        OSS context.
 
1813
   *   dn1   IN      distinguished name 1
 
1814
   *   dn2     IN      distinguished name 2
 
1815
   * 
 
1816
   * NOTES
 
1817
   *    
 
1818
   * RETURNS
 
1819
   *    NZERROR_OK       succeeded
 
1820
   *   others         failed
 
1821
   *    
 
1822
    }
 
1823
 
 
1824
{$IFNDEF LinkDynamically}
 
1825
  function nztCompareDN(_para1:Pnzctx; _para2:Pub1; _para3:ub4; _para4:Pub1; _para5:ub4;
 
1826
             _para6:Pboolean):nzerror;cdecl;external ocilib name 'nztCompareDN';
 
1827
{$ELSE}
 
1828
  nztCompareDN : function (_para1:Pnzctx; _para2:Pub1; _para3:ub4; _para4:Pub1; _para5:ub4;
 
1829
             _para6:Pboolean):nzerror;cdecl;
 
1830
{$ENDIF}
 
1831
 
 
1832
{$ifdef NZ_OLD_TOOLS}
 
1833
  {--------------------- nztIdentityAlloc --------------------- }
 
1834
  {
 
1835
   * NAME
 
1836
   *    nztIdentityAlloc - Allocate memory for nzttIdentity context
 
1837
   * 
 
1838
   * PARAMETERS
 
1839
   *    Name   IN/OUT   Description
 
1840
   *       osscntxt IN        OSS context.
 
1841
   *   identity OUT      nzttIdentity context
 
1842
   * 
 
1843
   * NOTES
 
1844
   *    
 
1845
   * RETURNS
 
1846
   *    NZERROR_OK       succeeded
 
1847
   *   others         failed
 
1848
   *    
 
1849
    }
 
1850
 
 
1851
{$IFNDEF LinkDynamically}
 
1852
  function nztIdentityAlloc(_para1:Pnzctx; _para2:PPnzttIdentity):nzerror;cdecl;external ocilib name 'nztIdentityAlloc';
 
1853
{$ELSE}
 
1854
  nztIdentityAlloc : function (_para1:Pnzctx; _para2:PPnzttIdentity):nzerror;cdecl;
 
1855
{$ENDIF}
 
1856
 
 
1857
  {--------------------- nztIPrivateAlloc --------------------- }
 
1858
  {
 
1859
   * NAME
 
1860
   *    nztIPrivateAlloc - Allocate memory for nzttIdentityPrivate
 
1861
   * 
 
1862
   * PARAMETERS
 
1863
   *    Name   IN/OUT   Description
 
1864
   * 
 
1865
   *       osscntxt IN        OSS context.
 
1866
   *   ipriv   OUT      identityPrivate structure
 
1867
   * NOTES
 
1868
   *    
 
1869
   * RETURNS
 
1870
   *    NZERROR_OK       succeeded
 
1871
   *   others         failed
 
1872
   *    
 
1873
    }
 
1874
 
 
1875
{$IFNDEF LinkDynamically}
 
1876
  function nztIPrivateAlloc(_para1:Pnzctx; _para2:PPnzttIdentityPrivate):nzerror;cdecl;external ocilib name 'nztIPrivateAlloc';
 
1877
{$ELSE}
 
1878
  nztIPrivateAlloc : function (_para1:Pnzctx; _para2:PPnzttIdentityPrivate):nzerror;cdecl;
 
1879
{$ENDIF}
 
1880
 
 
1881
  {---------------------- nztIDupContent ---------------------- }
 
1882
  {
 
1883
   * NAME
 
1884
   *    nztIDupContent - 
 
1885
   * 
 
1886
   * PARAMETERS
 
1887
   *    Name   IN/OUT   Description
 
1888
   *       osscntxt IN        OSS context.
 
1889
   *    targetIdentityOUT   target identity
 
1890
   *   sourceIdentity IN   source identity
 
1891
   * NOTES
 
1892
   *    
 
1893
   * RETURNS
 
1894
   *    NZERROR_OK       succeeded
 
1895
   *   others         failed
 
1896
   *    
 
1897
    }
 
1898
 
 
1899
{$IFNDEF LinkDynamically}
 
1900
  function nztIDupContent(_para1:Pnzctx; _para2:PnzttIdentity; _para3:PnzttIdentity):nzerror;cdecl;external ocilib name 'nztIDupContent';
 
1901
{$ELSE}
 
1902
  nztIDupContent : function (_para1:Pnzctx; _para2:PnzttIdentity; _para3:PnzttIdentity):nzerror;cdecl;
 
1903
{$ENDIF}
 
1904
 
 
1905
  {---------------------- nztIPDuplicate ---------------------- }
 
1906
  {
 
1907
   * NAME
 
1908
   *    nztIPDuplicate - 
 
1909
   * 
 
1910
   * PARAMETERS
 
1911
   *    Name   IN/OUT   Description
 
1912
   *       osscntxt IN        OSS context.
 
1913
   *   target_ipriv OUT   target identityPrivate
 
1914
   *   source_ipriv IN   source identityPrivate
 
1915
   * 
 
1916
   * NOTES
 
1917
   *    
 
1918
   * RETURNS
 
1919
   *    NZERROR_OK       succeeded
 
1920
   *   others         failed
 
1921
   *    
 
1922
    }
 
1923
 
 
1924
{$IFNDEF LinkDynamically}
 
1925
  function nztIPDuplicate(_para1:Pnzctx; _para2:PPnzttIdentityPrivate; _para3:PnzttIdentityPrivate):nzerror;cdecl;external ocilib name 'nztIPDuplicate';
 
1926
{$ELSE}
 
1927
  nztIPDuplicate : function (_para1:Pnzctx; _para2:PPnzttIdentityPrivate; _para3:PnzttIdentityPrivate):nzerror;cdecl;
 
1928
{$ENDIF}
 
1929
 
 
1930
  {--------------------- nztiDupIdentList --------------------- }
 
1931
  {
 
1932
   * NAME
 
1933
   *    nztiDupIdentList - 
 
1934
   * 
 
1935
   * PARAMETERS
 
1936
   *    Name   IN/OUT   Description
 
1937
   *       osscntxt IN        OSS context.
 
1938
   *   source_identities IN   source identity list
 
1939
   *   numIdent OUT      number of identity in the list
 
1940
   *   ppidentity OUT   Target of identity   
 
1941
   *   
 
1942
   * NOTES
 
1943
   *    
 
1944
   * RETURNS
 
1945
   *    NZERROR_OK       succeeded
 
1946
   *   others         failed
 
1947
   *    
 
1948
    }
 
1949
 
 
1950
{$IFNDEF LinkDynamically}
 
1951
  function nztiDupIdentList(_para1:Pnzctx; _para2:PnzttIdentity; _para3:Pub4; _para4:PPnzttIdentity):nzerror;cdecl;external ocilib name 'nztiDupIdentList';
 
1952
{$ELSE}
 
1953
  nztiDupIdentList : function (_para1:Pnzctx; _para2:PnzttIdentity; _para3:Pub4; _para4:PPnzttIdentity):nzerror;cdecl;
 
1954
{$ENDIF}
 
1955
 
 
1956
  {--------------------- nztFreeIdentList --------------------- }
 
1957
  {
 
1958
   * NAME
 
1959
   *    nztFreeIdentList - Free memory for a list of Identities
 
1960
   * 
 
1961
   * PARAMETERS
 
1962
   *    Name   IN/OUT   Description
 
1963
   *       osscntxt IN        OSS context.
 
1964
   *   identity IN      identity context
 
1965
   *
 
1966
   * NOTES
 
1967
   *    
 
1968
   * RETURNS
 
1969
   *    NZERROR_OK       succeeded
 
1970
   *   others         failed
 
1971
   *    
 
1972
    }
 
1973
 
 
1974
{$IFNDEF LinkDynamically}
 
1975
  function nztFreeIdentList(_para1:Pnzctx; _para2:PPnzttIdentity):nzerror;cdecl;external ocilib name 'nztFreeIdentList';
 
1976
{$ELSE}
 
1977
  nztFreeIdentList : function (_para1:Pnzctx; _para2:PPnzttIdentity):nzerror;cdecl;
 
1978
{$ENDIF}
 
1979
 
 
1980
{$endif}
 
1981
  { NZ_OLD_TOOLS  }
 
1982
  {--------------------- nztCheckVaLidity --------------------- }
 
1983
  {
 
1984
   * NAME
 
1985
   *    nztCheckVaLidity -  Check the validity of certificate
 
1986
   * 
 
1987
   * PARAMETERS
 
1988
   *    Name   IN/OUT   Description
 
1989
   *       osscntxt IN        OSS context.
 
1990
   *   start_time      Start time of the certificate
 
1991
   *   end_time      End time of the certificate
 
1992
   * 
 
1993
   * NOTES
 
1994
   *    
 
1995
   * RETURNS
 
1996
   *    NZERROR_OK       succeeded
 
1997
   *   others         failed
 
1998
   *    
 
1999
    }
 
2000
 
 
2001
{$IFNDEF LinkDynamically}
 
2002
  function nztCheckValidity(_para1:Pnzctx; _para2:ub4; _para3:ub4):nzerror;cdecl;external ocilib name 'nztCheckValidity';
 
2003
{$ELSE}
 
2004
  nztCheckValidity : function (_para1:Pnzctx; _para2:ub4; _para3:ub4):nzerror;cdecl;
 
2005
{$ENDIF}
 
2006
 
 
2007
  {--------------------- nztwCreateWallet --------------------- }
 
2008
  {
 
2009
   * NAME
 
2010
   *    nztwCreateWallet - Create a new wallet.
 
2011
   * 
 
2012
   * PARAMETERS
 
2013
   *    osscntxt IN     OSS context.
 
2014
   *    wrllen   IN     Length of wallet resource locator.
 
2015
   *    wrl      IN     WRL.
 
2016
   *    pwdlen   IN     Length of password (see notes below).
 
2017
   *    pwd      IN     Password.
 
2018
   *    wallet   IN/OUT Wallet. 
 
2019
   * 
 
2020
   * NOTES
 
2021
   *    It is an error to try to create a wallet that already exists.
 
2022
   *    The previously existing wallet must be destroyed first.
 
2023
   *
 
2024
   *    The wallet itself is not encrypted.  Rather, all the personas in
 
2025
   *    the wallet are encrypted under the same password.  A hash of the
 
2026
   *    password is stored in the wallet.
 
2027
   *
 
2028
   *    Upon success, an empty open wallet is stored in the wallet
 
2029
   *    parameter.
 
2030
   *    
 
2031
   * RETURNS
 
2032
   *    NZERROR_OK                 Sucess.
 
2033
   *    NZERROR_TK_WALLET_EXISTS   Wallet already exists.
 
2034
   *    NZERROR_RIO_OPEN           RIO could not create wallet (see trace file).
 
2035
    }
 
2036
 
 
2037
{$IFNDEF LinkDynamically}
 
2038
  function nztwCreateWallet(_para1:Pnzctx; _para2:ub4; _para3:Ptext; _para4:ub4; _para5:Ptext;
 
2039
             _para6:PnzttWallet):nzerror;cdecl;external ocilib name 'nztwCreateWallet';
 
2040
{$ELSE}
 
2041
  nztwCreateWallet : function (_para1:Pnzctx; _para2:ub4; _para3:Ptext; _para4:ub4; _para5:Ptext;
 
2042
             _para6:PnzttWallet):nzerror;cdecl;
 
2043
{$ENDIF}
 
2044
 
 
2045
  {--------------------- nztwDestroyWallet --------------------- }
 
2046
  {
 
2047
   * NAME
 
2048
   *    nztwDestroyWallet - Destroy an existing wallet.
 
2049
   * 
 
2050
   * PARAMETERS
 
2051
   *    osscntxt IN     OSS context.
 
2052
   *    wrllen   IN     Length of wallet resource locator.
 
2053
   *    wrl      IN     WRL.
 
2054
   *    pwdlen   IN     Length of password.
 
2055
   *    pwd      IN     Password.
 
2056
   * NOTES
 
2057
   *    
 
2058
   * RETURNS
 
2059
   *    NZERROR_OK           Success.
 
2060
   *    NZERROR_TK_PASSWORD  Password verification failed.
 
2061
   *    NZERROR_RIO_OPEN     RIO could not open wallet (see trace file).
 
2062
   *    NZERROR_RIO_DELETE   Delete failed (see trace file).
 
2063
    }
 
2064
 
 
2065
{$IFNDEF LinkDynamically}
 
2066
  function nztwDestroyWallet(_para1:Pnzctx; _para2:ub4; _para3:Ptext; _para4:ub4; _para5:Ptext):nzerror;cdecl;external ocilib name 'nztwDestroyWallet';
 
2067
{$ELSE}
 
2068
  nztwDestroyWallet : function (_para1:Pnzctx; _para2:ub4; _para3:Ptext; _para4:ub4; _para5:Ptext):nzerror;cdecl;
 
2069
{$ENDIF}
 
2070
 
 
2071
  {--------------------- nzteStorePersona --------------------- }
 
2072
  {
 
2073
   * NAME
 
2074
   *    nzteStorePersona - Store an open persona in a wallet.
 
2075
   * 
 
2076
   * PARAMETERS
 
2077
   *    osscntxt IN     OSS context. 
 
2078
   *    persona  IN/OUT Persona.
 
2079
   *    wallet   IN/OUT Wallet.
 
2080
   * 
 
2081
   * NOTES
 
2082
   *    If the open persona is not associated with any wallet (it was
 
2083
   *    created via the nzteClosePersona function), then storing the
 
2084
   *    persona creates that association.  The wallet will also have an
 
2085
   *    updated persona list that reflects this association.
 
2086
   *
 
2087
   *    If the open persona was associated with wallet 'A' (it was
 
2088
   *    opened via the nztwOpenWallet function), and is stored back into
 
2089
   *    wallet 'A', then then the old persona is overwritten by the new
 
2090
   *    persona if the password can be verified.  Recall that all
 
2091
   *    personas have a unique identity id.  If that id changes then
 
2092
   *    storing the persona will put a new persona in the wallet.
 
2093
   *
 
2094
   *    If the open persona was associated with wallet 'A' and is stored
 
2095
   *    into wallet 'B', and if wallet 'B' does not contain a persona
 
2096
   *    with that unique identity id, then the persona will be copied
 
2097
   *    into wallet 'B', wallet 'B''s persona list will be updated, and
 
2098
   *    the persona structure will be updated to be associated with
 
2099
   *    wallet 'B'.  If wallet 'B' already contained the persona, it
 
2100
   *    would be overwritten by the new persona.
 
2101
   *
 
2102
   *    The persona parameter is doubly indirect so that at the
 
2103
   *    conclusion of the function call, the pointer can be directed to
 
2104
   *    the persona in the wallet.
 
2105
   *
 
2106
   * RETURNS
 
2107
   *    NZERROR_OK           Success.
 
2108
   *    NZERROR_TK_PASSWORD  Password verification failed.
 
2109
   *    NZERROR_RIO_STORE    Store failed (see network trace file).
 
2110
    }
 
2111
 
 
2112
{$IFNDEF LinkDynamically}
 
2113
  function nzteStorePersona(_para1:Pnzctx; _para2:PPnzttPersona; _para3:PnzttWallet):nzerror;cdecl;external ocilib name 'nzteStorePersona';
 
2114
{$ELSE}
 
2115
  nzteStorePersona : function (_para1:Pnzctx; _para2:PPnzttPersona; _para3:PnzttWallet):nzerror;cdecl;
 
2116
{$ENDIF}
 
2117
 
 
2118
  {--------------------- nzteRemovePersona --------------------- }
 
2119
  {
 
2120
   * NAME
 
2121
   *    nzteRemovePersona - Remove a persona from the wallet.
 
2122
   * 
 
2123
   * PARAMETERS
 
2124
   *    osscntxt IN     OSS context.
 
2125
   *    persona  IN/OUT Persona.
 
2126
   * 
 
2127
   * NOTES
 
2128
   *    The password is verified before trying to remove the persona.
 
2129
   *    
 
2130
   *    If the persona is open, it is closed.  The persona is removed
 
2131
   *    from the wallet list and the persona pointer is set to NULL.
 
2132
   *    
 
2133
   *    A double indirect pointer to the persona is required so that the
 
2134
   *    persona pointer can be set to NULL upon completion.
 
2135
   *
 
2136
   * RETURNS
 
2137
   *    NZERROR_OK           Success.
 
2138
   *    NZERROR_TK_PASSWORD  Password verification failed.
 
2139
   *    NZERROR_RIO_DELETE   Delete failed.
 
2140
    }
 
2141
 
 
2142
{$IFNDEF LinkDynamically}
 
2143
  function nzteRemovePersona(_para1:Pnzctx; _para2:PPnzttPersona):nzerror;cdecl;external ocilib name 'nzteRemovePersona';
 
2144
{$ELSE}
 
2145
  nzteRemovePersona : function (_para1:Pnzctx; _para2:PPnzttPersona):nzerror;cdecl;
 
2146
{$ENDIF}
 
2147
 
 
2148
  {--------------------- nzteCreatePersona --------------------- }
 
2149
  {
 
2150
   * NAME
 
2151
   *    nzteCreatePersona - Create a persona.
 
2152
   * 
 
2153
   * PARAMETERS
 
2154
   *    osscntxt IN     OSS context.
 
2155
   *    itype    IN     Identity type.
 
2156
   *    ctype    IN     Cipher type.
 
2157
   *    desc     IN     Persona description.
 
2158
   *    persona  OUT    Persona.
 
2159
   * 
 
2160
   * NOTES
 
2161
   *    The resulting persona is created in the open state, but it will
 
2162
   *    not be associated with a wallet.
 
2163
   *    
 
2164
   *    The memory for the persona is allocated by the function.
 
2165
   *
 
2166
   * RETURNS
 
2167
   *    NZERROR_OK        Success.
 
2168
   *    NZERROR_TK_TYPE   Unsupported itype/ctype combination.
 
2169
   *    NZERROR_TK_PARMS  Error in persona description.
 
2170
    }
 
2171
 
 
2172
{$IFNDEF LinkDynamically}
 
2173
  function nzteCreatePersona(_para1:Pnzctx; _para2:nzttVersion; _para3:nzttCipherType; _para4:PnzttPersonaDesc; _para5:PPnzttPersona):nzerror;cdecl;external ocilib name 'nzteCreatePersona';
 
2174
{$ELSE}
 
2175
  nzteCreatePersona : function (_para1:Pnzctx; _para2:nzttVersion; _para3:nzttCipherType; _para4:PnzttPersonaDesc; _para5:PPnzttPersona):nzerror;cdecl;
 
2176
{$ENDIF}
 
2177
 
 
2178
  {----------------- nztiStoreTrustedIdentity ----------------- }
 
2179
  {
 
2180
   * NAME
 
2181
   *    nztiStoreTrustedIdentity - Store an identity into a persona.
 
2182
   * 
 
2183
   * PARAMETERS
 
2184
   *    osscntxt IN     Success.
 
2185
   *    identity IN/OUT Trusted Identity.
 
2186
   *    persona  IN/OUT Persona.    
 
2187
   * 
 
2188
   * NOTES
 
2189
   *    The identity is not saved with the persona in the wallet until
 
2190
   *    the persona is stored.
 
2191
   *    
 
2192
   *    The identity parameter is double indirect so that it can point
 
2193
   *    into the persona at the conclusion of the call.
 
2194
   *
 
2195
   * RETURNS
 
2196
   *    NZERROR_OK     Success.
 
2197
    }
 
2198
 
 
2199
{$IFNDEF LinkDynamically}
 
2200
  function nztiStoreTrustedIdentity(_para1:Pnzctx; _para2:PPnzttIdentity; _para3:PnzttPersona):nzerror;cdecl;external ocilib name 'nztiStoreTrustedIdentity';
 
2201
{$ELSE}
 
2202
  nztiStoreTrustedIdentity : function (_para1:Pnzctx; _para2:PPnzttIdentity; _para3:PnzttPersona):nzerror;cdecl;
 
2203
{$ENDIF}
 
2204
 
 
2205
  {--------------------- nzteSetProtection --------------------- }
 
2206
  {
 
2207
   * NAME
 
2208
   *    nzteSetProtection - Set the protection type for a CE function.
 
2209
   * 
 
2210
   * PARAMETERS
 
2211
   *    osscntxt IN     OSS context.
 
2212
   *    persona  IN/OUT Persona.
 
2213
   *    func     IN     CE function.
 
2214
   *    tdufmt   IN     TDU Format.
 
2215
   *    protinfo IN     Protection information specific to this format.
 
2216
   * 
 
2217
   * NOTES
 
2218
   *    
 
2219
   * RETURNS
 
2220
   *    NZERROR_OK              Success.
 
2221
   *    NZERROR_TK_PROTECTION   Unsupported protection.
 
2222
   *    NZERROR_TK_PARMS        Error in protection info.
 
2223
    }
 
2224
 
 
2225
{$IFNDEF LinkDynamically}
 
2226
  function nzteSetProtection(_para1:Pnzctx; _para2:PnzttPersona; _para3:nzttcef; _para4:nztttdufmt; _para5:PnzttProtInfo):nzerror;cdecl;external ocilib name 'nzteSetProtection';
 
2227
{$ELSE}
 
2228
  nzteSetProtection : function (_para1:Pnzctx; _para2:PnzttPersona; _para3:nzttcef; _para4:nztttdufmt; _para5:PnzttProtInfo):nzerror;cdecl;
 
2229
{$ENDIF}
 
2230
 
 
2231
  {--------------------- nzteGetProtection --------------------- }
 
2232
  {
 
2233
   * NAME
 
2234
   *    nzteGetProtection - Get the protection type for a CE function.
 
2235
   * 
 
2236
   * PARAMETERS
 
2237
   *    osscntxt IN     OSS context.
 
2238
   *    persona  IN     Persona.
 
2239
   *    func     IN     CE function.
 
2240
   *    tdufmt   OUT    TDU format.
 
2241
   *    protinfo OUT    Protection information.
 
2242
   * 
 
2243
   * NOTES
 
2244
   *    
 
2245
   * RETURNS
 
2246
   *    NZERROR_OK        Success.
 
2247
    }
 
2248
 
 
2249
{$IFNDEF LinkDynamically}
 
2250
  function nzteGetProtection(_para1:Pnzctx; _para2:PnzttPersona; _para3:nzttcef; _para4:Pnztttdufmt; _para5:PnzttProtInfo):nzerror;cdecl;external ocilib name 'nzteGetProtection';
 
2251
{$ELSE}
 
2252
  nzteGetProtection : function (_para1:Pnzctx; _para2:PnzttPersona; _para3:nzttcef; _para4:Pnztttdufmt; _para5:PnzttProtInfo):nzerror;cdecl;
 
2253
{$ENDIF}
 
2254
 
 
2255
  {-------------------- nztiRemoveIdentity -------------------- }
 
2256
  {
 
2257
   * NAME
 
2258
   *    nztiRemoveIdentity - Remove an identity from an open persona.
 
2259
   * 
 
2260
   * PARAMETERS
 
2261
   *    osscntxt IN     OSS context. 
 
2262
   *    identity IN/OUT     Identity.
 
2263
   * 
 
2264
   * NOTES
 
2265
   *    If the persona is not stored, this identity will still be in the
 
2266
   *    persona stored in the wallet.
 
2267
   *    
 
2268
   *    The identity parameter is doubly indirect so that at the
 
2269
   *    conclusion of the function, the pointer can be set to NULL.
 
2270
   *
 
2271
   * RETURNS
 
2272
   *    NZERROR_OK           Success.
 
2273
   *    NZERROR_TK_NOTFOUND  Identity not found.
 
2274
   *    NZERROR_TK_NOTOPEN   Persona is not open.
 
2275
    }
 
2276
 
 
2277
{$IFNDEF LinkDynamically}
 
2278
  function nztiRemoveIdentity(_para1:Pnzctx; _para2:PPnzttIdentity):nzerror;cdecl;external ocilib name 'nztiRemoveIdentity';
 
2279
{$ELSE}
 
2280
  nztiRemoveIdentity : function (_para1:Pnzctx; _para2:PPnzttIdentity):nzerror;cdecl;
 
2281
{$ENDIF}
 
2282
 
 
2283
  {----------------- nztifdn ----------------- }
 
2284
  {
 
2285
   * NAME
 
2286
   *    nztifdn - create an Identity From a Distinguished Name
 
2287
   * 
 
2288
   * PARAMETERS
 
2289
   *    osscntxt           IN  OSS context.
 
2290
   *    length             IN  Length of the distinguished name
 
2291
   *    distinguished_name IN  distinguished name string
 
2292
   *    ppidentity         OUT created identity
 
2293
   * 
 
2294
   * NOTES
 
2295
   *    Given a distinguished name, return the identity that corresponds to it.
 
2296
   *
 
2297
   * RETURNS
 
2298
   *    NZERROR_OK     Success.
 
2299
    }
 
2300
 
 
2301
{$IFNDEF LinkDynamically}
 
2302
  function nztifdn(ossctx:Pnzctx; length:ub4; distinguished_name:Ptext; ppidentity:PPnzttIdentity):nzerror;cdecl;external ocilib name 'nztifdn';
 
2303
{$ELSE}
 
2304
  nztifdn : function (ossctx:Pnzctx; length:ub4; distinguished_name:Ptext; ppidentity:PPnzttIdentity):nzerror;cdecl;
 
2305
{$ENDIF}
 
2306
 
 
2307
  {--------------------- nztxSignExpansion --------------------- }
 
2308
  {
 
2309
   * NAME
 
2310
   *    nztxSignExpansion - Determine the size of the attached signature buffer.
 
2311
   * 
 
2312
   * PARAMETERS
 
2313
   *    osscntxt IN  OSS context.
 
2314
   *    persona  IN  Persona.
 
2315
   *    inlen    IN  Length of input.
 
2316
   *    tdulen   OUT Buffer needed for signature.
 
2317
   *
 
2318
   * NOTES
 
2319
   *    
 
2320
   * RETURNS
 
2321
   *    NZERROR_OK           Success.
 
2322
   *    NZERROR_TK_NOTOPEN   Persona is not open.
 
2323
   *    NZERROR_TK_NOTSUPP   Function not supported with persona.
 
2324
    }
 
2325
 
 
2326
{$IFNDEF LinkDynamically}
 
2327
  function nztxSignExpansion(_para1:Pnzctx; _para2:PnzttPersona; _para3:ub4; _para4:Pub4):nzerror;cdecl;external ocilib name 'nztxSignExpansion';
 
2328
{$ELSE}
 
2329
  nztxSignExpansion : function (_para1:Pnzctx; _para2:PnzttPersona; _para3:ub4; _para4:Pub4):nzerror;cdecl;
 
2330
{$ENDIF}
 
2331
 
 
2332
  {--------------- nztxsd_SignDetachedExpansion --------------- }
 
2333
  {
 
2334
   * NAME
 
2335
   *    nztxsd_SignDetachedExpansion - Determine the size of buffer needed.
 
2336
   * 
 
2337
   * PARAMETERS
 
2338
   *    osscntxt IN  OSS context.
 
2339
   *    persona  IN  Persona.
 
2340
   *    inlen    IN  Length of input.
 
2341
   *    tdulen   OUT Buffer needed for signature.
 
2342
   * 
 
2343
   * NOTES
 
2344
   *    
 
2345
   * RETURNS
 
2346
   *    NZERROR_OK           Success.
 
2347
   *    NZERROR_TK_NOTOPEN   Persona is not open.
 
2348
   *    NZERROR_TK_NOTSUPP   Function not supported with persona.
 
2349
    }
 
2350
 
 
2351
{$IFNDEF LinkDynamically}
 
2352
  function nztxsd_SignDetachedExpansion(_para1:Pnzctx; _para2:PnzttPersona; _para3:ub4; _para4:Pub4):nzerror;cdecl;external ocilib name 'nztxsd_SignDetachedExpansion';
 
2353
{$ELSE}
 
2354
  nztxsd_SignDetachedExpansion : function (_para1:Pnzctx; _para2:PnzttPersona; _para3:ub4; _para4:Pub4):nzerror;cdecl;
 
2355
{$ENDIF}
 
2356
 
 
2357
  {------------------------ nztEncrypt ------------------------ }
 
2358
  {
 
2359
   * NAME
 
2360
   *    nztEncrypt - Symmetrically encrypt
 
2361
   * 
 
2362
   * PARAMETERS
 
2363
   *    osscntxt    IN     OSS context.
 
2364
   *    persona     IN     Persona.
 
2365
   *    inlen       IN     Length of this input part.
 
2366
   *    in          IN     This input part.
 
2367
   *    tdubuf      IN/OUT TDU buffer.
 
2368
   * 
 
2369
   * NOTES
 
2370
   *    
 
2371
   * RETURNS
 
2372
   *    NZERROR_OK           Success.
 
2373
   *    NZERROR_TK_CANTGROW  Needed to grow TDU buffer but could not.
 
2374
   *    NZERROR_TK_NOTOPEN   Persona is not open.
 
2375
   *    NZERROR_TK_NOTSUPP   Function not supported with persona.
 
2376
    }
 
2377
 
 
2378
{$IFNDEF LinkDynamically}
 
2379
  function nztEncrypt(_para1:Pnzctx; _para2:PnzttPersona; _para3:nzttces; _para4:ub4; _para5:Pub1;
 
2380
             _para6:PnzttBufferBlock):nzerror;cdecl;external ocilib name 'nztEncrypt';
 
2381
{$ELSE}
 
2382
  nztEncrypt : function (_para1:Pnzctx; _para2:PnzttPersona; _para3:nzttces; _para4:ub4; _para5:Pub1;
 
2383
             _para6:PnzttBufferBlock):nzerror;cdecl;
 
2384
{$ENDIF}
 
2385
 
 
2386
  {------------------- nztxEncryptExpansion ------------------- }
 
2387
  {
 
2388
   * NAME
 
2389
   *    nztxEncryptExpansion - Determine the size of the TDU to encrypt.
 
2390
   * 
 
2391
   * PARAMETERS
 
2392
   *    osscntxt    IN  OSS context.
 
2393
   *    persona     IN  Persona.
 
2394
   *    inlen       IN  Length of this input part.
 
2395
   *    tdulen      OUT Length of TDU.
 
2396
   * 
 
2397
   * NOTES
 
2398
   *    
 
2399
   * RETURNS
 
2400
   *    NZERROR_OK           Success.
 
2401
   *    NZERROR_TK_NOTOPEN   Persona is not open.
 
2402
   *    NZERROR_TK_NOTSUPP   Function not supported with persona.
 
2403
    }
 
2404
 
 
2405
{$IFNDEF LinkDynamically}
 
2406
  function nztxEncryptExpansion(_para1:Pnzctx; _para2:PnzttPersona; _para3:ub4; _para4:Pub4):nzerror;cdecl;external ocilib name 'nztxEncryptExpansion';
 
2407
{$ELSE}
 
2408
  nztxEncryptExpansion : function (_para1:Pnzctx; _para2:PnzttPersona; _para3:ub4; _para4:Pub4):nzerror;cdecl;
 
2409
{$ENDIF}
 
2410
 
 
2411
  {------------------------ nztDecrypt ------------------------ }
 
2412
  {
 
2413
   * NAME
 
2414
   *    nztDecrypt - Decrypt an Encrypted message.
 
2415
   * 
 
2416
   * PARAMETERS
 
2417
   *    osscntxt IN     OSS context.
 
2418
   *    persona  IN     Persona.
 
2419
   *    state    IN     State of decryption.
 
2420
   *    inlen    IN     Length of this input part.
 
2421
   *    in       IN     This input part.
 
2422
   *    out      IN/OUT Cleartext message.
 
2423
   * 
 
2424
   * NOTES
 
2425
   *    
 
2426
   * RETURNS
 
2427
   *    NZERROR_OK           Success.
 
2428
   *    NZERROR_TK_CANTGROW  Needed to grow TDU buffer but could not.
 
2429
   *    NZERROR_TK_NOTOPEN   Persona is not open.
 
2430
   *    NZERROR_TK_NOTSUPP   Function not supported with persona.
 
2431
    }
 
2432
 
 
2433
{$IFNDEF LinkDynamically}
 
2434
  function nztDecrypt(_para1:Pnzctx; _para2:PnzttPersona; _para3:nzttces; _para4:ub4; _para5:Pub1;
 
2435
             _para6:PnzttBufferBlock):nzerror;cdecl;external ocilib name 'nztDecrypt';
 
2436
{$ELSE}
 
2437
  nztDecrypt : function (_para1:Pnzctx; _para2:PnzttPersona; _para3:nzttces; _para4:ub4; _para5:Pub1;
 
2438
             _para6:PnzttBufferBlock):nzerror;cdecl;
 
2439
{$ENDIF}
 
2440
 
 
2441
  {------------------------ nztEnvelope ------------------------ }
 
2442
  {
 
2443
   * NAME
 
2444
   *    nztEnvelope - Sign and PKEncrypt a message.
 
2445
   * 
 
2446
   * PARAMETERS
 
2447
   *    osscntxt    IN     OSS context.
 
2448
   *    persona     IN     Persona.
 
2449
   *    nrecipients IN     Number of recipients for this encryption.
 
2450
   *    recipients  IN     List of recipients.
 
2451
   *    state       IN     State of encryption.
 
2452
   *    inlen       IN     Length of this input part.
 
2453
   *    in          IN     This input part.
 
2454
   *    tdubuf      IN/OUT TDU buffer.
 
2455
   *
 
2456
   * NOTES
 
2457
   *    
 
2458
   * RETURNS
 
2459
   *    NZERROR_OK           Success.
 
2460
   *    NZERROR_TK_CANTGROW  Needed to grow output buffer but could not.
 
2461
   *    NZERROR_TK_NOTOPEN   Persona is not open.
 
2462
   *    NZERROR_TK_NOTSUPP   Function not supported with persona.
 
2463
    }
 
2464
 
 
2465
{$IFNDEF LinkDynamically}
 
2466
  function nztEnvelope(_para1:Pnzctx; _para2:PnzttPersona; _para3:ub4; _para4:PnzttIdentity; _para5:nzttces;
 
2467
             _para6:ub4; _para7:Pub1; _para8:PnzttBufferBlock):nzerror;cdecl;external ocilib name 'nztEnvelope';
 
2468
{$ELSE}
 
2469
  nztEnvelope : function (_para1:Pnzctx; _para2:PnzttPersona; _para3:ub4; _para4:PnzttIdentity; _para5:nzttces;
 
2470
             _para6:ub4; _para7:Pub1; _para8:PnzttBufferBlock):nzerror;cdecl;
 
2471
{$ENDIF}
 
2472
 
 
2473
  {----------------------- nztDeEnvelope ----------------------- }
 
2474
  {
 
2475
   * NAME
 
2476
   *    nztDeEnvelope - PKDecrypt and verify a message.
 
2477
   * 
 
2478
   * PARAMETERS
 
2479
   *    osscntxt    IN     OSS context.
 
2480
   *    persona     IN     Persona.
 
2481
   *    state       IN     State of encryption.
 
2482
   *    inlen       IN     Length of this input part.
 
2483
   *    in          IN     This input part.
 
2484
   *    out         OUT    Message from TDU.
 
2485
   *    verified    OUT    TRUE if verified.
 
2486
   *    validated   OUT    TRUE if validated.
 
2487
   *    sender      OUT    Identity of sender.
 
2488
   *
 
2489
   * NOTES
 
2490
   *    
 
2491
   * RETURNS
 
2492
   *    NZERROR_OK           Success.
 
2493
   *    NZERROR_TK_CANTGROW  Needed to grow TDU buffer but could not.
 
2494
   *    NZERROR_TK_NOTOPEN   Persona is not open.
 
2495
   *    NZERROR_TK_NOTSUPP   Function not supported with persona.
 
2496
    }
 
2497
 
 
2498
{$IFNDEF LinkDynamically}
 
2499
  function nztDeEnvelope(_para1:Pnzctx; _para2:PnzttPersona; _para3:nzttces; _para4:ub4; _para5:Pub1;
 
2500
             _para6:PnzttBufferBlock; _para7:Pboolean; _para8:Pboolean; _para9:PPnzttIdentity):nzerror;cdecl;external ocilib name 'nztDeEnvelope';
 
2501
{$ELSE}
 
2502
  nztDeEnvelope : function (_para1:Pnzctx; _para2:PnzttPersona; _para3:nzttces; _para4:ub4; _para5:Pub1;
 
2503
             _para6:PnzttBufferBlock; _para7:Pboolean; _para8:Pboolean; _para9:PPnzttIdentity):nzerror;cdecl;
 
2504
{$ENDIF}
 
2505
 
 
2506
  {----------------------- nztKeyedHash ----------------------- }
 
2507
  {
 
2508
   * NAME
 
2509
   *    nztKeyedHash - Generate a keyed hash.
 
2510
   * 
 
2511
   * PARAMETERS
 
2512
   *    osscntxt IN     OSS context.
 
2513
   *    persona  IN     Persona.
 
2514
   *    state    IN     State of hash.
 
2515
   *    inlen    IN     Length of this input.
 
2516
   *    in       IN     This input.
 
2517
   *    tdu      IN/OUT Output tdu.
 
2518
   * 
 
2519
   * NOTES
 
2520
   *    
 
2521
   * RETURNS
 
2522
   *    NZERROR_OK           Success.
 
2523
   *    NZERROR_TK_CANTGROW  Needed to grow TDU buffer but could not.
 
2524
   *    NZERROR_TK_NOTOPEN   Persona is not open.
 
2525
   *    NZERROR_TK_NOTSUPP   Function not supported with persona.
 
2526
    }
 
2527
 
 
2528
{$IFNDEF LinkDynamically}
 
2529
  function nztKeyedHash(_para1:Pnzctx; _para2:PnzttPersona; _para3:nzttces; _para4:ub4; _para5:Pub1;
 
2530
             _para6:PnzttBufferBlock):nzerror;cdecl;external ocilib name 'nztKeyedHash';
 
2531
{$ELSE}
 
2532
  nztKeyedHash : function (_para1:Pnzctx; _para2:PnzttPersona; _para3:nzttces; _para4:ub4; _para5:Pub1;
 
2533
             _para6:PnzttBufferBlock):nzerror;cdecl;
 
2534
{$ENDIF}
 
2535
 
 
2536
  {------------------ nztxKeyedHashExpansion ------------------ }
 
2537
  {
 
2538
   * NAME
 
2539
   *    nztxKeyedHashExpansion - Determine the space needed for a keyed hash.
 
2540
   * 
 
2541
   * PARAMETERS
 
2542
   *    osscntxt IN  OSS context.
 
2543
   *    persona  IN  Persona.
 
2544
   *    inlen    IN  Length of this input.
 
2545
   *    tdulen   OUT TDU length.
 
2546
   * 
 
2547
   * NOTES
 
2548
   *    
 
2549
   * RETURNS
 
2550
   *    NZERROR_OK           Success.
 
2551
   *    NZERROR_TK_NOTOPEN   Persona is not open.
 
2552
   *    NZERROR_TK_NOTSUPP   Function not supported with persona.
 
2553
    }
 
2554
 
 
2555
{$IFNDEF LinkDynamically}
 
2556
  function nztxKeyedHashExpansion(_para1:Pnzctx; _para2:PnzttPersona; _para3:ub4; _para4:Pub4):nzerror;cdecl;external ocilib name 'nztxKeyedHashExpansion';
 
2557
{$ELSE}
 
2558
  nztxKeyedHashExpansion : function (_para1:Pnzctx; _para2:PnzttPersona; _para3:ub4; _para4:Pub4):nzerror;cdecl;
 
2559
{$ENDIF}
 
2560
 
 
2561
  {--------------------- nztxHashExpansion --------------------- }
 
2562
  {
 
2563
   * NAME
 
2564
   *    nztxHashExpansion - Determine the size of the TDU for a hash.
 
2565
   * 
 
2566
   * PARAMETERS
 
2567
   *    osscntxt IN  OSS context.
 
2568
   *    persona  IN  Persona.
 
2569
   *    inlen    IN  Length of this input.
 
2570
   *    tdulen   OUT TDU length.
 
2571
   * 
 
2572
   * NOTES
 
2573
   *    
 
2574
   * RETURNS
 
2575
   *    NZERROR_OK           Success.
 
2576
   *    NZERROR_TK_NOTOPEN   Persona is not open.
 
2577
   *    NZERROR_TK_NOTSUPP   Function not supported with persona.
 
2578
    }
 
2579
 
 
2580
{$IFNDEF LinkDynamically}
 
2581
  function nztxHashExpansion(_para1:Pnzctx; _para2:PnzttPersona; _para3:ub4; _para4:Pub4):nzerror;cdecl;external ocilib name 'nztxHashExpansion';
 
2582
{$ELSE}
 
2583
  nztxHashExpansion : function(_para1:Pnzctx; _para2:PnzttPersona; _para3:ub4; _para4:Pub4):nzerror;cdecl;
 
2584
{$ENDIF}
 
2585
 
 
2586
  {---------------- nztiae_IsAuthEnabled ---------------- }
 
2587
  {
 
2588
   * NAME
 
2589
   *    nztiae_IsAuthEnabled -  Checks to see if Authentication is Enabled
 
2590
   *                               in the current Cipher Spec.
 
2591
   * 
 
2592
   * PARAMETERS
 
2593
   *    ctx   IN   Oracle SSL Context
 
2594
   *      ncipher IN    CipherSuite
 
2595
   *      authEnabled OUT Boolean for is Auth Enabled?
 
2596
   * 
 
2597
   * NOTES
 
2598
   *    
 
2599
   * RETURNS
 
2600
   *      NZERROR_OK on success.
 
2601
   *      NZERROR_TK_INV_CIPHR_TYPE if Cipher Spec is not Recognized.
 
2602
    }
 
2603
 
 
2604
{$IFNDEF LinkDynamically}
 
2605
  function nztiae_IsAuthEnabled(_para1:Pnzctx; _para2:ub2; _para3:Pboolean):nzerror;cdecl;external ocilib name 'nztiae_IsAuthEnabled';
 
2606
{$ELSE}
 
2607
  nztiae_IsAuthEnabled : function (_para1:Pnzctx; _para2:ub2; _para3:Pboolean):nzerror;cdecl;
 
2608
{$ENDIF}
 
2609
 
 
2610
  {---------------- nztiee_IsEncrEnabled ---------------- }
 
2611
  {
 
2612
   * NAME
 
2613
   *    nztiee_IsEncrEnabled -  Checks to see if Encryption is Enabled
 
2614
   *                               in the current Cipher Spec.
 
2615
   * 
 
2616
   * PARAMETERS
 
2617
   *    ctx   IN   Oracle SSL Context
 
2618
   *      ncipher IN    CipherSuite
 
2619
   *      EncrEnabled OUT Boolean for is Auth Enabled?
 
2620
   * 
 
2621
   * NOTES
 
2622
   *    
 
2623
   * RETURNS
 
2624
   *      NZERROR_OK on success.
 
2625
   *      NZERROR_TK_INV_CIPHR_TYPE if Cipher Spec is not Recognized.
 
2626
    }
 
2627
 
 
2628
{$IFNDEF LinkDynamically}
 
2629
  function nztiee_IsEncrEnabled(_para1:Pnzctx; _para2:ub2; _para3:Pboolean):nzerror;cdecl;external ocilib name 'nztiee_IsEncrEnabled';
 
2630
{$ELSE}
 
2631
  nztiee_IsEncrEnabled : function (_para1:Pnzctx; _para2:ub2; _para3:Pboolean):nzerror;cdecl;
 
2632
{$ENDIF}
 
2633
 
 
2634
  {---------------- nztihe_IsHashEnabled ---------------- }
 
2635
  {
 
2636
   * NAME
 
2637
   *    nztihe_IsHashEnabled -  Checks to see if HAshing is Enabled
 
2638
   *                               in the current Cipher Spec.
 
2639
   * 
 
2640
   * PARAMETERS
 
2641
   *    ctx   IN   Oracle SSL Context
 
2642
   *      ncipher IN    CipherSuite
 
2643
   *      hashEnabled OUT Boolean for is Auth Enabled?
 
2644
   * 
 
2645
   * NOTES
 
2646
   *    
 
2647
   * RETURNS
 
2648
   *      NZERROR_OK on success.
 
2649
   *      NZERROR_TK_INV_CIPHR_TYPE if Cipher Spec is not Recognized.
 
2650
    }
 
2651
 
 
2652
{$IFNDEF LinkDynamically}
 
2653
  function nztihe_IsHashEnabled(_para1:Pnzctx; _para2:ub2; _para3:Pboolean):nzerror;cdecl;external ocilib name 'nztihe_IsHashEnabled';
 
2654
{$ELSE}
 
2655
  nztihe_IsHashEnabled : function (_para1:Pnzctx; _para2:ub2; _para3:Pboolean):nzerror;cdecl;
 
2656
{$ENDIF}
 
2657
 
 
2658
  {
 
2659
   *
 
2660
    }
 
2661
{$IFNDEF LinkDynamically}
 
2662
 
 
2663
  function nztGetIssuerName(_para1:Pnzctx; _para2:PnzttIdentity; _para3:PPub1; _para4:Pub4):nzerror;cdecl;external ocilib name 'nztGetIssuerName';
 
2664
 
 
2665
 
 
2666
  function nztGetSubjectName(_para1:Pnzctx; _para2:PnzttIdentity; _para3:PPub1; _para4:Pub4):nzerror;cdecl;external ocilib name 'nztGetSubjectName';
 
2667
 
 
2668
 
 
2669
  function nztGetBase64Cert(_para1:Pnzctx; _para2:PnzttIdentity; _para3:PPub1; _para4:Pub4):nzerror;cdecl;external ocilib name 'nztGetBase64Cert';
 
2670
 
 
2671
  function nztGetSerialNumber(_para1:Pnzctx; _para2:PnzttIdentity; _para3:PPub1; _para4:Pub4):nzerror;cdecl;external ocilib name 'nztGetSerialNumber';
 
2672
 
 
2673
  function nztGetValidDate(_para1:Pnzctx; _para2:PnzttIdentity; _para3:Pub4; _para4:Pub4):nzerror;cdecl;external ocilib name 'nztGetValidDate';
 
2674
 
 
2675
  function nztGetVersion(_para1:Pnzctx; _para2:PnzttIdentity; _para3:Pnzstrc):nzerror;cdecl;external ocilib name 'nztGetVersion';
 
2676
 
 
2677
  function nztGetPublicKey(_para1:Pnzctx; _para2:PnzttIdentity; _para3:PPub1; _para4:Pub4):nzerror;cdecl;external ocilib name 'nztGetPublicKey';
 
2678
 
 
2679
  function nztGenericDestroy(_para1:Pnzctx; _para2:PPub1):nzerror;cdecl;external ocilib name 'nztGenericDestroy';
 
2680
 
 
2681
  function nztSetAppDefaultLocation(_para1:Pnzctx; _para2:Ptext; _para3:size_t):nzerror;cdecl;external ocilib name 'nztSetAppDefaultLocation';
 
2682
 
 
2683
  function nztSearchNZDefault(_para1:Pnzctx; _para2:Pboolean):nzerror;cdecl;external ocilib name 'nztSearchNZDefault';
 
2684
{$ELSE}
 
2685
  nztGetIssuerName : function (_para1:Pnzctx; _para2:PnzttIdentity; _para3:PPub1; _para4:Pub4):nzerror;cdecl;
 
2686
 
 
2687
 
 
2688
  nztGetSubjectName: function(_para1:Pnzctx; _para2:PnzttIdentity; _para3:PPub1; _para4:Pub4):nzerror;cdecl;
 
2689
 
 
2690
 
 
2691
  nztGetBase64Cert : function(_para1:Pnzctx; _para2:PnzttIdentity; _para3:PPub1; _para4:Pub4):nzerror;cdecl;
 
2692
 
 
2693
  nztGetSerialNumber : function(_para1:Pnzctx; _para2:PnzttIdentity; _para3:PPub1; _para4:Pub4):nzerror;cdecl;
 
2694
 
 
2695
  nztGetValidDate : function(_para1:Pnzctx; _para2:PnzttIdentity; _para3:Pub4; _para4:Pub4):nzerror;cdecl;
 
2696
 
 
2697
  nztGetVersion : function(_para1:Pnzctx; _para2:PnzttIdentity; _para3:Pnzstrc):nzerror;cdecl;
 
2698
 
 
2699
  nztGetPublicKey : function(_para1:Pnzctx; _para2:PnzttIdentity; _para3:PPub1; _para4:Pub4):nzerror;cdecl;
 
2700
 
 
2701
  nztGenericDestroy : function(_para1:Pnzctx; _para2:PPub1):nzerror;cdecl;
 
2702
 
 
2703
  nztSetAppDefaultLocation : function(_para1:Pnzctx; _para2:Ptext; _para3:size_t):nzerror;cdecl;
 
2704
 
 
2705
  nztSearchNZDefault : function(_para1:Pnzctx; _para2:Pboolean):nzerror;cdecl;
 
2706
{$ENDIF}
 
2707