Jump to content

How to get the digital signature details programatically


Recommended Posts

Posted

Hi

 

In my drawing , one digital signature is attached.I need to get all the details of the signature poragmatically.ie. algorithm, issuer, key, comment etc.

Is there any method or property available. If so, please help me.

 

Waiting for your reply

 

 

Regards

Dominic Abraham

Posted

This should point you in the right direction:

 

(defun getSec (/ sec)
 (vl-load-com)
 (setq sec
   (vla-getInterfaceObject
     (vlax-get-acad-object)
       (if (< (setq acVer (atoi (getvar "ACADVER"))) 16)
         "AutoCAD.SecurityParams"
           (strcat "AutoCAD.SecurityParams." (itoa acVer)))))
 (vlax-dump-object sec t)
 (vlax-release-object sec)
 (princ))

Posted

Hi ..

 

Thank you for your reply.Is there any VBA scripts or C# code, so that i can easily understand.

 

 

 

 

Regards

Dominic

Posted

I'm not so good at VBA...

 

This may help, from the developer help:

 

Sub Example_Algorithm ()
       ' This example encrypts and saves a file.

       Dim acad As New AcadApplication
       Dim sp As New AcadSecurityParams

       acad.Visible = True
       sp.Action = AcadSecurityParamsType.ACADSECURITYPARAMS_ENCRYPT_DATA 
       sp.Algorithm = AcadSecurityParamsConstants.ACADSECURITYPARAMS_ALGID_RC4
       sp.KeyLength = 40
       sp.Password = UCase("mypassword") 'AutoCAD converts all passwords to uppercase before applying them
       sp.ProviderName = "Microsoft Base Cryptographic Provider v1.0"
       sp.ProviderType = 1

       acad.ActiveDocument.SaveAs "C:\MyDrawing.dwg", , sp
   
End Sub

Posted

Hi..

 

My intention is that, i open and save an autocad file[having signatures attached] programatically. But i don't want to drop the signatures. I need to keep that signatures.I know it is not the right way. But see my scenario.

 

My scenario is like:-

 

[My drawing has 2 or more child drawing, while trying to view the main document, i need to reset the external reference path.i am not making any changes for drawing. So while saving after this, my signature getting invalid. I cant avoid this saving operation while viewing the document.The viewing operation may be doing from the other machine]

 

Is there any solution for this.

 

NB:- I asked the previous question, because i thought that, if i am getting attached signature details, i can attach it again programatically.

 

Please help me to solve this issue:-

Posted

Hi ...

 

No Responses !!!!!!!!!!!!!!!!!!!!!!!:(

 

 

Regards

Dominic

Posted

Dominic, if you don't get a good answer here regarding VBA, try over at TheSwamp.org they have a whole forum dedicated to VBA. :thumbsup:

Posted

Digital signatures are serious business. I suspect that the ability to open a drawing, modify some detail (regardless of how irrelevant it may seem), and then resaving with the previous digital signature intact would be of major concern to some AutoCAD customers; hence, to the AutoCAD developers.

 

I’d guess that it is not possible due to the signatures time stamp (likely used during signature encryption) linked with the OS’s Date Modified stamp.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...