| View previous topic :: View next topic |
| Author |
Message |
SergeM Super User

Joined: 09 Sep 2003 Posts: 3211 Location: Troyes France
|
|
| Back to top |
|
 |
SergeM Super User

Joined: 09 Sep 2003 Posts: 3211 Location: Troyes France
|
Posted: Wed Aug 02, 2006 10:04 am Post subject: |
|
|
For completion of previous post you can also find in OpenOffice Wiki, an article on digital signature :
How to use digital Signatures [url]http://wiki.services.openoffice.org/wiki/How_to_use_digital_Signatures [/url]
I am not sure i will use digital signature architecture because I don't really trust it. Under Windows and under Linux when I sign a document the OS doesn't ask me for a password and I don't like that ! That means only user account passwords are protection : if you are logged and not in front of your computer, every body can sign for you. For me it's a weakness (for OS not for OOo).
It would be great if anybody can confirm or infirm that : perhaps my certificate is not good !
Certificate management by OS or Firefox is weak as I said, but what about OOo ? I absolutly don't like management with the MOZILLA_CERTIFICATE_FOLDER environment variable under Linux. Do you know how I manage it at the first time ? I change the script <OOo2.0>/program/soffice to export this variable. This was the weaker thing I can do ! Now everybody with an account on my computer can sign for me !!! Of course I can manage it an other way but it's the first idea I have and I don't see why other could not have the same idea.
I have written code in OOoBAsic but I never obtain the certificate with this code and I don't know why. Because I don't want to go further with this API I give this code :
| Code: |
Sub DigitalSign
oDocumentDigitalSignatures = createUnoService( "com.sun.star.security.DocumentDigitalSignatures" )
print oDocumentDigitalSignatures.getDocumentContentSignatureDefaultStreamName
'prints out : documentsignatures.xml
print oDocumentDigitalSignatures.getScriptingContentSignatureDefaultStreamName
'prints out : macrosignatures.xml
print oDocumentDigitalSignatures.getPackageSignatureDefaultStreamName
'prints out : packagesignatures.xml
Dim xXMLSecurityContext as object
xXMLSecurityContext = createUnoService( "com.sun.star.xml.crypto.XMLSecurityContext" )
'WritedbgInfo( oDocumentDigitalSignatures)
Dim Env as object
'Doesn't work : Env = xXMLSecurityContext. getSecurityEnvironment
print xXMLSecurityContext.getImplementationName
'prints out com.sun.star.xml.security.bridge.xmlsec.XMLSecurityContext_MSCryptImpl under Windows
'prints out com.sun.star.xml.security.bridge.xmlsec.XMLSecurityContext_NssImpl under Linux
Dim xSecurityEnvironment as Object
xSecurityEnvironment = createUnoService( "com.sun.star.xml.crypto.SecurityEnvironment" )
print xSecurityEnvironment.getSecurityEnvironmentInformation
'prints out Microsoft Crypto API
'prints out Unknown Token under Linux !
Dim i as Integer
'Dim asObject
Dim Certificates() as Object
Certificates() = xSecurityEnvironment.getPersonalCertificates()
print Lbound(Certificates()
'prints out 0 means O certificate !
'For i = 0 To lbound(Certificates())
Dim Certificat as Object
Certificat=Certificates(0)
'WritedbgInfo(xXMLSecurityContext)
End sub
|
_________________ Linux & Windows OOo3.0
UNO & C++ : WIKI
http://wiki.services.openoffice.org/wiki/Using_Cpp_with_the_OOo_SDK
In French
http://wiki.services.openoffice.org/wiki/Documentation/FR/Cpp_Guide |
|
| Back to top |
|
 |
|