| TerraLib 4.1

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Examples

- File List
- File Members

E:/Projetos_Primeiro_Semestre_2012/TerraView/terralib/src/terralib/drivers/Oracle/OCI/include/nzt.h
Go to the documentation of this file.

    00001 /* DISABLE check_long_lines */
    00002
    00003 /* Copyright (c) 1996, 2003, Oracle Corporation.  All rights reserved.  */
    00004 /* Copyright (c) 1996, 2003, Oracle Corporation.  All rights reserved.  */
    00005
    00006 /*
    00007  * $Header$
    00008  */
    00009
    00010 /*
    00011  * NAME
    00012  *    nzt.h
    00013  *
    00014  * DESCRIPTION
    00015  *    Toolkit public declarations.
    00016  *
    00017  * PUBLIC FUNCTIONS
    00018  *    nztwOpenWallet           - Open a wallet based on a WRL and pwd.
    00019  *    nztwCloseWallet          - Close a wallet.
    00020  * +  nztwCreateWallet         - Create a new wallet.
    00021  * +  nztwDestroyWallet        - Destroy an existing wallet.
    00022  *    nztwRetrievePersonaCopy  - Retieve a copy of a particular persona.
    00023  * +  nzteStorePersona         - Store a persona in the wallet.
    00024  *    nzteOpenPersona          - Open a persona.
    00025  *    nzteClosePersona         - Close a persona.
    00026  * +  nzteRemovePersona        - Remove a persona from a wallet.
    00027  * +  nzteCreatePersona        - Create a persona.
    00028  *    nzteDestroyPersona       - Destroy a persona.
    00029  *    nztiStoreTrustedIdentity - Store an identity with associated trust.
    00030  *    nzteRetrieveTrustedIdentCopy - Retrieves a trusted identity from persona
    00031  * +  nzteSetProtection        - Modify the protection set in a persona.
    00032  * +  nzteGetProtection        - Get the protection set in a persona
    00033  *    nztePriKey               - Get the Private Key (X509 Only)
    00034  *    nzteMyCert               - Get the Certificate (X509 only)
    00035  *    nzteX509CreatePersona    - Create a persona given an X509 Certificate.
    00036  * +  nztiRemoveIdentity       - Remove an identity from a persona.
    00037  *    nztiCreateIdentity       - Create an identity.
    00038  *    nztiDuplicateIdentity    - Create a complete copy of an identity.
    00039  *    nztiAbortIdentity        - Discard an unstored identity.
    00040  *    nztidGetIdentityDesc     - Gets Identity Description from Identity.
    00041  *    nztidFreeIdentityDesc    - Frees memory for Identity Desc object.
    00042  *    nztSign                  - Generate an attached signature.
    00043  * +  nztxSignExpansion        - Determine size of signature.
    00044  *    nztVerify                - Verify an attached signature.
    00045  *    nztValidate              - Validate an identity.
    00046  *    nztsd_SignDetached       - Generate a detached signature.
    00047  * +  nztxsd_SignDetachedExpansion - Determine size of detached signature.
    00048  *    nztved_VerifyDetached    - Verify a detached signature.
    00049  * +  nztEncrypt               - Symmetric key encryption.
    00050  * +  nztxEncryptExpansion     - Determine the tdu length for encryption.
    00051  * +  nztDecrypt               - Symmetric key decryption.
    00052  * +  nztEnvelope              - Sign then encrypt data for recipient(s).
    00053  * +  nztDeEnvelope            - Reverse nztEnvelope.
    00054  * +  nztKeyedHash             - Generate keyed hash.
    00055  * +  nztxKeyedHashExpansion   - Determine size of TDU for keyed hash.
    00056  *    nztHash                  - Generate hash.
    00057  * +  nztxHashExpansion        - Determine the size of the TDU for a hash.
    00058  *    nztSeedRandom            - See the random number generator.
    00059  *    nztrb_RandomBytes        - Generate a series of random bytes.
    00060  *    nztrn_RandomNumber       - Generate a random number.
    00061  *    nztbbInitBlock           - Initialize a buffer block.
    00062  *    nztbbReuseBlock          - Reuse a buffer block.
    00063  *    nztbbSizeBlock           - Find the size of the buffer block.
    00064  *    nztbbGrowBlock           - Grow initialized buffer block by 'inc' bytes.
    00065  *    nztbbPurgeBlock          - Purge the memory used within a buffer block.
    00066  *    nztbbSetBlock            - Set block to known state.
    00067  *    nztkec_PKEncrypt         - Encrypt data then encrypt key for recipient.
    00068  *    nztkdc_PKDecrypt         - Decrypt PKEncrypt'ed data.
    00069  *    nztific_FreeIdentityContent - Free the contents of an identity.
    00070  *    nztifdn                  - Create an identity from a distinguished name
    00071  *    nztcts_CipherSpecToStr   - Converts the Cipher Spec Code To String
    00072  *    nztiae_IsAuthEnabled     - Checks to see if Authentication is Enabled
    00073  *                               in the current Cipher Spec.
    00074  *    nztiae_IsEncrEnabled     - Checks to see if Encryption is Enabled
    00075  *                               in the current Cipher Spec.
    00076  *    nztiae_IsHashEnabled     - Checks to see if Hashing is Enabled
    00077  *                               in the current Cipher Spec.
    00078  *    nztwGetCertInfo          - Get peer certificate info
    00079  *
    00080  * NOTE: the '+' indicates that these functions are UNSUPPORTED at this time.
    00081  *
    00082  * NOTES
    00083  *
    00084  * MODIFIED
    00085  *    srtata     11/10/03 - fix nztSetAppDefaultLocation header
    00086  *    rchahal    10/15/03 - bug 2513821
    00087  *    rchahal    11/11/02 - pkcs11 support
    00088  *    akoyfman   07/05/02 - adding secret store to persona
    00089  *    supriya    10/11/01 - Fix for bug # 2015732
    00090  *    ajacobs    04/04/01 - make NZT_REGISTRY_WRL always available
    00091  *    ajacobs    03/06/01 - olint fix
    00092  *    ajacobs    03/02/01 - Add GetCertInfo
    00093  *    supriya    02/23/01 - Move nzttKPUsage from nzt0.h
    00094  *    rchahal    01/26/01 - olint fixes
    00095  *    supriya    12/07/00 - Change fn name
    00096  *    supriya    12/01/00 - Certificate API's needed for iAS
    00097  *    supriya    06/19/00 - Adding definitions for MCS and ENTR
    00098  *    lkethana   05/31/00 - multiple cert support
    00099  *    skanjila   06/25/99 - Remove nztcts_CipherSpecToStr() to NZOS.
    00100  *    skanjila   06/23/99 - Change API of nztcts_CipherSpecToStr.
    00101  *    lkethana   06/18/99 - rem nztIPrivateAlloc, etc
    00102  *    lkethana   06/10/99 - changing size_t to ub4
    00103  *    lkethana   06/02/99 - add api for getting auth/encry/hash capability of c
    00104  *    arswamin   12/28/98 - add NZT_MAX_MD5.
    00105  *    arswamin   12/21/98 - change signature of compareDN
    00106  *    qdinh      12/21/98 - change size_t to ub4.
    00107  *    inetwork   11/22/98 - Removing NZDEPRECATED definition
    00108  *    amthakur   09/14/98 - deprecating and updating the c-structures.
    00109  *    arswamin   09/24/98 - adding NZTTWRL_NULL for SSO support.
    00110  *    amthakur   07/30/98 - changing the prototype of nztGetCertChain.
    00111  *    qdinh      05/01/98 - add NZTTIDENTTYPE_INVALID_TYPE
    00112  *    qdinh      04/17/98 - add NZTTWRL_ORACLE.
    00113  *    ascott     10/08/97 - implement nztiStoreTrustedIdentity
    00114  *    ascott     10/07/97 - add nztiGetIdentityDesc
    00115  *    ascott     09/28/97 - clarify prototype comments and error codes
    00116  *    ascott     09/05/97 - update identity: create, destroy, duplicate
    00117  *    ascott     08/21/97 - add GetCert and GetPriKey
    00118  *    ascott     08/07/97 - add other WRL settings
    00119  *    asriniva   03/25/97 - Add ANSI prototypes
    00120  *    rwessman   03/19/97 - Added prototypes for nztific_FreeIdentityContent()
    00121  *    asriniva   03/11/97 - Fix olint errors
    00122  *    sdange     02/28/97 - Removed inclusion of nz0decl.h
    00123  *    sdange     02/18/97 - Moved nzt specific declarations from nz0decl.h
    00124  *    asriniva   01/21/97 - Remove prototypes.
    00125  *    asriniva   10/31/96 - Include oratypes.h
    00126  *    asriniva   10/15/96 - Declare buffer block helper functions
    00127  *    asriniva   10/08/96 - First pass at wallet open/close
    00128  *    asriniva   10/04/96 - Add random number seed function
    00129  *    asriniva   10/03/96 - Reorder parameters in nztbbSetBlock
    00130  *    asriniva   10/03/96 - Keep editing.
    00131  *    asriniva   10/03/96 - Continued edits.
    00132  *    asriniva   10/02/96 - Continue editing.
    00133  *    asriniva   09/26/96 -
    00134  */
    00135
    00136 /* ENABLE check_long_lines */
    00137
    00138 #ifndef NZT_ORACLE
    00139 #define NZT_ORACLE
    00140
    00141 #ifndef ORATYPES
    00142 # include <oratypes.h>
    00143 #endif /* ORATYPES */
    00144
    00145 #ifndef NZERROR_ORACLE
    00146 # include <nzerror.h>         /* NZ error type */
    00147 #endif /* NZERROR_ORACLE */
    00148
    00149
    00150 #define NZT_MAX_SHA1 20
    00151 #define NZT_MAX_MD5  16
    00152
    00153 /***************************************/
    00154 /* PUBLIC CONSTANTS, MACROS, AND TYPES */
    00155 /***************************************/
    00156
    00157 /*
    00158  * Wallet Resource Locator Type Strings
    00159  *
    00160  * WRL TYPE        PARAMETERS      BEHAVIOR
    00161  * ========        ==========      =====================================
    00162  * default:          <none>        Uses directory defined by the parameter
    00163  *                                 SNZD_DEFAULT_FILE_DIRECTORY which in
    00164  *                                 unix is "$HOME/oracle/oss"
    00165  *
    00166  * file:            file path      Find the Oracle wallet in this directory.
    00167  *                                 example: file:<dir-path>
    00168  *
    00169  * sqlnet:           <none>        In this case, the directory path will be
    00170  *                                 retrieved from the sqlnet.ora file under
    00171  *                                 the oss.source.my_wallet parameter.
    00172  *
    00173  * mcs:              <none>        Microsoft WRL.
    00174  *
    00175  * entr:             dir path      Entrust WRL. eg: ENTR:<dir-path>
    00176  *
    00177  */
    00178 /* Note that there is no NZT_NULL_WRL.  Instead look in snzd.h for DEFAULT_WRP
    00179  * which is used in our new defaulting mechanism.  The NZT_DEFAULT_WRL
    00180  * should be deprecated.
    00181  */
    00182 #define NZT_DEFAULT_WRL    ((text *)"default:")
    00183 #define NZT_SQLNET_WRL     ((text *)"sqlnet:")
    00184 #define NZT_FILE_WRL       ((text *)"file:")
    00185 #define NZT_ENTR_WRL       ((text *)"entr:")
    00186 #define NZT_MCS_WRL        ((text *)"mcs:")
    00187 #define NZT_ORACLE_WRL              ((text *)"oracle:")
    00188 #define NZT_REGISTRY_WRL   ((text *)"reg:")
    00189
    00190 enum nzttwrl
    00191 {
    00192    NZTTWRL_DEFAULT = 1,    /* Default, use SNZD_DEFAULT_FILE_DIRECTORY */
    00193    NZTTWRL_SQLNET,         /* Use oss.source.my_wallet in sqlnet.ora file */
    00194    NZTTWRL_FILE,           /* Find the oracle wallet in this directory */
    00195    NZTTWRL_ENTR,           /* Find the entrust profile in this directory */
    00196    NZTTWRL_MCS,            /* WRL for Microsoft */
    00197    NZTTWRL_ORACLE,       /* Get the wallet from OSS db */
    00198    NZTTWRL_NULL,           /* New SSO defaulting mechanism */
    00199    NZTTWRL_REGISTRY        /* Find the wallet in Windows Registry */
    00200 };
    00201 typedef enum nzttwrl nzttwrl;
    00202
    00203 #ifndef NZ0DECL_ORACLE
    00204    /*
    00205     * With the elimination of nz0decl.h from public, we need this
    00206     * redundant typedef.
    00207     */
    00208    typedef struct nzctx nzctx;
    00209    typedef struct nzstrc nzstrc;
    00210    typedef struct nzosContext nzosContext;
    00211 #endif /* NZ0DECL_ORACLE */
    00212
    00213 /* Moved from nz0decl.h */
    00214
    00215 typedef struct nzttIdentity nzttIdentity;
    00216 typedef struct nzttIdentityPrivate nzttIdentityPrivate;
    00217 typedef struct nzttPersona nzttPersona;
    00218 typedef struct nzttPersonaPrivate nzttPersonaPrivate;
    00219 typedef struct nzttWallet nzttWallet;
    00220 typedef struct nzttWalletPrivate nzttWalletPrivate;
    00221 typedef struct nzttWalletObj nzttWalletObj; /* For wallet object */
    00222 typedef struct nzssEntry nzssEntry; /* For secretstore */
    00223 typedef struct nzpkcs11_Info nzpkcs11_Info;
    00224
    00225 /*
    00226  * Crypto Engine State
    00227  *
    00228  * Once the crypto engine (CE) has been initialized for a particular
    00229  * cipher, it is either at the initial state, or it is continuing to
    00230  * use the cipher.  NZTCES_END is used to change the state back to
    00231  * initialized and flush any remaining output.  NZTTCES_RESET can be
    00232  * used to change the state back to initialized and throw away any
    00233  * remaining output.
    00234  */
    00235 enum nzttces
    00236 {
    00237    NZTTCES_CONTINUE = 1,    /* Continue processing input */
    00238    NZTTCES_END,             /* End processing input */
    00239    NZTTCES_RESET            /* Reset processing and skip generating output */
    00240 };
    00241 typedef enum nzttces nzttces;
    00242
    00243 /*
    00244  * Crypto Engine Functions
    00245  *
    00246  * List of crypto engine categories; used to index into protection
    00247  * vector.
    00248  */
    00249 enum nzttcef
    00250 {
    00251    NZTTCEF_DETACHEDSIGNATURE = 1,   /* Signature, detached from content */
    00252    NZTTCEF_SIGNATURE,               /* Signature combined with content */
    00253    NZTTCEF_ENVELOPING,              /* Signature and encryption with content */
    00254    NZTTCEF_PKENCRYPTION,            /* Encryption for one or more recipients */
    00255    NZTTCEF_ENCRYPTION,              /* Symmetric encryption */
    00256    NZTTCEF_KEYEDHASH,               /* Keyed hash/checkusm */
    00257    NZTTCEF_HASH,                    /* Hash/checsum */
    00258    NZTTCEF_RANDOM,                  /* Random byte generation */
    00259
    00260    NZTTCEF_LAST                     /* Used for array size */
    00261 };
    00262 typedef enum nzttcef nzttcef;
    00263
    00264 /*
    00265  * State of the persona.
    00266  */
    00267 enum nzttState
    00268 {
    00269    NZTTSTATE_EMPTY = 0,     /* is not in any state(senseless???) */
    00270    NZTTSTATE_REQUESTED,     /* cert-request */
    00271    NZTTSTATE_READY,         /* certificate */
    00272    NZTTSTATE_INVALID,         /* certificate */
    00273    NZTTSTATE_RENEWAL        /* renewal-requested */
    00274 };
    00275 typedef enum nzttState nzttState;
    00276
    00277 /*
    00278  * Cert-version types
    00279  *
    00280  * This is used to quickly look-up the cert-type
    00281  */
    00282 enum nzttVersion
    00283 {
    00284    NZTTVERSION_X509v1 = 1,        /* X.509v1 */
    00285    NZTTVERSION_X509v3,            /* X.509v3 */
    00286 #ifdef NZDEPRECATED
    00287    NZTTVERSION_SYMMETRIC,         /* Symmetric */
    00288 #endif
    00289    NZTTVERSION_INVALID_TYPE       /* For Initialization */
    00290 };
    00291 typedef enum nzttVersion nzttVersion;
    00292
    00293 /*
    00294  * Cipher Types
    00295  *
    00296  * List of all cryptographic algorithms, some of which may not be
    00297  * available.
    00298  */
    00299 enum nzttCipherType
    00300 {
    00301    NZTTCIPHERTYPE_RSA = 1,          /* RSA public key */
    00302    NZTTCIPHERTYPE_DES,              /* DES */
    00303    NZTTCIPHERTYPE_RC4,              /* RC4 */
    00304    NZTTCIPHERTYPE_MD5DES,           /* DES encrypted MD5 with salt (PBE) */
    00305    NZTTCIPHERTYPE_MD5RC2,           /* RC2 encrypted MD5 with salt (PBE) */
    00306    NZTTCIPHERTYPE_MD5,              /* MD5 */
    00307    NZTTCIPHERTYPE_SHA               /* SHA */
    00308 };
    00309 typedef enum nzttCipherType nzttCipherType;
    00310
    00311 /*
    00312  * TDU Formats
    00313  *
    00314  * List of possible toolkit data unit (TDU) formats.  Depending on the
    00315  * function and cipher used some may be not be available.
    00316  */
    00317 enum nztttdufmt
    00318 {
    00319    NZTTTDUFMT_PKCS7 = 1,            /* PKCS7 format */
    00320    NZTTTDUFMT_RSAPAD,               /* RSA padded format */
    00321    NZTTTDUFMT_ORACLEv1,             /* Oracle v1 format */
    00322    NZTTTDUFMT_LAST                  /* Used for array size */
    00323 };
    00324 typedef enum nztttdufmt nztttdufmt;
    00325
    00326 /*
    00327  * Validate State
    00328  *
    00329  * Possible validation states an identity can be in.
    00330  */
    00331 enum nzttValState
    00332 {
    00333    NZTTVALSTATE_NONE = 1,        /* Needs to be validated */
    00334    NZTTVALSTATE_GOOD,            /* Validated */
    00335    NZTTVALSTATE_REVOKED          /* Failed to validate */
    00336 };
    00337 typedef enum nzttValState nzttValState;
    00338
    00339 /*
    00340  * Policy Fields <----NEW (09/14/98)
    00341  *
    00342  * Policies enforced
    00343  */
    00344 enum nzttPolicy
    00345 {
    00346    NZTTPOLICY_NONE = 0,
    00347    NZTTPOLICY_RETRY_1, /* number of retries for decryption = 1 */
    00348    NZTTPOLICY_RETRY_2, /* number of retries for decryption = 2 */
    00349    NZTTPOLICY_RETRY_3  /* number of retries for decryption = 3 */
    00350 };
    00351 typedef enum nzttPolicy nzttPolicy;
    00352
    00353 /*
    00354  * Persona Usage <----NEW (09/14/98)
    00355  *
    00356  * what a persona will be used for?
    00357  */
    00358
    00359 #ifdef NZDEPRECATED_MULTIPLECERTS
    00360 enum nzttUsage
    00361 {
    00362    NZTTUSAGE_NONE = 0,
    00363    NZTTUSAGE_SSL  /* persona for SSL usage */
    00364 };
    00365 typedef enum nzttUsage nzttUsage;
    00366 #endif
    00367
    00368 /*
    00369  * Personas and identities have unique id's that are represented with
    00370  * 128 bits.
    00371  */
    00372 typedef ub1 nzttID[16];
    00373
    00374 /*
    00375  * Identity Types
    00376  *
    00377  * List of all Identity types..
    00378  */
    00379 enum nzttIdentType
    00380 {
    00381    NZTTIDENTITYTYPE_INVALID_TYPE = 0,
    00382    NZTTIDENTITYTYPE_CERTIFICTAE,
    00383    NZTTIDENTITYTYPE_CERT_REQ,
    00384    NZTTIDENTITYTYPE_RENEW_CERT_REQ,
    00385    NZTTIDENTITYTYPE_CLEAR_ETP,
    00386    NZTTIDENTITYTYPE_CLEAR_UTP,
    00387    NZTTIDENTITYTYPE_CLEAR_PTP
    00388 };
    00389 typedef enum nzttIdentType nzttIdentType;
    00390
    00391 typedef ub4 nzttKPUsage;
    00392 /* IF new types are added nztiMUS should be changed */
    00393 #define NZTTKPUSAGE_NONE 0
    00394 #define NZTTKPUSAGE_SSL 1
    00395 #define NZTTKPUSAGE_SMIME_ENCR 2
    00396 #define NZTTKPUSAGE_SMIME_SIGN 4
    00397 #define NZTTKPUSAGE_CODE_SIGN 8
    00398 #define NZTTKPUSAGE_CERT_SIGN 16
    00399 #define NZTTKPUSAGE_INVALID_USE 0xffff
    00400
    00401
    00402 /*
    00403  * Timestamp as 32 bit quantity in UTC.
    00404  */
    00405 typedef ub1 nzttTStamp[4];
    00406
    00407 /*
    00408  * Buffer Block
    00409  *
    00410  * A function that needs to fill (and possibly grow) an output buffer
    00411  * uses an output parameter block to describe each buffer.
    00412  *
    00413  * The flags_nzttBufferBlock member tells the function whether the
    00414  * buffer can be grown or not.  If flags_nzttBufferBlock is 0, then
    00415  * the buffer will be realloc'ed automatically.
    00416  *
    00417  * The buflen_nzttBufferBLock member is set to the length of the
    00418  * buffer before the function is called and will be the length of the
    00419  * buffer when the function is finished.  If buflen_nzttBufferBlock is
    00420  * 0, then the initial pointer stored in pobj_nzttBufferBlock is
    00421  * ignored.
    00422  *
    00423  * The objlen_nzttBufferBlock member is set to the length of the
    00424  * object stored in the buffer when the function is finished.  If the
    00425  * initial buffer had a non-0 length, then it is possible that the
    00426  * object length is shorter than the buffer length.
    00427  *
    00428  * The pobj_nzttBufferBlock member is a pointer to the output object.
    00429  */
    00430 struct nzttBufferBlock
    00431 {
    00432 # define NZT_NO_AUTO_REALLOC     0x1
    00433
    00434    uword flags_nzttBufferBlock;     /* Flags */
    00435    ub4 buflen_nzttBufferBlock;   /* Total length of buffer */
    00436    ub4 usedlen_nzttBufferBlock;  /* Length of used buffer part */
    00437    ub1 *buffer_nzttBufferBlock;     /* Pointer to buffer */
    00438 };
    00439 typedef struct nzttBufferBlock nzttBufferBlock;
    00440
    00441 /*
    00442  * Wallet.
    00443  */
    00444 struct nzttWallet
    00445 {
    00446    ub1 *ldapName_nzttWallet;              /* user's LDAP Name */
    00447    ub4  ldapNamelen_nzttWallet;           /* len of user's LDAP Name */
    00448    nzttPolicy securePolicy_nzttWallet;    /* secured-policy of the wallet */
    00449    nzttPolicy openPolicy_nzttWallet;      /* open-policy of the wallet */
    00450    nzttPersona *persona_nzttWallet;       /* List of personas in wallet */
    00451    nzttWalletPrivate *private_nzttWallet; /* Private wallet information */
    00452 #ifdef NZDEPRECATED
    00453    ub4 npersona_nzttWallet;            /* Number of personas */
    00454 #endif
    00455 };
    00456
    00457 /*
    00458  * The wallet contains, one or more personas.  A persona always
    00459  * contains its private key and its identity.  It may also contain
    00460  * other 3rd party identites.  All identities qualified with trust
    00461  * where the qualifier can indicate anything from untrusted to trusted
    00462  * for specific operations.
    00463  */
    00464
    00465 /*
    00466  * Persona
    00467  *
    00468  * Structure containing information about a persona.
    00469  */
    00470 struct nzttPersona
    00471 {
    00472    ub1 *genericName_nzttPersona;              /* user-friendly persona name  */
    00473    ub4  genericNamelen_nzttPersona;           /* persona-name length */
    00474    nzttPersonaPrivate *private_nzttPersona;   /* Opaque part of persona */
    00475    nzttIdentity *mycertreqs_nzttPersona;      /* My cert-requests */
    00476    nzttIdentity *mycerts_nzttPersona;         /* My certificates */
    00477    nzttIdentity *mytps_nzttPersona;           /* List of trusted identities */
    00478    nzssEntry *mystore_nzttPersona;            /* List of secrets */
    00479    nzpkcs11_Info *mypkcs11Info_nzttPersona;   /* PKCS11 token info */
    00480    struct nzttPersona *next_nzttPersona;      /* Next persona */
    00481 #ifdef NZDEPRECATED_MULTIPLECERTS
    00482   /* As Persona has multiple certs for different
    00483      usages, Persona Usage does not mean anything. Similarly
    00484      each key pair has its own state and Persona state itself
    00485      does not mean anything. - lk 5/31/00
    00486   */
    00487    nzttUsage usage_nzttPersona;               /* persona usage; SSL/SET/.. */
    00488    nzttState state_nzttPersona;               /* persona state-requested/ready */
    00489    ub4 ntps_nzttPersona;                   /* Num of trusted identities */
    00490 #endif
    00491 };
    00492
    00493 /*
    00494  * Identity
    00495  *
    00496  * Structure containing information about an identity.
    00497  *
    00498  * NOTE
    00499  *  -- the next_trustpoint field only applies to trusted identities and
    00500  *     has no meaning (i.e. is NULL) for self identities.
    00501  */
    00502 struct nzttIdentity
    00503 {
    00504    text *dn_nzttIdentity;                      /* Alias */
    00505    ub4 dnlen_nzttIdentity;                  /* Length of alias */
    00506    text *comment_nzttIdentity;                 /* Comment  */
    00507    ub4 commentlen_nzttIdentity;             /* Length of comment */
    00508    nzttIdentityPrivate *private_nzttIdentity;  /* Opaque part of identity */
    00509    nzttIdentity *next_nzttIdentity;            /* next identity in list */
    00510 };
    00511
    00512 struct nzttB64Cert
    00513 {
    00514    ub1 *b64Cert_nzttB64Cert;
    00515    ub4  b64Certlen_nzttB64Cert;
    00516    struct nzttB64Cert *next_nzttB64Cert;
    00517 };
    00518 typedef struct nzttB64Cert nzttB64Cert;
    00519
    00520
    00521 struct nzttPKCS7ProtInfo
    00522 {
    00523    nzttCipherType mictype_nzttPKCS7ProtInfo;    /* Hash cipher */
    00524    nzttCipherType symmtype_nzttPKCS7ProtInfo;   /* Symmetric cipher */
    00525    ub4 keylen_nzttPKCS7ProtInfo;             /* Length of key to use */
    00526 };
    00527 typedef struct nzttPKCS7ProtInfo nzttPKCS7ProtInfo;
    00528
    00529 /*
    00530  * Protection Information.
    00531  *
    00532  * Information specific to a type of protection.
    00533  */
    00534 union nzttProtInfo
    00535 {
    00536    nzttPKCS7ProtInfo pkcs7_nzttProtInfo;
    00537 };
    00538 typedef union nzttProtInfo nzttProtInfo;
    00539
    00540 /*
    00541  * A description of a persona so that the toolkit can create one.  A
    00542  * persona can be symmetric or asymmetric and both contain an
    00543  * identity.  The identity for an asymmetric persona will be the
    00544  * certificate and the identity for the symmetric persona will be
    00545  * descriptive information about the persona.  In either case, an
    00546  * identity will have been created before the persona is created.
    00547  *
    00548  * A persona can be stored separately from the wallet that references
    00549  * it.  By default, a persona is stored with the wallet (it inherits
    00550  * with WRL used to open the wallet).  If a WRL is specified, then it
    00551  * is used to store the actuall persona and the wallet will have a
    00552  * reference to it.
    00553  */
    00554 struct nzttPersonaDesc
    00555 {
    00556    ub4 privlen_nzttPersonaDesc;        /* Length of private info (key)*/
    00557    ub1 *priv_nzttPersonaDesc;             /* Private information */
    00558    ub4 prllen_nzttPersonaDesc;         /* Length of PRL */
    00559    text *prl_nzttPersonaDesc;             /* PRL for storage */
    00560    ub4 aliaslen_nzttPersonaDesc;       /* Length of alias */
    00561    text *alias_nzttPersonaDesc;           /* Alias */
    00562    ub4 longlen_nzttPersonaDesc;        /* Length of longer description*/
    00563    text *long_nzttPersonaDesc;            /* Longer persona description */
    00564 };
    00565 typedef struct nzttPersonaDesc nzttPersonaDesc;
    00566
    00567 /*
    00568  * A description of an identity so that the toolkit can create one.
    00569  * Since an identity can be symmetric or asymmetric, the asymmetric
    00570  * identity information will not be used when a symmetric identity is
    00571  * created.  This means the publen_nzttIdentityDesc and
    00572  * pub_nzttIdentityDesc members will not be used when creating a
    00573  * symmetric identity.
    00574  */
    00575 struct nzttIdentityDesc
    00576 {
    00577    ub4 publen_nzttIdentityDesc;        /* Length of identity */
    00578    ub1 *pub_nzttIdentityDesc;             /* Type specific identity */
    00579    ub4 dnlen_nzttIdentityDesc;         /* Length of alias */
    00580    text *dn_nzttIdentityDesc;             /* Alias */
    00581    ub4 longlen_nzttIdentityDesc;       /* Length of longer description */
    00582    text *long_nzttIdentityDesc;           /* Longer description */
    00583    ub4 quallen_nzttIdentityDesc;       /* Length of trust qualifier */
    00584    text *trustqual_nzttIdentityDesc;      /* Trust qualifier */
    00585 };
    00586 typedef struct nzttIdentityDesc nzttIdentityDesc;
    00587
    00588 /********************************/
    00589 /* PUBLIC FUNCTION DECLARATIONS */
    00590 /********************************/
    00591
    00592 /*---------------------- nztwOpenWallet ----------------------*/
    00593
    00594 /*
    00595  * NAME
    00596  *    nztwOpenWallet - Open a wallet based on a wallet Resource Locator (WRL).
    00597  *
    00598  * PARAMETERS
    00599  *    osscntxt {IN}     OSS context.
    00600  *    wrllen   {IN}     Length of WRL.
    00601  *    wrl      {IN}     WRL.
    00602  *    pwdlen   {IN}     Length of password.
    00603  *    pwd      {IN}     Password.
    00604  *    wallet   {IN/OUT} Initialized wallet structure.
    00605  *
    00606  * NOTES
    00607  *    The syntax for a WRL is <Wallet Type>:<Wallet Type Parameters>.
    00608  *
    00609  *    Wallet Type       Wallet Type Parameters.
    00610  *    -----------       ----------------------
    00611  *    File              Pathname (e.g. "file:/home/asriniva")
    00612  *    Oracle            Connect string (e.g. "oracle:scott/tiger@oss")
    00613  *
    00614  *    There are also defaults.  If the WRL is NZT_DEFAULT_WRL, then
    00615  *    the platform specific WRL default is used.  If only the wallet
    00616  *    type is specified, then the WRL type specific default is used
    00617  *    (e.g. "oracle:")
    00618  *
    00619  *    There is an implication with Oracle that should be stated: An
    00620  *    Oracle based wallet can be implemented in a user's private space
    00621  *    or in world readable space.
    00622  *
    00623  *    When the wallet is opened, the password is verified by hashing
    00624  *    it and comparing against the password hash stored with the
    00625  *    wallet.  The list of personas (and their associated identities)
    00626  *    is built and stored into the wallet structure.
    00627  *
    00628  * RETURNS
    00629  *    NZERROR_OK           Success.
    00630  *    NZERROR_RIO_OPEN     RIO could not open wallet (see network trace file).
    00631  *    NZERROR_TK_PASSWORD  Password verification failed.
    00632  *    NZERROR_TK_WRLTYPE   WRL type is not known.
    00633  *    NZERROR_TK_WRLPARM   WRL parm does not match type.
    00634  */
    00635 #ifdef __STDC__
    00636 nzerror nztwOpenWallet(nzctx *, ub4, text *, ub4, text *,
    00637                            nzttWallet *);
    00638 #else
    00639 nzerror nztwOpenWallet(/*_ nzctx *, ub4, text *, ub4, text *,
    00640                            nzttWallet * _*/);
    00641 #endif /* __STDC __*/
    00642
    00643
    00644 /*---------------------- nztwCloseWallet ----------------------*/
    00645
    00646 /*
    00647  * NAME
    00648  *    nztwCloseWallet - Close a wallet
    00649  *
    00650  * PARAMETERS
    00651  *    osscntxt {IN}     OSS context.
    00652  *    wallet   {IN/OUT} Wallet.
    00653  *
    00654  * NOTES
    00655  *    Closing a wallet also closes all personas associated with that
    00656  *    wallet.  It does not cause a persona to automatically be saved
    00657  *    if it has changed.  The implication is that a persona can be
    00658  *    modified by an application but if it is not explicitly saved it
    00659  *    reverts back to what was in the wallet.
    00660  *
    00661  * RETURNS
    00662  *    NZERROR_OK           Success.
    00663  *    NZERROR_RIO_CLOSE    RIO could not close wallet (see network trace file).
    00664  */
    00665 #ifdef __STDC__
    00666 nzerror nztwCloseWallet(nzctx *, nzttWallet *);
    00667 #else
    00668 nzerror nztwCloseWallet(/*_ nzctx *, nzttWallet * _*/);
    00669 #endif /* __STDC__ */
    00670
    00671 /*--------------------nztwGetCertInfo----------------------------*/
    00672 /****NOTE: This function is a temporary hack.****/
    00673 /****DO NOT CALL.  It will soon disappear.****/
    00674 nzerror nztwGetCertInfo(/*_ nzctx *nz_context,
    00675                             nzosContext *nzosCtx,
    00676                             nzttWallet *walletRef,
    00677                             void *peerCert _*/);
    00678
    00679
    00680 /*------------------------ nztwConstructWallet -----------------------*/
    00681 /*
    00682  *
    00683  * nzerror nztwConstructWallet( nzctx *oss_context,
    00684  *                                            nzttPolicy openPolicy,
    00685  *                                            nzttPolicy securePolicy,
    00686  *                                            ub1 *ldapName,
    00687  *                                            ub4 ldapNamelen,
    00688  *                                            nzstrc *wrl,
    00689  *                                            nzttPersona *personas,
    00690  *                                            nzttWallet **wallet );
    00691  */
    00692
    00693 /*---------------------- nztwRetrievePersonaCopy ----------------------*/
    00694
    00695 /*
    00696  * NAME
    00697  *    nztwRetrievePersonaCopy - Retrieves a persona based from wallet
    00698  *
    00699  * PARAMETERS
    00700  *    osscntxt {IN}     OSS context.
    00701  *    wallet   {IN}     Wallet.
    00702  *    index    {IN}     Which wallet index to remove (first persona is zero).
    00703  *    persona  {OUT}    Persona found.
    00704  *
    00705  * NOTES
    00706  *    Retrieves a persona from the wallet based on the index number passed
    00707  *    in.  This persona is a COPY of the one stored in the wallet, therefore
    00708  *    it is perfectly fine for the wallet to be closed after this call is
    00709  *    made.
    00710  *
    00711  *    The caller is responsible for disposing of the persona when completed.
    00712  *
    00713  * RETURNS
    00714  *    NZERROR_OK           Success.
    00715  */
    00716 #ifdef __STDC__
    00717 nzerror nztwRetrievePersonaCopy(nzctx *, nzttWallet *, ub4, nzttPersona **);
    00718 #else
    00719 nzerror nztwRetrievePersonaCopy(/*_ nzctx *, nzttWallet *, ub4,
    00720                            nzttPersona ** _*/);
    00721 #endif /* __STDC __*/
    00722
    00723
    00724 /*---------------------- nztwRetrievePersonaCopyByName ----------------------*/
    00725
    00726 /*
    00727  * NAME
    00728  *    nztwRetrievePersonaCopyByName - Retrieves a persona based on its name.
    00729  *
    00730  * PARAMETERS
    00731  *    osscntxt {IN}     OSS context.
    00732  *    wallet   {IN}     Wallet.
    00733  *    name    {IN}     Name of the persona
    00734  *    persona  {OUT}    Persona found.
    00735  *
    00736  * NOTES
    00737  *    Retrieves a persona from the wallet based on the name of the persona.
    00738  *    This persona is a COPY of the one stored in the wallet, therefore
    00739  *    it is perfectly fine for the wallet to be closed after this call is
    00740  *    made.
    00741  *
    00742  *    The caller is responsible for disposing of the persona when completed.
    00743  *
    00744  * RETURNS
    00745  *    NZERROR_OK           Success.
    00746  */
    00747 #ifdef __STDC__
    00748 nzerror nztwRetrievePersonaCopyByName(nzctx *, nzttWallet *,
    00749                                       char *, nzttPersona **);
    00750 #else
    00751 nzerror nztwRetrievePersonaCopyByName(/*_ nzctx *, nzttWallet *, char *,
    00752                            nzttPersona ** _*/);
    00753 #endif /* __STDC __*/
    00754
    00755 /*---------------------- nzteOpenPersona ----------------------*/
    00756
    00757 /*
    00758  * NAME
    00759  *    nzteOpenPersona - Open a persona.
    00760  *
    00761  * PARAMETERS
    00762  *    osscntxt {IN}     OSS context.
    00763  *    persona  {IN/OUT} Persona.
    00764  *
    00765  * NOTES
    00766  *
    00767  * RETURNS
    00768  *    NZERROR_OK           Success.
    00769  *    NZERROR_TK_PASSWORD  Password failed to decrypt persona.
    00770  *    NZERROR_TK_BADPRL    Persona resource locator did not work.
    00771  *    NZERROR_RIO_OPEN     Could not open persona (see network trace file).
    00772  */
    00773 #ifdef __STDC__
    00774 nzerror nzteOpenPersona(nzctx *, nzttPersona *);
    00775 #else
    00776 nzerror nzteOpenPersona(/*_ nzctx *, nzttPersona * _*/);
    00777 #endif /* __STDC __*/
    00778
    00779 /*--------------------- nzteClosePersona ---------------------*/
    00780
    00781 /*
    00782  * NAME
    00783  *    nzteClosePersona - Close a persona.
    00784  *
    00785  * PARAMETERS
    00786  *    osscntxt {IN}     OSS context.
    00787  *    persona  {IN/OUT} Persona.
    00788  *
    00789  * NOTES
    00790  *    Closing a persona does not store the persona, it simply releases
    00791  *    the memory associated with the crypto engine.
    00792  *
    00793  * RETURNS
    00794  *    NZERROR_OK        Success.
    00795  */
    00796 #ifdef __STDC__
    00797 nzerror nzteClosePersona(nzctx *, nzttPersona *);
    00798 #else
    00799 nzerror nzteClosePersona(/*_ nzctx *, nzttPersona * _*/);
    00800 #endif /* __STDC __*/
    00801
    00802 /*--------------------- nzteDestroyPersona ---------------------*/
    00803
    00804 /*
    00805  * NAME
    00806  *    nzteDestroyPersona - Destroy a persona.
    00807  *
    00808  * PARAMETERS
    00809  *    osscntxt {IN}        OSS context.
    00810  *    persona  {IN/OUT}    Persona.
    00811  *
    00812  * NOTES
    00813  *    The persona is destroyd in the open state, but it will
    00814  *    not be associated with a wallet.
    00815  *
    00816  *    The persona parameter is doubly indirect so that at the
    00817  *    conclusion of the function, the pointer can be set to NULL.
    00818  *
    00819  *
    00820  * RETURNS
    00821  *    NZERROR_OK        Success.
    00822  *    NZERROR_TK_TYPE   Unsupported itype/ctype combination.
    00823  *    NZERROR_TK_PARMS  Error in persona description.
    00824  */
    00825 #ifdef __STDC__
    00826 nzerror nzteDestroyPersona(nzctx *,  nzttPersona **);
    00827 #else
    00828 nzerror nzteDestroyPersona(/*_ nzctx *, nzttPersona ** _*/);
    00829 #endif /* __STDC __*/
    00830
    00831 /*---------------------- nzteRetrieveTrustedIdentCopy ----------------------*/
    00832
    00833 /*
    00834  * NAME
    00835  *    nzteRetrieveTrustedIdentCopy - Retrieves a trusted identity from persona
    00836  *
    00837  * PARAMETERS
    00838  *    osscntxt {IN}     OSS context.
    00839  *    persona  {IN}     Persona.
    00840  *    index    {IN}     Which wallet index to remove (first element is zero).
    00841  *    identity {OUT}    Trusted Identity from this persona.
    00842  *
    00843  * NOTES
    00844  *    Retrieves a trusted identity from the persona based on the index
    00845  *    number passed in.  This identity is a COPY of the one stored in
    00846  *    the persona, therefore it is perfectly fine to close the persona
    00847  *    after this call is made.
    00848  *
    00849  *    The caller is responsible for freeing the memory of this object
    00850  *    by calling nztiAbortIdentity it is no longer needed
    00851  *
    00852  * RETURNS
    00853  *    NZERROR_OK           Success.
    00854  */
    00855 #ifdef __STDC__
    00856 nzerror nzteRetrieveTrustedIdentCopy(nzctx *, nzttPersona *, ub4,
    00857                                                  nzttIdentity **);
    00858 #else
    00859 nzerror nzteRetrieveTrustedIdentCopy(/*_ nzctx *, nzttPersona *, ub4,
    00860                            nzttIdentity ** _*/);
    00861 #endif /* __STDC __*/
    00862
    00863 /*--------------------- nztePriKey ---------------------*/
    00864
    00865 /*
    00866  * NAME
    00867  *    nztePriKey - Get the decrypted Private Key for the Persona
    00868  *
    00869  * PARAMETERS
    00870  *    osscntxt {IN}     OSS context.
    00871  *    persona  {IN}     Persona.
    00872  *    vkey     {OUT}    Private Key [B_KEY_OBJ]
    00873  *    vkey_len {OUT}    Private Key Length
    00874  *
    00875  * NOTES
    00876  *    This funiction will only work for X.509 based persona which contain
    00877  *    a private key.
    00878  *    A copy of the private key is returned to the caller so that they do not
    00879  *    have to worry about the key changeing "underneath them".
    00880  *    Memory will be allocated for the vkey and therefore, the CALLER
    00881  *    will be responsible for freeing this memory.
    00882  *
    00883  * RETURNS
    00884  *    NZERROR_OK           Success.
    00885  *    NZERROR_NO_MEMORY    ossctx is null.
    00886  *    NZERROR_TK_BADPRL    Persona resource locator did not work.
    00887  */
    00888 #ifdef __STDC__
    00889 nzerror nztePriKey(nzctx *, nzttPersona *, ub1 **, ub4 *);
    00890 #else
    00891 nzerror nztePriKey(/*_ nzctx *, nzttPersona *, ub1 **, ub4 * _*/);
    00892 #endif /* __STDC __*/
    00893
    00894 /*--------------------- nzteMyCert ---------------------*/
    00895
    00896 /*
    00897  * NAME
    00898  *    nzteMyCert - Get the X.509 Certificate for a persona
    00899  *
    00900  * PARAMETERS
    00901  *    osscntxt {IN}     OSS context.
    00902  *    persona  {IN}     Persona.
    00903  *    cert     {OUT}    X.509 Certificate [BER encoded]
    00904  *    cert_len {OUT}    Certificate length
    00905  *
    00906  * NOTES
    00907  *    This funiction will only work for X.509 based persona which contain
    00908  *    a certificate for the self identity.
    00909  *    A copy of the certificate is returned to the caller so that they do not
    00910  *    have to worry about the certificate changeing "underneath them".
    00911  *    Memory will be allocated for the cert and therefore, the CALLER
    00912  *    will be responsible for freeing this memory.
    00913  *
    00914  * RETURNS
    00915  *    NZERROR_OK           Success.
    00916  *    NZERROR_NO_MEMORY    ossctx is null.
    00917  */
    00918 #ifdef __STDC__
    00919 nzerror nzteMyCert(nzctx *, nzttPersona *, ub1 **, ub4 *);
    00920 #else
    00921 nzerror nzteMyCert(/*_ nzctx *, nzttPersona *, ub1 **, ub4 * _*/);
    00922 #endif /* __STDC __*/
    00923
    00924 /*--------------------- nzteX509CreatePersona ---------------------*/
    00925
    00926 /*
    00927  * NAME
    00928  *    nzteX509CreatePersona - Given a BER X.509 cert, create a persona
    00929  *
    00930  * PARAMETERS
    00931  *    osscntxt {IN}     OSS context.
    00932  *    cert     {IN}     X.509 Certificate [BER encoded]
    00933  *    cert_len {IN}     Certificate length
    00934  *    persona  {OUT}    Persona.
    00935  *
    00936  * NOTES
    00937  *    Memory will be allocated for the persona and therefore, the CALLER
    00938  *    will be responsible for freeing this memory.
    00939  *
    00940  * RETURNS
    00941  *    NZERROR_OK           Success.
    00942  *    NZERROR_NO_MEMORY    ossctx is null.
    00943  */
    00944 #ifdef __STDC__
    00945 nzerror nzteX509CreatePersona(nzctx *, ub1 *, ub4, nzttPersona **);
    00946 #else
    00947 nzerror nzteX509CreatePersona(/*_ nzctx *, ub1 *, ub4, nzttPersona ** _*/);
    00948 #endif /* __STDC __*/
    00949
    00950 /*-------------------- nztiCreateIdentity --------------------*/
    00951
    00952 /*
    00953  * NAME
    00954  *    nztiCreateIdentity - Create an identity.
    00955  *
    00956  * PARAMETERS
    00957  *    osscntxt {IN}     OSS context.
    00958  *    itype    {IN}     Identity type.
    00959  *    desc     {IN}     Description of identity.
    00960  *    identity {IN/OUT} Identity.
    00961  *
    00962  * NOTES
    00963  *    Memory is only allocated for the identity structure.  The elements in
    00964  *    the description struct are not copied.  Rather their pointers are copied
    00965  *    into the identity structure.  Therefore, the caller should not free
    00966  *    the elements referenced by the desc.  These elements will be freed
    00967  *    when the nztiDestroyIdentity is called.
    00968  *
    00969  * RETURNS
    00970  *    NZERROR_OK        Success.
    00971  *    NZERROR_PARMS     Error in description.
    00972  */
    00973 #ifdef __STDC__
    00974 nzerror nztiCreateIdentity(nzctx *, nzttVersion, nzttIdentityDesc *,
    00975                                nzttIdentity **);
    00976 #else
    00977 nzerror nztiCreateIdentity(/*_ nzctx *, nzttVersion, nzttIdentityDesc *,
    00978                                nzttIdentity ** _*/);
    00979 #endif /* __STDC __*/
    00980
    00981 #ifdef NZ_OLD_TOOLS
    00982 /*-------------------- nztiDuplicateIdentity --------------------*/
    00983
    00984 /*
    00985  * NAME
    00986  *    nztiDuplicateIdentity - Duplicate an identity.
    00987  *
    00988  * PARAMETERS
    00989  *    osscntxt     {IN}     OSS context.
    00990  *    identity     {IN}     Target Identity.
    00991  *    new_identity {IN}     New Identity.
    00992  *
    00993  * NOTES
    00994  *    Memory for the identity is allocated inside the function, and all
    00995  *    internal identity elements as well.
    00996  *
    00997  * RETURNS
    00998  *    NZERROR_OK        Success.
    00999  *    NZERROR_TK_NOTFOUND  Identity not found.
    01000  *    NZERROR_PARMS     Error in description.
    01001  */
    01002 #ifdef __STDC__
    01003 nzerror nztiDuplicateIdentity(nzctx *, nzttIdentity *,
    01004                               nzttIdentity **);
    01005 #else
    01006 nzerror nztiDuplicateIdentity(/*_ nzctx *, nzttIdentity *,
    01007                               nzttIdentity ** _*/);
    01008 #endif /* __STDC __*/
    01009 #endif /* NZ_OLD_TOOLS */
    01010
    01011 /*--------------------- nztiAbortIdentity ---------------------*/
    01012
    01013 /*
    01014  * NAME
    01015  *    nztiAbortIdentity - Abort an unassociated identity.
    01016  *
    01017  * PARAMETERS
    01018  *    osscntxt {IN}     OSS context.
    01019  *    identity {IN/OUT} Identity.
    01020  *
    01021  * NOTES
    01022  *    It is an error to try to abort an identity that can be
    01023  *    referenced through a persona.
    01024  *
    01025  *    The identity pointer is set to NULL at the conclusion.
    01026  *
    01027  * RETURNS
    01028  *    NZERROR_OK           Success.
    01029  *    NZERROR_CANTABORT    Identity is associated with persona.
    01030  */
    01031 #ifdef __STDC__
    01032 nzerror nztiAbortIdentity(nzctx *, nzttIdentity **);
    01033 #else
    01034 nzerror nztiAbortIdentity(/*_ nzctx *, nzttIdentity ** _*/);
    01035 #endif /* __STDC __*/
    01036
    01037 #ifdef NZ_OLD_TOOLS
    01038 /*----------------- nztidGetIdentityDesc -----------------*/
    01039
    01040 /*
    01041  * NAME
    01042  *    nztidGetIdentityDesc - Gets an Identity Description from the identity
    01043  *
    01044  * PARAMETERS
    01045  *    osscntxt    {IN}     Success.
    01046  *    identity    {IN}     Identity.
    01047  *    description {IN/OUT} Identity Description.
    01048  *
    01049  * NOTES
    01050  *    Memory is allocated for the Identity Description. It
    01051  *    is the callers responsibility to free this memory by calling
    01052  *    nztiFreeIdentityDesc.
    01053  *
    01054  * RETURNS
    01055  *    NZERROR_OK     Success.
    01056  */
    01057 #ifdef __STDC__
    01058 nzerror nztidGetIdentityDesc(nzctx *, nzttIdentity *,
    01059                              nzttIdentityDesc **);
    01060 #else
    01061 nzerror nztidGetIdentityDesc(/*_ nzctx *, nzttIdentity *,
    01062                                      nzttIdentityDesc ** _*/);
    01063 #endif /* __STDC __*/
    01064
    01065 /*----------------- nztidFreeIdentityDesc -----------------*/
    01066
    01067 /*
    01068  * NAME
    01069  *    nztidFreeIdentityDesc - Frees memory for Identity Desc object.
    01070  *
    01071  * PARAMETERS
    01072  *    osscntxt    {IN}     oss context.
    01073  *    description {IN/OUT} Identity Description.
    01074  *
    01075  * NOTES
    01076  *    Memory is freed for all Identity description elements.  Pointer is
    01077  *    then set to null.
    01078  *
    01079  * RETURNS
    01080  *    NZERROR_OK     Success.
    01081  */
    01082 #ifdef __STDC__
    01083 nzerror nztidFreeIdentityDesc(nzctx *, nzttIdentityDesc **);
    01084 #else
    01085 nzerror nztidFreeIdentityDesc(/*_ nzctx *, nzttIdentityDesc ** _*/);
    01086 #endif /* __STDC __*/
    01087 #endif /* NZ_OLD_TOOLS */
    01088
    01089 /*---------------- nztific_FreeIdentityContent ----------------*/
    01090
    01091 /*
    01092  * NAME
    01093  *     nztific_FreeIdentityContent - free the contents of an identity.
    01094  *
    01095  * PARAMETERS
    01096  *    osscntxt         {IN}     OSS context.
    01097  *    identity         {IN/OUT} freed identity
    01098  *
    01099  * NOTES
    01100  *    Free a created identity.
    01101  *
    01102  * RETURNS
    01103  *    NZERROR_OK     Success.
    01104  */
    01105 /*
    01106  * Free the identity content.
    01107  */
    01108 #ifdef __STDC__
    01109 nzerror nztific_FreeIdentityContent(nzctx *ossctx,
    01110                                         nzttIdentity *identity);
    01111 #else
    01112 nzerror nztific_FreeIdentityContent(/*_ nzctx *ossctx,
    01113                                         nzttIdentity *identity _*/);
    01114 #endif /* __STDC __*/
    01115
    01116
    01117 /*-------------------------- nztSign --------------------------*/
    01118
    01119 /*
    01120  * NAME
    01121  *    nztSign - Create an attached signature.
    01122  *
    01123  * PARAMETERS
    01124  *    osscntxt {IN}     OSS context.
    01125  *    persona  {IN}     Open persona acting as signer.
    01126  *    state    {IN}     State of signature.
    01127  *    inlen    {IN}     Length of this input part.
    01128  *    in       {IN}     This input part.
    01129  *    tdubuf   {IN/OUT} TDU buffer.
    01130  *
    01131  * NOTES
    01132  *
    01133  * RETURNS
    01134  *    NZERROR_OK           Success.
    01135  *    NZERROR_TK_CANTGROW  Needed to grow output buffer but could not.
    01136  *    NZERROR_TK_NOTOPEN   Persona is not open.
    01137  *    NZERROR_TK_NOTSUPP   Function not supported with persona.
    01138  */
    01139 #ifdef __STDC__
    01140 nzerror nztSign(nzctx *, nzttPersona *, nzttces, ub4, ub1 *,
    01141                     nzttBufferBlock *);
    01142 #else
    01143 nzerror nztSign(/*_ nzctx *, nzttPersona *, nzttces, ub4, ub1 *,
    01144                     nzttBufferBlock * _*/);
    01145 #endif /* __STDC __*/
    01146
    01147 /*------------------------- nztVerify -------------------------*/
    01148
    01149 /*
    01150  * NAME
    01151  *    nztVerify - Verify an attached signature.
    01152  *
    01153  * PARAMETERS
    01154  *    osscntxt {IN}     OSS context.
    01155  *    persona  {IN}     Persona.
    01156  *    state    {IN}     State of verification.
    01157  *    intdulen {IN}     TDU length.
    01158  *    intdu    {IN}     TDU.
    01159  *    out      {IN/OUT} Extracted message.
    01160  *    verified {OUT}    TRUE if signature verified.
    01161  *    validated{OUT}    TRUE if signing identity validated.
    01162  *    identity {OUT} Identity of signing party.
    01163  *
    01164  * NOTES
    01165  *
    01166  * RETURNS
    01167  *    NZERROR_OK           Success.
    01168  *    NZERROR_TK_CANTGROW  Needed to grow outptu buffer but could not.
    01169  *    NZERROR_TK_NOTOPEN   Persona is not open.
    01170  *    NZERROR_TK_NOTSUPP   Function not supported with persona.
    01171  */
    01172 #ifdef __STDC__
    01173 nzerror nztVerify(nzctx *, nzttPersona *, nzttces, ub4, ub1 *,
    01174                       nzttBufferBlock *, boolean *, boolean *,
    01175                       nzttIdentity **);
    01176 #else
    01177 nzerror nztVerify(/*_ nzctx *, nzttPersona *, nzttces, ub4, ub1 *,
    01178                       nzttBufferBlock *, boolean *, boolean *,
    01179                       nzttIdentity ** _*/);
    01180 #endif /* __STDC __*/
    01181
    01182 /*------------------------ nztValidate ------------------------*/
    01183
    01184 /*
    01185  * NAME
    01186  *    nztValidate - Validate an identity.
    01187  *
    01188  * PARAMETERS
    01189  *    osscntxt {IN}  OSS context.
    01190  *    persona  {IN}  Persona.
    01191  *    identity {IN}  Identity.
    01192  *    validated{OUT} TRUE if identity was validated.
    01193  *
    01194  * NOTES
    01195  *
    01196  * RETURNS
    01197  *    NZERROR_OK           Success.
    01198  *    NZERROR_TK_NOTOPEN   Persona is not open.
    01199  *    NZERROR_TK_NOTSUPP   Function not supported with persona.
    01200  */
    01201 #ifdef __STDC__
    01202 nzerror nztValidate(nzctx *, nzttPersona *, nzttIdentity *, boolean *);
    01203 #else
    01204 nzerror nztValidate(/*_ nzctx *, nzttPersona *, nzttIdentity *, boolean * _*/);
    01205 #endif /* __STDC __*/
    01206
    01207 /*-------------------- nztsd_SignDetached --------------------*/
    01208
    01209 /*
    01210  * NAME
    01211  *    nztsd_SignDetached - Generate a detached signature.
    01212  *
    01213  * PARAMETERS
    01214  *    osscntxt {IN}     OSS context.
    01215  *    persona  {IN}     Persona.
    01216  *    state    {IN}     State of signature.
    01217  *    inlen    {IN}     Length of this input part.
    01218  *    in       {IN}     This input part.
    01219  *    tdubuf   {IN/OUT} TDU buffer.
    01220  *
    01221  * NOTES
    01222  *
    01223  * RETURNS
    01224  *    NZERROR_OK           Success.
    01225  *    NZERROR_TK_CANTGROW  Needed to grow output buffer but could not.
    01226  *    NZERROR_TK_NOTOPEN   Persona is not open.
    01227  *    NZERROR_TK_NOTSUPP   Function not supported with persona.
    01228  */
    01229 #ifdef __STDC__
    01230 nzerror nztsd_SignDetached(nzctx *, nzttPersona *, nzttces, ub4, ub1 *,
    01231                                nzttBufferBlock *);
    01232 #else
    01233 nzerror nztsd_SignDetached(/*_ nzctx *, nzttPersona *, nzttces, ub4, ub1 *,
    01234                                nzttBufferBlock * _*/);
    01235 #endif /* __STDC __*/
    01236
    01237 /*------------------- nztved_VerifyDetached -------------------*/
    01238
    01239 /*
    01240  * NAME
    01241  *    nztved_VerifyDetached - Verify a detached signature.
    01242  *
    01243  * PARAMETERS
    01244  *    osscntxt {IN}     OSS context.
    01245  *    persona  {IN}     Persona.
    01246  *    state    {IN}     State of verification.
    01247  *    inlen    {IN}     Length of data.
    01248  *    in       {IN}     Data.
    01249  *    intdulen {IN}     Input TDU length.
    01250  *    tdu      {IN}     Input TDU.
    01251  *    verified {OUT}    TRUE if signature verified.
    01252  *    validated{OUT}    TRUE if signing identity validated.
    01253  *    identity {OUT} Identity of signing party.
    01254  *
    01255  * NOTES
    01256  *
    01257  * RETURNS
    01258  *    NZERROR_OK           Success.
    01259  *    NZERROR_TK_NOTOPEN   Persona is not open.
    01260  *    NZERROR_TK_NOTSUPP   Function not supported with persona.
    01261  */
    01262 #ifdef __STDC__
    01263 nzerror nztved_VerifyDetached(nzctx *, nzttPersona *, nzttces, ub4,
    01264                                   ub1 *, ub4, ub1 *, boolean *, boolean *,
    01265                                   nzttIdentity **);
    01266 #else
    01267 nzerror nztved_VerifyDetached(/*_ nzctx *, nzttPersona *, nzttces, ub4,
    01268                                   ub1 *, ub4, ub1 *, boolean *, boolean *,
    01269                                   nzttIdentity ** _*/);
    01270 #endif /* __STDC __*/
    01271
    01272 /*--------------------- nztkec_PKEncrypt ---------------------*/
    01273
    01274 /*
    01275  * NAME
    01276  *    nztkec_PKEncrypt - Encrypt data symmetrically, encrypt key asymmetrically
    01277  *
    01278  * PARAMETERS
    01279  *    osscntxt    {IN}     OSS context.
    01280  *    persona     {IN}     Persona.
    01281  *    nrecipients {IN}     Number of recipients for this encryption.
    01282  *    recipients  {IN}     List of recipients.
    01283  *    state       {IN}     State of encryption.
    01284  *    inlen       {IN}     Length of this input part.
    01285  *    in          {IN}     This input part.
    01286  *    tdubuf      {IN/OUT} TDU buffer.
    01287  *
    01288  * NOTES
    01289  *    There is a limitation of 1 recipient (nrecipients = 1) at this
    01290  *    time.
    01291  *
    01292  * RETURNS
    01293  *    NZERROR_OK           Success.
    01294  *    NZERROR_TK_CANTGROW  Needed to grow output buffer but could not.
    01295  *    NZERROR_TK_NOTOPEN   Persona is not open.
    01296  *    NZERROR_TK_NOTSUPP   Function not supported with persona.
    01297  */
    01298 #ifdef __STDC__
    01299 nzerror nztkec_PKEncrypt(nzctx *, nzttPersona *, ub4, nzttIdentity *,
    01300                              nzttces, ub4, ub1 *, nzttBufferBlock *);
    01301 #else
    01302 nzerror nztkec_PKEncrypt(/*_ nzctx *, nzttPersona *, ub4, nzttIdentity *,
    01303                              nzttces, ub4, ub1 *, nzttBufferBlock * _*/);
    01304 #endif /* __STDC __*/
    01305
    01306 /*---------------- nztxkec_PKEncryptExpansion ----------------*/
    01307
    01308 /*
    01309  * NAME
    01310  *    nztxkec_PKEncryptExpansion - Determine the buffer needed for PKEncrypt
    01311  *
    01312  * PARAMETERS
    01313  *    osscntxt    {IN}     OSS context.
    01314  *    persona     {IN}     Persona.
    01315  *    nrecipients {IN}     Number of recipients.
    01316  *    inlen       {IN}     Length of input.
    01317  *    tdulen      {out}    Length of buffer need.
    01318  *
    01319  * NOTES
    01320  *
    01321  * RETURNS
    01322  *    NZERROR_OK           Success.
    01323  *    NZERROR_TK_NOTOPEN   Persona is not open.
    01324  *    NZERROR_TK_NOTSUPP   Function not supported with persona.
    01325  */
    01326 #ifdef __STDC__
    01327 nzerror nztxkec_PKEncryptExpansion(nzctx *, nzttPersona *, ub4, ub4,
    01328                                        ub4 *);
    01329 #else
    01330 nzerror nztxkec_PKEncryptExpansion(/*_ nzctx *, nzttPersona *, ub4, ub4,
    01331                                        ub4 * _*/);
    01332 #endif /* __STDC __*/
    01333
    01334 /*--------------------- nztkdc_PKDecrypt ---------------------*/
    01335
    01336 /*
    01337  * NAME
    01338  *    nztkdc_PKDecrypt - Decrypt a PKEncrypted message.
    01339  *
    01340  * PARAMETERS
    01341  *    osscntxt    {IN}     OSS context.
    01342  *    persona     {IN}     Persona.
    01343  *    state       {IN}     State of encryption.
    01344  *    inlen       {IN}     Length of this input part.
    01345  *    in          {IN}     This input part.
    01346  *    tdubuf      {IN/OUT} TDU buffer.
    01347  *
    01348  * NOTES
    01349  *
    01350  * RETURNS
    01351  *    NZERROR_OK           Success.
    01352  *    NZERROR_TK_CANTGROW  Needed to grow output buffer but could not.
    01353  *    NZERROR_TK_NOTOPEN   Persona is not open.
    01354  *    NZERROR_TK_NOTSUPP   Function not supported with persona.
    01355  */
    01356 #ifdef __STDC__
    01357 nzerror nztkdc_PKDecrypt(nzctx *, nzttPersona *, nzttces, ub4, ub1 *,
    01358                              nzttBufferBlock *);
    01359 #else
    01360 nzerror nztkdc_PKDecrypt(/*_ nzctx *, nzttPersona *, nzttces, ub4, ub1 *,
    01361                              nzttBufferBlock * _*/);
    01362 #endif /* __STDC __*/
    01363
    01364 /*-------------------------- nztHash --------------------------*/
    01365
    01366 /*
    01367  * NAME
    01368  *    nztHash - Generate a hash.
    01369  *
    01370  * PARAMETERS
    01371  *    osscntxt {IN}     OSS context.
    01372  *    persona  {IN}     Persona.
    01373  *    state    {IN}     State of hash.
    01374  *    inlen    {IN}     Length of this input.
    01375  *    in       {IN}     This input.
    01376  *    tdu      {IN/OUT} Output tdu.
    01377  *
    01378  * NOTES
    01379  *
    01380  * RETURNS
    01381  *    NZERROR_OK           Success.
    01382  *    NZERROR_TK_CANTGROW  Needed to grow TDU buffer but could not.
    01383  *    NZERROR_TK_NOTOPEN   Persona is not open.
    01384  *    NZERROR_TK_NOTSUPP   Function not supported with persona.
    01385  */
    01386 #ifdef __STDC__
    01387 nzerror nztHash(nzctx *, nzttPersona *, nzttces, ub4, ub1 *,
    01388                     nzttBufferBlock *);
    01389 #else
    01390 nzerror nztHash(/*_ nzctx *, nzttPersona *, nzttces, ub4, ub1 *,
    01391                     nzttBufferBlock * _*/);
    01392 #endif /* __STDC __*/
    01393
    01394 /*----------------------- nztSeedRandom -----------------------*/
    01395
    01396 /*
    01397  * NAME
    01398  *    nztSeedRandom - Seed the random function
    01399  *
    01400  * PARAMETERS
    01401  *    osscntxt {IN}  OSS context.
    01402  *    persona  {IN}  Persona.
    01403  *    seedlen  {IN}  Length of seed.
    01404  *    seed     {IN}  Seed.
    01405  *
    01406  * NOTES
    01407  *
    01408  * RETURNS
    01409  *    NZERROR_OK           Success.
    01410  *    NZERROR_TK_NOTOPEN   Persona is not open.
    01411  *    NZERROR_TK_NOTSUPP   Function not supported with persona.
    01412  */
    01413 #ifdef __STDC__
    01414 nzerror nztSeedRandom(nzctx *, nzttPersona *, ub4, ub1 *);
    01415 #else
    01416 nzerror nztSeedRandom(/*_ nzctx *, nzttPersona *, ub4, ub1 * _*/);
    01417 #endif /* __STDC __*/
    01418
    01419 /*--------------------- nztrb_RandomBytes ---------------------*/
    01420
    01421 /*
    01422  * NAME
    01423  *    nztrb_RandomBytes - Generate a buffer random bytes.
    01424  *
    01425  * PARAMETERS
    01426  *    osscntxt {IN}     OSS context.
    01427  *    persona  {IN}     Persona.
    01428  *    nbytes   {IN}     Number of bytes desired.
    01429  *    out      {IN/OUT} Buffer block for bytes.
    01430  *
    01431  * NOTES
    01432  *
    01433  * RETURNS
    01434  *    NZERROR_OK           Success.
    01435  *    NZERROR_TK_CANTGROW  Needed to grow TDU buffer but could not.
    01436  *    NZERROR_TK_NOTOPEN   Persona is not open.
    01437  *    NZERROR_TK_NOTSUPP   Function not supported with persona.
    01438  */
    01439 #ifdef __STDC__
    01440 nzerror nztrb_RandomBytes(nzctx *, nzttPersona *, ub4,
    01441                               nzttBufferBlock *);
    01442 #else
    01443 nzerror nztrb_RandomBytes(/*_ nzctx *, nzttPersona *, ub4,
    01444                               nzttBufferBlock * _*/);
    01445 #endif /* __STDC __*/
    01446
    01447 /*-------------------- nztrn_RandomNumber --------------------*/
    01448
    01449 /*
    01450  * NAME
    01451  *    nztrn_RandomNumber - Generate a random number
    01452  *
    01453  * PARAMETERS
    01454  *    osscntxt {IN}     OSS context.
    01455  *    persona  {IN}     Persona.
    01456  *    num      {OUT}    Number.
    01457  *
    01458  * NOTES
    01459  *
    01460  * RETURNS
    01461  *    NZERROR_OK           Success.
    01462  *    NZERROR_TK_NOTOPEN   Persona is not open.
    01463  *    NZERROR_TK_NOTSUPP   Function not supported with persona.
    01464  */
    01465 #ifdef __STDC__
    01466 nzerror nztrn_RandomNumber(nzctx *, nzttPersona *, uword *);
    01467 #else
    01468 nzerror nztrn_RandomNumber(/*_ nzctx *, nzttPersona *, uword * _*/);
    01469 #endif /* __STDC __*/
    01470
    01471 /*---------------------- nztbbInitBlock ----------------------*/
    01472
    01473 /*
    01474  * NAME
    01475  *    nztbbInitBlock - Initialize a buffer block.
    01476  *
    01477  * PARAMETERS
    01478  *    osscntxt {IN}     OSS context.
    01479  *    block    {IN/OUT} Buffer block.
    01480  *
    01481  * NOTES
    01482  *    The buffer block is initialized to be empty (all members are set
    01483  *    to 0/NULL).  Such a block will be allocated memory as needed.
    01484  *
    01485  * RETURNS
    01486  *    NZERROR_OK        Success.
    01487  */
    01488 #ifdef __STDC__
    01489 nzerror nztbbInitBlock(nzctx *, nzttBufferBlock *);
    01490 #else
    01491 nzerror nztbbInitBlock(/*_ nzctx *, nzttBufferBlock * _*/);
    01492 #endif /* __STDC __*/
    01493
    01494 /*---------------------- nztbbReuseBlock ----------------------*/
    01495
    01496 /*
    01497  * NAME
    01498  *    nztbbReuseBlock - Reuse an already initialized and possibly used block.
    01499  *
    01500  * PARAMETERS
    01501  *    osscntxt {IN}     OSS context.
    01502  *    block    {IN/OUT} Buffer block.
    01503  *
    01504  * NOTES
    01505  *    This function simply sets the used length member of the buffer
    01506  *    block to 0.  If the block already has memory allocated to it,
    01507  *    this will cause it to be reused.
    01508  *
    01509  * RETURNS
    01510  *    NZERROR_OK        Success.
    01511  */
    01512 #ifdef __STDC__
    01513 nzerror nztbbReuseBlock(nzctx *, nzttBufferBlock *);
    01514 #else
    01515 nzerror nztbbReuseBlock(/*_ nzctx *, nzttBufferBlock * _*/);
    01516 #endif /* __STDC __*/
    01517
    01518 /*---------------------- nztbbSizeBlock ----------------------*/
    01519
    01520 /*
    01521  * NAME
    01522  *    nztbbSizeBlock - Size an initialized block to a particular size.
    01523  *
    01524  * PARAMETERS
    01525  *    osscntxt {IN}     OSS context.
    01526  *    len      {IN}     Minimum number of unused bytes desired.
    01527  *    block    {IN/OUT} Buffer block.
    01528  *
    01529  * NOTES
    01530  *
    01531  * RETURNS
    01532  *    NZERROR_OK        Success.
    01533  */
    01534 #ifdef __STDC__
    01535 nzerror nztbbSizeBlock(nzctx *, ub4, nzttBufferBlock *);
    01536 #else
    01537 nzerror nztbbSizeBlock(/*_ nzctx *, ub4, nzttBufferBlock * _*/);
    01538 #endif /* __STDC __*/
    01539
    01540 /*----------------------- nztbbGrowBlock -----------------------*/
    01541
    01542 /*
    01543  * NAME
    01544  *    nzbbGrowBlock - Increase the size of the buffer block.
    01545  *
    01546  * PARAMETERS
    01547  *    osscntxt {IN}     OSS context.
    01548  *    inc      {IN}     Number of bytes to increase.
    01549  *    block    {IN/OUT} Buffer block.
    01550  *
    01551  * NOTES
    01552  *
    01553  * RETURNS
    01554  *    NZERROR_OK        Success.
    01555  */
    01556 #ifdef __STDC__
    01557 nzerror nztbbGrowBlock(nzctx *, ub4, nzttBufferBlock *);
    01558 #else
    01559 nzerror nztbbGrowBlock(/*_ nzctx *, ub4, nzttBufferBlock * _*/);
    01560 #endif /* __STDC __*/
    01561
    01562 /*---------------------- nztbbPurgeBlock ----------------------*/
    01563
    01564 /*
    01565  * NAME
    01566  *    nztbbPurgeBlock - Purge a buffer block of its memory.
    01567  *
    01568  * PARAMETERS
    01569  *    osscntxt {IN}     OSS context.
    01570  *    block    {IN/OUT} Buffer block.
    01571  *
    01572  * NOTES
    01573  *    The memory used by the buffer block as the buffer is released.
    01574  *    The buffer block itself is not affected.
    01575  *
    01576  * RETURNS
    01577  *    NZERROR_OK        Success.
    01578  */
    01579 #ifdef __STDC__
    01580 nzerror nztbbPurgeBlock(nzctx *, nzttBufferBlock *);
    01581 #else
    01582 nzerror nztbbPurgeBlock(/*_ nzctx *, nzttBufferBlock * _*/);
    01583 #endif /* __STDC __*/
    01584
    01585 /*----------------------- nztbbSetBlock -----------------------*/
    01586
    01587 /*
    01588  * NAME
    01589  *    nztbbSetBlock - Set a buffer block to a known state.
    01590  *
    01591  * PARAMETERS
    01592  *    osscntxt {IN}     OSS context.
    01593  *    flags    {IN}     Flags to set.
    01594  *    buflen   {IN}     Length of buffer.
    01595  *    usedlen  {IN}     Used length.
    01596  *    buffer   {IN}     Buffer.
    01597  *    block    {IN/OUT} Buffer block
    01598  *
    01599  * NOTES
    01600  *    If buflen > 0, objlen == 0, and obj == NULL, then buflen bytes
    01601  *    of memory is allocated and a pointer is stored in the buffer
    01602  *    block.
    01603  *
    01604  *    The buffer parameter remains unchanged.
    01605  *
    01606  * RETURNS
    01607  *    NZERROR_OK        Success.
    01608  */
    01609 #ifdef __STDC__
    01610 nzerror nztbbSetBlock(nzctx *,  uword, ub4, ub4, ub1 *,
    01611                           nzttBufferBlock *);
    01612 #else
    01613 nzerror nztbbSetBlock(/*_ nzctx *,  uword, ub4, ub4, ub1 *,
    01614                           nzttBufferBlock * _*/);
    01615 #endif /* __STDC __*/
    01616
    01617
    01618 /*--------------------- nztiGetSecInfo ---------------------*/
    01619
    01620 /*
    01621  * NAME
    01622  *         nztiGetSecInfo - Get some security information for SSL
    01623  *
    01624  * PARAMETERS
    01625  *         Name       {IN/OUT}   Description
    01626  *         osscntxt {IN}         OSS context.
    01627  *         persona  {IN}                    persona
    01628  *         dname    {OUT}        distinguished name of the certificate
    01629  *         dnamelen {OUT}        length of the distinguished name
    01630  *         issuername {OUT}      issuer name of the certificate
    01631  *         certhash {OUT}                   SHA1 hash of the certificate
    01632  *         certhashlen{OUT}      length of the hash
    01633  * NOTES
    01634  *         This function allocate memories for issuername, certhash, and dname.
    01635  *         To deallocate memory for those params, you should call nztdbuf_DestroyBuf.
    01636  * RETURNS
    01637  *
    01638  */
    01639 #ifdef __STDC__
    01640 nzerror nztiGetSecInfo(nzctx *, nzttPersona *, text **, ub4 *,
    01641                                   text **, ub4 *, ub1 **, ub4 *);
    01642 #else
    01643 nzerror nztiGetSecInfo(/*_ nzctx *, nzttPersona *, text **, ub4 *,
    01644                                     text **, ub4 *, ub1 **, ub4 * _*/);
    01645 #endif     /* __STDC__ */
    01646
    01647
    01648 /*---------------------- nztiGetDName ----------------------*/
    01649
    01650 /*
    01651  * NAME
    01652  *         nztiGetDName - Get the distinguished name for the given identity
    01653  *
    01654  * PARAMETERS
    01655  *         Name       {IN/OUT}   Description
    01656  *         osscntxt {IN}         OSS context.
    01657  *         identity {IN}                    identity need to get dname from
    01658  *         dn         {OUT}                 distinguished name
    01659  *         dnlen      {OUT}                 length of the dname
    01660  *
    01661  * NOTES
    01662  *
    01663  * RETURNS
    01664  *
    01665  */
    01666
    01667 #ifdef __STDC__
    01668 nzerror nztiGetDName(nzctx *, nzttIdentity *,
    01669                            text **, ub4 *);
    01670 #else
    01671 nzerror nztiGetDName(/*_ nzctx *, nzttIdentity *,
    01672                                       text **, ub4 * _*/);
    01673 #endif /* __STDC__ */
    01674
    01675 /*------------------- nztiGetIssuerName -------------------*/
    01676
    01677 /*
    01678  * NAME
    01679  *         nztiGetIssuerName -  Get IssuerName for the given identity
    01680  *
    01681  * PARAMETERS
    01682  *         Name       {IN/OUT}   Description
    01683  *         osscntxt {IN}         OSS context.
    01684  *         identity {IN}                    identity need to get issuername from
    01685  *         issuername {OUT}                 issuer's name
    01686  *         issuernamelen {OUT}   length of the issuer's name
    01687  *
    01688  * NOTES
    01689  *
    01690  * RETURNS
    01691  *
    01692  */
    01693 #ifdef __STDC__
    01694 nzerror nztiGetIssuerName(nzctx *, nzttIdentity *,
    01695                                       text **, ub4 *);
    01696 #else
    01697 nzerror nztiGetIssuerName(/*_ nzctx *, nzttIdentity *,
    01698                                        text **, ub4 * _*/);
    01699 #endif /* __STDC__ */
    01700
    01701
    01702 /*-------------------- nztgch_GetCertHash --------------------*/
    01703
    01704 /*
    01705  * NAME
    01706  *         nztgch_GetCertHash -  Get SHA1 hash for the certificate of the identity
    01707  *
    01708  * PARAMETERS
    01709  *         Name       {IN/OUT}   Description
    01710  *         osscntxt {IN}         OSS context.
    01711  *         identity {IN}                    identity need to get issuername from
    01712  *         certHash {OUT}          certHash buffer
    01713  *         hashLen {OUT}                    length of the certHash
    01714  *
    01715  * NOTES
    01716  *         Need to call nztdbuf_DestroyBuf to deallocate memory for certHash.
    01717  * RETURNS
    01718  *
    01719  */
    01720 #ifdef __STDC__
    01721 nzerror nztgch_GetCertHash(nzctx *, nzttIdentity *,
    01722                                       ub1 **, ub4 *);
    01723 #else
    01724 nzerror nztgch_GetCertHash(/*_ nzctx *, nzttIdentity *,
    01725                                       ub1 **, ub4 * _*/);
    01726 #endif /* __STDC__ */
    01727
    01728 /*-------------------- nztdbuf_DestroyBuf --------------------*/
    01729
    01730 /*
    01731  * NAME
    01732  *         nztdbuf_DestroyBuf - Deallocation funtions for ub1 and text buffer
    01733  *
    01734  * PARAMETERS
    01735  *         Name       {IN/OUT}   Description
    01736  *         osscntxt {IN}         OSS context.
    01737  *         buf      {IN}                    Allocated buffer to be destroyed.
    01738  *
    01739  * NOTES
    01740  *
    01741  * RETURNS
    01742  *
    01743  */
    01744 #ifdef __STDC__
    01745 nzerror nztdbuf_DestroyBuf( nzctx *, dvoid **);
    01746 #else
    01747 nzerror nztdbuf_DestroyBuf(/*_ nzctx *, dvoid ** _*/);
    01748 #endif /* __STDC__ */
    01749
    01750
    01751 /*----------------------- nztGetCertChain -----------------------*/
    01752
    01753 /*
    01754  * NAME
    01755  *         nztGetCertChain -
    01756  *
    01757  * PARAMETERS
    01758  *         Name       {IN/OUT}   Description
    01759  *         osscntxt {IN}         OSS context.
    01760  *
    01761  * NOTES
    01762  *
    01763  * RETURNS
    01764  *
    01765  */
    01766 #ifdef __STDC__
    01767 nzerror nztGetCertChain(nzctx *, nzttWallet * );
    01768 #else
    01769 nzerror nztGetCertChain(/*_ nzctx *, nzttWallet _*/);
    01770 #endif /* __STDC__ */
    01771
    01772 /*----------------------- nztCompareDN -----------------------*/
    01773
    01774 /*
    01775  * NAME
    01776  *         nztCompareDN -
    01777  *
    01778  * PARAMETERS
    01779  *         Name       {IN/OUT}   Description
    01780  *         osscntxt {IN}         OSS context.
    01781  *         dn1        {IN}                  distinguished name 1
    01782  *         dn2     {IN}                     distinguished name 2
    01783  *
    01784  * NOTES
    01785  *
    01786  * RETURNS
    01787  *         NZERROR_OK            succeeded
    01788  *         others                           failed
    01789  *
    01790  */
    01791 #ifdef __STDC__
    01792 nzerror nztCompareDN(nzctx *, ub1 *, ub4,  ub1 *, ub4, boolean * );
    01793 #else
    01794 nzerror nztCompareDN(/*_ nzctx *, ub1 *,ub4 ,  ub1 *, ub4, boolean * _*/);
    01795 #endif/* __STDC__ */
    01796
    01797
    01798 #ifdef NZ_OLD_TOOLS
    01799 /*--------------------- nztIdentityAlloc ---------------------*/
    01800
    01801 /*
    01802  * NAME
    01803  *         nztIdentityAlloc - Allocate memory for nzttIdentity context
    01804  *
    01805  * PARAMETERS
    01806  *         Name       {IN/OUT}   Description
    01807  *         osscntxt {IN}         OSS context.
    01808  *         identity {OUT}                   nzttIdentity context
    01809  *
    01810  * NOTES
    01811  *
    01812  * RETURNS
    01813  *         NZERROR_OK            succeeded
    01814  *         others                           failed
    01815  *
    01816  */
    01817 #ifdef __STDC__
    01818 nzerror nztIdentityAlloc(nzctx *, nzttIdentity **);
    01819 #else
    01820 nzerror nztIdentityAlloc(/*_ nzctx *, nzttIdentity ** _*/);
    01821 #endif/* __STDC__ */
    01822
    01823 /*--------------------- nztIPrivateAlloc ---------------------*/
    01824
    01825 /*
    01826  * NAME
    01827  *         nztIPrivateAlloc - Allocate memory for nzttIdentityPrivate
    01828  *
    01829  * PARAMETERS
    01830  *         Name       {IN/OUT}   Description
    01831  *
    01832  *         osscntxt {IN}         OSS context.
    01833  *         ipriv      {OUT}                 identityPrivate structure
    01834  * NOTES
    01835  *
    01836  * RETURNS
    01837  *         NZERROR_OK            succeeded
    01838  *         others                           failed
    01839  *
    01840  */
    01841
    01842 #ifdef __STDC__
    01843 nzerror nztIPrivateAlloc( nzctx *, nzttIdentityPrivate **);
    01844 #else
    01845 nzerror nztIPrivateAlloc( nzctx *, nzttIdentityPrivate **);
    01846 #endif /* __STDC__ */
    01847
    01848
    01849 /*---------------------- nztIDupContent ----------------------*/
    01850
    01851 /*
    01852  * NAME
    01853  *         nztIDupContent -
    01854  *
    01855  * PARAMETERS
    01856  *         Name       {IN/OUT}   Description
    01857  *         osscntxt {IN}         OSS context.
    01858  *         targetIdentity{OUT}   target identity
    01859  *         sourceIdentity {IN}   source identity
    01860  * NOTES
    01861  *
    01862  * RETURNS
    01863  *         NZERROR_OK            succeeded
    01864  *         others                           failed
    01865  *
    01866  */
    01867
    01868 #ifdef __STDC__
    01869 nzerror nztIDupContent( nzctx *, nzttIdentity *, nzttIdentity *);
    01870 #else
    01871 nzerror nztIDupContent(/*_ nzctx *, nzttIdentity *, nzttIdentity * _*/);
    01872 #endif
    01873 /*---------------------- nztIPDuplicate ----------------------*/
    01874
    01875 /*
    01876  * NAME
    01877  *         nztIPDuplicate -
    01878  *
    01879  * PARAMETERS
    01880  *         Name       {IN/OUT}   Description
    01881  *         osscntxt {IN}         OSS context.
    01882  *         target_ipriv {OUT}    target identityPrivate
    01883  *         source_ipriv {IN}     source identityPrivate
    01884  *
    01885  * NOTES
    01886  *
    01887  * RETURNS
    01888  *         NZERROR_OK            succeeded
    01889  *         others                           failed
    01890  *
    01891  */
    01892 #ifdef __STDC__
    01893 nzerror nztIPDuplicate( nzctx *, nzttIdentityPrivate **,
    01894                                  nzttIdentityPrivate *);
    01895 #else
    01896 nzerror nztIPDuplicate(/*_ nzctx *, nzttIdentityPrivate **,
    01897                                   nzttIdentityPrivate * _*/);
    01898 #endif /* __STDC__ */
    01899
    01900 /*--------------------- nztiDupIdentList ---------------------*/
    01901
    01902 /*
    01903  * NAME
    01904  *         nztiDupIdentList -
    01905  *
    01906  * PARAMETERS
    01907  *         Name       {IN/OUT}   Description
    01908  *         osscntxt {IN}         OSS context.
    01909  *         source_identities {IN}           source identity list
    01910  *         numIdent {OUT}                   number of identity in the list
    01911  *         ppidentity {OUT}      Target of identity
    01912  *
    01913  * NOTES
    01914  *
    01915  * RETURNS
    01916  *         NZERROR_OK            succeeded
    01917  *         others                           failed
    01918  *
    01919  */
    01920 #ifdef __STDC__
    01921 nzerror nztiDupIdentList( nzctx *, nzttIdentity  *, ub4 *,
    01922                           nzttIdentity **);
    01923 #else
    01924
    01925 nzerror nztiDupIdentList(/*_ nzctx *, nzttIdentity  *, ub4 *,
    01926                              nzttIdentity ** _*/);
    01927 #endif
    01928
    01929 /*--------------------- nztFreeIdentList ---------------------*/
    01930
    01931 /*
    01932  * NAME
    01933  *         nztFreeIdentList - Free memory for a list of Identities
    01934  *
    01935  * PARAMETERS
    01936  *         Name       {IN/OUT}   Description
    01937  *         osscntxt {IN}         OSS context.
    01938  *         identity {IN}                    identity context
    01939  *
    01940  * NOTES
    01941  *
    01942  * RETURNS
    01943  *         NZERROR_OK            succeeded
    01944  *         others                           failed
    01945  *
    01946  */
    01947 #ifdef __STDC__
    01948 nzerror nztFreeIdentList( nzctx *, nzttIdentity **);
    01949 #else
    01950 nzerror nztFreeIdentList(/*_ nzctx *, nzttIdentity ** _*/);
    01951 #endif
    01952 #endif /* NZ_OLD_TOOLS */
    01953
    01954 /*--------------------- nztCheckVaLidity ---------------------*/
    01955
    01956 /*
    01957  * NAME
    01958  *         nztCheckVaLidity -  Check the validity of certificate
    01959  *
    01960  * PARAMETERS
    01961  *         Name       {IN/OUT}   Description
    01962  *         osscntxt {IN}         OSS context.
    01963  *         start_time            Start time of the certificate
    01964  *         end_time              End time of the certificate
    01965  *
    01966  * NOTES
    01967  *
    01968  * RETURNS
    01969  *         NZERROR_OK            succeeded
    01970  *         others                           failed
    01971  *
    01972  */
    01973 #ifdef __STDC__
    01974 nzerror nztCheckValidity( nzctx *, ub4 , ub4 );
    01975 #else
    01976 nzerror nztCheckValidity(/*_ nzctx *, ub4 , ub4 _*/);
    01977 #endif
    01978
    01979 /*--------------------- nztwCreateWallet ---------------------*/
    01980
    01981 /*
    01982  * NAME
    01983  *    nztwCreateWallet - Create a new wallet.
    01984  *
    01985  * PARAMETERS
    01986  *    osscntxt {IN}     OSS context.
    01987  *    wrllen   {IN}     Length of wallet resource locator.
    01988  *    wrl      {IN}     WRL.
    01989  *    pwdlen   {IN}     Length of password (see notes below).
    01990  *    pwd      {IN}     Password.
    01991  *    wallet   {IN/OUT} Wallet.
    01992  *
    01993  * NOTES
    01994  *    It is an error to try to create a wallet that already exists.
    01995  *    The previously existing wallet must be destroyed first.
    01996  *
    01997  *    The wallet itself is not encrypted.  Rather, all the personas in
    01998  *    the wallet are encrypted under the same password.  A hash of the
    01999  *    password is stored in the wallet.
    02000  *
    02001  *    Upon success, an empty open wallet is stored in the wallet
    02002  *    parameter.
    02003  *
    02004  * RETURNS
    02005  *    NZERROR_OK                 Sucess.
    02006  *    NZERROR_TK_WALLET_EXISTS   Wallet already exists.
    02007  *    NZERROR_RIO_OPEN           RIO could not create wallet (see trace file).
    02008  */
    02009 #ifdef __STDC__
    02010 nzerror nztwCreateWallet(nzctx *, ub4, text *, ub4, text *,
    02011                              nzttWallet *);
    02012 #else
    02013 nzerror nztwCreateWallet(/*_ nzctx *, ub4, text *, ub4, text *,
    02014                              nzttWallet * _*/);
    02015 #endif /* __STDC__ */
    02016
    02017
    02018 /*--------------------- nztwDestroyWallet ---------------------*/
    02019
    02020 /*
    02021  * NAME
    02022  *    nztwDestroyWallet - Destroy an existing wallet.
    02023  *
    02024  * PARAMETERS
    02025  *    osscntxt {IN}     OSS context.
    02026  *    wrllen   {IN}     Length of wallet resource locator.
    02027  *    wrl      {IN}     WRL.
    02028  *    pwdlen   {IN}     Length of password.
    02029  *    pwd      {IN}     Password.
    02030  * NOTES
    02031  *
    02032  * RETURNS
    02033  *    NZERROR_OK           Success.
    02034  *    NZERROR_TK_PASSWORD  Password verification failed.
    02035  *    NZERROR_RIO_OPEN     RIO could not open wallet (see trace file).
    02036  *    NZERROR_RIO_DELETE   Delete failed (see trace file).
    02037  */
    02038 #ifdef __STDC__
    02039 nzerror nztwDestroyWallet(nzctx *, ub4, text *, ub4, text *);
    02040 #else
    02041 nzerror nztwDestroyWallet(/*_ nzctx *, ub4, text *, ub4, text * _*/);
    02042 #endif /* __STDC __*/
    02043
    02044 /*--------------------- nzteStorePersona ---------------------*/
    02045
    02046 /*
    02047  * NAME
    02048  *    nzteStorePersona - Store an open persona in a wallet.
    02049  *
    02050  * PARAMETERS
    02051  *    osscntxt {IN}     OSS context.
    02052  *    persona  {IN/OUT} Persona.
    02053  *    wallet   {IN/OUT} Wallet.
    02054  *
    02055  * NOTES
    02056  *    If the open persona is not associated with any wallet (it was
    02057  *    created via the nzteClosePersona function), then storing the
    02058  *    persona creates that association.  The wallet will also have an
    02059  *    updated persona list that reflects this association.
    02060  *
    02061  *    If the open persona was associated with wallet 'A' (it was
    02062  *    opened via the nztwOpenWallet function), and is stored back into
    02063  *    wallet 'A', then then the old persona is overwritten by the new
    02064  *    persona if the password can be verified.  Recall that all
    02065  *    personas have a unique identity id.  If that id changes then
    02066  *    storing the persona will put a new persona in the wallet.
    02067  *
    02068  *    If the open persona was associated with wallet 'A' and is stored
    02069  *    into wallet 'B', and if wallet 'B' does not contain a persona
    02070  *    with that unique identity id, then the persona will be copied
    02071  *    into wallet 'B', wallet 'B''s persona list will be updated, and
    02072  *    the persona structure will be updated to be associated with
    02073  *    wallet 'B'.  If wallet 'B' already contained the persona, it
    02074  *    would be overwritten by the new persona.
    02075  *
    02076  *    The persona parameter is doubly indirect so that at the
    02077  *    conclusion of the function call, the pointer can be directed to
    02078  *    the persona in the wallet.
    02079  *
    02080  * RETURNS
    02081  *    NZERROR_OK           Success.
    02082  *    NZERROR_TK_PASSWORD  Password verification failed.
    02083  *    NZERROR_RIO_STORE    Store failed (see network trace file).
    02084  */
    02085 #ifdef __STDC__
    02086 nzerror nzteStorePersona(nzctx *, nzttPersona **, nzttWallet *);
    02087 #else
    02088 nzerror nzteStorePersona(/*_ nzctx *, nzttPersona **, nzttWallet * _*/);
    02089 #endif /* __STDC __*/
    02090
    02091 /*--------------------- nzteRemovePersona ---------------------*/
    02092
    02093 /*
    02094  * NAME
    02095  *    nzteRemovePersona - Remove a persona from the wallet.
    02096  *
    02097  * PARAMETERS
    02098  *    osscntxt {IN}     OSS context.
    02099  *    persona  {IN/OUT} Persona.
    02100  *
    02101  * NOTES
    02102  *    The password is verified before trying to remove the persona.
    02103  *
    02104  *    If the persona is open, it is closed.  The persona is removed
    02105  *    from the wallet list and the persona pointer is set to NULL.
    02106  *
    02107  *    A double indirect pointer to the persona is required so that the
    02108  *    persona pointer can be set to NULL upon completion.
    02109  *
    02110  * RETURNS
    02111  *    NZERROR_OK           Success.
    02112  *    NZERROR_TK_PASSWORD  Password verification failed.
    02113  *    NZERROR_RIO_DELETE   Delete failed.
    02114  */
    02115 #ifdef __STDC__
    02116 nzerror nzteRemovePersona(nzctx *, nzttPersona **);
    02117 #else
    02118 nzerror nzteRemovePersona(/*_ nzctx *, nzttPersona ** _*/);
    02119 #endif /* __STDC __*/
    02120
    02121 /*--------------------- nzteCreatePersona ---------------------*/
    02122
    02123 /*
    02124  * NAME
    02125  *    nzteCreatePersona - Create a persona.
    02126  *
    02127  * PARAMETERS
    02128  *    osscntxt {IN}     OSS context.
    02129  *    itype    {IN}     Identity type.
    02130  *    ctype    {IN}     Cipher type.
    02131  *    desc     {IN}     Persona description.
    02132  *    persona  {OUT}    Persona.
    02133  *
    02134  * NOTES
    02135  *    The resulting persona is created in the open state, but it will
    02136  *    not be associated with a wallet.
    02137  *
    02138  *    The memory for the persona is allocated by the function.
    02139  *
    02140  * RETURNS
    02141  *    NZERROR_OK        Success.
    02142  *    NZERROR_TK_TYPE   Unsupported itype/ctype combination.
    02143  *    NZERROR_TK_PARMS  Error in persona description.
    02144  */
    02145 #ifdef __STDC__
    02146 nzerror nzteCreatePersona(nzctx *, nzttVersion, nzttCipherType,
    02147                                    nzttPersonaDesc *, nzttPersona **);
    02148 #else
    02149 nzerror nzteCreatePersona(/*_ nzctx *, nzttVersion, nzttCipherType,
    02150                               nzttPersonaDesc *, nzttPersona ** _*/);
    02151 #endif /* __STDC __*/
    02152
    02153
    02154 /*----------------- nztiStoreTrustedIdentity -----------------*/
    02155
    02156 /*
    02157  * NAME
    02158  *    nztiStoreTrustedIdentity - Store an identity into a persona.
    02159  *
    02160  * PARAMETERS
    02161  *    osscntxt {IN}     Success.
    02162  *    identity {IN/OUT} Trusted Identity.
    02163  *    persona  {IN/OUT} Persona.
    02164  *
    02165  * NOTES
    02166  *    The identity is not saved with the persona in the wallet until
    02167  *    the persona is stored.
    02168  *
    02169  *    The identity parameter is double indirect so that it can point
    02170  *    into the persona at the conclusion of the call.
    02171  *
    02172  * RETURNS
    02173  *    NZERROR_OK     Success.
    02174  */
    02175 #ifdef __STDC__
    02176 nzerror nztiStoreTrustedIdentity(nzctx *, nzttIdentity **,
    02177                                      nzttPersona *);
    02178 #else
    02179 nzerror nztiStoreTrustedIdentity(/*_ nzctx *, nzttIdentity **,
    02180                                      nzttPersona * _*/);
    02181 #endif /* __STDC __*/
    02182
    02183 /*--------------------- nzteSetProtection ---------------------*/
    02184
    02185 /*
    02186  * NAME
    02187  *    nzteSetProtection - Set the protection type for a CE function.
    02188  *
    02189  * PARAMETERS
    02190  *    osscntxt {IN}     OSS context.
    02191  *    persona  {IN/OUT} Persona.
    02192  *    func     {IN}     CE function.
    02193  *    tdufmt   {IN}     TDU Format.
    02194  *    protinfo {IN}     Protection information specific to this format.
    02195  *
    02196  * NOTES
    02197  *
    02198  * RETURNS
    02199  *    NZERROR_OK              Success.
    02200  *    NZERROR_TK_PROTECTION   Unsupported protection.
    02201  *    NZERROR_TK_PARMS        Error in protection info.
    02202  */
    02203 #ifdef __STDC__
    02204 nzerror nzteSetProtection(nzctx *, nzttPersona *, nzttcef, nztttdufmt,
    02205                               nzttProtInfo *);
    02206 #else
    02207 nzerror nzteSetProtection(/*_ nzctx *, nzttPersona *, nzttcef, nztttdufmt,
    02208                               nzttProtInfo * _*/);
    02209 #endif /* __STDC __*/
    02210
    02211 /*--------------------- nzteGetProtection ---------------------*/
    02212
    02213 /*
    02214  * NAME
    02215  *    nzteGetProtection - Get the protection type for a CE function.
    02216  *
    02217  * PARAMETERS
    02218  *    osscntxt {IN}     OSS context.
    02219  *    persona  {IN}     Persona.
    02220  *    func     {IN}     CE function.
    02221  *    tdufmt   {OUT}    TDU format.
    02222  *    protinfo {OUT}    Protection information.
    02223  *
    02224  * NOTES
    02225  *
    02226  * RETURNS
    02227  *    NZERROR_OK        Success.
    02228  */
    02229 #ifdef __STDC__
    02230 nzerror nzteGetProtection(nzctx *, nzttPersona *, nzttcef, nztttdufmt *,
    02231                               nzttProtInfo *);
    02232 #else
    02233 nzerror nzteGetProtection(/*_ nzctx *, nzttPersona *, nzttcef, nztttdufmt *,
    02234                               nzttProtInfo * _*/);
    02235 #endif /* __STDC __*/
    02236
    02237 /*-------------------- nztiRemoveIdentity --------------------*/
    02238
    02239 /*
    02240  * NAME
    02241  *    nztiRemoveIdentity - Remove an identity from an open persona.
    02242  *
    02243  * PARAMETERS
    02244  *    osscntxt {IN}     OSS context.
    02245  *    identity {IN/OUT}     Identity.
    02246  *
    02247  * NOTES
    02248  *    If the persona is not stored, this identity will still be in the
    02249  *    persona stored in the wallet.
    02250  *
    02251  *    The identity parameter is doubly indirect so that at the
    02252  *    conclusion of the function, the pointer can be set to NULL.
    02253  *
    02254  * RETURNS
    02255  *    NZERROR_OK           Success.
    02256  *    NZERROR_TK_NOTFOUND  Identity not found.
    02257  *    NZERROR_TK_NOTOPEN   Persona is not open.
    02258  */
    02259 #ifdef __STDC__
    02260 nzerror nztiRemoveIdentity(nzctx *, nzttIdentity **);
    02261 #else
    02262 nzerror nztiRemoveIdentity(/*_ nzctx *, nzttIdentity ** _*/);
    02263 #endif /* __STDC __*/
    02264
    02265 /*----------------- nztifdn -----------------*/
    02266
    02267 /*
    02268  * NAME
    02269  *    nztifdn - create an Identity From a Distinguished Name
    02270  *
    02271  * PARAMETERS
    02272  *    osscntxt           {IN}  OSS context.
    02273  *    length             {IN}  Length of the distinguished name
    02274  *    distinguished_name {IN}  distinguished name string
    02275  *    ppidentity         {OUT} created identity
    02276  *
    02277  * NOTES
    02278  *    Given a distinguished name, return the identity that corresponds to it.
    02279  *
    02280  * RETURNS
    02281  *    NZERROR_OK     Success.
    02282  */
    02283 #ifdef __STDC__
    02284 nzerror nztifdn(nzctx         *ossctx,
    02285                     ub4         length,
    02286                     text          *distinguished_name,
    02287                     nzttIdentity **ppidentity);
    02288 #else
    02289 nzerror nztifdn(/*_ nzctx         *ossctx,
    02290                     ub4         length,
    02291                     text          *distinguished_name,
    02292                     nzttIdentity **ppidentity _*/);
    02293 #endif /* __STDC __*/
    02294
    02295 /*--------------------- nztxSignExpansion ---------------------*/
    02296
    02297 /*
    02298  * NAME
    02299  *    nztxSignExpansion - Determine the size of the attached signature buffer.
    02300  *
    02301  * PARAMETERS
    02302  *    osscntxt {IN}  OSS context.
    02303  *    persona  {IN}  Persona.
    02304  *    inlen    {IN}  Length of input.
    02305  *    tdulen   {OUT} Buffer needed for signature.
    02306  *
    02307  * NOTES
    02308  *
    02309  * RETURNS
    02310  *    NZERROR_OK           Success.
    02311  *    NZERROR_TK_NOTOPEN   Persona is not open.
    02312  *    NZERROR_TK_NOTSUPP   Function not supported with persona.
    02313  */
    02314 #ifdef __STDC__
    02315 nzerror nztxSignExpansion(nzctx *, nzttPersona *, ub4, ub4 *);
    02316 #else
    02317 nzerror nztxSignExpansion(/*_ nzctx *, nzttPersona *, ub4, ub4 * _*/);
    02318 #endif /* __STDC __*/
    02319
    02320 /*--------------- nztxsd_SignDetachedExpansion ---------------*/
    02321
    02322 /*
    02323  * NAME
    02324  *    nztxsd_SignDetachedExpansion - Determine the size of buffer needed.
    02325  *
    02326  * PARAMETERS
    02327  *    osscntxt {IN}  OSS context.
    02328  *    persona  {IN}  Persona.
    02329  *    inlen    {IN}  Length of input.
    02330  *    tdulen   {OUT} Buffer needed for signature.
    02331  *
    02332  * NOTES
    02333  *
    02334  * RETURNS
    02335  *    NZERROR_OK           Success.
    02336  *    NZERROR_TK_NOTOPEN   Persona is not open.
    02337  *    NZERROR_TK_NOTSUPP   Function not supported with persona.
    02338  */
    02339 #ifdef __STDC__
    02340 nzerror nztxsd_SignDetachedExpansion(nzctx *, nzttPersona *, ub4,
    02341                                          ub4 *);
    02342 #else
    02343 nzerror nztxsd_SignDetachedExpansion(/*_ nzctx *, nzttPersona *, ub4,
    02344                                          ub4 * _*/);
    02345 #endif /* __STDC __*/
    02346
    02347 /*------------------------ nztEncrypt ------------------------*/
    02348
    02349 /*
    02350  * NAME
    02351  *    nztEncrypt - Symmetrically encrypt
    02352  *
    02353  * PARAMETERS
    02354  *    osscntxt    {IN}     OSS context.
    02355  *    persona     {IN}     Persona.
    02356  *    inlen       {IN}     Length of this input part.
    02357  *    in          {IN}     This input part.
    02358  *    tdubuf      {IN/OUT} TDU buffer.
    02359  *
    02360  * NOTES
    02361  *
    02362  * RETURNS
    02363  *    NZERROR_OK           Success.
    02364  *    NZERROR_TK_CANTGROW  Needed to grow TDU buffer but could not.
    02365  *    NZERROR_TK_NOTOPEN   Persona is not open.
    02366  *    NZERROR_TK_NOTSUPP   Function not supported with persona.
    02367  */
    02368 #ifdef __STDC__
    02369 nzerror nztEncrypt(nzctx *, nzttPersona *, nzttces, ub4, ub1 *,
    02370                        nzttBufferBlock *);
    02371 #else
    02372 nzerror nztEncrypt(/*_ nzctx *, nzttPersona *, nzttces, ub4, ub1 *,
    02373                        nzttBufferBlock * _*/);
    02374 #endif /* __STDC __*/
    02375
    02376 /*------------------- nztxEncryptExpansion -------------------*/
    02377
    02378 /*
    02379  * NAME
    02380  *    nztxEncryptExpansion - Determine the size of the TDU to encrypt.
    02381  *
    02382  * PARAMETERS
    02383  *    osscntxt    {IN}  OSS context.
    02384  *    persona     {IN}  Persona.
    02385  *    inlen       {IN}  Length of this input part.
    02386  *    tdulen      {OUT} Length of TDU.
    02387  *
    02388  * NOTES
    02389  *
    02390  * RETURNS
    02391  *    NZERROR_OK           Success.
    02392  *    NZERROR_TK_NOTOPEN   Persona is not open.
    02393  *    NZERROR_TK_NOTSUPP   Function not supported with persona.
    02394  */
    02395 #ifdef __STDC__
    02396 nzerror nztxEncryptExpansion(nzctx *, nzttPersona *, ub4, ub4 *);
    02397 #else
    02398 nzerror nztxEncryptExpansion(/*_ nzctx *, nzttPersona *, ub4, ub4 * _*/);
    02399 #endif /* __STDC __*/
    02400
    02401 /*------------------------ nztDecrypt ------------------------*/
    02402
    02403 /*
    02404  * NAME
    02405  *    nztDecrypt - Decrypt an Encrypted message.
    02406  *
    02407  * PARAMETERS
    02408  *    osscntxt {IN}     OSS context.
    02409  *    persona  {IN}     Persona.
    02410  *    state    {IN}     State of decryption.
    02411  *    inlen    {IN}     Length of this input part.
    02412  *    in       {IN}     This input part.
    02413  *    out      {IN/OUT} Cleartext message.
    02414  *
    02415  * NOTES
    02416  *
    02417  * RETURNS
    02418  *    NZERROR_OK           Success.
    02419  *    NZERROR_TK_CANTGROW  Needed to grow TDU buffer but could not.
    02420  *    NZERROR_TK_NOTOPEN   Persona is not open.
    02421  *    NZERROR_TK_NOTSUPP   Function not supported with persona.
    02422  */
    02423 #ifdef __STDC__
    02424 nzerror nztDecrypt(nzctx *, nzttPersona *, nzttces, ub4, ub1 *,
    02425                        nzttBufferBlock *);
    02426 #else
    02427 nzerror nztDecrypt(/*_ nzctx *, nzttPersona *, nzttces, ub4, ub1 *,
    02428                        nzttBufferBlock * _*/);
    02429 #endif /* __STDC __*/
    02430
    02431 /*------------------------ nztEnvelope ------------------------*/
    02432
    02433 /*
    02434  * NAME
    02435  *    nztEnvelope - Sign and PKEncrypt a message.
    02436  *
    02437  * PARAMETERS
    02438  *    osscntxt    {IN}     OSS context.
    02439  *    persona     {IN}     Persona.
    02440  *    nrecipients {IN}     Number of recipients for this encryption.
    02441  *    recipients  {IN}     List of recipients.
    02442  *    state       {IN}     State of encryption.
    02443  *    inlen       {IN}     Length of this input part.
    02444  *    in          {IN}     This input part.
    02445  *    tdubuf      {IN/OUT} TDU buffer.
    02446  *
    02447  * NOTES
    02448  *
    02449  * RETURNS
    02450  *    NZERROR_OK           Success.
    02451  *    NZERROR_TK_CANTGROW  Needed to grow output buffer but could not.
    02452  *    NZERROR_TK_NOTOPEN   Persona is not open.
    02453  *    NZERROR_TK_NOTSUPP   Function not supported with persona.
    02454  */
    02455 #ifdef __STDC__
    02456 nzerror nztEnvelope(nzctx *, nzttPersona *, ub4, nzttIdentity *,
    02457                         nzttces, ub4, ub1 *, nzttBufferBlock *);
    02458 #else
    02459 nzerror nztEnvelope(/*_ nzctx *, nzttPersona *, ub4, nzttIdentity *,
    02460                         nzttces, ub4, ub1 *, nzttBufferBlock * _*/);
    02461 #endif /* __STDC __*/
    02462
    02463 /*----------------------- nztDeEnvelope -----------------------*/
    02464
    02465 /*
    02466  * NAME
    02467  *    nztDeEnvelope - PKDecrypt and verify a message.
    02468  *
    02469  * PARAMETERS
    02470  *    osscntxt    {IN}     OSS context.
    02471  *    persona     {IN}     Persona.
    02472  *    state       {IN}     State of encryption.
    02473  *    inlen       {IN}     Length of this input part.
    02474  *    in          {IN}     This input part.
    02475  *    out         {OUT}    Message from TDU.
    02476  *    verified    {OUT}    TRUE if verified.
    02477  *    validated   {OUT}    TRUE if validated.
    02478  *    sender      {OUT}    Identity of sender.
    02479  *
    02480  * NOTES
    02481  *
    02482  * RETURNS
    02483  *    NZERROR_OK           Success.
    02484  *    NZERROR_TK_CANTGROW  Needed to grow TDU buffer but could not.
    02485  *    NZERROR_TK_NOTOPEN   Persona is not open.
    02486  *    NZERROR_TK_NOTSUPP   Function not supported with persona.
    02487  */
    02488 #ifdef __STDC__
    02489 nzerror nztDeEnvelope(nzctx *, nzttPersona *, nzttces, ub4, ub1 *,
    02490                           nzttBufferBlock *, boolean *, boolean *,
    02491                           nzttIdentity **);
    02492 #else
    02493 nzerror nztDeEnvelope(/*_ nzctx *, nzttPersona *, nzttces, ub4, ub1 *,
    02494                           nzttBufferBlock *, boolean *, boolean *,
    02495                           nzttIdentity ** _*/);
    02496 #endif /* __STDC __*/
    02497
    02498 /*----------------------- nztKeyedHash -----------------------*/
    02499
    02500 /*
    02501  * NAME
    02502  *    nztKeyedHash - Generate a keyed hash.
    02503  *
    02504  * PARAMETERS
    02505  *    osscntxt {IN}     OSS context.
    02506  *    persona  {IN}     Persona.
    02507  *    state    {IN}     State of hash.
    02508  *    inlen    {IN}     Length of this input.
    02509  *    in       {IN}     This input.
    02510  *    tdu      {IN/OUT} Output tdu.
    02511  *
    02512  * NOTES
    02513  *
    02514  * RETURNS
    02515  *    NZERROR_OK           Success.
    02516  *    NZERROR_TK_CANTGROW  Needed to grow TDU buffer but could not.
    02517  *    NZERROR_TK_NOTOPEN   Persona is not open.
    02518  *    NZERROR_TK_NOTSUPP   Function not supported with persona.
    02519  */
    02520 #ifdef __STDC__
    02521 nzerror nztKeyedHash(nzctx *, nzttPersona *, nzttces, ub4, ub1 *,
    02522                          nzttBufferBlock *);
    02523 #else
    02524 nzerror nztKeyedHash(/*_ nzctx *, nzttPersona *, nzttces, ub4, ub1 *,
    02525                          nzttBufferBlock * _*/);
    02526 #endif /* __STDC __*/
    02527
    02528 /*------------------ nztxKeyedHashExpansion ------------------*/
    02529
    02530 /*
    02531  * NAME
    02532  *    nztxKeyedHashExpansion - Determine the space needed for a keyed hash.
    02533  *
    02534  * PARAMETERS
    02535  *    osscntxt {IN}  OSS context.
    02536  *    persona  {IN}  Persona.
    02537  *    inlen    {IN}  Length of this input.
    02538  *    tdulen   {OUT} TDU length.
    02539  *
    02540  * NOTES
    02541  *
    02542  * RETURNS
    02543  *    NZERROR_OK           Success.
    02544  *    NZERROR_TK_NOTOPEN   Persona is not open.
    02545  *    NZERROR_TK_NOTSUPP   Function not supported with persona.
    02546  */
    02547 #ifdef __STDC__
    02548 nzerror nztxKeyedHashExpansion(nzctx *, nzttPersona *, ub4,
    02549                                    ub4 *);
    02550 #else
    02551 nzerror nztxKeyedHashExpansion(/*_ nzctx *, nzttPersona *, ub4,
    02552                                    ub4 * _*/);
    02553 #endif /* __STDC __*/
    02554
    02555 /*--------------------- nztxHashExpansion ---------------------*/
    02556
    02557 /*
    02558  * NAME
    02559  *    nztxHashExpansion - Determine the size of the TDU for a hash.
    02560  *
    02561  * PARAMETERS
    02562  *    osscntxt {IN}  OSS context.
    02563  *    persona  {IN}  Persona.
    02564  *    inlen    {IN}  Length of this input.
    02565  *    tdulen   {OUT} TDU length.
    02566  *
    02567  * NOTES
    02568  *
    02569  * RETURNS
    02570  *    NZERROR_OK           Success.
    02571  *    NZERROR_TK_NOTOPEN   Persona is not open.
    02572  *    NZERROR_TK_NOTSUPP   Function not supported with persona.
    02573  */
    02574 #ifdef __STDC__
    02575 nzerror nztxHashExpansion(nzctx *, nzttPersona *, ub4, ub4 *);
    02576 #else
    02577 nzerror nztxHashExpansion(/*_ nzctx *, nzttPersona *, ub4, ub4 * _*/);
    02578 #endif /* __STDC __*/
    02579
    02580 /*---------------- nztiae_IsAuthEnabled ----------------*/
    02581
    02582 /*
    02583  * NAME
    02584  *         nztiae_IsAuthEnabled -  Checks to see if Authentication is Enabled
    02585  *                               in the current Cipher Spec.
    02586  *
    02587  * PARAMETERS
    02588  *         ctx        {IN}       Oracle SSL Context
    02589  *      ncipher {IN}    CipherSuite
    02590  *      authEnabled {OUT} Boolean for is Auth Enabled?
    02591  *
    02592  * NOTES
    02593  *
    02594  * RETURNS
    02595  *      NZERROR_OK on success.
    02596  *      NZERROR_TK_INV_CIPHR_TYPE if Cipher Spec is not Recognized.
    02597  */
    02598
    02599 #ifdef __STDC__
    02600 nzerror nztiae_IsAuthEnabled( nzctx *, ub2, boolean *);
    02601 #else
    02602 nzerror nztiae_IsAuthEnabled(/*_ nzctx *ctx,
    02603                                   ub2 ncipher,
    02604                                   boolean *authEnabled _*/);
    02605 #endif
    02606
    02607 /*---------------- nztiee_IsEncrEnabled ----------------*/
    02608 /*
    02609  * NAME
    02610  *         nztiee_IsEncrEnabled -  Checks to see if Encryption is Enabled
    02611  *                               in the current Cipher Spec.
    02612  *
    02613  * PARAMETERS
    02614  *         ctx        {IN}       Oracle SSL Context
    02615  *      ncipher {IN}    CipherSuite
    02616  *      EncrEnabled {OUT} Boolean for is Auth Enabled?
    02617  *
    02618  * NOTES
    02619  *
    02620  * RETURNS
    02621  *      NZERROR_OK on success.
    02622  *      NZERROR_TK_INV_CIPHR_TYPE if Cipher Spec is not Recognized.
    02623  */
    02624
    02625 #ifdef __STDC__
    02626 nzerror nztiee_IsEncrEnabled( nzctx *, ub2, boolean *);
    02627 #else
    02628 nzerror nztiee_IsEncrEnabled(/*_ nzctx *ctx,
    02629                                   ub2 ncipher,
    02630                                   boolean *EncrEnabled _*/);
    02631 #endif
    02632 /*---------------- nztihe_IsHashEnabled ----------------*/
    02633 /*
    02634  * NAME
    02635  *         nztihe_IsHashEnabled -  Checks to see if HAshing is Enabled
    02636  *                               in the current Cipher Spec.
    02637  *
    02638  * PARAMETERS
    02639  *         ctx        {IN}       Oracle SSL Context
    02640  *      ncipher {IN}    CipherSuite
    02641  *      hashEnabled {OUT} Boolean for is Auth Enabled?
    02642  *
    02643  * NOTES
    02644  *
    02645  * RETURNS
    02646  *      NZERROR_OK on success.
    02647  *      NZERROR_TK_INV_CIPHR_TYPE if Cipher Spec is not Recognized.
    02648  */
    02649
    02650 #ifdef __STDC__
    02651 nzerror nztihe_IsHashEnabled( nzctx *, ub2, boolean *);
    02652 #else
    02653 nzerror nztihe_IsHashEnabled(/*_ nzctx *ctx,
    02654                                   ub2 ncipher,
    02655                                   boolean *hashEnabled _*/);
    02656 #endif
    02657
    02658 /*
    02659  *
    02660  */
    02661
    02662 #ifdef _STDC_
    02663 nzerror nztGetIssuerName(nzctx *, nzttIdentity *, ub1 **, ub4 *);
    02664 #else
    02665 nzerror nztGetIssuerName(/*_ nzctx *ctx,
    02666                              nzttIdentity *identity,
    02667                              ub1  **issuername,
    02668                              ub4   *issuernamelen _*/);
    02669 #endif
    02670
    02671 #ifdef _STDC_
    02672 nzerror nztGetSubjectName(nzctx *, nzttIdentity *, ub1 **, ub4 *);
    02673 #else
    02674 nzerror nztGetSubjectName(/*_ nzctx *ctx,
    02675                               nzttIdentity *identity,
    02676                               ub1  **subjectname,
    02677                               ub4   *subjectnamelen _*/);
    02678 #endif
    02679
    02680
    02681 #ifdef _STDC_
    02682 nzerror nztGetBase64Cert(nzctx *, nzttIdentity *, ub1 **, ub4 *);
    02683 #else
    02684 nzerror nztGetBase64Cert(/*_ nzctx *ctx,
    02685                               nzttIdentity *identity,
    02686                               ub1  **b64cert,
    02687                               ub4   *b64certlen _*/);
    02688 #endif
    02689
    02690 #ifdef _STDC_
    02691 nzerror nztGetSerialNumber(nzctx *, nzttIdentity *, ub1 **, ub4 *);
    02692 #else
    02693 nzerror nztGetSerialNumber(/*_ nzctx *ctx,
    02694                               nzttIdentity *identity,
    02695                               ub1   **serialnum,
    02696                               ub4    *serialnumlen _*/);
    02697 #endif
    02698
    02699 #ifdef _STDC_
    02700 nzerror nztGetValidDate(nzctx *, nzttIdentity *, ub4 *, ub4 *);
    02701 #else
    02702 nzerror nztGetValidDate(/*_ nzctx *ctx,
    02703                             nzttIdentity *identity,
    02704                             ub4  *startdate,
    02705                             ub4  *enddate  _*/);
    02706 #endif
    02707
    02708 #ifdef _STDC_
    02709 nzerror nztGetVersion(nzctx *, nzttIdentity *, nzstrc *);
    02710 #else
    02711 nzerror nztGetVersion(/*_ nzctx *ctx,
    02712                           nzttIdentity *identity,
    02713                           nzstrc *pVerStr  _*/);
    02714 #endif
    02715
    02716 #ifdef _STDC_
    02717 nzerror nztGetPublicKey(nzctx *, nzttIdentity *, ub1 **, ub4 *);
    02718 #else
    02719 nzerror nztGetPublicKey(/*_ nzctx *ctx,
    02720                             nzttIdentity *identity,
    02721                             ub1  **pubKey,
    02722                             ub4   *pubKeylen _*/);
    02723 #endif
    02724
    02725
    02726 #ifdef _STDC_
    02727 nzerror nztGenericDestroy(nzctx *, ub1 **);
    02728 #else
    02729 nzerror nztGenericDestroy(/*_ nzctx *ctx,
    02730                               ub1  **var _*/);
    02731 #endif
    02732
    02733 #ifdef _STDC_
    02734 nzerror nztSetAppDefaultLocation(nzctx *, text *, size_t);
    02735 #else
    02736 nzerror nztSetAppDefaultLocation(/*_ nzctx *ctx,
    02737                                      text *,
    02738                                      size_t _*/);
    02739 #endif
    02740
    02741 #ifdef _STDC_
    02742 nzerror nztSearchNZDefault(nzctx *, boolean *);
    02743 #else
    02744 nzerror nztSearchNZDefault(/*_ nzctx *ctx,
    02745                                boolean *search _*/);
    02746 #endif
    02747
    02748
    02749 #endif /* NZT_ORACLE */
    02750

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines