CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

ActiveX 开发指南

相关分类

时间服务器属性 (ActiveX)

2023-1-3 03:20| 发布者: admin| 查看: 188| 评论: 0|来自: AutoCAD

摘要: 指定要用于数字签名的时间服务器的名称。

指定要用于数字签名的时间服务器的名称。

支持的平台:仅窗口

签名

工 务 局:

object.TimeServer
对象

类型:安全参数

此属性适用的对象。

属性值

只读:

类型:字符串

要用于数字签名的时间服务器的名称。

言论

如果未设置此属性,则本地计算机的时间将用作数字签名的时间戳。

例子

工 务 局:

Sub Example_TimeServer()
    ' This example attaches a digital signature and accompanying data to a file,
    ' and saves the file.

    Dim sp As AcadSecurityParams
    Set sp = GetInterfaceObject("AutoCAD.SecurityParams." + Left(AcadApplication.Version, 2))
    
    ' Attach a digital signature and timestamp it
    sp.Action = AcadSecurityParamsType.ACADSECURITYPARAMS_SIGN_DATA _
                + AcadSecurityParamsType.ACADSECURITYPARAMS_ADD_TIMESTAMP
    
    ' Certificate details follow
    sp.Subject = "Thawte Freemail Member"
    sp.Issuer = "Personal Freemail RSA 2000.8.30"
    sp.SerialNumber = "073848"
    sp.Comment = "This is now signed"
    sp.TimeServer = "NIST(time.nist.gov)"
    ' To set the TimeServer property, use a description followed by the Internet address in parentheses
    
    ThisDrawing.SaveAs "C:\MyDrawing.dwg", , sp
End Sub

Visual LISP:

(vl-load-com)
(defun c:Example_TimeServer()
    ;; This example attaches a digital signature and accompanying data to a file,
    ;; and saves the file.
    (setq acadObj (vlax-get-acad-object))
    (setq sp (vlax-create-object (strcat "AutoCAD.SecurityParams." (substr (getvar "ACADVER") 1 2))))
  
    (vla-put-Visible acadObj :vlax-true)
    
    ;; Attach a digital signature and timestamp it
    (vla-put-Action sp (+ ACADSECURITYPARAMS_SIGN_DATA ACADSECURITYPARAMS_ADD_TIMESTAMP))
    
    ;; Certificate details follow
    (vla-put-Subject sp "Thawte Freemail Member")
    (vla-put-Issuer sp "Personal Freemail RSA 2000.8.30")
    (vla-put-SerialNumber sp "073848")
    (vla-put-Comment sp "This is now signed")
    (vla-put-TimeServer sp "NIST(time.nist.gov)")
    ;; To set the TimeServer property, use a description followed by the Internet address in parentheses

    (setq doc (vla-get-ActiveDocument acadObj))
    (vla-SaveAs doc "C:\\MyDrawing.dwg" acNative sp)
  
    (vlax-release-object sp)
)

路过

雷人

握手

鲜花

鸡蛋

最新评论

QQ|Archiver|CAD开发者社区 ( 苏ICP备2022047690号-1 )

GMT+8, 2024-5-11 21:30

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部