📄 nzt.h
字号:
/*--------------------- nzteX509CreatePersona ---------------------*/
/*
* NAME
* nzteX509CreatePersona - Given a BER X.509 cert, create a persona
*
* PARAMETERS
* osscntxt {IN} OSS context.
* cert {IN} X.509 Certificate [BER encoded]
* cert_len {IN} Certificate length
* persona {OUT} Persona.
*
* NOTES
* Memory will be allocated for the persona and therefore, the CALLER
* will be responsible for freeing this memory.
*
* RETURNS
* NZERROR_OK Success.
* NZERROR_NO_MEMORY ossctx is null.
*/
#ifdef __STDC__
nzerror nzteX509CreatePersona(nzctx *, ub1 *, ub4, nzttPersona **);
#else
nzerror nzteX509CreatePersona(/*_ nzctx *, ub1 *, ub4, nzttPersona ** _*/);
#endif /* __STDC __*/
/*-------------------- nztiCreateIdentity --------------------*/
/*
* NAME
* nztiCreateIdentity - Create an identity.
*
* PARAMETERS
* osscntxt {IN} OSS context.
* itype {IN} Identity type.
* desc {IN} Description of identity.
* identity {IN/OUT} Identity.
*
* NOTES
* Memory is only allocated for the identity structure. The elements in
* the description struct are not copied. Rather their pointers are copied
* into the identity structure. Therefore, the caller should not free
* the elements referenced by the desc. These elements will be freed
* when the nztiDestroyIdentity is called.
*
* RETURNS
* NZERROR_OK Success.
* NZERROR_PARMS Error in description.
*/
#ifdef __STDC__
nzerror nztiCreateIdentity(nzctx *, nzttVersion, nzttIdentityDesc *,
nzttIdentity **);
#else
nzerror nztiCreateIdentity(/*_ nzctx *, nzttVersion, nzttIdentityDesc *,
nzttIdentity ** _*/);
#endif /* __STDC __*/
#ifdef NZ_OLD_TOOLS
/*-------------------- nztiDuplicateIdentity --------------------*/
/*
* NAME
* nztiDuplicateIdentity - Duplicate an identity.
*
* PARAMETERS
* osscntxt {IN} OSS context.
* identity {IN} Target Identity.
* new_identity {IN} New Identity.
*
* NOTES
* Memory for the identity is allocated inside the function, and all
* internal identity elements as well.
*
* RETURNS
* NZERROR_OK Success.
* NZERROR_TK_NOTFOUND Identity not found.
* NZERROR_PARMS Error in description.
*/
#ifdef __STDC__
nzerror nztiDuplicateIdentity(nzctx *, nzttIdentity *,
nzttIdentity **);
#else
nzerror nztiDuplicateIdentity(/*_ nzctx *, nzttIdentity *,
nzttIdentity ** _*/);
#endif /* __STDC __*/
#endif /* NZ_OLD_TOOLS */
/*--------------------- nztiAbortIdentity ---------------------*/
/*
* NAME
* nztiAbortIdentity - Abort an unassociated identity.
*
* PARAMETERS
* osscntxt {IN} OSS context.
* identity {IN/OUT} Identity.
*
* NOTES
* It is an error to try to abort an identity that can be
* referenced through a persona.
*
* The identity pointer is set to NULL at the conclusion.
*
* RETURNS
* NZERROR_OK Success.
* NZERROR_CANTABORT Identity is associated with persona.
*/
#ifdef __STDC__
nzerror nztiAbortIdentity(nzctx *, nzttIdentity **);
#else
nzerror nztiAbortIdentity(/*_ nzctx *, nzttIdentity ** _*/);
#endif /* __STDC __*/
#ifdef NZ_OLD_TOOLS
/*----------------- nztidGetIdentityDesc -----------------*/
/*
* NAME
* nztidGetIdentityDesc - Gets an Identity Description from the identity
*
* PARAMETERS
* osscntxt {IN} Success.
* identity {IN} Identity.
* description {IN/OUT} Identity Description.
*
* NOTES
* Memory is allocated for the Identity Description. It
* is the callers responsibility to free this memory by calling
* nztiFreeIdentityDesc.
*
* RETURNS
* NZERROR_OK Success.
*/
#ifdef __STDC__
nzerror nztidGetIdentityDesc(nzctx *, nzttIdentity *,
nzttIdentityDesc **);
#else
nzerror nztidGetIdentityDesc(/*_ nzctx *, nzttIdentity *,
nzttIdentityDesc ** _*/);
#endif /* __STDC __*/
/*----------------- nztidFreeIdentityDesc -----------------*/
/*
* NAME
* nztidFreeIdentityDesc - Frees memory for Identity Desc object.
*
* PARAMETERS
* osscntxt {IN} oss context.
* description {IN/OUT} Identity Description.
*
* NOTES
* Memory is freed for all Identity description elements. Pointer is
* then set to null.
*
* RETURNS
* NZERROR_OK Success.
*/
#ifdef __STDC__
nzerror nztidFreeIdentityDesc(nzctx *, nzttIdentityDesc **);
#else
nzerror nztidFreeIdentityDesc(/*_ nzctx *, nzttIdentityDesc ** _*/);
#endif /* __STDC __*/
#endif /* NZ_OLD_TOOLS */
/*---------------- nztific_FreeIdentityContent ----------------*/
/*
* NAME
* nztific_FreeIdentityContent - free the contents of an identity.
*
* PARAMETERS
* osscntxt {IN} OSS context.
* identity {IN/OUT} freed identity
*
* NOTES
* Free a created identity.
*
* RETURNS
* NZERROR_OK Success.
*/
/*
* Free the identity content.
*/
#ifdef __STDC__
nzerror nztific_FreeIdentityContent(nzctx *ossctx,
nzttIdentity *identity);
#else
nzerror nztific_FreeIdentityContent(/*_ nzctx *ossctx,
nzttIdentity *identity _*/);
#endif /* __STDC __*/
/*-------------------------- nztSign --------------------------*/
/*
* NAME
* nztSign - Create an attached signature.
*
* PARAMETERS
* osscntxt {IN} OSS context.
* persona {IN} Open persona acting as signer.
* state {IN} State of signature.
* inlen {IN} Length of this input part.
* in {IN} This input part.
* tdubuf {IN/OUT} TDU buffer.
*
* NOTES
*
* RETURNS
* NZERROR_OK Success.
* NZERROR_TK_CANTGROW Needed to grow output buffer but could not.
* NZERROR_TK_NOTOPEN Persona is not open.
* NZERROR_TK_NOTSUPP Function not supported with persona.
*/
#ifdef __STDC__
nzerror nztSign(nzctx *, nzttPersona *, nzttces, ub4, ub1 *,
nzttBufferBlock *);
#else
nzerror nztSign(/*_ nzctx *, nzttPersona *, nzttces, ub4, ub1 *,
nzttBufferBlock * _*/);
#endif /* __STDC __*/
/*------------------------- nztVerify -------------------------*/
/*
* NAME
* nztVerify - Verify an attached signature.
*
* PARAMETERS
* osscntxt {IN} OSS context.
* persona {IN} Persona.
* state {IN} State of verification.
* intdulen {IN} TDU length.
* intdu {IN} TDU.
* out {IN/OUT} Extracted message.
* verified {OUT} TRUE if signature verified.
* validated{OUT} TRUE if signing identity validated.
* identity {OUT} Identity of signing party.
*
* NOTES
*
* RETURNS
* NZERROR_OK Success.
* NZERROR_TK_CANTGROW Needed to grow outptu buffer but could not.
* NZERROR_TK_NOTOPEN Persona is not open.
* NZERROR_TK_NOTSUPP Function not supported with persona.
*/
#ifdef __STDC__
nzerror nztVerify(nzctx *, nzttPersona *, nzttces, ub4, ub1 *,
nzttBufferBlock *, boolean *, boolean *,
nzttIdentity **);
#else
nzerror nztVerify(/*_ nzctx *, nzttPersona *, nzttces, ub4, ub1 *,
nzttBufferBlock *, boolean *, boolean *,
nzttIdentity ** _*/);
#endif /* __STDC __*/
/*------------------------ nztValidate ------------------------*/
/*
* NAME
* nztValidate - Validate an identity.
*
* PARAMETERS
* osscntxt {IN} OSS context.
* persona {IN} Persona.
* identity {IN} Identity.
* validated{OUT} TRUE if identity was validated.
*
* NOTES
*
* RETURNS
* NZERROR_OK Success.
* NZERROR_TK_NOTOPEN Persona is not open.
* NZERROR_TK_NOTSUPP Function not supported with persona.
*/
#ifdef __STDC__
nzerror nztValidate(nzctx *, nzttPersona *, nzttIdentity *, boolean *);
#else
nzerror nztValidate(/*_ nzctx *, nzttPersona *, nzttIdentity *, boolean * _*/);
#endif /* __STDC __*/
/*-------------------- nztsd_SignDetached --------------------*/
/*
* NAME
* nztsd_SignDetached - Generate a detached signature.
*
* PARAMETERS
* osscntxt {IN} OSS context.
* persona {IN} Persona.
* state {IN} State of signature.
* inlen {IN} Length of this input part.
* in {IN} This input part.
* tdubuf {IN/OUT} TDU buffer.
*
* NOTES
*
* RETURNS
* NZERROR_OK Success.
* NZERROR_TK_CANTGROW Needed to grow output buffer but could not.
* NZERROR_TK_NOTOPEN Persona is not open.
* NZERROR_TK_NOTSUPP Function not supported with persona.
*/
#ifdef __STDC__
nzerror nztsd_SignDetached(nzctx *, nzttPersona *, nzttces, ub4, ub1 *,
nzttBufferBlock *);
#else
nzerror nztsd_SignDetached(/*_ nzctx *, nzttPersona *, nzttces, ub4, ub1 *,
nzttBufferBlock * _*/);
#endif /* __STDC __*/
/*------------------- nztved_VerifyDetached -------------------*/
/*
* NAME
* nztved_VerifyDetached - Verify a detached signature.
*
* PARAMETERS
* osscntxt {IN} OSS context.
* persona {IN} Persona.
* state {IN} State of verification.
* inlen {IN} Length of data.
* in {IN} Data.
* intdulen {IN} Input TDU length.
* tdu {IN} Input TDU.
* verified {OUT} TRUE if signature verified.
* validated{OUT} TRUE if signing identity validated.
* identity {OUT} Identity of signing party.
*
* NOTES
*
* RETURNS
* NZERROR_OK Success.
* NZERROR_TK_NOTOPEN Persona is not open.
* NZERROR_TK_NOTSUPP Function not supported with persona.
*/
#ifdef __STDC__
nzerror nztved_VerifyDetached(nzctx *, nzttPersona *, nzttces, ub4,
ub1 *, ub4, ub1 *, boolean *, boolean *,
nzttIdentity **);
#else
nzerror nztved_VerifyDetached(/*_ nzctx *, nzttPersona *, nzttces, ub4,
ub1 *, ub4, ub1 *, boolean *, boolean *,
nzttIdentity ** _*/);
#endif /* __STDC __*/
/*--------------------- nztkec_PKEncrypt ---------------------*/
/*
* NAME
* nztkec_PKEncrypt - Encrypt data symmetrically, encrypt key asymmetrically
*
* PARAMETERS
* osscntxt {IN} OSS context.
* persona {IN} Persona.
* nrecipients {IN} Number of recipients for this encryption.
* recipients {IN} List of recipients.
* state {IN} State of encryption.
* inlen {IN} Length of this input part.
* in {IN} This input part.
* tdubuf {IN/OUT} TDU buffer.
*
* NOTES
* There is a limitation of 1 recipient (nrecipients = 1) at this
* time.
*
* RETURNS
* NZERROR_OK Success.
* NZERROR_TK_CANTGROW Needed to grow output buffer but could not.
* NZERROR_TK_NOTOPEN Persona is not open.
* NZERROR_TK_NOTSUPP Function not supported with persona.
*/
#ifdef __STDC__
nzerror nztkec_PKEncrypt(nzctx *, nzttPersona *, ub4, nzttIdentity *,
nzttces, ub4, ub1 *, nzttBufferBlock *);
#else
nzerror nztkec_PKEncrypt(/*_ nzctx *, nzttPersona *, ub4, nzttIdentity *,
nzttces, ub4, ub1 *, nzttBufferBlock * _*/);
#endif /* __STDC __*/
/*---------------- nztxkec_PKEncryptExpansion ----------------*/
/*
* NAME
* nztxkec_PKEncryptExpansion - Determine the buffer needed for PKEncrypt
*
* PARAMETERS
* osscntxt {IN} OSS context.
* persona {IN} Persona.
* nrecipients {IN} Number of recipients.
* inlen {IN} Length of input.
* tdulen {out} Length of buffer need.
*
* NOTES
*
* RETURNS
* NZERROR_OK Success.
* NZERROR_TK_NOTOPEN Persona is not open.
* NZERROR_TK_NOTSUPP Function not supported with persona.
*/
#ifdef __STDC__
nzerror nztxkec_PKEncryptExpansion(nzctx *, nzttPersona *, ub4, ub4,
ub4 *);
#else
nzerror nztxkec_PKEncryptExpansion(/*_ nzctx *, nzttPersona *, ub4, ub4,
ub4 * _*/);
#endif /* __STDC __*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -