📄 zdmparams.c
字号:
break;
/* The caller wants to get, is that allowed?
*/
VOLT_SET_FNCT_LINE (fnctLine)
status = VT_ERROR_INVALID_GET;
if ((paramFlags & VT_ZDM_GET_SUPPORTED) == 0)
break;
if (obj->GetParam == (VZDMGetParam)0)
{
VOLT_SET_FNCT_LINE(fnctLine)
status = VT_ERROR_INVALID_IMPL;
break;
}
VOLT_SET_ERROR_TYPE (errorType, 0)
VOLT_SET_FNCT_LINE (fnctLine)
status = obj->GetParam(zdmObj, selector, (Pointer *)info);
} while (0);
VOLT_LOG_ERROR_COMPARE (
status, libCtx, status, errorType, fnctLine,
"VoltZDMParamCommon", (unsigned char *)0)
return (status);
}
int VtZDMParamMessageType (
VtZDMObject zdmObj,
Pointer info,
unsigned int flag
)
{
int status;
VtLibCtx libCtx = (VtLibCtx)0;
VOLT_DECLARE_FNCT_LINE (fnctLine)
if (zdmObj != (VtZDMObject)0)
libCtx = zdmObj->voltObject.libraryCtx;
VOLT_SET_FNCT_LINE (fnctLine)
status = VoltZDMParamCommon (
zdmObj, info, flag, VT_ZDM_SET_SUPPORTED | VT_ZDM_SET_INFO_REQUIRED,
VT_ZDM_PARAM_MESSAGE_TYPE);
VOLT_LOG_ERROR_COMPARE (
status, libCtx, status, 0, fnctLine,
"VtZDMParamMessageType", (unsigned char *)0)
return (status);
}
int VtZDMParamSenderId (
VtZDMObject zdmObj,
Pointer info,
unsigned int flag
)
{
int status;
VtLibCtx libCtx = (VtLibCtx)0;
VOLT_DECLARE_FNCT_LINE (fnctLine)
VOLT_DECLARE_ERROR_TYPE(errorType)
do
{
if (zdmObj != (VtZDMObject)0)
libCtx = zdmObj->voltObject.libraryCtx;
if ((flag == VOLT_ZDM_SET_TYPE_FLAG) && (info != (Pointer)0) &&
VOLT_OBJECT_TYPE_NOT_EQUAL(info, VOLT_OBJECT_TYPE_IDENTITY))
{
VOLT_SET_FNCT_LINE(fnctLine)
VOLT_SET_ERROR_TYPE(errorType, VT_ERROR_TYPE_PRIMARY)
status = VT_ERROR_INVALID_ASSOCIATED_INFO;
break;
}
VOLT_SET_FNCT_LINE (fnctLine)
VOLT_SET_ERROR_TYPE(errorType, 0)
status = VoltZDMParamCommon (
zdmObj, info, flag, VT_ZDM_SET_SUPPORTED | VT_ZDM_SET_INFO_REQUIRED,
VT_ZDM_PARAM_SENDER_ID);
}
while (0);
VOLT_LOG_ERROR_COMPARE (
status, libCtx, status, errorType,
fnctLine, "VtZDMParamSenderId", (unsigned char *)0)
return (status);
}
int VtZDMParamSenderInfo (
VtZDMObject zdmObj,
Pointer info,
unsigned int flag
)
{
int status;
VtLibCtx libCtx = (VtLibCtx)0;
VtZDMSenderInfo* senderInfo;
VOLT_DECLARE_FNCT_LINE (fnctLine)
VOLT_DECLARE_ERROR_TYPE(errorType)
do
{
if (zdmObj != (VtZDMObject)0)
libCtx = zdmObj->voltObject.libraryCtx;
if ((flag == VOLT_ZDM_SET_TYPE_FLAG) && (info != (Pointer)0))
{
senderInfo = (VtZDMSenderInfo*)info;
status = VT_ERROR_INVALID_ASSOCIATED_INFO;
VOLT_SET_ERROR_TYPE(errorType, VT_ERROR_TYPE_PRIMARY)
VOLT_SET_FNCT_LINE(fnctLine)
if ((senderInfo->privateKey != (VtKeyObject)0) &&
VOLT_OBJECT_TYPE_NOT_EQUAL(senderInfo->privateKey, VOLT_OBJECT_TYPE_KEY))
break;
VOLT_SET_FNCT_LINE(fnctLine)
if ((senderInfo->senderId != (VtIdentityObject)0) &&
VOLT_OBJECT_TYPE_NOT_EQUAL(senderInfo->senderId, VOLT_OBJECT_TYPE_IDENTITY))
break;
VOLT_SET_FNCT_LINE(fnctLine)
if ((senderInfo->signerCert != (VtCertObject)0) &&
VOLT_OBJECT_TYPE_NOT_EQUAL(senderInfo->signerCert, VOLT_OBJECT_TYPE_CERT))
break;
}
VOLT_SET_ERROR_TYPE(errorType, 0)
VOLT_SET_FNCT_LINE (fnctLine)
status = VoltZDMParamCommon (
zdmObj, info, flag, VT_ZDM_SET_SUPPORTED | VT_ZDM_SET_INFO_REQUIRED,
VT_ZDM_PARAM_SENDER_INFO);
}
while (0);
VOLT_LOG_ERROR_COMPARE (
status, libCtx, status, errorType, fnctLine,
"VtZDMParamSenderInfo", (unsigned char *)0)
return (status);
}
int VtZDMParamRecipientList (
VtZDMObject zdmObj,
Pointer info,
unsigned int flag
)
{
int status;
VtLibCtx libCtx = (VtLibCtx)0;
VOLT_DECLARE_FNCT_LINE (fnctLine)
VOLT_DECLARE_ERROR_TYPE(errorType)
do
{
if (zdmObj != (VtZDMObject)0)
libCtx = zdmObj->voltObject.libraryCtx;
if ((flag == VOLT_ZDM_SET_TYPE_FLAG) && (info != (Pointer)0) &&
VOLT_OBJECT_TYPE_NOT_EQUAL(info, VOLT_OBJECT_TYPE_IDENTITY_LIST))
{
VOLT_SET_FNCT_LINE(fnctLine)
VOLT_SET_ERROR_TYPE(errorType, VT_ERROR_TYPE_PRIMARY)
status = VT_ERROR_INVALID_ASSOCIATED_INFO;
break;
}
VOLT_SET_ERROR_TYPE(errorType, 0)
VOLT_SET_FNCT_LINE (fnctLine)
status = VoltZDMParamCommon (
zdmObj, info, flag,
VT_ZDM_GET_AND_SET_SUPPORTED | VT_ZDM_SET_INFO_REQUIRED,
VT_ZDM_PARAM_RECIPIENT_LIST);
}
while (0);
VOLT_LOG_ERROR_COMPARE (
status, libCtx, status, errorType,
fnctLine, "VtZDMParamRecipientList", (unsigned char *)0)
return (status);
}
int VtZDMParamRecipientInfoList (
VtZDMObject zdmObj,
Pointer info,
unsigned int flag
)
{
int status;
VtLibCtx libCtx = (VtLibCtx)0;
VOLT_DECLARE_FNCT_LINE (fnctLine)
VOLT_DECLARE_ERROR_TYPE(errorType)
do
{
if (zdmObj != (VtZDMObject)0)
libCtx = zdmObj->voltObject.libraryCtx;
if ((flag == VOLT_ZDM_SET_TYPE_FLAG) && (info != (Pointer)0) &&
VOLT_OBJECT_TYPE_NOT_EQUAL(info, VOLT_OBJECT_TYPE_RECIP_INFO_LIST))
{
VOLT_SET_FNCT_LINE(fnctLine)
VOLT_SET_ERROR_TYPE(errorType, VT_ERROR_TYPE_PRIMARY)
status = VT_ERROR_INVALID_ASSOCIATED_INFO;
break;
}
VOLT_SET_ERROR_TYPE(errorType, 0)
VOLT_SET_FNCT_LINE (fnctLine)
status = VoltZDMParamCommon (
zdmObj, info, flag,
VT_ZDM_GET_AND_SET_SUPPORTED | VT_ZDM_SET_INFO_REQUIRED,
VT_ZDM_PARAM_RECIPIENT_INFO_LIST);
}
while (0);
VOLT_LOG_ERROR_COMPARE (
status, libCtx, status, errorType,
fnctLine, "VtZDMParamRecipientInfoList", (unsigned char *)0)
return (status);
}
int VtZDMParamAES128CBC (
VtZDMObject zdmObj,
Pointer info,
unsigned int flag
)
{
int status;
VtLibCtx libCtx = (VtLibCtx)0;
VOLT_DECLARE_FNCT_LINE (fnctLine)
if (zdmObj != (VtZDMObject)0)
libCtx = zdmObj->voltObject.libraryCtx;
VOLT_SET_FNCT_LINE (fnctLine)
status = VoltZDMParamCommon (
zdmObj, info, flag, VT_ZDM_SET_SUPPORTED, VT_ZDM_PARAM_AES128CBC);
VOLT_LOG_ERROR_COMPARE (
status, libCtx, status, 0, fnctLine,
"VtZDMParamAES128CBC", (unsigned char *)0)
return (status);
}
int VtZDMParam3DESCBC (
VtZDMObject zdmObj,
Pointer info,
unsigned int flag
)
{
int status;
VtLibCtx libCtx = (VtLibCtx)0;
VOLT_DECLARE_FNCT_LINE (fnctLine)
if (zdmObj != (VtZDMObject)0)
libCtx = zdmObj->voltObject.libraryCtx;
VOLT_SET_FNCT_LINE (fnctLine)
status = VoltZDMParamCommon (
zdmObj, info, flag, VT_ZDM_SET_SUPPORTED, VT_ZDM_PARAM_3DESCBC);
VOLT_LOG_ERROR_COMPARE (
status, libCtx, status, 0, fnctLine,
"VtZDMParam3DESCBC", (unsigned char *)0)
return (status);
}
int VtZDMParamNewLineCharacter (
VtZDMObject zdmObj,
Pointer info,
unsigned int flag
)
{
int status;
VtLibCtx libCtx = (VtLibCtx)0;
unsigned int newLineCharacter;
VOLT_DECLARE_FNCT_LINE (fnctLine)
VOLT_DECLARE_ERROR_TYPE(errorType)
do
{
if (zdmObj != (VtZDMObject)0)
libCtx = zdmObj->voltObject.libraryCtx;
if ((flag == VOLT_ZDM_SET_TYPE_FLAG) && (info != (Pointer)0))
{
newLineCharacter = *(unsigned int*)info;
if ((newLineCharacter != VT_ZDM_NEW_LINE_LF) &&
(newLineCharacter != VT_ZDM_NEW_LINE_CR_LF))
{
VOLT_SET_FNCT_LINE(fnctLine)
VOLT_SET_ERROR_TYPE(errorType, VT_ERROR_TYPE_PRIMARY)
status = VT_ERROR_INVALID_ASSOCIATED_INFO;
break;
}
}
VOLT_SET_ERROR_TYPE(errorType, 0)
VOLT_SET_FNCT_LINE (fnctLine)
status = VoltZDMParamCommon (
zdmObj, info, flag, VT_ZDM_SET_SUPPORTED | VT_ZDM_SET_INFO_REQUIRED,
VT_ZDM_PARAM_NEW_LINE_CHAR);
}
while (0);
VOLT_LOG_ERROR_COMPARE (
status, libCtx, status, errorType,
fnctLine, "VtZDMParamNewLineCharacter", (unsigned char *)0)
return (status);
}
int VtZDMParamDataLen (
VtZDMObject zdmObj,
Pointer info,
unsigned int flag
)
{
int status;
VtLibCtx libCtx = (VtLibCtx)0;
VOLT_DECLARE_FNCT_LINE (fnctLine)
if (zdmObj != (VtZDMObject)0)
libCtx = zdmObj->voltObject.libraryCtx;
VOLT_SET_FNCT_LINE (fnctLine)
status = VoltZDMParamCommon (
zdmObj, info, flag, VT_ZDM_SET_SUPPORTED | VT_ZDM_SET_INFO_REQUIRED,
VT_ZDM_PARAM_DATA_LEN);
VOLT_LOG_ERROR_COMPARE (
status, libCtx, status, 0, fnctLine,
"VtZDMParamDataLen", (unsigned char *)0)
return (status);
}
#if VT_64_BIT_LENGTH == 64
int VtZDMParamDataLen64 (
VtZDMObject zdmObj,
Pointer info,
unsigned int flag
)
{
int status;
VtLibCtx libCtx = (VtLibCtx)0;
VOLT_DECLARE_FNCT_LINE (fnctLine)
if (zdmObj != (VtZDMObject)0)
libCtx = zdmObj->voltObject.libraryCtx;
VOLT_SET_FNCT_LINE (fnctLine)
status = VoltZDMParamCommon (
zdmObj, info, flag, VT_ZDM_SET_SUPPORTED | VT_ZDM_SET_INFO_REQUIRED,
VT_ZDM_PARAM_DATA_LEN_64);
VOLT_LOG_ERROR_COMPARE (
status, libCtx, status, 0, fnctLine,
"VtZDMParamDataLen64", (unsigned char *)0)
return (status);
}
#endif
int VtZDMParamFileName (
VtZDMObject zdmObj,
Pointer info,
unsigned int flag
)
{
int status;
VtLibCtx libCtx = (VtLibCtx)0;
VOLT_DECLARE_FNCT_LINE (fnctLine)
if (zdmObj != (VtZDMObject)0)
libCtx = zdmObj->voltObject.libraryCtx;
VOLT_SET_FNCT_LINE (fnctLine)
status = VoltZDMParamCommon (
zdmObj, info, flag,
VT_ZDM_GET_AND_SET_SUPPORTED | VT_ZDM_SET_INFO_REQUIRED,
VT_ZDM_PARAM_FILE_NAME);
VOLT_LOG_ERROR_COMPARE (
status, libCtx, status, 0, fnctLine,
"VtZDMParamFileName", (unsigned char *)0)
return (status);
}
int VtZDMParamRecipientIndex (
VtZDMObject zdmObj,
Pointer info,
unsigned int flag
)
{
int status;
VtLibCtx libCtx = (VtLibCtx)0;
VOLT_DECLARE_FNCT_LINE (fnctLine)
if (zdmObj != (VtZDMObject)0)
libCtx = zdmObj->voltObject.libraryCtx;
VOLT_SET_FNCT_LINE (fnctLine)
status = VoltZDMParamCommon (
zdmObj, info, flag, VT_ZDM_SET_SUPPORTED | VT_ZDM_SET_INFO_REQUIRED,
VT_ZDM_PARAM_RECIPIENT_INDEX);
VOLT_LOG_ERROR_COMPARE (
status, libCtx, status, 0, fnctLine,
"VtZDMParamRecipientIndex", (unsigned char *)0)
return (status);
}
int VtZDMParamSignerList (
VtZDMObject zdmObj,
Pointer info,
unsigned int flag
)
{
int status;
VtLibCtx libCtx = (VtLibCtx)0;
VOLT_DECLARE_FNCT_LINE (fnctLine)
if (zdmObj != (VtZDMObject)0)
libCtx = zdmObj->voltObject.libraryCtx;
VOLT_SET_FNCT_LINE (fnctLine)
status = VoltZDMParamCommon (
zdmObj, info, flag, VT_ZDM_GET_SUPPORTED, VT_ZDM_PARAM_SIGNER_LIST);
VOLT_LOG_ERROR_COMPARE (
status, libCtx, status, 0, fnctLine,
"VtZDMParamSignerList", (unsigned char *)0)
return (status);
}
int VtZDMParamContentType (
VtZDMObject zdmObj,
Pointer info,
unsigned int flag
)
{
int status;
VtLibCtx libCtx = (VtLibCtx)0;
VOLT_DECLARE_FNCT_LINE (fnctLine)
if (zdmObj != (VtZDMObject)0)
libCtx = zdmObj->voltObject.libraryCtx;
VOLT_SET_FNCT_LINE (fnctLine)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -