ValidateSignatureAndWriteValue 方法示例

下列示例创建ESignature对象,检查节点是否启用了电子签名,并确定指定的标签(FIX32.thisnode.D01.F_CV)是否需要电子签名。如有需要,示例会验证签名,写入新值,并向审计跟踪发送一条消息。

Dim ESig As Object

Dim bNodeSignEnabled As Boolean

Dim bSigRequired As Boolean

Dim bVerify As Boolean

Dim bContinuousUse As Boolean

Dim nInfo As Integer

Dim NewValue As Variant

'创建 ESignature 对象

Set ESig = CreateObject("ElectronicSignature.ESignatureFactory")

'检查节点是否启用了电子签名

ESig.IsNodeSignEnabled bNodeSignEnabled

If bNodeSignEnabled = True Then

'检查标签是否要求电子签名

ESig.Initialize "Fix32.thisnode.DO1.F_CV"

ESig.IsSignatureRequired 0, bSigRequired, nInfo, bVerify, bContinuousUse

If bSigRequired = True Then

'验证签名,写入新值并向审计跟踪发送一条消息

NewValue = 1

If bVerify = False Then

ESig.ValidateSignatureAndWriteValue 0, NewValue, "admin", "admin", "Perform Comment Example"

Else

ESig.ValidateSignatureAndWriteValue 0, NewValue, "admin", "admin", "Perform Comment Example", "supervisor1", "GEF", "Verify Comment Example"

End If

Else

MsgBox "Signature is not required for this tag."

End If

Else

MsgBox "Signature is not enabled on this node."

End If

 

示例

应用到

您最近了解过 iFIX 吗 ?

查看最新版 iFIX 的所有新功能。

让 iFIX 帮助您提高效率,降低成本。