summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Burow <pb@openoffice.org>2004-08-20 07:41:20 +0000
committerPeter Burow <pb@openoffice.org>2004-08-20 07:41:20 +0000
commit7efb68197eaedf736e2d41cbf33ba2c701e00dce (patch)
tree4b3e4c810ad88c52d0bae111ac477e35eaad9c92
parent85a1abd8b1dfaac7b0f87c2ab49f069a842ff1d5 (diff)
fix: #i33090# isLocationTrusted() implemented
-rw-r--r--xmlsecurity/source/component/documentdigitalsignatures.cxx30
1 files changed, 24 insertions, 6 deletions
diff --git a/xmlsecurity/source/component/documentdigitalsignatures.cxx b/xmlsecurity/source/component/documentdigitalsignatures.cxx
index 5d1358999015..beb01f2a74f6 100644
--- a/xmlsecurity/source/component/documentdigitalsignatures.cxx
+++ b/xmlsecurity/source/component/documentdigitalsignatures.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: documentdigitalsignatures.cxx,v $
*
- * $Revision: 1.13 $
+ * $Revision: 1.14 $
*
- * last change: $Author: mmi $ $Date: 2004-08-12 02:29:20 $
+ * last change: $Author: pb $ $Date: 2004-08-20 08:41:20 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -75,16 +75,16 @@
#ifndef _COM_SUN_STAR_EMBED_ELEMENTMODES_HPP_
#include <com/sun/star/embed/ElementModes.hpp>
#endif
+#ifndef _URLOBJ_HXX
+#include <tools/urlobj.hxx>
+#endif
#ifndef INCLUDED_SVTOOLS_SECURITYOPTIONS_HXX
#include <svtools/securityoptions.hxx>
#endif
-
-
using namespace ::com::sun::star;
using namespace ::com::sun::star;
-
DocumentDigitalSignatures::DocumentDigitalSignatures( const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory> rxMSF )
{
mxMSF = rxMSF;
@@ -239,7 +239,25 @@ void DocumentDigitalSignatures::ShowCertificate( const ::com::sun::star::uno::Re
::sal_Bool DocumentDigitalSignatures::isLocationTrusted( const ::rtl::OUString& Location ) throw (::com::sun::star::uno::RuntimeException)
{
- return sal_False;
+ sal_Bool bFound = sal_False;
+ INetURLObject aLocObj( Location );
+
+ SvtSecurityOptions aSecOpt;
+ ::com::sun::star::uno::Sequence< ::rtl::OUString > aSecURLs = aSecOpt.GetSecureURLs();
+ sal_Int32 nCnt = aSecURLs.getLength();
+ const ::rtl::OUString* pSecURLs = aSecURLs.getConstArray();
+ const ::rtl::OUString* pSecURLsEnd = pSecURLs + aSecURLs.getLength();
+ for ( ; pSecURLs != pSecURLsEnd; ++pSecURLs )
+ {
+ INetURLObject aSecURL( *pSecURLs );
+ if ( aSecURL == aLocObj )
+ {
+ bFound = sal_True;
+ break;
+ }
+ }
+
+ return bFound;
}
void DocumentDigitalSignatures::addAuthorToTrustedSources( const ::com::sun::star::uno::Reference< ::com::sun::star::security::XCertificate >& Author ) throw (::com::sun::star::uno::RuntimeException)