Difference between revisions of "Certificate Detection"

From Apache OpenOffice Wiki
Jump to: navigation, search
 
m
Line 64: Line 64:
 
End Sub
 
End Sub
 
</pre>
 
</pre>
 +
 +
Launching this code gives all the information you need to modify the environment variable MOZILLA_CERTIFICATE_FOLDER :
 +
[[Image:DigitalSignature.png]]
 +
If you want to choose FireFox lanch
 +
<pre>
 +
export MOZILLA_CERTIFICATE_FOLDER=~/.mozilla/firefox/u1f6p56r.default
 +
</pre>
 +
before lanching OOo or modify the soffice.sh file.

Revision as of 16:02, 31 July 2006

On Windows, OOo will use certificates from the personal key store.

On all other platforms, OOo detects the default mozilla profile.

Detection order is 1) Thunderbird 2) Mozilla 3) Firefox 4) Default (what ever that means...)

Unfortunately, there is no option to choose an other profile, but the location can be overwritten with the environment variable MOZILLA_CERTIFICATE_FOLDER

You can check the detection with this small basic script:

Option Explicit

Sub MozProfile
	Dim oMozBootstrap as Object
	Dim sMsg as String
	Dim sDefault as String

	oMozBootstrap = createUnoService( "com.sun.star.mozilla.MozillaBootstrap" )
	
	sMsg = "OpenOffice.org Mozilla Profile Detection" + Chr$(10) + Chr$(10)
	CheckMozProfile( oMozBootstrap, "Thunderbird", com.sun.star.mozilla.MozillaProductType.Thunderbird, sMsg, sDefault )
	sMsg = sMsg + Chr$(10)
	CheckMozProfile( oMozBootstrap, "Mozilla", com.sun.star.mozilla.MozillaProductType.Mozilla, sMsg, sDefault )
	sMsg = sMsg + Chr$(10)
	CheckMozProfile( oMozBootstrap, "Firefox", com.sun.star.mozilla.MozillaProductType.Firefox, sMsg, sDefault )
	sMsg = sMsg + Chr$(10)
	CheckMozProfile( oMozBootstrap, "Default", com.sun.star.mozilla.MozillaProductType.Default, sMsg, sDefault )
	sMsg = sMsg + Chr$(10)
	sMsg = sMsg + "The first detected path will be used for certificates:" + Chr$(10)
	if Len( sDefault ) > 0 Then
		sMsg = sMsg + sDefault
	else
		sMsg = sMsg + "No profile found!"
	end if
	sMsg = sMsg + Chr$(10) + Chr$(10) + "You can overwrite the path with environment variable MOZILLA_CERTIFICATE_FOLDER" + Chr$(10) + " "
	
	
	MsgBox sMsg,64

End Sub

Sub CheckMozProfile( oMozBootstrap, TypeName, TypeID, sMsg, sDefault )
	Dim sProfile as String
	Dim sPath as String

	sMsg = sMsg + TypeName + ":" + Chr$(10) + "Profile name: "
	sProfile = 	oMozBootstrap.getDefaultProfile(TypeID)
	if Len( sProfile ) > 0 Then
		sMsg = sMsg + sProfile
		sPath = oMozBootstrap.getProfilePath(TypeID, sProfile )
		sMsg = sMsg + Chr$(10) + "Profile path: " + sPath + Chr$(10)
		if Len( sDefault ) = 0 Then
			sDefault = sPath
		end if
		
	else
		sMsg = sMsg + "NOT FOUND" + Chr$(10)
	endif
End Sub

Launching this code gives all the information you need to modify the environment variable MOZILLA_CERTIFICATE_FOLDER : DigitalSignature.png If you want to choose FireFox lanch

export MOZILLA_CERTIFICATE_FOLDER=~/.mozilla/firefox/u1f6p56r.default

before lanching OOo or modify the soffice.sh file.

Personal tools