[Solved] How to sign a document via UNO

The Application Programming Interface and the OASIS Open Document Format

[Solved] How to sign a document via UNO

Postby alex_lip » Tue Aug 05, 2014 2:37 pm

How to sign a document via UNO ??
Last edited by alex_lip on Fri Aug 08, 2014 8:35 am, edited 1 time in total.
OpenOffice 3.4 on Windows XP
alex_lip
 
Posts: 4
Joined: Tue Aug 05, 2014 7:34 am

Re: How to sign a document via UNO

Postby Villeroy » Tue Aug 05, 2014 2:57 pm

Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04, no OpenOffice, LibreOffice 6.4
User avatar
Villeroy
Volunteer
 
Posts: 28149
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: How to sign a document via UNO

Postby hanya » Thu Aug 07, 2014 2:41 pm

If you call methods from com.sun.star.security.XDocumentDigitalSignatures to sign to some document, Digital Sign dialog is opened. So it seems no way to do it without GUI.
Please, edit this thread's initial post and add "[Solved]" to the subject line if your problem has been solved.
Apache OpenOffice 4-dev on Xubuntu 14.04
hanya
Volunteer
 
Posts: 885
Joined: Fri Nov 23, 2007 9:27 am
Location: Japan

Re: How to sign a document via UNO

Postby alex_lip » Fri Aug 08, 2014 7:58 am

Not work (( Error in last row.
Code: Select all   Expand viewCollapse view
sub sign_doc
sFileURL = "c:\0_foxpro_oo\test.odt"
   
  sf = CreateUnoService("com.sun.star.embed.StorageFactory")
  oDocStorage = sf.createInstanceWithArguments(Array(sFileURL, 4))
  oDDS = CreateUnoServiceWithArguments("com.sun.star.security.DocumentDigitalSignatures", _
             Array("1.2", True))
oDDS.signDocumentContent(oDocStorage, Null)
   
end sub

OpenOffice 3.4 on Windows XP
alex_lip
 
Posts: 4
Joined: Tue Aug 05, 2014 7:34 am

Re: How to sign a document via UNO

Postby alex_lip » Fri Aug 08, 2014 8:02 am

Work only with property ((((
Code: Select all   Expand viewCollapse view
sub sign_doc
sFileURL = "c:\0_foxpro_oo\test.odt"
  Dim aProps(0) as new com.sun.star.beans.PropertyValue
  aProps(0).Name = "StorageFormat"
  aProps(0).Value = "ZipFormat"
 
  sf = CreateUnoService("com.sun.star.embed.StorageFactory")
  oDocStorage = sf.createInstanceWithArguments(Array(sFileURL, 4,  aProps))
  oDDS = CreateUnoServiceWithArguments("com.sun.star.security.DocumentDigitalSignatures", _
             Array("1.2", True))
oDDS.signDocumentContent(oDocStorage, Null)

end sub

OpenOffice 3.4 on Windows XP
alex_lip
 
Posts: 4
Joined: Tue Aug 05, 2014 7:34 am


Return to UNO API and ODF

Who is online

Users browsing this forum: No registered users and 1 guest