diff options
Diffstat (limited to 'xmlsecurity')
688 files changed, 60472 insertions, 0 deletions
diff --git a/xmlsecurity/doc/OpenDocumentSignatures-TestIntegration.sxw b/xmlsecurity/doc/OpenDocumentSignatures-TestIntegration.sxw Binary files differnew file mode 100644 index 000000000000..2973f08c8d8a --- /dev/null +++ b/xmlsecurity/doc/OpenDocumentSignatures-TestIntegration.sxw diff --git a/xmlsecurity/doc/OpenDocumentSignatures-Workflow.sxd b/xmlsecurity/doc/OpenDocumentSignatures-Workflow.sxd Binary files differnew file mode 100644 index 000000000000..abc5f32c6151 --- /dev/null +++ b/xmlsecurity/doc/OpenDocumentSignatures-Workflow.sxd diff --git a/xmlsecurity/doc/OpenDocumentSignatures.sxw b/xmlsecurity/doc/OpenDocumentSignatures.sxw Binary files differnew file mode 100644 index 000000000000..9b453e0d8a92 --- /dev/null +++ b/xmlsecurity/doc/OpenDocumentSignatures.sxw diff --git a/xmlsecurity/doc/XMLSecurityFramework.sxw b/xmlsecurity/doc/XMLSecurityFramework.sxw Binary files differnew file mode 100644 index 000000000000..c778e1c1ecd3 --- /dev/null +++ b/xmlsecurity/doc/XMLSecurityFramework.sxw diff --git a/xmlsecurity/inc/makefile.mk b/xmlsecurity/inc/makefile.mk new file mode 100644 index 000000000000..e3ee4509ae73 --- /dev/null +++ b/xmlsecurity/inc/makefile.mk @@ -0,0 +1,47 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2000, 2010 Oracle and/or its affiliates. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# This file is part of OpenOffice.org. +# +# OpenOffice.org is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License version 3 +# only, as published by the Free Software Foundation. +# +# OpenOffice.org is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License version 3 for more details +# (a copy is included in the LICENSE file that accompanied this code). +# +# You should have received a copy of the GNU Lesser General Public License +# version 3 along with OpenOffice.org. If not, see +# <http://www.openoffice.org/license.html> +# for a copy of the LGPLv3 License. +# +#************************************************************************* +PRJ=.. + +PRJNAME=xmlsecurity +TARGET=inc + +# --- Settings ----------------------------------------------------- + +.INCLUDE : settings.mk + +# --- Files -------------------------------------------------------- +# --- Targets ------------------------------------------------------- + +.INCLUDE : target.mk + +.IF "$(ENABLE_PCH)"!="" +ALLTAR : \ + $(SLO)$/precompiled.pch \ + $(SLO)$/precompiled_ex.pch + +.ENDIF # "$(ENABLE_PCH)"!="" + diff --git a/xmlsecurity/inc/pch/precompiled_xmlsecurity.cxx b/xmlsecurity/inc/pch/precompiled_xmlsecurity.cxx new file mode 100644 index 000000000000..42b0254306c2 --- /dev/null +++ b/xmlsecurity/inc/pch/precompiled_xmlsecurity.cxx @@ -0,0 +1,29 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "precompiled_xmlsecurity.hxx" + diff --git a/xmlsecurity/inc/pch/precompiled_xmlsecurity.hxx b/xmlsecurity/inc/pch/precompiled_xmlsecurity.hxx new file mode 100644 index 000000000000..f2701c727e99 --- /dev/null +++ b/xmlsecurity/inc/pch/precompiled_xmlsecurity.hxx @@ -0,0 +1,32 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): Generated on 2006-09-01 17:50:21.795105 + +#ifdef PRECOMPILED_HEADERS +#endif + diff --git a/xmlsecurity/inc/xmlsecurity/biginteger.hxx b/xmlsecurity/inc/xmlsecurity/biginteger.hxx new file mode 100644 index 000000000000..b77c7c3bb8c6 --- /dev/null +++ b/xmlsecurity/inc/xmlsecurity/biginteger.hxx @@ -0,0 +1,43 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _XMLSECURITY_BIGINTEGER_HXX +#define _XMLSECURITY_BIGINTEGER_HXX + +#include <sal/config.h> +#include <rtl/ustring.hxx> + +#ifndef _COM_SUN_STAR_UNO_REFERENCE_HPP_ +#include <com/sun/star/uno/Reference.hxx> +#endif +#include "com/sun/star/uno/Sequence.h" + +rtl::OUString bigIntegerToNumericString( ::com::sun::star::uno::Sequence< sal_Int8 > serial ); +::com::sun::star::uno::Sequence< sal_Int8 > numericStringToBigInteger ( rtl::OUString serialNumber ); + +#endif + diff --git a/xmlsecurity/inc/xmlsecurity/certificatechooser.hxx b/xmlsecurity/inc/xmlsecurity/certificatechooser.hxx new file mode 100644 index 000000000000..fa259cadc647 --- /dev/null +++ b/xmlsecurity/inc/xmlsecurity/certificatechooser.hxx @@ -0,0 +1,94 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _XMLSECURITY_CERTIFICATECHOOSER_HXX +#define _XMLSECURITY_CERTIFICATECHOOSER_HXX + +#include <vcl/dialog.hxx> +#include <vcl/fixed.hxx> +#include <vcl/button.hxx> +#include <svx/simptabl.hxx> + +namespace com { +namespace sun { +namespace star { +namespace security { + class XCertificate; } +namespace xml { namespace crypto { + class XSecurityEnvironment; }} +}}} + +#include <com/sun/star/uno/Sequence.hxx> +#include <xmlsecurity/sigstruct.hxx> + +namespace css = com::sun::star; +namespace cssu = com::sun::star::uno; +namespace dcss = ::com::sun::star; + +class HeaderBar; + +class CertificateChooser : public ModalDialog +{ +private: + cssu::Reference< cssu::XComponentContext > mxCtx; + cssu::Reference< dcss::xml::crypto::XSecurityEnvironment > mxSecurityEnvironment; + cssu::Sequence< cssu::Reference< dcss::security::XCertificate > > maCerts; + SignatureInformations maCertsToIgnore; + + FixedText maHintFT; + SvxSimpleTable maCertLB; // PB 2006/02/02 #i48648 now SvHeaderTabListBox + + PushButton maViewBtn; + + FixedLine maBottomSepFL; + OKButton maOKBtn; + CancelButton maCancelBtn; + HelpButton maHelpBtn; + + sal_Bool mbInitialized; + + sal_uInt16 GetSelectedEntryPos( void ) const; +// DECL_LINK( Initialize, void* ); + DECL_LINK( ViewButtonHdl, Button* ); + DECL_LINK( CertificateHighlightHdl, void* ); + DECL_LINK( CertificateSelectHdl, void* ); + + void ImplShowCertificateDetails(); + void ImplInitialize(); + +public: + CertificateChooser( Window* pParent, cssu::Reference< cssu::XComponentContext>& rxCtx, cssu::Reference< dcss::xml::crypto::XSecurityEnvironment >& rxSecurityEnvironment, const SignatureInformations& rCertsToIgnore ); + ~CertificateChooser(); + + short Execute(); + + cssu::Reference< dcss::security::XCertificate > GetSelectedCertificate(); + +}; + +#endif // _XMLSECURITY_CERTIFICATECHOOSER_HXX + diff --git a/xmlsecurity/inc/xmlsecurity/certificateviewer.hxx b/xmlsecurity/inc/xmlsecurity/certificateviewer.hxx new file mode 100644 index 000000000000..622a912e788e --- /dev/null +++ b/xmlsecurity/inc/xmlsecurity/certificateviewer.hxx @@ -0,0 +1,165 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _XMLSECURITY_CERTIFICATEVIEWER_HXX +#define _XMLSECURITY_CERTIFICATEVIEWER_HXX + +#include <vcl/fixed.hxx> +#include <vcl/button.hxx> +#include <vcl/lstbox.hxx> +#include <vcl/tabdlg.hxx> +#include <vcl/tabctrl.hxx> +#include <vcl/tabpage.hxx> +#include <svtools/stdctrl.hxx> +#include <svx/simptabl.hxx> +#include <svtools/svmedit.hxx> + +namespace com { +namespace sun { +namespace star { +namespace security { + class XCertificate; } +namespace xml { namespace crypto { + class XSecurityEnvironment; }} +}}} + +namespace css = com::sun::star; +namespace cssu = com::sun::star::uno; +namespace dcss = ::com::sun::star; + +class CertificateViewer : public TabDialog +{ +private: + friend class CertificateViewerGeneralTP; + friend class CertificateViewerDetailsTP; + friend class CertificateViewerCertPathTP; + + TabControl maTabCtrl; + OKButton maOkBtn; + HelpButton maHelpBtn; + + sal_Bool mbCheckForPrivateKey; + + cssu::Reference< dcss::xml::crypto::XSecurityEnvironment > mxSecurityEnvironment; + cssu::Reference< dcss::security::XCertificate > mxCert; +public: + CertificateViewer( Window* pParent, const cssu::Reference< dcss::xml::crypto::XSecurityEnvironment >& rxSecurityEnvironment, const cssu::Reference< dcss::security::XCertificate >& rXCert, sal_Bool bCheckForPrivateKey ); + virtual ~CertificateViewer(); +}; + + +class CertificateViewerTP : public TabPage +{ +protected: + CertificateViewer* mpDlg; +public: + CertificateViewerTP( Window* _pParent, const ResId& _rResId, CertificateViewer* _pDlg ); + inline void SetTabDlg( CertificateViewer* pTabDlg ); +}; + +inline void CertificateViewerTP::SetTabDlg( CertificateViewer* _pTabDlg ) +{ + mpDlg = _pTabDlg; +} + + +class CertificateViewerGeneralTP : public CertificateViewerTP +{ +private: + Window maFrameWin; + FixedImage maCertImg; + FixedInfo maCertInfoFI; + FixedLine maSep1FL; + FixedInfo maHintNotTrustedFI; + FixedLine maSep2FL; + FixedInfo maIssuedToLabelFI; + FixedInfo maIssuedToFI; + FixedInfo maIssuedByLabelFI; + FixedInfo maIssuedByFI; + FixedInfo maValidDateFI; + FixedImage maKeyImg; + FixedInfo maHintCorrespPrivKeyFI; +public: + CertificateViewerGeneralTP( Window* pParent, CertificateViewer* _pDlg ); + + virtual void ActivatePage(); +}; + + +class CertificateViewerDetailsTP : public CertificateViewerTP +{ +private: + SvxSimpleTable maElementsLB; // PB 2006/02/02 #i48648 now SvHeaderTabListBox + MultiLineEdit maElementML; + Font maStdFont; + Font maFixedWidthFont; + + DECL_LINK( ElementSelectHdl, void* ); + void Clear( void ); + void InsertElement( const String& _rField, const String& _rValue, + const String& _rDetails, bool _bFixedWidthFont = false ); +public: + CertificateViewerDetailsTP( Window* pParent, CertificateViewer* _pDlg ); + virtual ~CertificateViewerDetailsTP(); + + virtual void ActivatePage(); +}; + + +class CertificateViewerCertPathTP : public CertificateViewerTP +{ +private: + FixedText maCertPathFT; + SvTreeListBox maCertPathLB; + PushButton maViewCertPB; + FixedText maCertStatusFT; + MultiLineEdit maCertStatusML; + + CertificateViewer* mpParent; + bool mbFirstActivateDone; + Image maCertImage; + Image maCertNotValidatedImage; + String msCertOK; + String msCertNotValidated; + + DECL_LINK( ViewCertHdl, void* ); + DECL_LINK( CertSelectHdl, void* ); + void Clear( void ); + SvLBoxEntry* InsertCert( SvLBoxEntry* _pParent, const String& _rName, + cssu::Reference< dcss::security::XCertificate > rxCert, + bool bValid); + +public: + CertificateViewerCertPathTP( Window* pParent, CertificateViewer* _pDlg ); + virtual ~CertificateViewerCertPathTP(); + + virtual void ActivatePage(); +}; + + +#endif // _XMLSECURITY_CERTIFICATEVIEWER_HXX + diff --git a/xmlsecurity/inc/xmlsecurity/certvalidity.hxx b/xmlsecurity/inc/xmlsecurity/certvalidity.hxx new file mode 100644 index 000000000000..20fb05579029 --- /dev/null +++ b/xmlsecurity/inc/xmlsecurity/certvalidity.hxx @@ -0,0 +1,37 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _XMLSECURITY_BIGINTEGER_HXX +#define _XMLSECURITY_BIGINTEGER_HXX + +#include <sal/config.h> +#include <rtl/ustring.hxx> + +rtl::OUString certificateValidityToOUString( ::sal_Int32 certValidity ) ; + +#endif + diff --git a/xmlsecurity/inc/xmlsecurity/digitalsignaturesdialog.hxx b/xmlsecurity/inc/xmlsecurity/digitalsignaturesdialog.hxx new file mode 100644 index 000000000000..d40f2ebf4a12 --- /dev/null +++ b/xmlsecurity/inc/xmlsecurity/digitalsignaturesdialog.hxx @@ -0,0 +1,150 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _XMLSECURITY_DIGITALSIGNATURESDIALOG_HXX +#define _XMLSECURITY_DIGITALSIGNATURESDIALOG_HXX + +#include <vcl/dialog.hxx> +#include <vcl/fixed.hxx> +#include <vcl/button.hxx> +#include <svtools/stdctrl.hxx> +#include <svx/simptabl.hxx> +#include <com/sun/star/beans/PropertyValue.hpp> + +#include <xmlsecurity/documentsignaturehelper.hxx> +#include <xmlsecurity/xmlsignaturehelper.hxx> + + +#ifndef _STLP_VECTOR +#include <vector> +#endif + +namespace com { +namespace sun { +namespace star { +namespace lang { + class XMultiServiceFactory; } +namespace io { + class XStream; } +namespace embed { + class XStorage; } +namespace xml { namespace dom { + class XDocumentBuilder; } } +}}} + +namespace css = com::sun::star; +namespace cssu = com::sun::star::uno; + +class HeaderBar; + +class DigitalSignaturesDialog : public ModalDialog +{ +private: + cssu::Reference< cssu::XComponentContext >& mxCtx; + XMLSignatureHelper maSignatureHelper; + + css::uno::Reference < css::embed::XStorage > mxStore; + css::uno::Reference < css::io::XStream > mxSignatureStream; + css::uno::Reference < css::io::XStream > mxTempSignatureStream; + SignatureInformations maCurrentSignatureInformations; + bool mbVerifySignatures; + bool mbSignaturesChanged; + DocumentSignatureMode meSignatureMode; + css::uno::Sequence < css::uno::Sequence < css::beans::PropertyValue > > m_manifest; + + FixedText maHintDocFT; + FixedText maHintBasicFT; + FixedText maHintPackageFT; + SvxSimpleTable maSignaturesLB; // PB 2006/02/02 #i48648 now SvHeaderTabListBox + FixedImage maSigsValidImg; + FixedInfo maSigsValidFI; + FixedImage maSigsInvalidImg; + FixedInfo maSigsInvalidFI; + FixedImage maSigsNotvalidatedImg; + FixedInfo maSigsNotvalidatedFI; + FixedInfo maSigsOldSignatureFI; + + PushButton maViewBtn; + PushButton maAddBtn; + PushButton maRemoveBtn; + + FixedLine maBottomSepFL; + OKButton maOKBtn; + HelpButton maHelpBtn; + + ::rtl::OUString m_sODFVersion; + //Signals if the document contains already a document signature. This is only + //importent when we are signing macros and if the value is true. + bool m_bHasDocumentSignature; + bool m_bWarningShowSignMacro; + + DECL_LINK( ViewButtonHdl, Button* ); + DECL_LINK( AddButtonHdl, Button* ); + DECL_LINK( RemoveButtonHdl, Button* ); + DECL_LINK( SignatureHighlightHdl, void* ); + DECL_LINK( SignatureSelectHdl, void* ); + DECL_LINK( StartVerifySignatureHdl, void* ); + DECL_LINK( OKButtonHdl, void* ); + + void ImplGetSignatureInformations(bool bUseTempStream); + void ImplFillSignaturesBox(); + void ImplShowSignaturesDetails(); + SignatureStreamHelper ImplOpenSignatureStream( sal_Int32 eStreamMode, bool bTempStream ); + + //Checks if adding is allowed. + //See the spec at specs/www/appwide/security/Electronic_Signatures_and_Security.sxw + //(6.6.2)Behaviour with regard to ODF 1.2 + bool canAdd(); + bool canRemove(); + + //Checks if a particular stream is a valid xml stream. Those are treated differently + //when they are signed (c14n transformation) + bool isXML(const ::rtl::OUString& rURI ); + bool canAddRemove(); + +public: + DigitalSignaturesDialog( Window* pParent, cssu::Reference< + cssu::XComponentContext >& rxCtx, DocumentSignatureMode eMode, + sal_Bool bReadOnly, const ::rtl::OUString& sODFVersion, bool bHasDocumentSignature); + ~DigitalSignaturesDialog(); + + // Initialize the dialog and the security environment, returns sal_True on success + sal_Bool Init( const rtl::OUString& rTokenName ); + + // Set the storage which should be signed or verified + void SetStorage( const cssu::Reference < css::embed::XStorage >& rxStore ); + void SetSignatureStream( const cssu::Reference < css::io::XStream >& rxStream ); + + // Execute the dialog... + short Execute(); + + // Did signatures change? + sal_Bool SignaturesChanged() const { return mbSignaturesChanged; } +}; + +#endif // _XMLSECURITY_DIGITALSIGNATURESDIALOG_HXX + diff --git a/xmlsecurity/inc/xmlsecurity/documentsignaturehelper.hxx b/xmlsecurity/inc/xmlsecurity/documentsignaturehelper.hxx new file mode 100644 index 000000000000..14d6a160bd01 --- /dev/null +++ b/xmlsecurity/inc/xmlsecurity/documentsignaturehelper.hxx @@ -0,0 +1,103 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _XMLSECURITY_DOCUMENTSIGNATUREHELPER_HXX +#define _XMLSECURITY_DOCUMENTSIGNATUREHELPER_HXX + +#include <com/sun/star/uno/Reference.h> +#include <rtl/ustring.hxx> +#include "xmlsecurity/sigstruct.hxx" + +#ifndef _STLP_VECTOR +#include <vector> +#endif + + +namespace com { +namespace sun { +namespace star { +namespace io { + class XStream; } +namespace embed { + class XStorage; } +}}} + +namespace css = com::sun::star; + + +/********************************************************** + DocumentSignatureHelper + + Helper class for signing and verifieng document signatures + + Functions: + 1. help to create a list of content to be signed/verified + + **********************************************************/ + +enum DocumentSignatureMode { SignatureModeDocumentContent, SignatureModeMacros, SignatureModePackage }; + +enum DocumentSignatureAlgorithm +{ + OOo2Document, + OOo3_0Document, + OOo3_2Document +}; + +struct SignatureStreamHelper +{ + css::uno::Reference < css::embed::XStorage > xSignatureStorage; + css::uno::Reference < css::io::XStream > xSignatureStream; +}; + + +class DocumentSignatureHelper +{ +public: + + static SignatureStreamHelper OpenSignatureStream( + const css::uno::Reference < css::embed::XStorage >& rxStore, sal_Int32 nOpenMode, + DocumentSignatureMode eDocSigMode ); + static std::vector< rtl::OUString > CreateElementList( + const css::uno::Reference < css::embed::XStorage >& rxStore, + const ::rtl::OUString rRootStorageName, DocumentSignatureMode eMode, + const DocumentSignatureAlgorithm mode); + static bool isODFPre_1_2(const ::rtl::OUString & sODFVersion); + static bool isOOo3_2_Signature(const SignatureInformation & sigInfo); + static DocumentSignatureAlgorithm getDocumentAlgorithm( + const ::rtl::OUString & sODFVersion, const SignatureInformation & sigInfo); + static bool checkIfAllFilesAreSigned( const ::std::vector< ::rtl::OUString > & sElementList, + const SignatureInformation & sigInfo, const DocumentSignatureAlgorithm alg); + static bool equalsReferenceUriManifestPath( + const ::rtl::OUString & rUri, const ::rtl::OUString & rPath); + static ::rtl::OUString GetDocumentContentSignatureDefaultStreamName(); + static ::rtl::OUString GetScriptingContentSignatureDefaultStreamName(); + static ::rtl::OUString GetPackageSignatureDefaultStreamName(); + +}; + +#endif // _XMLSECURITY_XMLSIGNATUREHELPER_HXX diff --git a/xmlsecurity/inc/xmlsecurity/global.hrc b/xmlsecurity/inc/xmlsecurity/global.hrc new file mode 100644 index 000000000000..57a9a95e88b3 --- /dev/null +++ b/xmlsecurity/inc/xmlsecurity/global.hrc @@ -0,0 +1,49 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _XMLSEC_GLOBAL_HRC +#define _XMLSEC_GLOBAL_HRC + +// global resource ids + +#define RID_XMLSECDLG_DIGSIG 1000 +#define RID_XMLSECDLG_CERTCHOOSER 1001 +#define RID_XMLSECDLG_CERTVIEWER 1002 +#define RID_XMLSECTP_GENERAL 1003 +#define RID_XMLSECTP_DETAILS 1004 +#define RID_XMLSECTP_CERTPATH 1005 +#define RID_XMLSECTP_MACROSEC 1006 +#define RID_XMLSECTP_SECLEVEL 1007 +#define RID_XMLSECTP_TRUSTSOURCES 1008 +#define RID_XMLSECTP_MACROWARN 1009 +#define RID_XMLSECTP_READONLY_CONFIG_TIP 1010 +#define RID_XMLSECTP_LOCK 1011 +#define RID_XMLSECTP_LOCK_HC 1012 +#define RID_XMLSECWB_NO_MOZILLA_PROFILE 1013 + +#endif + diff --git a/xmlsecurity/inc/xmlsecurity/macrosecurity.hxx b/xmlsecurity/inc/xmlsecurity/macrosecurity.hxx new file mode 100644 index 000000000000..6ebab6d99265 --- /dev/null +++ b/xmlsecurity/inc/xmlsecurity/macrosecurity.hxx @@ -0,0 +1,175 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _XMLSECURITY_MACROSECURITY_HXX +#define _XMLSECURITY_MACROSECURITY_HXX + +#include <vcl/fixed.hxx> +#include <vcl/button.hxx> +#include <vcl/lstbox.hxx> +#include <vcl/tabdlg.hxx> +#include <vcl/tabctrl.hxx> +#include <vcl/tabpage.hxx> +#include <svtools/stdctrl.hxx> +#include <svx/simptabl.hxx> +#include <unotools/securityoptions.hxx> + +namespace com { +namespace sun { +namespace star { +namespace xml { namespace crypto { + class XSecurityEnvironment; }} +}}} + +namespace css = com::sun::star; +namespace cssu = com::sun::star::uno; +namespace dcss = ::com::sun::star; + +class MacroSecurityTP; + +class ReadOnlyImage : public FixedImage +{ +public: + ReadOnlyImage(Window* pParent, const ResId rResId); + ~ReadOnlyImage(); + + virtual void RequestHelp( const HelpEvent& rHEvt ); + static const String& GetHelpTip(); +}; + +class MacroSecurity : public TabDialog +{ +private: + friend class MacroSecurityLevelTP; + friend class MacroSecurityTrustedSourcesTP; + + TabControl maTabCtrl; + OKButton maOkBtn; + CancelButton maCancelBtn; + HelpButton maHelpBtn; + PushButton maResetBtn; + + cssu::Reference< cssu::XComponentContext > mxCtx; + cssu::Reference< dcss::xml::crypto::XSecurityEnvironment > mxSecurityEnvironment; + SvtSecurityOptions maSecOptions; + + MacroSecurityTP* mpLevelTP; + MacroSecurityTP* mpTrustSrcTP; + + DECL_LINK( OkBtnHdl, void* ); +public: + MacroSecurity( Window* pParent, const cssu::Reference< cssu::XComponentContext>& rxCtx, const cssu::Reference< dcss::xml::crypto::XSecurityEnvironment >& rxSecurityEnvironment ); + virtual ~MacroSecurity(); + + inline void EnableReset( bool _bEnable = true ); +}; + +inline void MacroSecurity::EnableReset( bool _bEnable ) +{ + maResetBtn.Enable ( _bEnable ); +} + +class MacroSecurityTP : public TabPage +{ +protected: + MacroSecurity* mpDlg; +public: + MacroSecurityTP( Window* _pParent, const ResId& _rResId, MacroSecurity* _pDlg ); + inline void SetTabDlg( MacroSecurity* pTabDlg ); + + virtual void ClosePage( void ) = 0; +}; + +inline void MacroSecurityTP::SetTabDlg( MacroSecurity* _pTabDlg ) +{ + mpDlg = _pTabDlg; +} + + +class MacroSecurityLevelTP : public MacroSecurityTP +{ +private: + FixedLine maSecLevelFL; + ReadOnlyImage maSecReadonlyFI; + RadioButton maVeryHighRB; + RadioButton maHighRB; + RadioButton maMediumRB; + RadioButton maLowRB; + + sal_uInt16 mnCurLevel; + +protected: + DECL_LINK( RadioButtonHdl, RadioButton* ); + +public: + MacroSecurityLevelTP( Window* pParent, MacroSecurity* _pDlg ); + + virtual void ClosePage( void ); +}; + + +class MacroSecurityTrustedSourcesTP : public MacroSecurityTP +{ +private: + FixedLine maTrustCertFL; + ReadOnlyImage maTrustCertROFI; + SvxSimpleTable maTrustCertLB; // PB 2006/02/02 #i48648 now SvHeaderTabListBox + PushButton maAddCertPB; + PushButton maViewCertPB; + PushButton maRemoveCertPB; + FixedLine maTrustFileLocFL; + ReadOnlyImage maTrustFileROFI; + FixedInfo maTrustFileLocFI; + ListBox maTrustFileLocLB; + PushButton maAddLocPB; + PushButton maRemoveLocPB; + + cssu::Sequence< SvtSecurityOptions::Certificate > maTrustedAuthors; + + sal_Bool mbAuthorsReadonly; + sal_Bool mbURLsReadonly; + + DECL_LINK( ViewCertPBHdl, void* ); + DECL_LINK( RemoveCertPBHdl, void* ); + DECL_LINK( AddLocPBHdl, void* ); + DECL_LINK( RemoveLocPBHdl, void* ); + DECL_LINK( TrustCertLBSelectHdl, void* ); + DECL_LINK( TrustFileLocLBSelectHdl, void* ); + + void FillCertLB( void ); + void ImplCheckButtons(); + +public: + MacroSecurityTrustedSourcesTP( Window* pParent, MacroSecurity* _pDlg ); + + virtual void ActivatePage(); + virtual void ClosePage( void ); +}; + + +#endif // _XMLSECURITY_MACROSECURITY_HXX + diff --git a/xmlsecurity/inc/xmlsecurity/sigstruct.hxx b/xmlsecurity/inc/xmlsecurity/sigstruct.hxx new file mode 100644 index 000000000000..345380835d70 --- /dev/null +++ b/xmlsecurity/inc/xmlsecurity/sigstruct.hxx @@ -0,0 +1,112 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SIGSTRUCT_HXX +#define _SIGSTRUCT_HXX + +#include <rtl/ustring.hxx> +#include <com/sun/star/util/DateTime.hpp> + +#include <com/sun/star/xml/crypto/SecurityOperationStatus.hpp> + +#ifndef INCLUDED_VECTOR +#include <vector> +#define INCLUDED_VECTOR +#endif + +/* + * signature status + */ +/* +#define STATUS_INIT 0 +#define STATUS_CREATION_SUCCEED 1 +#define STATUS_CREATION_FAIL 2 +#define STATUS_VERIFY_SUCCEED 3 +#define STATUS_VERIFY_FAIL 4 +*/ + +/* + * type of reference + */ +#define TYPE_SAMEDOCUMENT_REFERENCE 1 +#define TYPE_BINARYSTREAM_REFERENCE 2 +#define TYPE_XMLSTREAM_REFERENCE 3 + +struct SignatureReferenceInformation +{ + sal_Int32 nType; + rtl::OUString ouURI; + rtl::OUString ouDigestValue; + + SignatureReferenceInformation( sal_Int32 type, rtl::OUString uri ) + { + nType = type; + ouURI = uri; + } +}; + +typedef ::std::vector< SignatureReferenceInformation > SignatureReferenceInformations; + +struct SignatureInformation +{ + sal_Int32 nSecurityId; + sal_Int32 nSecurityEnvironmentIndex; + ::com::sun::star::xml::crypto::SecurityOperationStatus nStatus; + SignatureReferenceInformations vSignatureReferenceInfors; + rtl::OUString ouX509IssuerName; + rtl::OUString ouX509SerialNumber; + rtl::OUString ouX509Certificate; + rtl::OUString ouSignatureValue; + ::com::sun::star::util::DateTime stDateTime; + + //We also keep the date and time as string. This is done when this + //structure is created as a result of a XML signature being read. + //When then a signature is added or another removed, then the original + //XML signatures are written again (unless they have been removed). + //If the date time string is converted into the DateTime structure + //then information can be lost because it only holds a fractional + //of a second with a accuracy of one hundredth of second. + //If the string contains + //milli seconds (because the document was created by an application other than OOo) + //and the converted time is written back, then the string looks different + //and the signature is broken. + rtl::OUString ouDateTime; + rtl::OUString ouSignatureId; + rtl::OUString ouPropertyId; + + SignatureInformation( sal_Int32 nId ) + { + nSecurityId = nId; + nStatus = ::com::sun::star::xml::crypto::SecurityOperationStatus_UNKNOWN; + nSecurityEnvironmentIndex = -1; + } +}; + +typedef ::std::vector< SignatureInformation > SignatureInformations; + +#endif + diff --git a/xmlsecurity/inc/xmlsecurity/stbcontrl.hxx b/xmlsecurity/inc/xmlsecurity/stbcontrl.hxx new file mode 100644 index 000000000000..8e99a393ace2 --- /dev/null +++ b/xmlsecurity/inc/xmlsecurity/stbcontrl.hxx @@ -0,0 +1,57 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _XMLSECURITY_STBCONTRL_HXX +#define _XMLSECURITY_STBCONTRL_HXX + +#include <sfx2/stbitem.hxx> + + +class SvxSizeItem; + +// class SvxPosSizeToolBoxControl ---------------------------------------- + +class XmlSecStatusBarControl : public SfxStatusBarControl +{ +private: + struct XmlSecStatusBarControl_Impl; + + XmlSecStatusBarControl_Impl* mpImpl; + +public: + SFX_DECL_STATUSBAR_CONTROL(); + + XmlSecStatusBarControl( sal_uInt16 _nId, StatusBar& _rStb, SfxBindings& _rBind ); + ~XmlSecStatusBarControl(); + + virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState ); + virtual void Paint( const UserDrawEvent& rEvt ); + virtual void Command( const CommandEvent& rCEvt ); +}; + +#endif + diff --git a/xmlsecurity/inc/xmlsecurity/warnings.hxx b/xmlsecurity/inc/xmlsecurity/warnings.hxx new file mode 100644 index 000000000000..a8f0b033616d --- /dev/null +++ b/xmlsecurity/inc/xmlsecurity/warnings.hxx @@ -0,0 +1,89 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _XMLSECURITY_WARNINGS_HXX +#define _XMLSECURITY_WARNINGS_HXX + +#include <vcl/dialog.hxx> +#include <svtools/stdctrl.hxx> +#include <vcl/button.hxx> +#include <svx/simptabl.hxx> + +namespace com { +namespace sun { +namespace star { +namespace security { + class XCertificate; } +namespace xml { namespace crypto { + class XSecurityEnvironment; }} +}}} + +#include <com/sun/star/uno/Sequence.hxx> +#include <xmlsecurity/sigstruct.hxx> + +namespace css = com::sun::star; +namespace cssu = com::sun::star::uno; +namespace dcss = ::com::sun::star; + +class HeaderBar; + +class MacroWarning : public ModalDialog +{ +private: + // XSecurityEnvironment is needed for building the certification path + cssu::Reference< dcss::xml::crypto::XSecurityEnvironment > mxSecurityEnvironment; + +// cssu::Sequence< cssu::Reference< dcss::security::XCertificate > > maCerts; + cssu::Reference< dcss::security::XCertificate > mxCert; + +// FixedImage maQuestionMarkFI; + FixedInfo maDocNameFI; + FixedInfo maDescr1aFI; + FixedInfo maDescr1bFI; + FixedInfo maSignsFI; + PushButton maViewSignsBtn; + FixedInfo maDescr2FI; + CheckBox maAlwaysTrustCB; + FixedLine maBottomSepFL; + PushButton maEnableBtn; + CancelButton maDisableBtn; + HelpButton maHelpBtn; + + const bool mbSignedMode; // modus of dialog (signed / unsigned macros) + + DECL_LINK( ViewSignsBtnHdl, void* ); + DECL_LINK( EnableBtnHdl, void* ); +// DECL_LINK( DisableBtnHdl, void* ); + +public: + MacroWarning( Window* pParent, cssu::Reference< dcss::xml::crypto::XSecurityEnvironment >& _rxSecurityEnvironment, cssu::Reference< dcss::security::XCertificate >& _rxCert ); + MacroWarning( Window* pParent ); + ~MacroWarning(); +}; + +#endif + diff --git a/xmlsecurity/inc/xmlsecurity/xmlsignaturehelper.hxx b/xmlsecurity/inc/xmlsecurity/xmlsignaturehelper.hxx new file mode 100644 index 000000000000..4869b4728567 --- /dev/null +++ b/xmlsecurity/inc/xmlsecurity/xmlsignaturehelper.hxx @@ -0,0 +1,207 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _XMLSECURITY_XMLSIGNATUREHELPER_HXX +#define _XMLSECURITY_XMLSIGNATUREHELPER_HXX + +#ifndef _STLP_VECTOR +#include <vector> +#endif + +#include <tools/link.hxx> + +#include <rtl/ustring.hxx> + +#include <xmlsecurity/sigstruct.hxx> + +#include <com/sun/star/uno/XComponentContext.hpp> +#include <com/sun/star/xml/sax/XDocumentHandler.hpp> +#include <com/sun/star/xml/crypto/XUriBinding.hpp> +#include <com/sun/star/xml/crypto/XSEInitializer.hpp> +#include <com/sun/star/xml/crypto/sax/XSecurityController.hpp> +#include <com/sun/star/xml/crypto/sax/XSignatureCreationResultListener.hpp> +#include <com/sun/star/xml/crypto/sax/XSignatureVerifyResultListener.hpp> + +class XSecController; +class Date; +class Time; + +namespace com { +namespace sun { +namespace star { +namespace io { + class XOutputStream; + class XInputStream; } +namespace embed { + class XStorage; } +}}} + +struct XMLSignatureCreationResult +{ + sal_Int32 nSecurityId; + com::sun::star::xml::crypto::SecurityOperationStatus nSignatureCreationResult; + + XMLSignatureCreationResult( sal_Int32 nId, com::sun::star::xml::crypto::SecurityOperationStatus nResult ) + { + nSecurityId = nId; + nSignatureCreationResult = nResult; + } +}; + +struct XMLSignatureVerifyResult +{ + sal_Int32 nSecurityId; + com::sun::star::xml::crypto::SecurityOperationStatus nSignatureVerifyResult; + + XMLSignatureVerifyResult( sal_Int32 nId, com::sun::star::xml::crypto::SecurityOperationStatus nResult ) + { + nSecurityId = nId; + nSignatureVerifyResult = nResult; + } +}; + +typedef ::std::vector<XMLSignatureCreationResult> XMLSignatureCreationResults; +typedef ::std::vector<XMLSignatureVerifyResult> XMLSignatureVerifyResults; + + + +/********************************************************** + XMLSignatureHelper + + Helper class for the XML Security framework + + Functions: + 1. help to create a security context; + 2. help to listen signature creation result; + 3. help to listen signature verify result; + 4. help to indicate which signature to verify. + + **********************************************************/ + +class XMLSignatureHelper +{ +private: + ::com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > mxCtx; + ::com::sun::star::uno::Reference< com::sun::star::xml::crypto::sax::XSecurityController > mxSecurityController; + ::com::sun::star::uno::Reference< com::sun::star::xml::crypto::XUriBinding > mxUriBinding; + + ::com::sun::star::uno::Reference< com::sun::star::xml::crypto::XSEInitializer > mxSEInitializer; + ::com::sun::star::uno::Reference< com::sun::star::xml::crypto::XXMLSecurityContext > mxSecurityContext; + + XMLSignatureCreationResults maCreationResults; + XMLSignatureVerifyResults maVerifyResults; + XSecController* mpXSecController; + bool mbError; + bool mbODFPre1_2; + Link maStartVerifySignatureHdl; + +private: + void ImplCreateSEInitializer(); + DECL_LINK( SignatureCreationResultListener, XMLSignatureCreationResult*); + DECL_LINK( SignatureVerifyResultListener, XMLSignatureVerifyResult* ); + DECL_LINK( StartVerifySignatureElement, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >* ); + + // Not allowed: + XMLSignatureHelper(const XMLSignatureHelper&); + +public: + XMLSignatureHelper(const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& mrCtx ); + ~XMLSignatureHelper(); + + // Initialize the security context with given crypto token. + // Empty string means default crypto token. + // Returns true for success. + bool Init( const rtl::OUString& rTokenPath ); + + // Set UriBinding to create input streams to open files. + // Default implementation is capable to open files from disk. + void SetUriBinding( com::sun::star::uno::Reference< com::sun::star::xml::crypto::XUriBinding >& rxUriBinding ); + com::sun::star::uno::Reference< com::sun::star::xml::crypto::XUriBinding > GetUriBinding() const; + + // Set the storage which should be used by the default UriBinding + // Must be set before StatrtMission(). + //sODFVersion indicates the ODF version + void SetStorage( const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& rxStorage, ::rtl::OUString sODFVersion ); + + // Argument for the Link is a uno::Reference< xml::sax::XAttributeList >* + // Return 1 to verify, 0 to skip. + // Default handler will verify all. + void SetStartVerifySignatureHdl( const Link& rLink ); + + // Get the security environment + ::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XSecurityEnvironment > GetSecurityEnvironment(); + ::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XSecurityEnvironment > GetSecurityEnvironmentByIndex(sal_Int32 nId); + sal_Int32 GetSecurityEnvironmentNumber(); + + // After signing/veryfieng, get information about signatures + SignatureInformation GetSignatureInformation( sal_Int32 nSecurityId ) const; + SignatureInformations GetSignatureInformations() const; + + // See XSecController for documentation + void StartMission(); + void EndMission(); + sal_Int32 GetNewSecurityId(); + /** sets data that describes the certificate. + + It is absolutely necessary that the parameter ouX509IssuerName is set. It contains + the base64 encoded certificate, which is DER encoded. The XMLSec needs it to find + the private key. Although issuer name and certificate should be sufficient to identify + the certificate the implementation in XMLSec is broken, both for Windows and mozilla. + The reason is that they use functions to find the certificate which take as parameter + the DER encoded ASN.1 issuer name. The issuer name is a DName, where most attributes + are of type DirectoryName, which is a choice of 5 string types. This information is + not contained in the issuer string and while it is converted to the ASN.1 name the + conversion function must assume a particular type, which is often wrong. For example, + the Windows function CertStrToName will use a T.61 string if the string does not contain + special characters. So if the certificate uses simple characters but encodes the + issuer attributes in Utf8, then CertStrToName will use T.61. The resulting DER encoded + ASN.1 name now contains different bytes which indicate the string type. The functions + for finding the certificate apparently use memcmp - hence they fail to find the + certificate. + */ + void SetX509Certificate(sal_Int32 nSecurityId, const rtl::OUString& ouX509IssuerName, + const rtl::OUString& ouX509SerialNumber, const rtl::OUString& ouX509Cert); + + void SetX509Certificate(sal_Int32 nSecurityId, sal_Int32 nSecurityEnvironmentIndex, + const rtl::OUString& ouX509IssuerName, const rtl::OUString& ouX509SerialNumber, + const rtl::OUString& ouX509Cert); + void SetDateTime( sal_Int32 nSecurityId, const Date& rDate, const Time& rTime ); + + void AddForSigning( sal_Int32 securityId, const rtl::OUString& uri, const rtl::OUString& objectURL, sal_Bool bBinary ); + bool CreateAndWriteSignature( const com::sun::star::uno::Reference< com::sun::star::xml::sax::XDocumentHandler >& xDocumentHandler ); + bool CreateAndWriteSignature( const com::sun::star::uno::Reference< com::sun::star::io::XOutputStream >& xOutputStream ); + bool ReadAndVerifySignature( const com::sun::star::uno::Reference< com::sun::star::io::XInputStream >& xInputStream ); + + // MT: ??? I think only for adding/removing, not for new signatures... + // MM: Yes, but if you want to insert a new signature into an existing signature file, those function + // will be very usefull, see Mission 3 in the new "multisigdemo" program :-) + ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler> CreateDocumentHandlerWithHeader( const com::sun::star::uno::Reference< com::sun::star::io::XOutputStream >& xOutputStream ); + void CloseDocumentHandler( const ::com::sun::star::uno::Reference< com::sun::star::xml::sax::XDocumentHandler>& xDocumentHandler ); + void ExportSignature( const com::sun::star::uno::Reference< com::sun::star::xml::sax::XDocumentHandler >& xDocumentHandler, const SignatureInformation& signatureInfo ); +}; + +#endif // _XMLSECURITY_XMLSIGNATUREHELPER_HXX diff --git a/xmlsecurity/prj/build.lst b/xmlsecurity/prj/build.lst new file mode 100644 index 000000000000..54326d4fe5ef --- /dev/null +++ b/xmlsecurity/prj/build.lst @@ -0,0 +1,11 @@ +xs xmlsecurity : L10N:l10n xmloff unotools offapi unoil svx MOZ:moz SO:moz_prebuilt LIBXMLSEC:libxmlsec NSS:nss LIBXSLT:libxslt NULL +xs xmlsecurity usr1 - all xs_mkout NULL +xs xmlsecurity\inc nmake - all xs_inc NULL +xs xmlsecurity\source\framework nmake - all xs_fw xs_inc NULL +xs xmlsecurity\source\xmlsec\nss nmake - all xs_nss xs_inc NULL +xs xmlsecurity\source\xmlsec\mscrypt nmake - all xs_mscrypt xs_inc NULL +xs xmlsecurity\source\xmlsec nmake - all xs_xmlsec xs_nss xs_mscrypt xs_inc NULL +xs xmlsecurity\source\helper nmake - all xs_helper xs_inc NULL +xs xmlsecurity\source\dialogs nmake - all xs_dialogs xs_inc NULL +xs xmlsecurity\source\component nmake - all xs_component xs_inc NULL +xs xmlsecurity\util nmake - all xs_util xs_fw xs_xmlsec xs_nss xs_mscrypt xs_helper xs_dialogs xs_component NULL diff --git a/xmlsecurity/prj/d.lst b/xmlsecurity/prj/d.lst new file mode 100644 index 000000000000..94967c20a2e8 --- /dev/null +++ b/xmlsecurity/prj/d.lst @@ -0,0 +1,13 @@ +mkdir: %COMMON_DEST%\bin%_EXT%\hid +..\%COMMON_OUTDIR%\misc\*.hid %COMMON_DEST%\bin%_EXT%\hid\*.hid +..\%__SRC%\bin\xsec_fw.dll %_DEST%\bin%_EXT%\xsec_fw.dll +..\%__SRC%\bin\xsec_xmlsec.dll %_DEST%\bin%_EXT%\xsec_xmlsec.dll +..\%__SRC%\bin\xmlsecurity.dll %_DEST%\bin%_EXT%\xmlsecurity.dll +..\%__SRC%\lib\libxsec_fw.so %_DEST%\lib%_EXT%\libxsec_fw.so +..\%__SRC%\lib\libxsec_xmlsec.so %_DEST%\lib%_EXT%\libxsec_xmlsec.so +..\%__SRC%\lib\libxmlsecurity.so %_DEST%\lib%_EXT%\libxmlsecurity.so +..\%__SRC%\lib\*.dylib %_DEST%\lib%_EXT%\* +..\%__SRC%\bin\xmlsec*.res %_DEST%\bin%_EXT%\xmlsec*.res +..\%__SRC%\misc\xmlsecurity.component %_DEST%\xml%_EXT%\xmlsecurity.component +..\%__SRC%\misc\xsec_fw.component %_DEST%\xml%_EXT%\xsec_fw.component +..\%__SRC%\misc\xsec_xmlsec.component %_DEST%\xml%_EXT%\xsec_xmlsec.component diff --git a/xmlsecurity/source/component/certificatecontainer.cxx b/xmlsecurity/source/component/certificatecontainer.cxx new file mode 100644 index 000000000000..d490e500b2c3 --- /dev/null +++ b/xmlsecurity/source/component/certificatecontainer.cxx @@ -0,0 +1,171 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "precompiled_xmlsecurity.hxx" +#include <certificatecontainer.hxx> + +#include <sal/config.h> + +using namespace ::com::sun::star::uno; + + +sal_Bool +CertificateContainer::searchMap( const ::rtl::OUString & url, const ::rtl::OUString & certificate_name, Map &_certMap ) +{ + Map::iterator p = _certMap.find(url); + + ::sal_Bool ret = sal_False; + + while( p != _certMap.end() ) + { + ret = (sal_Bool) (*p).second.equals(certificate_name); + if( ret ) + break; + p++; + } + + return ret; +} +// ------------------------------------------------------------------- + +sal_Bool +CertificateContainer::isTemporaryCertificate ( const ::rtl::OUString & url, const ::rtl::OUString & certificate_name ) + throw(::com::sun::star::uno::RuntimeException) +{ + return searchMap( url, certificate_name, certMap); +} + +// ------------------------------------------------------------------- + +sal_Bool +CertificateContainer::isCertificateTrust ( const ::rtl::OUString & url, const ::rtl::OUString & certificate_name ) + throw(::com::sun::star::uno::RuntimeException) +{ + return searchMap( url, certificate_name, certTrustMap); +} + +// ------------------------------------------------------------------- +sal_Bool +CertificateContainer::addCertificate( const ::rtl::OUString & url, const ::rtl::OUString & certificate_name, ::sal_Bool trust ) + throw(::com::sun::star::uno::RuntimeException) +{ + certMap.insert( Map::value_type( url, certificate_name ) ); + + //remember that the cert is trusted + if (trust) + certTrustMap.insert( Map::value_type( url, certificate_name ) ); + + return true; +} + +//------------------------------------------------------------------------- +::security::CertificateContainerStatus +CertificateContainer::hasCertificate( const ::rtl::OUString & url, const ::rtl::OUString & certificate_name ) throw(::com::sun::star::uno::RuntimeException) +{ + if ( isTemporaryCertificate( url, certificate_name ) ) + { + if ( isCertificateTrust( url, certificate_name ) ) + return security::CertificateContainerStatus( security::CertificateContainerStatus_TRUSTED ); + else + return security::CertificateContainerStatus_UNTRUSTED; + } else + { + return security::CertificateContainerStatus_NOCERT; + } +} +//------------------------------------------------------------------------- + +::rtl::OUString SAL_CALL +CertificateContainer::getImplementationName( ) + throw(::com::sun::star::uno::RuntimeException) +{ + return impl_getStaticImplementationName(); +} + +//------------------------------------------------------------------------- + +sal_Bool SAL_CALL +CertificateContainer::supportsService( const ::rtl::OUString& ServiceName ) + throw(::com::sun::star::uno::RuntimeException) +{ + if ( ServiceName.compareToAscii("com.sun.star.security.CertificateContainer") == 0 ) + return sal_True; + else + return sal_False; +} + +//------------------------------------------------------------------------- + +Sequence< ::rtl::OUString > SAL_CALL +CertificateContainer::getSupportedServiceNames( ) + throw(::com::sun::star::uno::RuntimeException) +{ + return impl_getStaticSupportedServiceNames(); +} + +//------------------------------------------------------------------------- + +Sequence< ::rtl::OUString > SAL_CALL +CertificateContainer::impl_getStaticSupportedServiceNames( ) + throw(::com::sun::star::uno::RuntimeException) +{ + Sequence< ::rtl::OUString > aRet(1); + *aRet.getArray() = ::rtl::OUString::createFromAscii("com.sun.star.security.CertificateContainer"); + return aRet; +} + +//------------------------------------------------------------------------- + +::rtl::OUString SAL_CALL +CertificateContainer::impl_getStaticImplementationName() + throw(::com::sun::star::uno::RuntimeException) +{ + return ::rtl::OUString::createFromAscii("com.sun.star.security.CertificateContainer"); +} + +//------------------------------------------------------------------------- + +Reference< XInterface > SAL_CALL CertificateContainer::impl_createInstance( const Reference< XMultiServiceFactory >& xServiceManager ) + throw( RuntimeException ) +{ + return Reference< XInterface >( *new CertificateContainer( xServiceManager ) ); +} + +//------------------------------------------------------------------------- + +Reference< XSingleServiceFactory > SAL_CALL +CertificateContainer::impl_createFactory( const Reference< XMultiServiceFactory >& ServiceManager ) + throw(RuntimeException) +{ + Reference< XSingleServiceFactory > xReturn( ::cppu::createOneInstanceFactory( ServiceManager, + CertificateContainer::impl_getStaticImplementationName(), + CertificateContainer::impl_createInstance, + CertificateContainer::impl_getStaticSupportedServiceNames())); + + return xReturn; +} + diff --git a/xmlsecurity/source/component/certificatecontainer.hxx b/xmlsecurity/source/component/certificatecontainer.hxx new file mode 100644 index 000000000000..3bf11cd55d92 --- /dev/null +++ b/xmlsecurity/source/component/certificatecontainer.hxx @@ -0,0 +1,99 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _XCERTIFICATECONTAINER_HXX_ +#define _XCERTIFICATECONTAINER_HXX_ + +#include <com/sun/star/lang/XServiceInfo.hpp> +#include <com/sun/star/lang/XSingleServiceFactory.hpp> +#include <com/sun/star/lang/XMultiServiceFactory.hpp> +#include <cppuhelper/factory.hxx> +#include <cppuhelper/implbase2.hxx> + +#ifndef _XCERTIFICATECONTAINER_HPP_ +#include <com/sun/star/security/XCertificateContainer.hpp> +#endif + +#ifndef _CERTIFICATECONTAINERSTATUS_HPP_ +#include <com/sun/star/security/CertificateContainerStatus.hpp> +#endif + + +#include <vector> +#include <map> + +using namespace com::sun::star; +using namespace cppu; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::lang; + +class CertificateContainer : public ::cppu::WeakImplHelper2< ::com::sun::star::lang::XServiceInfo, ::com::sun::star::security::XCertificateContainer > +{ + private: + typedef std::map< ::rtl::OUString, ::rtl::OUString > Map; + Map certMap; + Map certTrustMap; + + ::sal_Bool SAL_CALL searchMap( const ::rtl::OUString & url, const ::rtl::OUString & certificate_name, Map &_certMap ); + virtual ::sal_Bool SAL_CALL isTemporaryCertificate( const ::rtl::OUString & url, const ::rtl::OUString & certificate_name ) throw(::com::sun::star::uno::RuntimeException); + virtual ::sal_Bool SAL_CALL isCertificateTrust( const ::rtl::OUString & url, const ::rtl::OUString & certificate_name ) throw(::com::sun::star::uno::RuntimeException); + + public: + + CertificateContainer(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& ) {}; + virtual ~CertificateContainer(){}; + + virtual ::sal_Bool SAL_CALL addCertificate( const ::rtl::OUString & url, const ::rtl::OUString & certificate_name, ::sal_Bool trust ) throw(::com::sun::star::uno::RuntimeException); + virtual ::security::CertificateContainerStatus SAL_CALL hasCertificate( const ::rtl::OUString & url, const ::rtl::OUString & certificate_name ) throw(::com::sun::star::uno::RuntimeException); + // provide factory + static ::rtl::OUString SAL_CALL + impl_getStaticImplementationName( ) throw(::com::sun::star::uno::RuntimeException); + + static ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL + impl_getStaticSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException); + + static ::com::sun::star::uno::Reference< ::com::sun::star::lang::XSingleServiceFactory > SAL_CALL + impl_createFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& ServiceManager ) throw(::com::sun::star::uno::RuntimeException); + + static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL + impl_createInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager ) throw( ::com::sun::star::uno::RuntimeException ); + + // XServiceInfo + virtual ::rtl::OUString SAL_CALL + getImplementationName( ) throw(::com::sun::star::uno::RuntimeException); + virtual ::sal_Bool SAL_CALL + supportsService( const ::rtl::OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException); + + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL + getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException); + +}; + + + +#endif + diff --git a/xmlsecurity/source/component/documentdigitalsignatures.cxx b/xmlsecurity/source/component/documentdigitalsignatures.cxx new file mode 100644 index 000000000000..e8eddefb51cf --- /dev/null +++ b/xmlsecurity/source/component/documentdigitalsignatures.cxx @@ -0,0 +1,516 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove + +#include "precompiled_xmlsecurity.hxx" + +#include <documentdigitalsignatures.hxx> +#include <xmlsecurity/digitalsignaturesdialog.hxx> +#include <xmlsecurity/certificateviewer.hxx> +#include <xmlsecurity/macrosecurity.hxx> +#include <xmlsecurity/biginteger.hxx> +#include <xmlsecurity/global.hrc> + +#include <xmloff/xmluconv.hxx> + +#include <../dialogs/resourcemanager.hxx> +#include <com/sun/star/embed/XStorage.hpp> +#include <com/sun/star/embed/XTransactedObject.hpp> +#include <com/sun/star/embed/ElementModes.hpp> +#include <com/sun/star/ucb/XContent.hpp> +#include <com/sun/star/ucb/XContentProvider.hpp> +#include <com/sun/star/ucb/XContentIdentifierFactory.hpp> +#include <com/sun/star/ucb/XCommandEnvironment.hpp> +#include <com/sun/star/ucb/XCommandProcessor.hpp> +#include <com/sun/star/ucb/Command.hpp> +#include <tools/urlobj.hxx> +#include <vcl/msgbox.hxx> +#include <unotools/securityoptions.hxx> +#include <com/sun/star/security/CertificateValidity.hpp> +#include <com/sun/star/security/SerialNumberAdapter.hpp> +#include <ucbhelper/contentbroker.hxx> +#include <unotools/ucbhelper.hxx> +#include <comphelper/componentcontext.hxx> +#include "comphelper/documentconstants.hxx" + +#include "com/sun/star/lang/IllegalArgumentException.hpp" + +#include <stdio.h> + + +using namespace ::com::sun::star; +using namespace ::com::sun::star::uno; +namespace css = ::com::sun::star; + +#define OUSTR(x) ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(x) ) + +DocumentDigitalSignatures::DocumentDigitalSignatures( const Reference< XComponentContext >& rxCtx ): + mxCtx(rxCtx), + m_sODFVersion(ODFVER_012_TEXT), + m_nArgumentsCount(0), + m_bHasDocumentSignature(false) +{ +} + +void DocumentDigitalSignatures::initialize( const Sequence< Any >& aArguments) + throw (css::uno::Exception, css::uno::RuntimeException) +{ + if (aArguments.getLength() == 0 || aArguments.getLength() > 2) + throw css::lang::IllegalArgumentException( + OUSTR("DocumentDigitalSignatures::initialize requires one or two arguments"), + Reference<XInterface>(static_cast<XInitialization*>(this), UNO_QUERY), 0); + + m_nArgumentsCount = aArguments.getLength(); + + if (!(aArguments[0] >>= m_sODFVersion)) + throw css::lang::IllegalArgumentException( + OUSTR("DocumentDigitalSignatures::initialize: the first arguments must be a string"), + Reference<XInterface>(static_cast<XInitialization*>(this), UNO_QUERY), 0); + + if (aArguments.getLength() == 2 + && !(aArguments[1] >>= m_bHasDocumentSignature)) + throw css::lang::IllegalArgumentException( + OUSTR("DocumentDigitalSignatures::initialize: the second arguments must be a bool"), + Reference<XInterface>(static_cast<XInitialization*>(this), UNO_QUERY), 1); + + //the Version is supported as of ODF1.2, so for and 1.1 document or older we will receive the + //an empty string. In this case we set it to ODFVER_010_TEXT. Then we can later check easily + //if initialize was called. Only then m_sODFVersion.getLength() is greater than 0 + if (m_sODFVersion.getLength() == 0) + m_sODFVersion = ODFVER_010_TEXT; +} + +sal_Bool DocumentDigitalSignatures::signDocumentContent( + const Reference< css::embed::XStorage >& rxStorage, + const Reference< css::io::XStream >& xSignStream) + throw (RuntimeException) +{ + OSL_ENSURE(m_sODFVersion.getLength(), "DocumentDigitalSignatures: ODF Version not set, assuming minimum 1.2"); + return ImplViewSignatures( rxStorage, xSignStream, SignatureModeDocumentContent, false ); +} + +Sequence< css::security::DocumentSignatureInformation > +DocumentDigitalSignatures::verifyDocumentContentSignatures( + const Reference< css::embed::XStorage >& rxStorage, + const Reference< css::io::XInputStream >& xSignInStream ) throw (RuntimeException) +{ + OSL_ENSURE(m_sODFVersion.getLength(),"DocumentDigitalSignatures: ODF Version not set, assuming minimum 1.2"); + return ImplVerifySignatures( rxStorage, xSignInStream, SignatureModeDocumentContent ); +} + +void DocumentDigitalSignatures::showDocumentContentSignatures( + const Reference< css::embed::XStorage >& rxStorage, + const Reference< css::io::XInputStream >& xSignInStream ) throw (RuntimeException) +{ + OSL_ENSURE(m_sODFVersion.getLength(),"DocumentDigitalSignatures: ODF Version not set, assuming minimum 1.2"); + ImplViewSignatures( rxStorage, xSignInStream, SignatureModeDocumentContent, true ); +} + +::rtl::OUString DocumentDigitalSignatures::getDocumentContentSignatureDefaultStreamName() + throw (css::uno::RuntimeException) +{ + return DocumentSignatureHelper::GetDocumentContentSignatureDefaultStreamName(); +} + +sal_Bool DocumentDigitalSignatures::signScriptingContent( + const Reference< css::embed::XStorage >& rxStorage, + const Reference< css::io::XStream >& xSignStream ) throw (RuntimeException) +{ + OSL_ENSURE(m_sODFVersion.getLength(),"DocumentDigitalSignatures: ODF Version not set, assuming minimum 1.2"); + OSL_ENSURE(m_nArgumentsCount == 2, "DocumentDigitalSignatures: Service was not initialized properly"); + return ImplViewSignatures( rxStorage, xSignStream, SignatureModeMacros, false ); +} + +Sequence< css::security::DocumentSignatureInformation > +DocumentDigitalSignatures::verifyScriptingContentSignatures( + const Reference< css::embed::XStorage >& rxStorage, + const Reference< css::io::XInputStream >& xSignInStream ) throw (RuntimeException) +{ + OSL_ENSURE(m_sODFVersion.getLength(),"DocumentDigitalSignatures: ODF Version not set, assuming minimum 1.2"); + return ImplVerifySignatures( rxStorage, xSignInStream, SignatureModeMacros ); +} + +void DocumentDigitalSignatures::showScriptingContentSignatures( + const Reference< css::embed::XStorage >& rxStorage, + const Reference< css::io::XInputStream >& xSignInStream ) throw (RuntimeException) +{ + OSL_ENSURE(m_sODFVersion.getLength(),"DocumentDigitalSignatures: ODF Version not set, assuming minimum 1.2"); + ImplViewSignatures( rxStorage, xSignInStream, SignatureModeMacros, true ); +} + +::rtl::OUString DocumentDigitalSignatures::getScriptingContentSignatureDefaultStreamName() + throw (css::uno::RuntimeException) +{ + return DocumentSignatureHelper::GetScriptingContentSignatureDefaultStreamName(); +} + + +sal_Bool DocumentDigitalSignatures::signPackage( + const Reference< css::embed::XStorage >& rxStorage, + const Reference< css::io::XStream >& xSignStream ) throw (RuntimeException) +{ + OSL_ENSURE(m_sODFVersion.getLength(),"DocumentDigitalSignatures: ODF Version not set, assuming minimum 1.2"); + return ImplViewSignatures( rxStorage, xSignStream, SignatureModePackage, false ); +} + +Sequence< css::security::DocumentSignatureInformation > +DocumentDigitalSignatures::verifyPackageSignatures( + const Reference< css::embed::XStorage >& rxStorage, + const Reference< css::io::XInputStream >& xSignInStream ) throw (RuntimeException) +{ + OSL_ENSURE(m_sODFVersion.getLength(),"DocumentDigitalSignatures: ODF Version not set, assuming minimum 1.2"); + return ImplVerifySignatures( rxStorage, xSignInStream, SignatureModePackage ); +} + +void DocumentDigitalSignatures::showPackageSignatures( + const Reference< css::embed::XStorage >& rxStorage, + const Reference< css::io::XInputStream >& xSignInStream ) throw (RuntimeException) +{ + OSL_ENSURE(m_sODFVersion.getLength(),"DocumentDigitalSignatures: ODF Version not set, assuming minimum 1.2"); + ImplViewSignatures( rxStorage, xSignInStream, SignatureModePackage, true ); +} + +::rtl::OUString DocumentDigitalSignatures::getPackageSignatureDefaultStreamName( ) + throw (::com::sun::star::uno::RuntimeException) +{ + return DocumentSignatureHelper::GetPackageSignatureDefaultStreamName(); +} + + +sal_Bool DocumentDigitalSignatures::ImplViewSignatures( + const Reference< css::embed::XStorage >& rxStorage, + const Reference< css::io::XInputStream >& xSignStream, + DocumentSignatureMode eMode, bool bReadOnly ) throw (RuntimeException) +{ + Reference< io::XStream > xStream; + if ( xSignStream.is() ) + xStream = Reference< io::XStream >( xSignStream, UNO_QUERY ); + return ImplViewSignatures( rxStorage, xStream, eMode, bReadOnly ); +} + +sal_Bool DocumentDigitalSignatures::ImplViewSignatures( + const Reference< css::embed::XStorage >& rxStorage, const Reference< css::io::XStream >& xSignStream, + DocumentSignatureMode eMode, bool bReadOnly ) throw (RuntimeException) +{ + sal_Bool bChanges = sal_False; + DigitalSignaturesDialog aSignaturesDialog( + NULL, mxCtx, eMode, bReadOnly, m_sODFVersion, m_bHasDocumentSignature); + bool bInit = aSignaturesDialog.Init( rtl::OUString() ); + DBG_ASSERT( bInit, "Error initializing security context!" ); + if ( bInit ) + { + aSignaturesDialog.SetStorage( rxStorage ); + aSignaturesDialog.SetSignatureStream( xSignStream ); + if ( aSignaturesDialog.Execute() ) + { + if ( aSignaturesDialog.SignaturesChanged() ) + { + bChanges = sal_True; + // If we have a storage and no stream, we are responsible for commit + if ( rxStorage.is() && !xSignStream.is() ) + { + uno::Reference< embed::XTransactedObject > xTrans( rxStorage, uno::UNO_QUERY ); + xTrans->commit(); + } + } + } + } + else + { + WarningBox aBox( NULL, XMLSEC_RES( RID_XMLSECWB_NO_MOZILLA_PROFILE ) ); + aBox.Execute(); + } + + return bChanges; +} + +Sequence< css::security::DocumentSignatureInformation > +DocumentDigitalSignatures::ImplVerifySignatures( + const Reference< css::embed::XStorage >& rxStorage, + const Reference< css::io::XInputStream >& xSignStream, DocumentSignatureMode eMode ) throw (RuntimeException) +{ + if (!rxStorage.is()) + { + DBG_ASSERT(0, "Error, no XStorage provided"); + return Sequence<css::security::DocumentSignatureInformation>(); + } + // First check for the InputStream, to avoid unnecessary initialization of the security environemnt... + SignatureStreamHelper aStreamHelper; + Reference< io::XInputStream > xInputStream = xSignStream; + + if ( !xInputStream.is() ) + { + aStreamHelper = DocumentSignatureHelper::OpenSignatureStream( rxStorage, embed::ElementModes::READ, eMode ); + if ( aStreamHelper.xSignatureStream.is() ) + xInputStream = Reference< io::XInputStream >( aStreamHelper.xSignatureStream, UNO_QUERY ); + } + + if ( !xInputStream.is() ) + return Sequence< ::com::sun::star::security::DocumentSignatureInformation >(0); + + + XMLSignatureHelper aSignatureHelper( mxCtx ); + + bool bInit = aSignatureHelper.Init( rtl::OUString() ); + + DBG_ASSERT( bInit, "Error initializing security context!" ); + + if ( !bInit ) + return Sequence< ::com::sun::star::security::DocumentSignatureInformation >(0); + + aSignatureHelper.SetStorage(rxStorage, m_sODFVersion); + + aSignatureHelper.StartMission(); + + aSignatureHelper.ReadAndVerifySignature( xInputStream ); + + aSignatureHelper.EndMission(); + + Reference< ::com::sun::star::xml::crypto::XSecurityEnvironment > xSecEnv = aSignatureHelper.GetSecurityEnvironment(); + + SignatureInformations aSignInfos = aSignatureHelper.GetSignatureInformations(); + int nInfos = aSignInfos.size(); + Sequence< css::security::DocumentSignatureInformation > aInfos(nInfos); + css::security::DocumentSignatureInformation* arInfos = aInfos.getArray(); + + if ( nInfos ) + { + Reference<security::XSerialNumberAdapter> xSerialNumberAdapter = + ::com::sun::star::security::SerialNumberAdapter::create(mxCtx); + + for( int n = 0; n < nInfos; ++n ) + { + DocumentSignatureAlgorithm mode = DocumentSignatureHelper::getDocumentAlgorithm( + m_sODFVersion, aSignInfos[n]); + const std::vector< rtl::OUString > aElementsToBeVerified = + DocumentSignatureHelper::CreateElementList( + rxStorage, ::rtl::OUString(), eMode, mode); + + const SignatureInformation& rInfo = aSignInfos[n]; + css::security::DocumentSignatureInformation& rSigInfo = arInfos[n]; + + if (rInfo.ouX509Certificate.getLength()) + rSigInfo.Signer = xSecEnv->createCertificateFromAscii( rInfo.ouX509Certificate ) ; + if (!rSigInfo.Signer.is()) + rSigInfo.Signer = xSecEnv->getCertificate( rInfo.ouX509IssuerName, xSerialNumberAdapter->toSequence( rInfo.ouX509SerialNumber ) ); + + // --> PB 2004-12-14 #i38744# time support again + Date aDate( rInfo.stDateTime.Day, rInfo.stDateTime.Month, rInfo.stDateTime.Year ); + Time aTime( rInfo.stDateTime.Hours, rInfo.stDateTime.Minutes, + rInfo.stDateTime.Seconds, rInfo.stDateTime.HundredthSeconds ); + rSigInfo.SignatureDate = aDate.GetDate(); + rSigInfo.SignatureTime = aTime.GetTime(); + + // Verify certificate + //We have patched our version of libxmlsec, so that it does not verify the certificates. This has two + //reasons. First we want two separate status for signature and certificate. Second libxmlsec calls + //CERT_VerifyCertificate (solaris, linux) falsly, so that it always regards the certificate as valid. + //On Window the checking of the certificate path is buggy. It does name matching (issuer, subject name) + //to find the parent certificate. It does not take into account that there can be several certificates + //with the same subject name. + if (rSigInfo.Signer.is()) + { + try { + rSigInfo.CertificateStatus = xSecEnv->verifyCertificate(rSigInfo.Signer, + Sequence<Reference<css::security::XCertificate> >()); + } catch (SecurityException& ) { + OSL_ENSURE(0, "Verification of certificate failed"); + rSigInfo.CertificateStatus = css::security::CertificateValidity::INVALID; + } + } + else + { + //We should always be aible to get the certificates because it is contained in the document, + //unless the document is damaged so that signature xml file could not be parsed. + rSigInfo.CertificateStatus = css::security::CertificateValidity::INVALID; + } + + rSigInfo.SignatureIsValid = ( rInfo.nStatus == ::com::sun::star::xml::crypto::SecurityOperationStatus_OPERATION_SUCCEEDED ); + + + if ( rSigInfo.SignatureIsValid ) + { + rSigInfo.SignatureIsValid = + DocumentSignatureHelper::checkIfAllFilesAreSigned( + aElementsToBeVerified, rInfo, mode); + } + if (eMode == SignatureModeDocumentContent) + rSigInfo.PartialDocumentSignature = + ! DocumentSignatureHelper::isOOo3_2_Signature(aSignInfos[n]); + + } + } + return aInfos; + +} + +void DocumentDigitalSignatures::manageTrustedSources( ) throw (RuntimeException) +{ + // MT: i45295 + // SecEnv is only needed to display certificate information from trusted sources. + // Macro Security also has some options where no security environment is needed, so raise dialog anyway. + // Later I should change the code so the Dialog creates the SecEnv on demand... + + Reference< dcss::xml::crypto::XSecurityEnvironment > xSecEnv; + + XMLSignatureHelper aSignatureHelper( mxCtx ); + if ( aSignatureHelper.Init( rtl::OUString() ) ) + xSecEnv = aSignatureHelper.GetSecurityEnvironment(); + + MacroSecurity aDlg( NULL, mxCtx, xSecEnv ); + aDlg.Execute(); +} + +void DocumentDigitalSignatures::showCertificate( + const Reference< css::security::XCertificate >& _Certificate ) throw (RuntimeException) +{ + XMLSignatureHelper aSignatureHelper( mxCtx ); + + bool bInit = aSignatureHelper.Init( rtl::OUString() ); + + DBG_ASSERT( bInit, "Error initializing security context!" ); + + if ( bInit ) + { + CertificateViewer aViewer( NULL, aSignatureHelper.GetSecurityEnvironment(), _Certificate, sal_False ); + aViewer.Execute(); + } + +} + +::sal_Bool DocumentDigitalSignatures::isAuthorTrusted( + const Reference< css::security::XCertificate >& Author ) throw (RuntimeException) +{ + sal_Bool bFound = sal_False; + + Reference<security::XSerialNumberAdapter> xSerialNumberAdapter = + ::com::sun::star::security::SerialNumberAdapter::create(mxCtx); + + ::rtl::OUString sSerialNum = xSerialNumberAdapter->toString( Author->getSerialNumber() ); + + Sequence< SvtSecurityOptions::Certificate > aTrustedAuthors = SvtSecurityOptions().GetTrustedAuthors(); + const SvtSecurityOptions::Certificate* pAuthors = aTrustedAuthors.getConstArray(); + const SvtSecurityOptions::Certificate* pAuthorsEnd = pAuthors + aTrustedAuthors.getLength(); + for ( ; pAuthors != pAuthorsEnd; ++pAuthors ) + { + SvtSecurityOptions::Certificate aAuthor = *pAuthors; + if ( ( aAuthor[0] == Author->getIssuerName() ) && ( aAuthor[1] == sSerialNum ) ) + { + bFound = sal_True; + break; + } + } + + return bFound; +} + +::sal_Bool DocumentDigitalSignatures::isLocationTrusted( const ::rtl::OUString& Location ) throw (RuntimeException) +{ + sal_Bool bFound = sal_False; + INetURLObject aLocObj( Location ); + INetURLObject aLocObjLowCase( Location.toAsciiLowerCase() ); // will be used for case insensitive comparing + + ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XContentProvider > xContentProvider; + ::ucbhelper::ContentBroker* pBroker = NULL; + + //warning free code + //if ( aLocObj.GetProtocol() == INET_PROT_FILE && ( pBroker = ::ucbhelper::ContentBroker::get() ) ) + // xContentProvider = pBroker->getContentProviderInterface(); + if ( aLocObj.GetProtocol() == INET_PROT_FILE) + { + pBroker = ::ucbhelper::ContentBroker::get(); + if (pBroker) + xContentProvider = pBroker->getContentProviderInterface(); + } + + Sequence< ::rtl::OUString > aSecURLs = SvtSecurityOptions().GetSecureURLs(); + const ::rtl::OUString* pSecURLs = aSecURLs.getConstArray(); + const ::rtl::OUString* pSecURLsEnd = pSecURLs + aSecURLs.getLength(); + for ( ; pSecURLs != pSecURLsEnd && !bFound; ++pSecURLs ) + bFound = ::utl::UCBContentHelper::IsSubPath( *pSecURLs, Location, xContentProvider ); + + return bFound; +} + +void DocumentDigitalSignatures::addAuthorToTrustedSources( + const Reference< css::security::XCertificate >& Author ) throw (RuntimeException) +{ + SvtSecurityOptions aSecOpts; + + Reference<security::XSerialNumberAdapter> xSerialNumberAdapter = + ::com::sun::star::security::SerialNumberAdapter::create(mxCtx); + + SvtSecurityOptions::Certificate aNewCert( 3 ); + aNewCert[ 0 ] = Author->getIssuerName(); + aNewCert[ 1 ] = xSerialNumberAdapter->toString( Author->getSerialNumber() ); + + rtl::OUStringBuffer aStrBuffer; + SvXMLUnitConverter::encodeBase64(aStrBuffer, Author->getEncoded()); + aNewCert[ 2 ] = aStrBuffer.makeStringAndClear(); + + + Sequence< SvtSecurityOptions::Certificate > aTrustedAuthors = aSecOpts.GetTrustedAuthors(); + sal_Int32 nCnt = aTrustedAuthors.getLength(); + aTrustedAuthors.realloc( nCnt + 1 ); + aTrustedAuthors[ nCnt ] = aNewCert; + + aSecOpts.SetTrustedAuthors( aTrustedAuthors ); +} + +void DocumentDigitalSignatures::addLocationToTrustedSources( const ::rtl::OUString& Location ) throw (RuntimeException) +{ + SvtSecurityOptions aSecOpt; + + Sequence< ::rtl::OUString > aSecURLs = aSecOpt.GetSecureURLs(); + sal_Int32 nCnt = aSecURLs.getLength(); + aSecURLs.realloc( nCnt + 1 ); + aSecURLs[ nCnt ] = Location; + + aSecOpt.SetSecureURLs( aSecURLs ); +} + +rtl::OUString DocumentDigitalSignatures::GetImplementationName() throw (RuntimeException) +{ + return rtl::OUString ( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.security.DocumentDigitalSignatures" ) ); +} + +Sequence< rtl::OUString > DocumentDigitalSignatures::GetSupportedServiceNames() throw (cssu::RuntimeException) +{ + Sequence < rtl::OUString > aRet(1); + rtl::OUString* pArray = aRet.getArray(); + pArray[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.security.DocumentDigitalSignatures" ) ); + return aRet; +} + + +Reference< XInterface > DocumentDigitalSignatures_CreateInstance( + const Reference< XComponentContext >& rCtx) throw ( Exception ) +{ + return (cppu::OWeakObject*) new DocumentDigitalSignatures( rCtx ); +} + diff --git a/xmlsecurity/source/component/documentdigitalsignatures.hxx b/xmlsecurity/source/component/documentdigitalsignatures.hxx new file mode 100644 index 000000000000..1102c65b43cb --- /dev/null +++ b/xmlsecurity/source/component/documentdigitalsignatures.hxx @@ -0,0 +1,101 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _XMLSECURITY_DOCUMENTDIGITALSIGNATURES_HXX +#define _XMLSECURITY_DOCUMENTDIGITALSIGNATURES_HXX + +#include <cppuhelper/implbase2.hxx> + +#include "com/sun/star/lang/XInitialization.hpp" +#include <com/sun/star/security/XDocumentDigitalSignatures.hpp> +#include <com/sun/star/io/XStream.hpp> +#include <com/sun/star/io/XInputStream.hpp> +#include <xmlsecurity/documentsignaturehelper.hxx> + +namespace com { namespace sun { namespace star { + + namespace uno { + class XComponentContext; + } +}}} + +class DocumentDigitalSignatures : public cppu::WeakImplHelper2 +< + com::sun::star::security::XDocumentDigitalSignatures, + com::sun::star::lang::XInitialization +> +{ +private: + com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > mxCtx; + // will be set by XInitialization. If not we assume true. false means an earlier version. + ::rtl::OUString m_sODFVersion; + //The number of arguments which were passed in XInitialization::initialize + int m_nArgumentsCount; + //Indicates if the document already contains a document signature + bool m_bHasDocumentSignature; + + sal_Bool ImplViewSignatures( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& rxStorage, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >& xSignStream, DocumentSignatureMode eMode, bool bReadOnly ) throw (::com::sun::star::uno::RuntimeException); + sal_Bool ImplViewSignatures( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& rxStorage, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xSignStream, DocumentSignatureMode eMode, bool bReadOnly ) throw (::com::sun::star::uno::RuntimeException); + com::sun::star::uno::Sequence< ::com::sun::star::security::DocumentSignatureInformation > ImplVerifySignatures( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& rxStorage, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xSignStream, DocumentSignatureMode eMode ) throw (::com::sun::star::uno::RuntimeException); + +public: + DocumentDigitalSignatures( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext>& rxCtx ); + + // for service registration... + static ::rtl::OUString GetImplementationName() throw (com::sun::star::uno::RuntimeException); + static ::com::sun::star::uno::Sequence < ::rtl::OUString > GetSupportedServiceNames() throw (com::sun::star::uno::RuntimeException); + + //XInitialization + void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments ) + throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException); + + // XDocumentDigitalSignatures + ::sal_Bool SAL_CALL signDocumentContent( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >& xSignStream ) throw (::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< ::com::sun::star::security::DocumentSignatureInformation > SAL_CALL verifyDocumentContentSignatures( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xSignInStream ) throw (::com::sun::star::uno::RuntimeException); + void SAL_CALL showDocumentContentSignatures( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xSignInStream ) throw (::com::sun::star::uno::RuntimeException); + ::rtl::OUString SAL_CALL getDocumentContentSignatureDefaultStreamName( ) throw (::com::sun::star::uno::RuntimeException); + ::sal_Bool SAL_CALL signScriptingContent( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >& xSignStream ) throw (::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< ::com::sun::star::security::DocumentSignatureInformation > SAL_CALL verifyScriptingContentSignatures( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xSignInStream ) throw (::com::sun::star::uno::RuntimeException); + void SAL_CALL showScriptingContentSignatures( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xSignInStream ) throw (::com::sun::star::uno::RuntimeException); + ::rtl::OUString SAL_CALL getScriptingContentSignatureDefaultStreamName( ) throw (::com::sun::star::uno::RuntimeException); + ::sal_Bool SAL_CALL signPackage( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& Storage, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >& xSignStream ) throw (::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< ::com::sun::star::security::DocumentSignatureInformation > SAL_CALL verifyPackageSignatures( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& Storage, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xSignInStream ) throw (::com::sun::star::uno::RuntimeException); + void SAL_CALL showPackageSignatures( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xSignInStream ) throw (::com::sun::star::uno::RuntimeException); + ::rtl::OUString SAL_CALL getPackageSignatureDefaultStreamName( ) throw (::com::sun::star::uno::RuntimeException); + void SAL_CALL showCertificate( const ::com::sun::star::uno::Reference< ::com::sun::star::security::XCertificate >& Certificate ) throw (::com::sun::star::uno::RuntimeException); + void SAL_CALL manageTrustedSources( ) throw (::com::sun::star::uno::RuntimeException); + ::sal_Bool SAL_CALL isAuthorTrusted( const ::com::sun::star::uno::Reference< ::com::sun::star::security::XCertificate >& Author ) throw (::com::sun::star::uno::RuntimeException); + ::sal_Bool SAL_CALL isLocationTrusted( const ::rtl::OUString& Location ) throw (::com::sun::star::uno::RuntimeException); + void SAL_CALL addAuthorToTrustedSources( const ::com::sun::star::uno::Reference< ::com::sun::star::security::XCertificate >& Author ) throw (::com::sun::star::uno::RuntimeException); + void SAL_CALL addLocationToTrustedSources( const ::rtl::OUString& Location ) throw (::com::sun::star::uno::RuntimeException); + +}; + +com::sun::star::uno::Reference< com::sun::star::uno::XInterface > SAL_CALL DocumentDigitalSignatures_CreateInstance( + const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rCtx) throw ( com::sun::star::uno::Exception ); + +#endif // _XMLSECURITY_DOCUMENTDIGITALSIGNATURES_HXX diff --git a/xmlsecurity/source/component/makefile.mk b/xmlsecurity/source/component/makefile.mk new file mode 100644 index 000000000000..9ad3db7208cc --- /dev/null +++ b/xmlsecurity/source/component/makefile.mk @@ -0,0 +1,54 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2000, 2010 Oracle and/or its affiliates. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# This file is part of OpenOffice.org. +# +# OpenOffice.org is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License version 3 +# only, as published by the Free Software Foundation. +# +# OpenOffice.org is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License version 3 for more details +# (a copy is included in the LICENSE file that accompanied this code). +# +# You should have received a copy of the GNU Lesser General Public License +# version 3 along with OpenOffice.org. If not, see +# <http://www.openoffice.org/license.html> +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +PRJ=..$/.. + +PRJNAME=xmlsecurity +TARGET=component + +ENABLE_EXCEPTIONS=TRUE + +# --- Settings ----------------------------------------------------- + +.INCLUDE : settings.mk +.INCLUDE : $(PRJ)$/util$/target.pmk + +# --- Files -------------------------------------------------------- + +SRS1NAME=component +SRC1FILES = \ + warnbox.src + +SLOFILES= \ + $(SLO)$/documentdigitalsignatures.obj \ + $(SLO)$/registerservices.obj \ + $(SLO)$/certificatecontainer.obj + +# --- Targets ------------------------------------------------------ + +.INCLUDE : target.mk + diff --git a/xmlsecurity/source/component/registerservices.cxx b/xmlsecurity/source/component/registerservices.cxx new file mode 100644 index 000000000000..0f6efeff05ce --- /dev/null +++ b/xmlsecurity/source/component/registerservices.cxx @@ -0,0 +1,88 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_xmlsecurity.hxx" + +#include <tools/debug.hxx> +#include <com/sun/star/lang/XSingleServiceFactory.hpp> + +#include <cppuhelper/factory.hxx> + + +#include <documentdigitalsignatures.hxx> +#include <certificatecontainer.hxx> + +using namespace ::com::sun::star; + +extern "C" +{ +void SAL_CALL component_getImplementationEnvironment( const sal_Char ** ppEnvTypeName, uno_Environment ** ) +{ + *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; +} + +void* SAL_CALL component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * /*pRegistryKey*/ ) +{ + void* pRet = 0; + uno::Reference< XInterface > xFactory; + + //Decryptor + rtl::OUString implName = rtl::OUString::createFromAscii( pImplName ); + + if ( pServiceManager && implName.equals( DocumentDigitalSignatures::GetImplementationName() ) ) + { + // DocumentDigitalSignatures + xFactory = cppu::createSingleComponentFactory( + DocumentDigitalSignatures_CreateInstance, + rtl::OUString::createFromAscii( pImplName ), + DocumentDigitalSignatures::GetSupportedServiceNames() ); + } + else if ( pServiceManager && implName.equals( CertificateContainer::impl_getStaticImplementationName() )) + { + // CertificateContainer + xFactory = cppu::createOneInstanceFactory( + reinterpret_cast< lang::XMultiServiceFactory * >( pServiceManager ), + rtl::OUString::createFromAscii( pImplName ), + CertificateContainer::impl_createInstance, + CertificateContainer::impl_getStaticSupportedServiceNames() ); + } + + if (xFactory.is()) + { + xFactory->acquire(); + pRet = xFactory.get(); + } + return pRet; +} + +} // extern "C" + + + + + diff --git a/xmlsecurity/source/component/warnbox.src b/xmlsecurity/source/component/warnbox.src new file mode 100644 index 000000000000..dd55cad7558b --- /dev/null +++ b/xmlsecurity/source/component/warnbox.src @@ -0,0 +1,36 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include <xmlsecurity/global.hrc> + +WarningBox RID_XMLSECWB_NO_MOZILLA_PROFILE +{ + Buttons = WB_OK ; + DefButton = WB_DEF_OK ; + Message [ en-US ] = "Digital signatures functionality could not be used, because no Mozilla user profile was found. Please check the Mozilla installation." ; +}; + diff --git a/xmlsecurity/source/dialogs/certificatechooser.cxx b/xmlsecurity/source/dialogs/certificatechooser.cxx new file mode 100644 index 000000000000..9e934d4e04f8 --- /dev/null +++ b/xmlsecurity/source/dialogs/certificatechooser.cxx @@ -0,0 +1,238 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_xmlsecurity.hxx" + +#include <xmlsecurity/certificatechooser.hxx> +#include <xmlsecurity/certificateviewer.hxx> +#include <xmlsecurity/biginteger.hxx> +#include <com/sun/star/xml/crypto/XSecurityEnvironment.hpp> +#include <comphelper/sequence.hxx> +#include <comphelper/processfactory.hxx> + +#include <com/sun/star/security/NoPasswordException.hpp> +#include <com/sun/star/security/CertificateCharacters.hpp> +#include <com/sun/star/security/SerialNumberAdapter.hpp> + +#include <dialogs.hrc> +#include <resourcemanager.hxx> +#include <vcl/msgbox.hxx> + +/* HACK: disable some warnings for MS-C */ +#ifdef _MSC_VER +#pragma warning (disable : 4355) // 4355: this used in initializer-list +#endif + +using namespace ::com::sun::star; + +#define INVAL_SEL 0xFFFF + +sal_uInt16 CertificateChooser::GetSelectedEntryPos( void ) const +{ + sal_uInt16 nSel = INVAL_SEL; + + SvLBoxEntry* pSel = maCertLB.FirstSelected(); + if( pSel ) + nSel = (sal_uInt16) ( sal_uIntPtr ) pSel->GetUserData(); + + return (sal_uInt16) nSel; +} + +CertificateChooser::CertificateChooser( Window* _pParent, uno::Reference< uno::XComponentContext>& _rxCtx, uno::Reference< dcss::xml::crypto::XSecurityEnvironment >& _rxSecurityEnvironment, const SignatureInformations& _rCertsToIgnore ) + :ModalDialog ( _pParent, XMLSEC_RES( RID_XMLSECDLG_CERTCHOOSER ) ) + ,maCertsToIgnore( _rCertsToIgnore ) + ,maHintFT ( this, XMLSEC_RES( FT_HINT_SELECT ) ) + ,maCertLB ( this, XMLSEC_RES( LB_SIGNATURES ) ) + ,maViewBtn ( this, XMLSEC_RES( BTN_VIEWCERT ) ) + ,maBottomSepFL ( this, XMLSEC_RES( FL_BOTTOM_SEP ) ) + ,maOKBtn ( this, XMLSEC_RES( BTN_OK ) ) + ,maCancelBtn ( this, XMLSEC_RES( BTN_CANCEL ) ) + ,maHelpBtn ( this, XMLSEC_RES( BTN_HELP ) ) +{ + static long nTabs[] = { 3, 0, 30*CS_LB_WIDTH/100, 60*CS_LB_WIDTH/100 }; + maCertLB.SetTabs( &nTabs[0] ); + maCertLB.InsertHeaderEntry( String( XMLSEC_RES( STR_HEADERBAR ) ) ); + maCertLB.SetSelectHdl( LINK( this, CertificateChooser, CertificateHighlightHdl ) ); + maCertLB.SetDoubleClickHdl( LINK( this, CertificateChooser, CertificateSelectHdl ) ); + maViewBtn.SetClickHdl( LINK( this, CertificateChooser, ViewButtonHdl ) ); + + FreeResource(); + + mxCtx = _rxCtx; + mxSecurityEnvironment = _rxSecurityEnvironment; + mbInitialized = sal_False; + + // disable buttons + CertificateHighlightHdl( NULL ); +} + +CertificateChooser::~CertificateChooser() +{ +} + +short CertificateChooser::Execute() +{ + // #i48432# + // We can't check for personal certificates before raising this dialog, + // because the mozilla implementation throws a NoPassword exception, + // if the user pressed cancel, and also if the database does not exist! + // But in the later case, the is no password query, and the user is confused + // that nothing happens when pressing "Add..." in the SignatureDialog. + + // PostUserEvent( LINK( this, CertificateChooser, Initialize ) ); + + // PostUserLink behavior is to slow, so do it directly before Execute(). + // Problem: This Dialog should be visible right now, and the parent should not be accessible. + // Show, Update, DIsableInput... + + Window* pMe = this; + Window* pParent = GetParent(); + if ( pParent ) + pParent->EnableInput( sal_False ); + pMe->Show(); + pMe->Update(); + ImplInitialize(); + if ( pParent ) + pParent->EnableInput( sal_True ); + return ModalDialog::Execute(); +} + +// IMPL_LINK( CertificateChooser, Initialize, void*, EMPTYARG ) +void CertificateChooser::ImplInitialize() +{ + if ( !mbInitialized ) + { + try + { + maCerts = mxSecurityEnvironment->getPersonalCertificates(); + } + catch (security::NoPasswordException&) + { + } + + uno::Reference< dcss::security::XSerialNumberAdapter> xSerialNumberAdapter = + ::com::sun::star::security::SerialNumberAdapter::create(mxCtx); + + sal_Int32 nCertificates = maCerts.getLength(); + sal_Int32 nCertificatesToIgnore = maCertsToIgnore.size(); + for( sal_Int32 nCert = nCertificates; nCert; ) + { + uno::Reference< security::XCertificate > xCert = maCerts[ --nCert ]; + sal_Bool bIgnoreThis = false; + + // Do we already use that? + if( nCertificatesToIgnore ) + { + rtl::OUString aIssuerName = xCert->getIssuerName(); + for( sal_Int32 nSig = 0; nSig < nCertificatesToIgnore; ++nSig ) + { + const SignatureInformation& rInf = maCertsToIgnore[ nSig ]; + if ( ( aIssuerName == rInf.ouX509IssuerName ) && + ( xSerialNumberAdapter->toString( xCert->getSerialNumber() ) == rInf.ouX509SerialNumber ) ) + { + bIgnoreThis = true; + break; + } + } + } + + if ( !bIgnoreThis ) + { + // Check if we have a private key for this... + long nCertificateCharacters = mxSecurityEnvironment->getCertificateCharacters( xCert ); + + if ( !( nCertificateCharacters & security::CertificateCharacters::HAS_PRIVATE_KEY ) ) + bIgnoreThis = true; + + } + + if ( bIgnoreThis ) + { + ::comphelper::removeElementAt( maCerts, nCert ); + nCertificates = maCerts.getLength(); + } + } + + // fill list of certificates; the first entry will be selected + for ( sal_Int32 nC = 0; nC < nCertificates; ++nC ) + { + String sEntry( XmlSec::GetContentPart( maCerts[ nC ]->getSubjectName() ) ); + sEntry += '\t'; + sEntry += XmlSec::GetContentPart( maCerts[ nC ]->getIssuerName() ); + sEntry += '\t'; + sEntry += XmlSec::GetDateString( maCerts[ nC ]->getNotValidAfter() ); + SvLBoxEntry* pEntry = maCertLB.InsertEntry( sEntry ); + pEntry->SetUserData( ( void* )nC ); // missuse user data as index + } + + // enable/disable buttons + CertificateHighlightHdl( NULL ); + mbInitialized = sal_True; + } +} + + +uno::Reference< dcss::security::XCertificate > CertificateChooser::GetSelectedCertificate() +{ + uno::Reference< dcss::security::XCertificate > xCert; + sal_uInt16 nSelected = GetSelectedEntryPos(); + if ( nSelected < maCerts.getLength() ) + xCert = maCerts[ nSelected ]; + return xCert; +} + +IMPL_LINK( CertificateChooser, CertificateHighlightHdl, void*, EMPTYARG ) +{ + sal_Bool bEnable = GetSelectedCertificate().is(); + maViewBtn.Enable( bEnable ); + maOKBtn.Enable( bEnable ); + return 0; +} + +IMPL_LINK( CertificateChooser, CertificateSelectHdl, void*, EMPTYARG ) +{ + EndDialog( RET_OK ); + return 0; +} + +IMPL_LINK( CertificateChooser, ViewButtonHdl, Button*, EMPTYARG ) +{ + ImplShowCertificateDetails(); + return 0; +} + +void CertificateChooser::ImplShowCertificateDetails() +{ + uno::Reference< dcss::security::XCertificate > xCert = GetSelectedCertificate(); + if( xCert.is() ) + { + CertificateViewer aViewer( this, mxSecurityEnvironment, xCert, sal_True ); + aViewer.Execute(); + } +} + diff --git a/xmlsecurity/source/dialogs/certificatechooser.src b/xmlsecurity/source/dialogs/certificatechooser.src new file mode 100644 index 000000000000..be0585d2bcd8 --- /dev/null +++ b/xmlsecurity/source/dialogs/certificatechooser.src @@ -0,0 +1,88 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "dialogs.hrc" +#include "helpids.hrc" + +ModalDialog RID_XMLSECDLG_CERTCHOOSER +{ + HelpId = HID_XMLSEC_DLG_CERTCHOOSER; + Size = MAP_APPFONT( CS_WIDTH, CS_HEIGHT ); + OutputSize = TRUE; + Closeable = TRUE; + Moveable = TRUE; + SVLook = TRUE; + + Text [ en-US ] = "Select Certificate"; + + FixedText FT_HINT_SELECT + { + Pos = MAP_APPFONT( CS_COL_0, CS_ROW_0 ); + Size = MAP_APPFONT( CS_COL_2-CS_COL_0, RSC_CD_FIXEDTEXT_HEIGHT ); + Text [ en-US ] = "Select the certificate you want to use for signing"; + }; + Control LB_SIGNATURES + { + HelpId = HID_XMLSEC_CTRL_CHOOSESIGNATURES; + Pos = MAP_APPFONT( CS_COL_0, CS_ROW_1 ); + Size = MAP_APPFONT( CS_LB_WIDTH, CS_ROW_2-CS_ROW_1 ); + SVLook = TRUE; + Border = TRUE; + }; + String STR_HEADERBAR + { + Text [ en-US ] = "Issued to\tIssued by\tExpiration date"; + }; + PushButton BTN_VIEWCERT + { + HelpID = "xmlsecurity:PushButton:RID_XMLSECDLG_CERTCHOOSER:BTN_VIEWCERT"; + Pos = MAP_APPFONT( CS_COL_1, CS_ROW_3 ); + Size = MAP_APPFONT( CS_COL_2-CS_COL_1, RSC_CD_PUSHBUTTON_HEIGHT ); + Text [ en-US ] = "View Certificate..."; + }; + FixedLine FL_BOTTOM_SEP + { + Pos = MAP_APPFONT( 0, DLGS_BOTTOM_FL_Y( CS_HEIGHT ) ); + Size = MAP_APPFONT( CS_WIDTH, RSC_CD_FIXEDLINE_HEIGHT ); + }; + OKButton BTN_OK + { + DefButton = TRUE; + Pos = MAP_APPFONT( DLGS_BOTTOM_OK_X( CS_WIDTH ), DLGS_BOTTOM_BTN_Y( CS_HEIGHT ) ); + Size = MAP_APPFONT( RSC_CD_PUSHBUTTON_WIDTH, RSC_CD_PUSHBUTTON_HEIGHT ); + }; + CancelButton BTN_CANCEL + { + Pos = MAP_APPFONT( DLGS_BOTTOM_CANCEL_X( CS_WIDTH ), DLGS_BOTTOM_BTN_Y( CS_HEIGHT ) ); + Size = MAP_APPFONT( RSC_CD_PUSHBUTTON_WIDTH, RSC_CD_PUSHBUTTON_HEIGHT ); + }; + HelpButton BTN_HELP + { + Pos = MAP_APPFONT( DLGS_BOTTOM_HELP_X( CS_WIDTH ), DLGS_BOTTOM_BTN_Y( CS_HEIGHT ) ); + Size = MAP_APPFONT( RSC_CD_PUSHBUTTON_WIDTH, RSC_CD_PUSHBUTTON_HEIGHT ); + }; +}; diff --git a/xmlsecurity/source/dialogs/certificateviewer.cxx b/xmlsecurity/source/dialogs/certificateviewer.cxx new file mode 100644 index 000000000000..3b38045938f2 --- /dev/null +++ b/xmlsecurity/source/dialogs/certificateviewer.cxx @@ -0,0 +1,550 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_xmlsecurity.hxx" +#include <xmlsecurity/certificateviewer.hxx> +#include <com/sun/star/security/XCertificate.hpp> + +#include <com/sun/star/security/CertificateCharacters.hpp> +#include <com/sun/star/xml/crypto/XSecurityEnvironment.hpp> +#include <com/sun/star/security/CertificateValidity.hpp> + +#include <unotools/localedatawrapper.hxx> +#include <unotools/datetime.hxx> + +#include "dialogs.hrc" +#include "resourcemanager.hxx" + +/* HACK: disable some warnings for MS-C */ +#ifdef _MSC_VER +#pragma warning (disable : 4355) // 4355: this used in initializer-list +#endif + +using namespace ::com::sun::star; +using namespace ::com::sun::star::uno; +namespace css = ::com::sun::star; + + +namespace +{ + void ShrinkToFit( FixedImage& _rImage ); + void AdjustPosAndSize( Control& _rCtrl, Point& _rStartIn_EndOut, long _nXOffset = 0 ); + + void ShrinkToFit( FixedImage& _rImg ) + { + _rImg.SetSizePixel( _rImg.GetImage().GetSizePixel() ); + } + + void AdjustPosAndSize( Control& _rCtrl, Point& _rStartIn_EndOut, long _nOffs ) + { + _rCtrl.SetPosPixel( _rStartIn_EndOut ); + _rStartIn_EndOut.X() += XmlSec::ShrinkToFitWidth( _rCtrl, _nOffs ); + } +} + +CertificateViewer::CertificateViewer( + Window* _pParent, + const cssu::Reference< dcss::xml::crypto::XSecurityEnvironment >& _rxSecurityEnvironment, + const cssu::Reference< dcss::security::XCertificate >& _rXCert, sal_Bool bCheckForPrivateKey ) + :TabDialog ( _pParent, XMLSEC_RES( RID_XMLSECDLG_CERTVIEWER ) ) + ,maTabCtrl ( this, XMLSEC_RES( 1 ) ) + ,maOkBtn ( this, XMLSEC_RES( BTN_OK ) ) + ,maHelpBtn ( this, XMLSEC_RES( BTN_HELP ) ) +{ + FreeResource(); + + mbCheckForPrivateKey = bCheckForPrivateKey; + + mxSecurityEnvironment = _rxSecurityEnvironment; + mxCert = _rXCert; + + maTabCtrl.SetTabPage( RID_XMLSECTP_GENERAL, new CertificateViewerGeneralTP( &maTabCtrl, this ) ); + maTabCtrl.SetTabPage( RID_XMLSECTP_DETAILS, new CertificateViewerDetailsTP( &maTabCtrl, this ) ); + maTabCtrl.SetTabPage( RID_XMLSECTP_CERTPATH, new CertificateViewerCertPathTP( &maTabCtrl, this ) ); + maTabCtrl.SetCurPageId( RID_XMLSECTP_GENERAL ); +} + +CertificateViewer::~CertificateViewer() +{ + delete maTabCtrl.GetTabPage( RID_XMLSECTP_CERTPATH ); + delete maTabCtrl.GetTabPage( RID_XMLSECTP_DETAILS ); + delete maTabCtrl.GetTabPage( RID_XMLSECTP_GENERAL ); +} + +CertificateViewerTP::CertificateViewerTP( Window* _pParent, const ResId& _rResId, CertificateViewer* _pDlg ) + :TabPage ( _pParent, _rResId ) + ,mpDlg ( _pDlg ) +{ +} + + +CertificateViewerGeneralTP::CertificateViewerGeneralTP( Window* _pParent, CertificateViewer* _pDlg ) + :CertificateViewerTP ( _pParent, XMLSEC_RES( RID_XMLSECTP_GENERAL ), _pDlg ) + ,maFrameWin ( this, XMLSEC_RES( WIN_FRAME ) ) + ,maCertImg ( this, XMLSEC_RES( IMG_CERT ) ) + ,maCertInfoFI ( this, XMLSEC_RES( FI_CERTINFO ) ) + ,maSep1FL ( this, XMLSEC_RES( FL_SEP1 ) ) + ,maHintNotTrustedFI ( this, XMLSEC_RES( FI_HINTNOTTRUST ) ) + ,maSep2FL ( this, XMLSEC_RES( FL_SEP2 ) ) + ,maIssuedToLabelFI ( this, XMLSEC_RES( FI_ISSTOLABEL ) ) + ,maIssuedToFI ( this, XMLSEC_RES( FI_ISSTO ) ) + ,maIssuedByLabelFI ( this, XMLSEC_RES( FI_ISSBYLABEL ) ) + ,maIssuedByFI ( this, XMLSEC_RES( FI_ISSBY ) ) + ,maValidDateFI ( this, XMLSEC_RES( FI_VALIDDATE ) ) + ,maKeyImg ( this, XMLSEC_RES( IMG_KEY ) ) + ,maHintCorrespPrivKeyFI ( this, XMLSEC_RES( FI_CORRPRIVKEY ) ) +{ + if ( GetSettings().GetStyleSettings().GetHighContrastMode() ) + maKeyImg.SetImage( Image( XMLSEC_RES( IMG_KEY_HC ) ) ); + + //Verify the certificate + sal_Int32 certStatus = mpDlg->mxSecurityEnvironment->verifyCertificate(mpDlg->mxCert, + Sequence<Reference<css::security::XCertificate> >()); + + bool bCertValid = certStatus == css::security::CertificateValidity::VALID ? true : false; + + bool bHC = GetSettings().GetStyleSettings().GetHighContrastMode(); + if ( !bCertValid ) + { + maCertImg.SetImage( + Image( XMLSEC_RES( bHC ? IMG_STATE_NOT_VALIDATED_HC : IMG_STATE_NOT_VALIDATED ) ) ); + maHintNotTrustedFI.SetText( String( XMLSEC_RES( STR_CERTIFICATE_NOT_VALIDATED ) ) ); + } + else if ( bHC ) + maCertImg.SetImage( Image( XMLSEC_RES( IMG_STATE_CERIFICATED_HC ) ) ); + + FreeResource(); + + Wallpaper aBack( GetSettings().GetStyleSettings().GetWindowColor() ); + maFrameWin.SetBackground( aBack ); + maCertImg.SetBackground( aBack ); + maCertInfoFI.SetBackground( aBack ); + maSep1FL.SetBackground( aBack ); + maHintNotTrustedFI.SetBackground( aBack ); + maSep2FL.SetBackground( aBack ); + maIssuedToLabelFI.SetBackground( aBack ); + maIssuedToFI.SetBackground( aBack ); + maIssuedByLabelFI.SetBackground( aBack ); + maIssuedByFI.SetBackground( aBack ); + maValidDateFI.SetBackground( aBack ); + maKeyImg.SetBackground( aBack ); + maHintCorrespPrivKeyFI.SetBackground( aBack ); + + // make some bold + Font aFnt( maCertInfoFI.GetFont() ); + aFnt.SetWeight( WEIGHT_BOLD ); + maCertInfoFI.SetFont( aFnt ); + maHintNotTrustedFI.SetFont( aFnt ); + maIssuedToLabelFI.SetFont( aFnt ); + maIssuedByLabelFI.SetFont( aFnt ); + maValidDateFI.SetFont( aFnt ); + + // insert data + cssu::Reference< dcss::security::XCertificate > xCert = mpDlg->mxCert; + + maIssuedToFI.SetText( XmlSec::GetContentPart( xCert->getSubjectName() ) ); + maIssuedByFI.SetText( XmlSec::GetContentPart( xCert->getIssuerName() ) ); + + // dynamic length because of the different languages + long nWidth1 = maIssuedToLabelFI.GetTextWidth( maIssuedToLabelFI.GetText() ); + long nWidth2 = maIssuedByLabelFI.GetTextWidth( maIssuedByLabelFI.GetText() ); + long nNewWidth = Max( nWidth1, nWidth2 ) + 5; + Size aNewSize = maIssuedToLabelFI.GetSizePixel(); + aNewSize.Width() = nNewWidth; + maIssuedToLabelFI.SetSizePixel( aNewSize ); + maIssuedByLabelFI.SetSizePixel( aNewSize ); + long nNewX = maIssuedToLabelFI.GetPosPixel().X() + nNewWidth + 1; + Point aNewPos = maIssuedToFI.GetPosPixel(); + aNewPos.X() = nNewX; + maIssuedToFI.SetPosPixel( aNewPos ); + aNewPos = maIssuedByFI.GetPosPixel(); + aNewPos.X() = nNewX; + maIssuedByFI.SetPosPixel( aNewPos ); + nNewWidth = maValidDateFI.GetSizePixel().Width() - nNewX; + aNewSize = maIssuedToFI.GetSizePixel(); + aNewSize.Width() = nNewWidth; + maIssuedToFI.SetSizePixel( aNewSize ); + maIssuedByFI.SetSizePixel( aNewSize ); + + DateTime aDateTimeStart; + DateTime aDateTimeEnd; + utl::typeConvert( xCert->getNotValidBefore(), aDateTimeStart ); + utl::typeConvert( xCert->getNotValidAfter(), aDateTimeEnd ); + String sText = maValidDateFI.GetText(); + sText.SearchAndReplace( String::CreateFromAscii( "%SDATE%" ), + GetSettings().GetUILocaleDataWrapper().getDate( aDateTimeStart.GetDate() ) ); + sText.SearchAndReplace( String::CreateFromAscii( "%EDATE%" ), + GetSettings().GetUILocaleDataWrapper().getDate( aDateTimeEnd.GetDate() ) ); + maValidDateFI.SetText( sText ); + + // adjust position of fixed text depending on image sizes + ShrinkToFit( maCertImg ); + ShrinkToFit( maKeyImg ); + XmlSec::AlignAfterImage( maCertImg, maCertInfoFI, 12 ); + XmlSec::AlignAfterImage( maKeyImg, maHintCorrespPrivKeyFI, 12 ); + + // Check if we have the private key... + sal_Bool bHasPrivateKey = sal_False; + // #i41270# Check only if we have that certificate in our security environment + if ( _pDlg->mbCheckForPrivateKey ) + { + long nCertificateCharacters = _pDlg->mxSecurityEnvironment->getCertificateCharacters( xCert ); + bHasPrivateKey = ( nCertificateCharacters & security::CertificateCharacters::HAS_PRIVATE_KEY ) ? sal_True : sal_False; + } + if ( !bHasPrivateKey ) + { + maKeyImg.Hide(); + maHintCorrespPrivKeyFI.Hide(); + } +} + +void CertificateViewerGeneralTP::ActivatePage() +{ + +} + + +struct Details_UserDatat +{ + String maTxt; + bool mbFixedWidthFont; + + inline Details_UserDatat( const String& _rTxt, bool _bFixedWidthFont ); +}; + +inline Details_UserDatat::Details_UserDatat( const String& _rTxt, bool _bFixedWidthFont ) + :maTxt ( _rTxt ) + ,mbFixedWidthFont ( _bFixedWidthFont ) +{ +} + + +void CertificateViewerDetailsTP::Clear( void ) +{ + maElementML.SetText( String() ); + sal_uLong i = 0; + SvLBoxEntry* pEntry = maElementsLB.GetEntry( i ); + while( pEntry ) + { + delete ( Details_UserDatat* ) pEntry->GetUserData(); + ++i; + pEntry = maElementsLB.GetEntry( i ); + } + + maElementsLB.Clear(); +} + +void CertificateViewerDetailsTP::InsertElement( const String& _rField, const String& _rValue, + const String& _rDetails, bool _bFixedWidthFont ) +{ + SvLBoxEntry* pEntry = maElementsLB.InsertEntry( _rField ); + maElementsLB.SetEntryText( _rValue, pEntry, 1 ); + pEntry->SetUserData( ( void* ) new Details_UserDatat( _rDetails, _bFixedWidthFont ) ); +} + +CertificateViewerDetailsTP::CertificateViewerDetailsTP( Window* _pParent, CertificateViewer* _pDlg ) + :CertificateViewerTP ( _pParent, XMLSEC_RES( RID_XMLSECTP_DETAILS ), _pDlg ) + ,maElementsLB ( this, XMLSEC_RES( LB_ELEMENTS ) ) + ,maElementML ( this, XMLSEC_RES( ML_ELEMENT ) ) + ,maStdFont ( maElementML.GetControlFont() ) + ,maFixedWidthFont ( OutputDevice::GetDefaultFont( DEFAULTFONT_UI_FIXED, LANGUAGE_DONTKNOW, DEFAULTFONT_FLAGS_ONLYONE, this ) ) +{ + WinBits nStyle = maElementsLB.GetStyle(); + nStyle &= ~WB_HSCROLL; + maElementsLB.SetStyle( nStyle ); + + maFixedWidthFont.SetHeight( maStdFont.GetHeight() ); + + static long nTabs[] = { 2, 0, 30*CS_LB_WIDTH/100 }; + maElementsLB.SetTabs( &nTabs[ 0 ] ); + maElementsLB.InsertHeaderEntry( String( XMLSEC_RES( STR_HEADERBAR ) ) ); + + // fill list box + Reference< security::XCertificate > xCert = mpDlg->mxCert; + sal_uInt16 nLineBreak = 16; + const char* pHexSep = " "; + String aLBEntry; + String aDetails; + // --> PB 2004-10-11 #i35107# - 0 == "V1", 1 == "V2", ..., n = "V(n+1)" + aLBEntry = String::CreateFromAscii( "V" ); + aLBEntry += String::CreateFromInt32( xCert->getVersion() + 1 ); + // <-- + InsertElement( String( XMLSEC_RES( STR_VERSION ) ), aLBEntry, aLBEntry ); + Sequence< sal_Int8 > aSeq = xCert->getSerialNumber(); + aLBEntry = XmlSec::GetHexString( aSeq, pHexSep ); + aDetails = XmlSec::GetHexString( aSeq, pHexSep, nLineBreak ); + InsertElement( String( XMLSEC_RES( STR_SERIALNUM ) ), aLBEntry, aDetails, true ); + + std::pair< ::rtl::OUString, ::rtl::OUString> pairIssuer = + XmlSec::GetDNForCertDetailsView(xCert->getIssuerName()); + aLBEntry = pairIssuer.first; + aDetails = pairIssuer.second; + InsertElement( String( XMLSEC_RES( STR_ISSUER ) ), aLBEntry, aDetails ); + /* + aSeq = xCert->getIssuerUniqueID(); + aLBEntry = XmlSec::GetHexString( aSeq, pHexSep ); + aDetails = XmlSec::GetHexString( aSeq, pHexSep, nLineBreak ); + InsertElement( String( XMLSEC_RES( STR_ISSUER_ID ) ), aLBEntry, aDetails, true ); + */ + + DateTime aDateTime; + utl::typeConvert( xCert->getNotValidBefore(), aDateTime ); + aLBEntry = GetSettings().GetUILocaleDataWrapper().getDate( aDateTime.GetDate() ); + aLBEntry += String::CreateFromAscii( " " ); + aLBEntry += GetSettings().GetUILocaleDataWrapper().getTime( aDateTime.GetTime() ); + InsertElement( String( XMLSEC_RES( STR_VALIDFROM ) ), aLBEntry, aLBEntry ); + utl::typeConvert( xCert->getNotValidAfter(), aDateTime ); + aLBEntry = GetSettings().GetUILocaleDataWrapper().getDate( aDateTime.GetDate() ); + aLBEntry += String::CreateFromAscii( " " ); + aLBEntry += GetSettings().GetUILocaleDataWrapper().getTime( aDateTime.GetTime() ); + InsertElement( String( XMLSEC_RES( STR_VALIDTO ) ), aLBEntry, aLBEntry ); + + std::pair< ::rtl::OUString, ::rtl::OUString > pairSubject = + XmlSec::GetDNForCertDetailsView(xCert->getSubjectName()); + aLBEntry = pairSubject.first; + aDetails = pairSubject.second; + InsertElement( String( XMLSEC_RES( STR_SUBJECT ) ), aLBEntry, aDetails ); + /* + aSeq = xCert->getSubjectUniqueID(); + aLBEntry = XmlSec::GetHexString( aSeq, pHexSep ); + aDetails = XmlSec::GetHexString( aSeq, pHexSep, nLineBreak ); + InsertElement( String( XMLSEC_RES( STR_SUBJECT_ID ) ), aLBEntry, aDetails, true ); + */ + aLBEntry = aDetails = xCert->getSubjectPublicKeyAlgorithm(); + InsertElement( String( XMLSEC_RES( STR_SUBJECT_PUBKEY_ALGO ) ), aLBEntry, aDetails ); + aSeq = xCert->getSubjectPublicKeyValue(); + aLBEntry = XmlSec::GetHexString( aSeq, pHexSep ); + aDetails = XmlSec::GetHexString( aSeq, pHexSep, nLineBreak ); + InsertElement( String( XMLSEC_RES( STR_SUBJECT_PUBKEY_VAL ) ), aLBEntry, aDetails, true ); + + aLBEntry = aDetails = xCert->getSignatureAlgorithm(); + InsertElement( String( XMLSEC_RES( STR_SIGNATURE_ALGO ) ), aLBEntry, aDetails ); + + aSeq = xCert->getSHA1Thumbprint(); + aLBEntry = XmlSec::GetHexString( aSeq, pHexSep ); + aDetails = XmlSec::GetHexString( aSeq, pHexSep, nLineBreak ); + InsertElement( String( XMLSEC_RES( STR_THUMBPRINT_SHA1 ) ), aLBEntry, aDetails, true ); + + aSeq = xCert->getMD5Thumbprint(); + aLBEntry = XmlSec::GetHexString( aSeq, pHexSep ); + aDetails = XmlSec::GetHexString( aSeq, pHexSep, nLineBreak ); + InsertElement( String( XMLSEC_RES( STR_THUMBPRINT_MD5 ) ), aLBEntry, aDetails, true ); + + FreeResource(); + + maElementsLB.SetSelectHdl( LINK( this, CertificateViewerDetailsTP, ElementSelectHdl ) ); +} + +CertificateViewerDetailsTP::~CertificateViewerDetailsTP() +{ + Clear(); +} + +void CertificateViewerDetailsTP::ActivatePage() +{ +} + +IMPL_LINK( CertificateViewerDetailsTP, ElementSelectHdl, void*, EMPTYARG ) +{ + SvLBoxEntry* pEntry = maElementsLB.FirstSelected(); + String aElementText; + bool bFixedWidthFont; + if( pEntry ) + { + const Details_UserDatat* p = ( Details_UserDatat* ) pEntry->GetUserData(); + aElementText = p->maTxt; + bFixedWidthFont = p->mbFixedWidthFont; + } + else + bFixedWidthFont = false; + + maElementML.SetFont( bFixedWidthFont? maFixedWidthFont : maStdFont ); + maElementML.SetControlFont( bFixedWidthFont? maFixedWidthFont : maStdFont ); + maElementML.SetText( aElementText ); + + return 0; +} + +struct CertPath_UserData +{ + cssu::Reference< dcss::security::XCertificate > mxCert; + String maStatus; + bool mbValid; + + CertPath_UserData( cssu::Reference< dcss::security::XCertificate > xCert, bool bValid): + mxCert(xCert), + mbValid(bValid) + { + } +}; + + +CertificateViewerCertPathTP::CertificateViewerCertPathTP( Window* _pParent, CertificateViewer* _pDlg ) + :CertificateViewerTP ( _pParent, XMLSEC_RES( RID_XMLSECTP_CERTPATH ), _pDlg ) + ,maCertPathFT ( this, XMLSEC_RES( FT_CERTPATH ) ) + ,maCertPathLB ( this, XMLSEC_RES( LB_SIGNATURES ) ) + ,maViewCertPB ( this, XMLSEC_RES( BTN_VIEWCERT ) ) + ,maCertStatusFT ( this, XMLSEC_RES( FT_CERTSTATUS ) ) + ,maCertStatusML ( this, XMLSEC_RES( ML_CERTSTATUS ) ) + ,mpParent ( _pDlg ) + ,mbFirstActivateDone ( false ) + ,maCertImage ( XMLSEC_RES( IMG_CERT_SMALL ) ) + ,maCertNotValidatedImage( XMLSEC_RES( IMG_CERT_NOTVALIDATED_SMALL ) ) + ,msCertOK ( XMLSEC_RES( STR_PATH_CERT_OK ) ) + ,msCertNotValidated ( XMLSEC_RES( STR_PATH_CERT_NOT_VALIDATED ) ) + +{ + if ( GetSettings().GetStyleSettings().GetHighContrastMode() ) + { + maCertImage = Image( XMLSEC_RES( IMG_CERT_SMALL_HC ) ); + maCertNotValidatedImage = Image( XMLSEC_RES( IMG_CERT_NOTVALIDATED_SMALL_HC ) ); + } + + FreeResource(); + + maCertPathLB.SetNodeDefaultImages(); + maCertPathLB.SetSublistOpenWithLeftRight(); + maCertPathLB.SetSelectHdl( LINK( this, CertificateViewerCertPathTP, CertSelectHdl ) ); + maViewCertPB.SetClickHdl( LINK( this, CertificateViewerCertPathTP, ViewCertHdl ) ); + + // check if buttontext is to wide + const long nOffset = 10; + String sText = maViewCertPB.GetText(); + long nTxtW = maViewCertPB.GetTextWidth( sText ); + if ( sText.Search( '~' ) == STRING_NOTFOUND ) + nTxtW += nOffset; + long nBtnW = maViewCertPB.GetSizePixel().Width(); + if ( nTxtW > nBtnW ) + { + // broaden the button + long nDelta = nTxtW - nBtnW; + Size aNewSize = maViewCertPB.GetSizePixel(); + aNewSize.Width() += nDelta; + maViewCertPB.SetSizePixel( aNewSize ); + // and give it a new position + Point aNewPos = maViewCertPB.GetPosPixel(); + aNewPos.X() -= nDelta; + maViewCertPB.SetPosPixel( aNewPos ); + } +} + +CertificateViewerCertPathTP::~CertificateViewerCertPathTP() +{ + Clear(); +} + +void CertificateViewerCertPathTP::ActivatePage() +{ + if ( !mbFirstActivateDone ) + { + mbFirstActivateDone = true; + Sequence< Reference< security::XCertificate > > aCertPath = + mpParent->mxSecurityEnvironment->buildCertificatePath( mpParent->mxCert ); + const Reference< security::XCertificate >* pCertPath = aCertPath.getConstArray(); + + String aState; + sal_Int32 i, nCnt = aCertPath.getLength(); + SvLBoxEntry* pParent = NULL; + for( i = nCnt; i; ) + { + const Reference< security::XCertificate > rCert = pCertPath[ --i ]; + String sName = XmlSec::GetContentPart( rCert->getSubjectName() ); + //Verify the certificate + sal_Int32 certStatus = mpDlg->mxSecurityEnvironment->verifyCertificate(rCert, + Sequence<Reference<css::security::XCertificate> >()); + bool bCertValid = certStatus == css::security::CertificateValidity::VALID ? true : false; + pParent = InsertCert( pParent, sName, rCert, bCertValid); + } + + maCertPathLB.Select( pParent ); + maViewCertPB.Disable(); // Own certificate selected + + while( pParent ) + { + maCertPathLB.Expand( pParent ); + pParent = maCertPathLB.GetParent( pParent ); + } + + CertSelectHdl( NULL ); + } +} + +IMPL_LINK( CertificateViewerCertPathTP, ViewCertHdl, void*, EMPTYARG ) +{ + SvLBoxEntry* pEntry = maCertPathLB.FirstSelected(); + if( pEntry ) + { + CertificateViewer aViewer( this, mpDlg->mxSecurityEnvironment, ((CertPath_UserData*)pEntry->GetUserData())->mxCert, sal_False ); + aViewer.Execute(); + } + + return 0; +} + +IMPL_LINK( CertificateViewerCertPathTP, CertSelectHdl, void*, EMPTYARG ) +{ + String sStatus; + SvLBoxEntry* pEntry = maCertPathLB.FirstSelected(); + if( pEntry ) + { + CertPath_UserData* pData = (CertPath_UserData*) pEntry->GetUserData(); + if ( pData ) + sStatus = pData->mbValid ? msCertOK : msCertNotValidated; + } + + maCertStatusML.SetText( sStatus ); + maViewCertPB.Enable( pEntry && ( pEntry != maCertPathLB.Last() ) ); + return 0; +} + +void CertificateViewerCertPathTP::Clear( void ) +{ + maCertStatusML.SetText( String() ); + sal_uLong i = 0; + SvLBoxEntry* pEntry = maCertPathLB.GetEntry( i ); + while( pEntry ) + { + delete ( CertPath_UserData* ) pEntry->GetUserData(); + ++i; + pEntry = maCertPathLB.GetEntry( i ); + } + + maCertPathLB.Clear(); +} + +SvLBoxEntry* CertificateViewerCertPathTP::InsertCert( + SvLBoxEntry* _pParent, const String& _rName, cssu::Reference< dcss::security::XCertificate > rxCert, + bool bValid) +{ + Image aImage = bValid ? maCertImage : maCertNotValidatedImage; + SvLBoxEntry* pEntry = maCertPathLB.InsertEntry( _rName, aImage, aImage, _pParent ); + pEntry->SetUserData( ( void* ) new CertPath_UserData( rxCert, bValid ) ); + + return pEntry; +} + diff --git a/xmlsecurity/source/dialogs/certificateviewer.src b/xmlsecurity/source/dialogs/certificateviewer.src new file mode 100644 index 000000000000..637d3a7f45fe --- /dev/null +++ b/xmlsecurity/source/dialogs/certificateviewer.src @@ -0,0 +1,350 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#include "dialogs.hrc" +#include "helpids.hrc" + +TabDialog RID_XMLSECDLG_CERTVIEWER +{ + HelpID = HID_XMLSEC_DLG_CERTVIEWER; + Size = MAP_APPFONT( TD_WIDTH, TD_HEIGHT ); + OutputSize = TRUE; + Closeable = TRUE; + Moveable = TRUE; + SVLook = TRUE; + + Text [ en-US ] = "View Certificate"; + TabControl 1 + { + Pos = MAP_APPFONT( TD_SP_INNERBORDER_LEFT, TD_SP_INNERBORDER_TOP ); + Size = MAP_APPFONT( TP_WIDTH, TP_HEIGHT+RIDDER_HEIGHT ); + SVLook = TRUE ; + PageList = + { + PageItem + { + Identifier = RID_XMLSECTP_GENERAL; + Text [ en-US ] = "General"; + }; + PageItem + { + Identifier = RID_XMLSECTP_DETAILS; + Text [ en-US ] = "Details"; + }; + PageItem + { + Identifier = RID_XMLSECTP_CERTPATH; + Text [ en-US ] = "Certification Path"; + }; + }; + }; + OKButton BTN_OK + { + Pos = MAP_APPFONT( CV_COL_A, CV_ROW_A ); + Size = MAP_APPFONT( RSC_CD_PUSHBUTTON_WIDTH, RSC_CD_PUSHBUTTON_HEIGHT ); + DefButton = TRUE; + }; + HelpButton BTN_HELP + { + Pos = MAP_APPFONT( CV_COL_C, CV_ROW_A ); + Size = MAP_APPFONT( RSC_CD_PUSHBUTTON_WIDTH, RSC_CD_PUSHBUTTON_HEIGHT ); + }; +}; + +TabPage RID_XMLSECTP_GENERAL +{ + HelpId = HID_XMLSEC_TP_GENERAL; + Size = MAP_APPFONT( TP_WIDTH, TP_HEIGHT ); + OutputSize = TRUE; + Hide = TRUE; + SVLook = TRUE; + Window WIN_FRAME + { + SVLook = TRUE; + Border = TRUE; + Pos = MAP_APPFONT( CV_COL_0, CV_ROW_0 ); + Size = MAP_APPFONT( CV_CONT_WIDTH, CV_CONT_HEIGHT ); + }; + FixedImage IMG_CERT + { + Pos = MAP_APPFONT( CW_COL_0, CW_ROW_0 ); + Size = MAP_APPFONT( IMG1_WIDTH, IMG1_HEIGHT ); + Fixed = Image + { + ImageBitmap = Bitmap { File = "certificate_40x56.png"; }; + MaskColor = STD_MASKCOLOR; + }; + }; + FixedText FI_CERTINFO + { + Pos = MAP_APPFONT( CW_COL_3, CW_ROW_1 ); + Size = MAP_APPFONT( CW_COL_5-CW_COL_3, RSC_CD_FIXEDTEXT_HEIGHT ); + Text [ en-US ] = " Certificate Information"; + }; + FixedLine FL_SEP1 + { + Pos = MAP_APPFONT( CW_COL_0, CW_ROW_3 ); + Size = MAP_APPFONT( CW_COL_5-CW_COL_0, RSC_CD_FIXEDLINE_HEIGHT ); + }; + FixedText FI_HINTNOTTRUST + { + Pos = MAP_APPFONT( CW_COL_1, CW_ROW_4 ); + Size = MAP_APPFONT( CW_COL_5a-CW_COL_1, CW_ROW_4a-CW_ROW_4 ); + WordBreak = TRUE; + Text [ en-US ] = "This certificate is intended for the following purpose(s):"; + }; + FixedLine FL_SEP2 + { + Pos = MAP_APPFONT( CW_COL_0, CW_ROW_5 ); + Size = MAP_APPFONT( CW_COL_5-CW_COL_0, RSC_CD_FIXEDLINE_HEIGHT ); + }; + FixedText FI_ISSTOLABEL + { + Pos = MAP_APPFONT( CW_COL_1, CW_ROW_6 ); + Size = MAP_APPFONT( CW_COL_4-CW_COL_1-1, RSC_CD_FIXEDTEXT_HEIGHT ); + Text [ en-US ] = "Issued to:"; + }; + FixedText FI_ISSTO + { + Pos = MAP_APPFONT( CW_COL_4, CW_ROW_6 ); + Size = MAP_APPFONT( CW_COL_5-CW_COL_4, RSC_CD_FIXEDTEXT_HEIGHT ); + }; + FixedText FI_ISSBYLABEL + { + Pos = MAP_APPFONT( CW_COL_1, CW_ROW_7 ); + Size = MAP_APPFONT( CW_COL_4-CW_COL_1-1, RSC_CD_FIXEDTEXT_HEIGHT ); + Text [ en-US ] = "Issued by:"; + }; + FixedText FI_ISSBY + { + Pos = MAP_APPFONT( CW_COL_4, CW_ROW_7 ); + Size = MAP_APPFONT( CW_COL_5-CW_COL_4, RSC_CD_FIXEDTEXT_HEIGHT ); + }; + FixedText FI_VALIDDATE + { + Pos = MAP_APPFONT( CW_COL_1, CW_ROW_8 ); + Size = MAP_APPFONT( CW_COL_5-CW_COL_1-1, RSC_CD_FIXEDTEXT_HEIGHT ); + Text [ en-US ] = "Valid from %SDATE% to %EDATE%"; + }; + FixedImage IMG_KEY + { + Pos = MAP_APPFONT( CW_COL_0, CW_ROW_9 ); + Size = MAP_APPFONT( IMG2_WIDTH, IMG2_HEIGHT ); + Fixed = Image + { + ImageBitmap = Bitmap { File = "key_12.png"; }; + MaskColor = STD_MASKCOLOR; + }; + }; + FixedText FI_CORRPRIVKEY + { + Pos = MAP_APPFONT( CW_COL_1a, CW_ROW_10 ); + Size = MAP_APPFONT( CW_COL_5-CW_COL_1a, RSC_CD_FIXEDTEXT_HEIGHT ); + Text [ en-US ] = "You have a private key that corresponds to this certificate."; + }; + String STR_CERTIFICATE_NOT_VALIDATED + { + Text [ en-US ] = "The certificate could not be validated."; + }; + Image IMG_STATE_NOT_VALIDATED + { + ImageBitmap = Bitmap { File = "notcertificate_40x56.png"; }; + MaskColor = STD_MASKCOLOR; + }; + Image IMG_STATE_CERIFICATED_HC + { + ImageBitmap = Bitmap { File = "certificate_40x56_h.png"; }; + MaskColor = STD_MASKCOLOR; + }; + Image IMG_STATE_NOT_VALIDATED_HC + { + ImageBitmap = Bitmap { File = "notcertificate_40x56_h.png"; }; + MaskColor = STD_MASKCOLOR; + }; + Image IMG_KEY_HC + { + ImageBitmap = Bitmap { File = "key_12_h.png"; }; + MaskColor = STD_MASKCOLOR; + }; +}; + +TabPage RID_XMLSECTP_DETAILS +{ + HelpId = HID_XMLSEC_TP_DETAILS; + Size = MAP_APPFONT( TP_WIDTH, TP_HEIGHT ); + OutputSize = TRUE; + Hide = TRUE; + SVLook = TRUE; + Control LB_ELEMENTS + { + HelpId = HID_XMLSEC_CTRL_ELEMENTS; + Pos = MAP_APPFONT( CV_COL_0, CV_ROW_0 ); + Size = MAP_APPFONT( CV_CONT_WIDTH, CV_ROW_1-CV_ROW_0 ); + SVLook = TRUE; + Border = TRUE; + }; + String STR_HEADERBAR + { + Text [ en-US ] = "Field\tValue"; + }; + MultiLineEdit ML_ELEMENT + { + HelpID = "xmlsecurity:MultiLineEdit:RID_XMLSECTP_DETAILS:ML_ELEMENT"; + Pos = MAP_APPFONT( CV_COL_0, CV_ROW_2 ); + Size = MAP_APPFONT( CV_CONT_WIDTH, CV_ROW_3-CV_ROW_2 ); + ReadOnly = TRUE; + Border = TRUE; + VSCROLL = TRUE; + }; + String STR_VERSION + { + Text [ en-US ] = "Version"; + }; + String STR_SERIALNUM + { + Text [ en-US ] = "Serial Number"; + }; + String STR_SIGALGORITHM + { + Text [ en-US ] = "Signature Algorithm"; + }; + String STR_ISSUER + { + Text [ en-US ] = "Issuer"; + }; + String STR_ISSUER_ID + { + Text [ en-US ] = "Issuer Unique ID"; + }; + String STR_VALIDFROM + { + Text [ en-US ] = "Valid From"; + }; + String STR_VALIDTO + { + Text [ en-US ] = "Valid to"; + }; + String STR_SUBJECT + { + Text [ en-US ] = "Subject"; + }; + String STR_SUBJECT_ID + { + Text [ en-US ] = "Subject Unique ID"; + }; + String STR_SUBJECT_PUBKEY_ALGO + { + Text [ en-US ] = "Subject Algorithm"; + }; + String STR_SUBJECT_PUBKEY_VAL + { + Text [ en-US ] = "Public Key"; + }; + String STR_SIGNATURE_ALGO + { + Text [ en-US ] = "Signature Algorithm"; + }; + String STR_THUMBPRINT_SHA1 + { + Text [ en-US ] = "Thumbprint SHA1"; + }; + String STR_THUMBPRINT_MD5 + { + Text [ en-US ] = "Thumbprint MD5"; + }; +}; + +TabPage RID_XMLSECTP_CERTPATH +{ + HelpId = HID_XMLSEC_TP_CERTPATH; + Size = MAP_APPFONT( TP_WIDTH, TP_HEIGHT ); + OutputSize = TRUE; + Hide = TRUE; + SVLook = TRUE; + FixedText FT_CERTPATH + { + Pos = MAP_APPFONT( CV_COL_0, CVP_ROW_0 ); + Size = MAP_APPFONT( CV_CONT_WIDTH, RSC_CD_FIXEDTEXT_HEIGHT ); + Text [ en-US ] = "Certification path"; + }; + Control LB_SIGNATURES + { + HelpId = HID_XMLSEC_CTRL_VIEWSIGNATURES; + Pos = MAP_APPFONT( CV_COL_0, CVP_ROW_1 ); + Size = MAP_APPFONT( CV_CONT_WIDTH, REST_HEIGHT/3*2 ); + SVLook = TRUE; + Border = TRUE; + }; + PushButton BTN_VIEWCERT + { + HelpID = "xmlsecurity:PushButton:RID_XMLSECTP_CERTPATH:BTN_VIEWCERT"; + Pos = MAP_APPFONT( CV_COL_1-(CV_COL_B-CV_COL_A), CVP_ROW_2 ); + Size = MAP_APPFONT( CV_COL_B-CV_COL_A, RSC_CD_PUSHBUTTON_HEIGHT ); + Text [ en-US ] = "View Certificate..."; + }; + FixedText FT_CERTSTATUS + { + Pos = MAP_APPFONT( CV_COL_0, CVP_ROW_3 ); + Size = MAP_APPFONT( CV_CONT_WIDTH, RSC_CD_FIXEDTEXT_HEIGHT ); + Text [ en-US ] = "Certification status"; + }; + MultiLineEdit ML_CERTSTATUS + { + HelpID = "xmlsecurity:MultiLineEdit:RID_XMLSECTP_CERTPATH:ML_CERTSTATUS"; + Pos = MAP_APPFONT( CV_COL_0, CVP_ROW_4 ); + Size = MAP_APPFONT( CV_CONT_WIDTH, REST_HEIGHT/3 ); + ReadOnly = TRUE; + Border = TRUE; + }; + Image IMG_CERT_SMALL + { + ImageBitmap = Bitmap { File = "certificate_16.png"; }; + MaskColor = STD_MASKCOLOR; + }; + Image IMG_CERT_SMALL_HC + { + ImageBitmap = Bitmap { File = "certificate_16_h.png"; }; + MaskColor = STD_MASKCOLOR; + }; + Image IMG_CERT_NOTVALIDATED_SMALL + { + ImageBitmap = Bitmap { File = "notcertificate_16.png"; }; + MaskColor = STD_MASKCOLOR; + }; + Image IMG_CERT_NOTVALIDATED_SMALL_HC + { + ImageBitmap = Bitmap { File = "notcertificate_16_h.png"; }; + MaskColor = STD_MASKCOLOR; + }; + String STR_PATH_CERT_OK + { + Text [ en-US ] = "The certificate is OK."; + }; + String STR_PATH_CERT_NOT_VALIDATED + { + Text [ en-US ] = "The certificate could not be validated."; + }; +}; diff --git a/xmlsecurity/source/dialogs/dialogs.hrc b/xmlsecurity/source/dialogs/dialogs.hrc new file mode 100644 index 000000000000..b30eb9198e32 --- /dev/null +++ b/xmlsecurity/source/dialogs/dialogs.hrc @@ -0,0 +1,360 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _DIALOGS_HRC +#define _DIALOGS_HRC + +#include <svtools/controldims.hrc> +#include <xmlsecurity/global.hrc> + +#define STD_MASKCOLOR Color{Red=0xffff;Green=0x0000;Blue=0xffff;} + +#define FL_BOTTOM_SEP 50 +#define BTN_OK 51 +#define BTN_CANCEL 52 +#define BTN_HELP 53 +#define LB_SIGNATURES 54 +#define BTN_VIEWCERT 55 +#define STR_HEADERBAR 56 +#define BTN_RESET 57 +#define STR_VALID_SIGNATURE 58 +#define STR_NO_INFO_TO_VERIFY 59 +#define STR_INVALID_SIGNATURE 60 + +// --------- general metrics --------- +#define DLGS_WIDTH 287 +#define DLGS_HEIGHT 195 +// --------- ... for tab dialogs ----- +#define TP_WIDTH 260 +#define TP_HEIGHT 185 +#define RIDDER_HEIGHT (RSC_CD_PUSHBUTTON_HEIGHT) +#define TD_SP_INNERBORDER_LEFT 3 +#define TD_SP_INNERBORDER_RIGHT 3 +#define TD_SP_INNERBORDER_TOP 3 +#define TD_SP_INNERBORDER_BOTTOM 3 +#define TD_WIDTH (TP_WIDTH+RSC_SP_DLG_INNERBORDER_LEFT+RSC_SP_DLG_INNERBORDER_RIGHT) +#define TD_HEIGHT (TP_HEIGHT+TD_SP_INNERBORDER_TOP+2*TD_SP_INNERBORDER_BOTTOM+RSC_CD_PUSHBUTTON_HEIGHT+RIDDER_HEIGHT) + +#define SEP_FL_SPACE_Y 6 +#define SEP_FL_ADJ_Y(val) (val-3) +#define DLGS_BOTTOM_BTN_L(dlgh) (dlgh-RSC_SP_DLG_INNERBORDER_BOTTOM) +#define DLGS_BOTTOM_BTN_Y(dlgh) (DLGS_BOTTOM_BTN_L(dlgh)-RSC_CD_PUSHBUTTON_HEIGHT) +#define DLGS_BOTTOM_FL_Y(dlgh) (DLGS_BOTTOM_BTN_Y(dlgh)-SEP_FL_SPACE_Y-5) +#define DLGS_BOTTOM_LAST_CTRL_L(dlgh) (DLGS_BOTTOM_BTN_Y(dlgh)-2*SEP_FL_SPACE_Y-3) +#define DLGS_BOTTOM_HELP_X(dlgw) (dlgw-RSC_SP_DLG_INNERBORDER_RIGHT-RSC_CD_PUSHBUTTON_WIDTH) +#define DLGS_BOTTOM_CANCEL_X(dlgw) (DLGS_BOTTOM_HELP_X(dlgw)-RSC_SP_CTRL_X-RSC_CD_PUSHBUTTON_WIDTH) +#define DLGS_BOTTOM_OK_X(dlgw) (DLGS_BOTTOM_CANCEL_X(dlgw)-RSC_SP_CTRL_DESC_X-RSC_CD_PUSHBUTTON_WIDTH) + + +// --------- dialog Digital Signatures --------- +#define BTN_ADDCERT 2 +#define BTN_REMOVECERT 3 +#define FT_HINT_DOC 4 +#define FT_HINT_BASIC 5 +#define FT_HINT_PACK 6 +#define IMG_STATE_VALID 7 +#define FI_STATE_VALID 8 +#define IMG_STATE_BROKEN 9 +#define FI_STATE_BROKEN 10 +#define IMG_STATE_NOTVALIDATED 11 +#define FI_STATE_NOTVALIDATED 12 +#define IMG_STATE_VALID_HC 13 +#define IMG_STATE_BROKEN_HC 14 +#define IMG_STATE_NOTVALIDATED_HC 15 +#define FI_STATE_OLDSIGNATURE 16 + +//#define DS_WIDTH DLGS_WIDTH +//#define DS_HEIGHT DLGS_HEIGHT +#define DS_BTNWIDTH_1 70 +#define DS_BTNSPACE_X RSC_SP_CTRL_X +#define DS_WIDTH (RSC_SP_DLG_INNERBORDER_LEFT+RSC_SP_DLG_INNERBORDER_RIGHT+2*DS_BTNSPACE_X+3*DS_BTNWIDTH_1) +#define DS_HEIGHT (DLGS_WIDTH*2/3) + +#define DS_COL_0 RSC_SP_DLG_INNERBORDER_LEFT +//#define DS_COL_MID (DS_WIDTH/2) +//#define DS_COL_3 (DS_COL_MID-(DS_BTNWIDTH_1/2)) +//#define DS_COL_4 (DS_COL_2+DS_BTNWIDTH_1) +//#define DS_COL_2 (DS_COL_3-DS_BTNSPACE_X) +//#define DS_COL_1 (DS_COL_2-DS_BTNWIDTH_1) +#define DS_COL_1 DS_COL_0 +#define DS_COL_2 (DS_COL_1+DS_BTNWIDTH_1) +#define DS_COL_3 (DS_COL_2+DS_BTNSPACE_X) +#define DS_COL_4 (DS_COL_3+DS_BTNWIDTH_1) +#define DS_COL_5 (DS_COL_4+DS_BTNSPACE_X) +//#define DS_COL_6 (DS_COL_5+DS_BTNWIDTH_1) +#define DS_COL_7 (DS_WIDTH-RSC_SP_DLG_INNERBORDER_RIGHT) +#define DS_COL_6 DS_COL_7 + +#define DS_ROW_0 RSC_SP_DLG_INNERBORDER_TOP +#define DS_ROW_1 (DS_ROW_0+RSC_CD_FIXEDTEXT_HEIGHT+RSC_SP_CTRL_DESC_X) +#define DS_ROW_7 DLGS_BOTTOM_BTN_L(DS_HEIGHT) +#define DS_ROW_6 DLGS_BOTTOM_BTN_Y(DS_HEIGHT) +#define DS_ROW_5 DLGS_BOTTOM_FL_Y(DS_HEIGHT) +#define DS_ROW_4 DLGS_BOTTOM_LAST_CTRL_L(DS_HEIGHT) +#define DS_ROW_3 (DS_ROW_4-RSC_CD_PUSHBUTTON_HEIGHT) +#define DS_ROW_2A (DS_ROW_3-RSC_CD_FIXEDTEXT_HEIGHT-RSC_SP_CTRL_Y) +#define DS_ROW_2 (DS_ROW_2A-RSC_SP_CTRL_GROUP_Y) + +#define DS_LB_WIDTH (DS_COL_7-DS_COL_0) + +// --------- dialog Ceritficate chooser --------- +#define FT_HINT_SELECT 1 + +#define CS_WIDTH DLGS_WIDTH +#define CS_HEIGHT DLGS_HEIGHT +#define CS_BTNWIDTH_1 DS_BTNWIDTH_1 + +#define CS_COL_0 RSC_SP_DLG_INNERBORDER_LEFT +#define CS_COL_2 (CS_WIDTH-RSC_SP_DLG_INNERBORDER_RIGHT) +#define CS_COL_1 (CS_COL_2-CS_BTNWIDTH_1) + +#define CS_ROW_0 RSC_SP_DLG_INNERBORDER_TOP +#define CS_ROW_1 (CS_ROW_0+RSC_CD_FIXEDTEXT_HEIGHT+RSC_SP_CTRL_DESC_X) +#define CS_ROW_4 DLGS_BOTTOM_LAST_CTRL_L(CS_HEIGHT) +#define CS_ROW_3 (CS_ROW_4-RSC_CD_PUSHBUTTON_HEIGHT) +#define CS_ROW_2 (CS_ROW_3-RSC_SP_CTRL_Y) + +#define CS_LB_WIDTH (CS_COL_2-CS_COL_0) + +// --------- tab dialog Certificate viewer --------- + +#define CV_COL_0 TD_SP_INNERBORDER_LEFT +#define CV_COL_1 (TP_WIDTH-RSC_SP_TBPG_INNERBORDER_RIGHT) +#define CV_ROW_0 RSC_SP_TBPG_INNERBORDER_TOP +#define CV_ROW_3 (TP_HEIGHT-RSC_SP_TBPG_INNERBORDER_BOTTOM) +#define CV_CONT_WIDTH (CV_COL_1-CV_COL_0) +#define CV_CONT_HEIGHT (CV_ROW_3-CV_ROW_0) +#define CV_ROW_1 (CV_ROW_0+2*CV_CONT_HEIGHT/3) +#define CV_ROW_2 (CV_ROW_1+RSC_SP_CTRL_GROUP_Y) + +#define CV_COL_D (TD_WIDTH-TD_SP_INNERBORDER_RIGHT) +#define CV_COL_C (CV_COL_D-RSC_CD_PUSHBUTTON_WIDTH) +#define CV_COL_B (CV_COL_C-RSC_SP_CTRL_X) +#define CV_COL_A (CV_COL_B-RSC_CD_PUSHBUTTON_WIDTH) + +#define CV_ROW_B (TD_HEIGHT-TD_SP_INNERBORDER_BOTTOM) +#define CV_ROW_A (CV_ROW_B-RSC_CD_PUSHBUTTON_HEIGHT) + +// --------- tab page Certificate viewer - General --------- +#define WIN_FRAME 2 +#define IMG_CERT 3 +#define FI_CERTINFO 4 +#define FL_SEP1 5 +#define FI_HINTNOTTRUST 6 +#define FL_SEP2 7 +#define FI_ISSTOLABEL 8 +#define FI_ISSTO 9 +#define FI_ISSBYLABEL 10 +#define FI_ISSBY 11 +#define FI_VALIDDATE 12 +#define IMG_KEY 13 +#define FI_CORRPRIVKEY 14 +#define STR_CERTIFICATE_NOT_VALIDATED 15 +#define IMG_STATE_NOT_VALIDATED 16 +#define IMG_STATE_CERIFICATED_HC 17 +#define IMG_STATE_NOT_VALIDATED_HC 18 +#define IMG_KEY_HC 19 + +#define IMG1_WIDTH 33 +#define IMG1_HEIGHT 22 +#define IMG2_WIDTH 20 +#define IMG2_HEIGHT 20 +#define DATE_WIDTH 30 +#define CW_COL_0 (CV_COL_0+RSC_SP_GRP_INNERBORDER_LEFT) +#define CW_COL_1 (CW_COL_0+RSC_SP_FLGR_SPACE_X) +#define CW_COL_1a (CW_COL_0+IMG2_WIDTH+1) +#define CW_COL_2 (CW_COL_0+IMG1_WIDTH) +#define CW_COL_3 (CW_COL_2+RSC_SP_CTRL_GROUP_X) +#define CW_COL_4 (CW_COL_1+40) +#define CW_COL_5 (CV_CONT_WIDTH-RSC_SP_GRP_INNERBORDER_RIGHT) +#define CW_COL_5a (CW_COL_5-RSC_SP_GRP_INNERBORDER_RIGHT) +#define CW_COL_4a (CW_COL_1+38) +#define CW_COL_4b (CW_COL_4a+DATE_WIDTH) +#define CW_COL_4c (CW_COL_4b+3) +#define CW_COL_4d (CW_COL_4c+8) +#define CW_COL_4e (CW_COL_4d+3) +#define CW_ROW_0 (CV_ROW_0+RSC_SP_GRP_INNERBORDER_TOP) +#define CW_ROW_1 (CW_ROW_0+RSC_SP_GRP_INNERBORDER_TOP) +#define CW_ROW_2 (CW_ROW_0+IMG1_HEIGHT) +#define CW_ROW_3 (CW_ROW_2+3) +#define CW_ROW_4 (CW_ROW_3+RSC_SP_CTRL_Y+RSC_CD_FIXEDLINE_HEIGHT) +#define CW_ROW_4a (CW_ROW_4+35) +#define CW_ROW_5 (CW_ROW_4a+3) +#define CW_ROW_6 (CW_ROW_5+RSC_SP_CTRL_Y+RSC_CD_FIXEDLINE_HEIGHT) +#define CW_ROW_7 (CW_ROW_6+RSC_SP_CTRL_Y+RSC_CD_FIXEDTEXT_HEIGHT) +#define CW_ROW_8 (CW_ROW_7+RSC_SP_CTRL_Y+RSC_CD_FIXEDTEXT_HEIGHT) +#define CW_ROW_9 (CW_ROW_8+RSC_SP_CTRL_Y+RSC_CD_FIXEDTEXT_HEIGHT) +#define CW_ROW_10 (CW_ROW_9+2) +#define CW_ROW_11 (CW_ROW_9+IMG2_HEIGHT) + +// --------- tab page Certificate viewer - Details --------- + +#define LB_ELEMENTS 1 +#define ML_ELEMENT 2 + +#define STR_VERSION 1 +#define STR_SERIALNUM 2 +#define STR_SIGALGORITHM 3 +#define STR_ISSUER 4 +#define STR_ISSUER_ID 5 +#define STR_VALIDFROM 6 +#define STR_VALIDTO 7 +#define STR_SUBJECT 8 +#define STR_SUBJECT_ID 9 +#define STR_SUBJECT_PUBKEY_ALGO 10 +#define STR_SUBJECT_PUBKEY_VAL 11 +#define STR_SIGNATURE_ALGO 12 +#define STR_THUMBPRINT_SHA1 13 +#define STR_THUMBPRINT_MD5 14 + +// --------- tab page Certificate viewer - Certification Path --------- + +#define FT_CERTPATH 1 +#define FT_CERTSTATUS 2 +#define ML_CERTSTATUS 3 +#define IMG_CERT_SMALL 4 +#define IMG_CERT_SMALL_HC 5 +#define IMG_CERT_NOTVALIDATED_SMALL 6 +#define IMG_CERT_NOTVALIDATED_SMALL_HC 7 +#define STR_PATH_CERT_OK 8 +#define STR_PATH_CERT_NOT_VALIDATED 9 + +#define CVP_ROW_0 RSC_SP_TBPG_INNERBORDER_TOP +#define CVP_ROW_1 (CVP_ROW_0+RSC_CD_FIXEDTEXT_HEIGHT+RSC_SP_CTRL_DESC_Y) +#define REST_HEIGHT (TP_HEIGHT-CVP_ROW_1-2*RSC_SP_GRP_SPACE_Y-RSC_CD_FIXEDTEXT_HEIGHT-RSC_CD_PUSHBUTTON_HEIGHT) +#define CVP_ROW_2 (CVP_ROW_1+REST_HEIGHT/3*2+RSC_SP_CTRL_DESC_Y) +#define CVP_ROW_3 (CVP_ROW_2+RSC_CD_PUSHBUTTON_HEIGHT) +#define CVP_ROW_4 (CVP_ROW_3+RSC_CD_FIXEDTEXT_HEIGHT+RSC_SP_CTRL_DESC_Y) + +//#define CV_ROW_0A (CV_ROW_0+RSC_SP_CTRL_DESC_Y+RSC_CD_FIXEDTEXT_HEIGHT) +//#define CV_ROW_2A (CV_ROW_2+RSC_SP_CTRL_DESC_Y+RSC_CD_FIXEDTEXT_HEIGHT) + +// --------- tab dialog macro security --------- + +#define MS_COL_A (TD_WIDTH-RSC_SP_DLG_INNERBORDER_LEFT) +#define MS_COL_B (MS_COL_A-RSC_CD_PUSHBUTTON_WIDTH) +#define MS_COL_C (MS_COL_B-RSC_SP_CTRL_X) +#define MS_COL_D (MS_COL_C-RSC_CD_PUSHBUTTON_WIDTH) +#define MS_COL_E (MS_COL_D-RSC_SP_CTRL_X) +#define MS_COL_F (MS_COL_E-RSC_CD_PUSHBUTTON_WIDTH) +#define MS_COL_G (MS_COL_F-RSC_SP_CTRL_X) +#define MS_COL_H (MS_COL_G-RSC_CD_PUSHBUTTON_WIDTH) + +// --------- tab page security level --------- + +#define FL_SECLEVEL 1 +#define RB_VERYHIGH 2 +#define RB_HIGH 3 +#define RB_MEDIUM 4 +#define RB_LOW 5 +#define FI_SEC_READONLY 6 + +#define RSC_BIG_RADIOBUTTON 40 +#define SL_RB_DIST_Y (RSC_SP_FLGR_SPACE_Y+RSC_BIG_RADIOBUTTON) +#define SL_COL_0 RSC_SP_TBPG_INNERBORDER_LEFT +#define SL_COL_1 (SL_COL_0+RSC_SP_FLGR_SPACE_X) +#define SL_COL_3 (TP_WIDTH-RSC_SP_TBPG_INNERBORDER_RIGHT) +#define SL_COL_2 ((SL_COL_3-SL_COL_1)*100/105) +#define SL_ROW_0 RSC_SP_TBPG_INNERBORDER_TOP +#define SL_ROW_1 (SL_ROW_0+SL_RB_DIST_Y) +#define SL_ROW_2 (SL_ROW_1+SL_RB_DIST_Y) +#define SL_ROW_3 (SL_ROW_2+SL_RB_DIST_Y) +#define SL_ROW_4 (TP_HEIGHT-RSC_SP_TBPG_INNERBORDER_BOTTOM) + +// --------- tab page trusted sources --------- + +#define FL_TRUSTCERT 1 +#define LB_TRUSTCERT 2 +#define PB_ADD_TRUSTCERT 3 +#define PB_VIEW_TRUSTCERT 4 +#define PB_REMOVE_TRUSTCERT 5 +#define FL_TRUSTFILELOC 6 +#define FI_TRUSTFILELOC 7 +#define LB_TRUSTFILELOC 8 +#define FL_ADD_TRUSTFILELOC 9 +#define FL_REMOVE_TRUSTFILELOC 10 +#define FI_TRUSTCERT_RO 11 +#define FI_TRUSTFILE_RO 12 + +#define TS_COL_0 RSC_SP_TBPG_INNERBORDER_LEFT +#define TS_COL_1 (TS_COL_0+RSC_SP_FLGR_SPACE_X) +#define TS_COL_8 (TP_WIDTH-RSC_SP_TBPG_INNERBORDER_RIGHT) +#define TS_COL_7 (TS_COL_8-RSC_SP_FLGR_SPACE_X) +#define TS_COL_6 (TS_COL_7-RSC_CD_PUSHBUTTON_WIDTH) +#define TS_COL_5 (TS_COL_6-RSC_SP_CTRL_GROUP_X) +#define TS_COL_4 (TS_COL_5-RSC_CD_PUSHBUTTON_WIDTH) +#define TS_COL_3 (TS_COL_4-RSC_SP_CTRL_GROUP_X) +#define TS_COL_2 (TS_COL_3-RSC_CD_PUSHBUTTON_WIDTH) + +#define RSC_CD_TABLISTBOX_HEIGHT 6*RSC_BS_CHARHEIGHT +#define TS_ROW_0 RSC_SP_TBPG_INNERBORDER_TOP +#define TS_ROW_1 (TS_ROW_0+RSC_CD_FIXEDLINE_HEIGHT+RSC_SP_FLGR_SPACE_Y) +#define TS_ROW_2 (TS_ROW_1+RSC_CD_TABLISTBOX_HEIGHT+RSC_SP_FLGR_SPACE_Y) +#define TS_ROW_3 (TS_ROW_2+RSC_CD_PUSHBUTTON_HEIGHT+RSC_SP_FLGR_SPACE_Y) +#define TS_ROW_4 (TS_ROW_3+RSC_CD_FIXEDLINE_HEIGHT+RSC_SP_FLGR_SPACE_Y) +#define TS_ROW_5 (TS_ROW_4+3*RSC_CD_FIXEDTEXT_HEIGHT+RSC_SP_FLGR_SPACE_Y) + +#define TS_ROW_8 (TP_HEIGHT-RSC_SP_TBPG_INNERBORDER_BOTTOM) +#define TS_ROW_7 (TS_ROW_8-RSC_CD_PUSHBUTTON_HEIGHT) +#define TS_ROW_6 (TS_ROW_7-RSC_SP_FLGR_SPACE_Y) + +// --------- signed macro warning --------- + +#define FI_DOCNAME 1 +#define FI_DESCR1A 2 +#define FI_SIGNS 3 +#define PB_VIEWSIGNS 4 +#define FI_DESCR2 5 +#define CB_ALWAYSTRUST 6 +#define PB_ENABLE 7 +#define PB_DISABLE 8 +#define FI_DESCR1B 9 + +#define MW_WIDTH DLGS_WIDTH +#define MW_HEIGHT DLGS_HEIGHT + +#define MW_SYMBOL_WIDTH (20) + +#define MW_COL_0 (RSC_SP_DLG_INNERBORDER_LEFT) +#define MW_COL_1 (MW_COL_0+MW_SYMBOL_WIDTH) +#define MW_COL_4 (MW_WIDTH-RSC_SP_DLG_INNERBORDER_RIGHT) +#define MW_COL_3 (MW_COL_4-RSC_CD_PUSHBUTTON_WIDTH) +#define MW_COL_2 (MW_COL_3-RSC_SP_CTRL_DESC_X) +#define MW_COL_A (DLGS_BOTTOM_OK_X(MW_WIDTH)) +#define MW_COL_C (DLGS_BOTTOM_CANCEL_X(MW_WIDTH)) +#define MW_COL_E (DLGS_BOTTOM_HELP_X(MW_WIDTH)) +#define MW_ROW_0 (RSC_SP_DLG_INNERBORDER_TOP) +#define MW_ROW_1 (MW_ROW_0+3*RSC_CD_FIXEDTEXT_HEIGHT+RSC_SP_CTRL_Y) +#define MW_ROW_2 (MW_ROW_1+RSC_CD_FIXEDTEXT_HEIGHT+RSC_SP_CTRL_Y) +#define MW_ROW_7 (MW_HEIGHT-RSC_SP_DLG_INNERBORDER_BOTTOM) +#define MW_ROW_6 (DLGS_BOTTOM_BTN_Y(MW_HEIGHT)) +#define MW_ROW_5 (DLGS_BOTTOM_FL_Y(MW_HEIGHT)) +#define MW_ROW_4 (MW_ROW_5-RSC_CD_CHECKBOX_HEIGHT-RSC_SP_CTRL_Y) +#define MW_ROW_3 (MW_ROW_4-4*RSC_CD_FIXEDTEXT_HEIGHT+RSC_SP_CTRL_Y) + +#endif + diff --git a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx new file mode 100644 index 000000000000..15ac9b591c48 --- /dev/null +++ b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx @@ -0,0 +1,846 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_xmlsecurity.hxx" +#include <xmlsecurity/digitalsignaturesdialog.hxx> +#include <xmlsecurity/certificatechooser.hxx> +#include <xmlsecurity/certificateviewer.hxx> +#include <xmlsecurity/biginteger.hxx> +#include <xmloff/xmluconv.hxx> +#include <com/sun/star/embed/XStorage.hpp> +#include <com/sun/star/embed/ElementModes.hpp> +#include <com/sun/star/io/XSeekable.hpp> +#include <com/sun/star/io/XTruncate.hpp> +#include <com/sun/star/embed/XTransactedObject.hpp> +#include <com/sun/star/container/XNameAccess.hpp> +#include <com/sun/star/lang/XComponent.hpp> +#include <com/sun/star/security/NoPasswordException.hpp> +#include <com/sun/star/lang/DisposedException.hpp> +#include <com/sun/star/beans/XPropertySet.hpp> +#include <com/sun/star/security/CertificateValidity.hdl> +#include <com/sun/star/packages/WrongPasswordException.hpp> +#include <com/sun/star/security/SerialNumberAdapter.hpp> +#include <com/sun/star/security/XDocumentDigitalSignatures.hpp> +#include <com/sun/star/xml/dom/XDocumentBuilder.hpp> +#include <com/sun/star/packages/manifest/XManifestReader.hpp> + + +#include <rtl/ustrbuf.hxx> +#include <rtl/uri.hxx> + +#include <tools/date.hxx> +#include <tools/time.hxx> + +#include "dialogs.hrc" +#include "digitalsignaturesdialog.hrc" +#include "helpids.hrc" +#include "resourcemanager.hxx" + +#include <vcl/msgbox.hxx> // Until encrypted docs work... +#include <unotools/configitem.hxx> +#include <comphelper/componentcontext.hxx> + +#define OUSTR(x) ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(x) ) + + +/* HACK: disable some warnings for MS-C */ +#ifdef _MSC_VER +#pragma warning (disable : 4355) // 4355: this used in initializer-list +#endif + +using namespace ::com::sun::star::security; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star; +namespace css = ::com::sun::star; +using ::rtl::OUString; + +namespace +{ + class SaveODFItem: public utl::ConfigItem + { + sal_Int16 m_nODF; + public: + virtual void Commit(); + virtual void Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& aPropertyNames ); + SaveODFItem(); + //See group ODF in Common.xcs + bool isLessODF1_2() + { + return m_nODF < 3; + } + }; + +void SaveODFItem::Commit() {} +void SaveODFItem::Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& ) {} + + SaveODFItem::SaveODFItem(): utl::ConfigItem(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "Office.Common/Save"))), m_nODF(0) + { + OUString sDef(RTL_CONSTASCII_USTRINGPARAM("ODF/DefaultVersion")); + Sequence< css::uno::Any > aValues = GetProperties( Sequence<OUString>(&sDef,1) ); + if ( aValues.getLength() == 1) + { + sal_Int16 nTmp = 0; + if ( aValues[0] >>= nTmp ) + m_nODF = nTmp; + else + throw uno::RuntimeException( + OUString(RTL_CONSTASCII_USTRINGPARAM( + "[xmlsecurity]SaveODFItem::SaveODFItem(): Wrong Type!")), 0 ); + + } + else + throw uno::RuntimeException( + OUString(RTL_CONSTASCII_USTRINGPARAM( + "[xmlsecurity] Could not open property Office.Common/Save/ODF/DefaultVersion")), 0); + } +} + +/* Using the zip storage, we cannot get the properties "MediaType" and "IsEncrypted" + We use the manifest to find out if a file is xml and if it is encrypted. + The parameter is an encoded uri. However, the manifest contains paths. Therefore + the path is encoded as uri, so they can be compared. +*/ +bool DigitalSignaturesDialog::isXML(const rtl::OUString& rURI ) +{ + OSL_ASSERT(mxStore.is()); + + bool bIsXML = false; + bool bPropsAvailable = false; + const OUString sPropFullPath(RTL_CONSTASCII_USTRINGPARAM("FullPath")); + const OUString sPropMediaType(RTL_CONSTASCII_USTRINGPARAM("MediaType")); + const OUString sPropDigest(RTL_CONSTASCII_USTRINGPARAM("Digest")); + + for (int i = 0; i < m_manifest.getLength(); i++) + { + Any digest; + const Sequence< css::beans::PropertyValue >& entry = m_manifest[i]; + OUString sPath, sMediaType; + bool bEncrypted = false; + for (int j = 0; j < entry.getLength(); j++) + { + const css::beans::PropertyValue & prop = entry[j]; + + if (prop.Name.equals( sPropFullPath ) ) + prop.Value >>= sPath; + else if (prop.Name.equals( sPropMediaType ) ) + prop.Value >>= sMediaType; + else if (prop.Name.equals( sPropDigest ) ) + bEncrypted = true; + } + if (DocumentSignatureHelper::equalsReferenceUriManifestPath(rURI, sPath)) + { + bIsXML = sMediaType.equals(OUSTR("text/xml")) && ! bEncrypted; + bPropsAvailable = true; + break; + } + } + if (!bPropsAvailable) + { + //This would be the case for at least mimetype, META-INF/manifest.xml + //META-INF/macrosignatures.xml. + //Files can only be encrypted if they are in the manifest.xml. + //That is, the current file cannot be encrypted, otherwise bPropsAvailable + //would be true. + OUString aXMLExt( RTL_CONSTASCII_USTRINGPARAM( "XML" ) ); + sal_Int32 nSep = rURI.lastIndexOf( '.' ); + if ( nSep != (-1) ) + { + OUString aExt = rURI.copy( nSep+1 ); + if (aExt.equalsIgnoreAsciiCase(aXMLExt )) + bIsXML = true; + } + } + return bIsXML; +} + +DigitalSignaturesDialog::DigitalSignaturesDialog( + Window* pParent, + uno::Reference< uno::XComponentContext >& rxCtx, DocumentSignatureMode eMode, + sal_Bool bReadOnly, const ::rtl::OUString& sODFVersion, bool bHasDocumentSignature) + :ModalDialog ( pParent, XMLSEC_RES( RID_XMLSECDLG_DIGSIG ) ) + ,mxCtx ( rxCtx ) + ,maSignatureHelper ( rxCtx ) + ,meSignatureMode ( eMode ) + ,maHintDocFT ( this, XMLSEC_RES( FT_HINT_DOC ) ) + ,maHintBasicFT ( this, XMLSEC_RES( FT_HINT_BASIC ) ) + ,maHintPackageFT ( this, XMLSEC_RES( FT_HINT_PACK ) ) + ,maSignaturesLB ( this, XMLSEC_RES( LB_SIGNATURES ) ) + ,maSigsValidImg ( this, XMLSEC_RES( IMG_STATE_VALID ) ) + ,maSigsValidFI ( this, XMLSEC_RES( FI_STATE_VALID ) ) + ,maSigsInvalidImg ( this, XMLSEC_RES( IMG_STATE_BROKEN ) ) + ,maSigsInvalidFI ( this, XMLSEC_RES( FI_STATE_BROKEN ) ) + ,maSigsNotvalidatedImg( this, XMLSEC_RES( IMG_STATE_NOTVALIDATED ) ) + ,maSigsNotvalidatedFI ( this, XMLSEC_RES( FI_STATE_NOTVALIDATED ) ) + ,maSigsOldSignatureFI ( this, XMLSEC_RES( FI_STATE_OLDSIGNATURE) ) + ,maViewBtn ( this, XMLSEC_RES( BTN_VIEWCERT ) ) + ,maAddBtn ( this, XMLSEC_RES( BTN_ADDCERT ) ) + ,maRemoveBtn ( this, XMLSEC_RES( BTN_REMOVECERT ) ) + ,maBottomSepFL ( this, XMLSEC_RES( FL_BOTTOM_SEP ) ) + ,maOKBtn ( this, XMLSEC_RES( BTN_OK ) ) + ,maHelpBtn ( this, XMLSEC_RES( BTN_HELP ) ) + ,m_sODFVersion (sODFVersion) + ,m_bHasDocumentSignature(bHasDocumentSignature) + ,m_bWarningShowSignMacro(false) +{ + // --> PB #i48253 the tablistbox needs its own unique id + maSignaturesLB.Window::SetUniqueId( HID_XMLSEC_TREE_SIGNATURESDLG ); + // <-- + Size aControlSize( maSignaturesLB.GetSizePixel() ); + aControlSize = maSignaturesLB.PixelToLogic( aControlSize, MapMode( MAP_APPFONT ) ); + const long nControlWidth = aControlSize.Width(); + static long nTabs[] = { 4, 0, 6*nControlWidth/100, 36*nControlWidth/100, 74*nControlWidth/100 }; + maSignaturesLB.SetTabs( &nTabs[ 0 ] ); + maSignaturesLB.InsertHeaderEntry( String( XMLSEC_RES( STR_HEADERBAR ) ) ); + + maSigsNotvalidatedFI.SetText( String( XMLSEC_RES( STR_NO_INFO_TO_VERIFY ) ) ); + + if ( GetSettings().GetStyleSettings().GetHighContrastMode() ) + { + // high contrast mode needs other images + maSigsValidImg.SetImage( Image( XMLSEC_RES( IMG_STATE_VALID_HC ) ) ); + maSigsInvalidImg.SetImage( Image( XMLSEC_RES( IMG_STATE_BROKEN_HC ) ) ); + maSigsNotvalidatedImg.SetImage( Image( XMLSEC_RES( IMG_STATE_NOTVALIDATED_HC ) ) ); + } + + FreeResource(); + + mbVerifySignatures = true; + mbSignaturesChanged = false; + + maSignaturesLB.SetSelectHdl( LINK( this, DigitalSignaturesDialog, SignatureHighlightHdl ) ); + maSignaturesLB.SetDoubleClickHdl( LINK( this, DigitalSignaturesDialog, SignatureSelectHdl ) ); + + maViewBtn.SetClickHdl( LINK( this, DigitalSignaturesDialog, ViewButtonHdl ) ); + maViewBtn.Disable(); + + maAddBtn.SetClickHdl( LINK( this, DigitalSignaturesDialog, AddButtonHdl ) ); + if ( bReadOnly ) + maAddBtn.Disable(); + + maRemoveBtn.SetClickHdl( LINK( this, DigitalSignaturesDialog, RemoveButtonHdl ) ); + maRemoveBtn.Disable(); + + maOKBtn.SetClickHdl( LINK( this, DigitalSignaturesDialog, OKButtonHdl) ); + + switch( meSignatureMode ) + { + case SignatureModeDocumentContent: maHintDocFT.Show(); break; + case SignatureModeMacros: maHintBasicFT.Show(); break; + case SignatureModePackage: maHintPackageFT.Show(); break; + } + + // adjust fixed text to images + XmlSec::AlignAndFitImageAndControl( maSigsValidImg, maSigsValidFI, 5 ); + XmlSec::AlignAndFitImageAndControl( maSigsInvalidImg, maSigsInvalidFI, 5 ); + XmlSec::AlignAndFitImageAndControl( maSigsNotvalidatedImg, maSigsNotvalidatedFI, 5 ); + XmlSec::AlignAndFitImageAndControl( maSigsNotvalidatedImg, maSigsOldSignatureFI, 5 ); +} + +DigitalSignaturesDialog::~DigitalSignaturesDialog() +{ +} + +sal_Bool DigitalSignaturesDialog::Init( const rtl::OUString& rTokenName ) +{ + bool bInit = maSignatureHelper.Init( rTokenName ); + + DBG_ASSERT( bInit, "Error initializing security context!" ); + + if ( bInit ) + { + maSignatureHelper.SetStartVerifySignatureHdl( LINK( this, DigitalSignaturesDialog, StartVerifySignatureHdl ) ); + } + + return bInit; +} + +void DigitalSignaturesDialog::SetStorage( const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& rxStore ) +{ + mxStore = rxStore; + maSignatureHelper.SetStorage( mxStore, m_sODFVersion); + + Reference < css::packages::manifest::XManifestReader > xReader( + mxCtx->getServiceManager()->createInstanceWithContext( + OUSTR("com.sun.star.packages.manifest.ManifestReader"), mxCtx), UNO_QUERY_THROW); + + //Get the manifest.xml + Reference < css::embed::XStorage > xSubStore(rxStore->openStorageElement( + OUSTR("META-INF"), css::embed::ElementModes::READ), UNO_QUERY_THROW); + + Reference< css::io::XInputStream > xStream( + xSubStore->openStreamElement(OUSTR("manifest.xml"), css::embed::ElementModes::READ), + UNO_QUERY_THROW); + + m_manifest = xReader->readManifestSequence(xStream); +} + +void DigitalSignaturesDialog::SetSignatureStream( const cssu::Reference < css::io::XStream >& rxStream ) +{ + mxSignatureStream = rxStream; +} + +bool DigitalSignaturesDialog::canAddRemove() +{ + //m56 + bool ret = true; + OSL_ASSERT(mxStore.is()); + bool bDoc1_1 = DocumentSignatureHelper::isODFPre_1_2(m_sODFVersion); + SaveODFItem item; + bool bSave1_1 = item.isLessODF1_2(); + + // see specification + //cvs: specs/www/appwide/security/Electronic_Signatures_and_Security.sxw + //Paragraph 'Behavior with regard to ODF 1.2' + //For both, macro and document + if ( (!bSave1_1 && bDoc1_1) || (bSave1_1 && bDoc1_1) ) + { + //#4 + ErrorBox err(NULL, XMLSEC_RES(RID_XMLSECDLG_OLD_ODF_FORMAT)); + err.Execute(); + ret = false; + } + + //As of OOo 3.2 the document signature includes in macrosignatures.xml. That is + //adding a macro signature will break an existing document signature. + //The sfx2 will remove the documentsignature when the user adds a macro signature + if (meSignatureMode == SignatureModeMacros + && ret) + { + if (m_bHasDocumentSignature && !m_bWarningShowSignMacro) + { + //The warning says that the document signatures will be removed if the user + //continues. He can then either press 'OK' or 'NO' + //It the user presses 'Add' or 'Remove' several times then, then the warning + //is shown every time until the user presses 'OK'. From then on, the warning + //is not displayed anymore as long as the signatures dialog is alive. + if (QueryBox( + NULL, XMLSEC_RES(MSG_XMLSECDLG_QUERY_REMOVEDOCSIGNBEFORESIGN)).Execute() == RET_NO) + ret = false; + else + m_bWarningShowSignMacro = true; + + } + } + return ret; +} + +bool DigitalSignaturesDialog::canAdd() +{ + if (canAddRemove()) + return true; + return false; +} + +bool DigitalSignaturesDialog::canRemove() +{ + if (canAddRemove()) + return true; + return false; +} + +short DigitalSignaturesDialog::Execute() +{ + // Verify Signatures and add certificates to ListBox... + mbVerifySignatures = true; + ImplGetSignatureInformations(false); + ImplFillSignaturesBox(); + + // Only verify once, content will not change. + // But for refreshing signature information, StartVerifySignatureHdl will be called after each add/remove + mbVerifySignatures = false; + + return Dialog::Execute(); +} + +IMPL_LINK( DigitalSignaturesDialog, SignatureHighlightHdl, void*, EMPTYARG ) +{ + bool bSel = maSignaturesLB.FirstSelected() ? true : false; + maViewBtn.Enable( bSel ); + if ( maAddBtn.IsEnabled() ) // not read only + maRemoveBtn.Enable( bSel ); + + return 0; +} + +IMPL_LINK( DigitalSignaturesDialog, OKButtonHdl, void*, EMPTYARG ) +{ + // Export all other signatures... + SignatureStreamHelper aStreamHelper = ImplOpenSignatureStream( + embed::ElementModes::WRITE|embed::ElementModes::TRUNCATE, false ); + uno::Reference< io::XOutputStream > xOutputStream( + aStreamHelper.xSignatureStream, uno::UNO_QUERY ); + uno::Reference< com::sun::star::xml::sax::XDocumentHandler> xDocumentHandler = + maSignatureHelper.CreateDocumentHandlerWithHeader( xOutputStream ); + + int nInfos = maCurrentSignatureInformations.size(); + for( int n = 0 ; n < nInfos ; ++n ) + maSignatureHelper.ExportSignature( + xDocumentHandler, maCurrentSignatureInformations[ n ] ); + + maSignatureHelper.CloseDocumentHandler( xDocumentHandler); + + // If stream was not provided, we are responsible for committing it.... + if ( !mxSignatureStream.is() ) + { + uno::Reference< embed::XTransactedObject > xTrans( + aStreamHelper.xSignatureStorage, uno::UNO_QUERY ); + xTrans->commit(); + } + + EndDialog(RET_OK); + return 0; +} + +IMPL_LINK( DigitalSignaturesDialog, SignatureSelectHdl, void*, EMPTYARG ) +{ + ImplShowSignaturesDetails(); + return 0; +} + +IMPL_LINK( DigitalSignaturesDialog, ViewButtonHdl, Button*, EMPTYARG ) +{ + ImplShowSignaturesDetails(); + return 0; +} + +IMPL_LINK( DigitalSignaturesDialog, AddButtonHdl, Button*, EMPTYARG ) +{ + if( ! canAdd()) + return 0; + try + { + uno::Reference<com::sun::star::xml::crypto::XSecurityEnvironment> xSecEnv = maSignatureHelper.GetSecurityEnvironment(); + + uno::Reference<com::sun::star::security::XSerialNumberAdapter> xSerialNumberAdapter = + ::com::sun::star::security::SerialNumberAdapter::create(mxCtx); + CertificateChooser aChooser( this, mxCtx, xSecEnv, maCurrentSignatureInformations ); + if ( aChooser.Execute() == RET_OK ) + { + uno::Reference< ::com::sun::star::security::XCertificate > xCert = aChooser.GetSelectedCertificate(); + if ( !xCert.is() ) + { + DBG_ERRORFILE( "no certificate selected" ); + return -1; + } + rtl::OUString aCertSerial = xSerialNumberAdapter->toString( xCert->getSerialNumber() ); + if ( !aCertSerial.getLength() ) + { + DBG_ERROR( "Error in Certificate, problem with serial number!" ); + return -1; + } + + maSignatureHelper.StartMission(); + + sal_Int32 nSecurityId = maSignatureHelper.GetNewSecurityId(); + + rtl::OUStringBuffer aStrBuffer; + SvXMLUnitConverter::encodeBase64(aStrBuffer, xCert->getEncoded()); + + maSignatureHelper.SetX509Certificate( nSecurityId, + xCert->getIssuerName(), aCertSerial, + aStrBuffer.makeStringAndClear()); + + std::vector< rtl::OUString > aElements = + DocumentSignatureHelper::CreateElementList( + mxStore, rtl::OUString(), meSignatureMode, OOo3_2Document); + + sal_Int32 nElements = aElements.size(); + for ( sal_Int32 n = 0; n < nElements; n++ ) + { + bool bBinaryMode = !isXML(aElements[n]); + maSignatureHelper.AddForSigning( nSecurityId, aElements[n], aElements[n], bBinaryMode ); + } + + maSignatureHelper.SetDateTime( nSecurityId, Date(), Time() ); + + // We open a signature stream in which the existing and the new + //signature is written. ImplGetSignatureInformation (later in this function) will + //then read the stream an will fill maCurrentSignatureInformations. The final signature + //is written when the user presses OK. Then only maCurrentSignatureInformation and + //a sax writer are used to write the information. + SignatureStreamHelper aStreamHelper = ImplOpenSignatureStream( + css::embed::ElementModes::WRITE|css::embed::ElementModes::TRUNCATE, true); + Reference< css::io::XOutputStream > xOutputStream( + aStreamHelper.xSignatureStream, UNO_QUERY_THROW); + Reference< css::xml::sax::XDocumentHandler> xDocumentHandler = + maSignatureHelper.CreateDocumentHandlerWithHeader( xOutputStream ); + + // Export old signatures... + int nInfos = maCurrentSignatureInformations.size(); + for ( int n = 0; n < nInfos; n++ ) + maSignatureHelper.ExportSignature( xDocumentHandler, maCurrentSignatureInformations[n]); + + // Create a new one... + maSignatureHelper.CreateAndWriteSignature( xDocumentHandler ); + + // That's it... + maSignatureHelper.CloseDocumentHandler( xDocumentHandler); + + maSignatureHelper.EndMission(); + + aStreamHelper = SignatureStreamHelper(); // release objects... + + mbSignaturesChanged = true; + + sal_Int32 nStatus = maSignatureHelper.GetSignatureInformation( nSecurityId ).nStatus; + + if ( nStatus == ::com::sun::star::xml::crypto::SecurityOperationStatus_OPERATION_SUCCEEDED ) + { + mbSignaturesChanged = true; + + // Can't simply remember current information, need parsing for getting full information :( + // We need to verify the signatures again, otherwise the status in the signature information + // will not contain + // SecurityOperationStatus_OPERATION_SUCCEEDED + mbVerifySignatures = true; + ImplGetSignatureInformations(true); + ImplFillSignaturesBox(); + } + } + } + catch ( uno::Exception& ) + { + DBG_ERROR( "Exception while adding a signature!" ); + // Don't keep invalid entries... + ImplGetSignatureInformations(true); + ImplFillSignaturesBox(); + } + + return 0; +} + +IMPL_LINK( DigitalSignaturesDialog, RemoveButtonHdl, Button*, EMPTYARG ) +{ + if (!canRemove()) + return 0; + if( maSignaturesLB.FirstSelected() ) + { + try + { + sal_uInt16 nSelected = (sal_uInt16) (sal_uIntPtr) maSignaturesLB.FirstSelected()->GetUserData(); + maCurrentSignatureInformations.erase( maCurrentSignatureInformations.begin()+nSelected ); + + // Export all other signatures... + SignatureStreamHelper aStreamHelper = ImplOpenSignatureStream( + css::embed::ElementModes::WRITE | css::embed::ElementModes::TRUNCATE, true); + Reference< css::io::XOutputStream > xOutputStream( + aStreamHelper.xSignatureStream, UNO_QUERY_THROW); + Reference< css::xml::sax::XDocumentHandler> xDocumentHandler = + maSignatureHelper.CreateDocumentHandlerWithHeader( xOutputStream ); + + int nInfos = maCurrentSignatureInformations.size(); + for( int n = 0 ; n < nInfos ; ++n ) + maSignatureHelper.ExportSignature( xDocumentHandler, maCurrentSignatureInformations[ n ] ); + + maSignatureHelper.CloseDocumentHandler( xDocumentHandler); + + mbSignaturesChanged = true; + + aStreamHelper = SignatureStreamHelper(); // release objects... + + ImplFillSignaturesBox(); + } + catch ( uno::Exception& ) + { + DBG_ERROR( "Exception while removing a signature!" ); + // Don't keep invalid entries... + ImplGetSignatureInformations(true); + ImplFillSignaturesBox(); + } + } + + return 0; +} + +IMPL_LINK( DigitalSignaturesDialog, StartVerifySignatureHdl, void*, EMPTYARG ) +{ + return mbVerifySignatures ? 1 : 0; +} + +void DigitalSignaturesDialog::ImplFillSignaturesBox() +{ + maSignaturesLB.Clear(); + + uno::Reference< ::com::sun::star::xml::crypto::XSecurityEnvironment > xSecEnv = maSignatureHelper.GetSecurityEnvironment(); + uno::Reference<com::sun::star::security::XSerialNumberAdapter> xSerialNumberAdapter = + ::com::sun::star::security::SerialNumberAdapter::create(mxCtx); + + uno::Reference< ::com::sun::star::security::XCertificate > xCert; + + String aNullStr; + int nInfos = maCurrentSignatureInformations.size(); + int nValidSigs = 0, nValidCerts = 0; + bool bAllNewSignatures = true; + + if( nInfos ) + { + for( int n = 0; n < nInfos; ++n ) + { + DocumentSignatureAlgorithm mode = DocumentSignatureHelper::getDocumentAlgorithm( + m_sODFVersion, maCurrentSignatureInformations[n]); + std::vector< rtl::OUString > aElementsToBeVerified = + DocumentSignatureHelper::CreateElementList( + mxStore, ::rtl::OUString(), meSignatureMode, mode); + + const SignatureInformation& rInfo = maCurrentSignatureInformations[n]; + //First we try to get the certificate which is embedded in the XML Signature + if (rInfo.ouX509Certificate.getLength()) + xCert = xSecEnv->createCertificateFromAscii(rInfo.ouX509Certificate); + else { + //There must be an embedded certificate because we use it to get the + //issuer name. We cannot use /Signature/KeyInfo/X509Data/X509IssuerName + //because it could be modified by an attacker. The issuer is displayed + //in the digital signature dialog. + //Comparing the X509IssuerName with the one from the X509Certificate in order + //to find out if the X509IssuerName was modified does not work. See #i62684 + DBG_ASSERT(sal_False, "Could not find embedded certificate!"); + } + + //In case there is no embedded certificate we try to get it from a local store + //Todo: This probably could be removed, see above. + if (!xCert.is()) + xCert = xSecEnv->getCertificate( rInfo.ouX509IssuerName, xSerialNumberAdapter->toSequence( rInfo.ouX509SerialNumber ) ); + + DBG_ASSERT( xCert.is(), "Certificate not found and can't be created!" ); + + String aSubject; + String aIssuer; + String aDateTimeStr; + + bool bSigValid = false; + bool bCertValid = false; + if( xCert.is() ) + { + //check the validity of the cert + try { + sal_Int32 certResult = xSecEnv->verifyCertificate(xCert, + Sequence<css::uno::Reference<css::security::XCertificate> >()); + + bCertValid = certResult == css::security::CertificateValidity::VALID ? true : false; + if ( bCertValid ) + nValidCerts++; + + } catch (css::uno::SecurityException& ) { + OSL_ENSURE(0, "Verification of certificate failed"); + bCertValid = false; + } + + aSubject = XmlSec::GetContentPart( xCert->getSubjectName() ); + aIssuer = XmlSec::GetContentPart( xCert->getIssuerName() ); + // --> PB 2004-10-12 #i20172# String with date and time information + aDateTimeStr = XmlSec::GetDateTimeString( rInfo.stDateTime ); + } + bSigValid = ( rInfo.nStatus == ::com::sun::star::xml::crypto::SecurityOperationStatus_OPERATION_SUCCEEDED ); + + if ( bSigValid ) + { + bSigValid = DocumentSignatureHelper::checkIfAllFilesAreSigned( + aElementsToBeVerified, rInfo, mode); + + if( bSigValid ) + nValidSigs++; + } + + Image aImage; + if (!bSigValid) + { + aImage = maSigsInvalidImg.GetImage(); + } + else if (bSigValid && !bCertValid) + { + aImage = maSigsNotvalidatedImg.GetImage(); + } + //Check if the signature is a "old" document signature, that is, which was created + //by an version of OOo previous to 3.2 + else if (meSignatureMode == SignatureModeDocumentContent + && bSigValid && bCertValid && !DocumentSignatureHelper::isOOo3_2_Signature( + maCurrentSignatureInformations[n])) + { + aImage = maSigsNotvalidatedImg.GetImage(); + bAllNewSignatures &= false; + } + else if (meSignatureMode == SignatureModeDocumentContent + && bSigValid && bCertValid && DocumentSignatureHelper::isOOo3_2_Signature( + maCurrentSignatureInformations[n])) + { + aImage = maSigsValidImg.GetImage(); + } + else if (meSignatureMode == SignatureModeMacros + && bSigValid && bCertValid) + { + aImage = aImage = maSigsValidImg.GetImage(); + } + + SvLBoxEntry* pEntry = maSignaturesLB.InsertEntry( aNullStr, aImage, aImage ); + maSignaturesLB.SetEntryText( aSubject, pEntry, 1 ); + maSignaturesLB.SetEntryText( aIssuer, pEntry, 2 ); + maSignaturesLB.SetEntryText( aDateTimeStr, pEntry, 3 ); + pEntry->SetUserData( ( void* ) n ); // missuse user data as index + } + } + + bool bAllSigsValid = (nValidSigs == nInfos); + bool bAllCertsValid = (nValidCerts == nInfos); + bool bShowValidState = nInfos && (bAllSigsValid && bAllCertsValid && bAllNewSignatures); + + bool bShowNotValidatedState = nInfos && (bAllSigsValid && (!bAllCertsValid || !bAllNewSignatures)); + bool bShowInvalidState = nInfos && !bAllSigsValid; + + maSigsValidImg.Show( bShowValidState); + maSigsValidFI.Show( bShowValidState ); + maSigsInvalidImg.Show( bShowInvalidState ); + maSigsInvalidFI.Show( bShowInvalidState ); + + maSigsNotvalidatedImg.Show(bShowNotValidatedState); + //bAllNewSignatures is always true if we are not in document mode + maSigsNotvalidatedFI.Show(nInfos && bAllSigsValid && ! bAllCertsValid); + maSigsOldSignatureFI.Show(nInfos && bAllSigsValid && bAllCertsValid && !bAllNewSignatures); + + SignatureHighlightHdl( NULL ); +} + + +//If bUseTempStream is true then the temporary signature stream is used. +//Otherwise the real signature stream is used. +void DigitalSignaturesDialog::ImplGetSignatureInformations(bool bUseTempStream) +{ + maCurrentSignatureInformations.clear(); + + maSignatureHelper.StartMission(); + + SignatureStreamHelper aStreamHelper = ImplOpenSignatureStream( + css::embed::ElementModes::READ, bUseTempStream); + if ( aStreamHelper.xSignatureStream.is() ) + { + uno::Reference< io::XInputStream > xInputStream( aStreamHelper.xSignatureStream, uno::UNO_QUERY ); + maSignatureHelper.ReadAndVerifySignature( xInputStream ); + } + maSignatureHelper.EndMission(); + + maCurrentSignatureInformations = maSignatureHelper.GetSignatureInformations(); + + mbVerifySignatures = false; +} + +void DigitalSignaturesDialog::ImplShowSignaturesDetails() +{ + if( maSignaturesLB.FirstSelected() ) + { + sal_uInt16 nSelected = (sal_uInt16) (sal_uIntPtr) maSignaturesLB.FirstSelected()->GetUserData(); + const SignatureInformation& rInfo = maCurrentSignatureInformations[ nSelected ]; + css::uno::Reference<css::xml::crypto::XSecurityEnvironment > xSecEnv = + maSignatureHelper.GetSecurityEnvironment(); + css::uno::Reference<com::sun::star::security::XSerialNumberAdapter> xSerialNumberAdapter = + ::com::sun::star::security::SerialNumberAdapter::create(mxCtx); + // Use Certificate from doc, not from key store + uno::Reference< dcss::security::XCertificate > xCert; + if (rInfo.ouX509Certificate.getLength()) + xCert = xSecEnv->createCertificateFromAscii(rInfo.ouX509Certificate); + //fallback if no certificate is embedded, get if from store + if (!xCert.is()) + xCert = xSecEnv->getCertificate( rInfo.ouX509IssuerName, xSerialNumberAdapter->toSequence( rInfo.ouX509SerialNumber ) ); + + DBG_ASSERT( xCert.is(), "Error getting cCertificate!" ); + if ( xCert.is() ) + { + CertificateViewer aViewer( this, maSignatureHelper.GetSecurityEnvironment(), xCert, sal_False ); + aViewer.Execute(); + } + } +} + +//If bTempStream is true, then a temporary stream is return. If it is false then, the actual +//signature stream is used. +//Everytime the user presses Add a new temporary stream is created. +//We keep the temporary stream as member because ImplGetSignatureInformations +//will later access the stream to create DocumentSignatureInformation objects +//which are stored in maCurrentSignatureInformations. +SignatureStreamHelper DigitalSignaturesDialog::ImplOpenSignatureStream( + sal_Int32 nStreamOpenMode, bool bTempStream) +{ + SignatureStreamHelper aHelper; + if (bTempStream) + { + if (nStreamOpenMode & css::embed::ElementModes::TRUNCATE) + { + //We write always into a new temporary stream. + mxTempSignatureStream = Reference < css::io::XStream >( + mxCtx->getServiceManager()->createInstanceWithContext( + OUSTR( "com.sun.star.io.TempFile" ), mxCtx) , + UNO_QUERY_THROW); + aHelper.xSignatureStream = mxTempSignatureStream; + } + else + { + //When we read from the temp stream, then we must have previously + //created one. + OSL_ASSERT(mxTempSignatureStream.is()); + } + aHelper.xSignatureStream = mxTempSignatureStream; + } + else + { + //No temporary stream + if (!mxSignatureStream.is()) + { + //We may not have a dedicated stream for writing the signature + //So we take one directly from the storage + //Or DocumentDigitalSignatures::showDocumentContentSignatures was called, + //in which case Add/Remove is not allowed. This is done, for example, if the + //document is readonly + aHelper = DocumentSignatureHelper::OpenSignatureStream( + mxStore, nStreamOpenMode, meSignatureMode ); + } + else + { + aHelper.xSignatureStream = mxSignatureStream; + } + } + + if (nStreamOpenMode & css::embed::ElementModes::TRUNCATE) + { + css::uno::Reference < css::io::XTruncate > xTruncate( + aHelper.xSignatureStream, UNO_QUERY_THROW); + DBG_ASSERT( xTruncate.is(), "ImplOpenSignatureStream - Stream does not support xTruncate!" ); + xTruncate->truncate(); + } + else if ( bTempStream || mxSignatureStream.is()) + { + //In case we read the signature stream from the storage directly, + //which is the case when DocumentDigitalSignatures::showDocumentContentSignatures + //then XSeakable is not supported + css::uno::Reference < css::io::XSeekable > xSeek( + aHelper.xSignatureStream, UNO_QUERY_THROW); + DBG_ASSERT( xSeek.is(), "ImplOpenSignatureStream - Stream does not support xSeekable!" ); + xSeek->seek( 0 ); + } + + return aHelper; +} + diff --git a/xmlsecurity/source/dialogs/digitalsignaturesdialog.hrc b/xmlsecurity/source/dialogs/digitalsignaturesdialog.hrc new file mode 100644 index 000000000000..d63b44834f2c --- /dev/null +++ b/xmlsecurity/source/dialogs/digitalsignaturesdialog.hrc @@ -0,0 +1,36 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#if ! defined INCLUDED_DIGITALSIGNATURESDIALOG_HRC +#define INCLUDED_DIGITALSIGNATURESDIALOG_HRC + +//global.hrc in xmlsecurity/inc starts at 1000 +#define RID_DIGITALSIGNATUREDLG_START 2000 + +#define RID_XMLSECDLG_OLD_ODF_FORMAT RID_DIGITALSIGNATUREDLG_START +#define MSG_XMLSECDLG_QUERY_REMOVEDOCSIGNBEFORESIGN (RID_DIGITALSIGNATUREDLG_START + 1) +#endif diff --git a/xmlsecurity/source/dialogs/digitalsignaturesdialog.src b/xmlsecurity/source/dialogs/digitalsignaturesdialog.src new file mode 100644 index 000000000000..54ef5ce17eeb --- /dev/null +++ b/xmlsecurity/source/dialogs/digitalsignaturesdialog.src @@ -0,0 +1,222 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "dialogs.hrc" +#include "helpids.hrc" +#include "digitalsignaturesdialog.hrc" + +ModalDialog RID_XMLSECDLG_DIGSIG +{ + HelpId = HID_XMLSEC_DLG_DIGSIG; + Size = MAP_APPFONT( 234, 191 ); + OutputSize = TRUE; + Closeable = TRUE; + Moveable = TRUE; + SVLook = TRUE; + + Text [ en-US ] = "Digital Signatures"; + + FixedText FT_HINT_DOC + { + Pos = MAP_APPFONT( 6, 3 ); + Size = MAP_APPFONT( 222, 8 ); + Hide = TRUE; + Text [ en-US ] = "The following have signed the document content:"; + }; + FixedText FT_HINT_BASIC + { + Pos = MAP_APPFONT( 6, 3 ); + Size = MAP_APPFONT( 222, 8 ); + Hide = TRUE; + Text [ en-US ] = "The following have signed the document macro:"; + }; + FixedText FT_HINT_PACK + { + Pos = MAP_APPFONT( 6, 3 ); + Size = MAP_APPFONT( 222, 8 ); + Hide = TRUE; + Text [ en-US ] = "The following have signed this package:"; + }; + Control LB_SIGNATURES + { + HelpId = HID_XMLSEC_CTRL_SIGNATURESDLG; + Pos = MAP_APPFONT( 6, 14 ); + Size = MAP_APPFONT( 222, 109 ); + SVLook = TRUE; + Border = TRUE; + }; + String STR_HEADERBAR + { + Text [ en-US ] = "\tSigned by\tDigital ID issued by\tDate"; + }; + String STR_VALID_SIGNATURE + { + Text [ en-US ] = "Valid signature"; + }; + String STR_NO_INFO_TO_VERIFY + { + Text [ en-US ] = "Certificate could not be validated"; + }; + String STR_INVALID_SIGNATURE + { + Text [ en-US ] = "The signatures in this document are invalid"; + }; + + FixedImage IMG_STATE_VALID + { + Pos = MAP_APPFONT( 6, 127 ); + Size = MAP_APPFONT( 33, 22 ); + Fixed = Image + { + ImageBitmap = Bitmap { File = "signet_11x16.png"; }; + MaskColor = STD_MASKCOLOR; + }; + }; + FixedText FI_STATE_VALID + { + Pos = MAP_APPFONT( 6, 127 ); + Size = MAP_APPFONT( 222, 8 ); + Hide = TRUE; + Text [ en-US ] = "The signatures in this document are valid"; + }; + FixedText FI_STATE_OLDSIGNATURE + { + Pos = MAP_APPFONT( 6, 127 ); + Size = MAP_APPFONT( 222, 8 ); + Hide = TRUE; + Text [ en-US ] = "Not all parts of the document are signed"; + }; + FixedImage IMG_STATE_BROKEN + { + Pos = MAP_APPFONT( 6, 127 ); + Size = MAP_APPFONT( 33, 22 ); + Fixed = Image + { + ImageBitmap = Bitmap { File = "caution_11x16.png"; }; + MaskColor = STD_MASKCOLOR; + }; + }; + FixedText FI_STATE_BROKEN + { + Pos = MAP_APPFONT( 6, 127 ); + Size = MAP_APPFONT( 222, 8 ); + Hide = TRUE; + Text [ en-US ] = "The signatures in this document are invalid"; + }; + FixedImage IMG_STATE_NOTVALIDATED + { + Pos = MAP_APPFONT( 6, 127 ); + Size = MAP_APPFONT( 33, 22 ); + Fixed = Image + { + ImageBitmap = Bitmap { File = "notcertificate_16.png"; }; + MaskColor = STD_MASKCOLOR; + }; + }; + FixedText FI_STATE_NOTVALIDATED + { + Pos = MAP_APPFONT( 6, 127 ); + Size = MAP_APPFONT( 222, 8 ); + Hide = TRUE; + }; + PushButton BTN_VIEWCERT + { + HelpID = "xmlsecurity:PushButton:RID_XMLSECDLG_DIGSIG:BTN_VIEWCERT"; + Pos = MAP_APPFONT( 6, 142 ); + Size = MAP_APPFONT( 70, 14 ); + Text [ en-US ] = "View Certificate..."; + }; + PushButton BTN_ADDCERT + { + HelpID = "xmlsecurity:PushButton:RID_XMLSECDLG_DIGSIG:BTN_ADDCERT"; + Pos = MAP_APPFONT( 82, 142 ); + Size = MAP_APPFONT( 70, 14 ); + Text [ en-US ] = "Sign Document..."; + }; + PushButton BTN_REMOVECERT + { + HelpID = "xmlsecurity:PushButton:RID_XMLSECDLG_DIGSIG:BTN_REMOVECERT"; + Pos = MAP_APPFONT( 158, 142 ); + Size = MAP_APPFONT( 70, 14 ); + Text [ en-US ] = "Remove"; + }; + FixedLine FL_BOTTOM_SEP + { + Pos = MAP_APPFONT( 0, 160 ); + Size = MAP_APPFONT( 234, 8 ); + }; + OKButton BTN_OK + { + DefButton = TRUE; + Pos = MAP_APPFONT( 178, 171 ); + Size = MAP_APPFONT( 50, 14 ); + Text [ en-US ] = "Close"; + }; + HelpButton BTN_HELP + { + Pos = MAP_APPFONT( 6, 171 ); + Size = MAP_APPFONT( 50, 14 ); + }; + Image IMG_STATE_VALID_HC + { + ImageBitmap = Bitmap { File = "signet_11x16_h.png"; }; + MaskColor = STD_MASKCOLOR; + }; + Image IMG_STATE_BROKEN_HC + { + ImageBitmap = Bitmap { File = "caution_11x16_h.png"; }; + MaskColor = STD_MASKCOLOR; + }; + Image IMG_STATE_NOTVALIDATED_HC + { + ImageBitmap = Bitmap { File = "notcertificate_16_h.png"; }; + MaskColor = STD_MASKCOLOR; + }; +}; + + +ErrorBox RID_XMLSECDLG_OLD_ODF_FORMAT +{ + Buttons = WB_OK ; + DefButton = WB_DEF_OK ; + Message [ en-US ] = + "This document contains signatures in ODF 1.1 (OpenOffice.org 2.x) format. " + "Signing documents in %PRODUCTNAME %PRODUCTVERSION requires ODF 1.2 format version. " + "Thus no signatures can be added or removed to this document.\n\n" + "Save document in ODF 1.2 format and add all desired signatures again."; +}; + + +QueryBox MSG_XMLSECDLG_QUERY_REMOVEDOCSIGNBEFORESIGN +{ + Buttons = WB_YES_NO ; + DefButton = WB_DEF_NO ; + Message [ en-US ] = "Adding or removing a macro signature will remove all document signatures.\n" + "Do you really want to continue?"; +}; + + diff --git a/xmlsecurity/source/dialogs/helpids.hrc b/xmlsecurity/source/dialogs/helpids.hrc new file mode 100644 index 000000000000..7c4514607f57 --- /dev/null +++ b/xmlsecurity/source/dialogs/helpids.hrc @@ -0,0 +1,55 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _XMLSEC_HELPIDS_HRC +#define _XMLSEC_HELPIDS_HRC + +// include --------------------------------------------------------------- + +#include <svl/solar.hrc> + +// Help-Ids -------------------------------------------------------------- + +#define HID_XMLSEC_TP_MACROSEC "XMLSECURITY_HID_XMLSEC_TP_MACROSEC" +#define HID_XMLSEC_TP_SECLEVEL "XMLSECURITY_HID_XMLSEC_TP_SECLEVEL" +#define HID_XMLSEC_TP_TRUSTSOURCES "XMLSECURITY_HID_XMLSEC_TP_TRUSTSOURCES" +#define HID_XMLSEC_DLG_CERTVIEWER "XMLSECURITY_HID_XMLSEC_DLG_CERTVIEWER" +#define HID_XMLSEC_TP_GENERAL "XMLSECURITY_HID_XMLSEC_TP_GENERAL" +#define HID_XMLSEC_TP_DETAILS "XMLSECURITY_HID_XMLSEC_TP_DETAILS" +#define HID_XMLSEC_TP_CERTPATH "XMLSECURITY_HID_XMLSEC_TP_CERTPATH" +#define HID_XMLSEC_DLG_DIGSIG "XMLSECURITY_HID_XMLSEC_DLG_DIGSIG" +#define HID_XMLSEC_TP_MACROWARN "XMLSECURITY_HID_XMLSEC_TP_MACROWARN" +#define HID_XMLSEC_DLG_CERTCHOOSER "XMLSECURITY_HID_XMLSEC_DLG_CERTCHOOSER" +#define HID_XMLSEC_CTRL_TRUSTSOURCES "XMLSECURITY_HID_XMLSEC_CTRL_TRUSTSOURCES" +#define HID_XMLSEC_CTRL_ELEMENTS "XMLSECURITY_HID_XMLSEC_CTRL_ELEMENTS" +#define HID_XMLSEC_CTRL_VIEWSIGNATURES "XMLSECURITY_HID_XMLSEC_CTRL_VIEWSIGNATURES" +#define HID_XMLSEC_CTRL_SIGNATURESDLG "XMLSECURITY_HID_XMLSEC_CTRL_SIGNATURESDLG" +#define HID_XMLSEC_CTRL_CHOOSESIGNATURES "XMLSECURITY_HID_XMLSEC_CTRL_CHOOSESIGNATURES" +#define HID_XMLSEC_TREE_SIGNATURESDLG "XMLSECURITY_HID_XMLSEC_TREE_SIGNATURESDLG" + +#endif // #ifndef _XMLSEC_HELPIDS_HRC + diff --git a/xmlsecurity/source/dialogs/macrosecurity.cxx b/xmlsecurity/source/dialogs/macrosecurity.cxx new file mode 100644 index 000000000000..6e9498c264b5 --- /dev/null +++ b/xmlsecurity/source/dialogs/macrosecurity.cxx @@ -0,0 +1,468 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_xmlsecurity.hxx" + +#include <xmlsecurity/macrosecurity.hxx> +#include <xmlsecurity/certificatechooser.hxx> +#include <xmlsecurity/certificateviewer.hxx> +#include <xmlsecurity/biginteger.hxx> + +#include <osl/file.hxx> +#include <vcl/help.hxx> + + +#include <com/sun/star/xml/crypto/XSecurityEnvironment.hpp> +#include <com/sun/star/security/SerialNumberAdapter.hpp> +#include <comphelper/sequence.hxx> +#include <sfx2/filedlghelper.hxx> +#include <comphelper/processfactory.hxx> +#include <com/sun/star/uno/Exception.hpp> +#include <com/sun/star/lang/XMultiServiceFactory.hpp> +#include <com/sun/star/ui/dialogs/XFolderPicker.hpp> +#include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp> +#include <tools/urlobj.hxx> + +#include <vcl/msgbox.hxx> + +#include "dialogs.hrc" +#include "resourcemanager.hxx" + +/* HACK: disable some warnings for MS-C */ +#ifdef _MSC_VER +#pragma warning (disable : 4355) // 4355: this used in initializer-list +#endif + +using namespace ::com::sun::star; + + +IMPL_LINK( MacroSecurity, OkBtnHdl, void*, EMPTYARG ) +{ + mpLevelTP->ClosePage(); + mpTrustSrcTP->ClosePage(); + + EndDialog( RET_OK ); + + return 0; +} + +MacroSecurity::MacroSecurity( Window* _pParent, const cssu::Reference< cssu::XComponentContext> &_rxCtx, const cssu::Reference< dcss::xml::crypto::XSecurityEnvironment >& _rxSecurityEnvironment ) + :TabDialog ( _pParent, XMLSEC_RES( RID_XMLSECTP_MACROSEC ) ) + ,maTabCtrl ( this, XMLSEC_RES( 1 ) ) + ,maOkBtn ( this, XMLSEC_RES( BTN_OK ) ) + ,maCancelBtn ( this, XMLSEC_RES( BTN_CANCEL ) ) + ,maHelpBtn ( this, XMLSEC_RES( BTN_HELP ) ) + ,maResetBtn ( this, XMLSEC_RES( BTN_RESET ) ) +{ + FreeResource(); + + mxCtx = _rxCtx; + mxSecurityEnvironment = _rxSecurityEnvironment; + + mpLevelTP = new MacroSecurityLevelTP( &maTabCtrl, this ); + mpTrustSrcTP = new MacroSecurityTrustedSourcesTP( &maTabCtrl, this ); + + maTabCtrl.SetTabPage( RID_XMLSECTP_SECLEVEL, mpLevelTP ); + maTabCtrl.SetTabPage( RID_XMLSECTP_TRUSTSOURCES, mpTrustSrcTP ); + maTabCtrl.SetCurPageId( RID_XMLSECTP_SECLEVEL ); + + maOkBtn.SetClickHdl( LINK( this, MacroSecurity, OkBtnHdl ) ); +} + +MacroSecurity::~MacroSecurity() +{ + delete maTabCtrl.GetTabPage( RID_XMLSECTP_TRUSTSOURCES ); + delete maTabCtrl.GetTabPage( RID_XMLSECTP_SECLEVEL ); +} + + +MacroSecurityTP::MacroSecurityTP( Window* _pParent, const ResId& _rResId, MacroSecurity* _pDlg ) + :TabPage ( _pParent, _rResId ) + ,mpDlg ( _pDlg ) +{ +} + +MacroSecurityLevelTP::MacroSecurityLevelTP( Window* _pParent, MacroSecurity* _pDlg ) + :MacroSecurityTP ( _pParent, XMLSEC_RES( RID_XMLSECTP_SECLEVEL ), _pDlg ) + ,maSecLevelFL ( this, XMLSEC_RES( FL_SECLEVEL ) ) + ,maSecReadonlyFI ( this, XMLSEC_RES( FI_SEC_READONLY )) + ,maVeryHighRB ( this, XMLSEC_RES( RB_VERYHIGH ) ) + ,maHighRB ( this, XMLSEC_RES( RB_HIGH ) ) + ,maMediumRB ( this, XMLSEC_RES( RB_MEDIUM ) ) + ,maLowRB ( this, XMLSEC_RES( RB_LOW ) ) +{ + FreeResource(); + + maLowRB.SetClickHdl( LINK( this, MacroSecurityLevelTP, RadioButtonHdl ) ); + maMediumRB.SetClickHdl( LINK( this, MacroSecurityLevelTP, RadioButtonHdl ) ); + maHighRB.SetClickHdl( LINK( this, MacroSecurityLevelTP, RadioButtonHdl ) ); + maVeryHighRB.SetClickHdl( LINK( this, MacroSecurityLevelTP, RadioButtonHdl ) ); + + mnCurLevel = (sal_uInt16) mpDlg->maSecOptions.GetMacroSecurityLevel(); + sal_Bool bReadonly = mpDlg->maSecOptions.IsReadOnly( SvtSecurityOptions::E_MACRO_SECLEVEL ); + + RadioButton* pCheck = 0; + switch( mnCurLevel ) + { + case 3: pCheck = &maVeryHighRB; break; + case 2: pCheck = &maHighRB; break; + case 1: pCheck = &maMediumRB; break; + case 0: pCheck = &maLowRB; break; + } + if(pCheck) + pCheck->Check(); + else + { + DBG_ERROR("illegal macro security level"); + } + maSecReadonlyFI.Show(bReadonly); + if(bReadonly) + { + //move to the selected button + if( pCheck && pCheck != &maVeryHighRB) + { + long nDiff = pCheck->GetPosPixel().Y() - maVeryHighRB.GetPosPixel().Y(); + Point aPos(maSecReadonlyFI.GetPosPixel()); + aPos.Y() += nDiff; + maSecReadonlyFI.SetPosPixel(aPos); + } + maVeryHighRB.Enable(sal_False); + maHighRB.Enable(sal_False); + maMediumRB.Enable(sal_False); + maLowRB.Enable(sal_False); + } + +} + +IMPL_LINK( MacroSecurityLevelTP, RadioButtonHdl, RadioButton*, EMPTYARG ) +{ + sal_uInt16 nNewLevel = 0; + if( maVeryHighRB.IsChecked() ) + nNewLevel = 3; + else if( maHighRB.IsChecked() ) + nNewLevel = 2; + else if( maMediumRB.IsChecked() ) + nNewLevel = 1; + + if ( nNewLevel != mnCurLevel ) + { + mnCurLevel = nNewLevel; + mpDlg->EnableReset(); + } + + return 0; +} + +void MacroSecurityLevelTP::ClosePage( void ) +{ + mpDlg->maSecOptions.SetMacroSecurityLevel( mnCurLevel ); +} + +void MacroSecurityTrustedSourcesTP::ImplCheckButtons() +{ + bool bCertSelected = maTrustCertLB.FirstSelected() != NULL; + maViewCertPB.Enable( bCertSelected ); + maRemoveCertPB.Enable( bCertSelected && !mbAuthorsReadonly); + + bool bLocationSelected = maTrustFileLocLB.GetSelectEntryPos() != LISTBOX_ENTRY_NOTFOUND; + maRemoveLocPB.Enable( bLocationSelected && !mbURLsReadonly); +} + + +IMPL_LINK( MacroSecurityTrustedSourcesTP, ViewCertPBHdl, void*, EMPTYARG ) +{ + if( maTrustCertLB.FirstSelected() ) + { + sal_uInt16 nSelected = sal_uInt16( sal_uIntPtr( maTrustCertLB.FirstSelected()->GetUserData() ) ); + + uno::Reference< dcss::security::XSerialNumberAdapter > xSerialNumberAdapter = + ::com::sun::star::security::SerialNumberAdapter::create(mpDlg->mxCtx); + + uno::Reference< dcss::security::XCertificate > xCert = mpDlg->mxSecurityEnvironment->getCertificate( maTrustedAuthors[nSelected][0], xSerialNumberAdapter->toSequence( maTrustedAuthors[nSelected][1] ) ); + + // If we don't get it, create it from signature data: + if ( !xCert.is() ) + xCert = mpDlg->mxSecurityEnvironment->createCertificateFromAscii( maTrustedAuthors[nSelected][2] ) ; + + DBG_ASSERT( xCert.is(), "*MacroSecurityTrustedSourcesTP::ViewCertPBHdl(): Certificate not found and can't be created!" ); + + if ( xCert.is() ) + { + CertificateViewer aViewer( this, mpDlg->mxSecurityEnvironment, xCert, sal_False ); + aViewer.Execute(); + } + } + return 0; +} + +IMPL_LINK( MacroSecurityTrustedSourcesTP, RemoveCertPBHdl, void*, EMPTYARG ) +{ + if( maTrustCertLB.FirstSelected() ) + { + sal_uInt16 nAuthor = sal_uInt16( sal_uIntPtr( maTrustCertLB.FirstSelected()->GetUserData() ) ); + ::comphelper::removeElementAt( maTrustedAuthors, nAuthor ); + + FillCertLB(); + ImplCheckButtons(); + } + + return 0; +} + +IMPL_LINK( MacroSecurityTrustedSourcesTP, AddLocPBHdl, void*, EMPTYARG ) +{ + try + { + rtl::OUString aService( RTL_CONSTASCII_USTRINGPARAM( FOLDER_PICKER_SERVICE_NAME ) ); + uno::Reference < lang::XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() ); + uno::Reference < ui::dialogs::XFolderPicker > xFolderPicker( xFactory->createInstance( aService ), uno::UNO_QUERY ); + + short nRet = xFolderPicker->execute(); + + if( ui::dialogs::ExecutableDialogResults::OK != nRet ) + return 0; + + rtl::OUString aPathStr = xFolderPicker->getDirectory(); + INetURLObject aNewObj( aPathStr ); + aNewObj.removeFinalSlash(); + + // then the new path also an URL else system path + ::rtl::OUString aSystemFileURL = ( aNewObj.GetProtocol() != INET_PROT_NOT_VALID ) ? + aPathStr : aNewObj.getFSysPath( INetURLObject::FSYS_DETECT ); + + String aNewPathStr(aSystemFileURL); + + if ( osl::FileBase::getSystemPathFromFileURL( aSystemFileURL, aSystemFileURL ) == osl::FileBase::E_None ) + aNewPathStr = aSystemFileURL; + + if( maTrustFileLocLB.GetEntryPos( aNewPathStr ) == LISTBOX_ENTRY_NOTFOUND ) + { + maTrustFileLocLB.InsertEntry( aNewPathStr ); + } + + ImplCheckButtons(); + } + catch( uno::Exception& ) + { + DBG_ERRORFILE( "MacroSecurityTrustedSourcesTP::AddLocPBHdl(): exception from folder picker" ); + } + + return 0; +} + +IMPL_LINK( MacroSecurityTrustedSourcesTP, RemoveLocPBHdl, void*, EMPTYARG ) +{ + sal_uInt16 nSel = maTrustFileLocLB.GetSelectEntryPos(); + if( nSel != LISTBOX_ENTRY_NOTFOUND ) + { + maTrustFileLocLB.RemoveEntry( nSel ); + // --> PB 2004-09-21 #i33584# + // after remove an entry, select another one if exists + sal_uInt16 nNewCount = maTrustFileLocLB.GetEntryCount(); + if ( nNewCount > 0 ) + { + if ( nSel >= nNewCount ) + nSel = nNewCount - 1; + maTrustFileLocLB.SelectEntryPos( nSel ); + } + // <-- + ImplCheckButtons(); + } + + return 0; +} + +IMPL_LINK( MacroSecurityTrustedSourcesTP, TrustCertLBSelectHdl, void*, EMPTYARG ) +{ + ImplCheckButtons(); + return 0; +} + +IMPL_LINK( MacroSecurityTrustedSourcesTP, TrustFileLocLBSelectHdl, void*, EMPTYARG ) +{ + ImplCheckButtons(); + return 0; +} + +void MacroSecurityTrustedSourcesTP::FillCertLB( void ) +{ + maTrustCertLB.Clear(); + + sal_uInt32 nEntries = maTrustedAuthors.getLength(); + + if ( nEntries && mpDlg->mxSecurityEnvironment.is() ) + { + for( sal_uInt32 nEntry = 0 ; nEntry < nEntries ; ++nEntry ) + { + cssu::Sequence< ::rtl::OUString >& rEntry = maTrustedAuthors[ nEntry ]; + uno::Reference< css::security::XCertificate > xCert; + + // create from RawData + xCert = mpDlg->mxSecurityEnvironment->createCertificateFromAscii( rEntry[ 2 ] ); + + SvLBoxEntry* pLBEntry = maTrustCertLB.InsertEntry( XmlSec::GetContentPart( xCert->getSubjectName() ) ); + maTrustCertLB.SetEntryText( XmlSec::GetContentPart( xCert->getIssuerName() ), pLBEntry, 1 ); + maTrustCertLB.SetEntryText( XmlSec::GetDateTimeString( xCert->getNotValidAfter() ), pLBEntry, 2 ); + pLBEntry->SetUserData( ( void* ) sal_Int32( nEntry ) ); // missuse user data as index + } + } +} + +MacroSecurityTrustedSourcesTP::MacroSecurityTrustedSourcesTP( Window* _pParent, MacroSecurity* _pDlg ) + :MacroSecurityTP ( _pParent, XMLSEC_RES( RID_XMLSECTP_TRUSTSOURCES ), _pDlg ) + ,maTrustCertFL ( this, XMLSEC_RES( FL_TRUSTCERT ) ) + ,maTrustCertROFI ( this, XMLSEC_RES( FI_TRUSTCERT_RO ) ) + ,maTrustCertLB ( this, XMLSEC_RES( LB_TRUSTCERT ) ) + ,maAddCertPB ( this, XMLSEC_RES( PB_ADD_TRUSTCERT ) ) + ,maViewCertPB ( this, XMLSEC_RES( PB_VIEW_TRUSTCERT ) ) + ,maRemoveCertPB ( this, XMLSEC_RES( PB_REMOVE_TRUSTCERT ) ) + ,maTrustFileLocFL ( this, XMLSEC_RES( FL_TRUSTFILELOC ) ) + ,maTrustFileROFI ( this, XMLSEC_RES( FI_TRUSTFILE_RO ) ) + ,maTrustFileLocFI ( this, XMLSEC_RES( FI_TRUSTFILELOC ) ) + ,maTrustFileLocLB ( this, XMLSEC_RES( LB_TRUSTFILELOC ) ) + ,maAddLocPB ( this, XMLSEC_RES( FL_ADD_TRUSTFILELOC ) ) + ,maRemoveLocPB ( this, XMLSEC_RES( FL_REMOVE_TRUSTFILELOC ) ) +{ + static long nTabs[] = { 3, 0, 35*CS_LB_WIDTH/100, 70*CS_LB_WIDTH/100 }; + maTrustCertLB.SetTabs( &nTabs[ 0 ] ); + maTrustCertLB.InsertHeaderEntry( String( XMLSEC_RES( STR_HEADERBAR ) ) ); + + FreeResource(); + + maTrustCertLB.SetSelectHdl( LINK( this, MacroSecurityTrustedSourcesTP, TrustCertLBSelectHdl ) ); + maAddCertPB.Hide(); // not used in the moment... + maViewCertPB.SetClickHdl( LINK( this, MacroSecurityTrustedSourcesTP, ViewCertPBHdl ) ); + maViewCertPB.Disable(); + maRemoveCertPB.SetClickHdl( LINK( this, MacroSecurityTrustedSourcesTP, RemoveCertPBHdl ) ); + maRemoveCertPB.Disable(); + + maTrustFileLocLB.SetSelectHdl( LINK( this, MacroSecurityTrustedSourcesTP, TrustFileLocLBSelectHdl ) ); + maAddLocPB.SetClickHdl( LINK( this, MacroSecurityTrustedSourcesTP, AddLocPBHdl ) ); + maRemoveLocPB.SetClickHdl( LINK( this, MacroSecurityTrustedSourcesTP, RemoveLocPBHdl ) ); + maRemoveLocPB.Disable(); + + maTrustedAuthors = mpDlg->maSecOptions.GetTrustedAuthors(); + mbAuthorsReadonly = mpDlg->maSecOptions.IsReadOnly( SvtSecurityOptions::E_MACRO_TRUSTEDAUTHORS ); + maTrustCertROFI.Show( mbAuthorsReadonly ); + mbAuthorsReadonly ? maTrustCertLB.DisableTable() : maTrustCertLB.EnableTable(); +// unused button +// maAddCertPB.Enable( !mbAuthorsReadonly ); + + FillCertLB(); + + cssu::Sequence< rtl::OUString > aSecureURLs = mpDlg->maSecOptions.GetSecureURLs(); + mbURLsReadonly = mpDlg->maSecOptions.IsReadOnly( SvtSecurityOptions::E_SECUREURLS ); + maTrustFileROFI.Show( mbURLsReadonly ); + maTrustFileLocLB.Enable( !mbURLsReadonly ); + maAddLocPB .Enable( !mbURLsReadonly ); + + sal_Int32 nEntryCnt = aSecureURLs.getLength(); + for( sal_Int32 i = 0 ; i < nEntryCnt ; ++i ) + { + ::rtl::OUString aSystemFileURL( aSecureURLs[ i ] ); + osl::FileBase::getSystemPathFromFileURL( aSystemFileURL, aSystemFileURL ); + maTrustFileLocLB.InsertEntry( aSystemFileURL ); + } +} + +void MacroSecurityTrustedSourcesTP::ActivatePage() +{ + mpDlg->EnableReset( false ); + FillCertLB(); +} + +void MacroSecurityTrustedSourcesTP::ClosePage( void ) +{ + sal_uInt16 nEntryCnt = maTrustFileLocLB.GetEntryCount(); + if( nEntryCnt ) + { + cssu::Sequence< rtl::OUString > aSecureURLs( nEntryCnt ); + for( sal_uInt16 i = 0 ; i < nEntryCnt ; ++i ) + { + ::rtl::OUString aURL( maTrustFileLocLB.GetEntry( i ) ); + osl::FileBase::getFileURLFromSystemPath( aURL, aURL ); + aSecureURLs[ i ] = aURL; + } + + mpDlg->maSecOptions.SetSecureURLs( aSecureURLs ); + } + // --> PB 2004-09-21 #i33584# + // don't forget to remove the old saved SecureURLs + else + mpDlg->maSecOptions.SetSecureURLs( cssu::Sequence< rtl::OUString >() ); + // <-- + + mpDlg->maSecOptions.SetTrustedAuthors( maTrustedAuthors ); +} +/*-- 26.02.2004 13:31:04--------------------------------------------------- + + -----------------------------------------------------------------------*/ +ReadOnlyImage::ReadOnlyImage(Window* pParent, const ResId rResId) : + FixedImage(pParent, rResId) +{ + sal_Bool bHighContrast = pParent->GetSettings().GetStyleSettings().GetHighContrastMode(); + SetImage( Image(XMLSEC_RES( bHighContrast ? RID_XMLSECTP_LOCK_HC : RID_XMLSECTP_LOCK ))); +} + +/*-- 26.02.2004 13:31:04--------------------------------------------------- + + -----------------------------------------------------------------------*/ +ReadOnlyImage::~ReadOnlyImage() +{ +} +/*-- 26.02.2004 13:31:04--------------------------------------------------- + + -----------------------------------------------------------------------*/ +void ReadOnlyImage::RequestHelp( const HelpEvent& rHEvt ) +{ + if( Help::IsBalloonHelpEnabled() || Help::IsQuickHelpEnabled() ) + { + Rectangle aLogicPix( LogicToPixel( Rectangle( Point(), GetOutputSize() ) ) ); + Rectangle aScreenRect( OutputToScreenPixel( aLogicPix.TopLeft() ), + OutputToScreenPixel( aLogicPix.BottomRight() ) ); + + String aStr(ReadOnlyImage::GetHelpTip()); + if ( Help::IsBalloonHelpEnabled() ) + Help::ShowBalloon( this, rHEvt.GetMousePosPixel(), aScreenRect, + aStr ); + else if ( Help::IsQuickHelpEnabled() ) + Help::ShowQuickHelp( this, aScreenRect, aStr ); + } + else + Window::RequestHelp( rHEvt ); +} + +/*-- 26.02.2004 14:20:21--------------------------------------------------- + + -----------------------------------------------------------------------*/ +const String& ReadOnlyImage::GetHelpTip() +{ + static String aStr(XMLSEC_RES( RID_XMLSECTP_READONLY_CONFIG_TIP)); + return aStr; +} + diff --git a/xmlsecurity/source/dialogs/macrosecurity.src b/xmlsecurity/source/dialogs/macrosecurity.src new file mode 100644 index 000000000000..5a4ab4f12b10 --- /dev/null +++ b/xmlsecurity/source/dialogs/macrosecurity.src @@ -0,0 +1,250 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "dialogs.hrc" +#include "helpids.hrc" + +TabDialog RID_XMLSECTP_MACROSEC +{ + HelpID = HID_XMLSEC_TP_MACROSEC; + Size = MAP_APPFONT( TD_WIDTH, TD_HEIGHT ); + OutputSize = TRUE; + Closeable = TRUE; + Moveable = TRUE; + SVLook = TRUE; + + Text [ en-US ] = "Macro Security"; + TabControl 1 + { + Pos = MAP_APPFONT( TD_SP_INNERBORDER_LEFT, TD_SP_INNERBORDER_TOP ); + Size = MAP_APPFONT( TP_WIDTH, TP_HEIGHT+RIDDER_HEIGHT ); + SVLook = TRUE ; + PageList = + { + PageItem + { + Identifier = RID_XMLSECTP_SECLEVEL; + Text [ en-US ] = "Security Level"; + }; + PageItem + { + Identifier = RID_XMLSECTP_TRUSTSOURCES; + Text [ en-US ] = "Trusted Sources"; + }; + }; + }; + OKButton BTN_OK + { + Pos = MAP_APPFONT( MS_COL_H, CV_ROW_A ); + Size = MAP_APPFONT( RSC_CD_PUSHBUTTON_WIDTH, RSC_CD_PUSHBUTTON_HEIGHT ); + DefButton = TRUE; + }; + CancelButton BTN_CANCEL + { + Pos = MAP_APPFONT( MS_COL_F, CV_ROW_A ); + Size = MAP_APPFONT( RSC_CD_PUSHBUTTON_WIDTH, RSC_CD_PUSHBUTTON_HEIGHT ); + }; + HelpButton BTN_HELP + { + Pos = MAP_APPFONT( MS_COL_D, CV_ROW_A ); + Size = MAP_APPFONT( RSC_CD_PUSHBUTTON_WIDTH, RSC_CD_PUSHBUTTON_HEIGHT ); + }; + PushButton BTN_RESET + { + Pos = MAP_APPFONT( MS_COL_B, CV_ROW_A ); + Size = MAP_APPFONT( RSC_CD_PUSHBUTTON_WIDTH, RSC_CD_PUSHBUTTON_HEIGHT ); + Text [ en-US ] = "Reset"; + }; +}; + +TabPage RID_XMLSECTP_SECLEVEL +{ + HelpId = HID_XMLSEC_TP_SECLEVEL; + Size = MAP_APPFONT( TP_WIDTH, TP_HEIGHT ); + OutputSize = TRUE; + Hide = TRUE; + SVLook = TRUE; + FixedLine FL_SECLEVEL + { + Pos = MAP_APPFONT( SL_COL_0, SL_ROW_0 ); + Size = MAP_APPFONT( SL_COL_3-SL_COL_0, RSC_CD_FIXEDLINE_HEIGHT ); + Hide = TRUE; + }; + FixedImage FI_SEC_READONLY + { + Pos = MAP_APPFONT( SL_COL_1 - 7, SL_ROW_0 + 4 ); + Size = MAP_APPFONT( 6, 6 ); + }; + RadioButton RB_VERYHIGH + { + HelpID = "xmlsecurity:RadioButton:RID_XMLSECTP_SECLEVEL:RB_VERYHIGH"; + Pos = MAP_APPFONT( SL_COL_1, SL_ROW_0 ); + Size = MAP_APPFONT( SL_COL_2-SL_COL_1, RSC_BIG_RADIOBUTTON ); + WordBreak = TRUE; + Text [ en-US ] = "~Very high.\nOnly macros from trusted file locations are allowed to run. All other macros, regardless whether signed or not, are disabled."; + }; + RadioButton RB_HIGH + { + HelpID = "xmlsecurity:RadioButton:RID_XMLSECTP_SECLEVEL:RB_HIGH"; + Pos = MAP_APPFONT( SL_COL_1, SL_ROW_1 ); + Size = MAP_APPFONT( SL_COL_2-SL_COL_1, RSC_BIG_RADIOBUTTON ); + WordBreak = TRUE; + Text [ en-US ] = "H~igh.\nOnly signed macros from trusted sources are allowed to run. Unsigned macros are disabled."; + }; + RadioButton RB_MEDIUM + { + HelpID = "xmlsecurity:RadioButton:RID_XMLSECTP_SECLEVEL:RB_MEDIUM"; + Pos = MAP_APPFONT( SL_COL_1, SL_ROW_2 ); + Size = MAP_APPFONT( SL_COL_2-SL_COL_1, RSC_BIG_RADIOBUTTON ); + WordBreak = TRUE; + Text [ en-US ] = "~Medium.\nConfirmation required before executing macros from untrusted sources."; + }; + RadioButton RB_LOW + { + HelpID = "xmlsecurity:RadioButton:RID_XMLSECTP_SECLEVEL:RB_LOW"; + Pos = MAP_APPFONT( SL_COL_1, SL_ROW_3 ); + Size = MAP_APPFONT( SL_COL_2-SL_COL_1, SL_ROW_4-SL_ROW_3 ); + WordBreak = TRUE; + Text [ en-US ] = "~Low (not recommended).\nAll macros will be executed without confirmation. Use this setting only if you are certain that all documents that will be opened are safe."; + }; +}; + +TabPage RID_XMLSECTP_TRUSTSOURCES +{ + HelpId = HID_XMLSEC_TP_TRUSTSOURCES; + Size = MAP_APPFONT( TP_WIDTH, TP_HEIGHT ); + OutputSize = TRUE; + Hide = TRUE; + SVLook = TRUE; + FixedLine FL_TRUSTCERT + { + Pos = MAP_APPFONT( TS_COL_0, TS_ROW_0 ); + Size = MAP_APPFONT( TS_COL_8-TS_COL_0, RSC_CD_FIXEDLINE_HEIGHT ); + Text [ en-US ] = "Trusted certificates"; + }; + FixedImage FI_TRUSTCERT_RO + { + Pos = MAP_APPFONT( TS_COL_1 - 7, TS_ROW_1 ); + Size = MAP_APPFONT( 6, 6 ); + }; + Control LB_TRUSTCERT + { + HelpId = HID_XMLSEC_CTRL_TRUSTSOURCES; + Pos = MAP_APPFONT( TS_COL_1, TS_ROW_1 ); + Size = MAP_APPFONT( TS_COL_7-TS_COL_1, RSC_CD_TABLISTBOX_HEIGHT ); + SVLook = TRUE; + Border = TRUE; + }; + String STR_HEADERBAR + { + Text [ en-US ] = "Issued to\tIssued by\tExpiration date"; + }; + PushButton PB_ADD_TRUSTCERT + { + HelpID = "xmlsecurity:PushButton:RID_XMLSECTP_TRUSTSOURCES:PB_ADD_TRUSTCERT"; + Pos = MAP_APPFONT( TS_COL_2, TS_ROW_2 ); + Size = MAP_APPFONT( RSC_CD_PUSHBUTTON_WIDTH, RSC_CD_PUSHBUTTON_HEIGHT ); + Text [ en-US ] = "Add..."; + }; + PushButton PB_VIEW_TRUSTCERT + { + HelpID = "xmlsecurity:PushButton:RID_XMLSECTP_TRUSTSOURCES:PB_VIEW_TRUSTCERT"; + Pos = MAP_APPFONT( TS_COL_4, TS_ROW_2 ); + Size = MAP_APPFONT( RSC_CD_PUSHBUTTON_WIDTH, RSC_CD_PUSHBUTTON_HEIGHT ); + Text [ en-US ] = "View..."; + }; + PushButton PB_REMOVE_TRUSTCERT + { + HelpID = "xmlsecurity:PushButton:RID_XMLSECTP_TRUSTSOURCES:PB_REMOVE_TRUSTCERT"; + Pos = MAP_APPFONT( TS_COL_6, TS_ROW_2 ); + Size = MAP_APPFONT( RSC_CD_PUSHBUTTON_WIDTH, RSC_CD_PUSHBUTTON_HEIGHT ); + Text [ en-US ] = "Remove"; + }; + FixedLine FL_TRUSTFILELOC + { + Pos = MAP_APPFONT( TS_COL_0, TS_ROW_3 ); + Size = MAP_APPFONT( TS_COL_8-TS_COL_0, RSC_CD_FIXEDLINE_HEIGHT ); + Text [ en-US ] = "Trusted file locations"; + }; + FixedText FI_TRUSTFILELOC + { + Pos = MAP_APPFONT( TS_COL_1, TS_ROW_4 ); + Size = MAP_APPFONT( TS_COL_7-TS_COL_1, 3*RSC_CD_FIXEDLINE_HEIGHT ); + WordBreak = TRUE; + Text [ en-US ] = "Document macros are always executed if they have been opened from one of the following locations."; + }; + FixedImage FI_TRUSTFILE_RO + { + Pos = MAP_APPFONT( TS_COL_1 - 7, TS_ROW_5 ); + Size = MAP_APPFONT( 6, 6 ); + }; + ListBox LB_TRUSTFILELOC + { + HelpID = "xmlsecurity:ListBox:RID_XMLSECTP_TRUSTSOURCES:LB_TRUSTFILELOC"; + Pos = MAP_APPFONT( TS_COL_1, TS_ROW_5 ); + Size = MAP_APPFONT( TS_COL_7-TS_COL_1, TS_ROW_6-TS_ROW_5 ); + SVLook = TRUE; + Border = TRUE; + VScroll = TRUE; + Sort = TRUE; + }; + PushButton FL_ADD_TRUSTFILELOC + { + HelpID = "xmlsecurity:PushButton:RID_XMLSECTP_TRUSTSOURCES:FL_ADD_TRUSTFILELOC"; + Pos = MAP_APPFONT( TS_COL_4, TS_ROW_7 ); + Size = MAP_APPFONT( RSC_CD_PUSHBUTTON_WIDTH, RSC_CD_PUSHBUTTON_HEIGHT ); + Text [ en-US ] = "Add..."; + }; + PushButton FL_REMOVE_TRUSTFILELOC + { + HelpID = "xmlsecurity:PushButton:RID_XMLSECTP_TRUSTSOURCES:FL_REMOVE_TRUSTFILELOC"; + Pos = MAP_APPFONT( TS_COL_6, TS_ROW_7 ); + Size = MAP_APPFONT( RSC_CD_PUSHBUTTON_WIDTH, RSC_CD_PUSHBUTTON_HEIGHT ); + Text [ en-US ] = "Remove"; + }; +}; +String RID_XMLSECTP_READONLY_CONFIG_TIP +{ + Text [ en-US ] = "This setting is protected by the Administrator"; +}; +Image RID_XMLSECTP_LOCK +{ + ImageBitmap = Bitmap + { + File = "lock.bmp"; + }; + MaskColor = Color { Red=0xffff; Green=0x0000; Blue=0xffff; }; +}; +Image RID_XMLSECTP_LOCK_HC +{ + ImageBitmap = Bitmap + { + File = "lock_hc.bmp"; + }; + MaskColor = Color { Red=0xffff; Green=0x0000; Blue=0xffff; }; +}; + diff --git a/xmlsecurity/source/dialogs/makefile.mk b/xmlsecurity/source/dialogs/makefile.mk new file mode 100644 index 000000000000..4cead130d887 --- /dev/null +++ b/xmlsecurity/source/dialogs/makefile.mk @@ -0,0 +1,64 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2000, 2010 Oracle and/or its affiliates. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# This file is part of OpenOffice.org. +# +# OpenOffice.org is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License version 3 +# only, as published by the Free Software Foundation. +# +# OpenOffice.org is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License version 3 for more details +# (a copy is included in the LICENSE file that accompanied this code). +# +# You should have received a copy of the GNU Lesser General Public License +# version 3 along with OpenOffice.org. If not, see +# <http://www.openoffice.org/license.html> +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +PRJ=..$/.. + +PRJNAME=xmlsecurity +TARGET=dialogs +TARGETTYPE=GUI + + +ENABLE_EXCEPTIONS=TRUE + +# --- Settings ----------------------------------------------------- + +.INCLUDE : settings.mk +.INCLUDE : $(PRJ)$/util$/target.pmk + + +# --- Files -------------------------------------------------------- + +BMP_IN=$(PRJ)$/res + +SRS1NAME=dialogs +SRC1FILES = \ + digitalsignaturesdialog.src \ + certificatechooser.src \ + certificateviewer.src \ + macrosecurity.src + +SLOFILES= \ + $(SLO)$/digitalsignaturesdialog.obj \ + $(SLO)$/certificatechooser.obj \ + $(SLO)$/certificateviewer.obj \ + $(SLO)$/macrosecurity.obj \ + $(SLO)$/resourcemanager.obj + + +# --- Targets ------------------------------------------------------ + +.INCLUDE : target.mk diff --git a/xmlsecurity/source/dialogs/resourcemanager.cxx b/xmlsecurity/source/dialogs/resourcemanager.cxx new file mode 100644 index 000000000000..25de43ac4566 --- /dev/null +++ b/xmlsecurity/source/dialogs/resourcemanager.cxx @@ -0,0 +1,431 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_xmlsecurity.hxx" + +#include "resourcemanager.hxx" + +#include <vcl/svapp.hxx> +#include <vcl/fixed.hxx> +#include <svtools/stdctrl.hxx> +#include <svl/solar.hrc> +#include <unotools/syslocale.hxx> +#include <rtl/ustring.h> +#include <rtl/ustrbuf.h> +#include <vector> + +using ::rtl::OUString; +using namespace std; + +namespace XmlSec +{ + static ResMgr* pResMgr = 0; + static SvtSysLocale* pSysLocale = 0; + + ResMgr* GetResMgr( void ) + { + if( !pResMgr ) + { + ByteString aName( "xmlsec" ); +// pResMgr = ResMgr::CreateResMgr( aName.GetBuffer(), Application::GetSettings().GetUILanguage() ); +// LanguageType aLang( LANGUAGE_ENGLISH_US ); +// pResMgr = ResMgr::CreateResMgr( aName.GetBuffer(), aLang ); +// MT: Change to Locale + pResMgr = ResMgr::CreateResMgr( aName.GetBuffer() ); + } + + return pResMgr; + } + + const LocaleDataWrapper& GetLocaleData( void ) + { + if (!pSysLocale) + pSysLocale = new SvtSysLocale; + return pSysLocale->GetLocaleData(); + } + + DateTime GetDateTime( const ::com::sun::star::util::DateTime& _rDT ) + { + return DateTime( + Date( _rDT.Day, _rDT.Month, _rDT.Year ), + Time( _rDT.Hours, _rDT.Minutes, _rDT.Seconds, _rDT.HundredthSeconds ) ); + } + + String GetDateTimeString( const ::com::sun::star::util::DateTime& _rDT ) + { + // --> PB 2004-10-12 #i20172# String with date and time information + DateTime aDT( GetDateTime( _rDT ) ); + const LocaleDataWrapper& rLoDa = GetLocaleData(); + String sRet( rLoDa.getDate( aDT ) ); + sRet += ' '; + sRet += rLoDa.getTime( aDT ); + return sRet; + } + + String GetDateTimeString( const rtl::OUString& _rDate, const rtl::OUString& _rTime ) + { + String sDay( _rDate, 6, 2 ); + String sMonth( _rDate, 4, 2 ); + String sYear( _rDate, 0, 4 ); + + String sHour( _rTime, 0, 2 ); + String sMin( _rTime, 4, 2 ); + String sSec( _rTime, 6, 2 ); + + + Date aDate( (sal_uInt16)sDay.ToInt32(), (sal_uInt16) sMonth.ToInt32(), (sal_uInt16)sYear.ToInt32() ); + Time aTime( sHour.ToInt32(), sMin.ToInt32(), sSec.ToInt32(), 0 ); + const LocaleDataWrapper& rLoDa = GetLocaleData(); + String aStr( rLoDa.getDate( aDate ) ); + aStr.AppendAscii( " " ); + aStr += rLoDa.getTime( aTime ); + return aStr; + } + + String GetDateString( const ::com::sun::star::util::DateTime& _rDT ) + { + return GetLocaleData().getDate( GetDateTime( _rDT ) ); + } + + /* + Creates two strings based on the distinguished name which are displayed in the + certificate details view. The first string contains only the values of the attribute + and valudes pairs, which are separated by commas. All escape characters ('"') are + removed. + The second string is for the details view at the bottom. It shows the attribute/value + pairs on different lines. All escape characters ('"') are removed. + */ + pair< OUString, OUString> GetDNForCertDetailsView( const OUString & rRawString) + { + vector< pair< OUString, OUString > > vecAttrValueOfDN = parseDN(rRawString); + ::rtl::OUStringBuffer s1, s2; + OUString sEqual(RTL_CONSTASCII_USTRINGPARAM(" = ")); + typedef vector< pair < OUString, OUString > >::const_iterator CIT; + for (CIT i = vecAttrValueOfDN.begin(); i < vecAttrValueOfDN.end(); i ++) + { + if (i != vecAttrValueOfDN.begin()) + { + s1.append(static_cast<sal_Unicode>(',')); + s2.append(static_cast<sal_Unicode>('\n')); + } + s1.append(i->second); + s2.append(i->first); + s2.append(sEqual); + s2.append(i->second); + } + return make_pair(s1.makeStringAndClear(), s2.makeStringAndClear()); + } + +/* + Whenever the attribute value contains special characters, such as '"' or ',' (without '') + then the value will be enclosed in double quotes by the respective Windows or NSS function + which we use to retrieve, for example, the subject name. If double quotes appear in the value then + they are escaped with a double quote. This function removes the escape characters. +*/ +#ifdef WNT +vector< pair< OUString, OUString> > parseDN(const OUString& rRawString) +{ + vector< pair<OUString, OUString> > retVal; + bool bInEscape = false; + bool bInValue = false; + bool bInType = true; + sal_Int32 nTypeNameStart = 0; + OUString sType; + ::rtl::OUStringBuffer sbufValue; + sal_Int32 length = rRawString.getLength(); + + for (sal_Int32 i = 0; i < length; i++) + { + sal_Unicode c = rRawString[i]; + + if (c == '=') + { + if (! bInValue) + { + sType = rRawString.copy(nTypeNameStart, i - nTypeNameStart); + sType = sType.trim(); + bInType = false; + } + else + { + sbufValue.append(c); + } + } + else if (c == '"') + { + if (!bInEscape) + { + //If this is the quote is the first of the couple which enclose the + //whole value, because the value contains special characters + //then we just drop it. That is, this character must be followed by + //a character which is not '"'. + if ( i + 1 < length && rRawString[i+1] == '"') + bInEscape = true; + else + bInValue = !bInValue; //value is enclosed in " " + } + else + { + //This quote is escaped by a preceding quote and therefore is + //part of the value + sbufValue.append(c); + bInEscape = false; + } + } + else if (c == ',' || c == '+') + { + //The comma separate the attribute value pairs. + //If the comma is not part of a value (the value would then be enclosed in '"'), + //then we have reached the end of the value + if (!bInValue) + { + OSL_ASSERT(sType.getLength()); + retVal.push_back(make_pair(sType, sbufValue.makeStringAndClear())); + sType = OUString(); + //The next char is the start of the new type + nTypeNameStart = i + 1; + bInType = true; + } + else + { + //The whole string is enclosed because it contains special characters. + //The enclosing '"' are not part of certificate but will be added by + //the function (Windows or NSS) which retrieves DN + sbufValue.append(c); + } + } + else + { + if (!bInType) + sbufValue.append(c); + } + } + if (sbufValue.getLength()) + { + OSL_ASSERT(sType.getLength()); + retVal.push_back(make_pair(sType, sbufValue.makeStringAndClear())); + } + return retVal; + } +#else +vector< pair< OUString, OUString> > parseDN(const OUString& rRawString) + { + vector< pair<OUString, OUString> > retVal; + //bInEscape == true means that the preceding character is an escape character + bool bInEscape = false; + bool bInValue = false; + bool bInType = true; + sal_Int32 nTypeNameStart = 0; + OUString sType; + ::rtl::OUStringBuffer sbufValue; + sal_Int32 length = rRawString.getLength(); + + for (sal_Int32 i = 0; i < length; i++) + { + sal_Unicode c = rRawString[i]; + + if (c == '=') + { + if (! bInValue) + { + sType = rRawString.copy(nTypeNameStart, i - nTypeNameStart); + sType = sType.trim(); + bInType = false; + } + else + { + sbufValue.append(c); + } + } + else if (c == '\\') + { + if (!bInEscape) + { + bInEscape = true; + } + else + { // bInEscape is true + sbufValue.append(c); + bInEscape = false; + } + } + else if (c == '"') + { + //an unescaped '"' is either at the beginning or end of the value + if (!bInEscape) + { + if ( !bInValue) + bInValue = true; + else if (bInValue) + bInValue = false; + } + else + { + //This quote is escaped by a preceding quote and therefore is + //part of the value + sbufValue.append(c); + bInEscape = false; + } + } + else if (c == ',' || c == '+') + { + //The comma separate the attribute value pairs. + //If the comma is not part of a value (the value would then be enclosed in '"'), + //then we have reached the end of the value + if (!bInValue) + { + OSL_ASSERT(sType.getLength()); + retVal.push_back(make_pair(sType, sbufValue.makeStringAndClear())); + sType = OUString(); + //The next char is the start of the new type + nTypeNameStart = i + 1; + bInType = true; + } + else + { + //The whole string is enclosed because it contains special characters. + //The enclosing '"' are not part of certificate but will be added by + //the function (Windows or NSS) which retrieves DN + sbufValue.append(c); + } + } + else + { + if (!bInType) + { + sbufValue.append(c); + bInEscape = false; + } + } + } + if (sbufValue.getLength()) + { + OSL_ASSERT(sType.getLength()); + retVal.push_back(make_pair(sType, sbufValue.makeStringAndClear())); + } + return retVal; + } + +#endif + + String GetContentPart( const String& _rRawString ) + { + char const * aIDs[] = { "CN", "OU", "O", "E", NULL }; + OUString retVal; + int i = 0; + vector< pair< OUString, OUString > > vecAttrValueOfDN = parseDN(_rRawString); + while ( aIDs[i] ) + { + OUString sPartId = OUString::createFromAscii( aIDs[i++] ); + typedef vector< pair < OUString, OUString > >::const_iterator CIT; + for (CIT idn = vecAttrValueOfDN.begin(); idn != vecAttrValueOfDN.end(); idn++) + { + if (idn->first.equals(sPartId)) + { + retVal = idn->second; + break; + } + } + if (retVal.getLength()) + break; + } + return retVal; + } + + String GetHexString( const ::com::sun::star::uno::Sequence< sal_Int8 >& _rSeq, const char* _pSep, sal_uInt16 _nLineBreak ) + { + const sal_Int8* pSerNumSeq = _rSeq.getConstArray(); + int nCnt = _rSeq.getLength(); + String aStr; + const char pHexDigs[ 17 ] = "0123456789ABCDEF"; + char pBuffer[ 3 ] = " "; + sal_uInt8 nNum; + sal_uInt16 nBreakStart = _nLineBreak? _nLineBreak : 1; + sal_uInt16 nBreak = nBreakStart; + for( int i = 0 ; i < nCnt ; ++i ) + { + nNum = sal_uInt8( pSerNumSeq[ i ] ); + + //MM : exchange the buffer[0] and buffer[1], which make it consistent with Mozilla and Windows + pBuffer[ 1 ] = pHexDigs[ nNum & 0x0F ]; + nNum >>= 4; + pBuffer[ 0 ] = pHexDigs[ nNum ]; + aStr.AppendAscii( pBuffer ); + + --nBreak; + if( nBreak ) + aStr.AppendAscii( _pSep ); + else + { + nBreak = nBreakStart; + aStr.AppendAscii( "\n" ); + } + } + + return aStr; + } + + long ShrinkToFitWidth( Control& _rCtrl, long _nOffs ) + { + long nWidth = _rCtrl.GetTextWidth( _rCtrl.GetText() ); + Size aSize( _rCtrl.GetSizePixel() ); + nWidth += _nOffs; + aSize.Width() = nWidth; + _rCtrl.SetSizePixel( aSize ); + return nWidth; + } + + void AlignAfterImage( const FixedImage& _rImage, Control& _rCtrl, long _nXOffset ) + { + Point aPos( _rImage.GetPosPixel() ); + Size aSize( _rImage.GetSizePixel() ); + long n = aPos.X(); + n += aSize.Width(); + n += _nXOffset; + aPos.X() = n; + n = aPos.Y(); + n += aSize.Height() / 2; // y-position is in the middle of the image + n -= _rCtrl.GetSizePixel().Height() / 2; // center Control + aPos.Y() = n; + _rCtrl.SetPosPixel( aPos ); + } + + void AlignAfterImage( const FixedImage& _rImage, FixedInfo& _rFI, long _nXOffset ) + { + AlignAfterImage( _rImage, static_cast< Control& >( _rFI ), _nXOffset ); + ShrinkToFitWidth( _rFI ); + } + + void AlignAndFitImageAndControl( FixedImage& _rImage, FixedInfo& _rFI, long _nXOffset ) + { + _rImage.SetSizePixel( _rImage.GetImage().GetSizePixel() ); + AlignAfterImage( _rImage, _rFI, _nXOffset ); + } +} + + diff --git a/xmlsecurity/source/dialogs/resourcemanager.hxx b/xmlsecurity/source/dialogs/resourcemanager.hxx new file mode 100644 index 000000000000..0a0615871af3 --- /dev/null +++ b/xmlsecurity/source/dialogs/resourcemanager.hxx @@ -0,0 +1,69 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _RESOURCEMANAGER_HXX +#define _RESOURCEMANAGER_HXX + +#include <tools/resmgr.hxx> +#include <tools/datetime.hxx> +#include <com/sun/star/util/DateTime.hpp> +#include <com/sun/star/uno/Sequence.hxx> + +#include <vector> + +class FixedImage; +class FixedInfo; +class Control; +class LocaleDataWrapper; + +namespace XmlSec +{ + ResMgr* GetResMgr( void ); + + const LocaleDataWrapper& GetLocaleData( void ); + DateTime GetDateTime( const ::com::sun::star::util::DateTime& _rDT ); + String GetDateTimeString( const ::com::sun::star::util::DateTime& _rDT ); + String GetDateTimeString( const rtl::OUString& _rDate, const rtl::OUString& _rTime ); + String GetDateString( const ::com::sun::star::util::DateTime& _rDT ); + + std::vector< std::pair< ::rtl::OUString, ::rtl::OUString> > + parseDN(const ::rtl::OUString& rRawString); + std::pair< ::rtl::OUString, ::rtl::OUString> GetDNForCertDetailsView( + const ::rtl::OUString & rRawString); + String GetContentPart( const String& _rRawString ); + + String GetHexString( const ::com::sun::star::uno::Sequence< sal_Int8 >& _rSeq, const char* _pSep = ":", sal_uInt16 _nLineBreak = 0xFFFF ); + + long ShrinkToFitWidth( Control& _rCtrl, long _nOffs = 0 ); // return = new width + void AlignAfterImage( const FixedImage& _rImage, Control& _rCtrl, long _nXOffset = 0 ); + void AlignAfterImage( const FixedImage& _rImage, FixedInfo& _rFI, long _nXOffset = 0 ); + void AlignAndFitImageAndControl( FixedImage& _rImage, FixedInfo& _rFI, long _nXOffset = 0 ); +} + +#define XMLSEC_RES(id) ResId(id,*XmlSec::GetResMgr()) + +#endif diff --git a/xmlsecurity/source/dialogs/stbcontrl.cxx b/xmlsecurity/source/dialogs/stbcontrl.cxx new file mode 100644 index 000000000000..44395ed5d328 --- /dev/null +++ b/xmlsecurity/source/dialogs/stbcontrl.cxx @@ -0,0 +1,188 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_xmlsecurity.hxx" + +// include --------------------------------------------------------------- +#include <tools/shl.hxx> +#ifndef _STATUS_HXX //autogen +#include <vcl/status.hxx> +#endif +#ifndef _MENU_HXX //autogen +#include <vcl/menu.hxx> +#endif +#include <vcl/image.hxx> +//#ifndef _SFXITEMPOOL_HXX +//#include <svl/itempool.hxx> +//#endif +#include <sfx2/app.hxx> +#include <sfx2/module.hxx> +#include <sfx2/dispatch.hxx> +#include <sfx2/objsh.hxx> + +#include <svl/eitem.hxx> + + +#include <xmlsecurity/stbcontrl.hxx> + +#define PAINT_OFFSET 5 + +//#include "sizeitem.hxx" +//#include "dialmgr.hxx" +//#include "dlgutil.hxx" +//#include "stbctrls.h" + +//#include "dialogs.hrc" + +/*#ifndef _UNOTOOLS_LOCALEDATAWRAPPER_HXX +#include <unotools/localedatawrapper.hxx> +#endif +#ifndef _UNOTOOLS_PROCESSFACTORY_HXX +#include <comphelper/processfactory.hxx> +#endif*/ + + + +SFX_IMPL_STATUSBAR_CONTROL( XmlSecStatusBarControl, SfxBoolItem ); + +/* +class FunctionPopup_Impl : public PopupMenu +{ +public: + FunctionPopup_Impl( sal_uInt16 nCheck ); + + sal_uInt16 GetSelected() const { return nSelected; } + +private: + sal_uInt16 nSelected; + + virtual void Select(); +}; + +// ----------------------------------------------------------------------- + +FunctionPopup_Impl::FunctionPopup_Impl( sal_uInt16 nCheck ) : + PopupMenu( ResId( RID_SVXMNU_PSZ_FUNC, DIALOG_MGR() ) ), + nSelected( 0 ) +{ + if (nCheck) + CheckItem( nCheck ); +} + +// ----------------------------------------------------------------------- + +void FunctionPopup_Impl::Select() +{ + nSelected = GetCurItemId(); +} +*/ + + + +struct XmlSecStatusBarControl::XmlSecStatusBarControl_Impl +{ + Point maPos; + Size maSize; + bool mbSigned; + Image maImage; +}; + + +XmlSecStatusBarControl::XmlSecStatusBarControl( sal_uInt16 _nId, StatusBar& _rStb, SfxBindings& _rBind ) + :SfxStatusBarControl( _nId, _rStb, _rBind ) + + ,mpImpl( new XmlSecStatusBarControl_Impl ) +{ + mpImpl->mbSigned = false; +// pImp->maImage = Image( ResId( RID_SVXBMP_POSITION, DIALOG_MGR() ) ); +} + +XmlSecStatusBarControl::~XmlSecStatusBarControl() +{ + delete mpImpl; +} + +void XmlSecStatusBarControl::StateChanged( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState ) +{ + GetStatusBar().SetHelpText( GetId(), String() ); // necessary ? + GetStatusBar().SetHelpId( GetId(), nSID ); // necessary ? + + if( SFX_ITEM_AVAILABLE != eState ) + { + mpImpl->mbSigned = false; + } + else if( pState->ISA( SfxBoolItem ) ) + { + mpImpl->mbSigned = ( ( SfxBoolItem* ) pState )->GetValue(); + } + else + { + DBG_ERRORFILE( "+XmlSecStatusBarControl::StateChanged(): invalid item type" ); + mpImpl->mbSigned = false; + } + + if( GetStatusBar().AreItemsVisible() ) // necessary ? + GetStatusBar().SetItemData( GetId(), 0 ); + + GetStatusBar().SetItemText( GetId(), String() ); // necessary ? +} + +void XmlSecStatusBarControl::Command( const CommandEvent& rCEvt ) +{ + // can / has to be done when integrated in Office! +// if( rCEvt.GetCommand() == .... ) + if( false ) + { +// GetBindings().GetDispatcher()->Execute( SID_PSZ_FUNCTION, SFX_CALLMODE_RECORD, &aItem, 0L ); + } + else + SfxStatusBarControl::Command( rCEvt ); +} + +void XmlSecStatusBarControl::Paint( const UserDrawEvent& rUsrEvt ) +{ + OutputDevice* pDev = rUsrEvt.GetDevice(); + DBG_ASSERT( pDev, "-XmlSecStatusBarControl::Paint(): no Output Device... this will lead to nirvana..." ); + const Rectangle& rRect = rUsrEvt.GetRect(); + StatusBar& rBar = GetStatusBar(); + Point aItemPos = rBar.GetItemTextPos( GetId() ); + Color aOldLineColor = pDev->GetLineColor(); + Color aOldFillColor = pDev->GetFillColor(); + + // just 4 testing until we've got a bitmap + pDev->SetLineColor(); + pDev->SetFillColor( pDev->GetBackground().GetColor() ); + + String s( String::CreateFromAscii( mpImpl->mbSigned? "X" : "-" ) ); + pDev->DrawRect( rRect ); + pDev->DrawText( Point( rRect.Left() + rRect.GetWidth() / 2 - pDev->GetTextWidth( s ) / 2, aItemPos.Y() ), s ); + + pDev->SetLineColor( aOldLineColor ); + pDev->SetFillColor( aOldFillColor ); +} + diff --git a/xmlsecurity/source/dialogs/warnings.cxx b/xmlsecurity/source/dialogs/warnings.cxx new file mode 100644 index 000000000000..b92266f427d7 --- /dev/null +++ b/xmlsecurity/source/dialogs/warnings.cxx @@ -0,0 +1,145 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_xmlsecurity.hxx" + +#include <xmlsecurity/warnings.hxx> +#include <xmlsecurity/certificateviewer.hxx> +#include <com/sun/star/xml/crypto/XSecurityEnvironment.hpp> +#include <comphelper/sequence.hxx> + +// MM : added for password exception +#include <vcl/msgbox.hxx> +#include <com/sun/star/security/NoPasswordException.hpp> +using namespace ::com::sun::star::security; + + +#include "dialogs.hrc" +#include "resourcemanager.hxx" + +/* HACK: disable some warnings for MS-C */ +#ifdef _MSC_VER +#pragma warning (disable : 4355) // 4355: this used in initializer-list +#endif + +using namespace ::com::sun::star; +using namespace ::com::sun::star; + + +MacroWarning::MacroWarning( Window* _pParent, uno::Reference< dcss::xml::crypto::XSecurityEnvironment >& _rxSecurityEnvironment, cssu::Reference< dcss::security::XCertificate >& _rxCert ) + :ModalDialog ( _pParent, XMLSEC_RES( RID_XMLSECTP_MACROWARN ) ) + ,maDocNameFI ( this, ResId( FI_DOCNAME ) ) + ,maDescr1aFI ( this, ResId( FI_DESCR1A ) ) + ,maDescr1bFI ( this, ResId( FI_DESCR1B ) ) + ,maSignsFI ( this, ResId( FI_SIGNS ) ) + ,maViewSignsBtn ( this, ResId( PB_VIEWSIGNS ) ) + ,maDescr2FI ( this, ResId( FI_DESCR2 ) ) + ,maAlwaysTrustCB ( this, ResId( CB_ALWAYSTRUST ) ) + ,maBottomSepFL ( this, ResId( FL_BOTTOM_SEP ) ) + ,maEnableBtn ( this, ResId( PB_DISABLE ) ) + ,maDisableBtn ( this, ResId( PB_DISABLE ) ) + ,maHelpBtn ( this, ResId( BTN_HELP ) ) + ,mbSignedMode ( true ) +{ + FreeResource(); + + mxSecurityEnvironment = _rxSecurityEnvironment; + mxCert = _rxCert; + + // hide unused parts + maDescr1bFI.Hide(); + + maViewSignsBtn.SetClickHdl( LINK( this, MacroWarning, ViewSignsBtnHdl ) ); + maEnableBtn.SetClickHdl( LINK( this, MacroWarning, EnableBtnHdl ) ); +// maDisableBtn.SetClickHdl( LINK( this, MacroWarning, DisableBtnHdl ) ); + + if( mxCert.is() ) + maSignsFI.SetText( XmlSec::GetContentPart( mxCert->getSubjectName() ) ); + else + // nothing to view! + maViewSignsBtn.Disable(); +} + +MacroWarning::MacroWarning( Window* _pParent ) + :ModalDialog ( _pParent, XMLSEC_RES( RID_XMLSECTP_MACROWARN ) ) + ,maDocNameFI ( this, ResId( FI_DOCNAME ) ) + ,maDescr1aFI ( this, ResId( FI_DESCR1A ) ) + ,maDescr1bFI ( this, ResId( FI_DESCR1B ) ) + ,maSignsFI ( this, ResId( FI_SIGNS ) ) + ,maViewSignsBtn ( this, ResId( PB_VIEWSIGNS ) ) + ,maDescr2FI ( this, ResId( FI_DESCR2 ) ) + ,maAlwaysTrustCB ( this, ResId( CB_ALWAYSTRUST ) ) + ,maBottomSepFL ( this, ResId( FL_BOTTOM_SEP ) ) + ,maEnableBtn ( this, ResId( PB_DISABLE ) ) + ,maDisableBtn ( this, ResId( PB_DISABLE ) ) + ,maHelpBtn ( this, ResId( BTN_HELP ) ) + ,mbSignedMode ( false ) +{ + FreeResource(); + + // hide unused parts + maDescr1aFI.Hide(); + maSignsFI.Hide(); + maViewSignsBtn.Hide(); + maAlwaysTrustCB.Hide(); + maDescr2FI.Hide(); + + // move hint up to position of signer list + maDescr1bFI.SetPosPixel( maSignsFI.GetPosPixel() ); +} + +MacroWarning::~MacroWarning() +{ +} + +IMPL_LINK( MacroWarning, ViewSignsBtnHdl, void*, EMPTYARG ) +{ + DBG_ASSERT( mxCert.is(), "*MacroWarning::ViewSignsBtnHdl(): no certificate set!" ); + + CertificateViewer aViewer( this, mxSecurityEnvironment, mxCert ); + aViewer.Execute(); + + return 0; +} + +IMPL_LINK( MacroWarning, EnableBtnHdl, void*, EMPTYARG ) +{ + if( mbSignedMode && maAlwaysTrustCB.IsChecked() ) + { // insert path into trusted path list + + } + + EndDialog( RET_OK ); + return 0; +} + +/*IMPL_LINK( MacroWarning, DisableBtnHdl, void*, EMPTYARG ) +{ + return 0; +}*/ + diff --git a/xmlsecurity/source/dialogs/warnings.src b/xmlsecurity/source/dialogs/warnings.src new file mode 100644 index 000000000000..bac25c3dd492 --- /dev/null +++ b/xmlsecurity/source/dialogs/warnings.src @@ -0,0 +1,115 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "dialogs.hrc" +#include "helpids.hrc" + +ModalDialog RID_XMLSECTP_MACROWARN +{ + HelpId = HID_XMLSEC_TP_MACROWARN; + Size = MAP_APPFONT( MW_WIDTH, MW_HEIGHT ); + OutputSize = TRUE; + Closeable = TRUE; + Moveable = TRUE; + SVLook = TRUE; + + Text [ en-US ] = "Security Warning"; + + FixedText FI_DOCNAME + { + Pos = MAP_APPFONT( MW_COL_1, MW_ROW_0 ); + Size = MAP_APPFONT( MW_COL_4-MW_COL_1, 3*RSC_CD_FIXEDTEXT_HEIGHT ); + Wordbreak = TRUE; + Text [ en-US ] = ""; + }; + FixedText FI_DESCR1A + { + Pos = MAP_APPFONT( MW_COL_1, MW_ROW_1 ); + Size = MAP_APPFONT( MW_COL_4-MW_COL_1, RSC_CD_FIXEDTEXT_HEIGHT ); + Wordbreak = TRUE; + Text [ en-US ] = "The document contains document macros signed by:"; + }; + FixedText FI_DESCR1B + { + Pos = MAP_APPFONT( MW_COL_1, MW_ROW_1 ); + Size = MAP_APPFONT( MW_COL_4-MW_COL_1, RSC_CD_FIXEDTEXT_HEIGHT ); + Wordbreak = TRUE; + Text [ en-US ] = "The document contains document macros."; + }; + FixedText FI_SIGNS + { + Pos = MAP_APPFONT( MW_COL_1, MW_ROW_2 ); + Size = MAP_APPFONT( MW_COL_4-MW_COL_2, MW_ROW_3-MW_ROW_2 ); + Wordbreak = TRUE; + Text [ en-US ] = ""; + }; + PushButton PB_VIEWSIGNS + { + HelpID = "xmlsecurity:PushButton:RID_XMLSECTP_MACROWARN:PB_VIEWSIGNS"; + Pos = MAP_APPFONT( MW_COL_3, MW_ROW_2 ); + Size = MAP_APPFONT( RSC_CD_PUSHBUTTON_WIDTH, RSC_CD_PUSHBUTTON_HEIGHT ); + Text [ en-US ] = "View Signatures..."; + }; + FixedText FI_DESCR2 + { + Pos = MAP_APPFONT( MW_COL_1, MW_ROW_3 ); + Size = MAP_APPFONT( MW_COL_4-MW_COL_1, RSC_CD_FIXEDTEXT_HEIGHT ); + Wordbreak = TRUE; + Text [ en-US ] = "Macros may contain viruses. Disabling macros for a document is always save. If you disable macros you may lose functionality provided by the document macros."; + }; + CheckBox CB_ALWAYSTRUST + { + HelpID = "xmlsecurity:CheckBox:RID_XMLSECTP_MACROWARN:CB_ALWAYSTRUST"; + Pos = MAP_APPFONT( MW_COL_1, MW_ROW_4 ); + Size = MAP_APPFONT( MW_COL_4-MW_COL_1, RSC_CD_CHECKBOX_HEIGHT ); + Text [ en-US ] = "Always trust macros from this source"; + }; + FixedLine FL_BOTTOM_SEP + { + Pos = MAP_APPFONT( 0, DLGS_BOTTOM_FL_Y( MW_HEIGHT ) ); + Size = MAP_APPFONT( MW_WIDTH, RSC_CD_FIXEDLINE_HEIGHT ); + }; + PushButton PB_ENABLE + { + HelpID = "xmlsecurity:PushButton:RID_XMLSECTP_MACROWARN:PB_ENABLE"; + Pos = MAP_APPFONT( DLGS_BOTTOM_OK_X( MW_WIDTH ), DLGS_BOTTOM_BTN_Y( MW_HEIGHT ) ); + Size = MAP_APPFONT( RSC_CD_PUSHBUTTON_WIDTH, RSC_CD_PUSHBUTTON_HEIGHT ); + Text [ en-US ] = "Enable Macros"; + }; + CancelButton PB_DISABLE + { + Pos = MAP_APPFONT( DLGS_BOTTOM_CANCEL_X( MW_WIDTH ), DLGS_BOTTOM_BTN_Y( MW_HEIGHT ) ); + Size = MAP_APPFONT( RSC_CD_PUSHBUTTON_WIDTH, RSC_CD_PUSHBUTTON_HEIGHT ); + Text [ en-US ] = "Disable Macros"; + }; + HelpButton BTN_HELP + { + Pos = MAP_APPFONT( DLGS_BOTTOM_HELP_X( MW_WIDTH ), DLGS_BOTTOM_BTN_Y( MW_HEIGHT ) ); + Size = MAP_APPFONT( RSC_CD_PUSHBUTTON_WIDTH, RSC_CD_PUSHBUTTON_HEIGHT ); + }; +}; + diff --git a/xmlsecurity/source/framework/buffernode.cxx b/xmlsecurity/source/framework/buffernode.cxx new file mode 100644 index 000000000000..5e06d3fbc3b6 --- /dev/null +++ b/xmlsecurity/source/framework/buffernode.cxx @@ -0,0 +1,1279 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_xmlsecurity.hxx" + +#include "elementmark.hxx" +#include "elementcollector.hxx" +#include "buffernode.hxx" +#include <com/sun/star/xml/crypto/sax/ConstOfSecurityId.hpp> + +namespace cssu = com::sun::star::uno; +namespace cssxw = com::sun::star::xml::wrapper; +namespace cssxc = com::sun::star::xml::crypto; + +BufferNode::BufferNode( const cssu::Reference< cssxw::XXMLElementWrapper >& xXMLElement ) + :m_pParent(NULL), + m_pBlocker(NULL), + m_bAllReceived(false), + m_xXMLElement(xXMLElement) +{ +} + +bool BufferNode::isECOfBeforeModifyIncluded(sal_Int32 nIgnoredSecurityId) const +/****** BufferNode/isECOfBeforeModifyIncluded ******************************** + * + * NAME + * isECOfBeforeModifyIncluded -- checks whether there is some + * ElementCollector on this BufferNode, that has BEFORE-MODIFY priority. + * + * SYNOPSIS + * bExist = isECOfBeforeModifyIncluded(nIgnoredSecurityId); + * + * FUNCTION + * checks each ElementCollector on this BufferNode, if all following + * conditions are satisfied, then returns true: + * 1. the ElementCollector's priority is BEFOREMODIFY; + * 2. the ElementCollector's securityId can't be ignored. + * otherwise, returns false. + * + * INPUTS + * nIgnoredSecurityId - the security Id to be ignored. If it equals + * to UNDEFINEDSECURITYID, then no security Id + * will be ignored. + * + * RESULT + * bExist - true if a match found, false otherwise + * + * HISTORY + * 05.01.2004 - implemented + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ + bool rc = false; + std::vector< const ElementCollector* >::const_iterator ii = m_vElementCollectors.begin(); + + for( ; ii != m_vElementCollectors.end() ; ++ii ) + { + ElementCollector* pElementCollector = (ElementCollector*)*ii; + + if ((nIgnoredSecurityId == cssxc::sax::ConstOfSecurityId::UNDEFINEDSECURITYID || + pElementCollector->getSecurityId() != nIgnoredSecurityId) && + (pElementCollector->getPriority() == cssxc::sax::ElementMarkPriority_BEFOREMODIFY)) + { + rc = true; + break; + } + } + + return rc; +} + +void BufferNode::setReceivedAll() +/****** BufferNode/setReceiveAll ********************************************* + * + * NAME + * setReceivedAll -- indicates that the element in this BufferNode has + * been compeletely bufferred. + * + * SYNOPSIS + * setReceivedAll(); + * + * FUNCTION + * sets the all-received flag and launches ElementCollector's notify + * process. + * + * INPUTS + * empty + * + * RESULT + * empty + * + * HISTORY + * 05.01.2004 - implemented + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ + m_bAllReceived = true; + elementCollectorNotify(); +} + +bool BufferNode::isAllReceived() const +{ + return m_bAllReceived; +} + +void BufferNode::addElementCollector(const ElementCollector* pElementCollector) +/****** BufferNode/addElementCollector *************************************** + * + * NAME + * addElementCollector -- adds a new ElementCollector to this BufferNode. + * + * SYNOPSIS + * addElementCollector(pElementCollector); + * + * FUNCTION + * see NAME + * + * INPUTS + * pElementCollector - the ElementCollector to be added + * + * RESULT + * empty + * + * HISTORY + * 05.01.2004 - implemented + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ + m_vElementCollectors.push_back( pElementCollector ); + ((ElementCollector*)pElementCollector)->setBufferNode(this); +} + +void BufferNode::removeElementCollector(const ElementCollector* pElementCollector) +/****** BufferNode/removeElementCollector ************************************ + * + * NAME + * removeElementCollector -- removes an ElementCollector from this + * BufferNode. + * + * SYNOPSIS + * removeElementCollector(pElementCollector); + * + * FUNCTION + * see NAME + * + * INPUTS + * pElementCollector - the ElementCollector to be removed + * + * RESULT + * empty + * + * HISTORY + * 05.01.2004 - implemented + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ + std::vector< const ElementCollector* >::iterator ii = m_vElementCollectors.begin(); + + for( ; ii != m_vElementCollectors.end() ; ++ii ) + { + if( *ii == pElementCollector ) + { + m_vElementCollectors.erase( ii ); + ((ElementCollector*)pElementCollector)->setBufferNode(NULL); + break; + } + } +} + +ElementMark* BufferNode::getBlocker() const +{ + return m_pBlocker; +} + +void BufferNode::setBlocker(const ElementMark* pBlocker) +/****** BufferNode/setBlocker ************************************************ + * + * NAME + * setBlocker -- adds a blocker to this BufferNode. + * + * SYNOPSIS + * setBlocker(pBlocker); + * + * FUNCTION + * see NAME + * + * INPUTS + * pBlocker - the new blocker to be attached + * + * RESULT + * empty + * + * NOTES + * Because there is only one blocker permited for a BufferNode, so the + * old blocker on this BufferNode, if there is one, will be overcasted. + * + * HISTORY + * 05.01.2004 - implemented + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ + OSL_ASSERT(!(m_pBlocker != NULL && pBlocker != NULL)); + + m_pBlocker = (ElementMark*)pBlocker; + if (m_pBlocker != NULL) + { + m_pBlocker->setBufferNode(this); + } +} + +rtl::OUString BufferNode::printChildren() const +/****** BufferNode/printChildren ********************************************* + * + * NAME + * printChildren -- prints children information into a string. + * + * SYNOPSIS + * result = printChildren(); + * + * FUNCTION + * see NAME + * + * INPUTS + * empty + * + * RESULT + * result - the information string + * + * HISTORY + * 05.01.2004 - implemented + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ + rtl::OUString rc; + std::vector< const ElementCollector* >::const_iterator ii = m_vElementCollectors.begin(); + + for( ; ii != m_vElementCollectors.end() ; ++ii ) + { + rc += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "BufID=" )); + rc += rtl::OUString::valueOf((*ii)->getBufferId()); + + if (((ElementCollector*)(*ii))->getModify()) + { + rc += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "[M]" )); + } + + rc += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ",Pri=" )); + + switch (((ElementCollector*)(*ii))->getPriority()) + { + case cssxc::sax::ElementMarkPriority_BEFOREMODIFY: + rc += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "BEFOREMODIFY" )); + break; + case cssxc::sax::ElementMarkPriority_AFTERMODIFY: + rc += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "AFTERMODIFY" )); + break; + default: + rc += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "UNKNOWN" )); + break; + } + + rc += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "(" )); + /* + if (((ElementCollector*)(*ii))->isInternalNotificationSuppressed()) + { + rc += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "*IN-Suppressed* " )); + } + */ + rc += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "SecID=" )); + rc += rtl::OUString::valueOf(((ElementCollector*)(*ii))->getSecurityId()); + rc += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ")" )); + rc += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( " " )); + } + + return rc; +} + +bool BufferNode::hasAnything() const +/****** BufferNode/hasAnything *********************************************** + * + * NAME + * hasAnything -- checks whether there is any ElementCollector or blocker + * on this BufferNode. + * + * SYNOPSIS + * bExist = hasAnything(); + * + * FUNCTION + * see NAME + * + * INPUTS + * empty + * + * RESULT + * bExist - true if there is, false otherwise. + * + * HISTORY + * 05.01.2004 - implemented + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ + return (m_pBlocker != NULL || m_vElementCollectors.size() > 0); +} + +bool BufferNode::hasChildren() const +/****** BufferNode/hasChildren *********************************************** + * + * NAME + * hasChildren -- checks whether this BufferNode has any child + * BufferNode. + * + * SYNOPSIS + * bExist = hasChildren(); + * + * FUNCTION + * see NAME + * + * INPUTS + * empty + * + * RESULT + * bExist - true if there is, false otherwise. + * + * HISTORY + * 05.01.2004 - implemented + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ + return (m_vChildren.size() > 0); +} + +std::vector< const BufferNode* >* BufferNode::getChildren() const +{ + return new std::vector< const BufferNode* >( m_vChildren ); +} + +const BufferNode* BufferNode::getFirstChild() const +/****** BufferNode/getFirstChild ********************************************* + * + * NAME + * getFirstChild -- retrieves the first child BufferNode. + * + * SYNOPSIS + * child = getFirstChild(); + * + * FUNCTION + * see NAME + * + * INPUTS + * empty + * + * RESULT + * child - the first child BufferNode, or NULL if there is no child + * BufferNode. + * + * HISTORY + * 05.01.2004 - implemented + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ + BufferNode* rc = NULL; + + if (m_vChildren.size() > 0) + { + rc = (BufferNode*)m_vChildren.front(); + } + + return (const BufferNode*)rc; +} + +void BufferNode::addChild(const BufferNode* pChild, sal_Int32 nPosition) +/****** BufferNode/addChild(pChild,nPosition) ******************************** + * + * NAME + * addChild -- inserts a child BufferNode at specific position. + * + * SYNOPSIS + * addChild(pChild, nPosition); + * + * FUNCTION + * see NAME + * + * INPUTS + * pChild - the child BufferNode to be added. + * nPosition - the position where the new child locates. + * + * RESULT + * empty + * + * NOTES + * If the nPosition is -1, then the new child BufferNode is appended + * at the end. + * + * HISTORY + * 05.01.2004 - implemented + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ + if (nPosition == -1) + { + m_vChildren.push_back( pChild ); + } + else + { + std::vector< const BufferNode* >::iterator ii = m_vChildren.begin(); + ii += nPosition; + m_vChildren.insert(ii, pChild); + } +} + +void BufferNode::addChild(const BufferNode* pChild) +/****** BufferNode/addChild() ************************************************ + * + * NAME + * addChild -- add a new child BufferNode. + * + * SYNOPSIS + * addChild(pChild); + * + * FUNCTION + * see NAME + * + * INPUTS + * pChild - the child BufferNode to be added. + * + * RESULT + * empty + * + * NOTES + * The new child BufferNode is appended at the end. + * + * HISTORY + * 05.01.2004 - implemented + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ + addChild(pChild, -1); +} + +void BufferNode::removeChild(const BufferNode* pChild) +/****** BufferNode/removeChild *********************************************** + * + * NAME + * removeChild -- removes a child BufferNode from the children list. + * + * SYNOPSIS + * removeChild(pChild); + * + * FUNCTION + * see NAME + * + * INPUTS + * pChild - the child BufferNode to be removed + * + * RESULT + * empty + * + * HISTORY + * 05.01.2004 - implemented + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ + std::vector< const BufferNode* >::iterator ii = m_vChildren.begin(); + + for( ; ii != m_vChildren.end() ; ++ii ) + { + if( *ii == pChild ) + { + m_vChildren.erase( ii ); + break; + } + } +} + +sal_Int32 BufferNode::indexOfChild(const BufferNode* pChild) const +/****** BufferNode/indexOfChild ********************************************** + * + * NAME + * indexOfChild -- gets the index of a child BufferNode. + * + * SYNOPSIS + * index = indexOfChild(pChild); + * + * FUNCTION + * see NAME + * + * INPUTS + * pChild - the child BufferNode whose index to be gotten + * + * RESULT + * index - the index of that child BufferNode. If that child BufferNode + * is not found, -1 is returned. + * + * HISTORY + * 05.01.2004 - implemented + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ + sal_Int32 nIndex = 0; + bool bFound = false; + + std::vector< const BufferNode * >::const_iterator ii = m_vChildren.begin(); + + for( ; ii != m_vChildren.end() ; ++ii ) + { + if( *ii == pChild ) + { + bFound = true; + break; + } + nIndex++; + } + + if (!bFound ) + { + nIndex = -1; + } + + return nIndex; +} + +const BufferNode* BufferNode::childAt(sal_Int32 nIndex) const +/****** BufferNode/childAt *************************************************** + * + * NAME + * childAt -- retrieves the child BufferNode at specific possition. + * + * SYNOPSIS + * child = childAt(nIndex); + * + * FUNCTION + * see NAME + * + * INPUTS + * nIndex - the index of the child BufferNode to be retrieved + * + * RESULT + * child - the child BufferNode at index position, or NULL if the index + * is out of the range of children. + * + * HISTORY + * 05.01.2004 - implemented + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ + BufferNode* rc = NULL; + + if (nIndex < ((sal_Int32)m_vChildren.size()) && nIndex >= 0) + { + rc = (BufferNode*)m_vChildren[nIndex]; + } + + return (const BufferNode*)rc; +} + +const BufferNode* BufferNode::getParent() const +{ + return m_pParent; +} + +void BufferNode::setParent(const BufferNode* pParent) +{ + m_pParent = (BufferNode*)pParent; +} + +const BufferNode* BufferNode::getNextSibling() const +/****** BufferNode/getNextSibling ******************************************** + * + * NAME + * getNextSibling -- retrieves the next sibling BufferNode. + * + * SYNOPSIS + * sibling = getNextSibling(); + * + * FUNCTION + * see NAME + * + * INPUTS + * empty + * + * RESULT + * sibling - the next sibling BufferNode, or NULL if there is none. + * + * HISTORY + * 05.01.2004 - implemented + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ + BufferNode* rc = NULL; + + if (m_pParent != NULL) + { + rc = (BufferNode*)m_pParent->getNextChild(this); + } + + return (const BufferNode*)rc; +} + +const BufferNode* BufferNode::isAncestor(const BufferNode* pDescendant) const +/****** BufferNode/isAncestor ************************************************ + * + * NAME + * isAncestor -- checks whether this BufferNode is an ancestor of another + * BufferNode. + * + * SYNOPSIS + * bIs = isAncestor(pDescendant); + * + * FUNCTION + * see NAME + * + * INPUTS + * pDescendant - the BufferNode to be checked as a descendant + * + * RESULT + * bIs - true if this BufferNode is an ancestor of the pDescendant, + * false otherwise. + * + * HISTORY + * 05.01.2004 - implemented + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ + BufferNode* rc = NULL; + + if (pDescendant != NULL) + { + std::vector< const BufferNode* >::const_iterator ii = m_vChildren.begin(); + + for( ; ii != m_vChildren.end() ; ++ii ) + { + BufferNode* pChild = (BufferNode*)*ii; + + if (pChild == pDescendant) + { + rc = pChild; + break; + } + + if (pChild->isAncestor(pDescendant) != NULL) + { + rc = pChild; + break; + } + } + } + + return (const BufferNode*)rc; +} + +bool BufferNode::isPrevious(const BufferNode* pFollowing) const +/****** BufferNode/isPrevious ************************************************ + * + * NAME + * isPrevious -- checks whether this BufferNode is ahead of another + * BufferNode in the tree order. + * + * SYNOPSIS + * bIs = isPrevious(pFollowing); + * + * FUNCTION + * see NAME + * + * INPUTS + * pFollowing - the BufferNode to be checked as a following + * + * RESULT + * bIs - true if this BufferNode is ahead in the tree order, false + * otherwise. + * + * HISTORY + * 05.01.2004 - implemented + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ + bool rc = false; + + BufferNode* pNextBufferNode = (BufferNode*)getNextNodeByTreeOrder(); + while (pNextBufferNode != NULL) + { + if (pNextBufferNode == pFollowing) + { + rc = true; + break; + } + + pNextBufferNode = (BufferNode*)(pNextBufferNode->getNextNodeByTreeOrder()); + } + + return rc; +} + +const BufferNode* BufferNode::getNextNodeByTreeOrder() const +/****** BufferNode/getNextNodeByTreeOrder ************************************ + * + * NAME + * getNextNodeByTreeOrder -- retrieves the next BufferNode in the tree + * order. + * + * SYNOPSIS + * next = getNextNodeByTreeOrder(); + * + * FUNCTION + * see NAME + * + * INPUTS + * empty + * + * RESULT + * next - the BufferNode following this BufferNode in the tree order, + * or NULL if there is none. + * + * NOTES + * The "next" node in tree order is defined as: + * 1. If a node has children, then the first child is; + * 2. otherwise, if it has a following sibling, then this sibling node is; + * 3. otherwise, if it has a parent node, the the parent's next sibling + * node is; + * 4. otherwise, no "next" node exists. + * + * HISTORY + * 05.01.2004 - implemented + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ + /* + * If this buffer node has m_vChildren, then return the first + * child. + */ + if (hasChildren()) + { + return getFirstChild(); + } + + /* + * Otherwise, it this buffer node has a following sibling, + * then return that sibling. + */ + BufferNode* pNextSibling = (BufferNode*)getNextSibling(); + if (pNextSibling != NULL) + { + return pNextSibling; + } + + /* + * Otherwise, it this buffer node has parent, then return + * its parent's following sibling. + */ + BufferNode* pNode = (BufferNode*)this; + BufferNode* pParent; + BufferNode* pNextSiblingParent = NULL; + + do + { + if (pNode == NULL) + { + break; + } + + pParent = (BufferNode*)pNode->getParent(); + if (pParent != NULL) + { + pNextSiblingParent = (BufferNode*)pParent->getNextSibling(); + } + pNode = pParent; + + }while (pNextSiblingParent == NULL); + + return pNextSiblingParent; +} + +cssu::Reference< cssxw::XXMLElementWrapper > BufferNode::getXMLElement() const +{ + return m_xXMLElement; +} + +void BufferNode::setXMLElement( const cssu::Reference< cssxw::XXMLElementWrapper >& xXMLElement ) +{ + m_xXMLElement = xXMLElement; +} + +void BufferNode::notifyBranch() +/****** BufferNode/notifyBranch ********************************************** + * + * NAME + * notifyBranch -- notifies each BufferNode in the branch of this + * BufferNode in the tree order. + * + * SYNOPSIS + * notifyBranch(); + * + * FUNCTION + * see NAME + * + * INPUTS + * empty + * + * RESULT + * empty + * + * HISTORY + * 05.01.2004 - implemented + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ + std::vector< const BufferNode* >::const_iterator ii = m_vChildren.begin(); + + for( ; ii != m_vChildren.end() ; ++ii ) + { + BufferNode* pBufferNode = (BufferNode*)*ii; + pBufferNode->elementCollectorNotify(); + pBufferNode->notifyBranch(); + } +} + +void BufferNode::notifyAncestor() +/****** BufferNode/notifyAncestor ******************************************** + * + * NAME + * notifyAncestor -- notifies each ancestor BufferNode through the parent + * link. + * + * SYNOPSIS + * notifyAncestor(); + * + * FUNCTION + * see NAME + * + * INPUTS + * empty + * + * RESULT + * empty + * + * HISTORY + * 05.01.2004 - implemented + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ + BufferNode* pParent = m_pParent; + while (pParent != NULL) + { + pParent->notifyAncestor(); + pParent = (BufferNode*)pParent->getParent(); + } +} + +void BufferNode::elementCollectorNotify() +/****** BufferNode/elementCollectorNotify ************************************ + * + * NAME + * elementCollectorNotify -- notifies this BufferNode. + * + * SYNOPSIS + * elementCollectorNotify(); + * + * FUNCTION + * Notifies this BufferNode if the notification is not suppressed. + * + * INPUTS + * empty + * + * RESULT + * child - the first child BufferNode, or NULL if there is no child + * BufferNode. + * + * HISTORY + * 05.01.2004 - implemented + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ + if (m_vElementCollectors.size()>0) + { + cssxc::sax::ElementMarkPriority nMaxPriority = cssxc::sax::ElementMarkPriority_MINIMUM; + cssxc::sax::ElementMarkPriority nPriority; + + /* + * get the max priority among ElementCollectors on this BufferNode + */ + std::vector< const ElementCollector* >::const_iterator ii = m_vElementCollectors.begin(); + for( ; ii != m_vElementCollectors.end() ; ++ii ) + { + ElementCollector* pElementCollector = (ElementCollector*)*ii; + nPriority = pElementCollector->getPriority(); + if (nPriority > nMaxPriority) + { + nMaxPriority = nPriority; + } + } + + std::vector< const ElementCollector* > vElementCollectors( m_vElementCollectors ); + ii = vElementCollectors.begin(); + + for( ; ii != vElementCollectors.end() ; ++ii ) + { + ElementCollector* pElementCollector = (ElementCollector*)*ii; + nPriority = pElementCollector->getPriority(); + bool bToModify = pElementCollector->getModify(); + + /* + * Only ElementCollector with the max priority can + * perform notify operation. + * Moreover, if any blocker exists in the subtree of + * this BufferNode, this ElementCollector can't do notify + * unless its priority is BEFOREMODIFY. + */ + if (nPriority == nMaxPriority && + (nPriority == cssxc::sax::ElementMarkPriority_BEFOREMODIFY || + !isBlockerInSubTreeIncluded(pElementCollector->getSecurityId()))) + { + /* + * If this ElementCollector will modify the bufferred element, then + * special attention must be paid. + * + * If there is any ElementCollector in the subtree or any ancestor + * ElementCollector with PRI_BEFPREMODIFY priority, this + * ElementCollector can't perform notify operation, otherwise, it + * will destroy the bufferred element, in turn, ElementCollectors + * mentioned above can't perform their mission. + */ + //if (!(nMaxPriority == cssxc::sax::ElementMarkPriority_PRI_MODIFY && + if (!(bToModify && + (isECInSubTreeIncluded(pElementCollector->getSecurityId()) || + isECOfBeforeModifyInAncestorIncluded(pElementCollector->getSecurityId())) + )) + { + pElementCollector->notifyListener(); + } + } + } + } +} + +bool BufferNode::isECInSubTreeIncluded(sal_Int32 nIgnoredSecurityId) const +/****** BufferNode/isECInSubTreeIncluded ************************************* + * + * NAME + * isECInSubTreeIncluded -- checks whether there is any ElementCollector + * in the branch of this BufferNode. + * + * SYNOPSIS + * bExist = isECInSubTreeIncluded(nIgnoredSecurityId); + * + * FUNCTION + * checks each BufferNode in the branch of this BufferNode, if there is + * an ElementCollector whose signatureId is not ignored, then return + * true, otherwise, false returned. + * + * INPUTS + * nIgnoredSecurityId - the security Id to be ignored. If it equals + * to UNDEFINEDSECURITYID, then no security Id + * will be ignored. + * + * RESULT + * bExist - true if a match found, false otherwise. + * + * HISTORY + * 05.01.2004 - implemented + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ + bool rc = false; + + std::vector< const ElementCollector* >::const_iterator jj = m_vElementCollectors.begin(); + + for( ; jj != m_vElementCollectors.end() ; ++jj ) + { + ElementCollector* pElementCollector = (ElementCollector*)*jj; + if (nIgnoredSecurityId == cssxc::sax::ConstOfSecurityId::UNDEFINEDSECURITYID || + pElementCollector->getSecurityId() != nIgnoredSecurityId) + { + rc = true; + break; + } + } + + if ( !rc ) + { + std::vector< const BufferNode* >::const_iterator ii = m_vChildren.begin(); + + for( ; ii != m_vChildren.end() ; ++ii ) + { + BufferNode* pBufferNode = (BufferNode*)*ii; + + if ( pBufferNode->isECInSubTreeIncluded(nIgnoredSecurityId)) + { + rc = true; + break; + } + } + } + + return rc; +} + +bool BufferNode::isECOfBeforeModifyInAncestorIncluded(sal_Int32 nIgnoredSecurityId) const +/****** BufferNode/isECOfBeforeModifyInAncestorIncluded ********************** + * + * NAME + * isECOfBeforeModifyInAncestorIncluded -- checks whether there is some + * ancestor BufferNode which has ElementCollector with PRI_BEFPREMODIFY + * priority. + * + * SYNOPSIS + * bExist = isECOfBeforeModifyInAncestorIncluded(nIgnoredSecurityId); + * + * FUNCTION + * checks each ancestor BufferNode through the parent link, if there is + * an ElementCollector with PRI_BEFPREMODIFY priority and its + * signatureId is not ignored, then return true, otherwise, false + * returned. + * + * INPUTS + * nIgnoredSecurityId - the security Id to be ignored. If it equals + * to UNDEFINEDSECURITYID, then no security Id + * will be ignored. + * + * RESULT + * bExist - true if a match found, false otherwise. + * + * HISTORY + * 05.01.2004 - implemented + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ + bool rc = false; + + BufferNode* pParentNode = m_pParent; + while (pParentNode != NULL) + { + if (pParentNode->isECOfBeforeModifyIncluded(nIgnoredSecurityId)) + { + rc = true; + break; + } + + pParentNode = (BufferNode*)pParentNode->getParent(); + } + + return rc; +} + +bool BufferNode::isBlockerInSubTreeIncluded(sal_Int32 nIgnoredSecurityId) const +/****** BufferNode/isBlockerInSubTreeIncluded ******************************** + * + * NAME + * isBlockerInSubTreeIncluded -- checks whether there is some BufferNode + * which has blocker on it + * + * SYNOPSIS + * bExist = isBlockerInSubTreeIncluded(nIgnoredSecurityId); + * + * FUNCTION + * checks each BufferNode in the branch of this BufferNode, if one has + * a blocker on it, and the blocker's securityId is not ignored, then + * returns true; otherwise, false returns. + * + * INPUTS + * nIgnoredSecurityId - the security Id to be ignored. If it equals + * to UNDEFINEDSECURITYID, then no security Id + * will be ignored. + * + * RESULT + * bExist - true if a match found, false otherwise. + * + * HISTORY + * 05.01.2004 - implemented + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ + bool rc = false; + + std::vector< const BufferNode* >::const_iterator ii = m_vChildren.begin(); + + for( ; ii != m_vChildren.end() ; ++ii ) + { + BufferNode* pBufferNode = (BufferNode*)*ii; + ElementMark* pBlocker = pBufferNode->getBlocker(); + + if (pBlocker != NULL && + (nIgnoredSecurityId == cssxc::sax::ConstOfSecurityId::UNDEFINEDSECURITYID || + pBlocker->getSecurityId() != nIgnoredSecurityId )) + { + rc = true; + break; + } + + if (rc || pBufferNode->isBlockerInSubTreeIncluded(nIgnoredSecurityId)) + { + rc = true; + break; + } + } + + return rc; +} + +const BufferNode* BufferNode::getNextChild(const BufferNode* pChild) const +/****** BufferNode/getNextChild ********************************************** + * + * NAME + * getNextChild -- get the next child BufferNode. + * + * SYNOPSIS + * nextChild = getNextChild(); + * + * FUNCTION + * see NAME + * + * INPUTS + * pChild - the child BufferNode whose next node is retrieved. + * + * RESULT + * nextChild - the next child BufferNode after the pChild, or NULL if + * there is none. + * + * HISTORY + * 05.01.2004 - implemented + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ + BufferNode* rc = NULL; + bool bChildFound = false; + + std::vector< const BufferNode* >::const_iterator ii = m_vChildren.begin(); + for( ; ii != m_vChildren.end() ; ++ii ) + { + if (bChildFound) + { + rc = (BufferNode*)*ii; + break; + } + + if( *ii == pChild ) + { + bChildFound = true; + } + } + + return (const BufferNode*)rc; +} + + +void BufferNode::freeAllChildren() +/****** BufferNode/freeAllChildren ******************************************* + * + * NAME + * freeAllChildren -- free all his child BufferNode. + * + * SYNOPSIS + * freeAllChildren(); + * + * FUNCTION + * see NAME + * + * INPUTS + * empty + * + * RESULT + * empty + * + * HISTORY + * 30.03.2004 - the correct the memory leak bug + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ + std::vector< const BufferNode* >::const_iterator ii = m_vChildren.begin(); + for( ; ii != m_vChildren.end() ; ++ii ) + { + BufferNode *pChild = (BufferNode *)(*ii); + pChild->freeAllChildren(); + delete pChild; + } + + m_vChildren.clear(); +} diff --git a/xmlsecurity/source/framework/buffernode.hxx b/xmlsecurity/source/framework/buffernode.hxx new file mode 100644 index 000000000000..ec5d071d234b --- /dev/null +++ b/xmlsecurity/source/framework/buffernode.hxx @@ -0,0 +1,137 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _BUFFERNODE_HXX +#define _BUFFERNODE_HXX + +#include <com/sun/star/lang/XServiceInfo.hpp> +#include <com/sun/star/xml/wrapper/XXMLElementWrapper.hpp> + +#ifndef INCLUDED_VECTOR +#include <vector> +#define INCLUDED_VECTOR +#endif + +class ElementMark; +class ElementCollector; + +class BufferNode +/****** buffernode.hxx/CLASS BufferNode *************************************** + * + * NAME + * BufferNode -- Class to maintain the tree of bufferred elements + * + * FUNCTION + * One BufferNode object represents a bufferred element in the document + * wrapper component. + * All BufferNode objects construct a tree which has the same structure + * of all bufferred elements. That is to say, if one bufferred element is + * an ancestor of another bufferred element, then the corresponding + * BufferNode objects are also in ancestor/descendant relationship. + * This class is used to manipulate the tree of bufferred elements. + * + * HISTORY + * 05.01.2004 - implemented + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ +private: + /* the parent BufferNode */ + BufferNode* m_pParent; + + /* all child BufferNodes */ + std::vector< const BufferNode* > m_vChildren; + + /* all ElementCollector holding this BufferNode */ + std::vector< const ElementCollector* > m_vElementCollectors; + + /* + * the blocker holding this BufferNode, one BufferNode can have one + * blocker at most + */ + ElementMark* m_pBlocker; + + /* + * whether the element has completely bufferred by the document wrapper + * component + */ + bool m_bAllReceived; + + /* the XMLElementWrapper of the bufferred element */ + com::sun::star::uno::Reference< + com::sun::star::xml::wrapper::XXMLElementWrapper > m_xXMLElement; + +private: + bool isECInSubTreeIncluded(sal_Int32 nIgnoredSecurityId) const; + bool isECOfBeforeModifyInAncestorIncluded(sal_Int32 nIgnoredSecurityId) const; + bool isBlockerInSubTreeIncluded(sal_Int32 nIgnoredSecurityId) const; + const BufferNode* getNextChild(const BufferNode* pChild) const; + +public: + explicit BufferNode( + const com::sun::star::uno::Reference< + com::sun::star::xml::wrapper::XXMLElementWrapper >& xXMLElement); + virtual ~BufferNode() {}; + + bool isECOfBeforeModifyIncluded(sal_Int32 nIgnoredSecurityId) const; + void setReceivedAll(); + bool isAllReceived() const; + void addElementCollector(const ElementCollector* pElementCollector); + void removeElementCollector(const ElementCollector* pElementCollector); + ElementMark* getBlocker() const; + void setBlocker(const ElementMark* pBlocker); + rtl::OUString printChildren() const; + bool hasAnything() const; + bool hasChildren() const; + std::vector< const BufferNode* >* getChildren() const; + const BufferNode* getFirstChild() const; + void addChild(const BufferNode* pChild, sal_Int32 nPosition); + void addChild(const BufferNode* pChild); + void removeChild(const BufferNode* pChild); + sal_Int32 indexOfChild(const BufferNode* pChild) const; + const BufferNode* childAt(sal_Int32 nIndex) const; + const BufferNode* getParent() const; + void setParent(const BufferNode* pParent); + const BufferNode* getNextSibling() const; + const BufferNode* isAncestor(const BufferNode* pDescendant) const; + bool isPrevious(const BufferNode* pFollowing) const; + const BufferNode* getNextNodeByTreeOrder() const; + com::sun::star::uno::Reference< + com::sun::star::xml::wrapper::XXMLElementWrapper > getXMLElement() const; + void setXMLElement(const com::sun::star::uno::Reference< + com::sun::star::xml::wrapper::XXMLElementWrapper >& xXMLElement); + void notifyBranch(); + void notifyAncestor(); + void elementCollectorNotify(); + void freeAllChildren(); +}; + +#endif + diff --git a/xmlsecurity/source/framework/decryptorimpl.cxx b/xmlsecurity/source/framework/decryptorimpl.cxx new file mode 100644 index 000000000000..a2fcafc1ca4b --- /dev/null +++ b/xmlsecurity/source/framework/decryptorimpl.cxx @@ -0,0 +1,245 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_xmlsecurity.hxx" + +#include "decryptorimpl.hxx" +#include <com/sun/star/xml/crypto/XXMLEncryptionTemplate.hpp> +#include <com/sun/star/xml/wrapper/XXMLElementWrapper.hpp> +#include <com/sun/star/lang/XMultiServiceFactory.hpp> + +namespace cssu = com::sun::star::uno; +namespace cssl = com::sun::star::lang; +namespace cssxc = com::sun::star::xml::crypto; +namespace cssxw = com::sun::star::xml::wrapper; + +#define SERVICE_NAME "com.sun.star.xml.crypto.sax.Decryptor" +#define IMPLEMENTATION_NAME "com.sun.star.xml.security.framework.DecryptorImpl" + +#define DECLARE_ASCII( SASCIIVALUE ) \ + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SASCIIVALUE ) ) + +DecryptorImpl::DecryptorImpl( const cssu::Reference< cssl::XMultiServiceFactory >& rxMSF) +{ + mxMSF = rxMSF; +} + +DecryptorImpl::~DecryptorImpl() +{ +} + +bool DecryptorImpl::checkReady() const +/****** DecryptorImpl/checkReady ********************************************* + * + * NAME + * checkReady -- checks the conditions for the decryption. + * + * SYNOPSIS + * bReady = checkReady( ); + * + * FUNCTION + * checks whether all following conditions are satisfied: + * 1. the result listener is ready; + * 2. the EncryptionEngine is ready. + * + * INPUTS + * empty + * + * RESULT + * bReady - true if all conditions are satisfied, false otherwise + * + * HISTORY + * 05.01.2004 - implemented + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ + return (m_xResultListener.is() && EncryptionEngine::checkReady()); +} + +void DecryptorImpl::notifyResultListener() const + throw (cssu::Exception, cssu::RuntimeException) +/****** DecryptorImpl/notifyResultListener *********************************** + * + * NAME + * notifyResultListener -- notifies the listener about the decryption + * result. + * + * SYNOPSIS + * notifyResultListener( ); + * + * FUNCTION + * see NAME. + * + * INPUTS + * empty + * + * RESULT + * empty + * + * HISTORY + * 05.01.2004 - implemented + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ + cssu::Reference< cssxc::sax::XDecryptionResultListener > + xDecryptionResultListener ( m_xResultListener , cssu::UNO_QUERY ) ; + + xDecryptionResultListener->decrypted(m_nSecurityId,m_nStatus); +} + +void DecryptorImpl::startEngine( const cssu::Reference< + cssxc::XXMLEncryptionTemplate >& + xEncryptionTemplate) + throw (cssu::Exception, cssu::RuntimeException) +/****** DecryptorImpl/startEngine ******************************************** + * + * NAME + * startEngine -- decrypts the encryption. + * + * SYNOPSIS + * startEngine( xEncryptionTemplate ); + * + * FUNCTION + * decrypts the encryption element, then if succeeds, updates the link + * of old template element to the new encryption element in + * SAXEventKeeper. + * + * INPUTS + * xEncryptionTemplate - the encryption template to be decrypted. + * + * RESULT + * empty + * + * HISTORY + * 05.01.2004 - implemented + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ + cssu::Reference< cssxc::XXMLEncryptionTemplate > xResultTemplate; + try + { + xResultTemplate = m_xXMLEncryption->decrypt(xEncryptionTemplate, m_xXMLSecurityContext); + m_nStatus = xResultTemplate->getStatus(); + } + catch( cssu::Exception& ) + { + m_nStatus = cssxc::SecurityOperationStatus_RUNTIMEERROR_FAILED; + } + + if (m_nStatus == cssxc::SecurityOperationStatus_OPERATION_SUCCEEDED) + { + cssu::Reference< cssxw::XXMLElementWrapper > xDecryptedElement + = xResultTemplate->getTemplate(); + m_xSAXEventKeeper->setElement(m_nIdOfTemplateEC, xDecryptedElement); + } +} + +/* XDecryptionResultBroadcaster */ +void SAL_CALL DecryptorImpl::addDecryptionResultListener( const cssu::Reference< cssxc::sax::XDecryptionResultListener >& listener ) + throw (cssu::Exception, cssu::RuntimeException) +{ + m_xResultListener = listener; + tryToPerform(); +} + +void SAL_CALL DecryptorImpl::removeDecryptionResultListener( const cssu::Reference< cssxc::sax::XDecryptionResultListener >&) + throw (cssu::RuntimeException) +{ +} + +/* XInitialization */ +void SAL_CALL DecryptorImpl::initialize( const cssu::Sequence< cssu::Any >& aArguments ) + throw (cssu::Exception, cssu::RuntimeException) +{ + OSL_ASSERT(aArguments.getLength() == 5); + + rtl::OUString ouTempString; + + aArguments[0] >>= ouTempString; + m_nSecurityId = ouTempString.toInt32(); + aArguments[1] >>= m_xSAXEventKeeper; + aArguments[2] >>= ouTempString; + m_nIdOfTemplateEC = ouTempString.toInt32(); + aArguments[3] >>= m_xXMLSecurityContext; + aArguments[4] >>= m_xXMLEncryption; +} + +rtl::OUString DecryptorImpl_getImplementationName () + throw (cssu::RuntimeException) +{ + return rtl::OUString ( RTL_CONSTASCII_USTRINGPARAM ( IMPLEMENTATION_NAME ) ); +} + +sal_Bool SAL_CALL DecryptorImpl_supportsService( const rtl::OUString& ServiceName ) + throw (cssu::RuntimeException) +{ + return ServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( SERVICE_NAME )); +} + +cssu::Sequence< rtl::OUString > SAL_CALL DecryptorImpl_getSupportedServiceNames( ) + throw (cssu::RuntimeException) +{ + cssu::Sequence < rtl::OUString > aRet(1); + rtl::OUString* pArray = aRet.getArray(); + pArray[0] = rtl::OUString ( RTL_CONSTASCII_USTRINGPARAM ( SERVICE_NAME ) ); + return aRet; +} +#undef SERVICE_NAME + +cssu::Reference< cssu::XInterface > SAL_CALL DecryptorImpl_createInstance( const cssu::Reference< cssl::XMultiServiceFactory >& rSMgr) + throw( cssu::Exception ) +{ + return (cppu::OWeakObject*) new DecryptorImpl(rSMgr); +} + +/* XServiceInfo */ +rtl::OUString SAL_CALL DecryptorImpl::getImplementationName( ) + throw (cssu::RuntimeException) +{ + return DecryptorImpl_getImplementationName(); +} +sal_Bool SAL_CALL DecryptorImpl::supportsService( const rtl::OUString& rServiceName ) + throw (cssu::RuntimeException) +{ + return DecryptorImpl_supportsService( rServiceName ); +} +cssu::Sequence< rtl::OUString > SAL_CALL DecryptorImpl::getSupportedServiceNames( ) + throw (cssu::RuntimeException) +{ + return DecryptorImpl_getSupportedServiceNames(); +} + diff --git a/xmlsecurity/source/framework/decryptorimpl.hxx b/xmlsecurity/source/framework/decryptorimpl.hxx new file mode 100644 index 000000000000..99aa2822667c --- /dev/null +++ b/xmlsecurity/source/framework/decryptorimpl.hxx @@ -0,0 +1,136 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _DECRYPTORIMPL_HXX +#define _DECRYPTORIMPL_HXX + +#include <com/sun/star/xml/crypto/sax/XDecryptionResultBroadcaster.hpp> +#include <com/sun/star/xml/crypto/sax/XDecryptionResultListener.hpp> +#include <com/sun/star/xml/crypto/XXMLSecurityContext.hpp> +#include <com/sun/star/lang/XInitialization.hpp> +#include <com/sun/star/lang/XServiceInfo.hpp> +#include <cppuhelper/implbase3.hxx> + +#include "encryptionengine.hxx" + +class DecryptorImpl : public cppu::ImplInheritanceHelper3 +< + EncryptionEngine, + com::sun::star::xml::crypto::sax::XDecryptionResultBroadcaster, + com::sun::star::lang::XInitialization, + com::sun::star::lang::XServiceInfo +> +/****** DecryptorImpl.hxx/CLASS DecryptorImpl ********************************* + * + * NAME + * DecryptorImpl -- decrypts an encryption + * + * FUNCTION + * Collects all resources for decrypting an encryption, then decrypts the + * encryption by invoking a xmlsec-based encryption bridge component. + * + * HISTORY + * 05.01.2004 - Interface supported: XDecryptionResultBroadcaster, + * XInitialization, XServiceInfo + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ +private: + /* + * the Id of the encryption, which is used for the result listener to + * identify the encryption. + */ + sal_Int32 m_nEncryptionId; + + /* + * the decryption result, + * remembers whether the decryption succeeds. + */ + bool m_bDecryptionSucceed; + + com::sun::star::uno::Reference< + com::sun::star::xml::crypto::XXMLSecurityContext > m_xXMLSecurityContext; + + virtual void notifyResultListener() const + throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException); + virtual bool checkReady() const; + virtual void startEngine( const com::sun::star::uno::Reference< + com::sun::star::xml::crypto::XXMLEncryptionTemplate >& + xEncryptionTemplate) + throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException); + +public: + explicit DecryptorImpl( const com::sun::star::uno::Reference< + com::sun::star::lang::XMultiServiceFactory >& rxMSF); + virtual ~DecryptorImpl(); + + /* XDecryptionResultBroadcaster */ + virtual void SAL_CALL addDecryptionResultListener( + const com::sun::star::uno::Reference< + com::sun::star::xml::crypto::sax::XDecryptionResultListener >& + listener ) + throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeDecryptionResultListener( + const com::sun::star::uno::Reference< + com::sun::star::xml::crypto::sax::XDecryptionResultListener >& + listener ) + throw (com::sun::star::uno::RuntimeException); + + /* XInitialization */ + virtual void SAL_CALL initialize( + const com::sun::star::uno::Sequence< com::sun::star::uno::Any >& aArguments ) + throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException); + + /* XServiceInfo */ + virtual rtl::OUString SAL_CALL getImplementationName( ) + throw (com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL supportsService( const rtl::OUString& ServiceName ) + throw (com::sun::star::uno::RuntimeException); + virtual com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames( ) + throw (com::sun::star::uno::RuntimeException); +}; + +rtl::OUString DecryptorImpl_getImplementationName() + throw ( com::sun::star::uno::RuntimeException ); + +sal_Bool SAL_CALL DecryptorImpl_supportsService( const rtl::OUString& ServiceName ) + throw ( com::sun::star::uno::RuntimeException ); + +com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL DecryptorImpl_getSupportedServiceNames( ) + throw ( com::sun::star::uno::RuntimeException ); + +com::sun::star::uno::Reference< com::sun::star::uno::XInterface > +SAL_CALL DecryptorImpl_createInstance( + const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& + rSMgr) + throw ( com::sun::star::uno::Exception ); + +#endif + diff --git a/xmlsecurity/source/framework/elementcollector.cxx b/xmlsecurity/source/framework/elementcollector.cxx new file mode 100644 index 000000000000..7f720bb86250 --- /dev/null +++ b/xmlsecurity/source/framework/elementcollector.cxx @@ -0,0 +1,296 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_xmlsecurity.hxx" + +#include "elementmark.hxx" +#include "elementcollector.hxx" +#include "buffernode.hxx" +#include <com/sun/star/xml/crypto/sax/ConstOfSecurityId.hpp> + +namespace cssu = com::sun::star::uno; +namespace cssxc = com::sun::star::xml::crypto; + +ElementCollector::ElementCollector( + sal_Int32 nSecurityId, + sal_Int32 nBufferId, + cssxc::sax::ElementMarkPriority nPriority, + bool bToModify, + const com::sun::star::uno::Reference< + com::sun::star::xml::crypto::sax::XReferenceResolvedListener >& + xReferenceResolvedListener) + :ElementMark(nSecurityId, nBufferId), + m_nPriority(nPriority), + m_bToModify(bToModify), + m_bAbleToNotify(false), + m_bNotified(false), + m_xReferenceResolvedListener(xReferenceResolvedListener) +/****** ElementCollector/ElementCollector ************************************* + * + * NAME + * ElementCollector -- constructor method + * + * SYNOPSIS + * ElementCollector(nSecurityId, nBufferId, nPriority, bToModify + * xReferenceResolvedListener); + * + * FUNCTION + * construct an ElementCollector object. + * + * INPUTS + * nSecurityId - represents which security entity the buffer node is + * related with. Either a signature or an encryption is + * a security entity. + * nBufferId - the id of the element bufferred in the document + * wrapper component. The document wrapper component + * uses this id to search the particular bufferred + * element. + * nPriority - the priority value. ElementCollector with lower + * priority value can't notify until all ElementCollectors + * with higher priority value have notified. + * bToModify - A flag representing whether this ElementCollector + * notification will cause the modification of its working + * element. + * xReferenceResolvedListener + * - the listener that this ElementCollector notifies to. + * + * RESULT + * empty + * + * HISTORY + * 05.01.2004 - implemented + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ + m_type = cssxc::sax::ElementMarkType_ELEMENTCOLLECTOR; +} + +/* +bool ElementCollector::isInternalNotificationSuppressed() const +{ + return m_bInternalNotificationSuppressed; +} +*/ + +cssxc::sax::ElementMarkPriority ElementCollector::getPriority() const +{ + return m_nPriority; +} + +bool ElementCollector::getModify() const +{ + return m_bToModify; +} + +void ElementCollector::notifyListener() +/****** ElementCollector/notifyListener *************************************** + * + * NAME + * notifyListener -- enable the ability to notify the listener + * + * SYNOPSIS + * notifyListener(); + * + * FUNCTION + * enable the ability to notify the listener and try to notify then. + * + * INPUTS + * empty + * + * RESULT + * empty + * + * HISTORY + * 05.01.2004 - implemented + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ + m_bAbleToNotify = true; + doNotify(); +} + +bool ElementCollector::isAbleToNotify() const +{ + return m_bAbleToNotify; +} + +void ElementCollector::setReferenceResolvedListener( + const cssu::Reference< cssxc::sax::XReferenceResolvedListener >& xReferenceResolvedListener) +/****** ElementCollector/setReferenceResolvedListener ************************* + * + * NAME + * setReferenceResolvedListener -- configures a listener for the buffer + * node in this object + * + * SYNOPSIS + * setReferenceResolvedListener(xReferenceResolvedListener); + * + * FUNCTION + * configures a new listener and try to notify then. + * + * INPUTS + * xReferenceResolvedListener - the new listener + * + * RESULT + * empty + * + * HISTORY + * 05.01.2004 - implemented + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ + m_xReferenceResolvedListener = xReferenceResolvedListener; + doNotify(); +} + +void ElementCollector::setSecurityId(sal_Int32 nSecurityId) +/****** ElementCollector/setSecurityId **************************************** + * + * NAME + * setSecurityId -- configures the security Id of the buffer node + * + * SYNOPSIS + * setSecurityId(nSecurityId); + * + * FUNCTION + * configures the security Id and try to notify then + * + * INPUTS + * nSecurityId - the security Id + * + * RESULT + * empty + * + * HISTORY + * 05.01.2004 - implemented + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ + m_nSecurityId = nSecurityId; + doNotify(); +} + +void ElementCollector::doNotify() +/****** ElementCollector/doNotify ********************************************* + * + * NAME + * doNotify -- tries to notify the listener + * + * SYNOPSIS + * doNotify(); + * + * FUNCTION + * notifies the listener when all below conditions are satisfied: + * the listener has not been notified; + * the notify right is granted; + * the listener has already been configured; + * the security id has already been configure + * + * INPUTS + * empty + * + * RESULT + * empty + * + * HISTORY + * 05.01.2004 - implemented + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ + if (!m_bNotified && + m_bAbleToNotify && + m_xReferenceResolvedListener.is() && + m_nSecurityId != cssxc::sax::ConstOfSecurityId::UNDEFINEDSECURITYID) + { + m_bNotified = true; + m_xReferenceResolvedListener->referenceResolved(m_nBufferId); + } +} + +ElementCollector* ElementCollector::clone( + sal_Int32 nBufferId, + cssxc::sax::ElementMarkPriority nPriority ) const +/****** ElementCollector/clone ************************************************ + * + * NAME + * clone -- duplicates this ElementCollector object + * + * SYNOPSIS + * cloned = clone(nBufferId, nPriority); + * + * FUNCTION + * duplicates this ElementCollector object with new buffer Id, priority. + * + * INPUTS + * nBufferId - the buffer node's Id + * nPriority - the priority + * + * RESULT + * clone - a new ElementCollector + * + * HISTORY + * 05.01.2004 - implemented + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ + ElementCollector* pClonedOne + = new ElementCollector(m_nSecurityId, + nBufferId, nPriority, m_bToModify, + m_xReferenceResolvedListener); + + if (m_bAbleToNotify) + { + pClonedOne->notifyListener(); + } + + if (m_pBufferNode != NULL) + { + m_pBufferNode->addElementCollector(pClonedOne); + } + + return pClonedOne; +} + diff --git a/xmlsecurity/source/framework/elementcollector.hxx b/xmlsecurity/source/framework/elementcollector.hxx new file mode 100644 index 000000000000..acef68b3bc8e --- /dev/null +++ b/xmlsecurity/source/framework/elementcollector.hxx @@ -0,0 +1,108 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _ELEMENTCOLLECTOR_HXX +#define _ELEMENTCOLLECTOR_HXX + +#include "elementmark.hxx" +#include <com/sun/star/xml/crypto/sax/XReferenceResolvedListener.hpp> +#include <com/sun/star/xml/crypto/sax/ElementMarkPriority.hpp> + +class ElementCollector : public ElementMark +/****** elementcollector.hxx/CLASS ElementCollector *************************** + * + * NAME + * ElementCollector -- Class to manipulate an element collector + * + * FUNCTION + * This class is derived from the ElementMark class. Beyond the function + * of the ElementMark class, this class also maintains the priority, and + * manages the notify process + * + * HISTORY + * 05.01.2004 - implemented + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ +private: + /* + * the notify priority, is one of following values: + * AFTERMODIFY - this ElementCollector will notify after all + * internal modifications have finished. + * BEFOREMODIFY - this ElementCollector must notify before any + * internal modification happens. + */ + com::sun::star::xml::crypto::sax::ElementMarkPriority m_nPriority; + + /* + * the modify flag, representing whether which elementcollector will + * modify its data. + */ + bool m_bToModify; + + /* the notify enable flag, see notifyListener method */ + bool m_bAbleToNotify; + + /* whether the listener has been notified */ + bool m_bNotified; + + /* the listener to be notified */ + com::sun::star::uno::Reference< + com::sun::star::xml::crypto::sax::XReferenceResolvedListener > m_xReferenceResolvedListener; + +public: + ElementCollector( + sal_Int32 nSecurityId, + sal_Int32 nBufferId, + com::sun::star::xml::crypto::sax::ElementMarkPriority nPriority, + bool bToModify, + const com::sun::star::uno::Reference< + com::sun::star::xml::crypto::sax::XReferenceResolvedListener >& + xReferenceResolvedListener); + virtual ~ElementCollector() {}; + + //bool isInternalNotificationSuppressed() const; + com::sun::star::xml::crypto::sax::ElementMarkPriority getPriority() const; + bool getModify() const; + void notifyListener(); + bool isAbleToNotify() const; + void setReferenceResolvedListener( + const com::sun::star::uno::Reference< + com::sun::star::xml::crypto::sax::XReferenceResolvedListener >& + referenceResolvedListener); + void setSecurityId(sal_Int32 nSecurityId); + void doNotify(); + ElementCollector* clone( + sal_Int32 nId, + com::sun::star::xml::crypto::sax::ElementMarkPriority nPriority ) const; +}; + +#endif + diff --git a/xmlsecurity/source/framework/elementmark.cxx b/xmlsecurity/source/framework/elementmark.cxx new file mode 100644 index 000000000000..3185d5e954dc --- /dev/null +++ b/xmlsecurity/source/framework/elementmark.cxx @@ -0,0 +1,105 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_xmlsecurity.hxx" + +#include "elementmark.hxx" +#include "buffernode.hxx" + +namespace cssxc = com::sun::star::xml::crypto; + +ElementMark::ElementMark(sal_Int32 nSecurityId, sal_Int32 nBufferId) + :m_pBufferNode(NULL), + m_nSecurityId(nSecurityId), + m_nBufferId(nBufferId), + m_type(cssxc::sax::ElementMarkType_ELEMENTMARK) +/****** ElementMark/ElementMark *********************************************** + * + * NAME + * ElementMark -- constructor method + * + * SYNOPSIS + * ElementMark(nSecurityId, nBufferId); + * + * FUNCTION + * construct an ElementMark object. + * + * INPUTS + * nSecurityId - represents which security entity the buffer node is + * related with. Either a signature or an encryption is + * a security entity. + * nBufferId - the id of the element bufferred in the document + * wrapper component. The document wrapper component + * uses this id to search the particular bufferred + * element. + * + * RESULT + * empty + * + * HISTORY + * 05.01.2004 - implemented + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ +} + +BufferNode* ElementMark::getBufferNode() const +{ + return m_pBufferNode; +} + +void ElementMark::setBufferNode(const BufferNode* pBufferNode) +{ + m_pBufferNode = (BufferNode*)pBufferNode; +} + +sal_Int32 ElementMark::getSecurityId() const +{ + return m_nSecurityId; +} + +void ElementMark::setSecurityId(sal_Int32 nSecurityId) +{ + m_nSecurityId = nSecurityId; +} + +com::sun::star::xml::crypto::sax::ElementMarkType ElementMark::getType() const +{ + return m_type; +} + +sal_Int32 ElementMark::getBufferId() const +{ + return m_nBufferId; +} + + + diff --git a/xmlsecurity/source/framework/elementmark.hxx b/xmlsecurity/source/framework/elementmark.hxx new file mode 100644 index 000000000000..0c08357867b4 --- /dev/null +++ b/xmlsecurity/source/framework/elementmark.hxx @@ -0,0 +1,85 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _ELEMENTMARK_HXX +#define _ELEMENTMARK_HXX + +#include <com/sun/star/lang/XServiceInfo.hpp> +#include <com/sun/star/xml/crypto/sax/ElementMarkType.hpp> + +class BufferNode; + +class ElementMark +/****** elementmark.hxx/CLASS ElementMark ************************************* + * + * NAME + * ElementMark -- Class to manipulate an element mark + * + * FUNCTION + * This class maintains the security id, buffer id and its type for a + * buffer node. + * + * HISTORY + * 05.01.2004 - implemented + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ +protected: + /* the BufferNode maintained by this object */ + BufferNode* m_pBufferNode; + + /* the security Id */ + sal_Int32 m_nSecurityId; + + /* the buffer Id */ + sal_Int32 m_nBufferId; + + /* + * the type value, is one of following values: + * TYPEOFELEMENTMARK - the default value, represents an blocker if + * not changed + * TYPEOFELEMENTCOLLECTOR - represents an ElementCollector + */ + com::sun::star::xml::crypto::sax::ElementMarkType m_type; + +public: + ElementMark(sal_Int32 nSecurityId, sal_Int32 nBufferId); + virtual ~ElementMark() {}; + + BufferNode* getBufferNode() const; + void setBufferNode(const BufferNode* pBufferNode); + sal_Int32 getSecurityId() const; + void setSecurityId(sal_Int32 nSecurityId); + com::sun::star::xml::crypto::sax::ElementMarkType getType() const; + sal_Int32 getBufferId() const; +}; + +#endif + diff --git a/xmlsecurity/source/framework/encryptionengine.cxx b/xmlsecurity/source/framework/encryptionengine.cxx new file mode 100644 index 000000000000..53e0c295a192 --- /dev/null +++ b/xmlsecurity/source/framework/encryptionengine.cxx @@ -0,0 +1,216 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_xmlsecurity.hxx" + +#include "encryptionengine.hxx" +#include <com/sun/star/xml/crypto/XXMLEncryptionTemplate.hpp> +#include <com/sun/star/xml/wrapper/XXMLElementWrapper.hpp> +#include <com/sun/star/lang/XMultiServiceFactory.hpp> + +namespace cssu = com::sun::star::uno; +namespace cssl = com::sun::star::lang; +namespace cssxc = com::sun::star::xml::crypto; +namespace cssxw = com::sun::star::xml::wrapper; + +#define ENCRYPTION_TEMPLATE "com.sun.star.xml.crypto.XMLEncryptionTemplate" + +#define DECLARE_ASCII( SASCIIVALUE ) \ + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SASCIIVALUE ) ) + +EncryptionEngine::EncryptionEngine( ) + :m_nIdOfBlocker(-1) +{ +} + +bool EncryptionEngine::checkReady() const +/****** EncryptionEngine/checkReady ****************************************** + * + * NAME + * checkReady -- checks the conditions for the main operation. + * + * SYNOPSIS + * bReady = checkReady( ); + * + * FUNCTION + * checks whether all following conditions are satisfied: + * 1. the main operation has't begun yet; + * 2. the key material is known; + * 3. the id of the template blocker is known; + * 4. both the key element and the encryption template + * are bufferred. + * + * INPUTS + * empty + * + * RESULT + * bReady - true if all conditions are satisfied, false otherwise + * + * HISTORY + * 05.01.2004 - implemented + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ + bool rc = true; + + sal_Int32 nKeyInc = 0; + if (m_nIdOfKeyEC != 0) + { + nKeyInc = 1; + } + + if (m_bMissionDone || + m_nIdOfKeyEC == -1 || + m_nIdOfBlocker == -1 || + 1+nKeyInc > m_nNumOfResolvedReferences ) + { + rc = false; + } + + return rc; +} + +void EncryptionEngine::tryToPerform( ) + throw (cssu::Exception, cssu::RuntimeException) +/****** EncryptionEngine/tryToPerform **************************************** + * + * NAME + * tryToPerform -- tries to perform the encryption/decryption operation. + * + * SYNOPSIS + * tryToPerform( ); + * + * FUNCTION + * if the situation is ready, perform following operations. + * 1. prepares a encryption template; + * 2. calls the encryption bridge component; + * 3. clears up all used resources; + * 4. notifies the result listener; + * 5. sets the "accomplishment" flag. + * + * INPUTS + * empty + * + * RESULT + * empty + * + * HISTORY + * 05.01.2004 - implemented + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ + if (checkReady()) + { + const rtl::OUString sEncryptionTemplate ( + RTL_CONSTASCII_USTRINGPARAM( ENCRYPTION_TEMPLATE ) ); + cssu::Reference < cssxc::XXMLEncryptionTemplate > xEncryptionTemplate( + mxMSF->createInstance( sEncryptionTemplate ), cssu::UNO_QUERY ); + + OSL_ASSERT( xEncryptionTemplate.is() ); + + cssu::Reference< cssxw::XXMLElementWrapper > xXMLElement + = m_xSAXEventKeeper->getElement( m_nIdOfTemplateEC ); + + xEncryptionTemplate->setTemplate(xXMLElement); + + startEngine( xEncryptionTemplate ); + + /* + * done + */ + clearUp( ); + + notifyResultListener(); + + m_bMissionDone = true; + } +} + +void EncryptionEngine::clearUp( ) const +/****** EncryptionEngine/clearup ********************************************* + * + * NAME + * clearUp -- clear up all resources used by this operation. + * + * SYNOPSIS + * clearUp( ); + * + * FUNCTION + * cleaning resources up includes: + * 1. releases the ElementCollector for the encryption template element; + * 2. releases the Blocker for the encryption template element; + * 3. releases the ElementCollector for the key element, if there is one. + * + * INPUTS + * empty + * + * RESULT + * empty + * + * HISTORY + * 05.01.2004 - implemented + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ + cssu::Reference < cssxc::sax::XReferenceResolvedBroadcaster > + xReferenceResolvedBroadcaster( m_xSAXEventKeeper, cssu::UNO_QUERY ); + + xReferenceResolvedBroadcaster->removeReferenceResolvedListener( + m_nIdOfTemplateEC, + (const cssu::Reference < cssxc::sax::XReferenceResolvedListener >)((SecurityEngine *)this)); + + m_xSAXEventKeeper->removeElementCollector(m_nIdOfTemplateEC); + + if (m_nIdOfBlocker != -1) + { + m_xSAXEventKeeper->removeBlocker(m_nIdOfBlocker); + } + + if (m_nIdOfKeyEC != 0 && m_nIdOfKeyEC != -1) + { + m_xSAXEventKeeper->removeElementCollector(m_nIdOfKeyEC); + } +} + +/* XBlockerMonitor */ +void SAL_CALL EncryptionEngine::setBlockerId( sal_Int32 id ) + throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException) +{ + m_nIdOfBlocker = id; + tryToPerform(); +} + diff --git a/xmlsecurity/source/framework/encryptionengine.hxx b/xmlsecurity/source/framework/encryptionengine.hxx new file mode 100644 index 000000000000..375fcc42b239 --- /dev/null +++ b/xmlsecurity/source/framework/encryptionengine.hxx @@ -0,0 +1,103 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _ENCRYPTIONENGINE_HXX +#define _ENCRYPTIONENGINE_HXX + +#include <com/sun/star/xml/crypto/sax/XReferenceResolvedListener.hpp> +#include <com/sun/star/xml/crypto/sax/XReferenceResolvedBroadcaster.hpp> +#include <com/sun/star/xml/crypto/sax/XBlockerMonitor.hpp> +#include <com/sun/star/xml/crypto/sax/XKeyCollector.hpp> +#include <com/sun/star/xml/crypto/sax/XMissionTaker.hpp> +#include <com/sun/star/xml/crypto/sax/XSAXEventKeeper.hpp> +#include <com/sun/star/xml/crypto/XXMLSecurityContext.hpp> +#include <com/sun/star/xml/crypto/XXMLEncryption.hpp> +#include <cppuhelper/implbase1.hxx> + +#include "securityengine.hxx" + +class EncryptionEngine : public cppu::ImplInheritanceHelper1 +< + SecurityEngine, + com::sun::star::xml::crypto::sax::XBlockerMonitor +> +/****** encryptionEngine.hxx/CLASS encryptionEngine *************************** + * + * NAME + * EncryptionEngine -- Base class of Encryptor and Decryptor + * + * FUNCTION + * Maintains common members and methods related with encryption. + * + * HISTORY + * 05.01.2004 - Interface supported: XBlockerMonitor + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ +protected: + /* + * the Encryption bridge component, which performs encrypt and decrypt + * operation based on xmlsec library. + */ + com::sun::star::uno::Reference< + com::sun::star::xml::crypto::XXMLEncryption > m_xXMLEncryption; + + /* + * the Id of template blocker. + */ + sal_Int32 m_nIdOfBlocker; + +protected: + EncryptionEngine( ); + virtual ~EncryptionEngine(){}; + + virtual void tryToPerform( ) + throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException); + virtual void clearUp( ) const; + virtual bool checkReady() const; + + /* + * starts the main function. This method will be implemented by any sub-class. + * For a Encryptor, it performs encryption operation; + * for a Decryptor, decryption operation is performed. + */ + virtual void startEngine( const com::sun::star::uno::Reference< + com::sun::star::xml::crypto::XXMLEncryptionTemplate >&) + throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException) + {}; + +public: + /* XBlockerMonitor */ + virtual void SAL_CALL setBlockerId( sal_Int32 id ) + throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException); +}; + +#endif + diff --git a/xmlsecurity/source/framework/encryptorimpl.cxx b/xmlsecurity/source/framework/encryptorimpl.cxx new file mode 100644 index 000000000000..e2ba215e21ff --- /dev/null +++ b/xmlsecurity/source/framework/encryptorimpl.cxx @@ -0,0 +1,281 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_xmlsecurity.hxx" + +#include "encryptorimpl.hxx" +#include <com/sun/star/xml/crypto/XXMLEncryptionTemplate.hpp> +#include <com/sun/star/xml/wrapper/XXMLElementWrapper.hpp> +#include <com/sun/star/lang/XMultiServiceFactory.hpp> + +namespace cssu = com::sun::star::uno; +namespace cssl = com::sun::star::lang; +namespace cssxc = com::sun::star::xml::crypto; +namespace cssxw = com::sun::star::xml::wrapper; + +#define SERVICE_NAME "com.sun.star.xml.crypto.sax.Encryptor" +#define IMPLEMENTATION_NAME "com.sun.star.xml.security.framework.EncryptorImpl" + +#define DECLARE_ASCII( SASCIIVALUE ) \ + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SASCIIVALUE ) ) + +EncryptorImpl::EncryptorImpl( const cssu::Reference< cssl::XMultiServiceFactory >& rxMSF) +{ + m_nReferenceId = -1; + mxMSF = rxMSF; +} + +EncryptorImpl::~EncryptorImpl() +{ +} + +bool EncryptorImpl::checkReady() const +/****** EncryptorImpl/checkReady ********************************************* + * + * NAME + * checkReady -- checks the conditions for the encryption. + * + * SYNOPSIS + * bReady = checkReady( ); + * + * FUNCTION + * checks whether all following conditions are satisfied: + * 1. the result listener is ready; + * 2. the EncryptionEngine is ready. + * + * INPUTS + * empty + * + * RESULT + * bReady - true if all conditions are satisfied, false otherwise + * + * HISTORY + * 05.01.2004 - implemented + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ + sal_Int32 nKeyInc = 0; + if (m_nIdOfKeyEC != 0) + { + nKeyInc = 1; + } + + return (m_xResultListener.is() && + (m_nReferenceId != -1) && + (2+nKeyInc == m_nNumOfResolvedReferences) && + EncryptionEngine::checkReady()); +} + +void EncryptorImpl::notifyResultListener() const + throw (cssu::Exception, cssu::RuntimeException) +/****** DecryptorImpl/notifyResultListener *********************************** + * + * NAME + * notifyResultListener -- notifies the listener about the encryption + * result. + * + * SYNOPSIS + * notifyResultListener( ); + * + * FUNCTION + * see NAME. + * + * INPUTS + * empty + * + * RESULT + * empty + * + * HISTORY + * 05.01.2004 - implemented + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ + cssu::Reference< cssxc::sax::XEncryptionResultListener > + xEncryptionResultListener ( m_xResultListener , cssu::UNO_QUERY ) ; + + xEncryptionResultListener->encrypted( m_nSecurityId, m_nStatus ); +} + +void EncryptorImpl::startEngine( const cssu::Reference< + cssxc::XXMLEncryptionTemplate >& + xEncryptionTemplate) + throw (cssu::Exception, cssu::RuntimeException) +/****** EncryptorImpl/startEngine ******************************************** + * + * NAME + * startEngine -- generates the encryption. + * + * SYNOPSIS + * startEngine( xEncryptionTemplate ); + * + * FUNCTION + * generates the encryption element, then if succeeds, updates the link + * of old template element to the new encryption element in + * SAXEventKeeper. + * + * INPUTS + * xEncryptionTemplate - the encryption template to be encrypted. + * + * RESULT + * empty + * + * HISTORY + * 05.01.2004 - implemented + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ + cssu::Reference < cssxc::XXMLEncryptionTemplate > xResultTemplate; + + cssu::Reference< cssxw::XXMLElementWrapper > + xXMLElement = m_xSAXEventKeeper->getElement( m_nReferenceId ); + xEncryptionTemplate->setTarget(xXMLElement); + + try + { + xResultTemplate = m_xXMLEncryption->encrypt( + xEncryptionTemplate, m_xSecurityEnvironment); + m_nStatus = xResultTemplate->getStatus(); + } + catch( cssu::Exception& ) + { + m_nStatus = cssxc::SecurityOperationStatus_RUNTIMEERROR_FAILED; + } + + if (m_nStatus == cssxc::SecurityOperationStatus_OPERATION_SUCCEEDED) + { + cssu::Reference < cssxw::XXMLElementWrapper > xResultEncryption + = xResultTemplate->getTemplate(); + m_xSAXEventKeeper->setElement(m_nIdOfTemplateEC, xResultEncryption); + m_xSAXEventKeeper->setElement(m_nReferenceId, NULL); + } +} + +/* XReferenceCollector */ +void SAL_CALL EncryptorImpl::setReferenceCount(sal_Int32) + throw (cssu::Exception, cssu::RuntimeException) +{ + /* + * dummp method, because there is only one reference in + * encryption, different from signature. + * so the referenceNumber is always 1 + */ +} + +void SAL_CALL EncryptorImpl::setReferenceId( sal_Int32 id ) + throw (cssu::Exception, cssu::RuntimeException) +{ + m_nReferenceId = id; +} + +/* XEncryptionResultBroadcaster */ +void SAL_CALL EncryptorImpl::addEncryptionResultListener( const cssu::Reference< cssxc::sax::XEncryptionResultListener >& listener ) + throw (cssu::Exception, cssu::RuntimeException) +{ + m_xResultListener = listener; + tryToPerform(); +} + +void SAL_CALL EncryptorImpl::removeEncryptionResultListener( const cssu::Reference< cssxc::sax::XEncryptionResultListener >&) + throw (cssu::RuntimeException) +{ +} + +/* XInitialization */ +void SAL_CALL EncryptorImpl::initialize( const cssu::Sequence< cssu::Any >& aArguments ) + throw (cssu::Exception, cssu::RuntimeException) +{ + OSL_ASSERT(aArguments.getLength() == 5); + + rtl::OUString ouTempString; + + aArguments[0] >>= ouTempString; + m_nSecurityId = ouTempString.toInt32(); + aArguments[1] >>= m_xSAXEventKeeper; + aArguments[2] >>= ouTempString; + m_nIdOfTemplateEC = ouTempString.toInt32(); + aArguments[3] >>= m_xSecurityEnvironment; + aArguments[4] >>= m_xXMLEncryption; +} + + +rtl::OUString EncryptorImpl_getImplementationName () + throw (cssu::RuntimeException) +{ + return rtl::OUString ( RTL_CONSTASCII_USTRINGPARAM ( IMPLEMENTATION_NAME ) ); +} + +sal_Bool SAL_CALL EncryptorImpl_supportsService( const rtl::OUString& ServiceName ) + throw (cssu::RuntimeException) +{ + return ServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( SERVICE_NAME )); +} + +cssu::Sequence< rtl::OUString > SAL_CALL EncryptorImpl_getSupportedServiceNames( ) + throw (cssu::RuntimeException) +{ + cssu::Sequence < rtl::OUString > aRet(1); + rtl::OUString* pArray = aRet.getArray(); + pArray[0] = rtl::OUString ( RTL_CONSTASCII_USTRINGPARAM ( SERVICE_NAME ) ); + return aRet; +} +#undef SERVICE_NAME + +cssu::Reference< cssu::XInterface > SAL_CALL EncryptorImpl_createInstance( + const cssu::Reference< cssl::XMultiServiceFactory >& rSMgr) + throw( cssu::Exception ) +{ + return (cppu::OWeakObject*) new EncryptorImpl(rSMgr); +} + +/* XServiceInfo */ +rtl::OUString SAL_CALL EncryptorImpl::getImplementationName( ) + throw (cssu::RuntimeException) +{ + return EncryptorImpl_getImplementationName(); +} +sal_Bool SAL_CALL EncryptorImpl::supportsService( const rtl::OUString& rServiceName ) + throw (cssu::RuntimeException) +{ + return EncryptorImpl_supportsService( rServiceName ); +} +cssu::Sequence< rtl::OUString > SAL_CALL EncryptorImpl::getSupportedServiceNames( ) + throw (cssu::RuntimeException) +{ + return EncryptorImpl_getSupportedServiceNames(); +} + diff --git a/xmlsecurity/source/framework/encryptorimpl.hxx b/xmlsecurity/source/framework/encryptorimpl.hxx new file mode 100644 index 000000000000..e80540ee9066 --- /dev/null +++ b/xmlsecurity/source/framework/encryptorimpl.hxx @@ -0,0 +1,150 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _ENCRYPTORIMPL_HXX +#define _ENCRYPTORIMPL_HXX + +#include <com/sun/star/xml/crypto/sax/XEncryptionResultBroadcaster.hpp> +#include <com/sun/star/xml/crypto/sax/XEncryptionResultListener.hpp> +#ifndef _COM_SUN_STAR_XML_CRYPTO_SAX_XSIGNATURECOLLECTOR_HPP_ +#include <com/sun/star/xml/crypto/sax/XReferenceCollector.hpp> +#endif +#include <com/sun/star/xml/crypto/XSecurityEnvironment.hpp> +#include <com/sun/star/lang/XInitialization.hpp> +#include <com/sun/star/lang/XServiceInfo.hpp> +#include <cppuhelper/implbase4.hxx> + +#include "encryptionengine.hxx" + +class EncryptorImpl : public cppu::ImplInheritanceHelper4 +< + EncryptionEngine, + com::sun::star::xml::crypto::sax::XEncryptionResultBroadcaster, + com::sun::star::xml::crypto::sax::XReferenceCollector, + com::sun::star::lang::XInitialization, + com::sun::star::lang::XServiceInfo +> +/****** EncryptorImpl.hxx/CLASS EncryptorImpl ********************************* + * + * NAME + * EncryptorImpl -- generates an encryption + * + * FUNCTION + * Collects all resources for an encryption generation, then generates the + * encryption by invoking a xmlsec-based encryption bridge component. + * + * HISTORY + * 05.01.2004 - Interface supported: XInitialization, XServiceInfo + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ +private: + /* + * the Id of the encryption, which is used for the result listener to + * identify the encryption. + */ + sal_Int32 m_nEncryptionId; + + /* + * the Id of the element to be encrypted. + */ + sal_Int32 m_nReferenceId; + + /* + * the decryption result, + * remembers whether the encryption succeeds. + */ + bool m_bEncryptionSucceed; + + com::sun::star::uno::Reference< + com::sun::star::xml::crypto::XSecurityEnvironment > m_xSecurityEnvironment; + + virtual void notifyResultListener() const + throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException); + virtual bool checkReady() const; + virtual void startEngine( const com::sun::star::uno::Reference< + com::sun::star::xml::crypto::XXMLEncryptionTemplate >& + xEncryptionTemplate) + throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException); + +public: + explicit EncryptorImpl( const com::sun::star::uno::Reference< + com::sun::star::lang::XMultiServiceFactory >& rxMSF); + virtual ~EncryptorImpl(); + + /* XEncryptionResultBroadcaster */ + virtual void SAL_CALL addEncryptionResultListener( + const com::sun::star::uno::Reference< + com::sun::star::xml::crypto::sax::XEncryptionResultListener >& + listener ) + throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeEncryptionResultListener( + const com::sun::star::uno::Reference< + com::sun::star::xml::crypto::sax::XEncryptionResultListener >& + listener ) + throw (com::sun::star::uno::RuntimeException); + + /* XReferenceCollector */ + virtual void SAL_CALL setReferenceCount( sal_Int32 count ) + throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL setReferenceId( sal_Int32 id ) + throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException); + + /* XInitialization */ + virtual void SAL_CALL initialize( + const com::sun::star::uno::Sequence< com::sun::star::uno::Any >& aArguments ) + throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException); + + /* XServiceInfo */ + virtual rtl::OUString SAL_CALL getImplementationName( ) + throw (com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL supportsService( const rtl::OUString& ServiceName ) + throw (com::sun::star::uno::RuntimeException); + virtual com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames( ) + throw (com::sun::star::uno::RuntimeException); +}; + +rtl::OUString EncryptorImpl_getImplementationName() + throw ( com::sun::star::uno::RuntimeException ); + +sal_Bool SAL_CALL EncryptorImpl_supportsService( const rtl::OUString& ServiceName ) + throw ( com::sun::star::uno::RuntimeException ); + +com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL EncryptorImpl_getSupportedServiceNames( ) + throw ( com::sun::star::uno::RuntimeException ); + +com::sun::star::uno::Reference< com::sun::star::uno::XInterface > +SAL_CALL EncryptorImpl_createInstance( + const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& rSMgr) + throw ( com::sun::star::uno::Exception ); + +#endif + diff --git a/xmlsecurity/source/framework/makefile.mk b/xmlsecurity/source/framework/makefile.mk new file mode 100644 index 000000000000..54c1fb507df4 --- /dev/null +++ b/xmlsecurity/source/framework/makefile.mk @@ -0,0 +1,61 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2000, 2010 Oracle and/or its affiliates. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# This file is part of OpenOffice.org. +# +# OpenOffice.org is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License version 3 +# only, as published by the Free Software Foundation. +# +# OpenOffice.org is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License version 3 for more details +# (a copy is included in the LICENSE file that accompanied this code). +# +# You should have received a copy of the GNU Lesser General Public License +# version 3 along with OpenOffice.org. If not, see +# <http://www.openoffice.org/license.html> +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +PRJ=..$/.. + +PRJNAME = xmlsecurity +TARGET = fw + +ENABLE_EXCEPTIONS = TRUE + +# --- Settings ----------------------------------------------------- + +.INCLUDE : settings.mk +.INCLUDE : $(PRJ)$/util$/target.pmk + + +# --- Files -------------------------------------------------------- +SLOFILES= \ + $(SLO)$/buffernode.obj \ + $(SLO)$/elementcollector.obj \ + $(SLO)$/elementmark.obj \ + $(SLO)$/securityengine.obj \ + $(SLO)$/signatureengine.obj \ + $(SLO)$/encryptionengine.obj \ + $(SLO)$/signaturecreatorimpl.obj \ + $(SLO)$/signatureverifierimpl.obj \ + $(SLO)$/encryptorimpl.obj \ + $(SLO)$/decryptorimpl.obj \ + $(SLO)$/saxeventkeeperimpl.obj \ + $(SLO)$/xmlencryptiontemplateimpl.obj \ + $(SLO)$/xmlsignaturetemplateimpl.obj \ + $(SLO)$/xsec_framework.obj + +# --- Targets ------------------------------------------------------ + +.INCLUDE : target.mk + diff --git a/xmlsecurity/source/framework/saxeventkeeperimpl.cxx b/xmlsecurity/source/framework/saxeventkeeperimpl.cxx new file mode 100644 index 000000000000..d5779e623522 --- /dev/null +++ b/xmlsecurity/source/framework/saxeventkeeperimpl.cxx @@ -0,0 +1,1463 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_xmlsecurity.hxx" + +#include "saxeventkeeperimpl.hxx" +#include <com/sun/star/lang/XMultiServiceFactory.hpp> +#include <com/sun/star/xml/sax/XDocumentHandler.hpp> +#include <com/sun/star/xml/crypto/sax/ConstOfSecurityId.hpp> + +namespace cssu = com::sun::star::uno; +namespace cssl = com::sun::star::lang; +namespace cssxc = com::sun::star::xml::crypto; +namespace cssxcsax = com::sun::star::xml::csax; +namespace cssxw = com::sun::star::xml::wrapper; +namespace cssxs = com::sun::star::xml::sax; + +#define SERVICE_NAME "com.sun.star.xml.crypto.sax.SAXEventKeeper" +#define IMPLEMENTATION_NAME "com.sun.star.xml.security.framework.SAXEventKeeperImpl" + +#define _USECOMPRESSEDDOCUMENTHANDLER + +SAXEventKeeperImpl::SAXEventKeeperImpl( ) + :m_pRootBufferNode(NULL), + m_pCurrentBufferNode(NULL), + m_nNextElementMarkId(1), + m_pNewBlocker(NULL), + m_pCurrentBlockingBufferNode(NULL), + m_bIsReleasing(false), + m_bIsForwarding(false) +{ + m_vElementMarkBuffers.reserve(2); + m_vNewElementCollectors.reserve(2); + m_vReleasedElementMarkBuffers.reserve(2); +} + +SAXEventKeeperImpl::~SAXEventKeeperImpl() +{ + /* + * delete the BufferNode tree + */ + if (m_pRootBufferNode != NULL) + { + m_pRootBufferNode->freeAllChildren(); + delete m_pRootBufferNode; + } + + m_pRootBufferNode = m_pCurrentBufferNode = m_pCurrentBlockingBufferNode = NULL; + + /* + * delete all unfreed ElementMarks + */ + m_vNewElementCollectors.clear(); + m_pNewBlocker = NULL; + + std::vector< const ElementMark* >::const_iterator ii = m_vElementMarkBuffers.begin(); + for( ; ii != m_vElementMarkBuffers.end(); ++ii ) + { + delete (*ii); + } + m_vElementMarkBuffers.clear(); +} + +void SAXEventKeeperImpl::setCurrentBufferNode(BufferNode* pBufferNode) +/****** SAXEventKeeperImpl/setCurrentBufferNode ****************************** + * + * NAME + * setCurrentBufferNode -- set a new active BufferNode. + * + * SYNOPSIS + * setCurrentBufferNode( pBufferNode ); + * + * FUNCTION + * connects this BufferNode into the BufferNode tree as a child of the + * current active BufferNode. Then makes this BufferNode as the current + * active BufferNode. + * If the previous active BufferNode points to the root + * BufferNode, which means that no buffering operation was proceeding, + * then notifies the status change listener that buffering operation + * will begin at once. + * + * INPUTS + * pBufferNode - a BufferNode which will be the new active BufferNode + * + * RESULT + * empty + * + * HISTORY + * 05.01.2004 - implemented + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ + if (pBufferNode != m_pCurrentBufferNode) + { + if ( m_pCurrentBufferNode == m_pRootBufferNode && + m_xSAXEventKeeperStatusChangeListener.is()) + { + m_xSAXEventKeeperStatusChangeListener->collectionStatusChanged(sal_True); + } + + if (pBufferNode->getParent() == NULL) + { + m_pCurrentBufferNode->addChild(pBufferNode); + pBufferNode->setParent(m_pCurrentBufferNode); + } + + m_pCurrentBufferNode = pBufferNode; + } +} + +BufferNode* SAXEventKeeperImpl::addNewElementMarkBuffers() +/****** SAXEventKeeperImpl/addNewElementMarkBuffers ************************** + * + * NAME + * addNewElementMarkBuffers -- add new ElementCollectors and new Blocker. + * + * SYNOPSIS + * pBufferNode = addNewElementMarkBuffers( ); + * + * FUNCTION + * if there are new ElementCollector or new Blocker to be added, then + * connect all of them with the current BufferNode. In case of the + * current BufferNode doesn't exist, creates one. + * Clears up the new ElementCollector list and the new Blocker pointer. + * + * INPUTS + * empty + * + * RESULT + * pBufferNode - the BufferNode that has been connected with both new + * ElementCollectors and new Blocker. + * + * HISTORY + * 05.01.2004 - implemented + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ + BufferNode* pBufferNode = NULL; + + if ( (m_vNewElementCollectors.size()>0) || + (m_pNewBlocker != NULL)) + { + /* + * When the current BufferNode is right pointing to the current + * working element in the XMLDocumentWrapper component, then + * no new BufferNode is needed to create. + * This situation can only happen in the "Forwarding" mode. + */ + if ( (m_pCurrentBufferNode != NULL) && + (m_xXMLDocument->isCurrent(m_pCurrentBufferNode->getXMLElement()))) + { + pBufferNode = m_pCurrentBufferNode; + } + else + { + pBufferNode = new BufferNode(m_xXMLDocument->getCurrentElement()); + } + + if (m_pNewBlocker != NULL) + { + pBufferNode->setBlocker(m_pNewBlocker); + + /* + * If no blocking before, then notify the status change listener that + * the SAXEventKeeper has entered "blocking" status, during which, no + * SAX events will be forwarded to the next document handler. + */ + if (m_pCurrentBlockingBufferNode == NULL) + { + m_pCurrentBlockingBufferNode = pBufferNode; + + if (m_xSAXEventKeeperStatusChangeListener.is()) + { + m_xSAXEventKeeperStatusChangeListener->blockingStatusChanged(sal_True); + } + } + + m_pNewBlocker = NULL; + } + + if (m_vNewElementCollectors.size()>0) + { + std::vector< const ElementCollector* >::const_iterator ii = m_vNewElementCollectors.begin(); + + for( ; ii != m_vNewElementCollectors.end(); ++ii ) + { + pBufferNode->addElementCollector(*ii); + } + + m_vNewElementCollectors.clear(); + } + } + + return pBufferNode; +} + +ElementMark* SAXEventKeeperImpl::findElementMarkBuffer(sal_Int32 nId) const +/****** SAXEventKeeperImpl/findElementMarkBuffer ***************************** + * + * NAME + * findElementMarkBuffer -- finds an ElementMark. + * + * SYNOPSIS + * pElementMark = findElementMarkBuffer( nId ); + * + * FUNCTION + * searches an ElementMark with the particular Id in the ElementMark + * list. + * + * INPUTS + * nId - the Id of the ElementMark to be searched. + * + * RESULT + * pElementMark - the ElementMark with the particular Id, or NULL when + * no such Id exists. + * + * HISTORY + * 05.01.2004 - implemented + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ + ElementMark* pElementMark = NULL; + + std::vector< const ElementMark* >::const_iterator ii = m_vElementMarkBuffers.begin(); + + for( ; ii != m_vElementMarkBuffers.end(); ++ii ) + { + if ( nId == (*ii)->getBufferId()) + { + pElementMark = (ElementMark*)*ii; + break; + } + } + + return pElementMark; +} + +void SAXEventKeeperImpl::removeElementMarkBuffer(sal_Int32 nId) +/****** SAXEventKeeperImpl/removeElementMarkBuffer *************************** + * + * NAME + * removeElementMarkBuffer -- removes an ElementMark + * + * SYNOPSIS + * removeElementMarkBuffer( nId ); + * + * FUNCTION + * removes an ElementMark with the particular Id in the ElementMark list. + * + * INPUTS + * nId - the Id of the ElementMark to be removed. + * + * RESULT + * empty + * + * HISTORY + * 05.01.2004 - implemented + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ + std::vector< const ElementMark* >::iterator ii = m_vElementMarkBuffers.begin(); + + for( ; ii != m_vElementMarkBuffers.end(); ++ii ) + { + if ( nId == (*ii)->getBufferId()) + { + /* + * checks whether this ElementMark still in the new ElementCollect array + */ + std::vector< const ElementCollector* >::iterator jj = m_vNewElementCollectors.begin(); + for( ; jj != m_vNewElementCollectors.end(); ++jj ) + { + if ((*ii) == (*jj)) + { + m_vNewElementCollectors.erase(jj); + break; + } + } + + /* + * checks whether this ElementMark is the new Blocker + */ + if ((*ii) == m_pNewBlocker) + { + m_pNewBlocker = NULL; + } + + /* + * destory the ElementMark + */ + delete (*ii); + + m_vElementMarkBuffers.erase( ii ); + break; + } + } +} + +rtl::OUString SAXEventKeeperImpl::printBufferNode( + BufferNode* pBufferNode, sal_Int32 nIndent) const +/****** SAXEventKeeperImpl/printBufferNode *********************************** + * + * NAME + * printBufferNode -- retrieves the information of a BufferNode and its + * branch. + * + * SYNOPSIS + * info = printBufferNode( pBufferNode, nIndent ); + * + * FUNCTION + * all retrieved information includes: + * 1. whether it is the current BufferNode; + * 2. whether it is the current blocking BufferNode; + * 3. the name of the parent element; + * 4. the name of this element; + * 5. all ElementCollectors working on this BufferNode; + * 6. the Blocker working on this BufferNode; + * 7. all child BufferNodes' information. + * + * INPUTS + * pBufferNode - the BufferNode from where information will be retrieved. + * nIndent - how many space characters prefixed before the output + * message. + * + * RESULT + * info - the information string + * + * HISTORY + * 05.01.2004 - implemented + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ + rtl::OUString rc; + + for ( int i=0; i<nIndent; ++i ) + { + rc += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( " " )); + } + + if (pBufferNode == m_pCurrentBufferNode) + { + rc += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "[%]" )); + } + + if (pBufferNode == m_pCurrentBlockingBufferNode) + { + rc += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "[B]" )); + } + + rc += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( " " )); + rc += m_xXMLDocument->getNodeName(pBufferNode->getXMLElement()); + + BufferNode* pParent = (BufferNode*)pBufferNode->getParent(); + if (pParent != NULL) + { + rc += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "[" )); + rc += m_xXMLDocument->getNodeName(pParent->getXMLElement()); + rc += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "]" )); + } + + rc += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ":EC=" )); + rc += pBufferNode->printChildren(); + rc += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( " BR=" )); + + ElementMark * pBlocker = pBufferNode->getBlocker(); + if (pBlocker != NULL) + { + rc += rtl::OUString::valueOf( pBlocker->getBufferId() ); + rc += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "(SecId=" )); + rc += rtl::OUString::valueOf( pBlocker->getSecurityId() ); + rc += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ")" )); + rc += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( " " )); + } + rc += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "\n" )); + + std::vector< const BufferNode* >* vChildren = pBufferNode->getChildren(); + std::vector< const BufferNode* >::const_iterator jj = vChildren->begin(); + for( ; jj != vChildren->end(); ++jj ) + { + rc += printBufferNode((BufferNode *)*jj, nIndent+4); + } + + delete vChildren; + + return rc; +} + +cssu::Sequence< cssu::Reference< cssxw::XXMLElementWrapper > > + SAXEventKeeperImpl::collectChildWorkingElement(BufferNode* pBufferNode) const +/****** SAXEventKeeperImpl/collectChildWorkingElement ************************ + * + * NAME + * collectChildWorkingElement -- collects a BufferNode's all child + * Elements. + * + * SYNOPSIS + * list = collectChildWorkingElement( pBufferNode ); + * + * FUNCTION + * see NAME. + * + * INPUTS + * pBufferNode - the BufferNode whose child Elements will be collected. + * + * RESULT + * list - the child Elements list. + * + * HISTORY + * 05.01.2004 - implemented + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ + std::vector< const BufferNode* >* vChildren = pBufferNode->getChildren(); + + cssu::Sequence < cssu::Reference< + cssxw::XXMLElementWrapper > > aChildrenCollection ( vChildren->size()); + + std::vector< const BufferNode* >::const_iterator ii = vChildren->begin(); + + sal_Int32 nIndex = 0; + for( ; ii != vChildren->end(); ++ii ) + { + aChildrenCollection[nIndex] = (*ii)->getXMLElement(); + nIndex++; + } + + delete vChildren; + + return aChildrenCollection; +} + +void SAXEventKeeperImpl::smashBufferNode( + BufferNode* pBufferNode, bool bClearRoot) const +/****** SAXEventKeeperImpl/smashBufferNode *********************************** + * + * NAME + * smashBufferNode -- removes a BufferNode along with its working + * element. + * + * SYNOPSIS + * smashBufferNode( pBufferNode, bClearRoot ); + * + * FUNCTION + * removes the BufferNode's working element from the DOM document, while + * reserves all ancestor paths for its child BufferNodes. + * when any of the BufferNode's ancestor element is useless, removes it + * too. + * removes the BufferNode from the BufferNode tree. + * + * INPUTS + * pBufferNode - the BufferNode to be removed + * bClearRoot - whether the root element also needs to be cleared up. + * + * RESULT + * empty + * + * NOTES + * when removeing a Blocker's BufferNode, the bClearRoot flag should be + * true. Because a Blocker can buffer many SAX events which are not used + * by any other ElementCollector or Blocker. + * When the bClearRoot is set to true, the root BufferNode will be first + * cleared, with a stop flag seting at the next Blocking BufferNode. This + * operation can delete all useless bufferred SAX events which are only + * needed by the Blocker to be deleted. + * + * HISTORY + * 05.01.2004 - implemented + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ + if (!pBufferNode->hasAnything()) + { + BufferNode* pParent = (BufferNode*)pBufferNode->getParent(); + + /* + * delete the XML data + */ + if (pParent == m_pRootBufferNode) + { + bool bIsNotBlocking = (m_pCurrentBlockingBufferNode == NULL); + bool bIsBlockInside = false; + bool bIsBlockingAfterward = false; + + /* + * If this is a blocker, then remove any out-element data + * which caused by blocking. The removal process will stop + * at the next blokcer to avoid removing any useful data. + */ + if (bClearRoot) + { + cssu::Sequence< cssu::Reference< cssxw::XXMLElementWrapper > > + aChildElements = collectChildWorkingElement(m_pRootBufferNode); + + /* + * the clearUselessData only clearup the content in the + * node, not the node itself. + */ + m_xXMLDocument->clearUselessData(m_pRootBufferNode->getXMLElement(), + aChildElements, + bIsNotBlocking?(NULL): + (m_pCurrentBlockingBufferNode->getXMLElement())); + + /* + * remove the node if it is empty, then if its parent is also + * empty, remove it, then if the next parent is also empty, + * remove it,..., until parent become null. + */ + m_xXMLDocument->collapse( m_pRootBufferNode->getXMLElement() ); + } + + /* + * if blocking, check the relationship between this BufferNode and + * the current blocking BufferNode. + */ + if ( !bIsNotBlocking ) + { + /* + * the current blocking BufferNode is a descendant of this BufferNode. + */ + bIsBlockInside = (NULL != pBufferNode->isAncestor(m_pCurrentBlockingBufferNode)); + + /* + * the current blocking BufferNode locates behind this BufferNode in tree + * order. + */ + bIsBlockingAfterward = pBufferNode->isPrevious(m_pCurrentBlockingBufferNode); + } + + /* + * this BufferNode's working element needs to be deleted only when + * 1. there is no blocking, or + * 2. the current blocking BufferNode is a descendant of this BufferNode, + * (then in the BufferNode's working element, the useless data before the blocking + * element should be deleted.) or + * 3. the current blocking BufferNode is locates behind this BufferNode in tree, + * (then the useless data between the blocking element and the working element + * should be deleted.). + * Otherwise, this working element should not be deleted. + */ + if ( bIsNotBlocking || bIsBlockInside || bIsBlockingAfterward ) + { + cssu::Sequence< cssu::Reference< cssxw::XXMLElementWrapper > > + aChildElements = collectChildWorkingElement(pBufferNode); + + /* + * the clearUselessData only clearup the content in the + * node, not the node itself. + */ + m_xXMLDocument->clearUselessData(pBufferNode->getXMLElement(), + aChildElements, + bIsBlockInside?(m_pCurrentBlockingBufferNode->getXMLElement()): + (NULL)); + + /* + * remove the node if it is empty, then if its parent is also + * empty, remove it, then if the next parent is also empty, + * remove it,..., until parent become null. + */ + m_xXMLDocument->collapse( pBufferNode->getXMLElement() ); + } + } + + sal_Int32 nIndex = pParent->indexOfChild(pBufferNode); + + std::vector< const BufferNode* >* vChildren = pBufferNode->getChildren(); + pParent->removeChild(pBufferNode); + pBufferNode->setParent(NULL); + + std::vector< const BufferNode * >::const_iterator ii = vChildren->begin(); + for( ; ii != vChildren->end(); ++ii ) + { + ((BufferNode *)(*ii))->setParent(pParent); + pParent->addChild(*ii, nIndex); + nIndex++; + } + + delete vChildren; + + /* + * delete the BufferNode + */ + delete pBufferNode; + } +} + +BufferNode* SAXEventKeeperImpl::findNextBlockingBufferNode( + BufferNode* pStartBufferNode) const +/****** SAXEventKeeperImpl/findNextBlockingBufferNode ************************ + * + * NAME + * findNextBlockingBufferNode -- finds the next blocking BufferNode + * behind the particular BufferNode. + * + * SYNOPSIS + * pBufferNode = findNextBlockingBufferNode( pStartBufferNode ); + * + * FUNCTION + * see NAME. + * + * INPUTS + * pStartBufferNode - the BufferNode from where to search the next + * blocking BufferNode. + * + * RESULT + * pBufferNode - the next blocking BufferNode, or NULL if no such + * BufferNode exists. + * + * HISTORY + * 05.01.2004 - implemented + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ + BufferNode* pNext = NULL; + + if (pStartBufferNode != NULL) + { + pNext = pStartBufferNode; + + while (NULL != (pNext = (BufferNode*)pNext->getNextNodeByTreeOrder())) + { + if (pNext->getBlocker() != NULL) + { + break; + } + } + } + + return pNext; +} + +void SAXEventKeeperImpl::diffuse(BufferNode* pBufferNode) const +/****** SAXEventKeeperImpl/diffuse ******************************************* + * + * NAME + * diffuse -- diffuse the notification. + * + * SYNOPSIS + * diffuse( pBufferNode ); + * + * FUNCTION + * diffuse the collecting completion notification from the specific + * BufferNode along its parent link, until an ancestor which is not + * completely received is met. + * + * INPUTS + * pBufferNode - the BufferNode from which the notification will be + * diffused. + * + * RESULT + * empty + * + * HISTORY + * 05.01.2004 - implemented + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ + BufferNode* pParent = pBufferNode; + + while(pParent->isAllReceived()) + { + pParent->elementCollectorNotify(); + pParent = (BufferNode*)pParent->getParent(); + } +} + +void SAXEventKeeperImpl::releaseElementMarkBuffer() +/****** SAXEventKeeperImpl/releaseElementMarkBuffer ************************** + * + * NAME + * releaseElementMarkBuffer -- releases useless ElementMarks + * + * SYNOPSIS + * releaseElementMarkBuffer( ); + * + * FUNCTION + * releases each ElementMark in the releasing list + * m_vReleasedElementMarkBuffers. + * The operation differs between an ElementCollector and a Blocker. + * + * INPUTS + * empty + * + * RESULT + * empty + * + * HISTORY + * 05.01.2004 - implemented + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ + m_bIsReleasing = true; + while (m_vReleasedElementMarkBuffers.size()>0) + { + std::vector< sal_Int32 >::iterator pId = m_vReleasedElementMarkBuffers.begin(); + sal_Int32 nId = *pId; + m_vReleasedElementMarkBuffers.erase( pId ); + + ElementMark* pElementMark = findElementMarkBuffer(nId); + + if (pElementMark != NULL) + { + if (cssxc::sax::ElementMarkType_ELEMENTCOLLECTOR + == pElementMark->getType()) + /* + * it is a EC + */ + { + ElementCollector* pElementCollector = (ElementCollector*)pElementMark; + + cssxc::sax::ElementMarkPriority nPriority = pElementCollector->getPriority(); + bool bToModify = pElementCollector->getModify(); + + /* + * Delete the EC from the buffer node. + */ + BufferNode* pBufferNode = pElementCollector->getBufferNode(); + pBufferNode->removeElementCollector(pElementCollector); + + if ( nPriority == cssxc::sax::ElementMarkPriority_BEFOREMODIFY) + { + pBufferNode->notifyBranch(); + } + + if (bToModify) + { + pBufferNode->notifyAncestor(); + } + + /* + * delete the ElementMark + */ + pElementCollector = NULL; + pElementMark = NULL; + removeElementMarkBuffer(nId); + + /* + * delete the BufferNode + */ + diffuse(pBufferNode); + smashBufferNode(pBufferNode, false); + } + else + /* + * it is a Blocker + */ + { + /* + * Delete the TH from the buffer node. + */ + BufferNode *pBufferNode = pElementMark->getBufferNode(); + pBufferNode->setBlocker(NULL); + + /* + * If there is a following handler and no blocking now, then + * forward this event + */ + if (m_pCurrentBlockingBufferNode == pBufferNode) + { + /* + * Before forwarding, the next blocking point needs to be + * found. + */ + m_pCurrentBlockingBufferNode = findNextBlockingBufferNode(pBufferNode); + + /* + * Forward the blocked events between these two STHs. + */ + if (m_xNextHandler.is()) + { + BufferNode* pTempCurrentBufferNode = m_pCurrentBufferNode; + BufferNode* pTempCurrentBlockingBufferNode = m_pCurrentBlockingBufferNode; + + m_pCurrentBufferNode = pBufferNode; + m_pCurrentBlockingBufferNode = NULL; + + m_bIsForwarding = true; + + m_xXMLDocument->generateSAXEvents( + m_xNextHandler, + this, + pBufferNode->getXMLElement(), + (pTempCurrentBlockingBufferNode == NULL)?NULL:(pTempCurrentBlockingBufferNode->getXMLElement())); + + m_bIsForwarding = false; + + m_pCurrentBufferNode = pTempCurrentBufferNode; + if (m_pCurrentBlockingBufferNode == NULL) + { + m_pCurrentBlockingBufferNode = pTempCurrentBlockingBufferNode; + } + } + + if (m_pCurrentBlockingBufferNode == NULL && + m_xSAXEventKeeperStatusChangeListener.is()) + { + m_xSAXEventKeeperStatusChangeListener->blockingStatusChanged(sal_False); + } + } + + /* + * delete the ElementMark + */ + pElementMark = NULL; + removeElementMarkBuffer(nId); + + /* + * delete the BufferNode + */ + diffuse(pBufferNode); + smashBufferNode(pBufferNode, true); + } + } + } + + m_bIsReleasing = false; + + if (!m_pRootBufferNode->hasAnything() && + !m_pRootBufferNode->hasChildren() && + m_xSAXEventKeeperStatusChangeListener.is()) + { + m_xSAXEventKeeperStatusChangeListener->bufferStatusChanged(sal_True); + } +} + +void SAXEventKeeperImpl::markElementMarkBuffer(sal_Int32 nId) +/****** SAXEventKeeperImpl/markElementMarkBuffer ***************************** + * + * NAME + * markElementMarkBuffer -- marks an ElementMark to be released + * + * SYNOPSIS + * markElementMarkBuffer( nId ); + * + * FUNCTION + * puts the ElementMark with the particular Id into the releasing list, + * checks whether the releasing process is runing, if not then launch + * this process. + * + * INPUTS + * nId - the Id of the ElementMark which will be released + * + * RESULT + * empty + * + * HISTORY + * 05.01.2004 - implemented + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ + m_vReleasedElementMarkBuffers.push_back( nId ); + if ( !m_bIsReleasing ) + { + releaseElementMarkBuffer(); + } +} + +sal_Int32 SAXEventKeeperImpl::createElementCollector( + sal_Int32 nSecurityId, + cssxc::sax::ElementMarkPriority nPriority, + bool bModifyElement, + const cssu::Reference< cssxc::sax::XReferenceResolvedListener >& xReferenceResolvedListener) +/****** SAXEventKeeperImpl/createElementCollector **************************** + * + * NAME + * createElementCollector -- creates a new ElementCollector on the + * incoming element. + * + * SYNOPSIS + * nId = createElementCollector( nSecurityId, nPriority, + * bModifyElement, + * xReferenceResolvedListener ); + * + * FUNCTION + * allocs a new Id, then create an ElementCollector with this Id value. + * Add the new created ElementCollector to the new ElementCollecotor list. + * + * INPUTS + * nSecurityId - the security Id of the new ElementCollector + * nPriority - the prirority of the new ElementCollector + * bModifyElement -whether this BufferNode will modify the content of + * the corresponding element it works on + * xReferenceResolvedListener - the listener for the new ElementCollector. + * + * RESULT + * nId - the Id of the new ElementCollector + * + * HISTORY + * 05.01.2004 - implemented + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ + sal_Int32 nId = m_nNextElementMarkId; + m_nNextElementMarkId ++; + + ElementCollector* pElementCollector + = new ElementCollector( + nSecurityId, + nId, + nPriority, + bModifyElement, + xReferenceResolvedListener); + + m_vElementMarkBuffers.push_back( pElementCollector ); + + /* + * All the new EC to initial EC array. + */ + m_vNewElementCollectors.push_back( pElementCollector ); + + return nId; +} + + +sal_Int32 SAXEventKeeperImpl::createBlocker(sal_Int32 nSecurityId) +/****** SAXEventKeeperImpl/createBlocker ************************************* + * + * NAME + * createBlocker -- creates a new Blocker on the incoming element. + * + * SYNOPSIS + * nId = createBlocker( nSecurityId ); + * + * FUNCTION + * see NAME. + * + * INPUTS + * nSecurityId - the security Id of the new Blocker + * + * RESULT + * nId - the Id of the new Blocker + * + * HISTORY + * 05.01.2004 - implemented + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ + sal_Int32 nId = m_nNextElementMarkId; + m_nNextElementMarkId ++; + + OSL_ASSERT(m_pNewBlocker == NULL); + + m_pNewBlocker = new ElementMark(nSecurityId, nId); + m_vElementMarkBuffers.push_back( m_pNewBlocker ); + + return nId; +} + +/* XSAXEventKeeper */ +sal_Int32 SAL_CALL SAXEventKeeperImpl::addElementCollector( ) + throw (cssu::RuntimeException) +{ + return createElementCollector( + cssxc::sax::ConstOfSecurityId::UNDEFINEDSECURITYID, + cssxc::sax::ElementMarkPriority_AFTERMODIFY, + false, + NULL); +} + +void SAL_CALL SAXEventKeeperImpl::removeElementCollector( sal_Int32 id ) + throw (cssu::RuntimeException) +{ + markElementMarkBuffer(id); +} + +sal_Int32 SAL_CALL SAXEventKeeperImpl::addBlocker( ) + throw (cssu::RuntimeException) +{ + return createBlocker(cssxc::sax::ConstOfSecurityId::UNDEFINEDSECURITYID); +} + +void SAL_CALL SAXEventKeeperImpl::removeBlocker( sal_Int32 id ) + throw (cssu::RuntimeException) +{ + markElementMarkBuffer(id); +} + +sal_Bool SAL_CALL SAXEventKeeperImpl::isBlocking( ) + throw (cssu::RuntimeException) +{ + return (m_pCurrentBlockingBufferNode != NULL); +} + +cssu::Reference< cssxw::XXMLElementWrapper > SAL_CALL + SAXEventKeeperImpl::getElement( sal_Int32 id ) + throw (cssu::RuntimeException) +{ + cssu::Reference< cssxw::XXMLElementWrapper > rc; + + ElementMark* pElementMark = findElementMarkBuffer(id); + if (pElementMark != NULL) + { + rc = pElementMark->getBufferNode()->getXMLElement(); + } + + return rc; +} + +void SAL_CALL SAXEventKeeperImpl::setElement( + sal_Int32 id, + const cssu::Reference< cssxw::XXMLElementWrapper >& aElement ) + throw (cssu::RuntimeException) +{ + if (aElement.is()) + { + m_xXMLDocument->rebuildIDLink(aElement); + + ElementMark* pElementMark = findElementMarkBuffer(id); + + if (pElementMark != NULL) + { + BufferNode* pBufferNode = pElementMark->getBufferNode(); + if (pBufferNode != NULL) + { + bool bIsCurrent = m_xXMLDocument->isCurrent(pBufferNode->getXMLElement()); + pBufferNode->setXMLElement(aElement); + + if (bIsCurrent) + { + m_xXMLDocument->setCurrentElement(aElement); + } + } + } + } + else + { + removeElementCollector( id ); + } +} + +cssu::Reference< cssxs::XDocumentHandler > SAL_CALL SAXEventKeeperImpl::setNextHandler( + const cssu::Reference< cssxs::XDocumentHandler >& xNewHandler ) + throw (cssu::RuntimeException) +{ + cssu::Reference< cssxs::XDocumentHandler > xOldHandler = m_xNextHandler; + + m_xNextHandler = xNewHandler; + return xOldHandler; +} + +rtl::OUString SAL_CALL SAXEventKeeperImpl::printBufferNodeTree() + throw (cssu::RuntimeException) +{ + rtl::OUString rc; + + rc += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ElementMarkBuffers: size = " )); + rc += rtl::OUString::valueOf((sal_Int32)m_vElementMarkBuffers.size()); + rc += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "\nCurrentBufferNode: " )); + rc += m_xXMLDocument->getNodeName(m_pCurrentBufferNode->getXMLElement()); + rc += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "\n" )); + rc += printBufferNode(m_pRootBufferNode, 0); + + return rc; +} + +cssu::Reference< cssxw::XXMLElementWrapper > SAL_CALL SAXEventKeeperImpl::getCurrentBlockingNode() + throw (cssu::RuntimeException) +{ + cssu::Reference< cssxw::XXMLElementWrapper > rc; + + if (m_pCurrentBlockingBufferNode != NULL) + { + rc = m_pCurrentBlockingBufferNode->getXMLElement(); + } + + return rc; +} + +/* XSecuritySAXEventKeeper */ +sal_Int32 SAL_CALL SAXEventKeeperImpl::addSecurityElementCollector( + cssxc::sax::ElementMarkPriority priority, + sal_Bool modifyElement ) + throw (cssu::RuntimeException) +{ + return createElementCollector( + cssxc::sax::ConstOfSecurityId::UNDEFINEDSECURITYID, + priority, + modifyElement, + NULL); +} + +sal_Int32 SAL_CALL SAXEventKeeperImpl::cloneElementCollector( + sal_Int32 referenceId, + cssxc::sax::ElementMarkPriority priority ) + throw (cssu::RuntimeException) +{ + sal_Int32 nId = -1; + + ElementCollector* pElementCollector = (ElementCollector*)findElementMarkBuffer(referenceId); + if (pElementCollector != NULL) + { + nId = m_nNextElementMarkId; + m_nNextElementMarkId ++; + + ElementCollector* pClonedOne + = pElementCollector->clone(nId, priority); + + /* + * add this EC into the security data buffer array. + */ + m_vElementMarkBuffers.push_back(pClonedOne); + + /* + * If the reference EC is still in initial EC array, add + * this cloned one into the initial EC array too. + */ + if (pElementCollector->getBufferNode() == NULL) + { + m_vNewElementCollectors.push_back(pClonedOne); + } + } + + return nId; +} + +void SAL_CALL SAXEventKeeperImpl::setSecurityId( sal_Int32 id, sal_Int32 securityId ) + throw (cssu::RuntimeException) +{ + ElementMark* pElementMark = findElementMarkBuffer(id); + if (pElementMark != NULL) + { + pElementMark->setSecurityId(securityId); + } +} + + +/* XReferenceResolvedBroadcaster */ +void SAL_CALL SAXEventKeeperImpl::addReferenceResolvedListener( + sal_Int32 referenceId, + const cssu::Reference< cssxc::sax::XReferenceResolvedListener >& listener ) + throw (cssu::RuntimeException) +{ + ElementCollector* pElementCollector = (ElementCollector*)findElementMarkBuffer(referenceId); + if (pElementCollector != NULL) + { + pElementCollector->setReferenceResolvedListener(listener); + } +} + +void SAL_CALL SAXEventKeeperImpl::removeReferenceResolvedListener( + sal_Int32 /*referenceId*/, + const cssu::Reference< cssxc::sax::XReferenceResolvedListener >&) + throw (cssu::RuntimeException) +{ +} + +/* XSAXEventKeeperStatusChangeBroadcaster */ +void SAL_CALL SAXEventKeeperImpl::addSAXEventKeeperStatusChangeListener( + const cssu::Reference< cssxc::sax::XSAXEventKeeperStatusChangeListener >& listener ) + throw (cssu::RuntimeException) +{ + m_xSAXEventKeeperStatusChangeListener = listener; +} + +void SAL_CALL SAXEventKeeperImpl::removeSAXEventKeeperStatusChangeListener( + const cssu::Reference< cssxc::sax::XSAXEventKeeperStatusChangeListener >&) + throw (cssu::RuntimeException) +{ +} + +/* XDocumentHandler */ +void SAL_CALL SAXEventKeeperImpl::startDocument( ) + throw (cssxs::SAXException, cssu::RuntimeException) +{ + if ( m_xNextHandler.is()) + { + m_xNextHandler->startDocument(); + } +} + +void SAL_CALL SAXEventKeeperImpl::endDocument( ) + throw (cssxs::SAXException, cssu::RuntimeException) +{ + if ( m_xNextHandler.is()) + { + m_xNextHandler->endDocument(); + } +} + +void SAL_CALL SAXEventKeeperImpl::startElement( + const rtl::OUString& aName, + const cssu::Reference< cssxs::XAttributeList >& xAttribs ) + throw (cssxs::SAXException, cssu::RuntimeException) +{ + /* + * If there is a following handler and no blocking now, then + * forward this event + */ + if ((m_pCurrentBlockingBufferNode == NULL) && + (m_xNextHandler.is()) && + (!m_bIsForwarding) && + (m_pNewBlocker == NULL)) + { + m_xNextHandler->startElement(aName, xAttribs); + } + + /* + * If not forwarding, buffer this startElement. + */ + if (!m_bIsForwarding) + { + #ifndef _USECOMPRESSEDDOCUMENTHANDLER + m_xDocumentHandler->startElement(aName, xAttribs); + #else + sal_Int32 nLength = xAttribs->getLength(); + cssu::Sequence< cssxcsax::XMLAttribute > aAttributes (nLength); + + for ( int i = 0; i<nLength; ++i ) + { + aAttributes[i].sName = xAttribs->getNameByIndex((short)i); + aAttributes[i].sValue =xAttribs->getValueByIndex((short)i); + } + + m_xCompressedDocumentHandler->_startElement(aName, aAttributes); + #endif + + } + + BufferNode* pBufferNode = addNewElementMarkBuffers(); + if (pBufferNode != NULL) + { + setCurrentBufferNode(pBufferNode); + } +} + +void SAL_CALL SAXEventKeeperImpl::endElement( const rtl::OUString& aName ) + throw (cssxs::SAXException, cssu::RuntimeException) +{ + sal_Bool bIsCurrent = m_xXMLDocument->isCurrent(m_pCurrentBufferNode->getXMLElement()); + + /* + * If there is a following handler and no blocking now, then + * forward this event + */ + if ((m_pCurrentBlockingBufferNode == NULL) && + (m_xNextHandler.is()) && + (!m_bIsForwarding)) + { + m_xNextHandler->endElement(aName); + } + + if ((m_pCurrentBlockingBufferNode != NULL) || + (m_pCurrentBufferNode != m_pRootBufferNode) || + (!m_xXMLDocument->isCurrentElementEmpty())) + { + if (!m_bIsForwarding) + { + #ifndef _USECOMPRESSEDDOCUMENTHANDLER + m_xDocumentHandler->endElement(aName); + #else + m_xCompressedDocumentHandler->_endElement(aName); + #endif + } + + /* + * If the current buffer node has not notified yet, and + * the current buffer node is waiting for the current element, + * then let it notify. + */ + if (bIsCurrent && (m_pCurrentBufferNode != m_pRootBufferNode)) + { + BufferNode* pOldCurrentBufferNode = m_pCurrentBufferNode; + m_pCurrentBufferNode = (BufferNode*)m_pCurrentBufferNode->getParent(); + + pOldCurrentBufferNode->setReceivedAll(); + + if ((m_pCurrentBufferNode == m_pRootBufferNode) && + m_xSAXEventKeeperStatusChangeListener.is()) + { + m_xSAXEventKeeperStatusChangeListener->collectionStatusChanged(sal_False); + } + } + } + else + { + if (!m_bIsForwarding) + { + m_xXMLDocument->removeCurrentElement(); + } + } +} + +void SAL_CALL SAXEventKeeperImpl::characters( const rtl::OUString& aChars ) + throw (cssxs::SAXException, cssu::RuntimeException) +{ + if (!m_bIsForwarding) + { + if ((m_pCurrentBlockingBufferNode == NULL) && m_xNextHandler.is()) + { + m_xNextHandler->characters(aChars); + } + + if ((m_pCurrentBlockingBufferNode != NULL) || + (m_pCurrentBufferNode != m_pRootBufferNode)) + { + #ifndef _USECOMPRESSEDDOCUMENTHANDLER + m_xDocumentHandler->characters(aChars); + #else + m_xCompressedDocumentHandler->_characters(aChars); + #endif + } + } +} + +void SAL_CALL SAXEventKeeperImpl::ignorableWhitespace( const rtl::OUString& aWhitespaces ) + throw (cssxs::SAXException, cssu::RuntimeException) +{ + characters( aWhitespaces ); +} + +void SAL_CALL SAXEventKeeperImpl::processingInstruction( + const rtl::OUString& aTarget, const rtl::OUString& aData ) + throw (cssxs::SAXException, cssu::RuntimeException) +{ + if (!m_bIsForwarding) + { + if ((m_pCurrentBlockingBufferNode == NULL) && m_xNextHandler.is()) + { + m_xNextHandler->processingInstruction(aTarget, aData); + } + + if ((m_pCurrentBlockingBufferNode != NULL) || + (m_pCurrentBufferNode != m_pRootBufferNode)) + { + #ifndef _USECOMPRESSEDDOCUMENTHANDLER + m_xDocumentHandler->processingInstruction(aTarget, aData); + #else + m_xCompressedDocumentHandler->_processingInstruction(aTarget, aData); + #endif + } + } +} + +void SAL_CALL SAXEventKeeperImpl::setDocumentLocator( const cssu::Reference< cssxs::XLocator >&) + throw (cssxs::SAXException, cssu::RuntimeException) +{ +} + +/* XInitialization */ +void SAL_CALL SAXEventKeeperImpl::initialize( const cssu::Sequence< cssu::Any >& aArguments ) + throw (cssu::Exception, cssu::RuntimeException) +{ + OSL_ASSERT(aArguments.getLength() == 1); + + aArguments[0] >>= m_xXMLDocument; + m_xDocumentHandler = cssu::Reference< cssxs::XDocumentHandler >( + m_xXMLDocument, cssu::UNO_QUERY ); + m_xCompressedDocumentHandler = cssu::Reference< cssxcsax::XCompressedDocumentHandler >( + m_xXMLDocument, cssu::UNO_QUERY ); + + m_pRootBufferNode = new BufferNode(m_xXMLDocument->getCurrentElement()); + m_pCurrentBufferNode = m_pRootBufferNode; +} + +rtl::OUString SAXEventKeeperImpl_getImplementationName () + throw (cssu::RuntimeException) +{ + return rtl::OUString ( RTL_CONSTASCII_USTRINGPARAM ( IMPLEMENTATION_NAME ) ); +} + +sal_Bool SAL_CALL SAXEventKeeperImpl_supportsService( const rtl::OUString& ServiceName ) + throw (cssu::RuntimeException) +{ + return ServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( SERVICE_NAME )); +} + +cssu::Sequence< rtl::OUString > SAL_CALL SAXEventKeeperImpl_getSupportedServiceNames( ) + throw (cssu::RuntimeException) +{ + cssu::Sequence < rtl::OUString > aRet(1); + rtl::OUString* pArray = aRet.getArray(); + pArray[0] = rtl::OUString ( RTL_CONSTASCII_USTRINGPARAM ( SERVICE_NAME ) ); + return aRet; +} +#undef SERVICE_NAME + +cssu::Reference< cssu::XInterface > SAL_CALL SAXEventKeeperImpl_createInstance( + const cssu::Reference< cssl::XMultiServiceFactory > &) + throw( cssu::Exception ) +{ + return (cppu::OWeakObject*) new SAXEventKeeperImpl(); +} + +/* XServiceInfo */ +rtl::OUString SAL_CALL SAXEventKeeperImpl::getImplementationName( ) + throw (cssu::RuntimeException) +{ + return SAXEventKeeperImpl_getImplementationName(); +} +sal_Bool SAL_CALL SAXEventKeeperImpl::supportsService( const rtl::OUString& rServiceName ) + throw (cssu::RuntimeException) +{ + return SAXEventKeeperImpl_supportsService( rServiceName ); +} +cssu::Sequence< rtl::OUString > SAL_CALL SAXEventKeeperImpl::getSupportedServiceNames( ) + throw (cssu::RuntimeException) +{ + return SAXEventKeeperImpl_getSupportedServiceNames(); +} + diff --git a/xmlsecurity/source/framework/saxeventkeeperimpl.hxx b/xmlsecurity/source/framework/saxeventkeeperimpl.hxx new file mode 100644 index 000000000000..4afe43852f2d --- /dev/null +++ b/xmlsecurity/source/framework/saxeventkeeperimpl.hxx @@ -0,0 +1,369 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SAXEVENTKEEPERIMPL_HXX +#define _SAXEVENTKEEPERIMPL_HXX + +#include <com/sun/star/xml/crypto/sax/XSecuritySAXEventKeeper.hpp> +#include <com/sun/star/xml/crypto/sax/XReferenceResolvedBroadcaster.hpp> +#include <com/sun/star/xml/crypto/sax/XSAXEventKeeperStatusChangeBroadcaster.hpp> +#include <com/sun/star/xml/crypto/sax/XSAXEventKeeperStatusChangeListener.hpp> +#include <com/sun/star/xml/csax/XCompressedDocumentHandler.hpp> +#include <com/sun/star/xml/wrapper/XXMLDocumentWrapper.hpp> +#include <com/sun/star/xml/sax/XDocumentHandler.hpp> +#include <com/sun/star/lang/XInitialization.hpp> +#include <com/sun/star/lang/XServiceInfo.hpp> +#include <cppuhelper/implbase6.hxx> + +#include "buffernode.hxx" +#include "elementmark.hxx" +#include "elementcollector.hxx" + +#ifndef INCLUDED_VECTOR +#include <vector> +#define INCLUDED_VECTOR +#endif + +class SAXEventKeeperImpl : public cppu::WeakImplHelper6 +< + com::sun::star::xml::crypto::sax::XSecuritySAXEventKeeper, + com::sun::star::xml::crypto::sax::XReferenceResolvedBroadcaster, + com::sun::star::xml::crypto::sax::XSAXEventKeeperStatusChangeBroadcaster, + com::sun::star::xml::sax::XDocumentHandler, + com::sun::star::lang::XInitialization, + com::sun::star::lang::XServiceInfo +> +/****** SAXEventKeeperImpl.hxx/CLASS SAXEventKeeperImpl *********************** + * + * NAME + * SAXEventKeeperImpl -- SAX events buffer controller + * + * FUNCTION + * Controls SAX events to be bufferred, and controls bufferred SAX events + * to be released. + * + * HISTORY + * 05.01.2004 - Interface supported: XSecuritySAXEventKeeper, + * XReferenceResolvedBroadcaster, + * XSAXEventKeeperStatusChangeBroadcaster, + * XDocumentHandler, XInitialization, XServiceInfo + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ +private: + /* + * the XMLDocumentWrapper component which maintains all bufferred SAX + * in DOM format. + */ + com::sun::star::uno::Reference< + com::sun::star::xml::wrapper::XXMLDocumentWrapper > + m_xXMLDocument; + + /* + * the document handler provided by the XMLDocumentWrapper component. + */ + com::sun::star::uno::Reference< + com::sun::star::xml::sax::XDocumentHandler > m_xDocumentHandler; + + /* + * the compressed document handler provided by the XMLDocumentWrapper + * component, the handler has more effient method definition that the + * normal document handler. + */ + com::sun::star::uno::Reference< + com::sun::star::xml::csax::XCompressedDocumentHandler > + m_xCompressedDocumentHandler; + + /* + * a listener which receives this SAXEventKeeper's status change + * notification. + * Based on the status changes, the listener can decide whether the + * SAXEventKeeper should chain on/chain off the SAX chain, or whether + * the SAXEventKeeper is useless any long. + */ + com::sun::star::uno::Reference< + com::sun::star::xml::crypto::sax::XSAXEventKeeperStatusChangeListener > + m_xSAXEventKeeperStatusChangeListener; + + /* + * the root node of the BufferNode tree. + * the BufferNode tree is used to keep track of all bufferred elements, + * it has the same structure with the document which maintains those + * elements physically. + */ + BufferNode* m_pRootBufferNode; + + /* + * the current active BufferNode. + * this is used to keep track the current location in the BufferNode tree, + * the next generated BufferNode will become a child BufferNode of it. + */ + BufferNode* m_pCurrentBufferNode; + + /* + * the next Id for a coming ElementMark. + * the variable is increased by 1 when an new ElementMark is generated, + * in this way, we can promise the Id of any ElementMark is unique. + */ + sal_Int32 m_nNextElementMarkId; + + /* + * maintains a collection of all ElementMarks. + */ + std::vector< const ElementMark* > m_vElementMarkBuffers; + + /* + * maintains a list of new ElementCollectors that will be created + * on the element represented by the next incoming startElement SAX + * event. + * The reason that such the m_vNewElementCollectors is necessary + * is: when an ElementCollector is asked to create, it can't be + * created completely at once, because the BufferNode it will be + * working on has not been created until the next startElement + * SAX event comes. + */ + std::vector< const ElementCollector* > m_vNewElementCollectors; + + /* + * maintains the new Blocker that will be created + * on the element represented by the next incoming startElement SAX + * event. + */ + ElementMark* m_pNewBlocker; + + /* + * the document handler to which all received SAX events will be + * forwarded. + */ + com::sun::star::uno::Reference< + com::sun::star::xml::sax::XDocumentHandler > m_xNextHandler; + + /* + * the current BufferNode which prevents the SAX events to be + * forwarded to the m_xNextHandler. + */ + BufferNode* m_pCurrentBlockingBufferNode; + + /* + * maintains a list of ElementMark that has been asked to release. + * Because during processing a request of releasing an ElementMark, + * another releasing ElementMark request can be invoked. To avoid + * reentering the same method, a such request only add that ElementMark + * into this ElementMark list, then all ElementMarks will be processed in + * order. + */ + std::vector< sal_Int32 > m_vReleasedElementMarkBuffers; + + /* + * a flag to indicate whether the ElementMark releasing process is runing. + * When a releasing request comes, the assigned ElementMark is added to + * the m_vReleasedElementMarkBuffers first, then this flag is checked. + * If the ElementMark releasing process is not running, then call that + * method. + */ + bool m_bIsReleasing; + + /* + * a flag to indicate whether it is the "Forwarding" mode now. + * A "Forwarding" mode means that all received SAX events are from the + * XMLDocumentWrapper component, instead of up-stream component in the + * SAX chain. + * The difference between "Forwarding" mode and normal mode is that: + * no SAX events need to be transferred to the XMLDocumentWrapper component + * again even if a buffer request happens. + */ + bool m_bIsForwarding; + + void setCurrentBufferNode(BufferNode* pBufferNode); + + BufferNode* addNewElementMarkBuffers(); + + ElementMark* findElementMarkBuffer(sal_Int32 nId) const; + + void removeElementMarkBuffer(sal_Int32 nId); + + rtl::OUString printBufferNode( + BufferNode* pBufferNode, sal_Int32 nIndent) const; + + com::sun::star::uno::Sequence< com::sun::star::uno::Reference< + com::sun::star::xml::wrapper::XXMLElementWrapper > > + collectChildWorkingElement(BufferNode* pBufferNode) const; + + void smashBufferNode( + BufferNode* pBufferNode, bool bClearRoot) const; + + BufferNode* findNextBlockingBufferNode( + BufferNode* pStartBufferNode) const; + + void diffuse(BufferNode* pBufferNode) const; + + void releaseElementMarkBuffer(); + + void markElementMarkBuffer(sal_Int32 nId); + + sal_Int32 createElementCollector( + sal_Int32 nSecurityId, + com::sun::star::xml::crypto::sax::ElementMarkPriority nPriority, + bool bModifyElement, + const com::sun::star::uno::Reference< + com::sun::star::xml::crypto::sax::XReferenceResolvedListener>& + xReferenceResolvedListener); + + sal_Int32 createBlocker(sal_Int32 nSecurityId); + +public: + SAXEventKeeperImpl(); + virtual ~SAXEventKeeperImpl(); + + /* XSAXEventKeeper */ + virtual sal_Int32 SAL_CALL addElementCollector( ) + throw (com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeElementCollector( sal_Int32 id ) + throw (com::sun::star::uno::RuntimeException); + virtual sal_Int32 SAL_CALL addBlocker( ) + throw (com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeBlocker( sal_Int32 id ) + throw (com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL isBlocking( ) + throw (com::sun::star::uno::RuntimeException); + virtual com::sun::star::uno::Reference< + com::sun::star::xml::wrapper::XXMLElementWrapper > SAL_CALL + getElement( sal_Int32 id ) + throw (com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setElement( + sal_Int32 id, + const com::sun::star::uno::Reference< + com::sun::star::xml::wrapper::XXMLElementWrapper >& + aElement ) + throw (com::sun::star::uno::RuntimeException); + virtual com::sun::star::uno::Reference< + com::sun::star::xml::sax::XDocumentHandler > SAL_CALL + setNextHandler( const com::sun::star::uno::Reference< + com::sun::star::xml::sax::XDocumentHandler >& xNewHandler ) + throw (com::sun::star::uno::RuntimeException); + virtual rtl::OUString SAL_CALL printBufferNodeTree() + throw (com::sun::star::uno::RuntimeException); + virtual com::sun::star::uno::Reference< + com::sun::star::xml::wrapper::XXMLElementWrapper > SAL_CALL + getCurrentBlockingNode() + throw (com::sun::star::uno::RuntimeException); + + /* XSecuritySAXEventKeeper */ + virtual sal_Int32 SAL_CALL addSecurityElementCollector( + com::sun::star::xml::crypto::sax::ElementMarkPriority priority, + sal_Bool modifyElement ) + throw (com::sun::star::uno::RuntimeException); + virtual sal_Int32 SAL_CALL cloneElementCollector( + sal_Int32 referenceId, + com::sun::star::xml::crypto::sax::ElementMarkPriority priority ) + throw (com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setSecurityId( sal_Int32 id, sal_Int32 securityId ) + throw (com::sun::star::uno::RuntimeException); + + /* XReferenceResolvedBroadcaster */ + virtual void SAL_CALL addReferenceResolvedListener( + sal_Int32 referenceId, + const com::sun::star::uno::Reference< + com::sun::star::xml::crypto::sax::XReferenceResolvedListener >& + listener ) + throw (com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeReferenceResolvedListener( + sal_Int32 referenceId, + const com::sun::star::uno::Reference< + com::sun::star::xml::crypto::sax::XReferenceResolvedListener >& + listener ) + throw (com::sun::star::uno::RuntimeException); + + /* XSAXEventKeeperStatusChangeBroadcaster */ + virtual void SAL_CALL addSAXEventKeeperStatusChangeListener( + const com::sun::star::uno::Reference< + com::sun::star::xml::crypto::sax::XSAXEventKeeperStatusChangeListener >& + listener ) + throw (com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeSAXEventKeeperStatusChangeListener( + const com::sun::star::uno::Reference< + com::sun::star::xml::crypto::sax::XSAXEventKeeperStatusChangeListener >& + listener ) + throw (com::sun::star::uno::RuntimeException); + + /* XDocumentHandler */ + virtual void SAL_CALL startDocument( ) + throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException); + virtual void SAL_CALL endDocument( ) + throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException); + virtual void SAL_CALL startElement( + const rtl::OUString& aName, + const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& + xAttribs ) + throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException); + virtual void SAL_CALL endElement( const rtl::OUString& aName ) + throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException); + virtual void SAL_CALL characters( const rtl::OUString& aChars ) + throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException); + virtual void SAL_CALL ignorableWhitespace( const rtl::OUString& aWhitespaces ) + throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException); + virtual void SAL_CALL processingInstruction( + const rtl::OUString& aTarget, const rtl::OUString& aData ) + throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setDocumentLocator( + const com::sun::star::uno::Reference< com::sun::star::xml::sax::XLocator >& xLocator ) + throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException); + + /* XInitialization */ + virtual void SAL_CALL initialize( + const com::sun::star::uno::Sequence< com::sun::star::uno::Any >& aArguments ) + throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException); + + /* XServiceInfo */ + virtual rtl::OUString SAL_CALL getImplementationName( ) + throw (com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL supportsService( const rtl::OUString& ServiceName ) + throw (com::sun::star::uno::RuntimeException); + virtual com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames( ) + throw (com::sun::star::uno::RuntimeException); +}; + +rtl::OUString SAXEventKeeperImpl_getImplementationName() + throw ( com::sun::star::uno::RuntimeException ); + +sal_Bool SAL_CALL SAXEventKeeperImpl_supportsService( const rtl::OUString& ServiceName ) + throw ( com::sun::star::uno::RuntimeException ); + +com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL SAXEventKeeperImpl_getSupportedServiceNames( ) + throw ( com::sun::star::uno::RuntimeException ); + +com::sun::star::uno::Reference< com::sun::star::uno::XInterface > +SAL_CALL SAXEventKeeperImpl_createInstance( const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > & rSMgr) + throw ( com::sun::star::uno::Exception ); + +#endif + + + diff --git a/xmlsecurity/source/framework/securityengine.cxx b/xmlsecurity/source/framework/securityengine.cxx new file mode 100644 index 000000000000..eac5e4189565 --- /dev/null +++ b/xmlsecurity/source/framework/securityengine.cxx @@ -0,0 +1,88 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_xmlsecurity.hxx" + +#include "securityengine.hxx" +#include <com/sun/star/lang/XMultiServiceFactory.hpp> + +namespace cssu = com::sun::star::uno; +namespace cssl = com::sun::star::lang; +namespace cssxc = com::sun::star::xml::crypto; +namespace cssxw = com::sun::star::xml::wrapper; + +#define DECLARE_ASCII( SASCIIVALUE ) \ + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SASCIIVALUE ) ) + +SecurityEngine::SecurityEngine( const cssu::Reference< cssl::XMultiServiceFactory >& rxMSF ) + :mxMSF( rxMSF ), + m_nIdOfTemplateEC(-1), + m_nNumOfResolvedReferences(0), + m_nIdOfKeyEC(-1), + m_bMissionDone(false), + m_nSecurityId(-1), + m_nStatus(::com::sun::star::xml::crypto::SecurityOperationStatus_UNKNOWN) +{ +} + +/* XReferenceResolvedListener */ +void SAL_CALL SecurityEngine::referenceResolved( sal_Int32 /*referenceId*/) + throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException) +{ + m_nNumOfResolvedReferences++; + tryToPerform(); +} + +/* XKeyCollector */ +void SAL_CALL SecurityEngine::setKeyId( sal_Int32 id ) + throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException) +{ + m_nIdOfKeyEC = id; + tryToPerform(); +} + +/* XMissionTaker */ +sal_Bool SAL_CALL SecurityEngine::endMission( ) + throw (com::sun::star::uno::RuntimeException) +{ + sal_Bool rc = m_bMissionDone; + + if (!rc) + { + clearUp( ); + + notifyResultListener(); + m_bMissionDone = true; + } + + m_xResultListener = NULL; + m_xSAXEventKeeper = NULL; + + return rc; +} + diff --git a/xmlsecurity/source/framework/securityengine.hxx b/xmlsecurity/source/framework/securityengine.hxx new file mode 100644 index 000000000000..c5c9e84977ea --- /dev/null +++ b/xmlsecurity/source/framework/securityengine.hxx @@ -0,0 +1,172 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SECURITYENGINE_HXX +#define _SECURITYENGINE_HXX + +#include <com/sun/star/xml/crypto/sax/XReferenceResolvedListener.hpp> +#include <com/sun/star/xml/crypto/sax/XReferenceResolvedBroadcaster.hpp> +#include <com/sun/star/xml/crypto/sax/XKeyCollector.hpp> +#include <com/sun/star/xml/crypto/sax/XMissionTaker.hpp> +#include <com/sun/star/xml/crypto/sax/XSAXEventKeeper.hpp> +#include <com/sun/star/xml/crypto/XXMLSignature.hpp> + +#include <cppuhelper/implbase3.hxx> + +class SecurityEngine : public cppu::WeakImplHelper3 +< + com::sun::star::xml::crypto::sax::XReferenceResolvedListener, + com::sun::star::xml::crypto::sax::XKeyCollector, + com::sun::star::xml::crypto::sax::XMissionTaker +> +/****** securityengine.hxx/CLASS SecurityEngine ******************************* + * + * NAME + * SecurityEngine -- Base class of SignatureEngine and EncryptionEngine + * + * FUNCTION + * Maintains common members and methods related with security engine + * operation. + * + * HISTORY + * 05.01.2004 - Interface supported: XReferenceResolvedListener, + * XKeyCollector, and XMissionTaker + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ +protected: + com::sun::star::uno::Reference< + com::sun::star::lang::XMultiServiceFactory > mxMSF; + + /* + * A SAXEventKeeper internally maintians all resources that a security + * operation needs. The m_xSAXEventKeeper member is used to release + * those resources when the security operation finishes. + */ + com::sun::star::uno::Reference< + com::sun::star::xml::crypto::sax::XSAXEventKeeper > m_xSAXEventKeeper; + + /* + * the id of ElementCollector of the template element. + * For a signature, the template element is the Signature element, + * for a encryption, the EncryptedData/EncryptedKey element is. + */ + sal_Int32 m_nIdOfTemplateEC; + + /* + * remembers how many referenced elements have been bufferred completely, + * including the key element, template element, and referenced element of + * signature. + */ + sal_Int32 m_nNumOfResolvedReferences; + + /* + * the id of ElementCollector of the key element. + * If a Signature element or EncryptedData/EncryptedKey element has + * an internal key sub-element, then this member should be -1 + */ + sal_Int32 m_nIdOfKeyEC; + + /* + * remembers whether the current opertion has finished. + */ + bool m_bMissionDone; + + /* + * the Id of the security entity, a signature or encryption, which is used for + * the result listener to identify the entity. + */ + sal_Int32 m_nSecurityId; + + /* + * the status of the operation + */ + //bool m_bOperationSucceed; + com::sun::star::xml::crypto::SecurityOperationStatus m_nStatus; + + /* + * the result listener, which will receives the security operation result. + */ + com::sun::star::uno::Reference< + com::sun::star::uno::XInterface > + m_xResultListener; + +protected: + explicit SecurityEngine( const com::sun::star::uno::Reference< + com::sun::star::lang::XMultiServiceFactory >& rxMSF = NULL ); + virtual ~SecurityEngine() {}; + + /* + * perform the security operation. + * Any derived class will implement this method respectively. + */ + virtual void tryToPerform( ) + throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException){}; + + /* + * clear up all resources used by this operation. + * This method is called after the operation finishes, or a End-Your-Mission + * message is received. + * Any derived class will implement this method respectively. + */ + virtual void clearUp( ) const {}; + + /* + * notifies any possible result listener. + * When verify a signature or conduct a decryption, the operation result will + * be transferred to a listener by this method. + * Any derived class will implement this method respectively. + */ + virtual void notifyResultListener() const + throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException) + {}; + + /* + * checks whether everything is ready. + * Any derived class will implement this method respectively. + */ + virtual bool checkReady() const { return true; }; + +public: + /* XReferenceResolvedListener */ + virtual void SAL_CALL referenceResolved( sal_Int32 referenceId ) + throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException); + + /* XKeyCollector */ + virtual void SAL_CALL setKeyId( sal_Int32 id ) + throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException); + + /* XMissionTaker */ + virtual sal_Bool SAL_CALL endMission( ) + throw (com::sun::star::uno::RuntimeException); +}; + +#endif + diff --git a/xmlsecurity/source/framework/signaturecreatorimpl.cxx b/xmlsecurity/source/framework/signaturecreatorimpl.cxx new file mode 100644 index 000000000000..761b981237f6 --- /dev/null +++ b/xmlsecurity/source/framework/signaturecreatorimpl.cxx @@ -0,0 +1,297 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_xmlsecurity.hxx" + +#include "signaturecreatorimpl.hxx" +#include <com/sun/star/xml/crypto/XXMLSignatureTemplate.hpp> +#include <com/sun/star/xml/wrapper/XXMLElementWrapper.hpp> +#include <com/sun/star/lang/XMultiServiceFactory.hpp> + +namespace cssu = com::sun::star::uno; +namespace cssl = com::sun::star::lang; +namespace cssxc = com::sun::star::xml::crypto; +namespace cssxw = com::sun::star::xml::wrapper; + +#define SERVICE_NAME "com.sun.star.xml.crypto.sax.SignatureCreator" +#define IMPLEMENTATION_NAME "com.sun.star.xml.security.framework.SignatureCreatorImpl" + +#define DECLARE_ASCII( SASCIIVALUE ) \ + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SASCIIVALUE ) ) + +SignatureCreatorImpl::SignatureCreatorImpl( const cssu::Reference< cssl::XMultiServiceFactory >& rxMSF ) + :m_nIdOfBlocker(-1) +{ + mxMSF = rxMSF; +} + +SignatureCreatorImpl::~SignatureCreatorImpl( ) +{ +} + +bool SignatureCreatorImpl::checkReady() const +/****** SignatureCreatorImpl/checkReady ************************************** + * + * NAME + * checkReady -- checks the conditions for the signature generation. + * + * SYNOPSIS + * bReady = checkReady( ); + * + * FUNCTION + * checks whether all following conditions are satisfied: + * 1. the result listener is ready; + * 2. the id of the template blocker is known; + * 3. the SignatureEngine is ready. + * + * INPUTS + * empty + * + * RESULT + * bReady - true if all conditions are satisfied, false otherwise + * + * HISTORY + * 05.01.2004 - implemented + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ + return (m_xResultListener.is() && + (m_nIdOfBlocker != -1) && + SignatureEngine::checkReady()); +} + +void SignatureCreatorImpl::notifyResultListener() const + throw (cssu::Exception, cssu::RuntimeException) +/****** SignatureCreatorImpl/notifyResultListener ***************************** + * + * NAME + * notifyResultListener -- notifies the listener about the signature + * creation result. + * + * SYNOPSIS + * notifyResultListener( ); + * + * FUNCTION + * see NAME. + * + * INPUTS + * empty + * + * RESULT + * empty + * + * HISTORY + * 05.01.2004 - implemented + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ + cssu::Reference< cssxc::sax::XSignatureCreationResultListener > + xSignatureCreationResultListener ( m_xResultListener , cssu::UNO_QUERY ) ; + + xSignatureCreationResultListener->signatureCreated( m_nSecurityId, m_nStatus ); +} + +void SignatureCreatorImpl::startEngine( const cssu::Reference< + cssxc::XXMLSignatureTemplate >& + xSignatureTemplate) + throw (cssu::Exception, cssu::RuntimeException) +/****** SignatureCreatorImpl/startEngine ************************************* + * + * NAME + * startEngine -- generates the signature. + * + * SYNOPSIS + * startEngine( xSignatureTemplate ); + * + * FUNCTION + * generates the signature element, then if succeeds, updates the link + * of old template element to the new signature element in + * SAXEventKeeper. + * + * INPUTS + * xSignatureTemplate - the signature template (along with all referenced + * elements) to be signed. + * + * RESULT + * empty + * + * HISTORY + * 05.01.2004 - implemented + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ + cssu::Reference< cssxc::XXMLSignatureTemplate > xResultTemplate; + try + { + xResultTemplate = m_xXMLSignature->generate(xSignatureTemplate, m_xSecurityEnvironment); + m_nStatus = xResultTemplate->getStatus(); + } + catch( cssu::Exception& ) + { + m_nStatus = cssxc::SecurityOperationStatus_RUNTIMEERROR_FAILED; + } + + if (m_nStatus == cssxc::SecurityOperationStatus_OPERATION_SUCCEEDED) + { + cssu::Reference < cssxw::XXMLElementWrapper > xResultSignature = xResultTemplate->getTemplate(); + m_xSAXEventKeeper->setElement(m_nIdOfTemplateEC, xResultSignature); + } +} + +void SignatureCreatorImpl::clearUp() const +/****** SignatureCreatorImpl/clearUp ***************************************** + * + * NAME + * clearUp -- clear up all resources used by the signature generation. + * + * SYNOPSIS + * clearUp( ); + * + * FUNCTION + * cleaning resources up includes: + * 1. SignatureEngine's clearing up; + * 2. releases the Blocker for the signature template element. + * + * INPUTS + * empty + * + * RESULT + * empty + * + * HISTORY + * 05.01.2004 - implemented + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ + SignatureEngine::clearUp(); + + if (m_nIdOfBlocker != -1) + { + m_xSAXEventKeeper->removeBlocker(m_nIdOfBlocker); + } +} + +/* XBlockerMonitor */ +void SAL_CALL SignatureCreatorImpl::setBlockerId( sal_Int32 id ) + throw (cssu::Exception, cssu::RuntimeException) +{ + m_nIdOfBlocker = id; + tryToPerform(); +} + +/* XSignatureCreationResultBroadcaster */ +void SAL_CALL SignatureCreatorImpl::addSignatureCreationResultListener( + const cssu::Reference< cssxc::sax::XSignatureCreationResultListener >& listener ) + throw (cssu::Exception, cssu::RuntimeException) +{ + m_xResultListener = listener; + tryToPerform(); +} + +void SAL_CALL SignatureCreatorImpl::removeSignatureCreationResultListener( + const cssu::Reference< cssxc::sax::XSignatureCreationResultListener >&) + throw (cssu::RuntimeException) +{ +} + +/* XInitialization */ +void SAL_CALL SignatureCreatorImpl::initialize( const cssu::Sequence< cssu::Any >& aArguments ) + throw (cssu::Exception, cssu::RuntimeException) +{ + OSL_ASSERT(aArguments.getLength() == 5); + + rtl::OUString ouTempString; + + aArguments[0] >>= ouTempString; + m_nSecurityId = ouTempString.toInt32(); + aArguments[1] >>= m_xSAXEventKeeper; + aArguments[2] >>= ouTempString; + m_nIdOfTemplateEC = ouTempString.toInt32(); + aArguments[3] >>= m_xSecurityEnvironment; + aArguments[4] >>= m_xXMLSignature; +} + + +rtl::OUString SignatureCreatorImpl_getImplementationName () + throw (cssu::RuntimeException) +{ + return rtl::OUString ( RTL_CONSTASCII_USTRINGPARAM ( IMPLEMENTATION_NAME ) ); +} + +sal_Bool SAL_CALL SignatureCreatorImpl_supportsService( const rtl::OUString& ServiceName ) + throw (cssu::RuntimeException) +{ + return ServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( SERVICE_NAME )); +} + +cssu::Sequence< rtl::OUString > SAL_CALL SignatureCreatorImpl_getSupportedServiceNames( ) + throw (cssu::RuntimeException) +{ + cssu::Sequence < rtl::OUString > aRet(1); + rtl::OUString* pArray = aRet.getArray(); + pArray[0] = rtl::OUString ( RTL_CONSTASCII_USTRINGPARAM ( SERVICE_NAME ) ); + return aRet; +} +#undef SERVICE_NAME + +cssu::Reference< cssu::XInterface > SAL_CALL SignatureCreatorImpl_createInstance( + const cssu::Reference< cssl::XMultiServiceFactory >& rSMgr) + throw( cssu::Exception ) +{ + return (cppu::OWeakObject*) new SignatureCreatorImpl( rSMgr ); +} + +/* XServiceInfo */ +rtl::OUString SAL_CALL SignatureCreatorImpl::getImplementationName( ) + throw (cssu::RuntimeException) +{ + return SignatureCreatorImpl_getImplementationName(); +} +sal_Bool SAL_CALL SignatureCreatorImpl::supportsService( const rtl::OUString& rServiceName ) + throw (cssu::RuntimeException) +{ + return SignatureCreatorImpl_supportsService( rServiceName ); +} +cssu::Sequence< rtl::OUString > SAL_CALL SignatureCreatorImpl::getSupportedServiceNames( ) + throw (cssu::RuntimeException) +{ + return SignatureCreatorImpl_getSupportedServiceNames(); +} + diff --git a/xmlsecurity/source/framework/signaturecreatorimpl.hxx b/xmlsecurity/source/framework/signaturecreatorimpl.hxx new file mode 100644 index 000000000000..db25bf10f893 --- /dev/null +++ b/xmlsecurity/source/framework/signaturecreatorimpl.hxx @@ -0,0 +1,147 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SIGNATURECREATORIMPL_HXX +#define _SIGNATURECREATORIMPL_HXX + +#include <com/sun/star/xml/crypto/sax/XBlockerMonitor.hpp> +#include <com/sun/star/xml/crypto/sax/XSignatureCreationResultListener.hpp> +#include <com/sun/star/xml/crypto/sax/XSignatureCreationResultBroadcaster.hpp> +#include <com/sun/star/xml/crypto/XSecurityEnvironment.hpp> +#include <com/sun/star/lang/XInitialization.hpp> +#include <com/sun/star/lang/XServiceInfo.hpp> +#include <cppuhelper/implbase4.hxx> + +#include "signatureengine.hxx" + +class SignatureCreatorImpl : public cppu::ImplInheritanceHelper4 +< + SignatureEngine, + com::sun::star::xml::crypto::sax::XBlockerMonitor, + com::sun::star::xml::crypto::sax::XSignatureCreationResultBroadcaster, + com::sun::star::lang::XInitialization, + com::sun::star::lang::XServiceInfo +> +/****** SignatureCreatorImpl.hxx/CLASS SignatureCreatorImpl ******************* + * + * NAME + * SignatureCreatorImpl -- generates a signature + * + * FUNCTION + * Collects all resources for a signature generation, then generates the + * signature by invoking a xmlsec-based signature bridge component. + * + * HISTORY + * 05.01.2004 - Interface supported: XBlockerMonitor, + * XInitialization, XServiceInfo + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ +private: + /* + * the Id of the signature, which is used for the result listener to + * identify the signature. + */ + sal_Int32 m_nSignatureId; + + /* + * the Id of template blocker. + */ + sal_Int32 m_nIdOfBlocker; + + /* + * the signature creation result + */ + bool m_bCreationSucceed; + + com::sun::star::uno::Reference< + com::sun::star::xml::crypto::XSecurityEnvironment > m_xSecurityEnvironment; + + virtual void notifyResultListener() const + throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException); + virtual void clearUp( ) const; + virtual bool checkReady() const; + virtual void startEngine( const com::sun::star::uno::Reference< + com::sun::star::xml::crypto::XXMLSignatureTemplate >& + xSignatureTemplate) + throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException); + +public: + explicit SignatureCreatorImpl( const com::sun::star::uno::Reference< + com::sun::star::lang::XMultiServiceFactory >& rxMSF); + virtual ~SignatureCreatorImpl(); + + /* XBlockerMonitor */ + virtual void SAL_CALL setBlockerId( sal_Int32 id ) + throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException); + + /* XSignatureCreationResultBroadcaster */ + void SAL_CALL addSignatureCreationResultListener( + const com::sun::star::uno::Reference< + com::sun::star::xml::crypto::sax::XSignatureCreationResultListener >& listener ) + throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException); + + void SAL_CALL removeSignatureCreationResultListener( + const com::sun::star::uno::Reference< + com::sun::star::xml::crypto::sax::XSignatureCreationResultListener >& listener ) + throw (com::sun::star::uno::RuntimeException); + + /* XInitialization */ + virtual void SAL_CALL initialize( + const com::sun::star::uno::Sequence< com::sun::star::uno::Any >& aArguments ) + throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException); + + /* XServiceInfo */ + virtual rtl::OUString SAL_CALL getImplementationName( ) + throw (com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL supportsService( const rtl::OUString& ServiceName ) + throw (com::sun::star::uno::RuntimeException); + virtual com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames( ) + throw (com::sun::star::uno::RuntimeException); +}; + +rtl::OUString SignatureCreatorImpl_getImplementationName() + throw ( com::sun::star::uno::RuntimeException ); + +sal_Bool SAL_CALL SignatureCreatorImpl_supportsService( const rtl::OUString& ServiceName ) + throw ( com::sun::star::uno::RuntimeException ); + +com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL SignatureCreatorImpl_getSupportedServiceNames( ) + throw ( com::sun::star::uno::RuntimeException ); + +com::sun::star::uno::Reference< com::sun::star::uno::XInterface > +SAL_CALL SignatureCreatorImpl_createInstance( + const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > & rSMgr) + throw ( com::sun::star::uno::Exception ); + +#endif + + + diff --git a/xmlsecurity/source/framework/signatureengine.cxx b/xmlsecurity/source/framework/signatureengine.cxx new file mode 100644 index 000000000000..51fbdb259667 --- /dev/null +++ b/xmlsecurity/source/framework/signatureengine.cxx @@ -0,0 +1,268 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_xmlsecurity.hxx" + +#include "signatureengine.hxx" +#include <com/sun/star/xml/crypto/XXMLSignatureTemplate.hpp> +#include <com/sun/star/xml/wrapper/XXMLElementWrapper.hpp> +#include <com/sun/star/lang/XMultiServiceFactory.hpp> + +namespace cssu = com::sun::star::uno; +namespace cssl = com::sun::star::lang; +namespace cssxc = com::sun::star::xml::crypto; +namespace cssxw = com::sun::star::xml::wrapper; + +#define SIGNATURE_TEMPLATE "com.sun.star.xml.crypto.XMLSignatureTemplate" + +#define DECLARE_ASCII( SASCIIVALUE ) \ + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SASCIIVALUE ) ) + +SignatureEngine::SignatureEngine( ) + :m_nTotalReferenceNumber(-1) +{ +} + +bool SignatureEngine::checkReady() const +/****** SignatureEngine/checkReady ******************************************* + * + * NAME + * checkReady -- checks the conditions for the main operation. + * + * SYNOPSIS + * bReady = checkReady( ); + * + * FUNCTION + * checks whether all following conditions are satisfied: + * 1. the main operation has't begun yet; + * 2. the key material is known; + * 3. the amount of reference is known; + * 4. all of referenced elements, the key element and the signature + * template are bufferred. + * + * INPUTS + * empty + * + * RESULT + * bReady - true if all conditions are satisfied, false otherwise + * + * HISTORY + * 05.01.2004 - implemented + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ + bool rc = true; + + sal_Int32 nKeyInc = 0; + if (m_nIdOfKeyEC != 0) + { + nKeyInc = 1; + } + + if (m_bMissionDone || + m_nIdOfKeyEC == -1 || + m_nTotalReferenceNumber == -1 || + m_nTotalReferenceNumber+1+nKeyInc > m_nNumOfResolvedReferences) + { + rc = false; + } + + return rc; +} + +void SignatureEngine::tryToPerform( ) + throw (cssu::Exception, cssu::RuntimeException) +/****** SignatureEngine/tryToPerform ***************************************** + * + * NAME + * tryToPerform -- tries to perform the signature operation. + * + * SYNOPSIS + * tryToPerform( ); + * + * FUNCTION + * if the situation is ready, perform following operations. + * 1. prepares a signature template; + * 2. calls the signature bridge component; + * 3. clears up all used resources; + * 4. notifies the result listener; + * 5. sets the "accomplishment" flag. + * + * INPUTS + * empty + * + * RESULT + * empty + * + * HISTORY + * 05.01.2004 - implemented + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ + if (checkReady()) + { + const rtl::OUString ouSignatureTemplate ( + RTL_CONSTASCII_USTRINGPARAM( SIGNATURE_TEMPLATE ) ); + cssu::Reference < cssxc::XXMLSignatureTemplate > + xSignatureTemplate( mxMSF->createInstance( ouSignatureTemplate ), cssu::UNO_QUERY ); + + OSL_ASSERT( xSignatureTemplate.is() ); + + cssu::Reference< cssxw::XXMLElementWrapper > + xXMLElement = m_xSAXEventKeeper->getElement( m_nIdOfTemplateEC ); + + xSignatureTemplate->setTemplate(xXMLElement); + + std::vector< sal_Int32 >::const_iterator ii = m_vReferenceIds.begin(); + + for( ; ii != m_vReferenceIds.end() ; ++ii ) + { + xXMLElement = m_xSAXEventKeeper->getElement( *ii ); + xSignatureTemplate->setTarget(xXMLElement); + } + + /* + * set the Uri binding + */ + xSignatureTemplate->setBinding( this ); + + startEngine( xSignatureTemplate ); + + /* + * done + */ + clearUp( ); + + notifyResultListener(); + + m_bMissionDone = true; + } +} + +void SignatureEngine::clearUp( ) const +/****** SignatureEngine/clearUp ********************************************** + * + * NAME + * clearUp -- clear up all resources used by this operation. + * + * SYNOPSIS + * clearUp( ); + * + * FUNCTION + * cleaning resources up includes: + * 1. releases the ElementCollector for the signature template element; + * 2. releases ElementCollectors for referenced elements; + * 3. releases the ElementCollector for the key element, if there is one. + * + * INPUTS + * empty + * + * RESULT + * empty + * + * HISTORY + * 05.01.2004 - implemented + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ + cssu::Reference < cssxc::sax::XReferenceResolvedBroadcaster > + xReferenceResolvedBroadcaster( m_xSAXEventKeeper, cssu::UNO_QUERY ); + xReferenceResolvedBroadcaster->removeReferenceResolvedListener( + m_nIdOfTemplateEC, + (const cssu::Reference < cssxc::sax::XReferenceResolvedListener >)((SecurityEngine *)this)); + + m_xSAXEventKeeper->removeElementCollector(m_nIdOfTemplateEC); + + std::vector< sal_Int32 >::const_iterator ii = m_vReferenceIds.begin(); + + for( ; ii != m_vReferenceIds.end() ; ++ii ) + { + xReferenceResolvedBroadcaster->removeReferenceResolvedListener( + *ii, + (const cssu::Reference < cssxc::sax::XReferenceResolvedListener >)((SecurityEngine *)this)); + m_xSAXEventKeeper->removeElementCollector(*ii); + } + + if (m_nIdOfKeyEC != 0 && m_nIdOfKeyEC != -1) + { + m_xSAXEventKeeper->removeElementCollector(m_nIdOfKeyEC); + } +} + +/* XReferenceCollector */ +void SAL_CALL SignatureEngine::setReferenceCount( sal_Int32 count ) + throw (cssu::Exception, cssu::RuntimeException) +{ + m_nTotalReferenceNumber = count; + tryToPerform(); +} + +void SAL_CALL SignatureEngine::setReferenceId( sal_Int32 id ) + throw (cssu::Exception, cssu::RuntimeException) +{ + m_vReferenceIds.push_back( id ); +} + +/* XUriBinding */ +void SAL_CALL SignatureEngine::setUriBinding( + const rtl::OUString& uri, + const cssu::Reference< com::sun::star::io::XInputStream >& aInputStream ) + throw (cssu::Exception, cssu::RuntimeException) +{ + m_vUris.push_back(uri); + m_vXInputStreams.push_back(aInputStream); +} + +cssu::Reference< com::sun::star::io::XInputStream > SAL_CALL SignatureEngine::getUriBinding( const rtl::OUString& uri ) + throw (cssu::Exception, cssu::RuntimeException) +{ + cssu::Reference< com::sun::star::io::XInputStream > xInputStream; + + int size = m_vUris.size(); + + for( int i=0; i<size; ++i) + { + if (m_vUris[i] == uri) + { + xInputStream = m_vXInputStreams[i]; + break; + } + } + + return xInputStream; +} + diff --git a/xmlsecurity/source/framework/signatureengine.hxx b/xmlsecurity/source/framework/signatureengine.hxx new file mode 100644 index 000000000000..b36cd6aa6442 --- /dev/null +++ b/xmlsecurity/source/framework/signatureengine.hxx @@ -0,0 +1,144 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SIGNATUREENGINE_HXX +#define _SIGNATUREENGINE_HXX + +#include <com/sun/star/xml/crypto/sax/XReferenceResolvedListener.hpp> +#include <com/sun/star/xml/crypto/sax/XReferenceResolvedBroadcaster.hpp> +#ifndef _COM_SUN_STAR_XML_CRYPTO_SAX_XSIGNATURECOLLECTOR_HPP_ +#include <com/sun/star/xml/crypto/sax/XReferenceCollector.hpp> +#endif +#include <com/sun/star/xml/crypto/sax/XKeyCollector.hpp> +#include <com/sun/star/xml/crypto/sax/XMissionTaker.hpp> +#include <com/sun/star/xml/crypto/sax/XSAXEventKeeper.hpp> +#include <com/sun/star/xml/crypto/XXMLSecurityContext.hpp> +#include <com/sun/star/xml/crypto/XXMLSignature.hpp> +#include <com/sun/star/xml/crypto/XUriBinding.hpp> +#include <com/sun/star/io/XInputStream.hpp> + +#include <cppuhelper/implbase2.hxx> + +#include "securityengine.hxx" + +#ifndef INCLUDED_VECTOR +#include <vector> +#define INCLUDED_VECTOR +#endif + +class SignatureEngine : public cppu::ImplInheritanceHelper2 +< + SecurityEngine, + com::sun::star::xml::crypto::sax::XReferenceCollector, + com::sun::star::xml::crypto::XUriBinding +> +/****** signatureengine.hxx/CLASS SignatureEngine ***************************** + * + * NAME + * SignatureEngine -- Base class of SignatureCreator and SignatureVerifier + * + * FUNCTION + * Maintains common members and methods related with signature operation. + * + * HISTORY + * 05.01.2004 - Interface supported: XReferenceCollector + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ +protected: + + /* + * the Signature bridge component, which performs signature generation + * and verification based on xmlsec library. + */ + com::sun::star::uno::Reference< + com::sun::star::xml::crypto::XXMLSignature > m_xXMLSignature; + + /* + * a collection of ElementCollector's ids. Each ElementCollector + * represents one element signed by this signature. + */ + std::vector< sal_Int32 > m_vReferenceIds; + + /* + * remembers how many references this signature has. + */ + sal_Int32 m_nTotalReferenceNumber; + + /* + * a collection of Uri binding. + * + * the m_vUris is used to hold the Uri strings, and the m_vXInputStreams is used + * to hold corresponding binded XInputStream interface. + */ + std::vector< rtl::OUString > m_vUris; + std::vector< com::sun::star::uno::Reference< + com::sun::star::io::XInputStream > > m_vXInputStreams; + +protected: + SignatureEngine( ); + virtual ~SignatureEngine() {}; + + virtual void tryToPerform( ) + throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException); + virtual void clearUp( ) const; + virtual bool checkReady() const; + + /* + * starts the main function. This method will be implemented by any sub-class. + * For a SignatureCreator, it performs signing operation; + * for a SignatureVerifier, verification operation is performed. + */ + virtual void startEngine( const com::sun::star::uno::Reference< + com::sun::star::xml::crypto::XXMLSignatureTemplate >&) + throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException) + {}; + +public: + /* XReferenceCollector */ + virtual void SAL_CALL setReferenceCount( sal_Int32 count ) + throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL setReferenceId( sal_Int32 id ) + throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException); + + /* XUriBinding */ + virtual void SAL_CALL setUriBinding( + const rtl::OUString& uri, + const com::sun::star::uno::Reference< + com::sun::star::io::XInputStream >& aInputStream ) + throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException); + virtual com::sun::star::uno::Reference< com::sun::star::io::XInputStream > + SAL_CALL getUriBinding( const rtl::OUString& uri ) + throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException); +}; + +#endif + diff --git a/xmlsecurity/source/framework/signatureverifierimpl.cxx b/xmlsecurity/source/framework/signatureverifierimpl.cxx new file mode 100644 index 000000000000..535944ef8415 --- /dev/null +++ b/xmlsecurity/source/framework/signatureverifierimpl.cxx @@ -0,0 +1,242 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_xmlsecurity.hxx" + +#include "signatureverifierimpl.hxx" +#include <com/sun/star/xml/crypto/XXMLSignatureTemplate.hpp> +#include <com/sun/star/xml/wrapper/XXMLElementWrapper.hpp> +#include <com/sun/star/lang/XMultiServiceFactory.hpp> + +namespace cssu = com::sun::star::uno; +namespace cssl = com::sun::star::lang; +namespace cssxc = com::sun::star::xml::crypto; +namespace cssxw = com::sun::star::xml::wrapper; + +#define SERVICE_NAME "com.sun.star.xml.crypto.sax.SignatureVerifier" +#define IMPLEMENTATION_NAME "com.sun.star.xml.security.framework.SignatureVerifierImpl" + +#define DECLARE_ASCII( SASCIIVALUE ) \ + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SASCIIVALUE ) ) + +SignatureVerifierImpl::SignatureVerifierImpl( const cssu::Reference< cssl::XMultiServiceFactory >& rxMSF) +{ + mxMSF = rxMSF; +} + +SignatureVerifierImpl::~SignatureVerifierImpl() +{ +} + +bool SignatureVerifierImpl::checkReady() const +/****** SignatureVerifierImpl/checkReady ************************************* + * + * NAME + * checkReady -- checks the conditions for the signature verification. + * + * SYNOPSIS + * bReady = checkReady( ); + * + * FUNCTION + * checks whether all following conditions are satisfied: + * 1. the result listener is ready; + * 2. the SignatureEngine is ready. + * + * INPUTS + * empty + * + * RESULT + * bReady - true if all conditions are satisfied, false otherwise + * + * HISTORY + * 05.01.2004 - implemented + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ + return (m_xResultListener.is() && SignatureEngine::checkReady()); +} + +void SignatureVerifierImpl::notifyResultListener() const + throw (cssu::Exception, cssu::RuntimeException) +/****** SignatureVerifierImpl/notifyResultListener *************************** + * + * NAME + * notifyResultListener -- notifies the listener about the verify result. + * + * SYNOPSIS + * notifyResultListener( ); + * + * FUNCTION + * see NAME. + * + * INPUTS + * empty + * + * RESULT + * empty + * + * HISTORY + * 05.01.2004 - implemented + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ + cssu::Reference< cssxc::sax::XSignatureVerifyResultListener > + xSignatureVerifyResultListener ( m_xResultListener , cssu::UNO_QUERY ) ; + + xSignatureVerifyResultListener->signatureVerified( m_nSecurityId, m_nStatus ); +} + +void SignatureVerifierImpl::startEngine( const cssu::Reference< + cssxc::XXMLSignatureTemplate >& + xSignatureTemplate) + throw (cssu::Exception, cssu::RuntimeException) +/****** SignatureVerifierImpl/startEngine ************************************ + * + * NAME + * startEngine -- verifies the signature. + * + * SYNOPSIS + * startEngine( xSignatureTemplate ); + * + * FUNCTION + * see NAME. + * + * INPUTS + * xSignatureTemplate - the signature template (along with all referenced + * elements) to be verified. + * + * RESULT + * empty + * + * HISTORY + * 05.01.2004 - implemented + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ + cssu::Reference< cssxc::XXMLSignatureTemplate > xResultTemplate; + try + { + xResultTemplate = m_xXMLSignature->validate(xSignatureTemplate, m_xXMLSecurityContext); + m_nStatus = xResultTemplate->getStatus(); + } + catch( cssu::Exception& ) + { + m_nStatus = cssxc::SecurityOperationStatus_RUNTIMEERROR_FAILED; + } +} + +/* XSignatureVerifyResultBroadcaster */ +void SAL_CALL SignatureVerifierImpl::addSignatureVerifyResultListener( + const cssu::Reference< cssxc::sax::XSignatureVerifyResultListener >& listener ) + throw (cssu::Exception, cssu::RuntimeException) +{ + m_xResultListener = listener; + tryToPerform(); +} + +void SAL_CALL SignatureVerifierImpl::removeSignatureVerifyResultListener( + const cssu::Reference< cssxc::sax::XSignatureVerifyResultListener >&) + throw (cssu::RuntimeException) +{ +} + +/* XInitialization */ +void SAL_CALL SignatureVerifierImpl::initialize( + const cssu::Sequence< cssu::Any >& aArguments ) + throw (cssu::Exception, cssu::RuntimeException) +{ + OSL_ASSERT(aArguments.getLength() == 5); + + rtl::OUString ouTempString; + + aArguments[0] >>= ouTempString; + m_nSecurityId = ouTempString.toInt32(); + aArguments[1] >>= m_xSAXEventKeeper; + aArguments[2] >>= ouTempString; + m_nIdOfTemplateEC = ouTempString.toInt32(); + aArguments[3] >>= m_xXMLSecurityContext; + aArguments[4] >>= m_xXMLSignature; +} + + +rtl::OUString SignatureVerifierImpl_getImplementationName () + throw (cssu::RuntimeException) +{ + return rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM ( IMPLEMENTATION_NAME ) ); +} + +sal_Bool SAL_CALL SignatureVerifierImpl_supportsService( const rtl::OUString& ServiceName ) + throw (cssu::RuntimeException) +{ + return ServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( SERVICE_NAME )); +} + +cssu::Sequence< rtl::OUString > SAL_CALL SignatureVerifierImpl_getSupportedServiceNames( ) + throw (cssu::RuntimeException) +{ + cssu::Sequence < rtl::OUString > aRet(1); + rtl::OUString* pArray = aRet.getArray(); + pArray[0] = rtl::OUString ( RTL_CONSTASCII_USTRINGPARAM ( SERVICE_NAME ) ); + return aRet; +} +#undef SERVICE_NAME + +cssu::Reference< cssu::XInterface > SAL_CALL SignatureVerifierImpl_createInstance( + const cssu::Reference< cssl::XMultiServiceFactory >& rSMgr) + throw( cssu::Exception ) +{ + return (cppu::OWeakObject*) new SignatureVerifierImpl(rSMgr); +} + +/* XServiceInfo */ +rtl::OUString SAL_CALL SignatureVerifierImpl::getImplementationName( ) + throw (cssu::RuntimeException) +{ + return SignatureVerifierImpl_getImplementationName(); +} +sal_Bool SAL_CALL SignatureVerifierImpl::supportsService( const rtl::OUString& rServiceName ) + throw (cssu::RuntimeException) +{ + return SignatureVerifierImpl_supportsService( rServiceName ); +} +cssu::Sequence< rtl::OUString > SAL_CALL SignatureVerifierImpl::getSupportedServiceNames( ) + throw (cssu::RuntimeException) +{ + return SignatureVerifierImpl_getSupportedServiceNames(); +} + diff --git a/xmlsecurity/source/framework/signatureverifierimpl.hxx b/xmlsecurity/source/framework/signatureverifierimpl.hxx new file mode 100644 index 000000000000..68b4fff245d2 --- /dev/null +++ b/xmlsecurity/source/framework/signatureverifierimpl.hxx @@ -0,0 +1,135 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SIGNATUREVERIFIERIMPL_HXX +#define _SIGNATUREVERIFIERIMPL_HXX + +#include <com/sun/star/xml/crypto/sax/XSignatureVerifyResultListener.hpp> +#include <com/sun/star/xml/crypto/sax/XSignatureVerifyResultBroadcaster.hpp> +#include <com/sun/star/xml/crypto/XXMLSecurityContext.hpp> +#include <com/sun/star/lang/XInitialization.hpp> +#include <com/sun/star/lang/XServiceInfo.hpp> +#include <cppuhelper/implbase3.hxx> + +#include "signatureengine.hxx" + +class SignatureVerifierImpl : public cppu::ImplInheritanceHelper3 +< + SignatureEngine, + com::sun::star::xml::crypto::sax::XSignatureVerifyResultBroadcaster, + com::sun::star::lang::XInitialization, + com::sun::star::lang::XServiceInfo +> +/****** SignatureVerifier.hxx/CLASS SignatureVerifierImpl ********************* + * + * NAME + * SignatureVerifierImpl -- verifies a signature + * + * FUNCTION + * Collects all resources for a signature verification, then verifies the + * signature by invoking a xmlsec-based signature bridge component. + * + * HISTORY + * 05.01.2004 - Interface supported: XSignatureVerifyResultBroadcaster, + * XInitialization, XServiceInfo + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ +private: + /* + * the Id of the signature, which is used for the result listener to + * identify the signature. + */ + sal_Int32 m_nSignatureId; + + /* + * the verify result + */ + bool m_bVerifySucceed; + + com::sun::star::uno::Reference< + com::sun::star::xml::crypto::XXMLSecurityContext > m_xXMLSecurityContext; + + virtual void notifyResultListener() const + throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException); + virtual bool checkReady() const; + virtual void startEngine( const com::sun::star::uno::Reference< + com::sun::star::xml::crypto::XXMLSignatureTemplate >& + xSignatureTemplate) + throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException); + +public: + explicit SignatureVerifierImpl( const com::sun::star::uno::Reference< + com::sun::star::lang::XMultiServiceFactory >& rxMSF); + virtual ~SignatureVerifierImpl(); + + /* XSignatureVerifyResultBroadcaster */ + virtual void SAL_CALL addSignatureVerifyResultListener( + const com::sun::star::uno::Reference< + com::sun::star::xml::crypto::sax::XSignatureVerifyResultListener >& + listener ) + throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeSignatureVerifyResultListener( + const com::sun::star::uno::Reference< + com::sun::star::xml::crypto::sax::XSignatureVerifyResultListener >& + listener ) + throw (com::sun::star::uno::RuntimeException); + + /* XInitialization */ + virtual void SAL_CALL initialize( + const com::sun::star::uno::Sequence< com::sun::star::uno::Any >& aArguments ) + throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException); + + /* XServiceInfo */ + virtual rtl::OUString SAL_CALL getImplementationName( ) + throw (com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL supportsService( const rtl::OUString& ServiceName ) + throw (com::sun::star::uno::RuntimeException); + virtual com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames( ) + throw (com::sun::star::uno::RuntimeException); +}; + +rtl::OUString SignatureVerifierImpl_getImplementationName() + throw ( com::sun::star::uno::RuntimeException ); + +sal_Bool SAL_CALL SignatureVerifierImpl_supportsService( const rtl::OUString& ServiceName ) + throw ( com::sun::star::uno::RuntimeException ); + +com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL SignatureVerifierImpl_getSupportedServiceNames( ) + throw ( com::sun::star::uno::RuntimeException ); + +com::sun::star::uno::Reference< com::sun::star::uno::XInterface > +SAL_CALL SignatureVerifierImpl_createInstance( + const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > & rSMgr) + throw ( com::sun::star::uno::Exception ); + +#endif + + diff --git a/xmlsecurity/source/framework/xmlencryptiontemplateimpl.cxx b/xmlsecurity/source/framework/xmlencryptiontemplateimpl.cxx new file mode 100644 index 000000000000..ec978dc488e1 --- /dev/null +++ b/xmlsecurity/source/framework/xmlencryptiontemplateimpl.cxx @@ -0,0 +1,142 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_xmlsecurity.hxx" +#include <sal/config.h> +#include <rtl/uuid.h> +#include "xmlencryptiontemplateimpl.hxx" + +using namespace ::com::sun::star::uno ; +using ::com::sun::star::lang::XMultiServiceFactory ; +using ::com::sun::star::lang::XSingleServiceFactory ; +using ::rtl::OUString ; + +using ::com::sun::star::xml::wrapper::XXMLElementWrapper ; +using ::com::sun::star::xml::crypto::XXMLEncryptionTemplate ; + +XMLEncryptionTemplateImpl :: XMLEncryptionTemplateImpl( const Reference< XMultiServiceFactory >& aFactory ) + : m_xTemplate( NULL ), + m_xTarget( NULL ), + m_xServiceManager( aFactory ), + m_nStatus ( ::com::sun::star::xml::crypto::SecurityOperationStatus_UNKNOWN ) { +} + +XMLEncryptionTemplateImpl :: ~XMLEncryptionTemplateImpl() { +} + +/* XXMLEncryptionTemplate */ +void SAL_CALL XMLEncryptionTemplateImpl :: setTemplate( const Reference< XXMLElementWrapper >& aTemplate ) + throw (com::sun::star::uno::RuntimeException, com::sun::star::lang::IllegalArgumentException) +{ + m_xTemplate = aTemplate ; +} + +/* XXMLEncryptionTemplate */ +Reference< XXMLElementWrapper > SAL_CALL XMLEncryptionTemplateImpl :: getTemplate() +throw (com::sun::star::uno::RuntimeException) +{ + return m_xTemplate ; +} + +/* XXMLEncryptionTemplate */ +void SAL_CALL XMLEncryptionTemplateImpl :: setTarget( const Reference< XXMLElementWrapper >& aTarget ) + throw( com::sun::star::lang::IllegalArgumentException ) { + m_xTarget = aTarget ; +} + +/* XXMLEncryptionTemplate */ +Reference< XXMLElementWrapper > SAL_CALL XMLEncryptionTemplateImpl :: getTarget() +throw (com::sun::star::uno::RuntimeException) +{ + return m_xTarget ; +} + +void SAL_CALL XMLEncryptionTemplateImpl::setStatus( + ::com::sun::star::xml::crypto::SecurityOperationStatus status ) + throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException) +{ + m_nStatus = status; +} + +::com::sun::star::xml::crypto::SecurityOperationStatus SAL_CALL XMLEncryptionTemplateImpl::getStatus( ) + throw (::com::sun::star::uno::RuntimeException) +{ + return m_nStatus; +} + +/* XInitialization */ +void SAL_CALL XMLEncryptionTemplateImpl :: initialize( const Sequence< Any >& /*aArguments*/ ) + throw( Exception, RuntimeException ) { + // TBD +} ; + +/* XServiceInfo */ +OUString SAL_CALL XMLEncryptionTemplateImpl :: getImplementationName() throw( RuntimeException ) { + return impl_getImplementationName() ; +} + +/* XServiceInfo */ +sal_Bool SAL_CALL XMLEncryptionTemplateImpl :: supportsService( const OUString& serviceName) throw( RuntimeException ) { + Sequence< OUString > seqServiceNames = getSupportedServiceNames() ; + const OUString* pArray = seqServiceNames.getConstArray() ; + for( sal_Int32 i = 0 ; i < seqServiceNames.getLength() ; i ++ ) { + if( *( pArray + i ) == serviceName ) + return sal_True ; + } + return sal_False ; +} + +/* XServiceInfo */ +Sequence< OUString > SAL_CALL XMLEncryptionTemplateImpl :: getSupportedServiceNames() throw( RuntimeException ) { + return impl_getSupportedServiceNames() ; +} + +//Helper for XServiceInfo +Sequence< OUString > XMLEncryptionTemplateImpl :: impl_getSupportedServiceNames() { + ::osl::Guard< ::osl::Mutex > aGuard( ::osl::Mutex::getGlobalMutex() ) ; + Sequence< OUString > seqServiceNames( 1 ) ; + seqServiceNames.getArray()[0] = OUString::createFromAscii( "com.sun.star.xml.crypto.XMLEncryptionTemplate" ) ; + return seqServiceNames ; +} + +OUString XMLEncryptionTemplateImpl :: impl_getImplementationName() throw( RuntimeException ) { + return OUString::createFromAscii( "com.sun.star.xml.security.framework.XMLEncryptionTemplateImpl" ) ; +} + +//Helper for registry +Reference< XInterface > SAL_CALL XMLEncryptionTemplateImpl :: impl_createInstance( const Reference< XMultiServiceFactory >& aServiceManager ) throw( RuntimeException ) { + return Reference< XInterface >( *new XMLEncryptionTemplateImpl( aServiceManager ) ) ; +} + +Reference< XSingleServiceFactory > XMLEncryptionTemplateImpl :: impl_createFactory( const Reference< XMultiServiceFactory >& aServiceManager ) { + //Reference< XSingleServiceFactory > xFactory ; + //xFactory = ::cppu::createSingleFactory( aServiceManager , impl_getImplementationName , impl_createInstance , impl_getSupportedServiceNames ) ; + //return xFactory ; + return ::cppu::createSingleFactory( aServiceManager , impl_getImplementationName() , impl_createInstance , impl_getSupportedServiceNames() ) ; +} + diff --git a/xmlsecurity/source/framework/xmlencryptiontemplateimpl.hxx b/xmlsecurity/source/framework/xmlencryptiontemplateimpl.hxx new file mode 100644 index 000000000000..af2f7ab93028 --- /dev/null +++ b/xmlsecurity/source/framework/xmlencryptiontemplateimpl.hxx @@ -0,0 +1,113 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _XMLENCRYPTIONTEMPLATEIMPL_HXX_ +#define _XMLENCRYPTIONTEMPLATEIMPL_HXX_ + +#include <sal/config.h> +#include <rtl/ustring.hxx> +#include <cppuhelper/factory.hxx> +#include <cppuhelper/implbase3.hxx> +#include <com/sun/star/uno/Exception.hpp> + +#ifndef _COM_SUN_STAR_UNO_REFERENCE_HPP_ +#include <com/sun/star/uno/Reference.hxx> +#endif +#include <com/sun/star/lang/XSingleServiceFactory.hpp> + +#ifndef _COM_SUN_STAR_LANG_XSECVICEINFO_HPP_ +#include <com/sun/star/lang/XServiceInfo.hpp> +#endif +#include <com/sun/star/lang/XInitialization.hpp> +#include <com/sun/star/lang/XUnoTunnel.hpp> +#include <com/sun/star/xml/crypto/XXMLEncryptionTemplate.hpp> +#include <com/sun/star/xml/wrapper/XXMLElementWrapper.hpp> + +class XMLEncryptionTemplateImpl : public ::cppu::WeakImplHelper3< + ::com::sun::star::xml::crypto::XXMLEncryptionTemplate , + ::com::sun::star::lang::XInitialization , + ::com::sun::star::lang::XServiceInfo > +{ + private : + ::com::sun::star::uno::Reference< ::com::sun::star::xml::wrapper::XXMLElementWrapper > m_xTemplate ; + ::com::sun::star::uno::Reference< ::com::sun::star::xml::wrapper::XXMLElementWrapper > m_xTarget ; + ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xServiceManager ; + ::com::sun::star::xml::crypto::SecurityOperationStatus m_nStatus; + + public : + XMLEncryptionTemplateImpl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& aFactory ) ; + virtual ~XMLEncryptionTemplateImpl() ; + + //Methods from XXMLEncryptionTemplate + virtual void SAL_CALL setTemplate( + const ::com::sun::star::uno::Reference< ::com::sun::star::xml::wrapper::XXMLElementWrapper >& aXmlElement + ) + throw (com::sun::star::uno::RuntimeException, com::sun::star::lang::IllegalArgumentException); + + virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::wrapper::XXMLElementWrapper > SAL_CALL getTemplate( + ) throw (com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL setTarget( + const ::com::sun::star::uno::Reference< ::com::sun::star::xml::wrapper::XXMLElementWrapper >& aXmlElement + ) throw( com::sun::star::lang::IllegalArgumentException); + + virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::wrapper::XXMLElementWrapper > SAL_CALL getTarget( + ) throw (com::sun::star::uno::RuntimeException) ; + + virtual void SAL_CALL setStatus( + ::com::sun::star::xml::crypto::SecurityOperationStatus status ) + throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::xml::crypto::SecurityOperationStatus + SAL_CALL getStatus( ) + throw (::com::sun::star::uno::RuntimeException); + + //Methods from XInitialization + virtual void SAL_CALL initialize( + const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments + ) throw( ::com::sun::star::uno::Exception , ::com::sun::star::uno::RuntimeException ) ; + + //Methods from XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException ) ; + + virtual sal_Bool SAL_CALL supportsService( + const ::rtl::OUString& ServiceName + ) throw( ::com::sun::star::uno::RuntimeException ) ; + + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException ) ; + + //Helper for XServiceInfo + static ::com::sun::star::uno::Sequence< ::rtl::OUString > impl_getSupportedServiceNames() ; + + static ::rtl::OUString impl_getImplementationName() throw( ::com::sun::star::uno::RuntimeException ) ; + + //Helper for registry + static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL impl_createInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& aServiceManager ) throw( ::com::sun::star::uno::RuntimeException ) ; + + static ::com::sun::star::uno::Reference< ::com::sun::star::lang::XSingleServiceFactory > impl_createFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& aServiceManager ) ; +} ; + +#endif // _XMLENCRYPTIONTEMPLATE_XMLSECIMPL_HXX_ diff --git a/xmlsecurity/source/framework/xmlsignaturetemplateimpl.cxx b/xmlsecurity/source/framework/xmlsignaturetemplateimpl.cxx new file mode 100644 index 000000000000..6b50d7b017ed --- /dev/null +++ b/xmlsecurity/source/framework/xmlsignaturetemplateimpl.cxx @@ -0,0 +1,167 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_xmlsecurity.hxx" +#include <sal/config.h> +#include <rtl/ustring.hxx> +#include <rtl/uuid.h> +#include "xmlsignaturetemplateimpl.hxx" + +using namespace ::com::sun::star::uno ; +using ::com::sun::star::lang::XMultiServiceFactory ; +using ::com::sun::star::lang::XSingleServiceFactory ; +using ::rtl::OUString ; + +using ::com::sun::star::xml::wrapper::XXMLElementWrapper ; +using ::com::sun::star::xml::crypto::XXMLSignatureTemplate ; + +XMLSignatureTemplateImpl :: XMLSignatureTemplateImpl( const Reference< XMultiServiceFactory >& aFactory ) + :m_xTemplate( NULL ), + m_xServiceManager( aFactory ), + m_nStatus ( ::com::sun::star::xml::crypto::SecurityOperationStatus_UNKNOWN ) +{ +} + +XMLSignatureTemplateImpl :: ~XMLSignatureTemplateImpl() { +} + +/* XXMLSignatureTemplate */ +void SAL_CALL XMLSignatureTemplateImpl :: setTemplate( const Reference< XXMLElementWrapper >& aTemplate ) + throw( com::sun::star::uno::RuntimeException, com::sun::star::lang::IllegalArgumentException) +{ + m_xTemplate = aTemplate ; +} + +/* XXMLSignatureTemplate */ +Reference< XXMLElementWrapper > SAL_CALL XMLSignatureTemplateImpl :: getTemplate() + throw (com::sun::star::uno::RuntimeException) +{ + return m_xTemplate ; +} + +void SAL_CALL XMLSignatureTemplateImpl :: setTarget( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::wrapper::XXMLElementWrapper >& aXmlElement ) + throw( com::sun::star::uno::RuntimeException, com::sun::star::lang::IllegalArgumentException) +{ + targets.push_back( aXmlElement ); +} + +::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::xml::wrapper::XXMLElementWrapper > > SAL_CALL XMLSignatureTemplateImpl :: getTargets() + throw (com::sun::star::uno::RuntimeException) +{ + sal_Int32 length = targets.size(); + ::com::sun::star::uno::Sequence< + ::com::sun::star::uno::Reference< ::com::sun::star::xml::wrapper::XXMLElementWrapper > + > aTargets (length); + + sal_Int32 i; + + for (i=0; i<length; i++) + { + aTargets[i] = targets[i]; + } + + return aTargets; +} + +void SAL_CALL XMLSignatureTemplateImpl::setBinding( + const ::com::sun::star::uno::Reference< + ::com::sun::star::xml::crypto::XUriBinding >& aUriBinding ) + throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException) +{ + m_xUriBinding = aUriBinding; +} + +::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XUriBinding > SAL_CALL XMLSignatureTemplateImpl::getBinding() + throw (::com::sun::star::uno::RuntimeException) +{ + return m_xUriBinding; +} + +void SAL_CALL XMLSignatureTemplateImpl::setStatus( + ::com::sun::star::xml::crypto::SecurityOperationStatus status ) + throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException) +{ + m_nStatus = status; +} + +::com::sun::star::xml::crypto::SecurityOperationStatus SAL_CALL XMLSignatureTemplateImpl::getStatus( ) + throw (::com::sun::star::uno::RuntimeException) +{ + return m_nStatus; +} + +/* XInitialization */ +void SAL_CALL XMLSignatureTemplateImpl :: initialize( const Sequence< Any >& /*aArguments*/ ) throw( Exception, RuntimeException ) { + // TBD +} ; + +/* XServiceInfo */ +OUString SAL_CALL XMLSignatureTemplateImpl :: getImplementationName() throw( RuntimeException ) { + return impl_getImplementationName() ; +} + +/* XServiceInfo */ +sal_Bool SAL_CALL XMLSignatureTemplateImpl :: supportsService( const OUString& serviceName) throw( RuntimeException ) { + Sequence< OUString > seqServiceNames = getSupportedServiceNames() ; + const OUString* pArray = seqServiceNames.getConstArray() ; + for( sal_Int32 i = 0 ; i < seqServiceNames.getLength() ; i ++ ) { + if( *( pArray + i ) == serviceName ) + return sal_True ; + } + return sal_False ; +} + +/* XServiceInfo */ +Sequence< OUString > SAL_CALL XMLSignatureTemplateImpl :: getSupportedServiceNames() throw( RuntimeException ) { + return impl_getSupportedServiceNames() ; +} + +//Helper for XServiceInfo +Sequence< OUString > XMLSignatureTemplateImpl :: impl_getSupportedServiceNames() { + ::osl::Guard< ::osl::Mutex > aGuard( ::osl::Mutex::getGlobalMutex() ) ; + Sequence< OUString > seqServiceNames( 1 ) ; + seqServiceNames.getArray()[0] = OUString::createFromAscii( "com.sun.star.xml.crypto.XMLSignatureTemplate" ) ; + return seqServiceNames ; +} + +OUString XMLSignatureTemplateImpl :: impl_getImplementationName() throw( RuntimeException ) { + return OUString::createFromAscii( "com.sun.star.xml.security.framework.XMLSignatureTemplateImpl" ) ; +} + +//Helper for registry +Reference< XInterface > SAL_CALL XMLSignatureTemplateImpl :: impl_createInstance( const Reference< XMultiServiceFactory >& aServiceManager ) throw( RuntimeException ) { + return Reference< XInterface >( *new XMLSignatureTemplateImpl( aServiceManager ) ) ; +} + +Reference< XSingleServiceFactory > XMLSignatureTemplateImpl :: impl_createFactory( const Reference< XMultiServiceFactory >& aServiceManager ) { + //Reference< XSingleServiceFactory > xFactory ; + //xFactory = ::cppu::createSingleFactory( aServiceManager , impl_getImplementationName , impl_createInstance , impl_getSupportedServiceNames ) ; + //return xFactory ; + return ::cppu::createSingleFactory( aServiceManager , impl_getImplementationName() , impl_createInstance , impl_getSupportedServiceNames() ) ; +} + diff --git a/xmlsecurity/source/framework/xmlsignaturetemplateimpl.hxx b/xmlsecurity/source/framework/xmlsignaturetemplateimpl.hxx new file mode 100644 index 000000000000..c4e33fdfe972 --- /dev/null +++ b/xmlsecurity/source/framework/xmlsignaturetemplateimpl.hxx @@ -0,0 +1,125 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _XMLSIGNATURETEMPLATEIMPL_HXX_ +#define _XMLSIGNATURETEMPLATEIMPL_HXX_ + +#include <sal/config.h> +#include <rtl/ustring.hxx> +#include <cppuhelper/factory.hxx> +#include <cppuhelper/implbase3.hxx> +#include <com/sun/star/uno/Exception.hpp> + +#ifndef _COM_SUN_STAR_UNO_REFERENCE_HPP_ +#include <com/sun/star/uno/Reference.hxx> +#endif +#include <com/sun/star/lang/XSingleServiceFactory.hpp> + +#ifndef _COM_SUN_STAR_LANG_XSECVICEINFO_HPP_ +#include <com/sun/star/lang/XServiceInfo.hpp> +#endif +#include <com/sun/star/lang/XInitialization.hpp> +#include <com/sun/star/xml/crypto/XXMLSignatureTemplate.hpp> +#include <com/sun/star/xml/wrapper/XXMLElementWrapper.hpp> + +#ifndef __SGI_STL_VECTOR +#include <vector> +#endif + +class XMLSignatureTemplateImpl : public ::cppu::WeakImplHelper3< + ::com::sun::star::xml::crypto::XXMLSignatureTemplate , + ::com::sun::star::lang::XInitialization , + ::com::sun::star::lang::XServiceInfo > +{ + private : + ::com::sun::star::uno::Reference< ::com::sun::star::xml::wrapper::XXMLElementWrapper > m_xTemplate ; + ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xServiceManager ; + std::vector< ::com::sun::star::uno::Reference< ::com::sun::star::xml::wrapper::XXMLElementWrapper > > targets; + ::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XUriBinding > m_xUriBinding; + ::com::sun::star::xml::crypto::SecurityOperationStatus m_nStatus; + + public : + XMLSignatureTemplateImpl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& aFactory ) ; + virtual ~XMLSignatureTemplateImpl() ; + + //Methods from XXMLSignatureTemplate + virtual void SAL_CALL setTemplate( + const ::com::sun::star::uno::Reference< ::com::sun::star::xml::wrapper::XXMLElementWrapper >& aXmlElement + ) throw( com::sun::star::uno::RuntimeException, com::sun::star::lang::IllegalArgumentException); + + virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::wrapper::XXMLElementWrapper > SAL_CALL getTemplate( + ) throw (com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL setTarget( + const ::com::sun::star::uno::Reference< ::com::sun::star::xml::wrapper::XXMLElementWrapper >& aXmlElement + ) throw( com::sun::star::uno::RuntimeException, com::sun::star::lang::IllegalArgumentException); + + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::xml::wrapper::XXMLElementWrapper > > SAL_CALL getTargets( + ) throw (com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL setBinding( + const ::com::sun::star::uno::Reference< + ::com::sun::star::xml::crypto::XUriBinding >& aUriBinding ) + throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::xml::crypto::XUriBinding > + SAL_CALL getBinding( ) + throw (::com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL setStatus( + ::com::sun::star::xml::crypto::SecurityOperationStatus status ) + throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::xml::crypto::SecurityOperationStatus + SAL_CALL getStatus( ) + throw (::com::sun::star::uno::RuntimeException); + + //Methods from XInitialization + virtual void SAL_CALL initialize( + const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments + ) throw( ::com::sun::star::uno::Exception , ::com::sun::star::uno::RuntimeException ) ; + + //Methods from XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException ) ; + + virtual sal_Bool SAL_CALL supportsService( + const ::rtl::OUString& ServiceName + ) throw( ::com::sun::star::uno::RuntimeException ) ; + + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException ) ; + + //Helper for XServiceInfo + static ::com::sun::star::uno::Sequence< ::rtl::OUString > impl_getSupportedServiceNames() ; + + static ::rtl::OUString impl_getImplementationName() throw( ::com::sun::star::uno::RuntimeException ) ; + + //Helper for registry + static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL impl_createInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& aServiceManager ) throw( ::com::sun::star::uno::RuntimeException ) ; + + static ::com::sun::star::uno::Reference< ::com::sun::star::lang::XSingleServiceFactory > impl_createFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& aServiceManager ) ; +} ; + +#endif // _XMLSIGNATURETEMPLATE_XMLSECIMPL_HXX_ diff --git a/xmlsecurity/source/framework/xsec_framework.cxx b/xmlsecurity/source/framework/xsec_framework.cxx new file mode 100644 index 000000000000..a9c418595901 --- /dev/null +++ b/xmlsecurity/source/framework/xsec_framework.cxx @@ -0,0 +1,173 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_xmlsecurity.hxx" + +#include <stdio.h> + +#include <osl/mutex.hxx> +#include <osl/thread.h> +#include <cppuhelper/factory.hxx> +#include <com/sun/star/lang/XSingleServiceFactory.hpp> + +#include <decryptorimpl.hxx> +#include <encryptorimpl.hxx> +#include <signaturecreatorimpl.hxx> +#include <signatureverifierimpl.hxx> +#include <saxeventkeeperimpl.hxx> +#include <xmlencryptiontemplateimpl.hxx> +#include <xmlsignaturetemplateimpl.hxx> + +using namespace ::rtl; +using namespace ::cppu; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::lang; +using namespace ::com::sun::star::registry; + +extern "C" +{ +//================================================================================================== +void SAL_CALL component_getImplementationEnvironment( + const sal_Char ** ppEnvTypeName, uno_Environment **) +{ + *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; +} + +//================================================================================================== +void * SAL_CALL component_getFactory( + const sal_Char * pImplName, void * pServiceManager, void * /*pRegistryKey*/ ) +{ + void * pRet = 0; + + //Decryptor + OUString implName = OUString::createFromAscii( pImplName ); + if ( pServiceManager && implName.equals(DecryptorImpl_getImplementationName()) ) + { + Reference< XSingleServiceFactory > xFactory( createSingleFactory( + reinterpret_cast< XMultiServiceFactory * >( pServiceManager ), + OUString::createFromAscii( pImplName ), + DecryptorImpl_createInstance, DecryptorImpl_getSupportedServiceNames() ) ); + + if (xFactory.is()) + { + xFactory->acquire(); + pRet = xFactory.get(); + } + } + + //Encryptor + if ( pServiceManager && implName.equals(EncryptorImpl_getImplementationName()) ) + { + Reference< XSingleServiceFactory > xFactory( createSingleFactory( + reinterpret_cast< XMultiServiceFactory * >( pServiceManager ), + OUString::createFromAscii( pImplName ), + EncryptorImpl_createInstance, EncryptorImpl_getSupportedServiceNames() ) ); + + if (xFactory.is()) + { + xFactory->acquire(); + pRet = xFactory.get(); + } + } + + //SignatureCreator + if ( pServiceManager && implName.equals(SignatureCreatorImpl_getImplementationName()) ) + { + Reference< XSingleServiceFactory > xFactory( createSingleFactory( + reinterpret_cast< XMultiServiceFactory * >( pServiceManager ), + OUString::createFromAscii( pImplName ), + SignatureCreatorImpl_createInstance, SignatureCreatorImpl_getSupportedServiceNames() ) ); + + if (xFactory.is()) + { + xFactory->acquire(); + pRet = xFactory.get(); + } + } + + //SignatureVerifier + if ( pServiceManager && implName.equals(SignatureVerifierImpl_getImplementationName()) ) + { + Reference< XSingleServiceFactory > xFactory( createSingleFactory( + reinterpret_cast< XMultiServiceFactory * >( pServiceManager ), + OUString::createFromAscii( pImplName ), + SignatureVerifierImpl_createInstance, SignatureVerifierImpl_getSupportedServiceNames() ) ); + + if (xFactory.is()) + { + xFactory->acquire(); + pRet = xFactory.get(); + } + } + + //SAXEventKeeper + if ( pServiceManager && implName.equals(SAXEventKeeperImpl_getImplementationName()) ) + { + Reference< XSingleServiceFactory > xFactory( createSingleFactory( + reinterpret_cast< XMultiServiceFactory * >( pServiceManager ), + OUString::createFromAscii( pImplName ), + SAXEventKeeperImpl_createInstance, SAXEventKeeperImpl_getSupportedServiceNames() ) ); + + if (xFactory.is()) + { + xFactory->acquire(); + pRet = xFactory.get(); + } + } + + //XMLSignatureTemplate + if ( pServiceManager && implName.equals( XMLSignatureTemplateImpl::impl_getImplementationName()) ) + { + Reference< XSingleServiceFactory > xFactory = XMLSignatureTemplateImpl::impl_createFactory( + reinterpret_cast< XMultiServiceFactory* >( pServiceManager ) ) ; + + if (xFactory.is()) + { + xFactory->acquire(); + pRet = xFactory.get(); + } + } + + //XMLEncryptionTemplate + if ( pServiceManager && implName.equals( XMLEncryptionTemplateImpl::impl_getImplementationName()) ) + { + Reference< XSingleServiceFactory > xFactory = XMLEncryptionTemplateImpl::impl_createFactory( + reinterpret_cast< XMultiServiceFactory* >( pServiceManager ) ) ; + + if (xFactory.is()) + { + xFactory->acquire(); + pRet = xFactory.get(); + } + } + + return pRet; +} +} + + diff --git a/xmlsecurity/source/helper/documentsignaturehelper.cxx b/xmlsecurity/source/helper/documentsignaturehelper.cxx new file mode 100644 index 000000000000..d0fba345588c --- /dev/null +++ b/xmlsecurity/source/helper/documentsignaturehelper.cxx @@ -0,0 +1,462 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_xmlsecurity.hxx" + +#include <xmlsecurity/documentsignaturehelper.hxx> + +#include <com/sun/star/container/XNameAccess.hpp> +#include <com/sun/star/lang/XComponent.hpp> +#include <com/sun/star/lang/DisposedException.hpp> +#include <com/sun/star/embed/XStorage.hpp> +#include <com/sun/star/embed/ElementModes.hpp> +#include "com/sun/star/beans/XPropertySet.hpp" + +#include "comphelper/documentconstants.hxx" +#include <tools/debug.hxx> +#include "rtl/uri.hxx" + +using namespace ::com::sun::star::uno; +//using namespace ::com::sun::star; +namespace css = ::com::sun::star; +using rtl::OUString; + + +namespace +{ +::rtl::OUString getElement(::rtl::OUString const & version, ::sal_Int32 * index) +{ + while (*index < version.getLength() && version[*index] == '0') { + ++*index; + } + return version.getToken(0, '.', *index); +} + + + +// Return 1 if version1 is greater then version 2, 0 if they are equal +//and -1 if version1 is less version 2 +int compareVersions( + ::rtl::OUString const & version1, ::rtl::OUString const & version2) +{ + for (::sal_Int32 i1 = 0, i2 = 0; i1 >= 0 || i2 >= 0;) { + ::rtl::OUString e1(getElement(version1, &i1)); + ::rtl::OUString e2(getElement(version2, &i2)); + if (e1.getLength() < e2.getLength()) { + return -1; + } else if (e1.getLength() > e2.getLength()) { + return 1; + } else if (e1 < e2) { + return -1; + } else if (e1 > e2) { + return 1; + } + } + return 0; +} +} +//If the OOo 3.0 mode is used then we exclude +//'mimetype' and all content of 'META-INF'. +//If the argument 'bSigning' is true then the element list is created for a signing +//operation in which case we use the latest signing algorithm. That is all elements +//we find in the zip storage are added to the list. We do not support the old signatures +//which did not contain all files. +//If 'bSigning' is false, then we validate. If the user enabled validating according to OOo 3.0 +//then mimetype and all content of META-INF must be excluded. +void ImplFillElementList( + std::vector< rtl::OUString >& rList, const Reference < css::embed::XStorage >& rxStore, + const ::rtl::OUString rRootStorageName, const bool bRecursive, + const DocumentSignatureAlgorithm mode) +{ + ::rtl::OUString aMetaInfName( RTL_CONSTASCII_USTRINGPARAM( "META-INF" ) ); + ::rtl::OUString sMimeTypeName (RTL_CONSTASCII_USTRINGPARAM("mimetype")); + ::rtl::OUString aSep( RTL_CONSTASCII_USTRINGPARAM( "/" ) ); + + Reference < css::container::XNameAccess > xElements( rxStore, UNO_QUERY ); + Sequence< ::rtl::OUString > aElements = xElements->getElementNames(); + sal_Int32 nElements = aElements.getLength(); + const ::rtl::OUString* pNames = aElements.getConstArray(); + + for ( sal_Int32 n = 0; n < nElements; n++ ) + { + if (mode != OOo3_2Document + && (pNames[n] == aMetaInfName + || pNames[n] == sMimeTypeName)) + { + continue; + } + else + { + ::rtl::OUString sEncName = ::rtl::Uri::encode( + pNames[n], rtl_UriCharClassRelSegment, + rtl_UriEncodeStrict, RTL_TEXTENCODING_UTF8); + if (sEncName.getLength() == 0 && pNames[n].getLength() != 0) + throw css::uno::Exception(::rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM("Failed to encode element name of XStorage")), 0); + + if ( rxStore->isStreamElement( pNames[n] ) ) + { + //Exclude documentsignatures.xml! + if (pNames[n].equals( + DocumentSignatureHelper::GetDocumentContentSignatureDefaultStreamName())) + continue; + ::rtl::OUString aFullName( rRootStorageName + sEncName ); + rList.push_back(aFullName); + } + else if ( bRecursive && rxStore->isStorageElement( pNames[n] ) ) + { + Reference < css::embed::XStorage > xSubStore = rxStore->openStorageElement( pNames[n], css::embed::ElementModes::READ ); + rtl::OUString aFullRootName( rRootStorageName + sEncName + aSep ); + ImplFillElementList(rList, xSubStore, aFullRootName, bRecursive, mode); + } + } + } +} + + +bool DocumentSignatureHelper::isODFPre_1_2(const ::rtl::OUString & sVersion) +{ + //The property version exists only if the document is at least version 1.2 + //That is, if the document has version 1.1 and sVersion is empty. + //The constant is defined in comphelper/documentconstants.hxx + if (compareVersions(sVersion, ODFVER_012_TEXT) == -1) + return true; + return false; +} + +bool DocumentSignatureHelper::isOOo3_2_Signature(const SignatureInformation & sigInfo) +{ + ::rtl::OUString sManifestURI(RTL_CONSTASCII_USTRINGPARAM("META-INF/manifest.xml")); + bool bOOo3_2 = false; + typedef ::std::vector< SignatureReferenceInformation >::const_iterator CIT; + for (CIT i = sigInfo.vSignatureReferenceInfors.begin(); + i < sigInfo.vSignatureReferenceInfors.end(); i++) + { + if (i->ouURI.equals(sManifestURI)) + { + bOOo3_2 = true; + break; + } + } + return bOOo3_2; +} + +DocumentSignatureAlgorithm +DocumentSignatureHelper::getDocumentAlgorithm( + const ::rtl::OUString & sODFVersion, const SignatureInformation & sigInfo) +{ + OSL_ASSERT(sODFVersion.getLength()); + DocumentSignatureAlgorithm mode = OOo3_2Document; + if (!isOOo3_2_Signature(sigInfo)) + { + if (isODFPre_1_2(sODFVersion)) + mode = OOo2Document; + else + mode = OOo3_0Document; + } + return mode; +} + +//The function creates a list of files which are to be signed or for which +//the signature is to be validated. The strings are UTF8 encoded URIs which +//contain '/' as path separators. +// +//The algorithm how document signatures are created and validated has +//changed over time. The change affects only which files within the document +//are changed. Document signatures created by OOo 2.x only used particular files. Since +//OOo 3.0 everything except "mimetype" and "META-INF" are signed. As of OOo 3.2 everything +//except META-INF/documentsignatures.xml is signed. +//Signatures are validated according to the algorithm which was then used for validation. +//That is, when validating a signature which was created by OOo 3.0, then mimetype and +//META-INF are not used. +// +//When a signature is created then we always use the latest algorithm. That is, we use +//that of OOo 3.2 +std::vector< rtl::OUString > +DocumentSignatureHelper::CreateElementList( + const Reference < css::embed::XStorage >& rxStore, + const ::rtl::OUString /*rRootStorageName*/, DocumentSignatureMode eMode, + const DocumentSignatureAlgorithm mode) +{ + std::vector< rtl::OUString > aElements; + ::rtl::OUString aSep( RTL_CONSTASCII_USTRINGPARAM( "/" ) ); + + switch ( eMode ) + { + case SignatureModeDocumentContent: + { + if (mode == OOo2Document) //that is, ODF 1.0, 1.1 + { + // 1) Main content + ImplFillElementList(aElements, rxStore, ::rtl::OUString(), false, mode); + + // 2) Pictures... + rtl::OUString aSubStorageName( rtl::OUString::createFromAscii( "Pictures" ) ); + try + { + Reference < css::embed::XStorage > xSubStore = rxStore->openStorageElement( aSubStorageName, css::embed::ElementModes::READ ); + ImplFillElementList(aElements, xSubStore, aSubStorageName+aSep, true, mode); + } + catch(css::io::IOException& ) + { + ; // Doesn't have to exist... + } + // 3) OLE.... + aSubStorageName = rtl::OUString::createFromAscii( "ObjectReplacements" ); + try + { + Reference < css::embed::XStorage > xSubStore = rxStore->openStorageElement( aSubStorageName, css::embed::ElementModes::READ ); + ImplFillElementList(aElements, xSubStore, aSubStorageName+aSep, true, mode); + xSubStore.clear(); + + // Object folders... + rtl::OUString aMatchStr( rtl::OUString::createFromAscii( "Object " ) ); + Reference < css::container::XNameAccess > xElements( rxStore, UNO_QUERY ); + Sequence< ::rtl::OUString > aElementNames = xElements->getElementNames(); + sal_Int32 nElements = aElementNames.getLength(); + const ::rtl::OUString* pNames = aElementNames.getConstArray(); + for ( sal_Int32 n = 0; n < nElements; n++ ) + { + if ( ( pNames[n].match( aMatchStr ) ) && rxStore->isStorageElement( pNames[n] ) ) + { + Reference < css::embed::XStorage > xTmpSubStore = rxStore->openStorageElement( pNames[n], css::embed::ElementModes::READ ); + ImplFillElementList(aElements, xTmpSubStore, pNames[n]+aSep, true, mode); + } + } + } + catch( com::sun::star::io::IOException& ) + { + ; // Doesn't have to exist... + } + } + else + { + // Everything except META-INF + ImplFillElementList(aElements, rxStore, ::rtl::OUString(), true, mode); + } + } + break; + case SignatureModeMacros: + { + // 1) Macros + rtl::OUString aSubStorageName( rtl::OUString::createFromAscii( "Basic" ) ); + try + { + Reference < css::embed::XStorage > xSubStore = rxStore->openStorageElement( aSubStorageName, css::embed::ElementModes::READ ); + ImplFillElementList(aElements, xSubStore, aSubStorageName+aSep, true, mode); + } + catch( com::sun::star::io::IOException& ) + { + ; // Doesn't have to exist... + } + + // 2) Dialogs + aSubStorageName = rtl::OUString::createFromAscii( "Dialogs") ; + try + { + Reference < css::embed::XStorage > xSubStore = rxStore->openStorageElement( aSubStorageName, css::embed::ElementModes::READ ); + ImplFillElementList(aElements, xSubStore, aSubStorageName+aSep, true, mode); + } + catch( com::sun::star::io::IOException& ) + { + ; // Doesn't have to exist... + } + // 3) Scripts + aSubStorageName = rtl::OUString::createFromAscii( "Scripts") ; + try + { + Reference < css::embed::XStorage > xSubStore = rxStore->openStorageElement( aSubStorageName, css::embed::ElementModes::READ ); + ImplFillElementList(aElements, xSubStore, aSubStorageName+aSep, true, mode); + } + catch( css::io::IOException& ) + { + ; // Doesn't have to exist... + } + } + break; + case SignatureModePackage: + { + // Everything except META-INF + ImplFillElementList(aElements, rxStore, ::rtl::OUString(), true, mode); + } + break; + } + + return aElements; +} + +SignatureStreamHelper DocumentSignatureHelper::OpenSignatureStream( + const Reference < css::embed::XStorage >& rxStore, sal_Int32 nOpenMode, DocumentSignatureMode eDocSigMode ) +{ + sal_Int32 nSubStorageOpenMode = css::embed::ElementModes::READ; + if ( nOpenMode & css::embed::ElementModes::WRITE ) + nSubStorageOpenMode = css::embed::ElementModes::WRITE; + + SignatureStreamHelper aHelper; + + try + { + ::rtl::OUString aSIGStoreName( RTL_CONSTASCII_USTRINGPARAM( "META-INF" ) ); + aHelper.xSignatureStorage = rxStore->openStorageElement( aSIGStoreName, nSubStorageOpenMode ); + if ( aHelper.xSignatureStorage.is() ) + { + ::rtl::OUString aSIGStreamName; + if ( eDocSigMode == SignatureModeDocumentContent ) + aSIGStreamName = DocumentSignatureHelper::GetDocumentContentSignatureDefaultStreamName(); + else if ( eDocSigMode == SignatureModeMacros ) + aSIGStreamName = DocumentSignatureHelper::GetScriptingContentSignatureDefaultStreamName(); + else + aSIGStreamName = DocumentSignatureHelper::GetPackageSignatureDefaultStreamName(); + + aHelper.xSignatureStream = aHelper.xSignatureStorage->openStreamElement( aSIGStreamName, nOpenMode ); + } + } + catch(css::io::IOException& ) + { + // Doesn't have to exist... + DBG_ASSERT( nOpenMode == css::embed::ElementModes::READ, "Error creating signature stream..." ); + } + + return aHelper; +} + +//sElementList contains all files which are expected to be signed. Only those files must me signed, +//no more, no less. +//The DocumentSignatureAlgorithm indicates if the document was created with OOo 2.x. Then +//the uri s in the Reference elements in the signature, were not properly encoded. +// For example: <Reference URI="ObjectReplacements/Object 1"> +bool DocumentSignatureHelper::checkIfAllFilesAreSigned( + const ::std::vector< ::rtl::OUString > & sElementList, + const SignatureInformation & sigInfo, + const DocumentSignatureAlgorithm alg) +{ + // Can only be valid if ALL streams are signed, which means real stream count == signed stream count + unsigned int nRealCount = 0; + for ( int i = sigInfo.vSignatureReferenceInfors.size(); i; ) + { + const SignatureReferenceInformation& rInf = sigInfo.vSignatureReferenceInfors[--i]; + // There is also an extra entry of type TYPE_SAMEDOCUMENT_REFERENCE because of signature date. + if ( ( rInf.nType == TYPE_BINARYSTREAM_REFERENCE ) || ( rInf.nType == TYPE_XMLSTREAM_REFERENCE ) ) + { + ::rtl::OUString sReferenceURI = rInf.ouURI; + if (alg == OOo2Document) + { + //Comparing URIs is a difficult. Therefore we kind of normalize + //it before comparing. We assume that our URI do not have a leading "./" + //and fragments at the end (...#...) + sReferenceURI = ::rtl::Uri::encode( + sReferenceURI, rtl_UriCharClassPchar, + rtl_UriEncodeCheckEscapes, RTL_TEXTENCODING_UTF8); + } + + //find the file in the element list + typedef ::std::vector< ::rtl::OUString >::const_iterator CIT; + for (CIT aIter = sElementList.begin(); aIter < sElementList.end(); aIter++) + { + ::rtl::OUString sElementListURI = *aIter; + if (alg == OOo2Document) + { + sElementListURI = + ::rtl::Uri::encode( + sElementListURI, rtl_UriCharClassPchar, + rtl_UriEncodeCheckEscapes, RTL_TEXTENCODING_UTF8); + } + if (sElementListURI.equals(sReferenceURI)) + { + nRealCount++; + break; + } + } + } + } + return sElementList.size() == nRealCount; +} + +/*Compares the Uri which are obtained from CreateElementList with + the path obtained from the manifest.xml. + Returns true if both strings are equal. +*/ +bool DocumentSignatureHelper::equalsReferenceUriManifestPath( + const OUString & rUri, const OUString & rPath) +{ + bool retVal = false; + //split up the uri and path into segments. Both are separated by '/' + std::vector<OUString> vUriSegments; + sal_Int32 nIndex = 0; + do + { + OUString aToken = rUri.getToken( 0, '/', nIndex ); + vUriSegments.push_back(aToken); + } + while (nIndex >= 0); + + std::vector<OUString> vPathSegments; + nIndex = 0; + do + { + OUString aToken = rPath.getToken( 0, '/', nIndex ); + vPathSegments.push_back(aToken); + } + while (nIndex >= 0); + + //Now compare each segment of the uri with its counterpart from the path + if (vUriSegments.size() == vPathSegments.size()) + { + retVal = true; + typedef std::vector<OUString>::const_iterator CIT; + for (CIT i = vUriSegments.begin(), j = vPathSegments.begin(); + i != vUriSegments.end(); i++, j++) + { + //Decode the uri segment, so that %20 becomes ' ', etc. + OUString sDecUri = ::rtl::Uri::decode( + *i, rtl_UriDecodeWithCharset, RTL_TEXTENCODING_UTF8); + if (!sDecUri.equals(*j)) + { + retVal = false; + break; + } + } + } + + return retVal; +} + +::rtl::OUString DocumentSignatureHelper::GetDocumentContentSignatureDefaultStreamName() +{ + return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "documentsignatures.xml" ) ); +} + +::rtl::OUString DocumentSignatureHelper::GetScriptingContentSignatureDefaultStreamName() +{ + return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "macrosignatures.xml" ) ); +} + +::rtl::OUString DocumentSignatureHelper::GetPackageSignatureDefaultStreamName() +{ + return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "packagesignatures.xml" ) ); +} diff --git a/xmlsecurity/source/helper/makefile.mk b/xmlsecurity/source/helper/makefile.mk new file mode 100644 index 000000000000..6b5a6a525e48 --- /dev/null +++ b/xmlsecurity/source/helper/makefile.mk @@ -0,0 +1,54 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2000, 2010 Oracle and/or its affiliates. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# This file is part of OpenOffice.org. +# +# OpenOffice.org is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License version 3 +# only, as published by the Free Software Foundation. +# +# OpenOffice.org is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License version 3 for more details +# (a copy is included in the LICENSE file that accompanied this code). +# +# You should have received a copy of the GNU Lesser General Public License +# version 3 along with OpenOffice.org. If not, see +# <http://www.openoffice.org/license.html> +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +PRJ=..$/.. + +PRJNAME=xmlsecurity +TARGET=helper + +ENABLE_EXCEPTIONS=TRUE + +# --- Settings ----------------------------------------------------- + +.INCLUDE : settings.mk +.INCLUDE : $(PRJ)$/util$/target.pmk + +# --- Files -------------------------------------------------------- + +SLOFILES= \ + $(SLO)$/documentsignaturehelper.obj \ + $(SLO)$/xmlsignaturehelper.obj \ + $(SLO)$/xmlsignaturehelper2.obj \ + $(SLO)$/xsecctl.obj \ + $(SLO)$/xsecparser.obj \ + $(SLO)$/xsecsign.obj \ + $(SLO)$/xsecverify.obj + + +# --- Targets ------------------------------------------------------ + +.INCLUDE : target.mk diff --git a/xmlsecurity/source/helper/xmlsignaturehelper.cxx b/xmlsecurity/source/helper/xmlsignaturehelper.cxx new file mode 100644 index 000000000000..dd3ae00f69c1 --- /dev/null +++ b/xmlsecurity/source/helper/xmlsignaturehelper.cxx @@ -0,0 +1,467 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_xmlsecurity.hxx" + +#include <xmlsecurity/xmlsignaturehelper.hxx> +#include <xmlsecurity/documentsignaturehelper.hxx> +#include <xsecctl.hxx> + +#include <xmlsignaturehelper2.hxx> + +#include <tools/stream.hxx> +#include <tools/debug.hxx> + +#include <xmloff/attrlist.hxx> + +#include <com/sun/star/io/XOutputStream.hpp> +#include <com/sun/star/io/XInputStream.hpp> +#include <com/sun/star/io/XActiveDataSource.hpp> +#include <com/sun/star/lang/XComponent.hpp> +#include <com/sun/star/security/SerialNumberAdapter.hpp> +#include <com/sun/star/beans/XPropertySet.hpp> + +#include <tools/date.hxx> +#include <tools/time.hxx> + +//MM : search for the default profile +//#include <unotools/streamhelper.hxx> +//MM : end + +/* SEInitializer component */ +#define SEINITIALIZER_COMPONENT "com.sun.star.xml.crypto.SEInitializer" + +#define TAG_DOCUMENTSIGNATURES "document-signatures" +#define NS_DOCUMENTSIGNATURES "http://openoffice.org/2004/documentsignatures" +#define NS_DOCUMENTSIGNATURES_ODF_1_2 "urn:oasis:names:tc:opendocument:xmlns:digitalsignature:1.0" + +using namespace ::com::sun::star; +using namespace ::com::sun::star::uno; + +XMLSignatureHelper::XMLSignatureHelper( const uno::Reference< uno::XComponentContext >& rxCtx) + : mxCtx(rxCtx), mbODFPre1_2(false) +{ + mpXSecController = new XSecController(rxCtx); + mxSecurityController = mpXSecController; + mbError = false; +} + +XMLSignatureHelper::~XMLSignatureHelper() +{ + if ( mxSEInitializer.is() && mxSecurityContext.is() ) + mxSEInitializer->freeSecurityContext( mxSecurityContext ); +} + +bool XMLSignatureHelper::Init( const rtl::OUString& rTokenPath ) +{ + DBG_ASSERT( !mxSEInitializer.is(), "XMLSignatureHelper::Init - mxSEInitializer already set!" ); + DBG_ASSERT( !mxSecurityContext.is(), "XMLSignatureHelper::Init - mxSecurityContext already set!" ); + + ImplCreateSEInitializer(); + + if ( mxSEInitializer.is() ) + mxSecurityContext = mxSEInitializer->createSecurityContext( rTokenPath ); + + return mxSecurityContext.is(); +} + +void XMLSignatureHelper::ImplCreateSEInitializer() +{ + rtl::OUString sSEInitializer(rtl::OUString::createFromAscii( SEINITIALIZER_COMPONENT )); + uno::Reference< lang::XMultiComponentFactory > xMCF( mxCtx->getServiceManager() ); + mxSEInitializer = uno::Reference< com::sun::star::xml::crypto::XSEInitializer > ( + xMCF->createInstanceWithContext( sSEInitializer, mxCtx ), uno::UNO_QUERY ); +} + +void XMLSignatureHelper::SetUriBinding( com::sun::star::uno::Reference< com::sun::star::xml::crypto::XUriBinding >& rxUriBinding ) +{ + mxUriBinding = rxUriBinding; +} + +com::sun::star::uno::Reference< com::sun::star::xml::crypto::XUriBinding > XMLSignatureHelper::GetUriBinding() const +{ + return mxUriBinding; +} + +void XMLSignatureHelper::SetStorage( + const Reference < css::embed::XStorage >& rxStorage, + ::rtl::OUString sODFVersion) +{ + DBG_ASSERT( !mxUriBinding.is(), "SetStorage - UriBinding already set!" ); + mxUriBinding = new UriBindingHelper( rxStorage ); + DBG_ASSERT(rxStorage.is(), "SetStorage - empty storage!"); + mbODFPre1_2 = DocumentSignatureHelper::isODFPre_1_2(sODFVersion); +} + + +void XMLSignatureHelper::SetStartVerifySignatureHdl( const Link& rLink ) +{ + maStartVerifySignatureHdl = rLink; +} + + +void XMLSignatureHelper::StartMission() +{ + if ( !mxUriBinding.is() ) + mxUriBinding = new UriBindingHelper(); + + mpXSecController->startMission( mxUriBinding, mxSecurityContext ); +} + +void XMLSignatureHelper::EndMission() +{ + mpXSecController->endMission(); +} + +sal_Int32 XMLSignatureHelper::GetNewSecurityId() +{ + return mpXSecController->getNewSecurityId(); +} + +void XMLSignatureHelper::SetX509Certificate( + sal_Int32 nSecurityId, + const rtl::OUString& ouX509IssuerName, + const rtl::OUString& ouX509SerialNumber, + const rtl::OUString& ouX509Cert) +{ + mpXSecController->setX509Certificate( + nSecurityId, + ouX509IssuerName, + ouX509SerialNumber, + ouX509Cert); +} + +void XMLSignatureHelper::SetX509Certificate( + sal_Int32 nSecurityId, + sal_Int32 nSecurityEnvironmentIndex, + const rtl::OUString& ouX509IssuerName, + const rtl::OUString& ouX509SerialNumber, + const rtl::OUString& ouX509Cert) +{ + mpXSecController->setX509Certificate( + nSecurityId, + nSecurityEnvironmentIndex, + ouX509IssuerName, + ouX509SerialNumber, + ouX509Cert); +} + +void XMLSignatureHelper::SetDateTime( sal_Int32 nSecurityId, const Date& rDate, const Time& rTime ) +{ + /* + rtl::OUString aDate = String::CreateFromInt32( rDate.GetDate() ); + rtl::OUString aTime = String::CreateFromInt32( rTime.GetTime() ); + mpXSecController->setDateTime( nSecurityId, aDate, aTime ); + */ + ::com::sun::star::util::DateTime stDateTime; + stDateTime.HundredthSeconds = (::sal_uInt16)rTime.Get100Sec(); + stDateTime.Seconds = (::sal_uInt16)rTime.GetSec(); + stDateTime.Minutes = (::sal_uInt16)rTime.GetMin(); + stDateTime.Hours = (::sal_uInt16)rTime.GetHour(); + stDateTime.Day = (::sal_uInt16)rDate.GetDay(); + stDateTime.Month = (::sal_uInt16)rDate.GetMonth(); + stDateTime.Year = (::sal_uInt16)rDate.GetYear(); + mpXSecController->setDate( nSecurityId, stDateTime ); +} + +void XMLSignatureHelper::AddForSigning( sal_Int32 nSecurityId, const rtl::OUString& uri, const rtl::OUString& objectURL, sal_Bool bBinary ) +{ + mpXSecController->signAStream( nSecurityId, uri, objectURL, bBinary ); +} + + +uno::Reference<xml::sax::XDocumentHandler> XMLSignatureHelper::CreateDocumentHandlerWithHeader( + const com::sun::star::uno::Reference< com::sun::star::io::XOutputStream >& xOutputStream ) +{ + /* + * get SAX writer component + */ + uno::Reference< lang::XMultiComponentFactory > xMCF( mxCtx->getServiceManager() ); + uno::Reference< io::XActiveDataSource > xSaxWriter( + xMCF->createInstanceWithContext(rtl::OUString::createFromAscii( + "com.sun.star.xml.sax.Writer"), mxCtx ), uno::UNO_QUERY ); + + DBG_ASSERT( xSaxWriter.is(), "can't instantiate XML writer" ); + + /* + * connect XML writer to output stream + */ + xSaxWriter->setOutputStream( xOutputStream ); + + /* + * prepare document handler + */ + uno::Reference<xml::sax::XDocumentHandler> + xDocHandler( xSaxWriter,uno::UNO_QUERY); + + /* + * write the xml context for signatures + */ + rtl::OUString tag_AllSignatures(RTL_CONSTASCII_USTRINGPARAM(TAG_DOCUMENTSIGNATURES)); + + SvXMLAttributeList *pAttributeList = new SvXMLAttributeList(); + rtl::OUString sNamespace; + if (mbODFPre1_2) + sNamespace = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(NS_DOCUMENTSIGNATURES)); + else + sNamespace = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(NS_DOCUMENTSIGNATURES_ODF_1_2)); + + pAttributeList->AddAttribute( + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(ATTR_XMLNS)), + sNamespace); + + xDocHandler->startDocument(); + xDocHandler->startElement( + tag_AllSignatures, + uno::Reference< com::sun::star::xml::sax::XAttributeList > (pAttributeList)); + + return xDocHandler; +} + +void XMLSignatureHelper::CloseDocumentHandler( const uno::Reference<xml::sax::XDocumentHandler>& xDocumentHandler ) +{ + rtl::OUString tag_AllSignatures(RTL_CONSTASCII_USTRINGPARAM(TAG_DOCUMENTSIGNATURES)); + xDocumentHandler->endElement( tag_AllSignatures ); + xDocumentHandler->endDocument(); +} + +void XMLSignatureHelper::ExportSignature( + const uno::Reference< xml::sax::XDocumentHandler >& xDocumentHandler, + const SignatureInformation& signatureInfo ) +{ + mpXSecController->exportSignature(xDocumentHandler, signatureInfo); +} + +bool XMLSignatureHelper::CreateAndWriteSignature( const uno::Reference< xml::sax::XDocumentHandler >& xDocumentHandler ) +{ + mbError = false; + + /* + * create a signature listener + */ +/* + ImplXMLSignatureListener* pSignatureListener = new ImplXMLSignatureListener( + LINK( this, XMLSignatureHelper, SignatureCreationResultListener ), + LINK( this, XMLSignatureHelper, SignatureVerifyResultListener ), + LINK( this, XMLSignatureHelper, StartVerifySignatureElement ) ); +*/ + /* + * configure the signature creation listener + */ + //mpXSecController->setSignatureCreationResultListener( pSignatureListener ); + + /* + * write signatures + */ + if ( !mpXSecController->WriteSignature( xDocumentHandler ) ) + { + mbError = true; + } + + /* + * clear up the signature creation listener + */ + //mpXSecController->setSignatureCreationResultListener( NULL ); + + return !mbError; +} + +bool XMLSignatureHelper::CreateAndWriteSignature( const com::sun::star::uno::Reference< com::sun::star::io::XOutputStream >& xOutputStream ) +{ + uno::Reference<xml::sax::XDocumentHandler> xDocHandler + = CreateDocumentHandlerWithHeader(xOutputStream); + + bool rc = CreateAndWriteSignature( xDocHandler ); + + CloseDocumentHandler(xDocHandler); + + return rc; +} + +bool XMLSignatureHelper::ReadAndVerifySignature( const com::sun::star::uno::Reference< com::sun::star::io::XInputStream >& xInputStream ) +{ + mbError = false; + + DBG_ASSERT(xInputStream.is(), "input stream missing"); + + /* + * prepare ParserInputSrouce + */ + xml::sax::InputSource aParserInput; + // aParserInput.sSystemId = ouName; + aParserInput.aInputStream = xInputStream; + + /* + * get SAX parser component + */ + uno::Reference< lang::XMultiComponentFactory > xMCF( mxCtx->getServiceManager() ); + uno::Reference< xml::sax::XParser > xParser( + xMCF->createInstanceWithContext( + rtl::OUString::createFromAscii("com.sun.star.xml.sax.Parser"), mxCtx ), + uno::UNO_QUERY ); + + DBG_ASSERT( xParser.is(), "Can't create parser" ); + + /* + * create a signature reader + */ + uno::Reference< xml::sax::XDocumentHandler > xHandler + = mpXSecController->createSignatureReader( ); + + /* + * create a signature listener + */ + ImplXMLSignatureListener* pSignatureListener = new ImplXMLSignatureListener( + LINK( this, XMLSignatureHelper, SignatureCreationResultListener ), + LINK( this, XMLSignatureHelper, SignatureVerifyResultListener ), + LINK( this, XMLSignatureHelper, StartVerifySignatureElement ) ); + + /* + * configure the signature verify listener + */ + //mpXSecController->setSignatureVerifyResultListener( pSignatureListener ); + + /* + * setup the connection: + * Parser -> SignatureListener -> SignatureReader + */ + pSignatureListener->setNextHandler(xHandler); + xParser->setDocumentHandler( pSignatureListener ); + + /* + * parser the stream + */ + try + { + xParser->parseStream( aParserInput ); + } + catch( xml::sax::SAXParseException& ) + { + mbError = true; + } + catch( xml::sax::SAXException& ) + { + mbError = true; + } + catch( com::sun::star::io::IOException& ) + { + mbError = true; + } + catch( uno::Exception& ) + { + mbError = true; + } + + /* + * clear up the connection + */ + pSignatureListener->setNextHandler( NULL ); + + /* + * clear up the signature verify listener + */ + //mpXSecController->setSignatureVerifyResultListener( NULL ); + + /* + * release the signature reader + */ + mpXSecController->releaseSignatureReader( ); + + return !mbError; +} + +SignatureInformation XMLSignatureHelper::GetSignatureInformation( sal_Int32 nSecurityId ) const +{ + return mpXSecController->getSignatureInformation( nSecurityId ); +} + +SignatureInformations XMLSignatureHelper::GetSignatureInformations() const +{ + return mpXSecController->getSignatureInformations(); +} + +uno::Reference< ::com::sun::star::xml::crypto::XSecurityEnvironment > XMLSignatureHelper::GetSecurityEnvironment() +{ + return (mxSecurityContext.is()?(mxSecurityContext->getSecurityEnvironment()): uno::Reference< ::com::sun::star::xml::crypto::XSecurityEnvironment >()); +} + +uno::Reference< ::com::sun::star::xml::crypto::XSecurityEnvironment > XMLSignatureHelper::GetSecurityEnvironmentByIndex(sal_Int32 nId) +{ + return (mxSecurityContext.is()?(mxSecurityContext->getSecurityEnvironmentByIndex(nId)): uno::Reference< ::com::sun::star::xml::crypto::XSecurityEnvironment >()); +} + +sal_Int32 XMLSignatureHelper::GetSecurityEnvironmentNumber() +{ + return (mxSecurityContext.is()?(mxSecurityContext->getSecurityEnvironmentNumber()): 0); +} + + +/* +void XMLSignatureHelper::createSecurityContext( rtl::OUString tokenPath ) +{ + if ( !mxSEInitializer.is() ) + ImplCreateSEInitializer(); + + mxSecurityContext = mxSEInitializer->createSecurityContext(tokenPath); +} + +void XMLSignatureHelper::freeSecurityContext() +{ + if ( !mxSEInitializer.is() ) + ImplCreateSEInitializer(); + + mxSEInitializer->freeSecurityContext( mxSecurityContext ); +} +*/ + +IMPL_LINK( XMLSignatureHelper, SignatureCreationResultListener, XMLSignatureCreationResult*, pResult ) +{ + maCreationResults.insert( maCreationResults.begin() + maCreationResults.size(), *pResult ); + if ( pResult->nSignatureCreationResult != com::sun::star::xml::crypto::SecurityOperationStatus_OPERATION_SUCCEEDED ) + mbError = true; + return 0; +} + +IMPL_LINK( XMLSignatureHelper, SignatureVerifyResultListener, XMLSignatureVerifyResult*, pResult ) +{ + maVerifyResults.insert( maVerifyResults.begin() + maVerifyResults.size(), *pResult ); + if ( pResult->nSignatureVerifyResult != com::sun::star::xml::crypto::SecurityOperationStatus_OPERATION_SUCCEEDED ) + mbError = true; + return 0; +} + +IMPL_LINK( XMLSignatureHelper, StartVerifySignatureElement, const uno::Reference< com::sun::star::xml::sax::XAttributeList >*, pAttrs ) +{ + if ( !maStartVerifySignatureHdl.IsSet() || maStartVerifySignatureHdl.Call( (void*)pAttrs ) ) + { + sal_Int32 nSignatureId = mpXSecController->getNewSecurityId(); + mpXSecController->addSignature( nSignatureId ); + } + + return 0; +} diff --git a/xmlsecurity/source/helper/xmlsignaturehelper2.cxx b/xmlsecurity/source/helper/xmlsignaturehelper2.cxx new file mode 100644 index 000000000000..c701adefd445 --- /dev/null +++ b/xmlsecurity/source/helper/xmlsignaturehelper2.cxx @@ -0,0 +1,232 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_xmlsecurity.hxx" + +#include <xmlsecurity/xmlsignaturehelper.hxx> +#include <xmlsignaturehelper2.hxx> + +#include <unotools/streamhelper.hxx> + +#include <com/sun/star/embed/XStorage.hpp> +#include <com/sun/star/embed/XStorageRawAccess.hpp> +#include <com/sun/star/embed/ElementModes.hpp> +#include <com/sun/star/beans/XPropertySet.hpp> +#include "rtl/uri.hxx" + +using namespace com::sun::star; + +ImplXMLSignatureListener::ImplXMLSignatureListener( const Link& rCreationResultListenerListener, const Link rVerifyResultListenerListener, const Link rStartSignatureElement ) +{ + maCreationResultListenerListener = rCreationResultListenerListener; + maVerifyResultListenerListener = rVerifyResultListenerListener; + maStartVerifySignatureElementListener = rStartSignatureElement; + +} +ImplXMLSignatureListener::~ImplXMLSignatureListener() +{ +} + +void ImplXMLSignatureListener::setNextHandler( + uno::Reference< xml::sax::XDocumentHandler > xNextHandler) +{ + m_xNextHandler = xNextHandler; +} + +void SAL_CALL ImplXMLSignatureListener::signatureCreated( sal_Int32 securityId, com::sun::star::xml::crypto::SecurityOperationStatus nResult ) + throw (com::sun::star::uno::RuntimeException) +{ + XMLSignatureCreationResult aResult( securityId, nResult ); + maCreationResultListenerListener.Call( &aResult ); +} + +void SAL_CALL ImplXMLSignatureListener::signatureVerified( sal_Int32 securityId, com::sun::star::xml::crypto::SecurityOperationStatus nResult ) + throw (com::sun::star::uno::RuntimeException) +{ + XMLSignatureVerifyResult aResult( securityId, nResult ); + maVerifyResultListenerListener.Call( &aResult ); +} + +// --------------------------------------------------------------------------------- +// XDocumentHandler +// --------------------------------------------------------------------------------- +void SAL_CALL ImplXMLSignatureListener::startDocument( ) + throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException) +{ + if (m_xNextHandler.is()) + { + m_xNextHandler->startDocument(); + } +} + +void SAL_CALL ImplXMLSignatureListener::endDocument( ) + throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException) +{ + if (m_xNextHandler.is()) + { + m_xNextHandler->endDocument(); + } +} + +void SAL_CALL ImplXMLSignatureListener::startElement( const rtl::OUString& aName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttribs ) + throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException) +{ + if ( aName == rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Signature")) ) + { + maStartVerifySignatureElementListener.Call( (void*)&xAttribs ); + } + + if (m_xNextHandler.is()) + { + m_xNextHandler->startElement( aName, xAttribs ); + } +} + +void SAL_CALL ImplXMLSignatureListener::endElement( const rtl::OUString& aName ) + throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException) +{ + if (m_xNextHandler.is()) + { + m_xNextHandler->endElement( aName ); + } +} + +void SAL_CALL ImplXMLSignatureListener::characters( const rtl::OUString& aChars ) + throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException) +{ + if (m_xNextHandler.is()) + { + m_xNextHandler->characters( aChars ); + } +} + +void SAL_CALL ImplXMLSignatureListener::ignorableWhitespace( const rtl::OUString& aWhitespaces ) + throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException) +{ + if (m_xNextHandler.is()) + { + m_xNextHandler->ignorableWhitespace( aWhitespaces ); + } +} + +void SAL_CALL ImplXMLSignatureListener::processingInstruction( const rtl::OUString& aTarget, const rtl::OUString& aData ) + throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException) +{ + if (m_xNextHandler.is()) + { + m_xNextHandler->processingInstruction( aTarget, aData ); + } +} + +void SAL_CALL ImplXMLSignatureListener::setDocumentLocator( const com::sun::star::uno::Reference< com::sun::star::xml::sax::XLocator >& xLocator ) + throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException) +{ + if (m_xNextHandler.is()) + { + m_xNextHandler->setDocumentLocator( xLocator ); + } +} + +// --------------------------------------------------------------------------------- +// XUriBinding +// --------------------------------------------------------------------------------- + +UriBindingHelper::UriBindingHelper() +{ +} + +UriBindingHelper::UriBindingHelper( const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& rxStorage ) +{ + mxStorage = rxStorage; +} + + +void SAL_CALL UriBindingHelper::setUriBinding( const rtl::OUString& /*uri*/, const uno::Reference< io::XInputStream >&) + throw (uno::Exception, uno::RuntimeException) +{ +} + +uno::Reference< io::XInputStream > SAL_CALL UriBindingHelper::getUriBinding( const rtl::OUString& uri ) + throw (uno::Exception, uno::RuntimeException) +{ + uno::Reference< io::XInputStream > xInputStream; + if ( mxStorage.is() ) + { + xInputStream = OpenInputStream( mxStorage, uri ); + } + else + { + SvFileStream* pStream = new SvFileStream( uri, STREAM_READ ); + pStream->Seek( STREAM_SEEK_TO_END ); + sal_uLong nBytes = pStream->Tell(); + pStream->Seek( STREAM_SEEK_TO_BEGIN ); + SvLockBytesRef xLockBytes = new SvLockBytes( pStream, sal_True ); + xInputStream = new utl::OInputStreamHelper( xLockBytes, nBytes ); + } + return xInputStream; +} + +uno::Reference < io::XInputStream > UriBindingHelper::OpenInputStream( const uno::Reference < embed::XStorage >& rxStore, const rtl::OUString& rURI ) +{ + OSL_ASSERT(rURI.getLength()); + uno::Reference < io::XInputStream > xInStream; + + sal_Int32 nSepPos = rURI.indexOf( '/' ); + if ( nSepPos == -1 ) + { + // Cloning because of I can't keep all storage references open + // MBA with think about a better API... + const ::rtl::OUString sName = ::rtl::Uri::decode( + rURI, rtl_UriDecodeStrict, rtl_UriCharClassRelSegment); + if (sName.getLength() == 0 && rURI.getLength() != 0) + throw uno::Exception(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "Could not decode URI for stream element.")), 0); + + uno::Reference< io::XStream > xStream; + xStream = rxStore->cloneStreamElement( sName ); + if ( !xStream.is() ) + throw uno::RuntimeException(); + xInStream = xStream->getInputStream(); + } + else + { + const rtl::OUString aStoreName = ::rtl::Uri::decode( + rURI.copy( 0, nSepPos ), rtl_UriDecodeStrict, rtl_UriCharClassRelSegment); + if (aStoreName.getLength() == 0 && rURI.getLength() != 0) + throw uno::Exception( + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "Could not decode URI for stream element.")), 0); + + rtl::OUString aElement = rURI.copy( nSepPos+1 ); + uno::Reference < embed::XStorage > xSubStore = rxStore->openStorageElement( aStoreName, embed::ElementModes::READ ); + xInStream = OpenInputStream( xSubStore, aElement ); + } + return xInStream; +} + + diff --git a/xmlsecurity/source/helper/xmlsignaturehelper2.hxx b/xmlsecurity/source/helper/xmlsignaturehelper2.hxx new file mode 100644 index 000000000000..84b45d02ba41 --- /dev/null +++ b/xmlsecurity/source/helper/xmlsignaturehelper2.hxx @@ -0,0 +1,134 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include <tools/link.hxx> +#include <rtl/ustring.hxx> + +#include <cppuhelper/implbase1.hxx> +#include <cppuhelper/implbase3.hxx> + +#include <com/sun/star/xml/sax/XDocumentHandler.hpp> +#include <com/sun/star/xml/crypto/sax/XSignatureCreationResultListener.hpp> +#include <com/sun/star/xml/crypto/sax/XSignatureVerifyResultListener.hpp> + +namespace com { +namespace sun { +namespace star { +namespace io { + class XStream; + class XOutputStream; + class XInputStream; } +namespace embed { + class XStorage; } +}}} + + +// MT: Not needed any more, remove later... + +class ImplXMLSignatureListener : public cppu::WeakImplHelper3 +< + com::sun::star::xml::crypto::sax::XSignatureCreationResultListener, + com::sun::star::xml::crypto::sax::XSignatureVerifyResultListener, + com::sun::star::xml::sax::XDocumentHandler +> +{ +private: + Link maCreationResultListenerListener; + Link maVerifyResultListenerListener; + Link maStartVerifySignatureElementListener; + + com::sun::star::uno::Reference< + com::sun::star::xml::sax::XDocumentHandler > m_xNextHandler; + +public: + ImplXMLSignatureListener( const Link& rCreationResultListenerListener, const Link rVerifyResultListenerListener, const Link rStartVerifySignatureElement ); + ~ImplXMLSignatureListener(); + + void setNextHandler(com::sun::star::uno::Reference< + com::sun::star::xml::sax::XDocumentHandler > xNextHandler); + + // com::sun::star::xml::crypto::sax::XSignatureCreationResultListener + virtual void SAL_CALL signatureCreated( sal_Int32 securityId, com::sun::star::xml::crypto::SecurityOperationStatus creationResult ) + throw (com::sun::star::uno::RuntimeException); + + // com::sun::star::xml::crypto::sax::XSignatureVerifyResultListener + virtual void SAL_CALL signatureVerified( sal_Int32 securityId, com::sun::star::xml::crypto::SecurityOperationStatus verifyResult ) + throw (com::sun::star::uno::RuntimeException); + + // com::sun::star::xml::sax::XDocumentHandler + virtual void SAL_CALL startElement( const rtl::OUString& aName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttribs ) + throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL startDocument( ) + throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL endDocument( ) + throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL endElement( const rtl::OUString& aName ) + throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL characters( const rtl::OUString& aChars ) + throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL ignorableWhitespace( const rtl::OUString& aWhitespaces ) + throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL processingInstruction( const rtl::OUString& aTarget, const rtl::OUString& aData ) + throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL setDocumentLocator( const com::sun::star::uno::Reference< com::sun::star::xml::sax::XLocator >& xLocator ) + throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException); +}; + + +// --------------------------------------------------------------------------------- +// XUriBinding +// --------------------------------------------------------------------------------- + +class UriBindingHelper : public cppu::WeakImplHelper1 +< + com::sun::star::xml::crypto::XUriBinding +> +{ +private: + com::sun::star::uno::Reference < com::sun::star::embed::XStorage > mxStorage; + + +public: + UriBindingHelper(); + UriBindingHelper( const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& rxStorage ); + + void SAL_CALL setUriBinding( const rtl::OUString& uri, const com::sun::star::uno::Reference< com::sun::star::io::XInputStream >& aInputStream ) + throw (com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException); + + com::sun::star::uno::Reference< com::sun::star::io::XInputStream > SAL_CALL getUriBinding( const rtl::OUString& uri ) + throw (com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException); + + static com::sun::star::uno::Reference < com::sun::star::io::XInputStream > OpenInputStream( const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& rxStore, const rtl::OUString& rURI ); +}; + diff --git a/xmlsecurity/source/helper/xsecctl.cxx b/xmlsecurity/source/helper/xsecctl.cxx new file mode 100644 index 000000000000..bdcb0658af1e --- /dev/null +++ b/xmlsecurity/source/helper/xsecctl.cxx @@ -0,0 +1,1498 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_xmlsecurity.hxx" + +#include <xsecctl.hxx> +#include <tools/debug.hxx> + +#include <com/sun/star/xml/crypto/sax/ElementMarkPriority.hpp> +#include <com/sun/star/xml/crypto/sax/XReferenceResolvedBroadcaster.hpp> +#include <com/sun/star/xml/crypto/sax/XMissionTaker.hpp> +#include <com/sun/star/xml/crypto/sax/XReferenceCollector.hpp> +#include <com/sun/star/xml/crypto/sax/XSAXEventKeeperStatusChangeBroadcaster.hpp> +#include <com/sun/star/xml/crypto/SecurityOperationStatus.hpp> + +#include <xmloff/attrlist.hxx> +#include <rtl/math.hxx> +#include <tools/string.hxx> + +namespace cssu = com::sun::star::uno; +namespace cssl = com::sun::star::lang; +namespace cssxc = com::sun::star::xml::crypto; +namespace cssxs = com::sun::star::xml::sax; +namespace cssxw = com::sun::star::xml::wrapper; +namespace cssb = com::sun::star::beans; + +const sal_Int8 XML_MAXDIGITSCOUNT_TIME = 11; +const sal_Int8 XML_MAXDIGITSCOUNT_DATETIME = 6; + +/* bridge component names */ +#define XMLSIGNATURE_COMPONENT "com.sun.star.xml.crypto.XMLSignature" +#define XMLDOCUMENTWRAPPER_COMPONENT "com.sun.star.xml.wrapper.XMLDocumentWrapper" + +/* xml security framework components */ +#define SAXEVENTKEEPER_COMPONENT "com.sun.star.xml.crypto.sax.SAXEventKeeper" + +/* string for package protocol */ +#define PACKAGEPROTOCOL "vnd.sun.star.Package:" + +XSecController::XSecController( const cssu::Reference<cssu::XComponentContext>& rxCtx ) + :mxCtx(rxCtx), + m_nNextSecurityId(1), + m_bIsSAXEventKeeperConnected(false), + m_nStatusOfSecurityComponents(UNINITIALIZED), + m_bIsSAXEventKeeperSticky(false), + m_pErrorMessage(NULL), + m_pXSecParser(NULL) +{ +} + +XSecController::~XSecController() +{ +} + + +/* + * private methods + */ +/** convert string to number with optional min and max values */ +sal_Bool XSecController::convertNumber( sal_Int32& rValue, + const rtl::OUString& rString, + sal_Int32 /*nMin*/, sal_Int32 /*nMax*/ ) +{ + sal_Bool bNeg = sal_False; + rValue = 0; + + sal_Int32 nPos = 0L; + sal_Int32 nLen = rString.getLength(); + + // skip white space + while( nPos < nLen && sal_Unicode(' ') == rString[nPos] ) + nPos++; + + if( nPos < nLen && sal_Unicode('-') == rString[nPos] ) + { + bNeg = sal_True; + nPos++; + } + + // get number + while( nPos < nLen && + sal_Unicode('0') <= rString[nPos] && + sal_Unicode('9') >= rString[nPos] ) + { + // TODO: check overflow! + rValue *= 10; + rValue += (rString[nPos] - sal_Unicode('0')); + nPos++; + } + + if( bNeg ) + rValue *= -1; + + return nPos == nLen; +} + +/** convert util::DateTime to ISO Date String */ +void XSecController::convertDateTime( ::rtl::OUStringBuffer& rBuffer, + const com::sun::star::util::DateTime& rDateTime ) +{ + String aString( String::CreateFromInt32( rDateTime.Year ) ); + aString += '-'; + if( rDateTime.Month < 10 ) + aString += '0'; + aString += String::CreateFromInt32( rDateTime.Month ); + aString += '-'; + if( rDateTime.Day < 10 ) + aString += '0'; + aString += String::CreateFromInt32( rDateTime.Day ); + + if( rDateTime.Seconds != 0 || + rDateTime.Minutes != 0 || + rDateTime.Hours != 0 ) + { + aString += 'T'; + if( rDateTime.Hours < 10 ) + aString += '0'; + aString += String::CreateFromInt32( rDateTime.Hours ); + aString += ':'; + if( rDateTime.Minutes < 10 ) + aString += '0'; + aString += String::CreateFromInt32( rDateTime.Minutes ); + aString += ':'; + if( rDateTime.Seconds < 10 ) + aString += '0'; + aString += String::CreateFromInt32( rDateTime.Seconds ); + if ( rDateTime.HundredthSeconds > 0) + { + aString += ','; + if (rDateTime.HundredthSeconds < 10) + aString += '0'; + aString += String::CreateFromInt32( rDateTime.HundredthSeconds ); + } + } + + rBuffer.append( aString ); +} + +/** convert ISO Date String to util::DateTime */ +sal_Bool XSecController::convertDateTime( com::sun::star::util::DateTime& rDateTime, + const ::rtl::OUString& rString ) +{ + sal_Bool bSuccess = sal_True; + + rtl::OUString aDateStr, aTimeStr, sHundredth; + sal_Int32 nPos = rString.indexOf( (sal_Unicode) 'T' ); + sal_Int32 nPos2 = rString.indexOf( (sal_Unicode) ',' ); + if ( nPos >= 0 ) + { + aDateStr = rString.copy( 0, nPos ); + if ( nPos2 >= 0 ) + { + aTimeStr = rString.copy( nPos + 1, nPos2 - nPos - 1 ); + + //Get the fraction of a second with the accuracy of one hundreds second. + //The fraction part of the date could have different accuracies. To calculate + //the count of a hundredth units one could form a fractional number by appending + //the value of the time string to 0. Then multiply it by 100 and use only the whole number. + //For example: 5:27:46,1 -> 0,1 * 100 = 10 + //5:27:46,01 -> 0,01 * 100 = 1 + //5:27:46,001 -> 0,001 * 100 = 0 + //Due to the inaccuracy of floating point numbers the result may not be the same on different + //platforms. We had the case where we had a value of 24 hundredth of second, which converted to + //23 on Linux and 24 on Solaris and Windows. + + //we only support a hundredth second + //make ,1 -> 10 ,01 -> 1 ,001 -> only use first two diggits + sHundredth = rString.copy(nPos2 + 1); + sal_Int32 len = sHundredth.getLength(); + if (len == 1) + sHundredth += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("0")); + if (len > 2) + sHundredth = sHundredth.copy(0, 2); + } + else + { + aTimeStr = rString.copy(nPos + 1); + sHundredth = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("0")); + } + } + else + aDateStr = rString; // no separator: only date part + + sal_Int32 nYear = 1899; + sal_Int32 nMonth = 12; + sal_Int32 nDay = 30; + sal_Int32 nHour = 0; + sal_Int32 nMin = 0; + sal_Int32 nSec = 0; + + const sal_Unicode* pStr = aDateStr.getStr(); + sal_Int32 nDateTokens = 1; + while ( *pStr ) + { + if ( *pStr == '-' ) + nDateTokens++; + pStr++; + } + if ( nDateTokens > 3 || aDateStr.getLength() == 0 ) + bSuccess = sal_False; + else + { + sal_Int32 n = 0; + if ( !convertNumber( nYear, aDateStr.getToken( 0, '-', n ), 0, 9999 ) ) + bSuccess = sal_False; + if ( nDateTokens >= 2 ) + if ( !convertNumber( nMonth, aDateStr.getToken( 0, '-', n ), 0, 12 ) ) + bSuccess = sal_False; + if ( nDateTokens >= 3 ) + if ( !convertNumber( nDay, aDateStr.getToken( 0, '-', n ), 0, 31 ) ) + bSuccess = sal_False; + } + + if ( aTimeStr.getLength() > 0 ) // time is optional + { + pStr = aTimeStr.getStr(); + sal_Int32 nTimeTokens = 1; + while ( *pStr ) + { + if ( *pStr == ':' ) + nTimeTokens++; + pStr++; + } + if ( nTimeTokens > 3 ) + bSuccess = sal_False; + else + { + sal_Int32 n = 0; + if ( !convertNumber( nHour, aTimeStr.getToken( 0, ':', n ), 0, 23 ) ) + bSuccess = sal_False; + if ( nTimeTokens >= 2 ) + if ( !convertNumber( nMin, aTimeStr.getToken( 0, ':', n ), 0, 59 ) ) + bSuccess = sal_False; + if ( nTimeTokens >= 3 ) + if ( !convertNumber( nSec, aTimeStr.getToken( 0, ':', n ), 0, 59 ) ) + bSuccess = sal_False; + } + } + + if (bSuccess) + { + rDateTime.Year = (sal_uInt16)nYear; + rDateTime.Month = (sal_uInt16)nMonth; + rDateTime.Day = (sal_uInt16)nDay; + rDateTime.Hours = (sal_uInt16)nHour; + rDateTime.Minutes = (sal_uInt16)nMin; + rDateTime.Seconds = (sal_uInt16)nSec; + // rDateTime.HundredthSeconds = sDoubleStr.toDouble() * 100; + rDateTime.HundredthSeconds = static_cast<sal_uInt16>(sHundredth.toInt32()); + } + return bSuccess; +} + +int XSecController::findSignatureInfor( sal_Int32 nSecurityId) const +/****** XSecController/findSignatureInfor ************************************* + * + * NAME + * findSignatureInfor -- find SignatureInformation struct for a particular + * signature + * + * SYNOPSIS + * index = findSignatureInfor( nSecurityId ); + * + * FUNCTION + * see NAME. + * + * INPUTS + * nSecurityId - the signature's id + * + * RESULT + * index - the index of the signature, or -1 when no such signature + * existing + * + * HISTORY + * 08.05.2004 - implemented + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ + int i; + int size = m_vInternalSignatureInformations.size(); + + for (i=0; i<size; ++i) + { + if (m_vInternalSignatureInformations[i].signatureInfor.nSecurityId == nSecurityId) + { + return i; + } + } + + return -1; +} + +void XSecController::createXSecComponent( ) +/****** XSecController/createXSecComponent ************************************ + * + * NAME + * bResult = createXSecComponent -- creates xml security components + * + * SYNOPSIS + * createXSecComponent( ); + * + * FUNCTION + * Creates xml security components, including: + * 1. an xml signature bridge component ( Java based or C based) + * 2. an XMLDocumentWrapper component ( Java based or C based) + * 3. a SAXEventKeeper component + * + * INPUTS + * empty + * + * RESULT + * empty + * + * HISTORY + * 05.01.2004 - implemented + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ + rtl::OUString sSAXEventKeeper(rtl::OUString::createFromAscii( SAXEVENTKEEPER_COMPONENT )); + rtl::OUString sXMLSignature(rtl::OUString::createFromAscii( XMLSIGNATURE_COMPONENT )); + rtl::OUString sXMLDocument(rtl::OUString::createFromAscii( XMLDOCUMENTWRAPPER_COMPONENT )); + + /* + * marks all security components are not available. + */ + m_nStatusOfSecurityComponents = FAILTOINITIALIZED; + m_xXMLSignature = NULL; + m_xXMLDocumentWrapper = NULL; + m_xSAXEventKeeper = NULL; + + cssu::Reference< cssl::XMultiComponentFactory > xMCF( mxCtx->getServiceManager() ); + + m_xXMLSignature = cssu::Reference< cssxc::XXMLSignature >( + xMCF->createInstanceWithContext( sXMLSignature, mxCtx ), + cssu::UNO_QUERY ); + + bool bSuccess = (0!=m_xXMLSignature.is()); + if ( bSuccess ) + /* + * XMLSignature created successfully. + */ + { + m_xXMLDocumentWrapper = cssu::Reference< cssxw::XXMLDocumentWrapper >( + xMCF->createInstanceWithContext( sXMLDocument, mxCtx ), + cssu::UNO_QUERY ); + } + + bSuccess &= (0!=m_xXMLDocumentWrapper.is()); + if ( bSuccess ) + /* + * XMLDocumentWrapper created successfully. + */ + { + m_xSAXEventKeeper = cssu::Reference< cssxc::sax::XSecuritySAXEventKeeper >( + xMCF->createInstanceWithContext( sSAXEventKeeper, mxCtx ), + cssu::UNO_QUERY ); + } + + bSuccess &= (0!=m_xSAXEventKeeper.is()); + + if (bSuccess) + /* + * SAXEventKeeper created successfully. + */ + { + cssu::Reference< cssl::XInitialization > xInitialization(m_xSAXEventKeeper, cssu::UNO_QUERY); + + cssu::Sequence <cssu::Any> arg(1); + arg[0] = cssu::makeAny(m_xXMLDocumentWrapper); + xInitialization->initialize(arg); + + cssu::Reference<cssxc::sax::XSAXEventKeeperStatusChangeBroadcaster> + xSAXEventKeeperStatusChangeBroadcaster(m_xSAXEventKeeper, cssu::UNO_QUERY); + cssu::Reference< cssxc::sax::XSAXEventKeeperStatusChangeListener > + xStatusChangeListener = this; + + xSAXEventKeeperStatusChangeBroadcaster + ->addSAXEventKeeperStatusChangeListener( xStatusChangeListener ); + + m_nStatusOfSecurityComponents = INITIALIZED; + } +} + +bool XSecController::chainOn( bool bRetrievingLastEvent ) +/****** XSecController/chainOn ************************************************ + * + * NAME + * chainOn -- tyies to connect the SAXEventKeeper with the SAX chain. + * + * SYNOPSIS + * bJustChainingOn = chainOn( bRetrievingLastEvent ); + * + * FUNCTION + * First, checks whether the SAXEventKeeper is on the SAX chain. If not, + * creates xml security components, and chains the SAXEventKeeper into + * the SAX chain. + * Before being chained in, the SAXEventKeeper needs to receive all + * missed key SAX events, which can promise the DOM tree bufferred by the + * SAXEventKeeper has the same structure with the original document. + * + * INPUTS + * bRetrievingLastEvent - whether to retrieve the last key SAX event from + * the ElementStackKeeper. + * + * RESULT + * bJustChainingOn - whether the SAXEventKeeper is just chained into the + * SAX chain. + * + * NOTES + * Sometimes, the last key SAX event can't be transferred to the + * SAXEventKeeper together. + * For instance, at the time an referenced element is detected, the + * startElement event has already been reserved by the ElementStackKeeper. + * Meanwhile, an ElementCollector needs to be created before the + * SAXEventKeeper receives that startElement event. + * So for the SAXEventKeeper, it needs to receive all missed key SAX + * events except that startElement event, then adds a new + * ElementCollector, then receives that startElement event. + * + * HISTORY + * 05.01.2004 - implemented + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ + bool rc = false; + + if (!m_bIsSAXEventKeeperSticky && !m_bIsSAXEventKeeperConnected) + { + if ( m_nStatusOfSecurityComponents == UNINITIALIZED ) + { + createXSecComponent(); + } + + if ( m_nStatusOfSecurityComponents == INITIALIZED ) + /* + * if all security components are ready, chains on the SAXEventKeeper + */ + { + /* + * disconnect the SAXEventKeeper with its current output handler, + * to make sure no SAX event is forwarded during the connecting + * phase. + */ + m_xSAXEventKeeper->setNextHandler( NULL ); + + cssu::Reference< cssxs::XDocumentHandler > xSEKHandler(m_xSAXEventKeeper, cssu::UNO_QUERY); + + /* + * connects the previous document handler on the SAX chain + */ + if ( m_xPreviousNodeOnSAXChain.is() ) + { + if ( m_bIsPreviousNodeInitializable ) + { + cssu::Reference< cssl::XInitialization > xInitialization + (m_xPreviousNodeOnSAXChain, cssu::UNO_QUERY); + + cssu::Sequence<cssu::Any> aArgs( 1 ); + aArgs[0] <<= xSEKHandler; + xInitialization->initialize(aArgs); + } + else + { + cssu::Reference< cssxs::XParser > xParser + (m_xPreviousNodeOnSAXChain, cssu::UNO_QUERY); + xParser->setDocumentHandler( xSEKHandler ); + } + } + + /* + * get missed key SAX events + */ + if (m_xElementStackKeeper.is()) + { + m_xElementStackKeeper->retrieve(xSEKHandler, bRetrievingLastEvent); + + /* + * now the ElementStackKeeper can stop its work, because the + * SAXEventKeeper is on the SAX chain, no SAX events will be + * missed. + */ + m_xElementStackKeeper->stop(); + } + + /* + * connects the next document handler on the SAX chain + */ + m_xSAXEventKeeper->setNextHandler( m_xNextNodeOnSAXChain ); + + m_bIsSAXEventKeeperConnected = true; + + rc = true; + } + } + + return rc; +} + +void XSecController::chainOff() +/****** XSecController/chainOff *********************************************** + * + * NAME + * chainOff -- disconnects the SAXEventKeeper from the SAX chain. + * + * SYNOPSIS + * chainOff( ); + * + * FUNCTION + * See NAME. + * + * INPUTS + * empty + * + * RESULT + * empty + * + * HISTORY + * 05.01.2004 - implemented + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ + if (!m_bIsSAXEventKeeperSticky ) + { + if (m_bIsSAXEventKeeperConnected) + { + m_xSAXEventKeeper->setNextHandler( NULL ); + + if ( m_xPreviousNodeOnSAXChain.is() ) + { + if ( m_bIsPreviousNodeInitializable ) + { + cssu::Reference< cssl::XInitialization > xInitialization + (m_xPreviousNodeOnSAXChain, cssu::UNO_QUERY); + + cssu::Sequence<cssu::Any> aArgs( 1 ); + aArgs[0] <<= m_xNextNodeOnSAXChain; + xInitialization->initialize(aArgs); + } + else + { + cssu::Reference< cssxs::XParser > xParser(m_xPreviousNodeOnSAXChain, cssu::UNO_QUERY); + xParser->setDocumentHandler( m_xNextNodeOnSAXChain ); + } + } + + if (m_xElementStackKeeper.is()) + { + /* + * start the ElementStackKeeper to reserve any possible + * missed key SAX events + */ + m_xElementStackKeeper->start(); + } + + m_bIsSAXEventKeeperConnected = false; + } + } +} + +void XSecController::checkChainingStatus() +/****** XSecController/checkChainingStatus ************************************ + * + * NAME + * checkChainingStatus -- connects or disconnects the SAXEventKeeper + * according to the current situation. + * + * SYNOPSIS + * checkChainingStatus( ); + * + * FUNCTION + * The SAXEventKeeper is chained into the SAX chain, when: + * 1. some element is being collected, or + * 2. the SAX event stream is blocking. + * Otherwise, chain off the SAXEventKeeper. + * + * INPUTS + * empty + * + * RESULT + * empty + * + * HISTORY + * 05.01.2004 - implemented + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ + if ( m_bIsCollectingElement || m_bIsBlocking ) + { + chainOn(true); + } + else + { + chainOff(); + } +} + +void XSecController::initializeSAXChain() +/****** XSecController/initializeSAXChain ************************************* + * + * NAME + * initializeSAXChain -- initializes the SAX chain according to the + * current setting. + * + * SYNOPSIS + * initializeSAXChain( ); + * + * FUNCTION + * Initializes the SAX chain, if the SAXEventKeeper is asked to be always + * on the SAX chain, chains it on. Otherwise, starts the + * ElementStackKeeper to reserve key SAX events. + * + * INPUTS + * empty + * + * RESULT + * empty + * + * HISTORY + * 05.01.2004 - implemented + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ + m_bIsSAXEventKeeperConnected = false; + m_bIsCollectingElement = false; + m_bIsBlocking = false; + + if (m_xElementStackKeeper.is()) + { + /* + * starts the ElementStackKeeper + */ + m_xElementStackKeeper->start(); + } + + chainOff(); +} + +cssu::Reference< com::sun::star::io::XInputStream > + XSecController::getObjectInputStream( const rtl::OUString& objectURL ) +/****** XSecController/getObjectInputStream ************************************ + * + * NAME + * getObjectInputStream -- get a XInputStream interface from a SvStorage + * + * SYNOPSIS + * xInputStream = getObjectInputStream( objectURL ); + * + * FUNCTION + * See NAME. + * + * INPUTS + * objectURL - the object uri + * + * RESULT + * xInputStream - the XInputStream interface + * + * HISTORY + * 15.04.2004 - implemented + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ + cssu::Reference< com::sun::star::io::XInputStream > xObjectInputStream; + + DBG_ASSERT( m_xUriBinding.is(), "Need XUriBinding!" ); + + xObjectInputStream = m_xUriBinding->getUriBinding(objectURL); + + return xObjectInputStream; +} + +#if 0 +sal_Int32 XSecController::getFastPropertyIndex(sal_Int32 nHandle) const +/****** XSecController/getFastPropertyIndex *********************************** + * + * NAME + * getFastPropertyIndex -- gets the index of a particular fast property + * + * SYNOPSIS + * nIndex = getFastPropertyIndex( nHandle ); + * + * FUNCTION + * See NAME. + * + * INPUTS + * nHandle - the key for the fast property + * + * RESULT + * nIndex - the index of the fast property, or -1 + * if the key is not found. + * + * HISTORY + * 05.01.2004 - implemented + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ + std::vector< sal_Int32 >::const_iterator ii = m_vFastPropertyIndexs.begin(); + sal_Int32 nIndex = 0; + + bool bFound = false; + + for( ; ii != m_vFastPropertyIndexs.end(); ++ii,++nIndex ) + { + if ( nHandle == (*ii)) + { + bFound = true; + break; + } + } + + if (!bFound) + { + nIndex = -1; + } + + return nIndex; +} +#endif + +/* + * public methods + */ + +sal_Int32 XSecController::getNewSecurityId( ) +{ + sal_Int32 nId = m_nNextSecurityId; + m_nNextSecurityId++; + return nId; +} + +void XSecController::startMission( + const cssu::Reference< cssxc::XUriBinding >& xUriBinding, + const cssu::Reference< cssxc::XXMLSecurityContext >& xSecurityContext ) +/****** XSecController/startMission ******************************************* + * + * NAME + * startMission -- starts a new security mission. + * + * SYNOPSIS + * startMission( xUriBinding, xSecurityContect ); + * + * FUNCTION + * get ready for a new mission. + * + * INPUTS + * xUriBinding - the Uri binding that provide maps between uris and + * XInputStreams + * xSecurityContext - the security context component which can provide + * cryptoken + * + * RESULT + * empty + * + * HISTORY + * 05.01.2004 - implemented + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ + m_xUriBinding = xUriBinding; + + m_nStatusOfSecurityComponents = UNINITIALIZED; + m_xSecurityContext = xSecurityContext; + m_pErrorMessage = NULL; + + m_vInternalSignatureInformations.clear(); + + m_bVerifyCurrentSignature = false; +} + +void XSecController::setSAXChainConnector( + const cssu::Reference< cssl::XInitialization >& xInitialization, + const cssu::Reference< cssxs::XDocumentHandler >& xDocumentHandler, + const cssu::Reference< cssxc::sax::XElementStackKeeper >& xElementStackKeeper) +/****** XSecController/setSAXChainConnector *********************************** + * + * NAME + * setSAXChainConnector -- configures the components which will + * collaborate with the SAXEventKeeper on the SAX chain. + * + * SYNOPSIS + * setSAXChainConnector( xInitialization, + * xDocumentHandler, + * xElementStackKeeper ); + * + * FUNCTION + * See NAME. + * + * INPUTS + * xInitialization - the previous node on the SAX chain + * xDocumentHandler - the next node on the SAX chain + * xElementStackKeeper - the ElementStackKeeper component which reserves + * missed key SAX events for the SAXEventKeeper + * + * RESULT + * empty + * + * HISTORY + * 05.01.2004 - implemented + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ + m_bIsPreviousNodeInitializable = true; + m_xPreviousNodeOnSAXChain = xInitialization; + m_xNextNodeOnSAXChain = xDocumentHandler; + m_xElementStackKeeper = xElementStackKeeper; + + initializeSAXChain( ); +} + +void XSecController::setSAXChainConnector( + const cssu::Reference< cssxs::XParser >& xParser, + const cssu::Reference< cssxs::XDocumentHandler >& xDocumentHandler, + const cssu::Reference< cssxc::sax::XElementStackKeeper >& xElementStackKeeper) +/****** XSecController/setSAXChainConnector *********************************** + * + * NAME + * setSAXChainConnector -- configures the components which will + * collaborate with the SAXEventKeeper on the SAX chain. + * + * SYNOPSIS + * setSAXChainConnector( xParser, xDocumentHandler, xElementStackKeeper ); + * + * FUNCTION + * See NAME. + * + * INPUTS + * xParser - the previous node on the SAX chain + * xDocumentHandler - the next node on the SAX chain + * xElementStackKeeper -the ElementStackKeeper component which reserves + * missed key SAX events for the SAXEventKeeper + * + * RESULT + * empty + * + * HISTORY + * 05.01.2004 - implemented + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ + m_bIsPreviousNodeInitializable = false; + m_xPreviousNodeOnSAXChain = xParser; + m_xNextNodeOnSAXChain = xDocumentHandler; + m_xElementStackKeeper = xElementStackKeeper; + + initializeSAXChain( ); +} + +void XSecController::clearSAXChainConnector() +/****** XSecController/clearSAXChainConnector ********************************* + * + * NAME + * clearSAXChainConnector -- resets the collaborating components. + * + * SYNOPSIS + * clearSAXChainConnector( ); + * + * FUNCTION + * See NAME. + * + * INPUTS + * empty + * + * RESULT + * empty + * + * HISTORY + * 05.01.2004 - implemented + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ + /* + * before reseting, if the ElementStackKeeper has kept something, then + * those kept key SAX events must be transferred to the SAXEventKeeper + * first. This is to promise the next node to the SAXEventKeeper on the + * SAX chain always receives a complete document. + */ + if (m_xElementStackKeeper.is() && m_xSAXEventKeeper.is()) + { + cssu::Reference< cssxs::XDocumentHandler > xSEKHandler(m_xSAXEventKeeper, cssu::UNO_QUERY); + m_xElementStackKeeper->retrieve(xSEKHandler, sal_True); + } + + chainOff(); + + m_xPreviousNodeOnSAXChain = NULL; + m_xNextNodeOnSAXChain = NULL; + m_xElementStackKeeper = NULL; +} + +void XSecController::endMission() +/****** XSecController/endMission ********************************************* + * + * NAME + * endMission -- forces to end all missions + * + * SYNOPSIS + * endMission( ); + * + * FUNCTION + * Deletes all signature information and forces all missions to an end. + * + * INPUTS + * empty + * + * RESULT + * empty + * + * HISTORY + * 05.01.2004 - implemented + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ + sal_Int32 size = m_vInternalSignatureInformations.size(); + + for (int i=0; i<size; ++i) + { + if ( m_nStatusOfSecurityComponents == INITIALIZED ) + /* + * ResolvedListener only exist when the security components are created. + */ + { + cssu::Reference< cssxc::sax::XMissionTaker > xMissionTaker + ( m_vInternalSignatureInformations[i].xReferenceResolvedListener, cssu::UNO_QUERY ); + + /* + * askes the SignatureCreator/SignatureVerifier to release + * all resouces it uses. + */ + xMissionTaker->endMission(); + } + } + + m_xUriBinding = NULL; + m_xSecurityContext = NULL; + + /* + * free the status change listener reference to this object + */ + if (m_xSAXEventKeeper.is()) + { + cssu::Reference<cssxc::sax::XSAXEventKeeperStatusChangeBroadcaster> + xSAXEventKeeperStatusChangeBroadcaster(m_xSAXEventKeeper, cssu::UNO_QUERY); + xSAXEventKeeperStatusChangeBroadcaster + ->addSAXEventKeeperStatusChangeListener( NULL ); + } +} + +const char* XSecController::getErrorMessage() +/****** XSecController/getErrorMessage **************************************** + * + * NAME + * getErrorMessage -- get the last error message + * + * SYNOPSIS + * pErrorMessage = getErrorMessage( ); + * + * FUNCTION + * see NAME. + * + * INPUTS + * empty + * + * RESULT + * empty + * + * HISTORY + * 22.04.2004 - implemented + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ + return m_pErrorMessage; +} + +void XSecController::exportSignature( + const cssu::Reference<cssxs::XDocumentHandler>& xDocumentHandler, + const SignatureInformation& signatureInfo ) +/****** XSecController/exportSignature **************************************** + * + * NAME + * exportSignature -- export a signature structure to an XDocumentHandler + * + * SYNOPSIS + * exportSignature( xDocumentHandler, signatureInfo); + * + * FUNCTION + * see NAME. + * + * INPUTS + * xDocumentHandler - the document handler to receive the signature + * signatureInfo - signature to be exported + * + * RESULT + * empty + * + * HISTORY + * 26.05.2004 - implemented + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ + /* + * defines all element tags in Signature element. + */ + rtl::OUString tag_Signature(RTL_CONSTASCII_USTRINGPARAM(TAG_SIGNATURE)); + rtl::OUString tag_SignedInfo(RTL_CONSTASCII_USTRINGPARAM(TAG_SIGNEDINFO)); + rtl::OUString tag_CanonicalizationMethod(RTL_CONSTASCII_USTRINGPARAM(TAG_CANONICALIZATIONMETHOD)); + rtl::OUString tag_SignatureMethod(RTL_CONSTASCII_USTRINGPARAM(TAG_SIGNATUREMETHOD)); + rtl::OUString tag_Reference(RTL_CONSTASCII_USTRINGPARAM(TAG_REFERENCE)); + rtl::OUString tag_Transforms(RTL_CONSTASCII_USTRINGPARAM(TAG_TRANSFORMS)); + rtl::OUString tag_Transform(RTL_CONSTASCII_USTRINGPARAM(TAG_TRANSFORM)); + rtl::OUString tag_DigestMethod(RTL_CONSTASCII_USTRINGPARAM(TAG_DIGESTMETHOD)); + rtl::OUString tag_DigestValue(RTL_CONSTASCII_USTRINGPARAM(TAG_DIGESTVALUE)); + rtl::OUString tag_SignatureValue(RTL_CONSTASCII_USTRINGPARAM(TAG_SIGNATUREVALUE)); + rtl::OUString tag_KeyInfo(RTL_CONSTASCII_USTRINGPARAM(TAG_KEYINFO)); + rtl::OUString tag_X509Data(RTL_CONSTASCII_USTRINGPARAM(TAG_X509DATA)); + rtl::OUString tag_X509IssuerSerial(RTL_CONSTASCII_USTRINGPARAM(TAG_X509ISSUERSERIAL)); + rtl::OUString tag_X509IssuerName(RTL_CONSTASCII_USTRINGPARAM(TAG_X509ISSUERNAME)); + rtl::OUString tag_X509SerialNumber(RTL_CONSTASCII_USTRINGPARAM(TAG_X509SERIALNUMBER)); + rtl::OUString tag_X509Certificate(RTL_CONSTASCII_USTRINGPARAM(TAG_X509CERTIFICATE)); + + rtl::OUString tag_Object(RTL_CONSTASCII_USTRINGPARAM(TAG_OBJECT)); + rtl::OUString tag_SignatureProperties(RTL_CONSTASCII_USTRINGPARAM(TAG_SIGNATUREPROPERTIES)); + rtl::OUString tag_SignatureProperty(RTL_CONSTASCII_USTRINGPARAM(TAG_SIGNATUREPROPERTY)); + rtl::OUString tag_Date(RTL_CONSTASCII_USTRINGPARAM(TAG_DATE)); +#if 0 + rtl::OUString tag_Timestamp(RTL_CONSTASCII_USTRINGPARAM(TAG_TIMESTAMP)); + rtl::OUString tag_Date(RTL_CONSTASCII_USTRINGPARAM(TAG_DATE)); + rtl::OUString tag_Time(RTL_CONSTASCII_USTRINGPARAM(TAG_TIME)); +#endif + + const SignatureReferenceInformations& vReferenceInfors = signatureInfo.vSignatureReferenceInfors; + SvXMLAttributeList *pAttributeList; + + /* + * Write Signature element + */ + pAttributeList = new SvXMLAttributeList(); + pAttributeList->AddAttribute( + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(ATTR_XMLNS)), + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(NS_XMLDSIG))); + + if (signatureInfo.ouSignatureId.getLength()>0) + { + pAttributeList->AddAttribute( + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(ATTR_ID)), + rtl::OUString(signatureInfo.ouSignatureId)); + } + + xDocumentHandler->startElement( tag_Signature, cssu::Reference< cssxs::XAttributeList > (pAttributeList)); + { + /* Write SignedInfo element */ + xDocumentHandler->startElement( + tag_SignedInfo, + cssu::Reference< cssxs::XAttributeList > (new SvXMLAttributeList())); + { + /* Write CanonicalizationMethod element */ + pAttributeList = new SvXMLAttributeList(); + pAttributeList->AddAttribute( + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(ATTR_ALGORITHM)), + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(ALGO_C14N))); + xDocumentHandler->startElement( tag_CanonicalizationMethod, cssu::Reference< cssxs::XAttributeList > (pAttributeList) ); + xDocumentHandler->endElement( tag_CanonicalizationMethod ); + + /* Write SignatureMethod element */ + pAttributeList = new SvXMLAttributeList(); + pAttributeList->AddAttribute( + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(ATTR_ALGORITHM)), + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(ALGO_RSASHA1))); + xDocumentHandler->startElement( tag_SignatureMethod, cssu::Reference< cssxs::XAttributeList > (pAttributeList) ); + xDocumentHandler->endElement( tag_SignatureMethod ); + + /* Write Reference element */ + int j; + int refNum = vReferenceInfors.size(); + + for(j=0; j<refNum; ++j) + { + const SignatureReferenceInformation& refInfor = vReferenceInfors[j]; + + pAttributeList = new SvXMLAttributeList(); + if ( refInfor.nType != TYPE_SAMEDOCUMENT_REFERENCE ) + /* + * stream reference + */ + { + pAttributeList->AddAttribute( + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(ATTR_URI)), + refInfor.ouURI); + } + else + /* + * same-document reference + */ + { + pAttributeList->AddAttribute( + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(ATTR_URI)), + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(CHAR_FRAGMENT))+refInfor.ouURI); + } + + xDocumentHandler->startElement( tag_Reference, cssu::Reference< cssxs::XAttributeList > (pAttributeList) ); + { + /* Write Transforms element */ + if (refInfor.nType == TYPE_XMLSTREAM_REFERENCE) + /* + * xml stream, so c14n transform is needed + */ + { + xDocumentHandler->startElement( + tag_Transforms, + cssu::Reference< cssxs::XAttributeList > (new SvXMLAttributeList())); + { + pAttributeList = new SvXMLAttributeList(); + pAttributeList->AddAttribute( + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(ATTR_ALGORITHM)), + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(ALGO_C14N))); + xDocumentHandler->startElement( + tag_Transform, + cssu::Reference< cssxs::XAttributeList > (pAttributeList) ); + xDocumentHandler->endElement( tag_Transform ); + } + xDocumentHandler->endElement( tag_Transforms ); + } + + /* Write DigestMethod element */ + pAttributeList = new SvXMLAttributeList(); + pAttributeList->AddAttribute( + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(ATTR_ALGORITHM)), + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(ALGO_XMLDSIGSHA1))); + xDocumentHandler->startElement( + tag_DigestMethod, + cssu::Reference< cssxs::XAttributeList > (pAttributeList) ); + xDocumentHandler->endElement( tag_DigestMethod ); + + /* Write DigestValue element */ + xDocumentHandler->startElement( + tag_DigestValue, + cssu::Reference< cssxs::XAttributeList > (new SvXMLAttributeList())); + xDocumentHandler->characters( refInfor.ouDigestValue ); + xDocumentHandler->endElement( tag_DigestValue ); + } + xDocumentHandler->endElement( tag_Reference ); + } + } + xDocumentHandler->endElement( tag_SignedInfo ); + + /* Write SignatureValue element */ + xDocumentHandler->startElement( + tag_SignatureValue, + cssu::Reference< cssxs::XAttributeList > (new SvXMLAttributeList())); + xDocumentHandler->characters( signatureInfo.ouSignatureValue ); + xDocumentHandler->endElement( tag_SignatureValue ); + + /* Write KeyInfo element */ + xDocumentHandler->startElement( + tag_KeyInfo, + cssu::Reference< cssxs::XAttributeList > (new SvXMLAttributeList())); + { + /* Write X509Data element */ + xDocumentHandler->startElement( + tag_X509Data, + cssu::Reference< cssxs::XAttributeList > (new SvXMLAttributeList())); + { + /* Write X509IssuerSerial element */ + xDocumentHandler->startElement( + tag_X509IssuerSerial, + cssu::Reference< cssxs::XAttributeList > (new SvXMLAttributeList())); + { + /* Write X509IssuerName element */ + xDocumentHandler->startElement( + tag_X509IssuerName, + cssu::Reference< cssxs::XAttributeList > (new SvXMLAttributeList())); + xDocumentHandler->characters( signatureInfo.ouX509IssuerName ); + xDocumentHandler->endElement( tag_X509IssuerName ); + + /* Write X509SerialNumber element */ + xDocumentHandler->startElement( + tag_X509SerialNumber, + cssu::Reference< cssxs::XAttributeList > (new SvXMLAttributeList())); + xDocumentHandler->characters( signatureInfo.ouX509SerialNumber ); + xDocumentHandler->endElement( tag_X509SerialNumber ); + } + xDocumentHandler->endElement( tag_X509IssuerSerial ); + + /* Write X509Certificate element */ + if (signatureInfo.ouX509Certificate.getLength()>0) + { + xDocumentHandler->startElement( + tag_X509Certificate, + cssu::Reference< cssxs::XAttributeList > (new SvXMLAttributeList())); + xDocumentHandler->characters( signatureInfo.ouX509Certificate ); + xDocumentHandler->endElement( tag_X509Certificate ); + } + } + xDocumentHandler->endElement( tag_X509Data ); + } + xDocumentHandler->endElement( tag_KeyInfo ); + + /* Write Object element */ + xDocumentHandler->startElement( + tag_Object, + cssu::Reference< cssxs::XAttributeList > (new SvXMLAttributeList())); + { + /* Write SignatureProperties element */ + xDocumentHandler->startElement( + tag_SignatureProperties, + cssu::Reference< cssxs::XAttributeList > (new SvXMLAttributeList())); + { + /* Write SignatureProperty element */ + pAttributeList = new SvXMLAttributeList(); + pAttributeList->AddAttribute( + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(ATTR_ID)), + signatureInfo.ouPropertyId); + pAttributeList->AddAttribute( + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(ATTR_TARGET)), + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(CHAR_FRAGMENT))+signatureInfo.ouSignatureId); + xDocumentHandler->startElement( + tag_SignatureProperty, + cssu::Reference< cssxs::XAttributeList > (pAttributeList)); + { + /* Write timestamp element */ + + pAttributeList = new SvXMLAttributeList(); + pAttributeList->AddAttribute( + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(ATTR_XMLNS)) + +rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(":")) + +rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(NSTAG_DC)), + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(NS_DC))); + + xDocumentHandler->startElement( + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(NSTAG_DC)) + +rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(":")) + +tag_Date, + cssu::Reference< cssxs::XAttributeList > (pAttributeList)); + + ::rtl::OUStringBuffer buffer; + //If the xml signature was already contained in the document, + //then we use the original date and time string, rather then the + //converted one. When the original string is converted to the DateTime + //structure then information may be lost because it only holds a fractional + //of a second with a accuracy of one hundredth of second. If the string contains + //milli seconds (document was signed by an application other than OOo) + //and the converted time is written back, then the string looks different + //and the signature is broken. + if (signatureInfo.ouDateTime.getLength() > 0) + buffer = signatureInfo.ouDateTime; + else + convertDateTime( buffer, signatureInfo.stDateTime ); + xDocumentHandler->characters( buffer.makeStringAndClear() ); + + xDocumentHandler->endElement( + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(NSTAG_DC)) + +rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(":")) + +tag_Date); + } + xDocumentHandler->endElement( tag_SignatureProperty ); + } + xDocumentHandler->endElement( tag_SignatureProperties ); + } + xDocumentHandler->endElement( tag_Object ); + } + xDocumentHandler->endElement( tag_Signature ); +} + +SignatureInformation XSecController::getSignatureInformation( sal_Int32 nSecurityId ) const +{ + SignatureInformation aInf( 0 ); + int nIndex = findSignatureInfor(nSecurityId); + DBG_ASSERT( nIndex != -1, "getSignatureInformation - SecurityId is invalid!" ); + if ( nIndex != -1) + { + aInf = m_vInternalSignatureInformations[nIndex].signatureInfor; + } + return aInf; +} + +SignatureInformations XSecController::getSignatureInformations() const +{ + SignatureInformations vInfors; + int sigNum = m_vInternalSignatureInformations.size(); + + for (int i=0; i<sigNum; ++i) + { + SignatureInformation si = m_vInternalSignatureInformations[i].signatureInfor; + vInfors.push_back(si); + } + + return vInfors; +} + +/* + * XSecurityController + * + * no methods + */ + +/* + * XFastPropertySet + */ +/* +void SAL_CALL XSecController::setFastPropertyValue( + sal_Int32 nHandle, + const cssu::Any& aValue ) + throw ( cssb::UnknownPropertyException, + cssb::PropertyVetoException, + cssl::IllegalArgumentException, + cssl::WrappedTargetException, + cssu::RuntimeException) +{ + sal_Int32 nIndex = getFastPropertyIndex(nHandle); + if (nIndex == -1) + { + m_vFastPropertyIndexs.push_back( nHandle ); + m_vFastPropertyValues.push_back( aValue ); + } + else + { + m_vFastPropertyValues[nIndex] = aValue; + } +} + +cssu::Any SAL_CALL XSecController::getFastPropertyValue( + sal_Int32 nHandle ) + throw ( + cssb::UnknownPropertyException, + cssl::WrappedTargetException, + cssu::RuntimeException) +{ + cssu::Any aValue; + + sal_Int32 nIndex = getFastPropertyIndex(nHandle); + if (nIndex != -1) + { + aValue = m_vFastPropertyValues[nIndex]; + } + + return aValue; +} +*/ + +/* + * XSAXEventKeeperStatusChangeListener + */ + +void SAL_CALL XSecController::blockingStatusChanged( sal_Bool isBlocking ) + throw (cssu::RuntimeException) +{ + /* + showMessageBox( rtl::OUString::createFromAscii((isBlocking? + "Blocking Status => TRUE": + "Blocking Status => FALSE")), + rtl::OUString::createFromAscii("SAXEventKeeper Status")); + */ + + this->m_bIsBlocking = isBlocking; + checkChainingStatus(); +} + +void SAL_CALL XSecController::collectionStatusChanged( + sal_Bool isInsideCollectedElement ) + throw (cssu::RuntimeException) +{ + /* + showMessageBox( rtl::OUString::createFromAscii((isInsideCollectedElement? + "Collection Status => TRUE": + "Collection Status => FALSE")), + rtl::OUString::createFromAscii("SAXEventKeeper Status")); + */ + + this->m_bIsCollectingElement = isInsideCollectedElement; + checkChainingStatus(); +} + +void SAL_CALL XSecController::bufferStatusChanged( sal_Bool /*isBufferEmpty*/) + throw (cssu::RuntimeException) +{ + /* + showMessageBox( rtl::OUString::createFromAscii((isBufferEmpty? + "Buffer Empty => TRUE": + "Buffer Empty => FALSE")), + rtl::OUString::createFromAscii("SAXEventKeeper Status")); + */ +} + +/* + * XSignatureCreationResultListener + */ +void SAL_CALL XSecController::signatureCreated( sal_Int32 securityId, com::sun::star::xml::crypto::SecurityOperationStatus nResult ) + throw (com::sun::star::uno::RuntimeException) +{ + int index = findSignatureInfor(securityId); + DBG_ASSERT( index != -1, "Signature Not Found!" ); + + SignatureInformation& signatureInfor = m_vInternalSignatureInformations[index].signatureInfor; + + /* + if (nResult == cssxc::sax::SignatureCreationResult_CREATIONSUCCEED) + { + signatureInfor.nStatus = STATUS_CREATION_SUCCEED; + } + else + { + signatureInfor.nStatus = STATUS_CREATION_FAIL; + } + */ + signatureInfor.nStatus = nResult; +} + +/* + * XSignatureVerifyResultListener + */ +void SAL_CALL XSecController::signatureVerified( sal_Int32 securityId, com::sun::star::xml::crypto::SecurityOperationStatus nResult ) + throw (com::sun::star::uno::RuntimeException) +{ + int index = findSignatureInfor(securityId); + DBG_ASSERT( index != -1, "Signature Not Found!" ); + + SignatureInformation& signatureInfor = m_vInternalSignatureInformations[index].signatureInfor; + + /* + if (nResult == cssxc::sax::SignatureVerifyResult_VERIFYSUCCEED) + { + signatureInfor.nStatus = STATUS_VERIFY_SUCCEED; + } + else + { + signatureInfor.nStatus = STATUS_VERIFY_FAIL; + } + */ + signatureInfor.nStatus = nResult; +} diff --git a/xmlsecurity/source/helper/xsecctl.hxx b/xmlsecurity/source/helper/xsecctl.hxx new file mode 100644 index 000000000000..4a715105d044 --- /dev/null +++ b/xmlsecurity/source/helper/xsecctl.hxx @@ -0,0 +1,577 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _XSEC_CTL_HXX +#define _XSEC_CTL_HXX + +#include <xmlsecurity/sigstruct.hxx> + +#include <com/sun/star/uno/XComponentContext.hpp> +#include <com/sun/star/xml/sax/XParser.hpp> +#include <com/sun/star/lang/XInitialization.hpp> +#include <com/sun/star/xml/sax/XDocumentHandler.hpp> +#include <com/sun/star/xml/sax/XAttributeList.hpp> +#include <com/sun/star/xml/crypto/XXMLSignature.hpp> +#include <com/sun/star/xml/crypto/XSEInitializer.hpp> +#include <com/sun/star/xml/crypto/sax/XSecurityController.hpp> +#include <com/sun/star/xml/crypto/sax/XElementStackKeeper.hpp> +#include <com/sun/star/xml/crypto/sax/XSecuritySAXEventKeeper.hpp> +#include <com/sun/star/xml/crypto/sax/XReferenceResolvedListener.hpp> +#include <com/sun/star/xml/crypto/sax/XSAXEventKeeperStatusChangeListener.hpp> +#include <com/sun/star/xml/crypto/sax/XSignatureCreationResultListener.hpp> +#include <com/sun/star/xml/crypto/sax/XSignatureVerifyResultListener.hpp> +#include <com/sun/star/xml/wrapper/XXMLDocumentWrapper.hpp> +#include <com/sun/star/beans/XFastPropertySet.hpp> +#include <com/sun/star/io/XOutputStream.hpp> +#include <com/sun/star/io/XInputStream.hpp> + +#include <rtl/ustrbuf.hxx> + +#include <cppuhelper/implbase4.hxx> + +#ifndef INCLUDED_VECTOR +#include <vector> +#define INCLUDED_VECTOR +#endif + +/* + * all error information + */ +#define ERROR_CANNOTCREATEXMLSECURITYCOMPONENT "Can't create XML security components." +#define ERROR_SAXEXCEPTIONDURINGCREATION "A SAX exception is throwed during signature creation." +#define ERROR_IOEXCEPTIONDURINGCREATION "An IO exception is throwed during signature creation." +#define ERROR_EXCEPTIONDURINGCREATION "An exception is throwed during signature creation." + +/* + * all stringS in signature element + */ +#define TAG_SIGNATURE "Signature" +#define TAG_SIGNEDINFO "SignedInfo" +#define TAG_CANONICALIZATIONMETHOD "CanonicalizationMethod" +#define TAG_SIGNATUREMETHOD "SignatureMethod" +#define TAG_REFERENCE "Reference" +#define TAG_TRANSFORMS "Transforms" +#define TAG_TRANSFORM "Transform" +#define TAG_DIGESTMETHOD "DigestMethod" +#define TAG_DIGESTVALUE "DigestValue" +#define TAG_SIGNATUREVALUE "SignatureValue" +#define TAG_KEYINFO "KeyInfo" +#define TAG_X509DATA "X509Data" +#define TAG_X509ISSUERSERIAL "X509IssuerSerial" +#define TAG_X509ISSUERNAME "X509IssuerName" +#define TAG_X509SERIALNUMBER "X509SerialNumber" +#define TAG_X509CERTIFICATE "X509Certificate" +#define TAG_OBJECT "Object" +#define TAG_SIGNATUREPROPERTIES "SignatureProperties" +#define TAG_SIGNATUREPROPERTY "SignatureProperty" +#define TAG_TIMESTAMP "timestamp" +#define TAG_DATE "date" +//#define TAG_TIME "time" + +#define ATTR_XMLNS "xmlns" +#define ATTR_ALGORITHM "Algorithm" +#define ATTR_URI "URI" +#define ATTR_ID "Id" +#define ATTR_TARGET "Target" + +#define NSTAG_DC "dc" + +#define NS_XMLDSIG "http://www.w3.org/2000/09/xmldsig#" +//#define NS_DATETIME "http://www.ietf.org/rfcXXXX.txt" +#define NS_DC "http://purl.org/dc/elements/1.1/" + +#define ALGO_C14N "http://www.w3.org/TR/2001/REC-xml-c14n-20010315" +#define ALGO_RSASHA1 "http://www.w3.org/2000/09/xmldsig#rsa-sha1" +#define ALGO_XMLDSIGSHA1 "http://www.w3.org/2000/09/xmldsig#sha1" + +#define CHAR_FRAGMENT "#" +#define CHAR_BLANK " " + + +/* + * status of security related components + */ +#define UNINITIALIZED 0 +#define INITIALIZED 1 +#define FAILTOINITIALIZED 2 + +#define RTL_ASCII_USTRINGPARAM( asciiStr ) asciiStr, strlen( asciiStr ), RTL_TEXTENCODING_ASCII_US + +// forward declaration +class XSecParser; + +class InternalSignatureInformation +{ +public: + SignatureInformation signatureInfor; + + com::sun::star::uno::Reference< + com::sun::star::xml::crypto::sax::XReferenceResolvedListener > + xReferenceResolvedListener; + + ::std::vector< sal_Int32 > vKeeperIds; + + InternalSignatureInformation( + sal_Int32 nId, + com::sun::star::uno::Reference< com::sun::star::xml::crypto::sax::XReferenceResolvedListener > + xListener) + :signatureInfor(nId) + { + xReferenceResolvedListener = xListener; + } + + void addReference( sal_Int32 type, rtl::OUString uri, sal_Int32 keeperId ) + { + signatureInfor.vSignatureReferenceInfors.push_back( + SignatureReferenceInformation(type, uri)); + vKeeperIds.push_back( keeperId ); + } +}; + +typedef ::std::vector< InternalSignatureInformation > InternalSignatureInformations; + +class XSecController : public cppu::WeakImplHelper4 +< + com::sun::star::xml::crypto::sax::XSecurityController, + //com::sun::star::beans::XFastPropertySet, + com::sun::star::xml::crypto::sax::XSAXEventKeeperStatusChangeListener, + com::sun::star::xml::crypto::sax::XSignatureCreationResultListener, + com::sun::star::xml::crypto::sax::XSignatureVerifyResultListener +> +/****** XSecController.hxx/CLASS XSecController ******************************* + * + * NAME + * XSecController -- the xml security framework controller + * + * FUNCTION + * Controlls the whole xml security framework to create signatures or to + * verify signatures. + * + * HISTORY + * 05.01.2004 - Interface supported: XSecurityController, + * XFastPropertySet, XSAXEventKeeperStatusChangeListener, + * XSignatureCreationResultListener, + * XSignatureVerifyResultListener + * + * NOTES + * The XFastPropertySet interface is used to transfer common values to + * classes in other module, for instance, the signature id for all + * sessions is transferred to xmloff module through this interface. + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ + friend class XSecParser; + +private: + com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext> mxCtx; + + /* + * used to buffer SAX events + */ + com::sun::star::uno::Reference< + com::sun::star::xml::wrapper::XXMLDocumentWrapper > m_xXMLDocumentWrapper; + + /* + * the SAX events keeper + */ + com::sun::star::uno::Reference< + com::sun::star::xml::crypto::sax::XSecuritySAXEventKeeper > m_xSAXEventKeeper; + + /* + * the bridge component which creates/verifies signature + */ + com::sun::star::uno::Reference< + com::sun::star::xml::crypto::XXMLSignature > m_xXMLSignature; + + /* + * the Security Context + */ + com::sun::star::uno::Reference< + com::sun::star::xml::crypto::XXMLSecurityContext > m_xSecurityContext; + +#if 0 + /* + * the signature creation result listener + */ + com::sun::star::uno::Reference< + com::sun::star::xml::crypto::sax::XSignatureCreationResultListener > m_xSignatureCreationResultListener; + /* + * the signature verify result listener + */ + com::sun::star::uno::Reference< + com::sun::star::xml::crypto::sax::XSignatureVerifyResultListener > m_xSignatureVerifyResultListener; +#endif + + /* + * the security id incrementer, in order to make any security id unique + * to the SAXEventKeeper. + * Because each XSecController has its own SAXEventKeeper, so this variable + * is not necessary to be static. + */ + sal_Int32 m_nNextSecurityId; + + /* + * Signature information + */ + InternalSignatureInformations m_vInternalSignatureInformations; + + /* + * the previous node on the SAX chain. + * The reason that use a Reference<XInterface> type variable + * is that the previous components are different when exporting + * and importing, and there is no other common interface they + * can provided. + */ + com::sun::star::uno::Reference< + com::sun::star::uno::XInterface > m_xPreviousNodeOnSAXChain; + /* + * whether the preivous node can provide an XInitiazlize interface, + * use this variable in order to typecast the XInterface to the + * correct interface type. + */ + bool m_bIsPreviousNodeInitializable; + + /* + * the next node on the SAX chain. + * it can always provide an XDocumentHandler interface. + */ + com::sun::star::uno::Reference< + com::sun::star::xml::sax::XDocumentHandler > m_xNextNodeOnSAXChain; + + /* + * the ElementStackKeeper is used to reserve the key SAX events. + * when the SAXEventKeeper is chained on the SAX chain, it need + * first get all missed key SAX events in order to make sure the + * DOM tree it buffering has the same structure with the original + * document. + * + * For a given section of a SAX event stream, the key SAX events + * are the minimal SAX event subset of that section, which, + * combining with SAX events outside of this section, has the same + * structure with the original document. + * + * For example, sees the following dom fragment: + * <A> + * <B/> + * <C> + * <D> + * <E/> + * </D> + * </C> + * </A> + * + * If we consider the SAX event section from startElement(<A>) to + * startElement(<D>), then the key SAX events are: + * + * startElement(<A>), startElement(<C>), startElement(<D>) + * + * The startElement(<B>) and endElement(<B>) is ignored, because + * they are unimportant for the tree structure in this section. + * + * If we consider the SAX event section from startElement(<D>) to + * endElement(<A>), the key SAX events are: + * + * startElement(<D>), endElement(<D>), endElement(<C>), + * endElement(<A>). + */ + com::sun::star::uno::Reference< + com::sun::star::xml::crypto::sax::XElementStackKeeper > m_xElementStackKeeper; + + /* + * a flag representing whether the SAXEventKeeper is now on the + * SAX chain. + */ + bool m_bIsSAXEventKeeperConnected; + + /* + * a flag representing whether it is collecting some element, + * which means that the SAXEventKeeper can't be chained off the + * SAX chain. + */ + bool m_bIsCollectingElement; + + /* + * a flag representing whether the SAX event stream is blocking, + * which also means that the SAXEventKeeper can't be chained off + * the SAX chain. + */ + bool m_bIsBlocking; + + /* + * a flag representing the current status of security related + * components. + */ + sal_Int32 m_nStatusOfSecurityComponents; + + /* + * a flag representing whether the SAXEventKeeper need to be + * on the SAX chain all the time. + * This flag is used to the situation when creating signature. + */ + bool m_bIsSAXEventKeeperSticky; + + /* + * fast property vector + */ + std::vector< sal_Int32 > m_vFastPropertyIndexs; + std::vector< com::sun::star::uno::Any > m_vFastPropertyValues; + + /* + * error message pointer + */ + const char *m_pErrorMessage; + + /* + * the XSecParser which is used to parse the signature stream + */ + XSecParser *m_pXSecParser; + + /* + * the caller assigned signature id for the next signature in the + * signature stream + */ + sal_Int32 m_nReservedSignatureId; + + /* + * representing whether to verify the current signature + */ + bool m_bVerifyCurrentSignature; +public: + /* + * An xUriBinding is provided to map Uris to XInputStream interfaces. + */ + com::sun::star::uno::Reference< + com::sun::star::xml::crypto::XUriBinding > m_xUriBinding; + +private: + + /* + * Common methods + */ + sal_Bool convertNumber( sal_Int32& rValue, const rtl::OUString& rString, sal_Int32 nMin, sal_Int32 nMax ); + void convertDateTime( ::rtl::OUStringBuffer& rBuffer, const com::sun::star::util::DateTime& rDateTime ); + sal_Bool convertDateTime( com::sun::star::util::DateTime& rDateTime, const ::rtl::OUString& rString ); + + void createXSecComponent( ); + int findSignatureInfor( sal_Int32 nSecurityId ) const; + bool chainOn( bool bRetrievingLastEvent ); + void chainOff(); + void checkChainingStatus(); + void initializeSAXChain(); + + com::sun::star::uno::Reference< + com::sun::star::io::XInputStream > getObjectInputStream( const rtl::OUString& objectURL ); + + //sal_Int32 getFastPropertyIndex(sal_Int32 nHandle) const; + + /* + * For signature generation + */ + rtl::OUString createId(); + com::sun::star::uno::Reference< + com::sun::star::xml::crypto::sax::XReferenceResolvedListener > prepareSignatureToWrite( + InternalSignatureInformation& signatureInfo ); + + /* + * For signature verification + */ + void addSignature(); + void addReference( const rtl::OUString& ouUri); + void addStreamReference( + const rtl::OUString& ouUri, + bool isBinary ); + void setReferenceCount() const; + + void setX509IssuerName( rtl::OUString& ouX509IssuerName ); + void setX509SerialNumber( rtl::OUString& ouX509SerialNumber ); + void setX509Certificate( rtl::OUString& ouX509Certificate ); + void setSignatureValue( rtl::OUString& ouSignatureValue ); + void setDigestValue( rtl::OUString& ouDigestValue ); + + void setDate( rtl::OUString& ouDate ); + + void setId( rtl::OUString& ouId ); + void setPropertyId( rtl::OUString& ouPropertyId ); + + com::sun::star::uno::Reference< + com::sun::star::xml::crypto::sax::XReferenceResolvedListener > prepareSignatureToRead( + sal_Int32 nSecurityId ); + +public: + XSecController(const com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext>& rxCtx); + ~XSecController(); + + sal_Int32 getNewSecurityId( ); + + void startMission( const com::sun::star::uno::Reference< + com::sun::star::xml::crypto::XUriBinding >& xUriBinding, + const com::sun::star::uno::Reference< + com::sun::star::xml::crypto::XXMLSecurityContext >& xSecurityContext ); + + void setSAXChainConnector( + const com::sun::star::uno::Reference< + com::sun::star::lang::XInitialization >& xInitialization, + const com::sun::star::uno::Reference< + com::sun::star::xml::sax::XDocumentHandler >& xDocumentHandler, + const com::sun::star::uno::Reference< + com::sun::star::xml::crypto::sax::XElementStackKeeper >& xElementStackKeeper); + + void setSAXChainConnector( + const com::sun::star::uno::Reference< + com::sun::star::xml::sax::XParser >& xParser, + const com::sun::star::uno::Reference< + com::sun::star::xml::sax::XDocumentHandler >& xDocumentHandler, + const com::sun::star::uno::Reference< + com::sun::star::xml::crypto::sax::XElementStackKeeper >& xElementStackKeeper); + + void clearSAXChainConnector(); + void endMission(); + const char* getErrorMessage(); + + SignatureInformation getSignatureInformation( sal_Int32 nSecurityId ) const; + SignatureInformations getSignatureInformations() const; + + void exportSignature( + const com::sun::star::uno::Reference< + com::sun::star::xml::sax::XDocumentHandler >& xDocumentHandler, + const SignatureInformation& signatureInfo ); + + + /* + * For signature generation + */ + void collectToSign( sal_Int32 securityId, const rtl::OUString& referenceId ); + void signAStream( sal_Int32 securityId, const rtl::OUString& uri, const rtl::OUString& objectURL, sal_Bool isBinary); + + + /** sets data that describes the certificate. + + It is absolutely necessary that the parameter ouX509IssuerName is set. It contains + the base64 encoded certificate, which is DER encoded. The XMLSec needs it to find + the private key. Although issuer name and certificate should be sufficient to identify + the certificate the implementation in XMLSec is broken, both for Windows and mozilla. + The reason is that they use functions to find the certificate which take as parameter + the DER encoded ASN.1 issuer name. The issuer name is a DName, where most attributes + are of type DirectoryName, which is a choice of 5 string types. This information is + not contained in the issuer string and while it is converted to the ASN.1 name the + conversion function must assume a particular type, which is often wrong. For example, + the Windows function CertStrToName will use a T.61 string if the string does not contain + special characters. So if the certificate uses simple characters but encodes the + issuer attributes in Utf8, then CertStrToName will use T.61. The resulting DER encoded + ASN.1 name now contains different bytes which indicate the string type. The functions + for finding the certificate apparently use memcmp - hence they fail to find the + certificate. + */ + void setX509Certificate( + sal_Int32 nSecurityId, + const rtl::OUString& ouX509IssuerName, + const rtl::OUString& ouX509SerialNumber, + const rtl::OUString& ouX509Cert); + // see the other setX509Certifcate function + void setX509Certificate( + sal_Int32 nSecurityId, + const sal_Int32 nSecurityEnvironmentIndex, + const rtl::OUString& ouX509IssuerName, + const rtl::OUString& ouX509SerialNumber, + const rtl::OUString& ouX509Cert); + + void setDate( + sal_Int32 nSecurityId, + const ::com::sun::star::util::DateTime& rDateTime ); + + + bool WriteSignature( + const com::sun::star::uno::Reference< + com::sun::star::xml::sax::XDocumentHandler >& xDocumentHandler ); + + /* + * For signature verification + */ + void collectToVerify( const rtl::OUString& referenceId ); + void addSignature( sal_Int32 nSignatureId ); + com::sun::star::uno::Reference< com::sun::star::xml::sax::XDocumentHandler > createSignatureReader(); + void releaseSignatureReader(); + +public: + /* Interface methods */ + + /* + * XSecurityController + * + * no method in XSecurityController interface + */ + + /* + * XFastPropertySet + */ + /* + virtual void SAL_CALL setFastPropertyValue( + sal_Int32 nHandle, + const com::sun::star::uno::Any& aValue ) + throw ( + com::sun::star::beans::UnknownPropertyException, + com::sun::star::beans::PropertyVetoException, + com::sun::star::lang::IllegalArgumentException, + com::sun::star::lang::WrappedTargetException, + com::sun::star::uno::RuntimeException); + virtual com::sun::star::uno::Any SAL_CALL getFastPropertyValue( + sal_Int32 nHandle ) + throw ( + com::sun::star::beans::UnknownPropertyException, + com::sun::star::lang::WrappedTargetException, + com::sun::star::uno::RuntimeException); + */ + + /* + * XSAXEventKeeperStatusChangeListener + */ + virtual void SAL_CALL blockingStatusChanged( sal_Bool isBlocking ) + throw (com::sun::star::uno::RuntimeException); + virtual void SAL_CALL collectionStatusChanged( + sal_Bool isInsideCollectedElement ) + throw (com::sun::star::uno::RuntimeException); + virtual void SAL_CALL bufferStatusChanged( sal_Bool isBufferEmpty ) + throw (com::sun::star::uno::RuntimeException); + + /* + * XSignatureCreationResultListener + */ + virtual void SAL_CALL signatureCreated( sal_Int32 securityId, com::sun::star::xml::crypto::SecurityOperationStatus nResult ) + throw (com::sun::star::uno::RuntimeException); + + /* + * XSignatureVerifyResultListener + */ + virtual void SAL_CALL signatureVerified( sal_Int32 securityId, com::sun::star::xml::crypto::SecurityOperationStatus nResult ) + throw (com::sun::star::uno::RuntimeException); +}; + +#endif + diff --git a/xmlsecurity/source/helper/xsecparser.cxx b/xmlsecurity/source/helper/xsecparser.cxx new file mode 100644 index 000000000000..1546acbdb4ef --- /dev/null +++ b/xmlsecurity/source/helper/xsecparser.cxx @@ -0,0 +1,377 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_xmlsecurity.hxx" + +#include "xsecparser.hxx" +#include <tools/debug.hxx> +#include "cppuhelper/exc_hlp.hxx" + +#include <string.h> + +namespace cssu = com::sun::star::uno; +namespace cssxs = com::sun::star::xml::sax; + +#define RTL_ASCII_USTRINGPARAM( asciiStr ) asciiStr, strlen( asciiStr ), RTL_TEXTENCODING_ASCII_US + +XSecParser::XSecParser( + XSecController* pXSecController, + const cssu::Reference< cssxs::XDocumentHandler >& xNextHandler ) + : m_pXSecController(pXSecController), + m_xNextHandler(xNextHandler), + m_bReferenceUnresolved(false) +{ +} + +rtl::OUString XSecParser::getIdAttr(const cssu::Reference< cssxs::XAttributeList >& xAttribs ) +{ + rtl::OUString ouIdAttr = xAttribs->getValueByName( + rtl::OUString(RTL_ASCII_USTRINGPARAM("id"))); + + if (ouIdAttr == NULL) + { + ouIdAttr = xAttribs->getValueByName( + rtl::OUString(RTL_ASCII_USTRINGPARAM("Id"))); + } + + return ouIdAttr; +} + +/* + * XDocumentHandler + */ +void SAL_CALL XSecParser::startDocument( ) + throw (cssxs::SAXException, cssu::RuntimeException) +{ + m_bInX509IssuerName = false; + m_bInX509SerialNumber = false; + m_bInX509Certificate = false; + m_bInSignatureValue = false; + m_bInDigestValue = false; + m_bInDate = false; + //m_bInTime = false; + + if (m_xNextHandler.is()) + { + m_xNextHandler->startDocument(); + } +} + +void SAL_CALL XSecParser::endDocument( ) + throw (cssxs::SAXException, cssu::RuntimeException) +{ + if (m_xNextHandler.is()) + { + m_xNextHandler->endDocument(); + } +} + +void SAL_CALL XSecParser::startElement( + const rtl::OUString& aName, + const cssu::Reference< cssxs::XAttributeList >& xAttribs ) + throw (cssxs::SAXException, cssu::RuntimeException) +{ + try + { + rtl::OUString ouIdAttr = getIdAttr(xAttribs); + if (ouIdAttr != NULL) + { + m_pXSecController->collectToVerify( ouIdAttr ); + } + + if ( aName == rtl::OUString(RTL_ASCII_USTRINGPARAM(TAG_SIGNATURE)) ) + { + m_pXSecController->addSignature(); + if (ouIdAttr != NULL) + { + m_pXSecController->setId( ouIdAttr ); + } + } + else if ( aName == rtl::OUString(RTL_ASCII_USTRINGPARAM(TAG_REFERENCE)) ) + { + rtl::OUString ouUri = xAttribs->getValueByName(rtl::OUString(RTL_ASCII_USTRINGPARAM(ATTR_URI))); + DBG_ASSERT( ouUri != NULL, "URI == NULL" ); + + if (0 == ouUri.compareTo(rtl::OUString(RTL_ASCII_USTRINGPARAM(CHAR_FRAGMENT)),1)) + { + /* + * remove the first character '#' from the attribute value + */ + m_pXSecController->addReference( ouUri.copy(1) ); + } + else + { + /* + * remember the uri + */ + m_currentReferenceURI = ouUri; + m_bReferenceUnresolved = true; + } + } + else if (aName == rtl::OUString(RTL_ASCII_USTRINGPARAM(TAG_TRANSFORM))) + { + if ( m_bReferenceUnresolved ) + { + rtl::OUString ouAlgorithm = xAttribs->getValueByName(rtl::OUString(RTL_ASCII_USTRINGPARAM(ATTR_ALGORITHM))); + + if (ouAlgorithm != NULL && ouAlgorithm == rtl::OUString(RTL_ASCII_USTRINGPARAM(ALGO_C14N))) + /* + * a xml stream + */ + { + m_pXSecController->addStreamReference( m_currentReferenceURI, sal_False); + m_bReferenceUnresolved = false; + } + } + } + else if (aName == rtl::OUString(RTL_ASCII_USTRINGPARAM(TAG_X509ISSUERNAME))) + { + m_ouX509IssuerName = rtl::OUString::createFromAscii(""); + m_bInX509IssuerName = true; + } + else if (aName == rtl::OUString(RTL_ASCII_USTRINGPARAM(TAG_X509SERIALNUMBER))) + { + m_ouX509SerialNumber = rtl::OUString::createFromAscii(""); + m_bInX509SerialNumber = true; + } + else if (aName == rtl::OUString(RTL_ASCII_USTRINGPARAM(TAG_X509CERTIFICATE))) + { + m_ouX509Certificate = rtl::OUString::createFromAscii(""); + m_bInX509Certificate = true; + } + else if (aName == rtl::OUString(RTL_ASCII_USTRINGPARAM(TAG_SIGNATUREVALUE))) + { + m_ouSignatureValue = rtl::OUString::createFromAscii(""); + m_bInSignatureValue = true; + } + else if (aName == rtl::OUString(RTL_ASCII_USTRINGPARAM(TAG_DIGESTVALUE))) + { + m_ouDigestValue = rtl::OUString::createFromAscii(""); + m_bInDigestValue = true; + } + else if ( aName == rtl::OUString(RTL_ASCII_USTRINGPARAM(TAG_SIGNATUREPROPERTY)) ) + { + if (ouIdAttr != NULL) + { + m_pXSecController->setPropertyId( ouIdAttr ); + } + } + else if (aName == rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(NSTAG_DC)) + +rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(":")) + +rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(TAG_DATE))) + { + m_ouDate = rtl::OUString::createFromAscii(""); + m_bInDate = true; + } + /* + else if (aName == rtl::OUString(RTL_ASCII_USTRINGPARAM(TAG_TIME))) + { + m_ouTime = rtl::OUString::createFromAscii(""); + m_bInTime = true; + } + */ + + if (m_xNextHandler.is()) + { + m_xNextHandler->startElement(aName, xAttribs); + } + } + catch (cssu::Exception& ) + {//getCaughtException MUST be the first line in the catch block + cssu::Any exc = cppu::getCaughtException(); + throw cssxs::SAXException( + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "xmlsecurity: Exception in XSecParser::startElement")), + 0, exc); + } + catch (...) + { + throw cssxs::SAXException( + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("xmlsecurity: unexpected exception in XSecParser::startElement")), 0, + cssu::Any()); + } +} + +void SAL_CALL XSecParser::endElement( const rtl::OUString& aName ) + throw (cssxs::SAXException, cssu::RuntimeException) +{ + try + { + if (aName == rtl::OUString(RTL_ASCII_USTRINGPARAM(TAG_DIGESTVALUE))) + { + m_bInDigestValue = false; + } + else if ( aName == rtl::OUString(RTL_ASCII_USTRINGPARAM(TAG_REFERENCE)) ) + { + if ( m_bReferenceUnresolved ) + /* + * it must be a octet stream + */ + { + m_pXSecController->addStreamReference( m_currentReferenceURI, sal_True); + m_bReferenceUnresolved = false; + } + + m_pXSecController->setDigestValue( m_ouDigestValue ); + } + else if ( aName == rtl::OUString(RTL_ASCII_USTRINGPARAM(TAG_SIGNEDINFO)) ) + { + m_pXSecController->setReferenceCount(); + } + else if ( aName == rtl::OUString(RTL_ASCII_USTRINGPARAM(TAG_SIGNATUREVALUE)) ) + { + m_pXSecController->setSignatureValue( m_ouSignatureValue ); + m_bInSignatureValue = false; + } + else if (aName == rtl::OUString(RTL_ASCII_USTRINGPARAM(TAG_X509ISSUERNAME))) + { + m_pXSecController->setX509IssuerName( m_ouX509IssuerName ); + m_bInX509IssuerName = false; + } + else if (aName == rtl::OUString(RTL_ASCII_USTRINGPARAM(TAG_X509SERIALNUMBER))) + { + m_pXSecController->setX509SerialNumber( m_ouX509SerialNumber ); + m_bInX509SerialNumber = false; + } + else if (aName == rtl::OUString(RTL_ASCII_USTRINGPARAM(TAG_X509CERTIFICATE))) + { + m_pXSecController->setX509Certificate( m_ouX509Certificate ); + m_bInX509Certificate = false; + } + else if (aName == rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(NSTAG_DC)) + +rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(":")) + +rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(TAG_DATE))) + { + m_pXSecController->setDate( m_ouDate ); + m_bInDate = false; + } + /* + else if ( aName == rtl::OUString(RTL_ASCII_USTRINGPARAM(TAG_TIME)) ) + { + m_pXSecController->setTime( m_ouTime ); + m_bInTime = false; + } + */ + + if (m_xNextHandler.is()) + { + m_xNextHandler->endElement(aName); + } + } + catch (cssu::Exception& ) + {//getCaughtException MUST be the first line in the catch block + cssu::Any exc = cppu::getCaughtException(); + throw cssxs::SAXException( + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "xmlsecurity: Exception in XSecParser::endElement")), + 0, exc); + } + catch (...) + { + throw cssxs::SAXException( + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("xmlsecurity: unexpected exception in XSecParser::endElement")), 0, + cssu::Any()); + } +} + +void SAL_CALL XSecParser::characters( const rtl::OUString& aChars ) + throw (cssxs::SAXException, cssu::RuntimeException) +{ + if (m_bInX509IssuerName) + { + m_ouX509IssuerName += aChars; + } + else if (m_bInX509SerialNumber) + { + m_ouX509SerialNumber += aChars; + } + else if (m_bInX509Certificate) + { + m_ouX509Certificate += aChars; + } + else if (m_bInSignatureValue) + { + m_ouSignatureValue += aChars; + } + else if (m_bInDigestValue) + { + m_ouDigestValue += aChars; + } + else if (m_bInDate) + { + m_ouDate += aChars; + } + /* + else if (m_bInTime) + { + m_ouTime += aChars; + } + */ + + if (m_xNextHandler.is()) + { + m_xNextHandler->characters(aChars); + } +} + +void SAL_CALL XSecParser::ignorableWhitespace( const rtl::OUString& aWhitespaces ) + throw (cssxs::SAXException, cssu::RuntimeException) +{ + if (m_xNextHandler.is()) + { + m_xNextHandler->ignorableWhitespace( aWhitespaces ); + } +} + +void SAL_CALL XSecParser::processingInstruction( const rtl::OUString& aTarget, const rtl::OUString& aData ) + throw (cssxs::SAXException, cssu::RuntimeException) +{ + if (m_xNextHandler.is()) + { + m_xNextHandler->processingInstruction(aTarget, aData); + } +} + +void SAL_CALL XSecParser::setDocumentLocator( const cssu::Reference< cssxs::XLocator >& xLocator ) + throw (cssxs::SAXException, cssu::RuntimeException) +{ + if (m_xNextHandler.is()) + { + m_xNextHandler->setDocumentLocator( xLocator ); + } +} + +/* + * XInitialization + */ +void SAL_CALL XSecParser::initialize( + const cssu::Sequence< cssu::Any >& aArguments ) + throw(cssu::Exception, cssu::RuntimeException) +{ + aArguments[0] >>= m_xNextHandler; +} diff --git a/xmlsecurity/source/helper/xsecparser.hxx b/xmlsecurity/source/helper/xsecparser.hxx new file mode 100644 index 000000000000..8de771569191 --- /dev/null +++ b/xmlsecurity/source/helper/xsecparser.hxx @@ -0,0 +1,165 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _XSEC_CTL_PARSER_HXX +#define _XSEC_CTL_PARSER_HXX + +#include <xsecctl.hxx> + +#include <com/sun/star/xml/sax/XParser.hpp> +#include <com/sun/star/lang/XInitialization.hpp> +#include <com/sun/star/xml/sax/XDocumentHandler.hpp> +#include <com/sun/star/xml/sax/XAttributeList.hpp> + +#include <cppuhelper/implbase2.hxx> + +class XSecParser: public cppu::WeakImplHelper2 +< + com::sun::star::xml::sax::XDocumentHandler, + com::sun::star::lang::XInitialization +> +/****** XSecController.hxx/CLASS XSecParser *********************************** + * + * NAME + * XSecParser -- a SAX parser that can detect security elements + * + * FUNCTION + * The XSecParser object is connected on the SAX chain and detects + * security elements in the SAX event stream, then notifies + * the XSecController. + * + * HISTORY + * 05.01.2004 - Interface supported: XDocumentHandler, XInitialization + * + * NOTES + * This class is used when importing a document. + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ + friend class XSecController; +private: + /* + * the following members are used to reserve the signature information, + * including X509IssuerName, X509SerialNumber, and X509Certificate,etc. + */ + rtl::OUString m_ouX509IssuerName; + rtl::OUString m_ouX509SerialNumber; + rtl::OUString m_ouX509Certificate; + rtl::OUString m_ouDigestValue; + rtl::OUString m_ouSignatureValue; + rtl::OUString m_ouDate; + //rtl::OUString m_ouTime; + + /* + * whether inside a particular element + */ + bool m_bInX509IssuerName; + bool m_bInX509SerialNumber; + bool m_bInX509Certificate; + bool m_bInDigestValue; + bool m_bInSignatureValue; + bool m_bInDate; + //bool m_bInTime; + + /* + * the XSecController collaborating with XSecParser + */ + XSecController* m_pXSecController; + + /* + * the next XDocumentHandler on the SAX chain + */ + com::sun::star::uno::Reference< + com::sun::star::xml::sax::XDocumentHandler > m_xNextHandler; + + /* + * this string is used to remember the current handled reference's URI, + * + * because it can be decided whether a stream reference is xml based or binary based + * only after the Transforms element is read in, so we have to reserve the reference's + * URI when the startElement event is met. + */ + rtl::OUString m_currentReferenceURI; + bool m_bReferenceUnresolved; + +private: + rtl::OUString getIdAttr(const com::sun::star::uno::Reference< + com::sun::star::xml::sax::XAttributeList >& xAttribs ); + +public: + XSecParser( XSecController* pXSecController, + const com::sun::star::uno::Reference< + com::sun::star::xml::sax::XDocumentHandler >& xNextHandler ); + ~XSecParser(){}; + + /* + * XDocumentHandler + */ + virtual void SAL_CALL startDocument( ) + throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL endDocument( ) + throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL startElement( + const rtl::OUString& aName, + const com::sun::star::uno::Reference< + com::sun::star::xml::sax::XAttributeList >& xAttribs ) + throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL endElement( const rtl::OUString& aName ) + throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL characters( const rtl::OUString& aChars ) + throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL ignorableWhitespace( const rtl::OUString& aWhitespaces ) + throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL processingInstruction( + const rtl::OUString& aTarget, + const rtl::OUString& aData ) + throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL setDocumentLocator( + const com::sun::star::uno::Reference< + com::sun::star::xml::sax::XLocator >& xLocator ) + throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException); + + /* + * XInitialization + */ + virtual void SAL_CALL initialize( + const com::sun::star::uno::Sequence< com::sun::star::uno::Any >& aArguments ) + throw(com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException); +}; + +#endif + diff --git a/xmlsecurity/source/helper/xsecsign.cxx b/xmlsecurity/source/helper/xsecsign.cxx new file mode 100644 index 000000000000..774a07cb28f2 --- /dev/null +++ b/xmlsecurity/source/helper/xsecsign.cxx @@ -0,0 +1,374 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_xmlsecurity.hxx" + +#include <xsecctl.hxx> +#include <tools/debug.hxx> + +#include <com/sun/star/xml/crypto/sax/XKeyCollector.hpp> +#include <com/sun/star/xml/crypto/sax/ElementMarkPriority.hpp> +#include <com/sun/star/xml/crypto/sax/XReferenceResolvedBroadcaster.hpp> +#include <com/sun/star/xml/crypto/sax/XBlockerMonitor.hpp> +#include <com/sun/star/xml/crypto/sax/XReferenceCollector.hpp> +#include <com/sun/star/xml/crypto/sax/XSignatureCreationResultBroadcaster.hpp> +#include <com/sun/star/io/XActiveDataSource.hpp> +#include <rtl/uuid.h> + +#include <stdio.h> + +namespace cssu = com::sun::star::uno; +namespace cssl = com::sun::star::lang; +namespace cssxc = com::sun::star::xml::crypto; +namespace cssxs = com::sun::star::xml::sax; + +/* xml security framework components */ +#define SIGNATURECREATOR_COMPONENT "com.sun.star.xml.crypto.sax.SignatureCreator" + +/* protected: for signature generation */ +rtl::OUString XSecController::createId() +{ + cssu::Sequence< sal_Int8 > aSeq( 16 ); + rtl_createUuid ((sal_uInt8 *)aSeq.getArray(), 0, sal_True); + + char str[68]="ID_"; + int length = 3; + for (int i=0; i<16; ++i) + { + length += sprintf(str+length, "%04x", (unsigned char)aSeq[i]); + } + + return rtl::OUString::createFromAscii(str); +} + +cssu::Reference< cssxc::sax::XReferenceResolvedListener > XSecController::prepareSignatureToWrite( + InternalSignatureInformation& internalSignatureInfor ) +{ + sal_Int32 nSecurityId = internalSignatureInfor.signatureInfor.nSecurityId; + SignatureReferenceInformations& vReferenceInfors = internalSignatureInfor.signatureInfor.vSignatureReferenceInfors; + + sal_Int32 nIdOfSignatureElementCollector; + cssu::Reference< cssxc::sax::XReferenceResolvedListener > xReferenceResolvedListener; + + nIdOfSignatureElementCollector = + m_xSAXEventKeeper->addSecurityElementCollector( cssxc::sax::ElementMarkPriority_AFTERMODIFY, sal_True ); + + m_xSAXEventKeeper->setSecurityId(nIdOfSignatureElementCollector, nSecurityId); + + /* + * create a SignatureCreator + */ + cssu::Reference< cssl::XMultiComponentFactory > xMCF( mxCtx->getServiceManager() ); + xReferenceResolvedListener = cssu::Reference< cssxc::sax::XReferenceResolvedListener >( + xMCF->createInstanceWithContext( + rtl::OUString::createFromAscii(SIGNATURECREATOR_COMPONENT), mxCtx), + cssu::UNO_QUERY); + + cssu::Reference<cssl::XInitialization> xInitialization(xReferenceResolvedListener, cssu::UNO_QUERY); + + cssu::Sequence<cssu::Any> args(5); + args[0] = cssu::makeAny(rtl::OUString::valueOf(nSecurityId)); + args[1] = cssu::makeAny(m_xSAXEventKeeper); + args[2] = cssu::makeAny(rtl::OUString::valueOf(nIdOfSignatureElementCollector)); + + //i39448 : for nss, the internal module is used for signing, which needs to be improved later + sal_Int32 nEnvIndex = internalSignatureInfor.signatureInfor.nSecurityEnvironmentIndex; + if( nEnvIndex < 0 || nEnvIndex >= m_xSecurityContext->getSecurityEnvironmentNumber()) + {// set defaultEnv + args[3] = cssu::makeAny(m_xSecurityContext->getSecurityEnvironment()); + } + else + { + args[3] = cssu::makeAny(m_xSecurityContext->getSecurityEnvironmentByIndex(nEnvIndex)); + } + + args[4] = cssu::makeAny(m_xXMLSignature); + xInitialization->initialize(args); + + sal_Int32 nBlockerId = m_xSAXEventKeeper->addBlocker(); + m_xSAXEventKeeper->setSecurityId(nBlockerId, nSecurityId); + + cssu::Reference<cssxc::sax::XBlockerMonitor> xBlockerMonitor(xReferenceResolvedListener, cssu::UNO_QUERY); + xBlockerMonitor->setBlockerId(nBlockerId); + + cssu::Reference< cssxc::sax::XSignatureCreationResultBroadcaster > + xSignatureCreationResultBroadcaster(xReferenceResolvedListener, cssu::UNO_QUERY); + + xSignatureCreationResultBroadcaster->addSignatureCreationResultListener( this ); + + cssu::Reference<cssxc::sax::XReferenceResolvedBroadcaster> + xReferenceResolvedBroadcaster + (m_xSAXEventKeeper, + cssu::UNO_QUERY); + + xReferenceResolvedBroadcaster->addReferenceResolvedListener( + nIdOfSignatureElementCollector, + xReferenceResolvedListener); + + cssu::Reference<cssxc::sax::XReferenceCollector> xReferenceCollector + (xReferenceResolvedListener, cssu::UNO_QUERY); + + int i; + int size = vReferenceInfors.size(); + sal_Int32 nReferenceCount = 0; + + for(i=0; i<size; ++i) + { + sal_Int32 keeperId = internalSignatureInfor.vKeeperIds[i]; + + if ( keeperId != -1) + { + m_xSAXEventKeeper->setSecurityId(keeperId, nSecurityId); + xReferenceResolvedBroadcaster->addReferenceResolvedListener( keeperId, xReferenceResolvedListener); + xReferenceCollector->setReferenceId( keeperId ); + nReferenceCount++; + } + } + + xReferenceCollector->setReferenceCount( nReferenceCount ); + + /* + * adds all URI binding + */ + cssu::Reference<cssxc::XUriBinding> xUriBinding + (xReferenceResolvedListener, cssu::UNO_QUERY); + + for(i=0; i<size; ++i) + { + const SignatureReferenceInformation& refInfor = vReferenceInfors[i]; + + cssu::Reference< com::sun::star::io::XInputStream > xInputStream + = getObjectInputStream( refInfor.ouURI ); + + if (xInputStream.is()) + { + xUriBinding->setUriBinding(refInfor.ouURI,xInputStream); + } + } + + cssu::Reference<cssxc::sax::XKeyCollector> keyCollector (xReferenceResolvedListener, cssu::UNO_QUERY); + keyCollector->setKeyId(0); + + internalSignatureInfor.signatureInfor.ouSignatureId = createId(); + internalSignatureInfor.signatureInfor.ouPropertyId = createId(); + internalSignatureInfor.addReference(TYPE_SAMEDOCUMENT_REFERENCE, internalSignatureInfor.signatureInfor.ouPropertyId, -1 ); + size++; + + /* + * replace both digestValues and signatueValue to " " + */ + for(i=0; i<size; ++i) + { + SignatureReferenceInformation& refInfor = vReferenceInfors[i]; + refInfor.ouDigestValue = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(CHAR_BLANK)); + } + + internalSignatureInfor.signatureInfor.ouSignatureValue = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(CHAR_BLANK)); + + return xReferenceResolvedListener; +} + +/* public: for signature generation */ +void XSecController::collectToSign( sal_Int32 securityId, const rtl::OUString& referenceId ) +{ + /* DBG_ASSERT( m_xSAXEventKeeper.is(), "the SAXEventKeeper is NULL" ); */ + + chainOn(true); + + if ( m_nStatusOfSecurityComponents == INITIALIZED ) + /* + * if all security components are ready, add a signature. + */ + { + sal_Int32 nKeeperId = m_xSAXEventKeeper->addSecurityElementCollector( + cssxc::sax::ElementMarkPriority_AFTERMODIFY, sal_False); + + int index = findSignatureInfor( securityId ); + + if ( index == -1 ) + { + InternalSignatureInformation isi(securityId, NULL); + isi.addReference(TYPE_SAMEDOCUMENT_REFERENCE, referenceId, nKeeperId ); + m_vInternalSignatureInformations.push_back( isi ); + } + else + { + m_vInternalSignatureInformations[index].addReference(TYPE_SAMEDOCUMENT_REFERENCE, referenceId, nKeeperId ); + } + } +} + +void XSecController::signAStream( sal_Int32 securityId, const rtl::OUString& uri, const rtl::OUString& /*objectURL*/, sal_Bool isBinary) +{ + sal_Int32 type = ((isBinary==sal_True)?TYPE_BINARYSTREAM_REFERENCE:TYPE_XMLSTREAM_REFERENCE); + + int index = findSignatureInfor( securityId ); + + if (index == -1) + { + InternalSignatureInformation isi(securityId, NULL); + isi.addReference(type, uri, -1); + m_vInternalSignatureInformations.push_back( isi ); + } + else + { + m_vInternalSignatureInformations[index].addReference(type, uri, -1); + } +} + +void XSecController::setX509Certificate( + sal_Int32 nSecurityId, + const rtl::OUString& ouX509IssuerName, + const rtl::OUString& ouX509SerialNumber, + const rtl::OUString& ouX509Cert) +{ + setX509Certificate(nSecurityId, -1, ouX509IssuerName, ouX509SerialNumber, ouX509Cert); +} + +void XSecController::setX509Certificate( + sal_Int32 nSecurityId, + const sal_Int32 nSecurityEnvironmentIndex, + const rtl::OUString& ouX509IssuerName, + const rtl::OUString& ouX509SerialNumber, + const rtl::OUString& ouX509Cert) +{ + int index = findSignatureInfor( nSecurityId ); + + if ( index == -1 ) + { + InternalSignatureInformation isi(nSecurityId, NULL); + isi.signatureInfor.nSecurityEnvironmentIndex = nSecurityEnvironmentIndex; + isi.signatureInfor.ouX509IssuerName = ouX509IssuerName; + isi.signatureInfor.ouX509SerialNumber = ouX509SerialNumber; + isi.signatureInfor.ouX509Certificate = ouX509Cert; + m_vInternalSignatureInformations.push_back( isi ); + } + else + { + SignatureInformation &si + = m_vInternalSignatureInformations[index].signatureInfor; + si.ouX509IssuerName = ouX509IssuerName; + si.ouX509SerialNumber = ouX509SerialNumber; + si.ouX509Certificate = ouX509Cert; + si.nSecurityEnvironmentIndex = nSecurityEnvironmentIndex; + } +} + +void XSecController::setDate( + sal_Int32 nSecurityId, + const ::com::sun::star::util::DateTime& rDateTime ) +{ + int index = findSignatureInfor( nSecurityId ); + + if ( index == -1 ) + { + InternalSignatureInformation isi(nSecurityId, NULL); + isi.signatureInfor.stDateTime = rDateTime; + m_vInternalSignatureInformations.push_back( isi ); + } + else + { + SignatureInformation &si + = m_vInternalSignatureInformations[index].signatureInfor; + si.stDateTime = rDateTime; + } +} + +bool XSecController::WriteSignature( + const cssu::Reference<cssxs::XDocumentHandler>& xDocumentHandler ) +{ + bool rc = false; + + DBG_ASSERT( xDocumentHandler.is(), "I really need a document handler!" ); + + /* + * chain the SAXEventKeeper to the SAX chain + */ + chainOn(true); + + if ( m_nStatusOfSecurityComponents == INITIALIZED ) + /* + * if all security components are ready, add the signature + * stream. + */ + { + m_bIsSAXEventKeeperSticky = true; + m_xSAXEventKeeper->setNextHandler(xDocumentHandler); + + try + { + /* + * export the signature template + */ + cssu::Reference<cssxs::XDocumentHandler> xSEKHandler( m_xSAXEventKeeper,cssu::UNO_QUERY); + + int i; + int sigNum = m_vInternalSignatureInformations.size(); + + for (i=0; i<sigNum; ++i) + { + InternalSignatureInformation &isi = m_vInternalSignatureInformations[i]; + + /* + * prepare the signature creator + */ + isi.xReferenceResolvedListener + = prepareSignatureToWrite( isi ); + + exportSignature( xSEKHandler, isi.signatureInfor ); + } + + m_bIsSAXEventKeeperSticky = false; + chainOff(); + + rc = true; + } + catch( cssxs::SAXException& ) + { + m_pErrorMessage = ERROR_SAXEXCEPTIONDURINGCREATION; + } + catch( com::sun::star::io::IOException& ) + { + m_pErrorMessage = ERROR_IOEXCEPTIONDURINGCREATION; + } + catch( cssu::Exception& ) + { + m_pErrorMessage = ERROR_EXCEPTIONDURINGCREATION; + } + + m_xSAXEventKeeper->setNextHandler( NULL ); + m_bIsSAXEventKeeperSticky = false; + } + else + { + m_pErrorMessage = ERROR_CANNOTCREATEXMLSECURITYCOMPONENT; + } + + return rc; +} + diff --git a/xmlsecurity/source/helper/xsecverify.cxx b/xmlsecurity/source/helper/xsecverify.cxx new file mode 100644 index 000000000000..82210fdc91b3 --- /dev/null +++ b/xmlsecurity/source/helper/xsecverify.cxx @@ -0,0 +1,331 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_xmlsecurity.hxx" + +#include <xsecctl.hxx> +#include "xsecparser.hxx" +#include <tools/debug.hxx> + +#include <com/sun/star/xml/crypto/sax/XKeyCollector.hpp> +#include <com/sun/star/xml/crypto/sax/ElementMarkPriority.hpp> +#include <com/sun/star/xml/crypto/sax/XReferenceResolvedBroadcaster.hpp> +#include <com/sun/star/xml/crypto/sax/XReferenceCollector.hpp> +#include <com/sun/star/xml/crypto/sax/XSignatureVerifyResultBroadcaster.hpp> +#include <com/sun/star/xml/sax/SAXParseException.hpp> + +namespace cssu = com::sun::star::uno; +namespace cssl = com::sun::star::lang; +namespace cssxc = com::sun::star::xml::crypto; +namespace cssxs = com::sun::star::xml::sax; + +/* xml security framework components */ +#define SIGNATUREVERIFIER_COMPONENT "com.sun.star.xml.crypto.sax.SignatureVerifier" + +/* protected: for signature verify */ +cssu::Reference< cssxc::sax::XReferenceResolvedListener > XSecController::prepareSignatureToRead( + sal_Int32 nSecurityId) +{ + if ( m_nStatusOfSecurityComponents != INITIALIZED ) + { + return NULL; + } + + sal_Int32 nIdOfSignatureElementCollector; + cssu::Reference< cssxc::sax::XReferenceResolvedListener > xReferenceResolvedListener; + + nIdOfSignatureElementCollector = + m_xSAXEventKeeper->addSecurityElementCollector( cssxc::sax::ElementMarkPriority_BEFOREMODIFY, sal_False); + + m_xSAXEventKeeper->setSecurityId(nIdOfSignatureElementCollector, nSecurityId); + + /* + * create a SignatureVerifier + */ + cssu::Reference< cssl::XMultiComponentFactory > xMCF( mxCtx->getServiceManager() ); + xReferenceResolvedListener = cssu::Reference< cssxc::sax::XReferenceResolvedListener >( + xMCF->createInstanceWithContext( + rtl::OUString::createFromAscii( SIGNATUREVERIFIER_COMPONENT ), mxCtx), + cssu::UNO_QUERY); + + cssu::Reference<cssl::XInitialization> xInitialization(xReferenceResolvedListener, cssu::UNO_QUERY); + + cssu::Sequence<cssu::Any> args(5); + args[0] = cssu::makeAny(rtl::OUString::valueOf(nSecurityId)); + args[1] = cssu::makeAny(m_xSAXEventKeeper); + args[2] = cssu::makeAny(rtl::OUString::valueOf(nIdOfSignatureElementCollector)); + args[3] = cssu::makeAny(m_xSecurityContext); + args[4] = cssu::makeAny(m_xXMLSignature); + xInitialization->initialize(args); + + cssu::Reference< cssxc::sax::XSignatureVerifyResultBroadcaster > + signatureVerifyResultBroadcaster(xReferenceResolvedListener, cssu::UNO_QUERY); + + signatureVerifyResultBroadcaster->addSignatureVerifyResultListener( this ); + + cssu::Reference<cssxc::sax::XReferenceResolvedBroadcaster> xReferenceResolvedBroadcaster + (m_xSAXEventKeeper, + cssu::UNO_QUERY); + + xReferenceResolvedBroadcaster->addReferenceResolvedListener( + nIdOfSignatureElementCollector, + xReferenceResolvedListener); + + cssu::Reference<cssxc::sax::XKeyCollector> keyCollector (xReferenceResolvedListener, cssu::UNO_QUERY); + keyCollector->setKeyId(0); + + return xReferenceResolvedListener; +} + +void XSecController::addSignature() +{ + cssu::Reference< cssxc::sax::XReferenceResolvedListener > xReferenceResolvedListener = NULL; + sal_Int32 nSignatureId = 0; + + + if (m_bVerifyCurrentSignature) + { + chainOn(true); + xReferenceResolvedListener = prepareSignatureToRead( m_nReservedSignatureId ); + m_bVerifyCurrentSignature = false; + nSignatureId = m_nReservedSignatureId; + } + + InternalSignatureInformation isi( nSignatureId, xReferenceResolvedListener ); + m_vInternalSignatureInformations.push_back( isi ); +} + +void XSecController::addReference( const rtl::OUString& ouUri) +{ + InternalSignatureInformation &isi = m_vInternalSignatureInformations[m_vInternalSignatureInformations.size()-1]; + isi.addReference(TYPE_SAMEDOCUMENT_REFERENCE,ouUri, -1 ); +} + +void XSecController::addStreamReference( + const rtl::OUString& ouUri, + bool isBinary ) +{ + sal_Int32 type = (isBinary?TYPE_BINARYSTREAM_REFERENCE:TYPE_XMLSTREAM_REFERENCE); + + InternalSignatureInformation &isi = m_vInternalSignatureInformations[m_vInternalSignatureInformations.size()-1]; + + if ( isi.xReferenceResolvedListener.is() ) + { + /* + * get the input stream + */ + cssu::Reference< com::sun::star::io::XInputStream > xObjectInputStream + = getObjectInputStream( ouUri ); + + if ( xObjectInputStream.is() ) + { + cssu::Reference<cssxc::XUriBinding> xUriBinding + (isi.xReferenceResolvedListener, cssu::UNO_QUERY); + xUriBinding->setUriBinding(ouUri, xObjectInputStream); + } + } + + isi.addReference(type, ouUri, -1); +} + +void XSecController::setReferenceCount() const +{ + const InternalSignatureInformation &isi = m_vInternalSignatureInformations[m_vInternalSignatureInformations.size()-1]; + + if ( isi.xReferenceResolvedListener.is() ) + { + const SignatureReferenceInformations &refInfors = isi.signatureInfor.vSignatureReferenceInfors; + + int refNum = refInfors.size(); + sal_Int32 referenceCount = 0; + + for(int i=0 ; i<refNum; ++i) + { + if (refInfors[i].nType == TYPE_SAMEDOCUMENT_REFERENCE ) + /* + * same-document reference + */ + { + referenceCount++; + } + } + + cssu::Reference<cssxc::sax::XReferenceCollector> xReferenceCollector + (isi.xReferenceResolvedListener, cssu::UNO_QUERY); + xReferenceCollector->setReferenceCount( referenceCount ); + } +} + +void XSecController::setX509IssuerName( rtl::OUString& ouX509IssuerName ) +{ + InternalSignatureInformation &isi = m_vInternalSignatureInformations[m_vInternalSignatureInformations.size()-1]; + isi.signatureInfor.ouX509IssuerName = ouX509IssuerName; +} + +void XSecController::setX509SerialNumber( rtl::OUString& ouX509SerialNumber ) +{ + InternalSignatureInformation &isi = m_vInternalSignatureInformations[m_vInternalSignatureInformations.size()-1]; + isi.signatureInfor.ouX509SerialNumber = ouX509SerialNumber; +} + +void XSecController::setX509Certificate( rtl::OUString& ouX509Certificate ) +{ + InternalSignatureInformation &isi = m_vInternalSignatureInformations[m_vInternalSignatureInformations.size()-1]; + isi.signatureInfor.ouX509Certificate = ouX509Certificate; +} + +void XSecController::setSignatureValue( rtl::OUString& ouSignatureValue ) +{ + InternalSignatureInformation &isi = m_vInternalSignatureInformations[m_vInternalSignatureInformations.size()-1]; + isi.signatureInfor.ouSignatureValue = ouSignatureValue; +} + +void XSecController::setDigestValue( rtl::OUString& ouDigestValue ) +{ + SignatureInformation &si = m_vInternalSignatureInformations[m_vInternalSignatureInformations.size()-1].signatureInfor; + SignatureReferenceInformation &reference = si.vSignatureReferenceInfors[si.vSignatureReferenceInfors.size()-1]; + reference.ouDigestValue = ouDigestValue; +} + +void XSecController::setDate( rtl::OUString& ouDate ) +{ + InternalSignatureInformation &isi = m_vInternalSignatureInformations[m_vInternalSignatureInformations.size()-1]; + convertDateTime( isi.signatureInfor.stDateTime, ouDate ); + isi.signatureInfor.ouDateTime = ouDate; +} + +/* +void XSecController::setTime( rtl::OUString& ouTime ) +{ + InternalSignatureInformation &isi = m_vInternalSignatureInformations[m_vInternalSignatureInformations.size()-1]; + isi.signatureInfor.ouTime = ouTime; +} +*/ + +void XSecController::setId( rtl::OUString& ouId ) +{ + InternalSignatureInformation &isi = m_vInternalSignatureInformations[m_vInternalSignatureInformations.size()-1]; + isi.signatureInfor.ouSignatureId = ouId; +} + +void XSecController::setPropertyId( rtl::OUString& ouPropertyId ) +{ + InternalSignatureInformation &isi = m_vInternalSignatureInformations[m_vInternalSignatureInformations.size()-1]; + isi.signatureInfor.ouPropertyId = ouPropertyId; +} + +/* public: for signature verify */ +void XSecController::collectToVerify( const rtl::OUString& referenceId ) +{ + /* DBG_ASSERT( m_xSAXEventKeeper.is(), "the SAXEventKeeper is NULL" ); */ + + if ( m_nStatusOfSecurityComponents == INITIALIZED ) + /* + * if all security components are ready, verify the signature. + */ + { + bool bJustChainingOn = false; + cssu::Reference< cssxs::XDocumentHandler > xHandler = NULL; + + int i,j; + int sigNum = m_vInternalSignatureInformations.size(); + + for (i=0; i<sigNum; ++i) + { + InternalSignatureInformation& isi = m_vInternalSignatureInformations[i]; + SignatureReferenceInformations& vReferenceInfors = isi.signatureInfor.vSignatureReferenceInfors; + int refNum = vReferenceInfors.size(); + + for (j=0; j<refNum; ++j) + { + SignatureReferenceInformation &refInfor = vReferenceInfors[j]; + + if (refInfor.ouURI == referenceId) + { + if (chainOn(false)) + { + bJustChainingOn = true; + xHandler = m_xSAXEventKeeper->setNextHandler(NULL); + } + + sal_Int32 nKeeperId = m_xSAXEventKeeper->addSecurityElementCollector( + cssxc::sax::ElementMarkPriority_BEFOREMODIFY, sal_False ); + + cssu::Reference<cssxc::sax::XReferenceResolvedBroadcaster> xReferenceResolvedBroadcaster + (m_xSAXEventKeeper, + cssu::UNO_QUERY ); + + cssu::Reference<cssxc::sax::XReferenceCollector> xReferenceCollector + ( isi.xReferenceResolvedListener, cssu::UNO_QUERY ); + + m_xSAXEventKeeper->setSecurityId(nKeeperId, isi.signatureInfor.nSecurityId); + xReferenceResolvedBroadcaster->addReferenceResolvedListener( nKeeperId, isi.xReferenceResolvedListener); + xReferenceCollector->setReferenceId( nKeeperId ); + + isi.vKeeperIds[j] = nKeeperId; + break; + } + } + } + + if ( bJustChainingOn ) + { + cssu::Reference< cssxs::XDocumentHandler > xSEKHandler(m_xSAXEventKeeper, cssu::UNO_QUERY); + if (m_xElementStackKeeper.is()) + { + m_xElementStackKeeper->retrieve(xSEKHandler, sal_True); + } + m_xSAXEventKeeper->setNextHandler(xHandler); + } + } +} + +void XSecController::addSignature( sal_Int32 nSignatureId ) +{ + DBG_ASSERT( m_pXSecParser != NULL, "No XSecParser initialized" ); + + m_nReservedSignatureId = nSignatureId; + m_bVerifyCurrentSignature = true; +} + +cssu::Reference< cssxs::XDocumentHandler > XSecController::createSignatureReader() +{ + m_pXSecParser = new XSecParser( this, NULL ); + cssu::Reference< cssl::XInitialization > xInitialization = m_pXSecParser; + + setSAXChainConnector(xInitialization, NULL, NULL); + + return m_pXSecParser; +} + +void XSecController::releaseSignatureReader() +{ + clearSAXChainConnector( ); + m_pXSecParser = NULL; +} + diff --git a/xmlsecurity/source/xmlsec/biginteger.cxx b/xmlsecurity/source/xmlsec/biginteger.cxx new file mode 100644 index 000000000000..e3947671ae38 --- /dev/null +++ b/xmlsecurity/source/xmlsec/biginteger.cxx @@ -0,0 +1,126 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_xmlsecurity.hxx" + +#include <xmlsecurity/biginteger.hxx> + +#include <sal/types.h> +//For reasons that escape me, this is what xmlsec does when size_t is not 4 +#if SAL_TYPES_SIZEOFPOINTER != 4 +# define XMLSEC_NO_SIZE_T +#endif +#include <xmlsec/xmlsec.h> +#include <xmlsec/bn.h> +#include <com/sun/star/uno/Sequence.hxx> + +using namespace ::com::sun::star::uno ; +using ::rtl::OUString ; + +Sequence< sal_Int8 > numericStringToBigInteger ( OUString numeral ) +{ + if( numeral.getStr() != NULL ) + { + xmlChar* chNumeral ; + const xmlSecByte* bnInteger ; + xmlSecSize length ; + xmlSecBn bn ; + + rtl::OString onumeral = rtl::OUStringToOString( numeral , RTL_TEXTENCODING_ASCII_US ) ; + + chNumeral = xmlStrndup( ( const xmlChar* )onumeral.getStr(), ( int )onumeral.getLength() ) ; + + if( xmlSecBnInitialize( &bn, 0 ) < 0 ) { + xmlFree( chNumeral ) ; + return Sequence< sal_Int8 >(); + } + + if( xmlSecBnFromDecString( &bn, chNumeral ) < 0 ) { + xmlFree( chNumeral ) ; + xmlSecBnFinalize( &bn ) ; + return Sequence< sal_Int8 >(); + } + + xmlFree( chNumeral ) ; + + length = xmlSecBnGetSize( &bn ) ; + if( length <= 0 ) { + xmlSecBnFinalize( &bn ) ; + return Sequence< sal_Int8 >(); + } + + bnInteger = xmlSecBnGetData( &bn ) ; + if( bnInteger == NULL ) { + xmlSecBnFinalize( &bn ) ; + return Sequence< sal_Int8 >(); + } + + Sequence< sal_Int8 > integer( length ) ; + for( unsigned int i = 0 ; i < length ; i ++ ) + { + integer[i] = *( bnInteger + i ) ; + } + + xmlSecBnFinalize( &bn ) ; + return integer ; + } + + return Sequence< sal_Int8 >(); +} + +OUString bigIntegerToNumericString ( Sequence< sal_Int8 > integer ) +{ + OUString aRet ; + + if( integer.getLength() ) { + xmlSecBn bn ; + xmlChar* chNumeral ; + + if( xmlSecBnInitialize( &bn, 0 ) < 0 ) + return aRet ; + + if( xmlSecBnSetData( &bn, ( const unsigned char* )&integer[0], integer.getLength() ) < 0 ) { + xmlSecBnFinalize( &bn ) ; + return aRet ; + } + + chNumeral = xmlSecBnToDecString( &bn ) ; + if( chNumeral == NULL ) { + xmlSecBnFinalize( &bn ) ; + return aRet ; + } + + aRet = OUString::createFromAscii( ( const char* )chNumeral ) ; + + xmlSecBnFinalize( &bn ) ; + xmlFree( chNumeral ) ; + } + + return aRet ; +} + diff --git a/xmlsecurity/source/xmlsec/certificateextension_xmlsecimpl.cxx b/xmlsecurity/source/xmlsec/certificateextension_xmlsecimpl.cxx new file mode 100644 index 000000000000..19dfeb9c08a7 --- /dev/null +++ b/xmlsecurity/source/xmlsec/certificateextension_xmlsecimpl.cxx @@ -0,0 +1,97 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_xmlsecurity.hxx" +#include <sal/config.h> +#include <rtl/uuid.h> + +#ifndef _certificateextension_nssimpl_hxx_ +#include "certificateextension_xmlsecimpl.hxx" +#endif + +using namespace ::com::sun::star::uno ; +using ::rtl::OUString ; + +using ::com::sun::star::security::XCertificateExtension ; + +CertificateExtension_XmlSecImpl :: CertificateExtension_XmlSecImpl() : + m_critical( sal_False ) , + m_xExtnId() , + m_xExtnValue() +{ +} + +CertificateExtension_XmlSecImpl :: ~CertificateExtension_XmlSecImpl() { +} + + +//Methods from XCertificateExtension +sal_Bool SAL_CALL CertificateExtension_XmlSecImpl :: isCritical() throw( ::com::sun::star::uno::RuntimeException ) { + return m_critical ; +} + +::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL CertificateExtension_XmlSecImpl :: getExtensionId() throw( ::com::sun::star::uno::RuntimeException ) { + return m_xExtnId ; +} + +::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL CertificateExtension_XmlSecImpl :: getExtensionValue() throw( ::com::sun::star::uno::RuntimeException ) { + return m_xExtnValue ; +} + +//Helper method +void CertificateExtension_XmlSecImpl :: setCertExtn( ::com::sun::star::uno::Sequence< sal_Int8 > extnId, ::com::sun::star::uno::Sequence< sal_Int8 > extnValue, sal_Bool critical ) { + m_critical = critical ; + m_xExtnId = extnId ; + m_xExtnValue = extnValue ; +} + +void CertificateExtension_XmlSecImpl :: setCertExtn( unsigned char* value, unsigned int vlen, unsigned char* id, unsigned int idlen, sal_Bool critical ) { + unsigned int i ; + if( value != NULL && vlen != 0 ) { + Sequence< sal_Int8 > extnv( vlen ) ; + for( i = 0; i < vlen ; i ++ ) + extnv[i] = *( value + i ) ; + + m_xExtnValue = extnv ; + } else { + m_xExtnValue = Sequence<sal_Int8>(); + } + + if( id != NULL && idlen != 0 ) { + Sequence< sal_Int8 > extnId( idlen ) ; + for( i = 0; i < idlen ; i ++ ) + extnId[i] = *( id + i ) ; + + m_xExtnId = extnId ; + } else { + m_xExtnId = Sequence<sal_Int8>(); + } + + m_critical = critical ; +} + diff --git a/xmlsecurity/source/xmlsec/certificateextension_xmlsecimpl.hxx b/xmlsecurity/source/xmlsec/certificateextension_xmlsecimpl.hxx new file mode 100644 index 000000000000..26d5e413307c --- /dev/null +++ b/xmlsecurity/source/xmlsec/certificateextension_xmlsecimpl.hxx @@ -0,0 +1,65 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _CERTIFICATEEXTENSION_XMLSECIMPL_HXX_ +#define _CERTIFICATEEXTENSION_XMLSECIMPL_HXX_ + +#include <sal/config.h> +#include <rtl/ustring.hxx> +#include <cppuhelper/factory.hxx> +#include <cppuhelper/implbase1.hxx> +#include <com/sun/star/uno/Exception.hpp> +#include "com/sun/star/uno/SecurityException.hpp" +#include <com/sun/star/security/XCertificateExtension.hpp> + +class CertificateExtension_XmlSecImpl : public ::cppu::WeakImplHelper1< + ::com::sun::star::security::XCertificateExtension > +{ + private : + sal_Bool m_critical ; + ::com::sun::star::uno::Sequence< sal_Int8 > m_xExtnId ; + ::com::sun::star::uno::Sequence< sal_Int8 > m_xExtnValue ; + + public : + CertificateExtension_XmlSecImpl() ; + virtual ~CertificateExtension_XmlSecImpl() ; + + //Methods from XCertificateExtension + virtual sal_Bool SAL_CALL isCritical() throw( ::com::sun::star::uno::RuntimeException ) ; + + virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getExtensionId() throw( ::com::sun::star::uno::RuntimeException ) ; + + virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getExtensionValue() throw( ::com::sun::star::uno::RuntimeException ) ; + + //Helper method + void setCertExtn( ::com::sun::star::uno::Sequence< sal_Int8 > extnId, ::com::sun::star::uno::Sequence< sal_Int8 > extnValue, sal_Bool critical ) ; + + void setCertExtn( unsigned char* value, unsigned int vlen, unsigned char* id, unsigned int idlen, sal_Bool critical ) ; +} ; + +#endif // _CERTIFICATEEXTENSION_XMLSECIMPL_HXX_ + diff --git a/xmlsecurity/source/xmlsec/certvalidity.cxx b/xmlsecurity/source/xmlsec/certvalidity.cxx new file mode 100644 index 000000000000..b92fe3b1214e --- /dev/null +++ b/xmlsecurity/source/xmlsec/certvalidity.cxx @@ -0,0 +1,98 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_xmlsecurity.hxx" + +#include <xmlsecurity/certvalidity.hxx> +#include <com/sun/star/security/CertificateValidity.hpp> + +using ::rtl::OUString ; +using namespace ::com::sun::star::security ; + +#define VALID_STR "valid certificate" +#define INVALID_STR "invalid certificate" +#define UNTRUSTED_STR "untrusted certificate" +#define TIME_INVALID_STR "expired certificate" +#define NOT_NESTED_TIME_STR "invalid time nesting" +#define REVOKED_STR "revoked certificate" +#define UNKNOWN_REVOKATION_STR "unknown certificate revocation status" +#define SIGNATURE_INVALID_STR "invalid certificate signature" +#define EXTENSION_INVALID_STR "invalid certificate extension" +#define EXTENSION_UNKNOWN_STR "unknown critical certificate extension" +#define ISSUER_UNKNOWN_STR "unknown certificate issuer" +#define ISSUER_UNTRUSTED_STR "untrusted certificate issuer" +#define ISSUER_INVALID_STR "invalid certificate issuer" +#define ROOT_UNKNOWN_STR "unknown root certificate" +#define ROOT_UNTRUSTED_STR "untrusted root certificate" +#define ROOT_INVALID_STR "invalid root certificate" +#define CHAIN_INCOMPLETE_STR "invalid certification path" + +rtl::OUString certificateValidityToOUString( ::sal_Int32 certValidity ) { + OUString aValidity ; + + if( (certValidity & CertificateValidity::VALID) == CertificateValidity::VALID ) { + aValidity = OUString::createFromAscii( ( const char* )VALID_STR ) ; + } else if( ( certValidity & CertificateValidity::INVALID ) == CertificateValidity::INVALID ) { + aValidity = OUString::createFromAscii( ( const char* )INVALID_STR ) ; + } else if( ( certValidity & CertificateValidity::UNTRUSTED ) == CertificateValidity::UNTRUSTED ) { + aValidity = OUString::createFromAscii( ( const char* )UNTRUSTED_STR ) ; + } else if( ( certValidity & CertificateValidity::TIME_INVALID ) == CertificateValidity::TIME_INVALID ) { + aValidity = OUString::createFromAscii( ( const char* )TIME_INVALID_STR ) ; + } else if( ( certValidity & CertificateValidity::NOT_TIME_NESTED ) == CertificateValidity::NOT_TIME_NESTED ) { + aValidity = OUString::createFromAscii( ( const char* )NOT_NESTED_TIME_STR ) ; + } else if( ( certValidity & CertificateValidity::REVOKED ) == CertificateValidity::REVOKED ) { + aValidity = OUString::createFromAscii( ( const char* )REVOKED_STR ) ; + } else if( ( certValidity & CertificateValidity::UNKNOWN_REVOKATION ) == CertificateValidity::UNKNOWN_REVOKATION ) { + aValidity = OUString::createFromAscii( ( const char* )UNKNOWN_REVOKATION_STR ) ; + } else if( ( certValidity & CertificateValidity::SIGNATURE_INVALID ) == CertificateValidity::SIGNATURE_INVALID ) { + aValidity = OUString::createFromAscii( ( const char* )SIGNATURE_INVALID_STR ) ; + } else if( ( certValidity & CertificateValidity::EXTENSION_INVALID ) == CertificateValidity::EXTENSION_INVALID ) { + aValidity = OUString::createFromAscii( ( const char* )EXTENSION_INVALID_STR ) ; + } else if( ( certValidity & CertificateValidity::EXTENSION_UNKNOWN ) == CertificateValidity::EXTENSION_UNKNOWN ) { + aValidity = OUString::createFromAscii( ( const char* )EXTENSION_UNKNOWN_STR ) ; + } else if( ( certValidity & CertificateValidity::ISSUER_UNKNOWN ) == CertificateValidity::ISSUER_UNKNOWN ) { + aValidity = OUString::createFromAscii( ( const char* )ISSUER_UNKNOWN_STR ) ; + } else if( ( certValidity & CertificateValidity::ISSUER_UNTRUSTED ) == CertificateValidity::ISSUER_UNTRUSTED ) { + aValidity = OUString::createFromAscii( ( const char* )ISSUER_UNTRUSTED_STR ) ; + } else if( ( certValidity & CertificateValidity::ISSUER_INVALID ) == CertificateValidity::ISSUER_INVALID ) { + aValidity = OUString::createFromAscii( ( const char* )ISSUER_INVALID_STR ) ; + } else if( ( certValidity & CertificateValidity::ROOT_UNKNOWN ) == CertificateValidity::ROOT_UNKNOWN ) { + aValidity = OUString::createFromAscii( ( const char* )ROOT_UNKNOWN_STR ) ; + } else if( ( certValidity & CertificateValidity::ROOT_UNTRUSTED ) == CertificateValidity::ROOT_UNTRUSTED ) { + aValidity = OUString::createFromAscii( ( const char* )ROOT_UNTRUSTED_STR ) ; + } else if( ( certValidity & CertificateValidity::ROOT_INVALID ) == CertificateValidity::ROOT_INVALID ) { + aValidity = OUString::createFromAscii( ( const char* )ROOT_INVALID_STR ) ; + } else if( ( certValidity & CertificateValidity::CHAIN_INCOMPLETE ) == CertificateValidity::CHAIN_INCOMPLETE ) { + aValidity = OUString::createFromAscii( ( const char* )CHAIN_INCOMPLETE_STR ) ; + } else { + aValidity = OUString::createFromAscii( ( const char* )INVALID_STR ) ; + } + + return aValidity ; +} + diff --git a/xmlsecurity/source/xmlsec/diagnose.cxx b/xmlsecurity/source/xmlsec/diagnose.cxx new file mode 100644 index 000000000000..4c10d2f7d576 --- /dev/null +++ b/xmlsecurity/source/xmlsec/diagnose.cxx @@ -0,0 +1,77 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: xmlstreamio.hxx,v $ + * $Revision: 1.3 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "diagnose.hxx" +#include <stdio.h> +#include <stdarg.h> +#include "rtl/instance.hxx" +#include "rtl/bootstrap.hxx" + +namespace xmlsecurity { + +struct UseDiagnose : public rtl::StaticWithInit< + const bool, UseDiagnose> +{ + bool operator () () const + { + ::rtl::OUString value; + sal_Bool res = rtl::Bootstrap::get( + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("XMLSECURITY_TRACE")), value); + return res == sal_True ? true : false; + } +}; + +/* the function will print the string when + - build with debug + - the bootstrap variable XMLSECURITY_TRACE is set. + */ +void xmlsec_trace(const char* pszFormat, ...) +{ + bool bDebug = false; + +#if OSL_DEBUG_LEVEL > 1 + bDebug = true; +#endif + if (bDebug || UseDiagnose::get()) + { + va_list args; + fprintf(stderr, "[xmlsecurity] "); + va_start(args, pszFormat); + vfprintf(stderr, pszFormat, args); + va_end(args); + + fprintf(stderr,"\n"); + fflush(stderr); + } +} + + + +} diff --git a/xmlsecurity/source/xmlsec/diagnose.hxx b/xmlsecurity/source/xmlsec/diagnose.hxx new file mode 100644 index 000000000000..691d4e277c20 --- /dev/null +++ b/xmlsecurity/source/xmlsec/diagnose.hxx @@ -0,0 +1,43 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: xmlstreamio.hxx,v $ + * $Revision: 1.3 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef XMLSECURITY_DIAGNOSE_HXX +#define XMLSECURITY_DIAGNOSE_HXX + + +namespace xmlsecurity +{ + + void xmlsec_trace(const char* pszFormat, ...); +} + + + +#endif //XMLSECURITY_DIAGNOSE_HXX diff --git a/xmlsecurity/source/xmlsec/errorcallback.cxx b/xmlsecurity/source/xmlsec/errorcallback.cxx new file mode 100644 index 000000000000..2c55bf1a4fad --- /dev/null +++ b/xmlsecurity/source/xmlsec/errorcallback.cxx @@ -0,0 +1,211 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_xmlsecurity.hxx" + +/* + * Implementation of the I/O interfaces based on stream and URI binding + */ +#include "errorcallback.hxx" + +#include <sal/types.h> +//For reasons that escape me, this is what xmlsec does when size_t is not 4 +#if SAL_TYPES_SIZEOFPOINTER != 4 +# define XMLSEC_NO_SIZE_T +#endif +#include "xmlsec/xmlsec.h" +#include "xmlsec/errors.h" + +using namespace ::com::sun::star::xml::crypto; + +// ::com::sun::star::uno::Reference< XXMLSecurityTemplate > g_xErrorRecorder; +// bool g_bErrorRecorded; + +// SecurityOperationStatus getOperationStatus(int reason) +// { +// switch (reason) +// { +// case XMLSEC_ERRORS_R_XMLSEC_FAILED: +// return SecurityOperationStatus_ENGINE_FAILED; +// case XMLSEC_ERRORS_R_MALLOC_FAILED: +// return SecurityOperationStatus_MALLOC_FAILED; +// case XMLSEC_ERRORS_R_STRDUP_FAILED: +// return SecurityOperationStatus_STRDUP_FAILED; +// case XMLSEC_ERRORS_R_CRYPTO_FAILED: +// return SecurityOperationStatus_CRYPTO_FAILED; +// case XMLSEC_ERRORS_R_XML_FAILED: +// return SecurityOperationStatus_XML_FAILED; +// case XMLSEC_ERRORS_R_XSLT_FAILED: +// return SecurityOperationStatus_XSLT_FAILED; +// case XMLSEC_ERRORS_R_IO_FAILED: +// return SecurityOperationStatus_IO_FAILED; +// case XMLSEC_ERRORS_R_DISABLED: +// return SecurityOperationStatus_DISABLED; +// case XMLSEC_ERRORS_R_NOT_IMPLEMENTED: +// return SecurityOperationStatus_NOT_IMPLEMENTED; +// case XMLSEC_ERRORS_R_INVALID_SIZE: +// return SecurityOperationStatus_INVALID_SIZE; +// case XMLSEC_ERRORS_R_INVALID_DATA: +// return SecurityOperationStatus_INVALID_DATA; +// case XMLSEC_ERRORS_R_INVALID_RESULT: +// return SecurityOperationStatus_INVALID_RESULT; +// case XMLSEC_ERRORS_R_INVALID_TYPE: +// return SecurityOperationStatus_INVALID_TYPE; +// case XMLSEC_ERRORS_R_INVALID_OPERATION: +// return SecurityOperationStatus_INVALID_OPERATION; +// case XMLSEC_ERRORS_R_INVALID_STATUS: +// return SecurityOperationStatus_INVALID_STATUS; +// case XMLSEC_ERRORS_R_INVALID_FORMAT: +// return SecurityOperationStatus_INVALID_FORMAT; +// case XMLSEC_ERRORS_R_DATA_NOT_MATCH: +// return SecurityOperationStatus_DATA_NOT_MATCH; +// case XMLSEC_ERRORS_R_INVALID_NODE: +// return SecurityOperationStatus_INVALID_NODE; +// case XMLSEC_ERRORS_R_INVALID_NODE_CONTENT: +// return SecurityOperationStatus_INVALID_NODE_CONTENT; +// case XMLSEC_ERRORS_R_INVALID_NODE_ATTRIBUTE: +// return SecurityOperationStatus_INVALID_NODE_ATTRIBUTE; +// case XMLSEC_ERRORS_R_MISSING_NODE_ATTRIBUTE: +// return SecurityOperationStatus_MISSING_NODE_ATTRIBUTE; +// case XMLSEC_ERRORS_R_NODE_ALREADY_PRESENT: +// return SecurityOperationStatus_NODE_ALREADY_PRESENT; +// case XMLSEC_ERRORS_R_UNEXPECTED_NODE: +// return SecurityOperationStatus_UNEXPECTED_NODE; +// case XMLSEC_ERRORS_R_NODE_NOT_FOUND: +// return SecurityOperationStatus_NODE_NOT_FOUND; +// case XMLSEC_ERRORS_R_INVALID_TRANSFORM: +// return SecurityOperationStatus_INVALID_TRANSFORM; +// case XMLSEC_ERRORS_R_INVALID_TRANSFORM_KEY: +// return SecurityOperationStatus_INVALID_TRANSFORM_KEY; +// case XMLSEC_ERRORS_R_INVALID_URI_TYPE: +// return SecurityOperationStatus_INVALID_URI_TYPE; +// case XMLSEC_ERRORS_R_TRANSFORM_SAME_DOCUMENT_REQUIRED: +// return SecurityOperationStatus_TRANSFORM_SAME_DOCUMENT_REQUIRED; +// case XMLSEC_ERRORS_R_TRANSFORM_DISABLED: +// return SecurityOperationStatus_TRANSFORM_DISABLED; +// case XMLSEC_ERRORS_R_INVALID_KEY_DATA: +// return SecurityOperationStatus_INVALID_KEY_DATA; +// case XMLSEC_ERRORS_R_KEY_DATA_NOT_FOUND: +// return SecurityOperationStatus_KEY_DATA_NOT_FOUND; +// case XMLSEC_ERRORS_R_KEY_DATA_ALREADY_EXIST: +// return SecurityOperationStatus_KEY_DATA_ALREADY_EXIST; +// case XMLSEC_ERRORS_R_INVALID_KEY_DATA_SIZE: +// return SecurityOperationStatus_INVALID_KEY_DATA_SIZE; +// case XMLSEC_ERRORS_R_KEY_NOT_FOUND: +// return SecurityOperationStatus_KEY_NOT_FOUND; +// case XMLSEC_ERRORS_R_KEYDATA_DISABLED: +// return SecurityOperationStatus_KEYDATA_DISABLED; +// case XMLSEC_ERRORS_R_MAX_RETRIEVALS_LEVEL: +// return SecurityOperationStatus_MAX_RETRIEVALS_LEVEL; +// case XMLSEC_ERRORS_R_MAX_RETRIEVAL_TYPE_MISMATCH: +// return SecurityOperationStatus_MAX_RETRIEVAL_TYPE_MISMATCH; +// case XMLSEC_ERRORS_R_MAX_ENCKEY_LEVEL: +// return SecurityOperationStatus_MAX_ENCKEY_LEVEL; +// case XMLSEC_ERRORS_R_CERT_VERIFY_FAILED: +// return SecurityOperationStatus_CERT_VERIFY_FAILED; +// case XMLSEC_ERRORS_R_CERT_NOT_FOUND: +// return SecurityOperationStatus_CERT_NOT_FOUND; +// case XMLSEC_ERRORS_R_CERT_REVOKED: +// return SecurityOperationStatus_CERT_REVOKED; +// case XMLSEC_ERRORS_R_CERT_ISSUER_FAILED: +// return SecurityOperationStatus_CERT_ISSUER_FAILED; +// case XMLSEC_ERRORS_R_CERT_NOT_YET_VALID: +// return SecurityOperationStatus_CERT_NOT_YET_VALID; +// case XMLSEC_ERRORS_R_CERT_HAS_EXPIRED: +// return SecurityOperationStatus_CERT_HAS_EXPIRED; +// case XMLSEC_ERRORS_R_DSIG_NO_REFERENCES: +// return SecurityOperationStatus_DSIG_NO_REFERENCES; +// case XMLSEC_ERRORS_R_DSIG_INVALID_REFERENCE: +// return SecurityOperationStatus_DSIG_INVALID_REFERENCE; +// case XMLSEC_ERRORS_R_ASSERTION: +// return SecurityOperationStatus_ASSERTION; +// default: +// return SecurityOperationStatus_RUNTIMEERROR_FAILED; +// } +// } + + +extern "C" +void errorCallback(const char * /*file*/, + int /*line*/, + const char * /*func*/, + const char * /*errorObject*/, + const char * /*errorSubject*/, + int /*reason*/, + const char * /*msg*/) +{ +#if OSL_DEBUG_LEVEL > 1 +// const char * afunc = func ? func : ""; +// const char * errObj = errorObject ? errorObject : ""; +// const char * errSub = errorSubject ? errorSubject : ""; +// const char * amsg = msg ? msg : ""; +// fprintf(stdout, "xmlsec error: %s, %s, %s, %i %s \n", afunc, errObj, errSub, reason, amsg); +#endif + //ToDo write log message +// if (g_xErrorRecorder.is() && !g_bErrorRecorded) +// { +// g_xErrorRecorder->setStatus(getOperationStatus(reason)); + +// if ( reason != XMLSEC_ERRORS_R_ASSERTION && reason!=XMLSEC_ERRORS_R_XMLSEC_FAILED) +// { +// g_bErrorRecorded = true; +// } +// } +} + +// void setErrorRecorder(const ::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XXMLSecurityTemplate >& xTemplate) +// { +// g_xErrorRecorder = xTemplate; +// g_xErrorRecorder->setStatus(SecurityOperationStatus_OPERATION_SUCCEEDED); +// g_bErrorRecorded = false; +// xmlSecErrorsSetCallback(errorCallback); +// } + +//void setErrorRecorder(const ::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XXMLSignatureTemplate >& xTemplate) + +void setErrorRecorder() +{ +// ::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XXMLSecurityTemplate > +// xSecurityTemplate(xTemplate, ::com::sun::star::uno::UNO_QUERY); +// setErrorRecorder( xSecurityTemplate ); + xmlSecErrorsSetCallback(errorCallback); +} + +// void setErrorRecorder(const ::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XXMLEncryptionTemplate >& xTemplate) +// { +// ::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XXMLSecurityTemplate > +// xSecurityTemplate(xTemplate, ::com::sun::star::uno::UNO_QUERY); +// setErrorRecorder( xSecurityTemplate ); +// } + +void clearErrorRecorder() +{ + xmlSecErrorsSetCallback(NULL); +// g_xErrorRecorder = NULL; +} + diff --git a/xmlsecurity/source/xmlsec/errorcallback.hxx b/xmlsecurity/source/xmlsec/errorcallback.hxx new file mode 100644 index 000000000000..8c219a5396fd --- /dev/null +++ b/xmlsecurity/source/xmlsec/errorcallback.hxx @@ -0,0 +1,44 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _ERRORCALLBACK_XMLSECIMPL_HXX_ +#define _ERRORCALLBACK_XMLSECIMPL_HXX_ + +#ifndef _COM_SUN_STAR_UNO_REFERENCE_HPP_ +#include <com/sun/star/uno/Reference.hxx> +#endif +#include <com/sun/star/xml/crypto/XXMLSignatureTemplate.hpp> +#include <com/sun/star/xml/crypto/XXMLEncryptionTemplate.hpp> + +// Only used for logging +void setErrorRecorder(); +//ToDo +//void setErrorRecorder(const ::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XXMLEncryptionTemplate >& xTemplate); +void clearErrorRecorder(); + +#endif + diff --git a/xmlsecurity/source/xmlsec/makefile.mk b/xmlsecurity/source/xmlsec/makefile.mk new file mode 100644 index 000000000000..44b668b84765 --- /dev/null +++ b/xmlsecurity/source/xmlsec/makefile.mk @@ -0,0 +1,72 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2000, 2010 Oracle and/or its affiliates. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# This file is part of OpenOffice.org. +# +# OpenOffice.org is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License version 3 +# only, as published by the Free Software Foundation. +# +# OpenOffice.org is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License version 3 for more details +# (a copy is included in the LICENSE file that accompanied this code). +# +# You should have received a copy of the GNU Lesser General Public License +# version 3 along with OpenOffice.org. If not, see +# <http://www.openoffice.org/license.html> +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +PRJ=..$/.. + +PRJNAME = xmlsecurity +TARGET = xs_comm + +ENABLE_EXCEPTIONS = TRUE + +# --- Settings ----------------------------------------------------- + +.INCLUDE : settings.mk +.INCLUDE : $(PRJ)$/util$/target.pmk + +.IF "$(SYSTEM_LIBXML)" == "YES" +CFLAGS+=-DSYSTEM_LIBXML $(LIBXML_CFLAGS) +.ENDIF + +.IF "$(WITH_MOZILLA)" == "NO" || "$(ENABLE_NSS_MODULE)"!="YES" +.IF "$(SYSTEM_MOZILLA)" != "YES" +@all: + @echo "No mozilla -> no nss -> no libxmlsec -> no xmlsecurity.." +.ENDIF +.ENDIF + +.IF "$(CRYPTO_ENGINE)" == "mscrypto" +CDEFS += -DXMLSEC_CRYPTO_MSCRYPTO -DXMLSEC_NO_XSLT +.ELSE +CDEFS += -DXMLSEC_CRYPTO_NSS -DXMLSEC_NO_XSLT +.ENDIF + +# --- Files -------------------------------------------------------- +SLOFILES = \ + $(SLO)$/biginteger.obj \ + $(SLO)$/certvalidity.obj \ + $(SLO)$/saxhelper.obj \ + $(SLO)$/xmldocumentwrapper_xmlsecimpl.obj \ + $(SLO)$/xmlelementwrapper_xmlsecimpl.obj \ + $(SLO)$/certificateextension_xmlsecimpl.obj \ + $(SLO)$/xmlstreamio.obj \ + $(SLO)$/errorcallback.obj \ + $(SLO)$/xsec_xmlsec.obj \ + $(SLO)$/diagnose.obj + +# --- Targets ------------------------------------------------------ + +.INCLUDE : target.mk diff --git a/xmlsecurity/source/xmlsec/mscrypt/makefile.mk b/xmlsecurity/source/xmlsec/mscrypt/makefile.mk new file mode 100644 index 000000000000..20153edf18e6 --- /dev/null +++ b/xmlsecurity/source/xmlsec/mscrypt/makefile.mk @@ -0,0 +1,73 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2000, 2010 Oracle and/or its affiliates. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# This file is part of OpenOffice.org. +# +# OpenOffice.org is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License version 3 +# only, as published by the Free Software Foundation. +# +# OpenOffice.org is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License version 3 for more details +# (a copy is included in the LICENSE file that accompanied this code). +# +# You should have received a copy of the GNU Lesser General Public License +# version 3 along with OpenOffice.org. If not, see +# <http://www.openoffice.org/license.html> +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +PRJ=..$/..$/.. + +PRJNAME = xmlsecurity +TARGET = xs_mscrypt + +ENABLE_EXCEPTIONS = TRUE + +# --- Settings ----------------------------------------------------- + +.INCLUDE : settings.mk +.INCLUDE : $(PRJ)$/util$/target.pmk + +.IF "$(CRYPTO_ENGINE)" != "mscrypto" +LIBTARGET=NO +.ENDIF + +.IF "$(CRYPTO_ENGINE)" == "mscrypto" + +.IF "$(WITH_MOZILLA)" == "NO" || "$(ENABLE_NSS_MODULE)"!="YES" +.IF "$(SYSTEM_MOZILLA)" != "YES" +@all: + @echo "No mozilla -> no nss -> no libxmlsec -> no xmlsecurity/nss" +.ENDIF +.ENDIF + +CDEFS += -DXMLSEC_CRYPTO_MSCRYPTO -DXMLSEC_NO_XSLT + +# --- Files -------------------------------------------------------- +INCLOCAL = \ + .. + +SLOFILES = \ + $(SLO)$/securityenvironment_mscryptimpl.obj \ + $(SLO)$/xmlencryption_mscryptimpl.obj \ + $(SLO)$/xmlsecuritycontext_mscryptimpl.obj \ + $(SLO)$/xmlsignature_mscryptimpl.obj \ + $(SLO)$/x509certificate_mscryptimpl.obj \ + $(SLO)$/seinitializer_mscryptimpl.obj \ + $(SLO)$/xsec_mscrypt.obj + +.ENDIF + +# --- Targets ------------------------------------------------------ + +.INCLUDE : target.mk + diff --git a/xmlsecurity/source/xmlsec/mscrypt/oid.hxx b/xmlsecurity/source/xmlsec/mscrypt/oid.hxx new file mode 100644 index 000000000000..05447254175c --- /dev/null +++ b/xmlsecurity/source/xmlsec/mscrypt/oid.hxx @@ -0,0 +1,158 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _OID_HXX_ +#define _OID_HXX_ + +typedef struct OIDItemStr OIDItem; + +struct OIDItemStr { + char *oid; + char *desc; +}; + +OIDItem OIDs[] = { + {"1.2.840.113549", "RSA Data Security Inc."}, + {"1.2.840.113549.1", "PKCS"}, + {"1.2.840.113549.2", "RSA digest algorithm"}, + {"1.2.840.113549.3", "RSA cipher algorithm"}, + {"1.2.840.113549.1.1", "PKCS #1"}, + {"1.2.840.113549.1.2", "Unknown"}, + {"1.2.840.113549.1.3", "Unknown"}, + {"1.2.840.113549.1.4", "Unknown"}, + {"1.2.840.113549.1.5", "PKCS #5"}, + {"1.2.840.113549.1.6", "Unknown"}, + {"1.2.840.113549.1.7", "PKCS #7"}, + {"1.2.840.113549.1.8", "Unknown"}, + {"1.2.840.113549.1.9", "PKCS #9"}, + {"1.2.840.113549.1.10", "Unknown"}, + {"1.2.840.113549.1.12", "PKCS #12"}, + {"1.2.840.113549.1.1.2", "PKCS #1 MD2 With RSA Encryption"}, + {"1.2.840.113549.1.1.3", "PKCS #1 MD4 With RSA Encryption"}, + {"1.2.840.113549.1.1.4", "PKCS #1 MD5 With RSA Encryption"}, + {"1.2.840.113549.1.1.1", "PKCS #1 RSA Encryption"}, + {"1.2.840.113549.1.1.2", "PKCS #1 MD2 With RSA Encryption"}, + {"1.2.840.113549.1.1.3", "PKCS #1 MD4 With RSA Encryption"}, + {"1.2.840.113549.1.1.4", "PKCS #1 MD5 With RSA Encryption"}, + {"1.2.840.113549.1.1.5", "PKCS #1 SHA-1 With RSA Encryption"}, + {"1.2.840.113549.1.1.5", "PKCS #1 SHA-1 With RSA Encryption"}, + {"1.2.840.113549.1.3.1", "Unknown"}, + {"1.2.840.113549.1.7.1", "PKCS #7 Data"}, + {"1.2.840.113549.1.7.2", "PKCS #7 Signed Data"}, + {"1.2.840.113549.1.7.3", "PKCS #7 Enveloped Data"}, + {"1.2.840.113549.1.7.4", "PKCS #7 Signed and Enveloped Data"}, + {"1.2.840.113549.1.7.5", "PKCS #7 Digested Data"}, + {"1.2.840.113549.1.7.5", "PKCS #7 Digested Data"}, + {"1.2.840.113549.1.7.6", "PKCS #7 Encrypted Data"}, + {"1.2.840.113549.1.9.1", "PKCS #9 Email Address"}, + {"1.2.840.113549.1.9.2", "PKCS #9 Unstructured Name"}, + {"1.2.840.113549.1.9.3", "PKCS #9 Content Type"}, + {"1.2.840.113549.1.9.4", "PKCS #9 Message Digest"}, + {"1.2.840.113549.1.9.5", "PKCS #9 Signing Time"}, + {"1.2.840.113549.1.9.6", "PKCS #9 Counter Signature"}, + {"1.2.840.113549.1.9.7", "PKCS #9 Challenge Password"}, + {"1.2.840.113549.1.9.8", "PKCS #9 Unstructured Address"}, + {"1.2.840.113549.1.9.9", "PKCS #9 Extended Certificate Attributes"}, + {"1.2.840.113549.1.9.15", "PKCS #9 S/MIME Capabilities"}, + {"1.2.840.113549.1.9.15.1", "Unknown"}, + {"1.2.840.113549.3.2", "RC2-CBC"}, + {"1.2.840.113549.3.4", "RC4"}, + {"1.2.840.113549.3.7", "DES-EDE3-CBC"}, + {"1.2.840.113549.3.9", "RC5-CBCPad"}, + {"1.2.840.10046", "ANSI X9.42"}, + {"1.2.840.10046.2.1", "Diffie-Hellman Public Key Algorithm"}, + {"1.2.840.10040", "ANSI X9.57"}, + {"1.2.840.10040.4.1", "ANSI X9.57 DSA Signature"}, + {"1.2.840.10040.4.3", "ANSI X9.57 Algorithm DSA Signature with SHA-1 Digest"}, + {"2.5", "Directory"}, + {"2.5.8", "X.500-defined algorithms"}, + {"2.5.8.1", "X.500-defined encryption algorithms"}, + {"2.5.8.2", "Unknown"}, + {"2.5.8.3", "Unknown"}, + {"2.5.8.1.1", "RSA Encryption Algorithm"}, + {"1.3.14", "Open Systems Implementors Workshop"}, + {"1.3.14.3.2", "OIW SECSIG Algorithm"}, + {"1.3.14.3.2.2", "Unknown"}, + {"1.3.14.3.2.3", "Unknown"}, + {"1.3.14.3.2.4", "Unknown"}, + {"1.3.14.3.2.6", "DES-ECB"}, + {"1.3.14.3.2.7", "DES-CBC"}, + {"1.3.14.3.2.8", "DES-OFB"}, + {"1.3.14.3.2.9", "DES-CFB"}, + {"1.3.14.3.2.10", "DES-MAC"}, + {"1.3.14.3.2.11", "Unknown"}, + {"1.3.14.3.2.12", "Unknown"}, + {"1.3.14.3.2.13", "Unknown"}, + {"1.3.14.3.2.14", "Unknown"}, + {"1.3.14.3.2.15", "ISO SHA with RSA Signature"}, + {"1.3.14.3.2.16", "Unknown"}, + {"1.3.14.3.2.17", "DES-EDE"}, + {"1.3.14.3.2.18", "Unknown"}, + {"1.3.14.3.2.19", "Unknown"}, + {"1.3.14.3.2.20", "Unknown"}, + {"1.3.14.3.2.21", "Unknown"}, + {"1.3.14.3.2.22", "Unknown"}, + {"1.3.14.3.2.23", "Unknown"}, + {"1.3.14.3.2.24", "Unknown"}, + {"1.3.14.3.2.25", "Unknown"}, + {"1.3.14.3.2.26", "SHA-1"}, + {"1.3.14.3.2.27", "Forgezza DSA Signature with SHA-1 Digest"}, + {"1.3.14.3.2.28", "Unknown"}, + {"1.3.14.3.2.29", "Unknown"}, + {"1.3.14.7.2", "Unknown"}, + {"1.3.14.7.2.1", "Unknown"}, + {"1.3.14.7.2.2", "Unknown"}, + {"1.3.14.7.2.3", "Unknown"}, + {"1.3.14.7.2.2.1", "Unknown"}, + {"1.3.14.7.2.3.1", "Unknown"}, + {"2.16.840.1.101.2.1", "US DOD Infosec"}, + {"2.16.840.1.101.2.1.1.1", "Unknown"}, + {"2.16.840.1.101.2.1.1.2", "MISSI DSS Algorithm (Old)"}, + {"2.16.840.1.101.2.1.1.3", "Unknown"}, + {"2.16.840.1.101.2.1.1.4", "Skipjack CBC64"}, + {"2.16.840.1.101.2.1.1.5", "Unknown"}, + {"2.16.840.1.101.2.1.1.6", "Unknown"}, + {"2.16.840.1.101.2.1.1.7", "Unknown"}, + {"2.16.840.1.101.2.1.1.8", "Unknown"}, + {"2.16.840.1.101.2.1.1.9", "Unknown"}, + {"2.16.840.1.101.2.1.1.10", "MISSI KEA Algorithm"}, + {"2.16.840.1.101.2.1.1.11", "Unknown"}, + {"2.16.840.1.101.2.1.1.12", "MISSI KEA and DSS Algorithm (Old)"}, + {"2.16.840.1.101.2.1.1.13", "Unknown"}, + {"2.16.840.1.101.2.1.1.14", "Unknown"}, + {"2.16.840.1.101.2.1.1.15", "Unknown"}, + {"2.16.840.1.101.2.1.1.16", "Unknown"}, + {"2.16.840.1.101.2.1.1.17", "Unknown"}, + {"2.16.840.1.101.2.1.1.18", "Unknown"}, + {"2.16.840.1.101.2.1.1.19", "MISSI DSS Algorithm"}, + {"2.16.840.1.101.2.1.1.20", "MISSI KEA and DSS Algorithm"}, + {"2.16.840.1.101.2.1.1.21", "Unknown"} +}; + +int nOID = 115; + +#endif diff --git a/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx b/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx new file mode 100644 index 000000000000..d4bc76e627b5 --- /dev/null +++ b/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx @@ -0,0 +1,1312 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_xmlsecurity.hxx" + +#ifdef _MSC_VER +#pragma warning(push,1) +#endif +#include "Windows.h" +#include "WinCrypt.h" +#ifdef _MSC_VER +#pragma warning(pop) +#endif +#include <sal/config.h> +#include <osl/thread.h> +#include "securityenvironment_mscryptimpl.hxx" + +#ifndef _X509CERTIFICATE_NSSIMPL_HXX_ +#include "x509certificate_mscryptimpl.hxx" +#endif +#include <rtl/uuid.h> + +#include <xmlsec/xmlsec.h> +#include <xmlsec/keysmngr.h> +#include <xmlsec/crypto.h> +#include <xmlsec/base64.h> + +#include <xmlsecurity/biginteger.hxx> + +#include "xmlsec/keysmngr.h" +#include "xmlsec/mscrypto/akmngr.h" + +//CP : added by CP +#include <rtl/locale.h> +#include <osl/nlsupport.h> +#include <osl/process.h> + +//CP : end +#include <rtl/memory.h> + +#include "../diagnose.hxx" + +using namespace xmlsecurity; +using namespace ::com::sun::star::uno ; +using namespace ::com::sun::star::lang ; +using ::com::sun::star::lang::XMultiServiceFactory ; +using ::com::sun::star::lang::XSingleServiceFactory ; +using ::rtl::OUString ; + +using ::com::sun::star::xml::crypto::XSecurityEnvironment ; +using ::com::sun::star::security::XCertificate ; +namespace css = ::com::sun::star; + +extern X509Certificate_MSCryptImpl* MswcryCertContextToXCert( PCCERT_CONTEXT cert ) ; + +struct CertErrorToString{ + DWORD error; + char * name; +}; + +CertErrorToString arErrStrings[] = +{ + { 0x00000000, "CERT_TRUST_NO_ERROR"}, + { 0x00000001, "CERT_TRUST_IS_NOT_TIME_VALID"}, + { 0x00000002, "CERT_TRUST_IS_NOT_TIME_NESTED"}, + { 0x00000004, "CERT_TRUST_IS_REVOKED" }, + { 0x00000008, "CERT_TRUST_IS_NOT_SIGNATURE_VALID" }, + { 0x00000010, "CERT_TRUST_IS_NOT_SIGNATURE_VALID"}, + { 0x00000020, "CERT_TRUST_IS_UNTRUSTED_ROOT"}, + { 0x00000040, "CERT_TRUST_REVOCATION_STATUS_UNKNOWN"}, + { 0x00000080, "CERT_TRUST_IS_CYCLIC"}, + { 0x00000100, "CERT_TRUST_INVALID_EXTENSION"}, + { 0x00000200, "CERT_TRUST_INVALID_POLICY_CONSTRAINTS"}, + { 0x00000400, "CERT_TRUST_INVALID_BASIC_CONSTRAINTS"}, + { 0x00000800, "CERT_TRUST_INVALID_NAME_CONSTRAINTS"}, + { 0x00001000, "CERT_TRUST_HAS_NOT_SUPPORTED_NAME_CONSTRAINT"}, + { 0x00002000, "CERT_TRUST_HAS_NOT_DEFINED_NAME_CONSTRAINT"}, + { 0x00004000, "CERT_TRUST_HAS_NOT_PERMITTED_NAME_CONSTRAINT"}, + { 0x00008000, "CERT_TRUST_HAS_EXCLUDED_NAME_CONSTRAINT"}, + { 0x01000000, "CERT_TRUST_IS_OFFLINE_REVOCATION"}, + { 0x02000000, "CERT_TRUST_NO_ISSUANCE_CHAIN_POLICY"}, + { 0x04000000, "CERT_TRUST_IS_EXPLICIT_DISTRUST"}, + { 0x08000000, "CERT_TRUST_HAS_NOT_SUPPORTED_CRITICAL_EXT"}, + //Chain errors + { 0x00010000, "CERT_TRUST_IS_PARTIAL_CHAIN"}, + { 0x00020000, "CERT_TRUST_CTL_IS_NOT_TIME_VALID"}, + { 0x00040000, "CERT_TRUST_CTL_IS_NOT_SIGNATURE_VALID"}, + { 0x00080000, "CERT_TRUST_CTL_IS_NOT_VALID_FOR_USAGE"} +}; + +void traceTrustStatus(DWORD err) +{ + int numErrors = sizeof(arErrStrings) / sizeof(CertErrorToString); + xmlsec_trace("The certificate error status is: "); + if (err == 0) + xmlsec_trace("%s", arErrStrings[0].name); + for (int i = 1; i < numErrors; i++) + { + if (arErrStrings[i].error & err) + xmlsec_trace("%s", arErrStrings[i].name); + } +} + +SecurityEnvironment_MSCryptImpl :: SecurityEnvironment_MSCryptImpl( const Reference< XMultiServiceFactory >& aFactory ) : m_hProv( NULL ) , m_pszContainer( NULL ) , m_hKeyStore( NULL ), m_hCertStore( NULL ), m_tSymKeyList() , m_tPubKeyList() , m_tPriKeyList(), m_xServiceManager( aFactory ), m_bEnableDefault( sal_False ) { + +} + +SecurityEnvironment_MSCryptImpl :: ~SecurityEnvironment_MSCryptImpl() { + + if( m_hProv != NULL ) { + CryptReleaseContext( m_hProv, 0 ) ; + m_hProv = NULL ; + } + + if( m_pszContainer != NULL ) { + //TODO: Don't know whether or not it should be released now. + m_pszContainer = NULL ; + } + + if( m_hCertStore != NULL ) { + CertCloseStore( m_hCertStore, CERT_CLOSE_STORE_FORCE_FLAG ) ; + m_hCertStore = NULL ; + } + + if( m_hKeyStore != NULL ) { + CertCloseStore( m_hKeyStore, CERT_CLOSE_STORE_FORCE_FLAG ) ; + m_hKeyStore = NULL ; + } + + if( !m_tSymKeyList.empty() ) { + std::list< HCRYPTKEY >::iterator symKeyIt ; + + for( symKeyIt = m_tSymKeyList.begin() ; symKeyIt != m_tSymKeyList.end() ; symKeyIt ++ ) + CryptDestroyKey( *symKeyIt ) ; + } + + if( !m_tPubKeyList.empty() ) { + std::list< HCRYPTKEY >::iterator pubKeyIt ; + + for( pubKeyIt = m_tPubKeyList.begin() ; pubKeyIt != m_tPubKeyList.end() ; pubKeyIt ++ ) + CryptDestroyKey( *pubKeyIt ) ; + } + + if( !m_tPriKeyList.empty() ) { + std::list< HCRYPTKEY >::iterator priKeyIt ; + + for( priKeyIt = m_tPriKeyList.begin() ; priKeyIt != m_tPriKeyList.end() ; priKeyIt ++ ) + CryptDestroyKey( *priKeyIt ) ; + } + +} + +/* XInitialization */ +void SAL_CALL SecurityEnvironment_MSCryptImpl :: initialize( const Sequence< Any >& /*aArguments*/ ) throw( Exception, RuntimeException ) { + //TODO +} ; + +/* XServiceInfo */ +OUString SAL_CALL SecurityEnvironment_MSCryptImpl :: getImplementationName() throw( RuntimeException ) { + return impl_getImplementationName() ; +} + +/* XServiceInfo */ +sal_Bool SAL_CALL SecurityEnvironment_MSCryptImpl :: supportsService( const OUString& serviceName) throw( RuntimeException ) { + Sequence< OUString > seqServiceNames = getSupportedServiceNames() ; + const OUString* pArray = seqServiceNames.getConstArray() ; + for( sal_Int32 i = 0 ; i < seqServiceNames.getLength() ; i ++ ) { + if( *( pArray + i ) == serviceName ) + return sal_True ; + } + return sal_False ; +} + +/* XServiceInfo */ +Sequence< OUString > SAL_CALL SecurityEnvironment_MSCryptImpl :: getSupportedServiceNames() throw( RuntimeException ) { + return impl_getSupportedServiceNames() ; +} + +//Helper for XServiceInfo +Sequence< OUString > SecurityEnvironment_MSCryptImpl :: impl_getSupportedServiceNames() { + ::osl::Guard< ::osl::Mutex > aGuard( ::osl::Mutex::getGlobalMutex() ) ; + Sequence< OUString > seqServiceNames( 1 ) ; + seqServiceNames.getArray()[0] = OUString::createFromAscii( "com.sun.star.xml.crypto.SecurityEnvironment" ) ; + return seqServiceNames ; +} + +OUString SecurityEnvironment_MSCryptImpl :: impl_getImplementationName() throw( RuntimeException ) { + return OUString::createFromAscii( "com.sun.star.xml.security.bridge.xmlsec.SecurityEnvironment_MSCryptImpl" ) ; +} + +//Helper for registry +Reference< XInterface > SAL_CALL SecurityEnvironment_MSCryptImpl :: impl_createInstance( const Reference< XMultiServiceFactory >& aServiceManager ) throw( RuntimeException ) { + return Reference< XInterface >( *new SecurityEnvironment_MSCryptImpl( aServiceManager ) ) ; +} + +Reference< XSingleServiceFactory > SecurityEnvironment_MSCryptImpl :: impl_createFactory( const Reference< XMultiServiceFactory >& aServiceManager ) { + return ::cppu::createSingleFactory( aServiceManager , impl_getImplementationName() , impl_createInstance , impl_getSupportedServiceNames() ) ; +} + +/* XUnoTunnel */ +sal_Int64 SAL_CALL SecurityEnvironment_MSCryptImpl :: getSomething( const Sequence< sal_Int8 >& aIdentifier ) + throw( RuntimeException ) +{ + if( aIdentifier.getLength() == 16 && 0 == rtl_compareMemory( getUnoTunnelId().getConstArray(), aIdentifier.getConstArray(), 16 ) ) { + return ( sal_Int64 )this ; + } + return 0 ; +} + +/* XUnoTunnel extension */ +const Sequence< sal_Int8>& SecurityEnvironment_MSCryptImpl :: getUnoTunnelId() { + static Sequence< sal_Int8 >* pSeq = 0 ; + if( !pSeq ) { + ::osl::Guard< ::osl::Mutex > aGuard( ::osl::Mutex::getGlobalMutex() ) ; + if( !pSeq ) { + static Sequence< sal_Int8> aSeq( 16 ) ; + rtl_createUuid( ( sal_uInt8* )aSeq.getArray() , 0 , sal_True ) ; + pSeq = &aSeq ; + } + } + return *pSeq ; +} + +/* XUnoTunnel extension */ +SecurityEnvironment_MSCryptImpl* SecurityEnvironment_MSCryptImpl :: getImplementation( const Reference< XInterface > xObj ) { + Reference< XUnoTunnel > xUT( xObj , UNO_QUERY ) ; + if( xUT.is() ) { + return ( SecurityEnvironment_MSCryptImpl* )xUT->getSomething( getUnoTunnelId() ) ; + } else + return NULL ; +} + +/* Native methods */ +HCRYPTPROV SecurityEnvironment_MSCryptImpl :: getCryptoProvider() throw( ::com::sun::star::uno::Exception , ::com::sun::star::uno::RuntimeException ) { + return m_hProv ; +} + +void SecurityEnvironment_MSCryptImpl :: setCryptoProvider( HCRYPTPROV aProv ) throw( ::com::sun::star::uno::Exception , ::com::sun::star::uno::RuntimeException ) { + if( m_hProv != NULL ) { + CryptReleaseContext( m_hProv, 0 ) ; + m_hProv = NULL ; + } + + if( aProv != NULL ) { + /*- Replaced by direct adopt for WINNT support ---- + if( !CryptContextAddRef( aProv, NULL, NULL ) ) + throw Exception() ; + else + m_hProv = aProv ; + ----*/ + m_hProv = aProv ; + } +} + +LPCTSTR SecurityEnvironment_MSCryptImpl :: getKeyContainer() throw( ::com::sun::star::uno::Exception , ::com::sun::star::uno::RuntimeException ) { + return m_pszContainer ; +} + +void SecurityEnvironment_MSCryptImpl :: setKeyContainer( LPCTSTR aKeyContainer ) throw( ::com::sun::star::uno::Exception , ::com::sun::star::uno::RuntimeException ) { + //TODO: Don't know whether or not it should be copied. + m_pszContainer = aKeyContainer ; +} + + +HCERTSTORE SecurityEnvironment_MSCryptImpl :: getCryptoSlot() throw( Exception , RuntimeException ) { + return m_hKeyStore ; +} + +void SecurityEnvironment_MSCryptImpl :: setCryptoSlot( HCERTSTORE aSlot) throw( Exception , RuntimeException ) { + if( m_hKeyStore != NULL ) { + CertCloseStore( m_hKeyStore, CERT_CLOSE_STORE_FORCE_FLAG ) ; + m_hKeyStore = NULL ; + } + + if( aSlot != NULL ) { + m_hKeyStore = CertDuplicateStore( aSlot ) ; + } +} + +HCERTSTORE SecurityEnvironment_MSCryptImpl :: getCertDb() throw( Exception , RuntimeException ) { + return m_hCertStore ; +} + +void SecurityEnvironment_MSCryptImpl :: setCertDb( HCERTSTORE aCertDb ) throw( Exception , RuntimeException ) { + if( m_hCertStore != NULL ) { + CertCloseStore( m_hCertStore, CERT_CLOSE_STORE_FORCE_FLAG ) ; + m_hCertStore = NULL ; + } + + if( aCertDb != NULL ) { + m_hCertStore = CertDuplicateStore( aCertDb ) ; + } +} + +void SecurityEnvironment_MSCryptImpl :: adoptSymKey( HCRYPTKEY aSymKey ) throw( Exception , RuntimeException ) { + HCRYPTKEY symkey ; + std::list< HCRYPTKEY >::iterator keyIt ; + + if( aSymKey != NULL ) { + //First try to find the key in the list + for( keyIt = m_tSymKeyList.begin() ; keyIt != m_tSymKeyList.end() ; keyIt ++ ) { + if( *keyIt == aSymKey ) + return ; + } + + //If we do not find the key in the list, add a new node + /*- Replaced with directly adopt for WINNT 4.0 support ---- + if( !CryptDuplicateKey( aSymKey, NULL, 0, &symkey ) ) + throw RuntimeException() ; + ----*/ + symkey = aSymKey ; + + try { + m_tSymKeyList.push_back( symkey ) ; + } catch ( Exception& ) { + CryptDestroyKey( symkey ) ; + } + } +} + +void SecurityEnvironment_MSCryptImpl :: rejectSymKey( HCRYPTKEY aSymKey ) throw( Exception , RuntimeException ) { + HCRYPTKEY symkey ; + std::list< HCRYPTKEY >::iterator keyIt ; + + if( aSymKey != NULL ) { + for( keyIt = m_tSymKeyList.begin() ; keyIt != m_tSymKeyList.end() ; keyIt ++ ) { + if( *keyIt == aSymKey ) { + symkey = *keyIt ; + CryptDestroyKey( symkey ) ; + m_tSymKeyList.erase( keyIt ) ; + break ; + } + } + } +} + +HCRYPTKEY SecurityEnvironment_MSCryptImpl :: getSymKey( unsigned int position ) throw( Exception , RuntimeException ) { + HCRYPTKEY symkey ; + std::list< HCRYPTKEY >::iterator keyIt ; + unsigned int pos ; + + symkey = NULL ; + for( pos = 0, keyIt = m_tSymKeyList.begin() ; pos < position && keyIt != m_tSymKeyList.end() ; pos ++ , keyIt ++ ) ; + + if( pos == position && keyIt != m_tSymKeyList.end() ) + symkey = *keyIt ; + + return symkey ; +} + +void SecurityEnvironment_MSCryptImpl :: adoptPubKey( HCRYPTKEY aPubKey ) throw( Exception , RuntimeException ) { + HCRYPTKEY pubkey ; + std::list< HCRYPTKEY >::iterator keyIt ; + + if( aPubKey != NULL ) { + //First try to find the key in the list + for( keyIt = m_tPubKeyList.begin() ; keyIt != m_tPubKeyList.end() ; keyIt ++ ) { + if( *keyIt == aPubKey ) + return ; + } + + //If we do not find the key in the list, add a new node + /*- Replaced with directly adopt for WINNT 4.0 support ---- + if( !CryptDuplicateKey( aPubKey, NULL, 0, &pubkey ) ) + throw RuntimeException() ; + ----*/ + pubkey = aPubKey ; + + try { + m_tPubKeyList.push_back( pubkey ) ; + } catch ( Exception& ) { + CryptDestroyKey( pubkey ) ; + } + } +} + +void SecurityEnvironment_MSCryptImpl :: rejectPubKey( HCRYPTKEY aPubKey ) throw( Exception , RuntimeException ) { + HCRYPTKEY pubkey ; + std::list< HCRYPTKEY >::iterator keyIt ; + + if( aPubKey != NULL ) { + for( keyIt = m_tPubKeyList.begin() ; keyIt != m_tPubKeyList.end() ; keyIt ++ ) { + if( *keyIt == aPubKey ) { + pubkey = *keyIt ; + CryptDestroyKey( pubkey ) ; + m_tPubKeyList.erase( keyIt ) ; + break ; + } + } + } +} + +HCRYPTKEY SecurityEnvironment_MSCryptImpl :: getPubKey( unsigned int position ) throw( Exception , RuntimeException ) { + HCRYPTKEY pubkey ; + std::list< HCRYPTKEY >::iterator keyIt ; + unsigned int pos ; + + pubkey = NULL ; + for( pos = 0, keyIt = m_tPubKeyList.begin() ; pos < position && keyIt != m_tPubKeyList.end() ; pos ++ , keyIt ++ ) ; + + if( pos == position && keyIt != m_tPubKeyList.end() ) + pubkey = *keyIt ; + + return pubkey ; +} + +void SecurityEnvironment_MSCryptImpl :: adoptPriKey( HCRYPTKEY aPriKey ) throw( Exception , RuntimeException ) { + HCRYPTKEY prikey ; + std::list< HCRYPTKEY >::iterator keyIt ; + + if( aPriKey != NULL ) { + //First try to find the key in the list + for( keyIt = m_tPriKeyList.begin() ; keyIt != m_tPriKeyList.end() ; keyIt ++ ) { + if( *keyIt == aPriKey ) + return ; + } + + //If we do not find the key in the list, add a new node + /*- Replaced with directly adopt for WINNT 4.0 support ---- + if( !CryptDuplicateKey( aPriKey, NULL, 0, &prikey ) ) + throw RuntimeException() ; + ----*/ + prikey = aPriKey ; + + try { + m_tPriKeyList.push_back( prikey ) ; + } catch ( Exception& ) { + CryptDestroyKey( prikey ) ; + } + } +} + +void SecurityEnvironment_MSCryptImpl :: rejectPriKey( HCRYPTKEY aPriKey ) throw( Exception , RuntimeException ) { + HCRYPTKEY prikey ; + std::list< HCRYPTKEY >::iterator keyIt ; + + if( aPriKey != NULL ) { + for( keyIt = m_tPriKeyList.begin() ; keyIt != m_tPriKeyList.end() ; keyIt ++ ) { + if( *keyIt == aPriKey ) { + prikey = *keyIt ; + CryptDestroyKey( prikey ) ; + m_tPriKeyList.erase( keyIt ) ; + break ; + } + } + } +} + +HCRYPTKEY SecurityEnvironment_MSCryptImpl :: getPriKey( unsigned int position ) throw( Exception , RuntimeException ) { + HCRYPTKEY prikey ; + std::list< HCRYPTKEY >::iterator keyIt ; + unsigned int pos ; + + prikey = NULL ; + for( pos = 0, keyIt = m_tPriKeyList.begin() ; pos < position && keyIt != m_tPriKeyList.end() ; pos ++ , keyIt ++ ) ; + + if( pos == position && keyIt != m_tPriKeyList.end() ) + prikey = *keyIt ; + + return prikey ; +} + +//Methods from XSecurityEnvironment +Sequence< Reference < XCertificate > > SecurityEnvironment_MSCryptImpl :: getPersonalCertificates() throw( SecurityException , RuntimeException ) +{ + sal_Int32 length ; + X509Certificate_MSCryptImpl* xcert ; + std::list< X509Certificate_MSCryptImpl* > certsList ; + PCCERT_CONTEXT pCertContext = NULL; + + //firstly, we try to find private keys in given key store. + if( m_hKeyStore != NULL ) { + pCertContext = CertEnumCertificatesInStore( m_hKeyStore, pCertContext ); + while (pCertContext) + { + xcert = MswcryCertContextToXCert( pCertContext ) ; + if( xcert != NULL ) + certsList.push_back( xcert ) ; + pCertContext = CertEnumCertificatesInStore( m_hKeyStore, pCertContext ); + } + } + + //secondly, we try to find certificate from registered private keys. + if( !m_tPriKeyList.empty() ) { + //TODO: Don't know whether or not it is necessary ans possible. + } + + //Thirdly, we try to find certificate from system default key store. + if( m_bEnableDefault ) { + HCERTSTORE hSystemKeyStore ; + DWORD dwKeySpec; + HCRYPTPROV hCryptProv; + + /* + hSystemKeyStore = CertOpenStore( + CERT_STORE_PROV_SYSTEM , + 0 , + NULL , + CERT_SYSTEM_STORE_CURRENT_USER | CERT_STORE_READONLY_FLAG | CERT_STORE_OPEN_EXISTING_FLAG , + L"MY" + ) ; + */ + hSystemKeyStore = CertOpenSystemStore( 0, "MY" ) ; + if( hSystemKeyStore != NULL ) { + pCertContext = CertEnumCertificatesInStore( hSystemKeyStore, pCertContext ); + while (pCertContext) + { + // Add By CP for checking whether the certificate is a personal certificate or not. + if(!(CryptAcquireCertificatePrivateKey(pCertContext, + CRYPT_ACQUIRE_COMPARE_KEY_FLAG, + NULL, + &hCryptProv, + &dwKeySpec, + NULL))) + { + // Not Privatekey found. SKIP this one; By CP + pCertContext = CertEnumCertificatesInStore( hSystemKeyStore, pCertContext ); + continue; + } + // then TODO : Check the personal cert is valid or not. + + // end CP + xcert = MswcryCertContextToXCert( pCertContext ) ; + if( xcert != NULL ) + certsList.push_back( xcert ) ; + pCertContext = CertEnumCertificatesInStore( hSystemKeyStore, pCertContext ); + } + } + + CertCloseStore( hSystemKeyStore, CERT_CLOSE_STORE_CHECK_FLAG ) ; + } + + length = certsList.size() ; + if( length != 0 ) { + int i ; + std::list< X509Certificate_MSCryptImpl* >::iterator xcertIt ; + Sequence< Reference< XCertificate > > certSeq( length ) ; + + for( i = 0, xcertIt = certsList.begin(); xcertIt != certsList.end(); xcertIt ++, i++ ) { + certSeq[i] = *xcertIt ; + } + + return certSeq ; + } + + return Sequence< Reference< XCertificate > >() ; +} + + +Reference< XCertificate > SecurityEnvironment_MSCryptImpl :: getCertificate( const OUString& issuerName, const Sequence< sal_Int8 >& serialNumber ) throw( SecurityException , RuntimeException ) { + unsigned int i ; +// sal_Int8 found = 0 ; + LPSTR pszName ; + X509Certificate_MSCryptImpl *xcert = NULL ; + PCCERT_CONTEXT pCertContext = NULL ; + HCERTSTORE hCertStore = NULL ; + CRYPT_INTEGER_BLOB cryptSerialNumber ; + CERT_INFO certInfo ; + + // By CP , for correct encoding + sal_uInt16 encoding ; + rtl_Locale *pLocale = NULL ; + osl_getProcessLocale( &pLocale ) ; + encoding = osl_getTextEncodingFromLocale( pLocale ) ; + // CP end + + //Create cert info from issue and serial + rtl::OString oissuer = rtl::OUStringToOString( issuerName , encoding ) ; + pszName = ( char* )oissuer.getStr() ; + + if( ! ( CertStrToName( + X509_ASN_ENCODING | PKCS_7_ASN_ENCODING , + pszName , + CERT_X500_NAME_STR | CERT_NAME_STR_REVERSE_FLAG | CERT_NAME_STR_ENABLE_UTF8_UNICODE_FLAG, + NULL , + NULL , + &certInfo.Issuer.cbData, NULL ) ) + ) { + return NULL ; + } + + certInfo.Issuer.pbData = ( BYTE* )malloc( certInfo.Issuer.cbData ); + if(!certInfo.Issuer.pbData) + throw RuntimeException() ; + + if( ! ( CertStrToName( + X509_ASN_ENCODING | PKCS_7_ASN_ENCODING , + pszName , + CERT_X500_NAME_STR | CERT_NAME_STR_REVERSE_FLAG | CERT_NAME_STR_ENABLE_UTF8_UNICODE_FLAG, + NULL , + ( BYTE* )certInfo.Issuer.pbData , + &certInfo.Issuer.cbData, NULL ) ) + ) { + free( certInfo.Issuer.pbData ) ; + return NULL ; + } + + //Get the SerialNumber + cryptSerialNumber.cbData = serialNumber.getLength() ; + cryptSerialNumber.pbData = ( BYTE* )malloc( cryptSerialNumber.cbData); + if (!cryptSerialNumber.pbData) + { + free( certInfo.Issuer.pbData ) ; + throw RuntimeException() ; + } + for( i = 0; i < cryptSerialNumber.cbData; i ++ ) + cryptSerialNumber.pbData[i] = serialNumber[ cryptSerialNumber.cbData - i - 1 ] ; + + certInfo.SerialNumber.cbData = cryptSerialNumber.cbData ; + certInfo.SerialNumber.pbData = cryptSerialNumber.pbData ; + + // Get the Cert from all store. + for( i = 0 ; i < 6 ; i ++ ) + { + switch(i) + { + case 0: + if(m_hKeyStore == NULL) continue ; + hCertStore = m_hKeyStore ; + break; + case 1: + if(m_hCertStore == NULL) continue ; + hCertStore = m_hCertStore ; + break; + case 2: + hCertStore = CertOpenSystemStore( 0, "MY" ) ; + if(hCertStore == NULL || !m_bEnableDefault) continue ; + break; + case 3: + hCertStore = CertOpenSystemStore( 0, "Root" ) ; + if(hCertStore == NULL || !m_bEnableDefault) continue ; + break; + case 4: + hCertStore = CertOpenSystemStore( 0, "Trust" ) ; + if(hCertStore == NULL || !m_bEnableDefault) continue ; + break; + case 5: + hCertStore = CertOpenSystemStore( 0, "CA" ) ; + if(hCertStore == NULL || !m_bEnableDefault) continue ; + break; + default: + i=6; + continue; + } + +/******************************************************************************* + * This code reserved for remind us there are another way to find one cert by + * IssuerName&serialnumber. You can use the code to replaced the function + * CertFindCertificateInStore IF and ONLY IF you must find one special cert in + * certStore but can not be found by CertFindCertificateInStore , then , you + * should also change the same part in libxmlsec/.../src/mscrypto/x509vfy.c#875. + * By Chandler Peng(chandler.peng@sun.com) + *****/ +/******************************************************************************* + pCertContext = NULL ; + found = 0; + do{ + // 1. enum the certs has same string in the issuer string. + pCertContext = CertEnumCertificatesInStore( hCertStore , pCertContext ) ; + if( pCertContext != NULL ) + { + // 2. check the cert's issuer name . + char* issuer = NULL ; + DWORD cbIssuer = 0 ; + + cbIssuer = CertNameToStr( + X509_ASN_ENCODING | PKCS_7_ASN_ENCODING , + &( pCertContext->pCertInfo->Issuer ), + CERT_X500_NAME_STR | CERT_NAME_STR_REVERSE_FLAG , + NULL, 0 + ) ; + + if( cbIssuer == 0 ) continue ; // discard this cert; + + issuer = (char *)malloc( cbIssuer ) ; + if( issuer == NULL ) // discard this cert; + { + free( cryptSerialNumber.pbData) ; + free( certInfo.Issuer.pbData ) ; + CertFreeCertificateContext( pCertContext ) ; + if(i != 0 && i != 1) CertCloseStore( hCertStore, CERT_CLOSE_STORE_CHECK_FLAG ) ; + throw RuntimeException() ; + } + + cbIssuer = CertNameToStr( + X509_ASN_ENCODING | PKCS_7_ASN_ENCODING , + &( pCertContext->pCertInfo->Issuer ), + CERT_X500_NAME_STR | CERT_NAME_STR_REVERSE_FLAG , + issuer, cbIssuer + ) ; + + if( cbIssuer <= 0 ) + { + free( issuer ) ; + continue ;// discard this cert; + } + + if(strncmp(pszName , issuer , cbIssuer) != 0) + { + free( issuer ) ; + continue ;// discard this cert; + } + free( issuer ) ; + + // 3. check the serial number. + if( memcmp( cryptSerialNumber.pbData , pCertContext->pCertInfo->SerialNumber.pbData , cryptSerialNumber.cbData ) != 0 ) + { + continue ;// discard this cert; + } + + // 4. confirm and break; + found = 1; + break ; + } + + }while(pCertContext); + + if(i != 0 && i != 1) CertCloseStore( hCertStore, CERT_CLOSE_STORE_CHECK_FLAG ) ; + if( found != 0 ) break; // Found the certificate. +********************************************************************************/ + + pCertContext = CertFindCertificateInStore( + hCertStore, + X509_ASN_ENCODING | PKCS_7_ASN_ENCODING, + 0, + CERT_FIND_SUBJECT_CERT, + &certInfo, + NULL + ) ; + + if(i != 0 && i != 1) CertCloseStore( hCertStore, CERT_CLOSE_STORE_CHECK_FLAG ) ; + if( pCertContext != NULL ) break ; // Found the certificate. + + } + + if( cryptSerialNumber.pbData ) free( cryptSerialNumber.pbData ) ; + if( certInfo.Issuer.pbData ) free( certInfo.Issuer.pbData ) ; + + if( pCertContext != NULL ) { + xcert = MswcryCertContextToXCert( pCertContext ) ; + if( pCertContext ) CertFreeCertificateContext( pCertContext ) ; + } else { + xcert = NULL ; + } + + return xcert ; +} + +Reference< XCertificate > SecurityEnvironment_MSCryptImpl :: getCertificate( const OUString& issuerName, const OUString& serialNumber ) throw( SecurityException , RuntimeException ) { + Sequence< sal_Int8 > serial = numericStringToBigInteger( serialNumber ) ; + return getCertificate( issuerName, serial ) ; +} + +Sequence< Reference < XCertificate > > SecurityEnvironment_MSCryptImpl :: buildCertificatePath( const Reference< XCertificate >& begin ) throw( SecurityException , RuntimeException ) { + PCCERT_CHAIN_CONTEXT pChainContext ; + PCCERT_CONTEXT pCertContext ; + const X509Certificate_MSCryptImpl* xcert ; + + CERT_ENHKEY_USAGE enhKeyUsage ; + CERT_USAGE_MATCH certUsage ; + CERT_CHAIN_PARA chainPara ; + + enhKeyUsage.cUsageIdentifier = 0 ; + enhKeyUsage.rgpszUsageIdentifier = NULL ; + certUsage.dwType = USAGE_MATCH_TYPE_AND ; + certUsage.Usage = enhKeyUsage ; + chainPara.cbSize = sizeof( CERT_CHAIN_PARA ) ; + chainPara.RequestedUsage = certUsage ; + + Reference< XUnoTunnel > xCertTunnel( begin, UNO_QUERY ) ; + if( !xCertTunnel.is() ) { + throw RuntimeException() ; + } + + xcert = ( X509Certificate_MSCryptImpl* )xCertTunnel->getSomething( X509Certificate_MSCryptImpl::getUnoTunnelId() ) ; + if( xcert == NULL ) { + throw RuntimeException() ; + } + + pCertContext = xcert->getMswcryCert() ; + + pChainContext = NULL ; + + BOOL bChain = FALSE; + if( pCertContext != NULL ) + { + HCERTSTORE hAdditionalStore = NULL; + HCERTSTORE hCollectionStore = NULL; + if (m_hCertStore && m_hKeyStore) + { + //Merge m_hCertStore and m_hKeyStore into one store. + hCollectionStore = CertOpenStore( + CERT_STORE_PROV_COLLECTION , + 0 , + NULL , + 0 , + NULL + ) ; + if (hCollectionStore != NULL) + { + CertAddStoreToCollection ( + hCollectionStore , + m_hCertStore , + CERT_PHYSICAL_STORE_ADD_ENABLE_FLAG , + 0) ; + CertAddStoreToCollection ( + hCollectionStore , + m_hCertStore , + CERT_PHYSICAL_STORE_ADD_ENABLE_FLAG , + 0) ; + hAdditionalStore = hCollectionStore; + } + + } + + //if the merge of both stores failed then we add only m_hCertStore + if (hAdditionalStore == NULL && m_hCertStore) + hAdditionalStore = m_hCertStore; + else if (hAdditionalStore == NULL && m_hKeyStore) + hAdditionalStore = m_hKeyStore; + else + hAdditionalStore = NULL; + + //CertGetCertificateChain searches by default in MY, CA, ROOT and TRUST + bChain = CertGetCertificateChain( + NULL , + pCertContext , + NULL , //use current system time + hAdditionalStore, + &chainPara , + CERT_CHAIN_REVOCATION_CHECK_CHAIN | CERT_CHAIN_TIMESTAMP_TIME , + NULL , + &pChainContext); + if (!bChain) + pChainContext = NULL; + + //Close the additional store + CertCloseStore(hCollectionStore, CERT_CLOSE_STORE_CHECK_FLAG); + } + + if(bChain && pChainContext != NULL && pChainContext->cChain > 0 ) + { + PCCERT_CONTEXT pCertInChain ; + PCERT_SIMPLE_CHAIN pCertChain ; + X509Certificate_MSCryptImpl* pCert ; + + pCertChain = pChainContext->rgpChain[0] ; + if( pCertChain->cElement ) { + Sequence< Reference< XCertificate > > xCertChain( pCertChain->cElement ) ; + + for( unsigned int i = 0 ; i < pCertChain->cElement ; i ++ ) { + if( pCertChain->rgpElement[i] ) + pCertInChain = pCertChain->rgpElement[i]->pCertContext ; + else + pCertInChain = NULL ; + + if( pCertInChain != NULL ) { + pCert = MswcryCertContextToXCert( pCertInChain ) ; + if( pCert != NULL ) + xCertChain[i] = pCert ; + } + } + + CertFreeCertificateChain( pChainContext ) ; + pChainContext = NULL ; + + return xCertChain ; + } + } + if (pChainContext) + CertFreeCertificateChain(pChainContext); + + return Sequence< Reference < XCertificate > >(); +} + +Reference< XCertificate > SecurityEnvironment_MSCryptImpl :: createCertificateFromRaw( const Sequence< sal_Int8 >& rawCertificate ) throw( SecurityException , RuntimeException ) { + X509Certificate_MSCryptImpl* xcert ; + + if( rawCertificate.getLength() > 0 ) { + xcert = new X509Certificate_MSCryptImpl() ; + if( xcert == NULL ) + throw RuntimeException() ; + + xcert->setRawCert( rawCertificate ) ; + } else { + xcert = NULL ; + } + + return xcert ; +} + +Reference< XCertificate > SecurityEnvironment_MSCryptImpl :: createCertificateFromAscii( const OUString& asciiCertificate ) throw( SecurityException , RuntimeException ) { + xmlChar* chCert ; + xmlSecSize certSize ; + + rtl::OString oscert = rtl::OUStringToOString( asciiCertificate , RTL_TEXTENCODING_ASCII_US ) ; + + chCert = xmlStrndup( ( const xmlChar* )oscert.getStr(), ( int )oscert.getLength() ) ; + + certSize = xmlSecBase64Decode( chCert, ( xmlSecByte* )chCert, xmlStrlen( chCert ) ) ; + + Sequence< sal_Int8 > rawCert( certSize ) ; + for( unsigned int i = 0 ; i < certSize ; i ++ ) + rawCert[i] = *( chCert + i ) ; + + xmlFree( chCert ) ; + + return createCertificateFromRaw( rawCert ) ; +} + + +HCERTSTORE getCertStoreForIntermediatCerts( + const Sequence< Reference< ::com::sun::star::security::XCertificate > >& seqCerts) +{ + HCERTSTORE store = NULL; + store = CertOpenStore( + CERT_STORE_PROV_MEMORY, 0, NULL, 0, NULL); + if (store == NULL) + return NULL; + + for (int i = 0; i < seqCerts.getLength(); i++) + { + xmlsec_trace("Added temporary certificate: \n%s", + OUStringToOString(seqCerts[i]->getSubjectName(), + osl_getThreadTextEncoding()).getStr()); + + + Sequence<sal_Int8> data = seqCerts[i]->getEncoded(); + PCCERT_CONTEXT cert = CertCreateCertificateContext( + X509_ASN_ENCODING, ( const BYTE* )&data[0], data.getLength()); + //Adding the certificate creates a copy and not just increases the ref count + //Therefore we free later the certificate that we now add + CertAddCertificateContextToStore(store, cert, CERT_STORE_ADD_ALWAYS, NULL); + CertFreeCertificateContext(cert); + } + return store; +} + +//We return only valid or invalid, as long as the API documentation expresses +//explicitly that all validation steps are carried out even if one or several +//errors occur. See also +//http://wiki.services.openoffice.org/wiki/Certificate_Path_Validation#Validation_status +sal_Int32 SecurityEnvironment_MSCryptImpl :: verifyCertificate( + const Reference< ::com::sun::star::security::XCertificate >& aCert, + const Sequence< Reference< ::com::sun::star::security::XCertificate > >& seqCerts) + throw( ::com::sun::star::uno::SecurityException, ::com::sun::star::uno::RuntimeException ) +{ + sal_Int32 validity = 0; + PCCERT_CHAIN_CONTEXT pChainContext = NULL; + PCCERT_CONTEXT pCertContext = NULL; + const X509Certificate_MSCryptImpl* xcert = NULL; + + Reference< XUnoTunnel > xCertTunnel( aCert, UNO_QUERY ) ; + if( !xCertTunnel.is() ) { + throw RuntimeException() ; + } + + xmlsec_trace("Start verification of certificate: \n %s", + OUStringToOString( + aCert->getSubjectName(), osl_getThreadTextEncoding()).getStr()); + + xcert = ( X509Certificate_MSCryptImpl* )xCertTunnel->getSomething( X509Certificate_MSCryptImpl::getUnoTunnelId() ) ; + if( xcert == NULL ) { + throw RuntimeException() ; + } + + pCertContext = xcert->getMswcryCert() ; + + CERT_ENHKEY_USAGE enhKeyUsage ; + CERT_USAGE_MATCH certUsage ; + CERT_CHAIN_PARA chainPara ; + rtl_zeroMemory(&chainPara, sizeof(CERT_CHAIN_PARA)); + + //Prepare parameter for CertGetCertificateChain + enhKeyUsage.cUsageIdentifier = 0 ; + enhKeyUsage.rgpszUsageIdentifier = NULL ; + certUsage.dwType = USAGE_MATCH_TYPE_AND ; + certUsage.Usage = enhKeyUsage ; + chainPara.cbSize = sizeof( CERT_CHAIN_PARA ) ; + chainPara.RequestedUsage = certUsage ; + + + HCERTSTORE hCollectionStore = NULL; + HCERTSTORE hIntermediateCertsStore = NULL; + BOOL bChain = FALSE; + if( pCertContext != NULL ) + { + hIntermediateCertsStore = + getCertStoreForIntermediatCerts(seqCerts); + + //Merge m_hCertStore and m_hKeyStore and the store of the intermediate + //certificates into one store. + hCollectionStore = CertOpenStore( + CERT_STORE_PROV_COLLECTION , + 0 , + NULL , + 0 , + NULL + ) ; + if (hCollectionStore != NULL) + { + CertAddStoreToCollection ( + hCollectionStore , + m_hCertStore , + CERT_PHYSICAL_STORE_ADD_ENABLE_FLAG , + 0) ; + CertAddStoreToCollection ( + hCollectionStore , + m_hCertStore , + CERT_PHYSICAL_STORE_ADD_ENABLE_FLAG , + 0) ; + CertAddStoreToCollection ( + hCollectionStore, + hIntermediateCertsStore, + CERT_PHYSICAL_STORE_ADD_ENABLE_FLAG, + 0); + + } + + //CertGetCertificateChain searches by default in MY, CA, ROOT and TRUST + //We do not check revocation of the root. In most cases there are none. + //Then we would get CERT_TRUST_REVOCATION_STATUS_UNKNOWN + xmlsec_trace("Verifying cert using revocation information."); + bChain = CertGetCertificateChain( + NULL , + pCertContext , + NULL , //use current system time + hCollectionStore, + &chainPara , + CERT_CHAIN_REVOCATION_CHECK_CHAIN | CERT_CHAIN_REVOCATION_CHECK_CHAIN_EXCLUDE_ROOT, + NULL , + &pChainContext); + + if (bChain && pChainContext->cChain > 0) + { + xmlsec_trace("Overall error status (all chains):"); + traceTrustStatus(pChainContext->TrustStatus.dwErrorStatus); + //highest quality chains come first + PCERT_SIMPLE_CHAIN pSimpleChain = pChainContext->rgpChain[0]; + xmlsec_trace("Error status of first chain: "); + traceTrustStatus(pSimpleChain->TrustStatus.dwErrorStatus); + + //CERT_TRUST_REVOCATION_STATUS_UNKNOWN is also set if a certificate + //has no AIA(OCSP) or CRLDP extension and there is no CRL locally installed. + DWORD revocationFlags = CERT_TRUST_REVOCATION_STATUS_UNKNOWN | + CERT_TRUST_IS_OFFLINE_REVOCATION; + DWORD otherErrorsMask = ~revocationFlags; + if( !(pSimpleChain->TrustStatus.dwErrorStatus & otherErrorsMask)) + + { + //No errors except maybe those caused by missing revocation information + //Check if there are errors + if ( pSimpleChain->TrustStatus.dwErrorStatus & revocationFlags) + { + //No revocation information. Because MSDN documentation is not + //clear about if all other tests are performed if an error occurrs, + //we test again, without requiring revocation checking. + CertFreeCertificateChain(pChainContext); + pChainContext = NULL; + xmlsec_trace("Checking again but without requiring revocation information."); + bChain = CertGetCertificateChain( + NULL , + pCertContext , + NULL , //use current system time + hCollectionStore, + &chainPara , + 0, + NULL , + &pChainContext); + if (bChain + && pChainContext->cChain > 0 + && pChainContext->rgpChain[0]->TrustStatus.dwErrorStatus == CERT_TRUST_NO_ERROR) + { + xmlsec_trace("Certificate is valid.\n"); + validity = ::com::sun::star::security::CertificateValidity::VALID; + } + else + { + xmlsec_trace("Certificate is invalid.\n"); + } + } + else + { + //valid and revocation information available + xmlsec_trace("Certificate is valid.\n"); + validity = ::com::sun::star::security::CertificateValidity::VALID; + } + } + else + { + //invalid + xmlsec_trace("Certificate is invalid.\n"); + validity = ::com::sun::star::security::CertificateValidity::INVALID ; + } + } + else + { + xmlsec_trace("CertGetCertificateChaine failed.\n"); + } + } + + if (pChainContext) + { + CertFreeCertificateChain(pChainContext); + pChainContext = NULL; + } + + //Close the additional store, do not destroy the contained certs + CertCloseStore(hCollectionStore, CERT_CLOSE_STORE_CHECK_FLAG); + //Close the temporary store containing the intermediate certificates and make + //sure all certificates are deleted. + CertCloseStore(hIntermediateCertsStore, CERT_CLOSE_STORE_CHECK_FLAG); + + return validity ; +} + +sal_Int32 SecurityEnvironment_MSCryptImpl :: getCertificateCharacters( const ::com::sun::star::uno::Reference< ::com::sun::star::security::XCertificate >& aCert ) throw( ::com::sun::star::uno::SecurityException, ::com::sun::star::uno::RuntimeException ) { + sal_Int32 characters ; + PCCERT_CONTEXT pCertContext ; + const X509Certificate_MSCryptImpl* xcert ; + + Reference< XUnoTunnel > xCertTunnel( aCert, UNO_QUERY ) ; + if( !xCertTunnel.is() ) { + throw RuntimeException() ; + } + + xcert = ( X509Certificate_MSCryptImpl* )xCertTunnel->getSomething( X509Certificate_MSCryptImpl::getUnoTunnelId() ) ; + if( xcert == NULL ) { + throw RuntimeException() ; + } + + pCertContext = xcert->getMswcryCert() ; + + characters = 0x00000000 ; + + //Firstly, make sentence whether or not the cert is self-signed. + if( CertCompareCertificateName( X509_ASN_ENCODING | PKCS_7_ASN_ENCODING, &(pCertContext->pCertInfo->Subject), &(pCertContext->pCertInfo->Issuer) ) ) { + characters |= ::com::sun::star::security::CertificateCharacters::SELF_SIGNED ; + } else { + characters &= ~ ::com::sun::star::security::CertificateCharacters::SELF_SIGNED ; + } + + //Secondly, make sentence whether or not the cert has a private key. + { + BOOL fCallerFreeProv ; + DWORD dwKeySpec ; + HCRYPTPROV hProv ; + if( CryptAcquireCertificatePrivateKey( pCertContext , + 0 , + NULL , + &( hProv ) , + &( dwKeySpec ) , + &( fCallerFreeProv ) ) + ) { + characters |= ::com::sun::star::security::CertificateCharacters::HAS_PRIVATE_KEY ; + + if( hProv != NULL && fCallerFreeProv ) + CryptReleaseContext( hProv, 0 ) ; + } else { + characters &= ~ ::com::sun::star::security::CertificateCharacters::HAS_PRIVATE_KEY ; + } + } + return characters ; +} + +void SecurityEnvironment_MSCryptImpl :: enableDefaultCrypt( sal_Bool enable ) throw( Exception, RuntimeException ) { + m_bEnableDefault = enable ; +} + +sal_Bool SecurityEnvironment_MSCryptImpl :: defaultEnabled() throw( Exception, RuntimeException ) { + return m_bEnableDefault ; +} + +X509Certificate_MSCryptImpl* MswcryCertContextToXCert( PCCERT_CONTEXT cert ) +{ + X509Certificate_MSCryptImpl* xcert ; + + if( cert != NULL ) { + xcert = new X509Certificate_MSCryptImpl() ; + if( xcert != NULL ) { + xcert->setMswcryCert( cert ) ; + } + } else { + xcert = NULL ; + } + + return xcert ; +} + +::rtl::OUString SecurityEnvironment_MSCryptImpl::getSecurityEnvironmentInformation() throw( ::com::sun::star::uno::RuntimeException ) +{ + return rtl::OUString::createFromAscii("Microsoft Crypto API"); +} + +/* Native methods */ +xmlSecKeysMngrPtr SecurityEnvironment_MSCryptImpl :: createKeysManager() throw( Exception, RuntimeException ) { + + unsigned int i ; + HCRYPTKEY symKey ; + HCRYPTKEY pubKey ; + HCRYPTKEY priKey ; + xmlSecKeysMngrPtr pKeysMngr = NULL ; + + /*- + * The following lines is based on the of xmlsec-mscrypto crypto engine + */ + pKeysMngr = xmlSecMSCryptoAppliedKeysMngrCreate( m_hKeyStore , m_hCertStore ) ; + if( pKeysMngr == NULL ) + throw RuntimeException() ; + + /*- + * Adopt symmetric key into keys manager + */ + for( i = 0 ; ( symKey = getSymKey( i ) ) != NULL ; i ++ ) { + if( xmlSecMSCryptoAppliedKeysMngrSymKeyLoad( pKeysMngr, symKey ) < 0 ) { + throw RuntimeException() ; + } + } + + /*- + * Adopt asymmetric public key into keys manager + */ + for( i = 0 ; ( pubKey = getPubKey( i ) ) != NULL ; i ++ ) { + if( xmlSecMSCryptoAppliedKeysMngrPubKeyLoad( pKeysMngr, pubKey ) < 0 ) { + throw RuntimeException() ; + } + } + + /*- + * Adopt asymmetric private key into keys manager + */ + for( i = 0 ; ( priKey = getPriKey( i ) ) != NULL ; i ++ ) { + if( xmlSecMSCryptoAppliedKeysMngrPriKeyLoad( pKeysMngr, priKey ) < 0 ) { + throw RuntimeException() ; + } + } + + /*- + * Adopt system default certificate store. + */ + if( defaultEnabled() ) { + HCERTSTORE hSystemStore ; + + //Add system key store into the keys manager. + hSystemStore = CertOpenSystemStore( 0, "MY" ) ; + if( hSystemStore != NULL ) { + if( xmlSecMSCryptoAppliedKeysMngrAdoptKeyStore( pKeysMngr, hSystemStore ) < 0 ) { + CertCloseStore( hSystemStore, CERT_CLOSE_STORE_CHECK_FLAG ) ; + throw RuntimeException() ; + } + } + + //Add system root store into the keys manager. + hSystemStore = CertOpenSystemStore( 0, "Root" ) ; + if( hSystemStore != NULL ) { + if( xmlSecMSCryptoAppliedKeysMngrAdoptTrustedStore( pKeysMngr, hSystemStore ) < 0 ) { + CertCloseStore( hSystemStore, CERT_CLOSE_STORE_CHECK_FLAG ) ; + throw RuntimeException() ; + } + } + + //Add system trusted store into the keys manager. + hSystemStore = CertOpenSystemStore( 0, "Trust" ) ; + if( hSystemStore != NULL ) { + if( xmlSecMSCryptoAppliedKeysMngrAdoptUntrustedStore( pKeysMngr, hSystemStore ) < 0 ) { + CertCloseStore( hSystemStore, CERT_CLOSE_STORE_CHECK_FLAG ) ; + throw RuntimeException() ; + } + } + + //Add system CA store into the keys manager. + hSystemStore = CertOpenSystemStore( 0, "CA" ) ; + if( hSystemStore != NULL ) { + if( xmlSecMSCryptoAppliedKeysMngrAdoptUntrustedStore( pKeysMngr, hSystemStore ) < 0 ) { + CertCloseStore( hSystemStore, CERT_CLOSE_STORE_CHECK_FLAG ) ; + throw RuntimeException() ; + } + } + } + + return pKeysMngr ; +} +void SecurityEnvironment_MSCryptImpl :: destroyKeysManager(xmlSecKeysMngrPtr pKeysMngr) throw( Exception, RuntimeException ) { + if( pKeysMngr != NULL ) { + xmlSecKeysMngrDestroy( pKeysMngr ) ; + } +} diff --git a/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.hxx b/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.hxx new file mode 100644 index 000000000000..a97c96b6c3d3 --- /dev/null +++ b/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.hxx @@ -0,0 +1,195 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _XSECURITYENVIRONMENT_MSCRYPTIMPL_HXX_ +#define _XSECURITYENVIRONMENT_MSCRYPTIMPL_HXX_ + +#ifdef _MSC_VER +#pragma warning(push,1) +#endif +#include <windows.h> +#include <wincrypt.h> +#ifdef _MSC_VER +#pragma warning(pop) +#endif +#include <sal/config.h> +#include <rtl/ustring.hxx> +#include <cppuhelper/factory.hxx> +#include <cppuhelper/implbase4.hxx> +#include <com/sun/star/uno/Exception.hpp> + +#ifndef _COM_SUN_STAR_UNO_REFERENCE_HPP_ +#include <com/sun/star/uno/Reference.hxx> +#endif +#include <com/sun/star/lang/XSingleServiceFactory.hpp> + +#ifndef _COM_SUN_STAR_LANG_XSECVICEINFO_HPP_ +#include <com/sun/star/lang/XServiceInfo.hpp> +#endif +#include <com/sun/star/lang/XInitialization.hpp> +#include <com/sun/star/xml/crypto/XSecurityEnvironment.hpp> +#include <com/sun/star/security/XCertificate.hpp> +#include <com/sun/star/security/CertificateCharacters.hpp> +#include <com/sun/star/security/CertificateValidity.hpp> +#include <com/sun/star/lang/XUnoTunnel.hpp> + +#include <list> +#include "xmlsec/xmlsec.h" + +class SecurityEnvironment_MSCryptImpl : public ::cppu::WeakImplHelper4< + ::com::sun::star::xml::crypto::XSecurityEnvironment , + ::com::sun::star::lang::XInitialization , + ::com::sun::star::lang::XServiceInfo , + ::com::sun::star::lang::XUnoTunnel > +{ + private : + //cyrpto provider and key container + HCRYPTPROV m_hProv ; + LPCTSTR m_pszContainer ; + + //Key store + HCERTSTORE m_hKeyStore ; + + //Certiticate store + HCERTSTORE m_hCertStore ; + + //Enable default system cryptography setting + sal_Bool m_bEnableDefault ; + + //External keys + std::list< HCRYPTKEY > m_tSymKeyList ; + std::list< HCRYPTKEY > m_tPubKeyList ; + std::list< HCRYPTKEY > m_tPriKeyList ; + + //Service manager + ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xServiceManager ; + + public : + SecurityEnvironment_MSCryptImpl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& aFactory ) ; + virtual ~SecurityEnvironment_MSCryptImpl() ; + + //Methods from XSecurityEnvironment + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::security::XCertificate > > SAL_CALL getPersonalCertificates() throw( ::com::sun::star::uno::SecurityException , ::com::sun::star::uno::RuntimeException ) ; + + virtual ::com::sun::star::uno::Reference< ::com::sun::star::security::XCertificate > SAL_CALL getCertificate( const ::rtl::OUString& issuerName, const ::com::sun::star::uno::Sequence< sal_Int8 >& serialNumber ) throw( ::com::sun::star::uno::SecurityException , ::com::sun::star::uno::RuntimeException ) ; + + virtual ::com::sun::star::uno::Reference< ::com::sun::star::security::XCertificate > SAL_CALL getCertificate( const ::rtl::OUString& issuerName, const ::rtl::OUString& serialNumber ) throw( ::com::sun::star::uno::SecurityException , ::com::sun::star::uno::RuntimeException ) ; + + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::security::XCertificate > > SAL_CALL buildCertificatePath( const ::com::sun::star::uno::Reference< ::com::sun::star::security::XCertificate >& beginCert ) throw( ::com::sun::star::uno::SecurityException , ::com::sun::star::uno::RuntimeException ) ; + + virtual ::com::sun::star::uno::Reference< ::com::sun::star::security::XCertificate > SAL_CALL createCertificateFromRaw( const ::com::sun::star::uno::Sequence< sal_Int8 >& rawCertificate ) throw( ::com::sun::star::uno::SecurityException , ::com::sun::star::uno::RuntimeException ) ; + + virtual ::com::sun::star::uno::Reference< ::com::sun::star::security::XCertificate > SAL_CALL createCertificateFromAscii( const ::rtl::OUString& asciiCertificate ) throw( ::com::sun::star::uno::SecurityException , ::com::sun::star::uno::RuntimeException ) ; + + virtual ::sal_Int32 SAL_CALL verifyCertificate( + const ::com::sun::star::uno::Reference< ::com::sun::star::security::XCertificate >& xCert, + const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< + ::com::sun::star::security::XCertificate > >& intermediateCertificates) + throw (::com::sun::star::uno::SecurityException, ::com::sun::star::uno::RuntimeException) ; + virtual ::sal_Int32 SAL_CALL getCertificateCharacters( const ::com::sun::star::uno::Reference< ::com::sun::star::security::XCertificate >& xCert ) throw (::com::sun::star::uno::SecurityException, ::com::sun::star::uno::RuntimeException) ; + + virtual ::rtl::OUString SAL_CALL getSecurityEnvironmentInformation( ) throw (::com::sun::star::uno::RuntimeException); + + + //Methods from XInitialization + virtual void SAL_CALL initialize( + const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments + ) throw( ::com::sun::star::uno::Exception , ::com::sun::star::uno::RuntimeException ) ; + + //Methods from XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException ) ; + + virtual sal_Bool SAL_CALL supportsService( + const ::rtl::OUString& ServiceName + ) throw( ::com::sun::star::uno::RuntimeException ) ; + + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException ) ; + + //Helper for XServiceInfo + static ::com::sun::star::uno::Sequence< ::rtl::OUString > impl_getSupportedServiceNames() ; + + static ::rtl::OUString impl_getImplementationName() throw( ::com::sun::star::uno::RuntimeException ) ; + + //Helper for registry + static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL impl_createInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& aServiceManager ) throw( ::com::sun::star::uno::RuntimeException ) ; + + static ::com::sun::star::uno::Reference< ::com::sun::star::lang::XSingleServiceFactory > impl_createFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& aServiceManager ) ; + + //Methods from XUnoTunnel + virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) + throw (::com::sun::star::uno::RuntimeException); + + static const ::com::sun::star::uno::Sequence< sal_Int8 >& getUnoTunnelId() ; + static SecurityEnvironment_MSCryptImpl* getImplementation( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > xObj ) ; + + //Native mehtods + virtual HCRYPTPROV getCryptoProvider() throw( ::com::sun::star::uno::Exception , ::com::sun::star::uno::RuntimeException ) ; + + virtual void setCryptoProvider( HCRYPTPROV aProv ) throw( ::com::sun::star::uno::Exception , ::com::sun::star::uno::RuntimeException ) ; + + virtual LPCTSTR getKeyContainer() throw( ::com::sun::star::uno::Exception , ::com::sun::star::uno::RuntimeException ) ; + + virtual void setKeyContainer( LPCTSTR aKeyContainer ) throw( ::com::sun::star::uno::Exception , ::com::sun::star::uno::RuntimeException ) ; + + virtual HCERTSTORE getCryptoSlot() throw( ::com::sun::star::uno::Exception , ::com::sun::star::uno::RuntimeException ) ; + + virtual void setCryptoSlot( HCERTSTORE aKeyStore ) throw( ::com::sun::star::uno::Exception , ::com::sun::star::uno::RuntimeException ) ; + + virtual HCERTSTORE getCertDb() throw( ::com::sun::star::uno::Exception , ::com::sun::star::uno::RuntimeException ) ; + + virtual void setCertDb( HCERTSTORE aCertDb ) throw( ::com::sun::star::uno::Exception , ::com::sun::star::uno::RuntimeException ) ; + + virtual void adoptSymKey( HCRYPTKEY aSymKey ) throw( ::com::sun::star::uno::Exception , ::com::sun::star::uno::RuntimeException ) ; + + virtual void rejectSymKey( HCRYPTKEY aSymKey ) throw( ::com::sun::star::uno::Exception , ::com::sun::star::uno::RuntimeException ) ; + + virtual HCRYPTKEY getSymKey( unsigned int position ) throw( ::com::sun::star::uno::Exception , ::com::sun::star::uno::RuntimeException ) ; + + virtual void adoptPubKey( HCRYPTKEY aPubKey ) throw( ::com::sun::star::uno::Exception , ::com::sun::star::uno::RuntimeException ) ; + + virtual void rejectPubKey( HCRYPTKEY aPubKey ) throw( ::com::sun::star::uno::Exception , ::com::sun::star::uno::RuntimeException ) ; + + virtual HCRYPTKEY getPubKey( unsigned int position ) throw( ::com::sun::star::uno::Exception , ::com::sun::star::uno::RuntimeException ) ; + + virtual void adoptPriKey( HCRYPTKEY aPriKey ) throw( ::com::sun::star::uno::Exception , ::com::sun::star::uno::RuntimeException ) ; + + virtual void rejectPriKey( HCRYPTKEY aPriKey ) throw( ::com::sun::star::uno::Exception , ::com::sun::star::uno::RuntimeException ) ; + + virtual HCRYPTKEY getPriKey( unsigned int position ) throw( ::com::sun::star::uno::Exception , ::com::sun::star::uno::RuntimeException ) ; + + virtual void enableDefaultCrypt( sal_Bool enable ) throw( ::com::sun::star::uno::Exception , ::com::sun::star::uno::RuntimeException ) ; + + virtual sal_Bool defaultEnabled() throw( ::com::sun::star::uno::Exception , ::com::sun::star::uno::RuntimeException ) ; + + //Native mehtods + virtual xmlSecKeysMngrPtr createKeysManager() throw( ::com::sun::star::uno::Exception , ::com::sun::star::uno::RuntimeException ) ; + + virtual void destroyKeysManager(xmlSecKeysMngrPtr pKeysMngr) throw( ::com::sun::star::uno::Exception , ::com::sun::star::uno::RuntimeException ) ; +} ; + +#endif // _XSECURITYENVIRONMENT_MSCRYPTIMPL_HXX_ + diff --git a/xmlsecurity/source/xmlsec/mscrypt/seinitializer_mscryptimpl.cxx b/xmlsecurity/source/xmlsec/mscrypt/seinitializer_mscryptimpl.cxx new file mode 100644 index 000000000000..43c0bc53cb22 --- /dev/null +++ b/xmlsecurity/source/xmlsec/mscrypt/seinitializer_mscryptimpl.cxx @@ -0,0 +1,238 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_xmlsecurity.hxx" + +#include "seinitializer_mscryptimpl.hxx" + +#include "securityenvironment_mscryptimpl.hxx" + +#include "xmlsec/strings.h" +#include "xmlsec/mscrypto/app.h" + +namespace cssu = com::sun::star::uno; +namespace cssl = com::sun::star::lang; +namespace cssxc = com::sun::star::xml::crypto; + +#define SERVICE_NAME "com.sun.star.xml.crypto.SEInitializer" +#define IMPLEMENTATION_NAME "com.sun.star.xml.security.bridge.xmlsec.SEInitializer_MSCryptImpl" +#define SECURITY_ENVIRONMENT "com.sun.star.xml.crypto.SecurityEnvironment" +#define SECURITY_CONTEXT "com.sun.star.xml.crypto.XMLSecurityContext" + +SEInitializer_MSCryptImpl::SEInitializer_MSCryptImpl( + const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > &rxMSF) + :mxMSF( rxMSF ) +{ +} + +SEInitializer_MSCryptImpl::~SEInitializer_MSCryptImpl() +{ +} + +/* XSEInitializer */ +cssu::Reference< cssxc::XXMLSecurityContext > SAL_CALL + SEInitializer_MSCryptImpl::createSecurityContext( + const rtl::OUString& sCertDB ) + throw (cssu::RuntimeException) +{ + const char* n_pCertStore ; + HCERTSTORE n_hStoreHandle ; + + //Initialize the crypto engine + if( sCertDB.getLength() > 0 ) + { + rtl::OString sCertDir(sCertDB, sCertDB.getLength(), RTL_TEXTENCODING_ASCII_US); + n_pCertStore = sCertDir.getStr(); + n_hStoreHandle = CertOpenSystemStore( NULL, n_pCertStore ) ; + if( n_hStoreHandle == NULL ) + { + return NULL; + } + } + else + { + n_pCertStore = NULL ; + n_hStoreHandle = NULL ; + } + + xmlSecMSCryptoAppInit( n_pCertStore ) ; + + try { + /* Build Security Environment */ + const rtl::OUString sSecyrutyEnvironment ( RTL_CONSTASCII_USTRINGPARAM( SECURITY_ENVIRONMENT ) ); + cssu::Reference< cssxc::XSecurityEnvironment > xSecEnv( mxMSF->createInstance ( sSecyrutyEnvironment ), cssu::UNO_QUERY ); + if( !xSecEnv.is() ) + { + if( n_hStoreHandle != NULL ) + { + CertCloseStore( n_hStoreHandle, CERT_CLOSE_STORE_FORCE_FLAG ) ; + } + + xmlSecMSCryptoAppShutdown() ; + return NULL; + } + + /* Setup key slot and certDb */ + cssu::Reference< cssl::XUnoTunnel > xEnvTunnel( xSecEnv , cssu::UNO_QUERY ) ; + if( !xEnvTunnel.is() ) + { + if( n_hStoreHandle != NULL ) + { + CertCloseStore( n_hStoreHandle, CERT_CLOSE_STORE_FORCE_FLAG ) ; + } + + xmlSecMSCryptoAppShutdown() ; + return NULL; + } + + SecurityEnvironment_MSCryptImpl* pSecEnv = ( SecurityEnvironment_MSCryptImpl* )xEnvTunnel->getSomething( SecurityEnvironment_MSCryptImpl::getUnoTunnelId() ) ; + if( pSecEnv == NULL ) + { + if( n_hStoreHandle != NULL ) + { + CertCloseStore( n_hStoreHandle, CERT_CLOSE_STORE_FORCE_FLAG ) ; + } + + xmlSecMSCryptoAppShutdown() ; + return NULL; + } + + if( n_hStoreHandle != NULL ) + { + pSecEnv->setCryptoSlot( n_hStoreHandle ) ; + pSecEnv->setCertDb( n_hStoreHandle ) ; + } + else + { + pSecEnv->enableDefaultCrypt( sal_True ) ; + } + + /* Build XML Security Context */ + const rtl::OUString sSecyrutyContext ( RTL_CONSTASCII_USTRINGPARAM( SECURITY_CONTEXT ) ); + cssu::Reference< cssxc::XXMLSecurityContext > xSecCtx( mxMSF->createInstance ( sSecyrutyContext ), cssu::UNO_QUERY ); + if( !xSecCtx.is() ) + { + if( n_hStoreHandle != NULL ) + { + CertCloseStore( n_hStoreHandle, CERT_CLOSE_STORE_FORCE_FLAG ) ; + } + + xmlSecMSCryptoAppShutdown() ; + return NULL; + } + + xSecCtx->setDefaultSecurityEnvironmentIndex(xSecCtx->addSecurityEnvironment( xSecEnv )) ; + return xSecCtx; + } + catch( cssu::Exception& ) + { + if( n_hStoreHandle != NULL ) + { + CertCloseStore( n_hStoreHandle, CERT_CLOSE_STORE_FORCE_FLAG ) ; + } + + xmlSecMSCryptoAppShutdown() ; + return NULL; + } +} + +void SAL_CALL SEInitializer_MSCryptImpl::freeSecurityContext( const cssu::Reference< cssxc::XXMLSecurityContext >&) + throw (cssu::RuntimeException) +{ + /* + cssu::Reference< cssxc::XSecurityEnvironment > xSecEnv + = securityContext->getSecurityEnvironment(); + + if( xSecEnv.is() ) + { + cssu::Reference< cssl::XUnoTunnel > xEnvTunnel( xSecEnv , cssu::UNO_QUERY ) ; + if( xEnvTunnel.is() ) + { + SecurityEnvironment_MSCryptImpl* pSecEnv = ( SecurityEnvironment_MSCryptImpl* )xEnvTunnel->getSomething( SecurityEnvironment_MSCryptImpl::getUnoTunnelId() ) ; + HCERTSTORE n_hStoreHandle = pSecEnv->getCryptoSlot(); + + if( n_hStoreHandle != NULL ) + { + CertCloseStore( n_hStoreHandle, CERT_CLOSE_STORE_FORCE_FLAG ) ; + pSecEnv->setCryptoSlot( NULL ) ; + pSecEnv->setCertDb( NULL ) ; + } + + xmlSecMSCryptoAppShutdown() ; + } + } + */ + + xmlSecMSCryptoAppShutdown() ; +} + +rtl::OUString SEInitializer_MSCryptImpl_getImplementationName () + throw (cssu::RuntimeException) +{ + return rtl::OUString ( RTL_CONSTASCII_USTRINGPARAM ( IMPLEMENTATION_NAME ) ); +} + +sal_Bool SAL_CALL SEInitializer_MSCryptImpl_supportsService( const rtl::OUString& ServiceName ) + throw (cssu::RuntimeException) +{ + return ServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( SERVICE_NAME )); +} + +cssu::Sequence< rtl::OUString > SAL_CALL SEInitializer_MSCryptImpl_getSupportedServiceNames( ) + throw (cssu::RuntimeException) +{ + cssu::Sequence < rtl::OUString > aRet(1); + rtl::OUString* pArray = aRet.getArray(); + pArray[0] = rtl::OUString ( RTL_CONSTASCII_USTRINGPARAM ( SERVICE_NAME ) ); + return aRet; +} +#undef SERVICE_NAME + +cssu::Reference< cssu::XInterface > SAL_CALL SEInitializer_MSCryptImpl_createInstance( const cssu::Reference< cssl::XMultiServiceFactory > & rSMgr) + throw( cssu::Exception ) +{ + return (cppu::OWeakObject*) new SEInitializer_MSCryptImpl(rSMgr); +} + +/* XServiceInfo */ +rtl::OUString SAL_CALL SEInitializer_MSCryptImpl::getImplementationName( ) + throw (cssu::RuntimeException) +{ + return SEInitializer_MSCryptImpl_getImplementationName(); +} +sal_Bool SAL_CALL SEInitializer_MSCryptImpl::supportsService( const rtl::OUString& rServiceName ) + throw (cssu::RuntimeException) +{ + return SEInitializer_MSCryptImpl_supportsService( rServiceName ); +} +cssu::Sequence< rtl::OUString > SAL_CALL SEInitializer_MSCryptImpl::getSupportedServiceNames( ) + throw (cssu::RuntimeException) +{ + return SEInitializer_MSCryptImpl_getSupportedServiceNames(); +} + diff --git a/xmlsecurity/source/xmlsec/mscrypt/seinitializer_mscryptimpl.hxx b/xmlsecurity/source/xmlsec/mscrypt/seinitializer_mscryptimpl.hxx new file mode 100644 index 000000000000..8acd41dfa539 --- /dev/null +++ b/xmlsecurity/source/xmlsec/mscrypt/seinitializer_mscryptimpl.hxx @@ -0,0 +1,108 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SEINITIALIZERIMPL_HXX +#define _SEINITIALIZERIMPL_HXX + +#include <com/sun/star/xml/crypto/XXMLSecurityContext.hpp> +#ifndef _COM_SUN_STAR_XML_CRYPTO_SEINITIALIZER_HPP_ +#include <com/sun/star/xml/crypto/XSEInitializer.hpp> +#endif +#include <com/sun/star/lang/XUnoTunnel.hpp> +#include <com/sun/star/lang/XServiceInfo.hpp> +#include <com/sun/star/lang/XMultiServiceFactory.hpp> +#include <cppuhelper/implbase2.hxx> + +#include <libxml/tree.h> + +class SEInitializer_MSCryptImpl : public cppu::WeakImplHelper2 +< + com::sun::star::xml::crypto::XSEInitializer, + com::sun::star::lang::XServiceInfo +> +/****** SEInitializer_MSCryptImpl.hxx/CLASS SEInitializer_MSCryptImpl *********** + * + * NAME + * SEInitializer_MSCryptImpl -- Class to initialize a Security Context + * instance + * + * FUNCTION + * Use this class to initialize a XmlSec based Security Context + * instance. After this instance is used up, use this class to free this + * instance. + * + * HISTORY + * 05.01.2004 - Interface supported: XSEInitializer, XSEInitializer + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ +private: + com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > mxMSF; + +public: + SEInitializer_MSCryptImpl(const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > &rxMSF); + virtual ~SEInitializer_MSCryptImpl(); + + /* XSEInitializer */ + virtual com::sun::star::uno::Reference< + com::sun::star::xml::crypto::XXMLSecurityContext > + SAL_CALL createSecurityContext( const rtl::OUString& certDB ) + throw (com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL freeSecurityContext( const com::sun::star::uno::Reference< + com::sun::star::xml::crypto::XXMLSecurityContext >& securityContext ) + throw (com::sun::star::uno::RuntimeException); + + /* XServiceInfo */ + virtual rtl::OUString SAL_CALL getImplementationName( ) + throw (com::sun::star::uno::RuntimeException); + + virtual sal_Bool SAL_CALL supportsService( const rtl::OUString& ServiceName ) + throw (com::sun::star::uno::RuntimeException); + + virtual com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames( ) + throw (com::sun::star::uno::RuntimeException); +}; + +rtl::OUString SEInitializer_MSCryptImpl_getImplementationName() + throw ( com::sun::star::uno::RuntimeException ); + +sal_Bool SAL_CALL SEInitializer_MSCryptImpl_supportsService( const rtl::OUString& ServiceName ) + throw ( com::sun::star::uno::RuntimeException ); + +com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL SEInitializer_MSCryptImpl_getSupportedServiceNames( ) + throw ( com::sun::star::uno::RuntimeException ); + +com::sun::star::uno::Reference< com::sun::star::uno::XInterface > +SAL_CALL SEInitializer_MSCryptImpl_createInstance( const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > & rSMgr) + throw ( com::sun::star::uno::Exception ); + +#endif + diff --git a/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx b/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx new file mode 100644 index 000000000000..e4a89201f081 --- /dev/null +++ b/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx @@ -0,0 +1,659 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_xmlsecurity.hxx" +#include <sal/config.h> +#include <rtl/uuid.h> +#include "x509certificate_mscryptimpl.hxx" +#include "certificateextension_xmlsecimpl.hxx" + +//MM : added by MM +#include "oid.hxx" +//MM : end + +//CP : added by CP +#include <rtl/locale.h> +#include <osl/nlsupport.h> +#include <osl/process.h> +#include <utility> + +//CP : end + +using namespace ::com::sun::star::uno ; +using namespace ::com::sun::star::security ; +using ::rtl::OUString ; + +using ::com::sun::star::security::XCertificate ; +using ::com::sun::star::util::DateTime ; + +#define OUSTR(x) ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(x) ) + +/*Resturns the index withing rRawString where sTypeName starts and where it ends. + The starting index is pair.first. The ending index in pair.second points + one char after the last character of the type. + sTypeName can be + "S" or "CN" (without ""). Do not use spaces at the beginning of the type name. + If the type name is not found then pair.first and pair.second are -1. +*/ +std::pair< sal_Int32, sal_Int32 > +findTypeInDN(const OUString& rRawString, const OUString& sTypeName) +{ + std::pair< sal_Int32, sal_Int32 > retVal; + bool bInEscape = false; + bool bInValue = false; + bool bFound = false; + sal_Int32 nTypeNameStart = 0; + sal_Int32 length = rRawString.getLength(); + + for (sal_Int32 i = 0; i < length; i++) + { + sal_Unicode c = rRawString[i]; + + if (c == '=') + { + if (! bInValue) + { + OUString sType = rRawString.copy(nTypeNameStart, i - nTypeNameStart); + sType = sType.trim(); + if (sType.equalsIgnoreAsciiCase(sTypeName)) + { + bFound = true; + break; + } + } + } + else if (c == '"') + { + if (!bInEscape) + { + //If this is the quote is the first of the couple which enclose the + //whole value, because the value contains special characters + //then we just drop it. That is, this character must be followed by + //a character which is not '"'. + if ( i + 1 < length && rRawString[i+1] == '"') + bInEscape = true; + else + bInValue = !bInValue; //value is enclosed in " " + } + else + { + //This quote is escaped by a preceding quote and therefore is + //part of the value + bInEscape = false; + } + } + else if (c == ',' || c == '+') + { + //The comma separate the attribute value pairs. + //If the comma is not part of a value (the value would then be enclosed in '"'), + //then we have reached the end of the value + if (!bInValue) + { + //The next char is the start of the new type + nTypeNameStart = i + 1; + } + } + } + + //Found the Type Name, but there can still be spaces after the last comma + //and the beginning of the type. + if (bFound) + { + while (true) + { + sal_Unicode c = rRawString[nTypeNameStart]; + if (c != ' ' && c != '\t') + //found + break; + nTypeNameStart ++; + } + // search end (one after last letter) + sal_Int32 nTypeNameEnd = nTypeNameStart; + nTypeNameEnd++; + while (true) + { + sal_Unicode c = rRawString[nTypeNameEnd]; + if (c == ' ' || c == '\t' || c == '=') + break; + nTypeNameEnd++; + } + retVal = std::make_pair(nTypeNameStart, nTypeNameEnd); + } + else + { + retVal = std::make_pair(-1, -1); + } + return retVal; +} + + +/* + MS Crypto uses the 'S' tag (equal to the 'ST' tag in NSS), but the NSS can't recognise + it, so the 'S' tag should be changed to 'ST' tag. However I am not sure if this is necessary + anymore, because we provide always the signers certificate when signing. So libmlsec can find + the private key based on the provided certificate (X509Certificate element) and does not need + the issuer name (X509IssuerName element). The issuer name in the xml signature has also no + effect for the signature nor the certificate validation. + In many RFCs, for example 4519, on speaks of 'ST'. However, the certificate does not contain + strings for type names. Instead it uses OIDs. + */ + +OUString replaceTagSWithTagST(OUString oldDN) +{ + std::pair<sal_Int32, sal_Int32 > pairIndex = findTypeInDN(oldDN, OUSTR("S")); + + if (pairIndex.first != -1) + { + OUString newDN = oldDN.copy(0, pairIndex.first); + newDN += OUSTR("ST"); + newDN += oldDN.copy(pairIndex.second); + return newDN; + } + return oldDN; +} +/* end */ + +X509Certificate_MSCryptImpl :: X509Certificate_MSCryptImpl() : + m_pCertContext( NULL ) +{ +} + +X509Certificate_MSCryptImpl :: ~X509Certificate_MSCryptImpl() { + if( m_pCertContext != NULL ) { + CertFreeCertificateContext( m_pCertContext ) ; + } +} + +//Methods from XCertificate +sal_Int16 SAL_CALL X509Certificate_MSCryptImpl :: getVersion() throw ( ::com::sun::star::uno::RuntimeException) { + if( m_pCertContext != NULL && m_pCertContext->pCertInfo != NULL ) { + return ( char )m_pCertContext->pCertInfo->dwVersion ; + } else { + return -1 ; + } +} + +::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL X509Certificate_MSCryptImpl :: getSerialNumber() throw ( ::com::sun::star::uno::RuntimeException) { + if( m_pCertContext != NULL && m_pCertContext->pCertInfo != NULL ) { + Sequence< sal_Int8 > serial( m_pCertContext->pCertInfo->SerialNumber.cbData ) ; + for( unsigned int i = 0 ; i < m_pCertContext->pCertInfo->SerialNumber.cbData ; i ++ ) + serial[i] = *( m_pCertContext->pCertInfo->SerialNumber.pbData + m_pCertContext->pCertInfo->SerialNumber.cbData - i - 1 ) ; + + return serial ; + } else { + return Sequence< sal_Int8 >(); + } +} + +::rtl::OUString SAL_CALL X509Certificate_MSCryptImpl :: getIssuerName() throw ( ::com::sun::star::uno::RuntimeException) { + if( m_pCertContext != NULL && m_pCertContext->pCertInfo != NULL ) { + char* issuer ; + DWORD cbIssuer ; + + cbIssuer = CertNameToStr( + X509_ASN_ENCODING | PKCS_7_ASN_ENCODING , + &( m_pCertContext->pCertInfo->Issuer ), + CERT_X500_NAME_STR | CERT_NAME_STR_REVERSE_FLAG , + NULL, 0 + ) ; + + // Here the cbIssuer count the last 0x00 , take care. + if( cbIssuer != 0 ) { + issuer = new char[ cbIssuer ] ; + if( issuer == NULL ) + throw RuntimeException() ; + + cbIssuer = CertNameToStr( + X509_ASN_ENCODING | PKCS_7_ASN_ENCODING , + &( m_pCertContext->pCertInfo->Issuer ), + CERT_X500_NAME_STR | CERT_NAME_STR_REVERSE_FLAG , + issuer, cbIssuer + ) ; + + if( cbIssuer <= 0 ) { + delete [] issuer ; + throw RuntimeException() ; + } + + // By CP , for correct encoding + sal_uInt16 encoding ; + rtl_Locale *pLocale = NULL ; + osl_getProcessLocale( &pLocale ) ; + encoding = osl_getTextEncodingFromLocale( pLocale ) ; + // CP end + + if(issuer[cbIssuer-1] == 0) cbIssuer--; //delimit the last 0x00; + OUString xIssuer(issuer , cbIssuer ,encoding ) ; //By CP + delete [] issuer ; + + return replaceTagSWithTagST(xIssuer); + } else { + return OUString() ; + } + } else { + return OUString() ; + } +} + +::rtl::OUString SAL_CALL X509Certificate_MSCryptImpl :: getSubjectName() throw ( ::com::sun::star::uno::RuntimeException) +{ + if( m_pCertContext != NULL && m_pCertContext->pCertInfo != NULL ) + { + wchar_t* subject ; + DWORD cbSubject ; + + cbSubject = CertNameToStrW( + X509_ASN_ENCODING | PKCS_7_ASN_ENCODING , + &( m_pCertContext->pCertInfo->Subject ), + CERT_X500_NAME_STR | CERT_NAME_STR_REVERSE_FLAG , + NULL, 0 + ) ; + + if( cbSubject != 0 ) + { + subject = new wchar_t[ cbSubject ] ; + if( subject == NULL ) + throw RuntimeException() ; + + cbSubject = CertNameToStrW( + X509_ASN_ENCODING | PKCS_7_ASN_ENCODING , + &( m_pCertContext->pCertInfo->Subject ), + CERT_X500_NAME_STR | CERT_NAME_STR_REVERSE_FLAG , + subject, cbSubject + ) ; + + if( cbSubject <= 0 ) { + delete [] subject ; + throw RuntimeException() ; + } + + OUString xSubject(reinterpret_cast<const sal_Unicode*>(subject)); + delete [] subject ; + + return replaceTagSWithTagST(xSubject); + } else + { + return OUString() ; + } + } + else + { + return OUString() ; + } +} + +::com::sun::star::util::DateTime SAL_CALL X509Certificate_MSCryptImpl :: getNotValidBefore() throw ( ::com::sun::star::uno::RuntimeException ) { + if( m_pCertContext != NULL && m_pCertContext->pCertInfo != NULL ) { + SYSTEMTIME explTime ; + DateTime dateTime ; + FILETIME localFileTime; + + if (FileTimeToLocalFileTime(&( m_pCertContext->pCertInfo->NotBefore ), &localFileTime)) + { + if( FileTimeToSystemTime( &localFileTime, &explTime ) ) { + //Convert the time to readable local time + dateTime.HundredthSeconds = explTime.wMilliseconds / 100 ; + dateTime.Seconds = explTime.wSecond ; + dateTime.Minutes = explTime.wMinute ; + dateTime.Hours = explTime.wHour ; + dateTime.Day = explTime.wDay ; + dateTime.Month = explTime.wMonth ; + dateTime.Year = explTime.wYear ; + } + } + + return dateTime ; + } else { + return DateTime() ; + } +} + +::com::sun::star::util::DateTime SAL_CALL X509Certificate_MSCryptImpl :: getNotValidAfter() throw ( ::com::sun::star::uno::RuntimeException) { + if( m_pCertContext != NULL && m_pCertContext->pCertInfo != NULL ) { + SYSTEMTIME explTime ; + DateTime dateTime ; + FILETIME localFileTime; + + if (FileTimeToLocalFileTime(&( m_pCertContext->pCertInfo->NotAfter ), &localFileTime)) + { + if( FileTimeToSystemTime( &localFileTime, &explTime ) ) { + //Convert the time to readable local time + dateTime.HundredthSeconds = explTime.wMilliseconds / 100 ; + dateTime.Seconds = explTime.wSecond ; + dateTime.Minutes = explTime.wMinute ; + dateTime.Hours = explTime.wHour ; + dateTime.Day = explTime.wDay ; + dateTime.Month = explTime.wMonth ; + dateTime.Year = explTime.wYear ; + } + } + + return dateTime ; + } else { + return DateTime() ; + } +} + +::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL X509Certificate_MSCryptImpl :: getIssuerUniqueID() throw ( ::com::sun::star::uno::RuntimeException) { + if( m_pCertContext != NULL && m_pCertContext->pCertInfo != NULL ) { + Sequence< sal_Int8 > issuerUid( m_pCertContext->pCertInfo->IssuerUniqueId.cbData ) ; + for( unsigned int i = 0 ; i < m_pCertContext->pCertInfo->IssuerUniqueId.cbData; i ++ ) + issuerUid[i] = *( m_pCertContext->pCertInfo->IssuerUniqueId.pbData + i ) ; + + return issuerUid ; + } else { + return Sequence< sal_Int8 >(); + } +} + +::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL X509Certificate_MSCryptImpl :: getSubjectUniqueID() throw ( ::com::sun::star::uno::RuntimeException ) { + if( m_pCertContext != NULL && m_pCertContext->pCertInfo != NULL ) { + Sequence< sal_Int8 > subjectUid( m_pCertContext->pCertInfo->SubjectUniqueId.cbData ) ; + for( unsigned int i = 0 ; i < m_pCertContext->pCertInfo->SubjectUniqueId.cbData; i ++ ) + subjectUid[i] = *( m_pCertContext->pCertInfo->SubjectUniqueId.pbData + i ) ; + + return subjectUid ; + } else { + return Sequence< sal_Int8 >(); + } +} + +::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::security::XCertificateExtension > > SAL_CALL X509Certificate_MSCryptImpl :: getExtensions() throw ( ::com::sun::star::uno::RuntimeException ) { + if( m_pCertContext != NULL && m_pCertContext->pCertInfo != NULL && m_pCertContext->pCertInfo->cExtension != 0 ) { + CertificateExtension_XmlSecImpl* xExtn ; + CERT_EXTENSION* pExtn ; + Sequence< Reference< XCertificateExtension > > xExtns( m_pCertContext->pCertInfo->cExtension ) ; + + for( unsigned int i = 0; i < m_pCertContext->pCertInfo->cExtension; i++ ) { + pExtn = &(m_pCertContext->pCertInfo->rgExtension[i]) ; + + xExtn = new CertificateExtension_XmlSecImpl() ; + if( xExtn == NULL ) + throw RuntimeException() ; + + xExtn->setCertExtn( pExtn->Value.pbData, pExtn->Value.cbData, ( unsigned char* )pExtn->pszObjId, strlen( pExtn->pszObjId ), sal::static_int_cast<sal_Bool>(pExtn->fCritical) ) ; + + xExtns[i] = xExtn ; + } + + return xExtns ; + } else { + return Sequence< Reference< XCertificateExtension > >(); + } +} + +::com::sun::star::uno::Reference< ::com::sun::star::security::XCertificateExtension > SAL_CALL X509Certificate_MSCryptImpl :: findCertificateExtension( const ::com::sun::star::uno::Sequence< sal_Int8 >& /*oid*/ ) throw (::com::sun::star::uno::RuntimeException) { + if( m_pCertContext != NULL && m_pCertContext->pCertInfo != NULL && m_pCertContext->pCertInfo->cExtension != 0 ) { + CertificateExtension_XmlSecImpl* xExtn ; + CERT_EXTENSION* pExtn ; + Sequence< Reference< XCertificateExtension > > xExtns( m_pCertContext->pCertInfo->cExtension ) ; + + xExtn = NULL ; + for( unsigned int i = 0; i < m_pCertContext->pCertInfo->cExtension; i++ ) { + pExtn = &( m_pCertContext->pCertInfo->rgExtension[i] ) ; + + //TODO: Compare the oid + if( 0 ) { + xExtn = new CertificateExtension_XmlSecImpl() ; + if( xExtn == NULL ) + throw RuntimeException() ; + + xExtn->setCertExtn( pExtn->Value.pbData, pExtn->Value.cbData, ( unsigned char* )pExtn->pszObjId, strlen( pExtn->pszObjId ), sal::static_int_cast<sal_Bool>(pExtn->fCritical) ) ; + } + } + + return xExtn ; + } else { + return NULL ; + } +} + + +::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL X509Certificate_MSCryptImpl :: getEncoded() throw ( ::com::sun::star::uno::RuntimeException) { + if( m_pCertContext != NULL && m_pCertContext->cbCertEncoded > 0 ) { + Sequence< sal_Int8 > rawCert( m_pCertContext->cbCertEncoded ) ; + + for( unsigned int i = 0 ; i < m_pCertContext->cbCertEncoded ; i ++ ) + rawCert[i] = *( m_pCertContext->pbCertEncoded + i ) ; + + return rawCert ; + } else { + return Sequence< sal_Int8 >(); + } +} + +//Helper methods +void X509Certificate_MSCryptImpl :: setMswcryCert( const CERT_CONTEXT* cert ) { + if( m_pCertContext != NULL ) { + CertFreeCertificateContext( m_pCertContext ) ; + m_pCertContext = NULL ; + } + + if( cert != NULL ) { + m_pCertContext = CertDuplicateCertificateContext( cert ) ; + } +} + +const CERT_CONTEXT* X509Certificate_MSCryptImpl :: getMswcryCert() const { + if( m_pCertContext != NULL ) { + return m_pCertContext ; + } else { + return NULL ; + } +} + +void X509Certificate_MSCryptImpl :: setRawCert( Sequence< sal_Int8 > rawCert ) throw ( ::com::sun::star::uno::RuntimeException) { + if( m_pCertContext != NULL ) { + CertFreeCertificateContext( m_pCertContext ) ; + m_pCertContext = NULL ; + } + + if( rawCert.getLength() != 0 ) { + m_pCertContext = CertCreateCertificateContext( X509_ASN_ENCODING, ( const sal_uInt8* )&rawCert[0], rawCert.getLength() ) ; + } +} + +/* XUnoTunnel */ +sal_Int64 SAL_CALL X509Certificate_MSCryptImpl :: getSomething( const Sequence< sal_Int8 >& aIdentifier ) throw( RuntimeException ) { + if( aIdentifier.getLength() == 16 && 0 == rtl_compareMemory( getUnoTunnelId().getConstArray(), aIdentifier.getConstArray(), 16 ) ) { + return ( sal_Int64 )this ; + } + return 0 ; +} + +/* XUnoTunnel extension */ +const Sequence< sal_Int8>& X509Certificate_MSCryptImpl :: getUnoTunnelId() { + static Sequence< sal_Int8 >* pSeq = 0 ; + if( !pSeq ) { + ::osl::Guard< ::osl::Mutex > aGuard( ::osl::Mutex::getGlobalMutex() ) ; + if( !pSeq ) { + static Sequence< sal_Int8> aSeq( 16 ) ; + rtl_createUuid( ( sal_uInt8* )aSeq.getArray() , 0 , sal_True ) ; + pSeq = &aSeq ; + } + } + return *pSeq ; +} + +/* XUnoTunnel extension */ +X509Certificate_MSCryptImpl* X509Certificate_MSCryptImpl :: getImplementation( const Reference< XInterface > xObj ) { + Reference< XUnoTunnel > xUT( xObj , UNO_QUERY ) ; + if( xUT.is() ) { + return ( X509Certificate_MSCryptImpl* )xUT->getSomething( getUnoTunnelId() ) ; + } else + return NULL ; +} + +// MM : added by MM +::rtl::OUString findOIDDescription(char *oid) +{ + OUString ouOID = OUString::createFromAscii( oid ); + for (int i=0; i<nOID; i++) + { + OUString item = OUString::createFromAscii( OIDs[i].oid ); + if (ouOID == item) + { + return OUString::createFromAscii( OIDs[i].desc ); + } + } + + return OUString() ; +} + +::com::sun::star::uno::Sequence< sal_Int8 > getThumbprint(const CERT_CONTEXT* pCertContext, DWORD dwPropId) +{ + if( pCertContext != NULL ) + { + DWORD cbData = 20; + unsigned char fingerprint[20]; + if (CertGetCertificateContextProperty(pCertContext, dwPropId, (void*)fingerprint, &cbData)) + { + Sequence< sal_Int8 > thumbprint( cbData ) ; + for( unsigned int i = 0 ; i < cbData ; i ++ ) + { + thumbprint[i] = fingerprint[i]; + } + + return thumbprint; + } + else + { + DWORD e = GetLastError(); + cbData = e; + } + } + + return Sequence< sal_Int8 >(); +} + +::rtl::OUString SAL_CALL X509Certificate_MSCryptImpl::getSubjectPublicKeyAlgorithm() + throw ( ::com::sun::star::uno::RuntimeException) +{ + if( m_pCertContext != NULL && m_pCertContext->pCertInfo != NULL ) + { + CRYPT_ALGORITHM_IDENTIFIER algorithm = m_pCertContext->pCertInfo->SubjectPublicKeyInfo.Algorithm; + return findOIDDescription( algorithm.pszObjId ) ; + } + else + { + return OUString() ; + } +} + +::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL X509Certificate_MSCryptImpl::getSubjectPublicKeyValue() + throw ( ::com::sun::star::uno::RuntimeException) +{ + if( m_pCertContext != NULL && m_pCertContext->pCertInfo != NULL ) + { + CRYPT_BIT_BLOB publicKey = m_pCertContext->pCertInfo->SubjectPublicKeyInfo.PublicKey; + + Sequence< sal_Int8 > key( publicKey.cbData ) ; + for( unsigned int i = 0 ; i < publicKey.cbData ; i++ ) + { + key[i] = *(publicKey.pbData + i) ; + } + + return key; + } + else + { + return Sequence< sal_Int8 >(); + } +} + +::rtl::OUString SAL_CALL X509Certificate_MSCryptImpl::getSignatureAlgorithm() + throw ( ::com::sun::star::uno::RuntimeException) +{ + if( m_pCertContext != NULL && m_pCertContext->pCertInfo != NULL ) + { + CRYPT_ALGORITHM_IDENTIFIER algorithm = m_pCertContext->pCertInfo->SignatureAlgorithm; + return findOIDDescription( algorithm.pszObjId ) ; + } + else + { + return OUString() ; + } +} + +::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL X509Certificate_MSCryptImpl::getSHA1Thumbprint() + throw ( ::com::sun::star::uno::RuntimeException) +{ + return getThumbprint(m_pCertContext, CERT_SHA1_HASH_PROP_ID); +} + +::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL X509Certificate_MSCryptImpl::getMD5Thumbprint() + throw ( ::com::sun::star::uno::RuntimeException) +{ + return getThumbprint(m_pCertContext, CERT_MD5_HASH_PROP_ID); +} + +sal_Int32 SAL_CALL X509Certificate_MSCryptImpl::getCertificateUsage( ) + throw ( ::com::sun::star::uno::RuntimeException) +{ + sal_Int32 usage = + CERT_DATA_ENCIPHERMENT_KEY_USAGE | + CERT_DIGITAL_SIGNATURE_KEY_USAGE | + CERT_KEY_AGREEMENT_KEY_USAGE | + CERT_KEY_CERT_SIGN_KEY_USAGE | + CERT_KEY_ENCIPHERMENT_KEY_USAGE | + CERT_NON_REPUDIATION_KEY_USAGE | + CERT_OFFLINE_CRL_SIGN_KEY_USAGE; + + if( m_pCertContext != NULL && m_pCertContext->pCertInfo != NULL && m_pCertContext->pCertInfo->cExtension != 0 ) + { + CERT_EXTENSION* pExtn = CertFindExtension( + szOID_KEY_USAGE, + m_pCertContext->pCertInfo->cExtension, + m_pCertContext->pCertInfo->rgExtension); + + if (pExtn != NULL) + { + CERT_KEY_USAGE_RESTRICTION_INFO keyUsage; + DWORD length = sizeof(CERT_KEY_USAGE_RESTRICTION_INFO); + + bool rc = CryptDecodeObject( + X509_ASN_ENCODING, + X509_KEY_USAGE, + pExtn->Value.pbData, + pExtn->Value.cbData, + CRYPT_DECODE_NOCOPY_FLAG, + (void *)&keyUsage, + &length); + + if (rc && keyUsage.RestrictedKeyUsage.cbData!=0) + { + usage = (sal_Int32)keyUsage.RestrictedKeyUsage.pbData; + } + } + } + + return usage; +} + +// MM : end + diff --git a/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.hxx b/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.hxx new file mode 100644 index 000000000000..209a8a6ce10d --- /dev/null +++ b/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.hxx @@ -0,0 +1,114 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _X509CERTIFICATE_MSCRYPTIMPL_HXX_ +#define _X509CERTIFICATE_MSCRYPTIMPL_HXX_ + +#ifdef _MSC_VER +#pragma warning(push,1) +#endif +#include "Windows.h" +#include "WinCrypt.h" +#ifdef _MSC_VER +#pragma warning(pop) +#endif +#include <sal/config.h> +#include <rtl/ustring.hxx> +#include <cppuhelper/factory.hxx> +#include <cppuhelper/implbase2.hxx> +#include <com/sun/star/uno/Exception.hpp> +#include <com/sun/star/lang/XUnoTunnel.hpp> +#include <com/sun/star/uno/SecurityException.hpp> +#include <com/sun/star/security/XCertificate.hpp> + +class X509Certificate_MSCryptImpl : public ::cppu::WeakImplHelper2< + ::com::sun::star::security::XCertificate , + ::com::sun::star::lang::XUnoTunnel > +{ + private : + const CERT_CONTEXT* m_pCertContext ; + + public : + X509Certificate_MSCryptImpl() ; + virtual ~X509Certificate_MSCryptImpl() ; + + //Methods from XCertificate + virtual sal_Int16 SAL_CALL getVersion() throw ( ::com::sun::star::uno::RuntimeException) ; + + virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getSerialNumber() throw ( ::com::sun::star::uno::RuntimeException) ; + + virtual ::rtl::OUString SAL_CALL getIssuerName() throw ( ::com::sun::star::uno::RuntimeException) ; + + virtual ::rtl::OUString SAL_CALL getSubjectName() throw ( ::com::sun::star::uno::RuntimeException) ; + + virtual ::com::sun::star::util::DateTime SAL_CALL getNotValidBefore() throw ( ::com::sun::star::uno::RuntimeException) ; + + virtual ::com::sun::star::util::DateTime SAL_CALL getNotValidAfter() throw ( ::com::sun::star::uno::RuntimeException) ; + + virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getIssuerUniqueID() throw ( ::com::sun::star::uno::RuntimeException) ; + + virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getSubjectUniqueID() throw ( ::com::sun::star::uno::RuntimeException) ; + + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::security::XCertificateExtension > > SAL_CALL getExtensions() throw ( ::com::sun::star::uno::RuntimeException) ; + + virtual ::com::sun::star::uno::Reference< ::com::sun::star::security::XCertificateExtension > SAL_CALL findCertificateExtension( const ::com::sun::star::uno::Sequence< sal_Int8 >& oid ) throw (::com::sun::star::uno::RuntimeException) ; + + virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getEncoded() throw ( ::com::sun::star::uno::RuntimeException) ; + + // MM : added by MM + virtual ::rtl::OUString SAL_CALL getSubjectPublicKeyAlgorithm() + throw ( ::com::sun::star::uno::RuntimeException) ; + + virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getSubjectPublicKeyValue() + throw ( ::com::sun::star::uno::RuntimeException) ; + + virtual ::rtl::OUString SAL_CALL getSignatureAlgorithm() + throw ( ::com::sun::star::uno::RuntimeException) ; + + virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getSHA1Thumbprint() + throw ( ::com::sun::star::uno::RuntimeException) ; + + virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getMD5Thumbprint() + throw ( ::com::sun::star::uno::RuntimeException) ; + + virtual sal_Int32 SAL_CALL getCertificateUsage( ) throw ( ::com::sun::star::uno::RuntimeException) ; + // MM : end + + //Methods from XUnoTunnel + virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw (com::sun::star::uno::RuntimeException); + + static const ::com::sun::star::uno::Sequence< sal_Int8 >& getUnoTunnelId() ; + static X509Certificate_MSCryptImpl* getImplementation( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > xObj ) ; + + //Helper methods + void setMswcryCert( const CERT_CONTEXT* cert ) ; + const CERT_CONTEXT* getMswcryCert() const ; + void setRawCert( ::com::sun::star::uno::Sequence< sal_Int8 > rawCert ) throw ( ::com::sun::star::uno::RuntimeException) ; +} ; + +#endif // _X509CERTIFICATE_MSCRYPTIMPL_HXX_ + diff --git a/xmlsecurity/source/xmlsec/mscrypt/xmlencryption_mscryptimpl.cxx b/xmlsecurity/source/xmlsec/mscrypt/xmlencryption_mscryptimpl.cxx new file mode 100644 index 000000000000..e30eabfb279e --- /dev/null +++ b/xmlsecurity/source/xmlsec/mscrypt/xmlencryption_mscryptimpl.cxx @@ -0,0 +1,390 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_xmlsecurity.hxx" + +#include <sal/config.h> +#include <rtl/uuid.h> +#include "xmlencryption_mscryptimpl.hxx" + +#ifndef _XMLDOCUMENTWRAPPER_XMLSECIMPL_HXX_ +#include "xmldocumentwrapper_xmlsecimpl.hxx" +#endif + +#ifndef _XMLELEMENTWRAPPER_XMLSECIMPL_HXX_ +#include "xmlelementwrapper_xmlsecimpl.hxx" +#endif + +#ifndef _SECURITYENVIRONMENT_MSCRYPTIMPL_HXX_ +#include "securityenvironment_mscryptimpl.hxx" +#endif +#include "errorcallback.hxx" + +#include "xmlsec/xmlsec.h" +#include "xmlsec/xmltree.h" +#include "xmlsec/xmlenc.h" +#include "xmlsec/crypto.h" + +#ifdef UNX +#define stricmp strcasecmp +#endif + +using namespace ::com::sun::star::uno ; +using namespace ::com::sun::star::lang ; +using ::com::sun::star::lang::XMultiServiceFactory ; +using ::com::sun::star::lang::XSingleServiceFactory ; +using ::rtl::OUString ; + +using ::com::sun::star::xml::wrapper::XXMLElementWrapper ; +using ::com::sun::star::xml::wrapper::XXMLDocumentWrapper ; +using ::com::sun::star::xml::crypto::XSecurityEnvironment ; +using ::com::sun::star::xml::crypto::XXMLEncryption ; +using ::com::sun::star::xml::crypto::XXMLEncryptionTemplate ; +using ::com::sun::star::xml::crypto::XXMLSecurityContext ; +using ::com::sun::star::xml::crypto::XMLEncryptionException ; + +XMLEncryption_MSCryptImpl :: XMLEncryption_MSCryptImpl( const Reference< XMultiServiceFactory >& aFactory ) : m_xServiceManager( aFactory ) { +} + +XMLEncryption_MSCryptImpl :: ~XMLEncryption_MSCryptImpl() { +} + +/* XXMLEncryption */ +Reference< XXMLEncryptionTemplate > +SAL_CALL XMLEncryption_MSCryptImpl :: encrypt( + const Reference< XXMLEncryptionTemplate >& aTemplate , + const Reference< XSecurityEnvironment >& aEnvironment +) throw( com::sun::star::xml::crypto::XMLEncryptionException, + com::sun::star::uno::SecurityException ) +{ + xmlSecKeysMngrPtr pMngr = NULL ; + xmlSecEncCtxPtr pEncCtx = NULL ; + xmlNodePtr pEncryptedData = NULL ; + xmlNodePtr pContent = NULL ; + + if( !aTemplate.is() ) + throw RuntimeException() ; + + if( !aEnvironment.is() ) + throw RuntimeException() ; + + //Get Keys Manager + Reference< XUnoTunnel > xSecTunnel( aEnvironment , UNO_QUERY ) ; + if( !xSecTunnel.is() ) { + throw RuntimeException() ; + } + + SecurityEnvironment_MSCryptImpl* pSecEnv = ( SecurityEnvironment_MSCryptImpl* )xSecTunnel->getSomething( SecurityEnvironment_MSCryptImpl::getUnoTunnelId() ) ; + if( pSecEnv == NULL ) + throw RuntimeException() ; + + //Get the encryption template + Reference< XXMLElementWrapper > xTemplate = aTemplate->getTemplate() ; + if( !xTemplate.is() ) { + throw RuntimeException() ; + } + + Reference< XUnoTunnel > xTplTunnel( xTemplate , UNO_QUERY ) ; + if( !xTplTunnel.is() ) { + throw RuntimeException() ; + } + + XMLElementWrapper_XmlSecImpl* pTemplate = ( XMLElementWrapper_XmlSecImpl* )xTplTunnel->getSomething( XMLElementWrapper_XmlSecImpl::getUnoTunnelImplementationId() ) ; + if( pTemplate == NULL ) { + throw RuntimeException() ; + } + + pEncryptedData = pTemplate->getNativeElement() ; + + //Find the element to be encrypted. + //This element is wrapped in the CipherValue sub-element. + xmlNodePtr pCipherData = pEncryptedData->children; + while (pCipherData != NULL && stricmp((const char *)(pCipherData->name), "CipherData")) + { + pCipherData = pCipherData->next; + } + + if( pCipherData == NULL ) { + throw XMLEncryptionException() ; + } + + xmlNodePtr pCipherValue = pCipherData->children; + while (pCipherValue != NULL && stricmp((const char *)(pCipherValue->name), "CipherValue")) + { + pCipherValue = pCipherValue->next; + } + + if( pCipherValue == NULL ) { + throw XMLEncryptionException() ; + } + + pContent = pCipherValue->children; + + if( pContent == NULL ) { + throw XMLEncryptionException() ; + } + + xmlUnlinkNode(pContent); + xmlAddNextSibling(pEncryptedData, pContent); + + //remember the position of the element to be signed + sal_Bool isParentRef = sal_True; + xmlNodePtr pParent = pEncryptedData->parent; + xmlNodePtr referenceNode; + + if (pEncryptedData == pParent->children) + { + referenceNode = pParent; + } + else + { + referenceNode = pEncryptedData->prev; + isParentRef = sal_False; + } + + setErrorRecorder( ); + + pMngr = pSecEnv->createKeysManager() ; //i39448 + if( !pMngr ) { + throw RuntimeException() ; + } + + //Create Encryption context + pEncCtx = xmlSecEncCtxCreate( pMngr ) ; + if( pEncCtx == NULL ) + { + pSecEnv->destroyKeysManager( pMngr ) ; //i39448 + //throw XMLEncryptionException() ; + clearErrorRecorder(); + return aTemplate; + } + + //Encrypt the template + if( xmlSecEncCtxXmlEncrypt( pEncCtx , pEncryptedData , pContent ) < 0 ) { + aTemplate->setStatus(::com::sun::star::xml::crypto::SecurityOperationStatus_UNKNOWN); + xmlSecEncCtxDestroy( pEncCtx ) ; + pSecEnv->destroyKeysManager( pMngr ) ; //i39448 + clearErrorRecorder(); + return aTemplate; + } + aTemplate->setStatus(::com::sun::star::xml::crypto::SecurityOperationStatus_OPERATION_SUCCEEDED); + xmlSecEncCtxDestroy( pEncCtx ) ; + pSecEnv->destroyKeysManager( pMngr ) ; //i39448 + + //get the new EncryptedData element + if (isParentRef) + { + pTemplate->setNativeElement(referenceNode->children) ; + } + else + { + pTemplate->setNativeElement(referenceNode->next); + } + + clearErrorRecorder(); + return aTemplate ; +} + +/* XXMLEncryption */ +Reference< XXMLEncryptionTemplate > SAL_CALL +XMLEncryption_MSCryptImpl :: decrypt( + const Reference< XXMLEncryptionTemplate >& aTemplate , + const Reference< XXMLSecurityContext >& aSecurityCtx +) throw( com::sun::star::xml::crypto::XMLEncryptionException , + com::sun::star::uno::SecurityException) { + xmlSecKeysMngrPtr pMngr = NULL ; + xmlSecEncCtxPtr pEncCtx = NULL ; + xmlNodePtr pEncryptedData = NULL ; + + if( !aTemplate.is() ) + throw RuntimeException() ; + + if( !aSecurityCtx.is() ) + throw RuntimeException() ; + + //Get Keys Manager + Reference< XSecurityEnvironment > xSecEnv + = aSecurityCtx->getSecurityEnvironmentByIndex( + aSecurityCtx->getDefaultSecurityEnvironmentIndex()); + Reference< XUnoTunnel > xSecTunnel( xSecEnv , UNO_QUERY ) ; + if( !xSecTunnel.is() ) { + throw RuntimeException() ; + } + + SecurityEnvironment_MSCryptImpl* pSecEnv = ( SecurityEnvironment_MSCryptImpl* )xSecTunnel->getSomething( SecurityEnvironment_MSCryptImpl::getUnoTunnelId() ) ; + if( pSecEnv == NULL ) + throw RuntimeException() ; + + //Get the encryption template + Reference< XXMLElementWrapper > xTemplate = aTemplate->getTemplate() ; + if( !xTemplate.is() ) { + throw RuntimeException() ; + } + + Reference< XUnoTunnel > xTplTunnel( xTemplate , UNO_QUERY ) ; + if( !xTplTunnel.is() ) { + throw RuntimeException() ; + } + + XMLElementWrapper_XmlSecImpl* pTemplate = ( XMLElementWrapper_XmlSecImpl* )xTplTunnel->getSomething( XMLElementWrapper_XmlSecImpl::getUnoTunnelImplementationId() ) ; + if( pTemplate == NULL ) { + throw RuntimeException() ; + } + + pEncryptedData = pTemplate->getNativeElement() ; + + //remember the position of the element to be signed + sal_Bool isParentRef = sal_True; + xmlNodePtr pParent = pEncryptedData->parent; + xmlNodePtr referenceNode; + + if (pEncryptedData == pParent->children) + { + referenceNode = pParent; + } + else + { + referenceNode = pEncryptedData->prev; + isParentRef = sal_False; + } + + setErrorRecorder( ); + + pMngr = pSecEnv->createKeysManager() ; //i39448 + if( !pMngr ) { + throw RuntimeException() ; + } + + //Create Encryption context + pEncCtx = xmlSecEncCtxCreate( pMngr ) ; + if( pEncCtx == NULL ) + { + pSecEnv->destroyKeysManager( pMngr ) ; //i39448 + //throw XMLEncryptionException() ; + clearErrorRecorder(); + return aTemplate; + } + + //Decrypt the template + if( xmlSecEncCtxDecrypt( pEncCtx , pEncryptedData ) < 0 || pEncCtx->result == NULL ) { + aTemplate->setStatus(::com::sun::star::xml::crypto::SecurityOperationStatus_UNKNOWN); + xmlSecEncCtxDestroy( pEncCtx ) ; + pSecEnv->destroyKeysManager( pMngr ) ; //i39448 + + //throw XMLEncryptionException() ; + clearErrorRecorder(); + return aTemplate; + } + aTemplate->setStatus(::com::sun::star::xml::crypto::SecurityOperationStatus_OPERATION_SUCCEEDED); + /*---------------------------------------- + if( pEncCtx->resultReplaced != 0 ) { + pContent = pEncryptedData ; + + Reference< XUnoTunnel > xTunnel( ret , UNO_QUERY ) ; + if( !xTunnel.is() ) { + xmlSecEncCtxDestroy( pEncCtx ) ; + throw RuntimeException() ; + } + XMLElementWrapper_XmlSecImpl* pNode = ( XMLElementWrapper_XmlSecImpl* )xTunnel->getSomething( XMLElementWrapper_XmlSecImpl::getUnoTunnelImplementationId() ) ; + if( pNode == NULL ) { + xmlSecEncCtxDestroy( pEncCtx ) ; + throw RuntimeException() ; + } + + pNode->setNativeElement( pContent ) ; + } else { + xmlSecEncCtxDestroy( pEncCtx ) ; + throw RuntimeException() ; + } + ----------------------------------------*/ + + //Destroy the encryption context + xmlSecEncCtxDestroy( pEncCtx ) ; + pSecEnv->destroyKeysManager( pMngr ) ; //i39448 + + //get the decrypted element + XMLElementWrapper_XmlSecImpl * ret = new XMLElementWrapper_XmlSecImpl(isParentRef? + (referenceNode->children):(referenceNode->next)); + + //return ret; + aTemplate->setTemplate(ret); + + clearErrorRecorder(); + return aTemplate; +} + +/* XInitialization */ +void SAL_CALL XMLEncryption_MSCryptImpl :: initialize( const Sequence< Any >& /*aArguments*/ ) throw( Exception, RuntimeException ) { + // TBD +} ; + +/* XServiceInfo */ +OUString SAL_CALL XMLEncryption_MSCryptImpl :: getImplementationName() throw( RuntimeException ) { + return impl_getImplementationName() ; +} + +/* XServiceInfo */ +sal_Bool SAL_CALL XMLEncryption_MSCryptImpl :: supportsService( const OUString& serviceName) throw( RuntimeException ) { + Sequence< OUString > seqServiceNames = getSupportedServiceNames() ; + const OUString* pArray = seqServiceNames.getConstArray() ; + for( sal_Int32 i = 0 ; i < seqServiceNames.getLength() ; i ++ ) { + if( *( pArray + i ) == serviceName ) + return sal_True ; + } + return sal_False ; +} + +/* XServiceInfo */ +Sequence< OUString > SAL_CALL XMLEncryption_MSCryptImpl :: getSupportedServiceNames() throw( RuntimeException ) { + return impl_getSupportedServiceNames() ; +} + +//Helper for XServiceInfo +Sequence< OUString > XMLEncryption_MSCryptImpl :: impl_getSupportedServiceNames() { + ::osl::Guard< ::osl::Mutex > aGuard( ::osl::Mutex::getGlobalMutex() ) ; + Sequence< OUString > seqServiceNames( 1 ) ; + seqServiceNames.getArray()[0] = OUString::createFromAscii( "com.sun.star.xml.crypto.XMLEncryption" ) ; + return seqServiceNames ; +} + +OUString XMLEncryption_MSCryptImpl :: impl_getImplementationName() throw( RuntimeException ) { + return OUString::createFromAscii( "com.sun.star.xml.security.bridge.xmlsec.XMLEncryption_MSCryptImpl" ) ; +} + +//Helper for registry +Reference< XInterface > SAL_CALL XMLEncryption_MSCryptImpl :: impl_createInstance( const Reference< XMultiServiceFactory >& aServiceManager ) throw( RuntimeException ) { + return Reference< XInterface >( *new XMLEncryption_MSCryptImpl( aServiceManager ) ) ; +} + +Reference< XSingleServiceFactory > XMLEncryption_MSCryptImpl :: impl_createFactory( const Reference< XMultiServiceFactory >& aServiceManager ) { + //Reference< XSingleServiceFactory > xFactory ; + //xFactory = ::cppu::createSingleFactory( aServiceManager , impl_getImplementationName , impl_createInstance , impl_getSupportedServiceNames ) ; + //return xFactory ; + return ::cppu::createSingleFactory( aServiceManager , impl_getImplementationName() , impl_createInstance , impl_getSupportedServiceNames() ) ; +} + diff --git a/xmlsecurity/source/xmlsec/mscrypt/xmlencryption_mscryptimpl.hxx b/xmlsecurity/source/xmlsec/mscrypt/xmlencryption_mscryptimpl.hxx new file mode 100644 index 000000000000..fdc3d0ff41f8 --- /dev/null +++ b/xmlsecurity/source/xmlsec/mscrypt/xmlencryption_mscryptimpl.hxx @@ -0,0 +1,102 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _XMLENCRYPTION_MSCRYPTIMPL_HXX_ +#define _XMLENCRYPTION_MSCRYPTIMPL_HXX_ + +#include <sal/config.h> +#include <rtl/ustring.hxx> +#include <cppuhelper/factory.hxx> +#include <cppuhelper/implbase3.hxx> +#include <com/sun/star/uno/Exception.hpp> + +#ifndef _COM_SUN_STAR_UNO_REFERENCE_HPP_ +#include <com/sun/star/uno/Reference.hxx> +#endif +#include <com/sun/star/lang/XSingleServiceFactory.hpp> + +#ifndef _COM_SUN_STAR_LANG_XSECVICEINFO_HPP_ +#include <com/sun/star/lang/XServiceInfo.hpp> +#endif +#include <com/sun/star/lang/XInitialization.hpp> +#include <com/sun/star/xml/crypto/XXMLEncryption.hpp> +#include <com/sun/star/xml/crypto/XXMLEncryptionTemplate.hpp> +#include <com/sun/star/xml/crypto/XXMLSecurityContext.hpp> + +class XMLEncryption_MSCryptImpl : public ::cppu::WeakImplHelper3< + ::com::sun::star::xml::crypto::XXMLEncryption , + ::com::sun::star::lang::XInitialization , + ::com::sun::star::lang::XServiceInfo > +{ + private : + ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xServiceManager ; + + public : + XMLEncryption_MSCryptImpl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& aFactory ) ; + virtual ~XMLEncryption_MSCryptImpl() ; + + //Methods from XXMLEncryption + virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XXMLEncryptionTemplate > SAL_CALL encrypt( + const ::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XXMLEncryptionTemplate >& aTemplate , + const ::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XSecurityEnvironment >& aEnvironment) + // ) throw( ::com::sun::star::uno::Exception , ::com::sun::star::uno::RuntimeException ) ; + throw ( com::sun::star::xml::crypto::XMLEncryptionException , + com::sun::star::uno::SecurityException); + + virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XXMLEncryptionTemplate > SAL_CALL decrypt( + const ::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XXMLEncryptionTemplate >& aTemplate , + const ::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XXMLSecurityContext >& aContext + ) throw( com::sun::star::xml::crypto::XMLEncryptionException , + com::sun::star::uno::SecurityException) ; + + //Methods from XInitialization + virtual void SAL_CALL initialize( + const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments + ) throw( ::com::sun::star::uno::Exception , ::com::sun::star::uno::RuntimeException ) ; + + //Methods from XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException ) ; + + virtual sal_Bool SAL_CALL supportsService( + const ::rtl::OUString& ServiceName + ) throw( ::com::sun::star::uno::RuntimeException ) ; + + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException ) ; + + //Helper for XServiceInfo + static ::com::sun::star::uno::Sequence< ::rtl::OUString > impl_getSupportedServiceNames() ; + + static ::rtl::OUString impl_getImplementationName() throw( ::com::sun::star::uno::RuntimeException ) ; + + //Helper for registry + static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL impl_createInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& aServiceManager ) throw( ::com::sun::star::uno::RuntimeException ) ; + + static ::com::sun::star::uno::Reference< ::com::sun::star::lang::XSingleServiceFactory > impl_createFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& aServiceManager ) ; +} ; + +#endif // _XMLENCRYPTION_MSCRYPTIMPL_HXX_ + diff --git a/xmlsecurity/source/xmlsec/mscrypt/xmlsecuritycontext_mscryptimpl.cxx b/xmlsecurity/source/xmlsec/mscrypt/xmlsecuritycontext_mscryptimpl.cxx new file mode 100644 index 000000000000..034bb70c591a --- /dev/null +++ b/xmlsecurity/source/xmlsec/mscrypt/xmlsecuritycontext_mscryptimpl.cxx @@ -0,0 +1,345 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_xmlsecurity.hxx" +#include <sal/config.h> +#include <rtl/uuid.h> +#include "securityenvironment_mscryptimpl.hxx" + +#ifndef _XMLSECURITYCONTEXT_MSCRYPTIMPL_HXX_ +#include "xmlsecuritycontext_mscryptimpl.hxx" +#endif +#include "xmlstreamio.hxx" + +#include "xmlsec/xmlsec.h" +#include "xmlsec/keysmngr.h" +#include "xmlsec/crypto.h" +#include "xmlsec/mscrypto/akmngr.h" + +using namespace ::com::sun::star::uno ; +using namespace ::com::sun::star::lang ; +using ::com::sun::star::lang::XMultiServiceFactory ; +using ::com::sun::star::lang::XSingleServiceFactory ; +using ::rtl::OUString ; + +using ::com::sun::star::xml::crypto::XSecurityEnvironment ; +using ::com::sun::star::xml::crypto::XXMLSecurityContext ; + +XMLSecurityContext_MSCryptImpl :: XMLSecurityContext_MSCryptImpl( const Reference< XMultiServiceFactory >& aFactory ) + ://m_pKeysMngr( NULL ) , + m_xServiceManager( aFactory ), + m_xSecurityEnvironment( NULL ) +{ + //Init xmlsec library + if( xmlSecInit() < 0 ) { + throw RuntimeException() ; + } + + //Init xmlsec crypto engine library + if( xmlSecCryptoInit() < 0 ) { + xmlSecShutdown() ; + throw RuntimeException() ; + } + + //Enable external stream handlers + if( xmlEnableStreamInputCallbacks() < 0 ) { + xmlSecCryptoShutdown() ; + xmlSecShutdown() ; + throw RuntimeException() ; + } +} + +XMLSecurityContext_MSCryptImpl :: ~XMLSecurityContext_MSCryptImpl() { + xmlDisableStreamInputCallbacks() ; + xmlSecCryptoShutdown() ; + xmlSecShutdown() ; +} + +//i39448 : new methods +sal_Int32 SAL_CALL XMLSecurityContext_MSCryptImpl::addSecurityEnvironment( + const ::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XSecurityEnvironment >& aSecurityEnvironment) + throw (::com::sun::star::security::SecurityInfrastructureException, ::com::sun::star::uno::RuntimeException) +{ + if( !aSecurityEnvironment.is() ) + { + throw RuntimeException() ; + } + + m_xSecurityEnvironment = aSecurityEnvironment; + + return 0; +} + + +sal_Int32 SAL_CALL XMLSecurityContext_MSCryptImpl::getSecurityEnvironmentNumber( ) + throw (::com::sun::star::uno::RuntimeException) +{ + return 1; +} + +::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XSecurityEnvironment > SAL_CALL + XMLSecurityContext_MSCryptImpl::getSecurityEnvironmentByIndex( sal_Int32 index ) + throw (::com::sun::star::uno::RuntimeException) +{ + if (index == 0) + { + return m_xSecurityEnvironment; + } + else + throw RuntimeException() ; +} + +::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XSecurityEnvironment > SAL_CALL + XMLSecurityContext_MSCryptImpl::getSecurityEnvironment( ) + throw (::com::sun::star::uno::RuntimeException) +{ + return m_xSecurityEnvironment; +} + +sal_Int32 SAL_CALL XMLSecurityContext_MSCryptImpl::getDefaultSecurityEnvironmentIndex( ) + throw (::com::sun::star::uno::RuntimeException) +{ + return 0; +} + +void SAL_CALL XMLSecurityContext_MSCryptImpl::setDefaultSecurityEnvironmentIndex( sal_Int32 /*nDefaultEnvIndex*/ ) + throw (::com::sun::star::uno::RuntimeException) +{ + //dummy +} + +#if 0 +/* XXMLSecurityContext */ +void SAL_CALL XMLSecurityContext_MSCryptImpl :: setSecurityEnvironment( const Reference< XSecurityEnvironment >& aSecurityEnvironment ) throw( com::sun::star::security::SecurityInfrastructureException ) { + HCERTSTORE hkeyStore ; + HCERTSTORE hCertStore ; + HCRYPTKEY symKey ; + HCRYPTKEY pubKey ; + HCRYPTKEY priKey ; + unsigned int i ; + + if( !aSecurityEnvironment.is() ) + throw RuntimeException() ; + + m_xSecurityEnvironment = aSecurityEnvironment ; + + //Clear key manager + if( m_pKeysMngr != NULL ) { + xmlSecKeysMngrDestroy( m_pKeysMngr ) ; + m_pKeysMngr = NULL ; + } + + //Create key manager + Reference< XUnoTunnel > xEnvTunnel( m_xSecurityEnvironment , UNO_QUERY ) ; + if( !xEnvTunnel.is() ) { + throw RuntimeException() ; + } + + SecurityEnvironment_MSCryptImpl* pSecEnv = ( SecurityEnvironment_MSCryptImpl* )xEnvTunnel->getSomething( SecurityEnvironment_MSCryptImpl::getUnoTunnelId() ) ; + if( pSecEnv == NULL ) + throw RuntimeException() ; + + hkeyStore = pSecEnv->getCryptoSlot() ; + hCertStore = pSecEnv->getCertDb() ; + + /*- + * The following lines is based on the of xmlsec-mscrypto crypto engine + */ + m_pKeysMngr = xmlSecMSCryptoAppliedKeysMngrCreate( hkeyStore , hCertStore ) ; + if( m_pKeysMngr == NULL ) + throw RuntimeException() ; + + /*- + * Adopt symmetric key into keys manager + */ + for( i = 0 ; ( symKey = pSecEnv->getSymKey( i ) ) != NULL ; i ++ ) { + if( xmlSecMSCryptoAppliedKeysMngrSymKeyLoad( m_pKeysMngr, symKey ) < 0 ) { + throw RuntimeException() ; + } + } + + /*- + * Adopt asymmetric public key into keys manager + */ + for( i = 0 ; ( pubKey = pSecEnv->getPubKey( i ) ) != NULL ; i ++ ) { + if( xmlSecMSCryptoAppliedKeysMngrPubKeyLoad( m_pKeysMngr, pubKey ) < 0 ) { + throw RuntimeException() ; + } + } + + /*- + * Adopt asymmetric private key into keys manager + */ + for( i = 0 ; ( priKey = pSecEnv->getPriKey( i ) ) != NULL ; i ++ ) { + if( xmlSecMSCryptoAppliedKeysMngrPriKeyLoad( m_pKeysMngr, priKey ) < 0 ) { + throw RuntimeException() ; + } + } + + /*- + * Adopt system default certificate store. + */ + if( pSecEnv->defaultEnabled() ) { + HCERTSTORE hSystemStore ; + + //Add system key store into the keys manager. + hSystemStore = CertOpenSystemStore( 0, "MY" ) ; + if( hSystemStore != NULL ) { + if( xmlSecMSCryptoAppliedKeysMngrAdoptKeyStore( m_pKeysMngr, hSystemStore ) < 0 ) { + CertCloseStore( hSystemStore, CERT_CLOSE_STORE_CHECK_FLAG ) ; + throw RuntimeException() ; + } + } + + //Add system root store into the keys manager. + hSystemStore = CertOpenSystemStore( 0, "Root" ) ; + if( hSystemStore != NULL ) { + if( xmlSecMSCryptoAppliedKeysMngrAdoptTrustedStore( m_pKeysMngr, hSystemStore ) < 0 ) { + CertCloseStore( hSystemStore, CERT_CLOSE_STORE_CHECK_FLAG ) ; + throw RuntimeException() ; + } + } + + //Add system trusted store into the keys manager. + hSystemStore = CertOpenSystemStore( 0, "Trust" ) ; + if( hSystemStore != NULL ) { + if( xmlSecMSCryptoAppliedKeysMngrAdoptUntrustedStore( m_pKeysMngr, hSystemStore ) < 0 ) { + CertCloseStore( hSystemStore, CERT_CLOSE_STORE_CHECK_FLAG ) ; + throw RuntimeException() ; + } + } + + //Add system CA store into the keys manager. + hSystemStore = CertOpenSystemStore( 0, "CA" ) ; + if( hSystemStore != NULL ) { + if( xmlSecMSCryptoAppliedKeysMngrAdoptUntrustedStore( m_pKeysMngr, hSystemStore ) < 0 ) { + CertCloseStore( hSystemStore, CERT_CLOSE_STORE_CHECK_FLAG ) ; + throw RuntimeException() ; + } + } + } +} + +/* XXMLSecurityContext */ +Reference< XSecurityEnvironment > SAL_CALL XMLSecurityContext_MSCryptImpl :: getSecurityEnvironment() + throw (RuntimeException) +{ + return m_xSecurityEnvironment ; +} +#endif + +/* XInitialization */ +void SAL_CALL XMLSecurityContext_MSCryptImpl :: initialize( const Sequence< Any >& /*aArguments*/ ) throw( Exception, RuntimeException ) { + // TBD +} ; + +/* XServiceInfo */ +OUString SAL_CALL XMLSecurityContext_MSCryptImpl :: getImplementationName() throw( RuntimeException ) { + return impl_getImplementationName() ; +} + +/* XServiceInfo */ +sal_Bool SAL_CALL XMLSecurityContext_MSCryptImpl :: supportsService( const OUString& serviceName) throw( RuntimeException ) { + Sequence< OUString > seqServiceNames = getSupportedServiceNames() ; + const OUString* pArray = seqServiceNames.getConstArray() ; + for( sal_Int32 i = 0 ; i < seqServiceNames.getLength() ; i ++ ) { + if( *( pArray + i ) == serviceName ) + return sal_True ; + } + return sal_False ; +} + +/* XServiceInfo */ +Sequence< OUString > SAL_CALL XMLSecurityContext_MSCryptImpl :: getSupportedServiceNames() throw( RuntimeException ) { + return impl_getSupportedServiceNames() ; +} + +//Helper for XServiceInfo +Sequence< OUString > XMLSecurityContext_MSCryptImpl :: impl_getSupportedServiceNames() { + ::osl::Guard< ::osl::Mutex > aGuard( ::osl::Mutex::getGlobalMutex() ) ; + Sequence< OUString > seqServiceNames( 1 ) ; + seqServiceNames.getArray()[0] = OUString::createFromAscii( "com.sun.star.xml.crypto.XMLSecurityContext" ) ; + return seqServiceNames ; +} + +OUString XMLSecurityContext_MSCryptImpl :: impl_getImplementationName() throw( RuntimeException ) { + return OUString::createFromAscii( "com.sun.star.xml.security.bridge.xmlsec.XMLSecurityContext_MSCryptImpl" ) ; +} + +//Helper for registry +Reference< XInterface > SAL_CALL XMLSecurityContext_MSCryptImpl :: impl_createInstance( const Reference< XMultiServiceFactory >& aServiceManager ) throw( RuntimeException ) { + return Reference< XInterface >( *new XMLSecurityContext_MSCryptImpl( aServiceManager ) ) ; +} + +Reference< XSingleServiceFactory > XMLSecurityContext_MSCryptImpl :: impl_createFactory( const Reference< XMultiServiceFactory >& aServiceManager ) { + //Reference< XSingleServiceFactory > xFactory ; + //xFactory = ::cppu::createSingleFactory( aServiceManager , impl_getImplementationName , impl_createInstance , impl_getSupportedServiceNames ) ; + //return xFactory ; + return ::cppu::createSingleFactory( aServiceManager , impl_getImplementationName() , impl_createInstance , impl_getSupportedServiceNames() ) ; +} + +#if 0 +/* XUnoTunnel */ +sal_Int64 SAL_CALL XMLSecurityContext_MSCryptImpl :: getSomething( const Sequence< sal_Int8 >& aIdentifier ) +throw (RuntimeException) +{ + if( aIdentifier.getLength() == 16 && 0 == rtl_compareMemory( getUnoTunnelId().getConstArray(), aIdentifier.getConstArray(), 16 ) ) { + return ( sal_Int64 )this ; + } + return 0 ; +} + +/* XUnoTunnel extension */ +const Sequence< sal_Int8>& XMLSecurityContext_MSCryptImpl :: getUnoTunnelId() { + static Sequence< sal_Int8 >* pSeq = 0 ; + if( !pSeq ) { + ::osl::Guard< ::osl::Mutex > aGuard( ::osl::Mutex::getGlobalMutex() ) ; + if( !pSeq ) { + static Sequence< sal_Int8> aSeq( 16 ) ; + rtl_createUuid( ( sal_uInt8* )aSeq.getArray() , 0 , sal_True ) ; + pSeq = &aSeq ; + } + } + return *pSeq ; +} + +/* XUnoTunnel extension */ +XMLSecurityContext_MSCryptImpl* XMLSecurityContext_MSCryptImpl :: getImplementation( const Reference< XInterface > xObj ) { + Reference< XUnoTunnel > xUT( xObj , UNO_QUERY ) ; + if( xUT.is() ) { + return ( XMLSecurityContext_MSCryptImpl* )xUT->getSomething( getUnoTunnelId() ) ; + } else + return NULL ; +} + +/* Native methods */ +xmlSecKeysMngrPtr XMLSecurityContext_MSCryptImpl :: keysManager() throw( Exception, RuntimeException ) { + return m_pKeysMngr ; +} +#endif + diff --git a/xmlsecurity/source/xmlsec/mscrypt/xmlsecuritycontext_mscryptimpl.hxx b/xmlsecurity/source/xmlsec/mscrypt/xmlsecuritycontext_mscryptimpl.hxx new file mode 100644 index 000000000000..b6ad409ad4be --- /dev/null +++ b/xmlsecurity/source/xmlsec/mscrypt/xmlsecuritycontext_mscryptimpl.hxx @@ -0,0 +1,137 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _XMLSIGNATURECONTEXT_MSCRYPTIMPL_HXX_ +#define _XMLSIGNATURECONTEXT_MSCRYPTIMPL_HXX_ + +#include <sal/config.h> +#include <rtl/ustring.hxx> +#include <cppuhelper/factory.hxx> +#include <cppuhelper/implbase3.hxx> +#include <com/sun/star/uno/Exception.hpp> + +#ifndef _COM_SUN_STAR_UNO_REFERENCE_HPP_ +#include <com/sun/star/uno/Reference.hxx> +#endif +#include <com/sun/star/lang/XSingleServiceFactory.hpp> + +#ifndef _COM_SUN_STAR_LANG_XSECVICEINFO_HPP_ +#include <com/sun/star/lang/XServiceInfo.hpp> +#endif +#include <com/sun/star/lang/XInitialization.hpp> +#include <com/sun/star/lang/XUnoTunnel.hpp> +#include <com/sun/star/xml/crypto/XSecurityEnvironment.hpp> +#include <com/sun/star/xml/crypto/XXMLSecurityContext.hpp> + +//#include "xmlsec/xmlsec.h" + +class XMLSecurityContext_MSCryptImpl : public ::cppu::WeakImplHelper3< + ::com::sun::star::xml::crypto::XXMLSecurityContext , + ::com::sun::star::lang::XInitialization , + ::com::sun::star::lang::XServiceInfo > +{ + private : + //xmlSecKeysMngrPtr m_pKeysMngr ; + ::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XSecurityEnvironment > m_xSecurityEnvironment ; + ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xServiceManager ; + + public : + XMLSecurityContext_MSCryptImpl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& aFactory ) ; + virtual ~XMLSecurityContext_MSCryptImpl() ; + + //Methods from XXMLSecurityContext + virtual sal_Int32 SAL_CALL addSecurityEnvironment( + const ::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XSecurityEnvironment >& aSecurityEnvironment + ) throw (::com::sun::star::security::SecurityInfrastructureException, ::com::sun::star::uno::RuntimeException); + + virtual ::sal_Int32 SAL_CALL getSecurityEnvironmentNumber( ) + throw (::com::sun::star::uno::RuntimeException); + + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::xml::crypto::XSecurityEnvironment > SAL_CALL + getSecurityEnvironmentByIndex( ::sal_Int32 index ) + throw (::com::sun::star::uno::RuntimeException); + + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::xml::crypto::XSecurityEnvironment > SAL_CALL + getSecurityEnvironment( ) + throw (::com::sun::star::uno::RuntimeException); + + virtual ::sal_Int32 SAL_CALL getDefaultSecurityEnvironmentIndex( ) + throw (::com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL setDefaultSecurityEnvironmentIndex( sal_Int32 nDefaultEnvIndex ) + throw (::com::sun::star::uno::RuntimeException); + +#if 0 + virtual void SAL_CALL setSecurityEnvironment( + const ::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XSecurityEnvironment >& aSecurityEnvironment + ) throw( com::sun::star::security::SecurityInfrastructureException) ; + + virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XSecurityEnvironment > SAL_CALL getSecurityEnvironment() + throw(::com::sun::star::uno::RuntimeException); +#endif + + //Methods from XInitialization + virtual void SAL_CALL initialize( + const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments + ) throw( ::com::sun::star::uno::Exception , ::com::sun::star::uno::RuntimeException ) ; + + //Methods from XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException ) ; + + virtual sal_Bool SAL_CALL supportsService( + const ::rtl::OUString& ServiceName + ) throw( ::com::sun::star::uno::RuntimeException ) ; + + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException ) ; + + //Helper for XServiceInfo + static ::com::sun::star::uno::Sequence< ::rtl::OUString > impl_getSupportedServiceNames() ; + + static ::rtl::OUString impl_getImplementationName() throw( ::com::sun::star::uno::RuntimeException ) ; + + //Helper for registry + static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL impl_createInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& aServiceManager ) throw( ::com::sun::star::uno::RuntimeException ) ; + + static ::com::sun::star::uno::Reference< ::com::sun::star::lang::XSingleServiceFactory > impl_createFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& aServiceManager ) ; + +#if 0 + //Methods from XUnoTunnel + virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) + throw (com::sun::star::uno::RuntimeException); + + static const ::com::sun::star::uno::Sequence< sal_Int8 >& getUnoTunnelId() ; + static XMLSecurityContext_MSCryptImpl* getImplementation( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > xObj ) ; +#endif + + //Native mehtods + //virtual xmlSecKeysMngrPtr keysManager() throw( ::com::sun::star::uno::Exception , ::com::sun::star::uno::RuntimeException ) ; +} ; + +#endif // _XMLSIGNATURECONTEXT_MSCRYPTIMPL_HXX_ + diff --git a/xmlsecurity/source/xmlsec/mscrypt/xmlsignature_mscryptimpl.cxx b/xmlsecurity/source/xmlsec/mscrypt/xmlsignature_mscryptimpl.cxx new file mode 100644 index 000000000000..80db62742f24 --- /dev/null +++ b/xmlsecurity/source/xmlsec/mscrypt/xmlsignature_mscryptimpl.cxx @@ -0,0 +1,334 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_xmlsecurity.hxx" +#include <sal/config.h> +#include <rtl/uuid.h> + +#include "com/sun/star/xml/crypto/SecurityOperationStatus.hdl" +#include "xmlsignature_mscryptimpl.hxx" + +#ifndef _XMLDOCUMENTWRAPPER_XMLSECIMPL_HXX_ +#include "xmldocumentwrapper_xmlsecimpl.hxx" +#endif + +#ifndef _XMLELEMENTWRAPPER_XMLSECIMPL_HXX_ +#include "xmlelementwrapper_xmlsecimpl.hxx" +#endif + +#ifndef _SECURITYENVIRONMENT_MSCRYPTIMPL_HXX_ +#include "securityenvironment_mscryptimpl.hxx" +#endif +#include "xmlstreamio.hxx" +#include "errorcallback.hxx" + +#include "xmlsec/xmlsec.h" +#include "xmlsec/xmldsig.h" +#include "xmlsec/crypto.h" + +using namespace ::com::sun::star::uno ; +using namespace ::com::sun::star::lang ; +using ::com::sun::star::lang::XMultiServiceFactory ; +using ::com::sun::star::lang::XSingleServiceFactory ; +using ::rtl::OUString ; + +using ::com::sun::star::xml::wrapper::XXMLElementWrapper ; +using ::com::sun::star::xml::wrapper::XXMLDocumentWrapper ; +using ::com::sun::star::xml::crypto::XSecurityEnvironment ; +using ::com::sun::star::xml::crypto::XXMLSignature ; +using ::com::sun::star::xml::crypto::XXMLSignatureTemplate ; +using ::com::sun::star::xml::crypto::XXMLSecurityContext ; +using ::com::sun::star::xml::crypto::XUriBinding ; +using ::com::sun::star::xml::crypto::XMLSignatureException ; + + +XMLSignature_MSCryptImpl :: XMLSignature_MSCryptImpl( const Reference< XMultiServiceFactory >& aFactory ) : m_xServiceManager( aFactory ) { +} + +XMLSignature_MSCryptImpl :: ~XMLSignature_MSCryptImpl() { +} + +/* XXMLSignature */ +Reference< XXMLSignatureTemplate > +SAL_CALL XMLSignature_MSCryptImpl :: generate( + const Reference< XXMLSignatureTemplate >& aTemplate , + const Reference< XSecurityEnvironment >& aEnvironment +) throw( com::sun::star::xml::crypto::XMLSignatureException, + com::sun::star::uno::SecurityException ) +{ + xmlSecKeysMngrPtr pMngr = NULL ; + xmlSecDSigCtxPtr pDsigCtx = NULL ; + xmlNodePtr pNode = NULL ; + + if( !aTemplate.is() ) + throw RuntimeException() ; + + if( !aEnvironment.is() ) + throw RuntimeException() ; + + //Get Keys Manager + Reference< XUnoTunnel > xSecTunnel( aEnvironment , UNO_QUERY ) ; + if( !xSecTunnel.is() ) { + throw RuntimeException() ; + } + + SecurityEnvironment_MSCryptImpl* pSecEnv = ( SecurityEnvironment_MSCryptImpl* )xSecTunnel->getSomething( SecurityEnvironment_MSCryptImpl::getUnoTunnelId() ) ; + if( pSecEnv == NULL ) + throw RuntimeException() ; + + //Get the xml node + Reference< XXMLElementWrapper > xElement = aTemplate->getTemplate() ; + if( !xElement.is() ) { + throw RuntimeException() ; + } + + Reference< XUnoTunnel > xNodTunnel( xElement , UNO_QUERY ) ; + if( !xNodTunnel.is() ) { + throw RuntimeException() ; + } + + XMLElementWrapper_XmlSecImpl* pElement = ( XMLElementWrapper_XmlSecImpl* )xNodTunnel->getSomething( XMLElementWrapper_XmlSecImpl::getUnoTunnelImplementationId() ) ; + if( pElement == NULL ) { + throw RuntimeException() ; + } + + pNode = pElement->getNativeElement() ; + + //Get the stream/URI binding + Reference< XUriBinding > xUriBinding = aTemplate->getBinding() ; + if( xUriBinding.is() ) { + //Register the stream input callbacks into libxml2 + if( xmlRegisterStreamInputCallbacks( xUriBinding ) < 0 ) + throw RuntimeException() ; + } + + setErrorRecorder( ); + + pMngr = pSecEnv->createKeysManager() ; //i39448 + if( !pMngr ) { + throw RuntimeException() ; + } + + //Create Signature context + pDsigCtx = xmlSecDSigCtxCreate( pMngr ) ; + if( pDsigCtx == NULL ) + { + //throw XMLSignatureException() ; + pSecEnv->destroyKeysManager( pMngr ) ; //i39448 + clearErrorRecorder(); + return aTemplate; + } + + //Sign the template + if( xmlSecDSigCtxSign( pDsigCtx , pNode ) == 0 ) + { + if (pDsigCtx->status == xmlSecDSigStatusSucceeded) + aTemplate->setStatus(com::sun::star::xml::crypto::SecurityOperationStatus_OPERATION_SUCCEEDED); + else + aTemplate->setStatus(com::sun::star::xml::crypto::SecurityOperationStatus_UNKNOWN); + } + else + { + aTemplate->setStatus(com::sun::star::xml::crypto::SecurityOperationStatus_UNKNOWN); + } + + + xmlSecDSigCtxDestroy( pDsigCtx ) ; + pSecEnv->destroyKeysManager( pMngr ) ; //i39448 + + //Unregistered the stream/URI binding + if( xUriBinding.is() ) + xmlUnregisterStreamInputCallbacks() ; + + clearErrorRecorder(); + return aTemplate ; +} + +/* XXMLSignature */ +Reference< XXMLSignatureTemplate > +SAL_CALL XMLSignature_MSCryptImpl :: validate( + const Reference< XXMLSignatureTemplate >& aTemplate , + const Reference< XXMLSecurityContext >& aSecurityCtx +) throw( com::sun::star::uno::RuntimeException, + com::sun::star::uno::SecurityException, + com::sun::star::xml::crypto::XMLSignatureException ) { + xmlSecKeysMngrPtr pMngr = NULL ; + xmlSecDSigCtxPtr pDsigCtx = NULL ; + xmlNodePtr pNode = NULL ; + //sal_Bool valid ; + + if( !aTemplate.is() ) + throw RuntimeException() ; + + if( !aSecurityCtx.is() ) + throw RuntimeException() ; + + //Get Keys Manager + Reference< XSecurityEnvironment > xSecEnv + = aSecurityCtx->getSecurityEnvironmentByIndex( + aSecurityCtx->getDefaultSecurityEnvironmentIndex()); + Reference< XUnoTunnel > xSecTunnel( xSecEnv , UNO_QUERY ) ; + if( !xSecTunnel.is() ) { + throw RuntimeException() ; + } + + SecurityEnvironment_MSCryptImpl* pSecEnv = ( SecurityEnvironment_MSCryptImpl* )xSecTunnel->getSomething( SecurityEnvironment_MSCryptImpl::getUnoTunnelId() ) ; + if( pSecEnv == NULL ) + throw RuntimeException() ; + + //Get the xml node + Reference< XXMLElementWrapper > xElement = aTemplate->getTemplate() ; + if( !xElement.is() ) + throw RuntimeException() ; + + Reference< XUnoTunnel > xNodTunnel( xElement , UNO_QUERY ) ; + if( !xNodTunnel.is() ) { + throw RuntimeException() ; + } + + XMLElementWrapper_XmlSecImpl* pElement = ( XMLElementWrapper_XmlSecImpl* )xNodTunnel->getSomething( XMLElementWrapper_XmlSecImpl::getUnoTunnelImplementationId() ) ; + if( pElement == NULL ) + throw RuntimeException() ; + + pNode = pElement->getNativeElement() ; + + //Get the stream/URI binding + Reference< XUriBinding > xUriBinding = aTemplate->getBinding() ; + if( xUriBinding.is() ) { + //Register the stream input callbacks into libxml2 + if( xmlRegisterStreamInputCallbacks( xUriBinding ) < 0 ) + throw RuntimeException() ; + } + + //added for test: save the result + /* + { + FILE *dstFile = fopen( "c:\\1.txt", "w" ) ; + xmlDocDump( dstFile, pNode->doc) ; + fclose( dstFile ) ; + } + */ + + setErrorRecorder( ); + + pMngr = pSecEnv->createKeysManager() ; //i39448 + if( !pMngr ) { + throw RuntimeException() ; + } + + //Create Signature context + pDsigCtx = xmlSecDSigCtxCreate( pMngr ) ; + if( pDsigCtx == NULL ) + { + pSecEnv->destroyKeysManager( pMngr ) ; //i39448 + //throw XMLSignatureException() ; + clearErrorRecorder(); + return aTemplate; + } + + //Verify signature + //The documentation says that the signature is only valid if the return value is 0 (that is, not < 0) + //AND pDsigCtx->status == xmlSecDSigStatusSucceeded. That is, we must not make any assumptions, if + //the return value is < 0. Then we must regard the signature as INVALID. We cannot use the + //error recorder feature to get the ONE error that made the verification fail, because there is no + //documentation/specification as to how to interpret the number of recorded errors and what is the initial + //error. + if( xmlSecDSigCtxVerify( pDsigCtx , pNode ) == 0 ) + { + if (pDsigCtx->status == xmlSecDSigStatusSucceeded) + aTemplate->setStatus(com::sun::star::xml::crypto::SecurityOperationStatus_OPERATION_SUCCEEDED); + else + aTemplate->setStatus(com::sun::star::xml::crypto::SecurityOperationStatus_UNKNOWN); + } + else + { + aTemplate->setStatus(com::sun::star::xml::crypto::SecurityOperationStatus_UNKNOWN); + } + + xmlSecDSigCtxDestroy( pDsigCtx ) ; + pSecEnv->destroyKeysManager( pMngr ) ; //i39448 + + //Unregistered the stream/URI binding + if( xUriBinding.is() ) + xmlUnregisterStreamInputCallbacks() ; + + + clearErrorRecorder(); + return aTemplate; +} + +/* XInitialization */ +void SAL_CALL XMLSignature_MSCryptImpl :: initialize( const Sequence< Any >& /*aArguments*/ ) throw( Exception, RuntimeException ) { + // TBD +} ; + +/* XServiceInfo */ +OUString SAL_CALL XMLSignature_MSCryptImpl :: getImplementationName() throw( RuntimeException ) { + return impl_getImplementationName() ; +} + +/* XServiceInfo */ +sal_Bool SAL_CALL XMLSignature_MSCryptImpl :: supportsService( const OUString& serviceName) throw( RuntimeException ) { + Sequence< OUString > seqServiceNames = getSupportedServiceNames() ; + const OUString* pArray = seqServiceNames.getConstArray() ; + for( sal_Int32 i = 0 ; i < seqServiceNames.getLength() ; i ++ ) { + if( *( pArray + i ) == serviceName ) + return sal_True ; + } + return sal_False ; +} + +/* XServiceInfo */ +Sequence< OUString > SAL_CALL XMLSignature_MSCryptImpl :: getSupportedServiceNames() throw( RuntimeException ) { + return impl_getSupportedServiceNames() ; +} + +//Helper for XServiceInfo +Sequence< OUString > XMLSignature_MSCryptImpl :: impl_getSupportedServiceNames() { + ::osl::Guard< ::osl::Mutex > aGuard( ::osl::Mutex::getGlobalMutex() ) ; + Sequence< OUString > seqServiceNames( 1 ) ; + seqServiceNames.getArray()[0] = OUString::createFromAscii( "com.sun.star.xml.crypto.XMLSignature" ) ; + return seqServiceNames ; +} + +OUString XMLSignature_MSCryptImpl :: impl_getImplementationName() throw( RuntimeException ) { + return OUString::createFromAscii( "com.sun.star.xml.security.bridge.xmlsec.XMLSignature_MSCryptImpl" ) ; +} + +//Helper for registry +Reference< XInterface > SAL_CALL XMLSignature_MSCryptImpl :: impl_createInstance( const Reference< XMultiServiceFactory >& aServiceManager ) throw( RuntimeException ) { + return Reference< XInterface >( *new XMLSignature_MSCryptImpl( aServiceManager ) ) ; +} + +Reference< XSingleServiceFactory > XMLSignature_MSCryptImpl :: impl_createFactory( const Reference< XMultiServiceFactory >& aServiceManager ) { + //Reference< XSingleServiceFactory > xFactory ; + //xFactory = ::cppu::createSingleFactory( aServiceManager , impl_getImplementationName , impl_createInstance , impl_getSupportedServiceNames ) ; + //return xFactory ; + return ::cppu::createSingleFactory( aServiceManager , impl_getImplementationName() , impl_createInstance , impl_getSupportedServiceNames() ) ; +} + diff --git a/xmlsecurity/source/xmlsec/mscrypt/xmlsignature_mscryptimpl.hxx b/xmlsecurity/source/xmlsec/mscrypt/xmlsignature_mscryptimpl.hxx new file mode 100644 index 000000000000..5f5178773221 --- /dev/null +++ b/xmlsecurity/source/xmlsec/mscrypt/xmlsignature_mscryptimpl.hxx @@ -0,0 +1,102 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _XMLSIGNATURE_MSCRYPTIMPL_HXX_ +#define _XMLSIGNATURE_MSCRYPTIMPL_HXX_ + +#include <sal/config.h> +#include <rtl/ustring.hxx> +#include <cppuhelper/factory.hxx> +#include <cppuhelper/implbase3.hxx> +#include <com/sun/star/uno/Exception.hpp> + +#ifndef _COM_SUN_STAR_UNO_REFERENCE_HPP_ +#include <com/sun/star/uno/Reference.hxx> +#endif +#include <com/sun/star/lang/XSingleServiceFactory.hpp> + +#ifndef _COM_SUN_STAR_LANG_XSECVICEINFO_HPP_ +#include <com/sun/star/lang/XServiceInfo.hpp> +#endif +#include <com/sun/star/lang/XInitialization.hpp> +#include <com/sun/star/xml/crypto/XXMLSignature.hpp> +#include <com/sun/star/xml/crypto/XXMLSignatureTemplate.hpp> +#include <com/sun/star/xml/crypto/XXMLSecurityContext.hpp> + +class XMLSignature_MSCryptImpl : public ::cppu::WeakImplHelper3< + ::com::sun::star::xml::crypto::XXMLSignature , + ::com::sun::star::lang::XInitialization , + ::com::sun::star::lang::XServiceInfo > +{ + private : + ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xServiceManager ; + + public : + XMLSignature_MSCryptImpl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& aFactory ) ; + virtual ~XMLSignature_MSCryptImpl() ; + + //Methods from XXMLSignature + virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XXMLSignatureTemplate > SAL_CALL generate( + const ::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XXMLSignatureTemplate >& aTemplate , + const ::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XSecurityEnvironment >& aEnvironment + ) throw( com::sun::star::xml::crypto::XMLSignatureException, + com::sun::star::uno::SecurityException) ; + + virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XXMLSignatureTemplate > SAL_CALL validate( + const ::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XXMLSignatureTemplate >& aTemplate , + const ::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XXMLSecurityContext >& aContext + ) throw( com::sun::star::uno::RuntimeException, + com::sun::star::uno::SecurityException, + com::sun::star::xml::crypto::XMLSignatureException); + + //Methods from XInitialization + virtual void SAL_CALL initialize( + const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments + ) throw( ::com::sun::star::uno::Exception , ::com::sun::star::uno::RuntimeException ) ; + + //Methods from XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException ) ; + + virtual sal_Bool SAL_CALL supportsService( + const ::rtl::OUString& ServiceName + ) throw( ::com::sun::star::uno::RuntimeException ) ; + + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException ) ; + + //Helper for XServiceInfo + static ::com::sun::star::uno::Sequence< ::rtl::OUString > impl_getSupportedServiceNames() ; + + static ::rtl::OUString impl_getImplementationName() throw( ::com::sun::star::uno::RuntimeException ) ; + + //Helper for registry + static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL impl_createInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& aServiceManager ) throw( ::com::sun::star::uno::RuntimeException ) ; + + static ::com::sun::star::uno::Reference< ::com::sun::star::lang::XSingleServiceFactory > impl_createFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& aServiceManager ) ; +} ; + +#endif // _XMLSIGNATURE_MSCRYPTIMPL_HXX_ + diff --git a/xmlsecurity/source/xmlsec/mscrypt/xsec_mscrypt.cxx b/xmlsecurity/source/xmlsec/mscrypt/xsec_mscrypt.cxx new file mode 100644 index 000000000000..87b7bf035cc5 --- /dev/null +++ b/xmlsecurity/source/xmlsec/mscrypt/xsec_mscrypt.cxx @@ -0,0 +1,164 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_xmlsecurity.hxx" + +#include <sal/config.h> +#include <stdio.h> + +#include <osl/mutex.hxx> +#include <osl/thread.h> +#include <cppuhelper/factory.hxx> +#include <com/sun/star/lang/XSingleServiceFactory.hpp> + +#include "seinitializer_mscryptimpl.hxx" +#include "xmlsignature_mscryptimpl.hxx" +#include "xmlencryption_mscryptimpl.hxx" +#include "xmlsecuritycontext_mscryptimpl.hxx" +#include "securityenvironment_mscryptimpl.hxx" + +using namespace ::rtl; +using namespace ::cppu; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::lang; +using namespace ::com::sun::star::registry; + +extern "C" +{ + +sal_Bool SAL_CALL mscrypt_component_writeInfo( void* /*pServiceManager*/ , void* pRegistryKey ) +{ + sal_Bool result = sal_False; + sal_Int32 i ; + OUString sKeyName ; + Reference< XRegistryKey > xNewKey ; + Sequence< OUString > seqServices ; + Reference< XRegistryKey > xKey( reinterpret_cast< XRegistryKey* >( pRegistryKey ) ) ; + + if( xKey.is() ) { + // try { + // XMLSignature_MSCryptImpl + sKeyName = OUString( RTL_CONSTASCII_USTRINGPARAM( "/" ) ) ; + sKeyName += XMLSignature_MSCryptImpl::impl_getImplementationName() ; + sKeyName += OUString::createFromAscii( "/UNO/SERVICES" ) ; + + xNewKey = xKey->createKey( sKeyName ) ; + if( xNewKey.is() ) { + seqServices = XMLSignature_MSCryptImpl::impl_getSupportedServiceNames() ; + for( i = seqServices.getLength() ; i -- ; ) + xNewKey->createKey( seqServices.getConstArray()[i] ) ; + } + + // XMLEncryption_MSCryptImpl + sKeyName = OUString( RTL_CONSTASCII_USTRINGPARAM( "/" ) ) ; + sKeyName += XMLEncryption_MSCryptImpl::impl_getImplementationName() ; + sKeyName += OUString::createFromAscii( "/UNO/SERVICES" ) ; + + xNewKey = xKey->createKey( sKeyName ) ; + if( xNewKey.is() ) { + seqServices = XMLEncryption_MSCryptImpl::impl_getSupportedServiceNames() ; + for( i = seqServices.getLength() ; i -- ; ) + xNewKey->createKey( seqServices.getConstArray()[i] ) ; + } + + // XMLSecurityContext_MSCryptImpl + sKeyName = OUString( RTL_CONSTASCII_USTRINGPARAM( "/" ) ) ; + sKeyName += XMLSecurityContext_MSCryptImpl::impl_getImplementationName() ; + sKeyName += OUString::createFromAscii( "/UNO/SERVICES" ) ; + + xNewKey = xKey->createKey( sKeyName ) ; + if( xNewKey.is() ) { + seqServices = XMLSecurityContext_MSCryptImpl::impl_getSupportedServiceNames() ; + for( i = seqServices.getLength() ; i -- ; ) + xNewKey->createKey( seqServices.getConstArray()[i] ) ; + } + + // SecurityEnvironment_MSCryptImpl + sKeyName = OUString( RTL_CONSTASCII_USTRINGPARAM( "/" ) ) ; + sKeyName += SecurityEnvironment_MSCryptImpl::impl_getImplementationName() ; + sKeyName += OUString::createFromAscii( "/UNO/SERVICES" ) ; + + xNewKey = xKey->createKey( sKeyName ) ; + if( xNewKey.is() ) { + seqServices = SecurityEnvironment_MSCryptImpl::impl_getSupportedServiceNames() ; + for( i = seqServices.getLength() ; i -- ; ) + xNewKey->createKey( seqServices.getConstArray()[i] ) ; + } + + // SEInitializer_MSCryptImpl + sKeyName = OUString( RTL_CONSTASCII_USTRINGPARAM( "/" ) ) ; + sKeyName += SEInitializer_MSCryptImpl_getImplementationName() ; + sKeyName += OUString::createFromAscii( "/UNO/SERVICES" ) ; + + xNewKey = xKey->createKey( sKeyName ) ; + if( xNewKey.is() ) { + seqServices = SEInitializer_MSCryptImpl_getSupportedServiceNames() ; + for( i = seqServices.getLength() ; i -- ; ) + xNewKey->createKey( seqServices.getConstArray()[i] ) ; + } + + return sal_True; + //} catch( InvalidRegistryException & ) { + // //we should not ignore exceptions + // return sal_False ; + //} + } + return result; +} + +void* SAL_CALL mscrypt_component_getFactory( const sal_Char* pImplName , void* pServiceManager , void* /*pRegistryKey*/ ) +{ + void* pRet = 0; + Reference< XSingleServiceFactory > xFactory ; + + if( pImplName != NULL && pServiceManager != NULL ) { + if( XMLSignature_MSCryptImpl::impl_getImplementationName().equals( OUString::createFromAscii( pImplName ) ) ) { + xFactory = XMLSignature_MSCryptImpl::impl_createFactory( reinterpret_cast< XMultiServiceFactory* >( pServiceManager ) ) ; + } else if( XMLSecurityContext_MSCryptImpl::impl_getImplementationName().equals( OUString::createFromAscii( pImplName ) ) ) { + xFactory = XMLSecurityContext_MSCryptImpl::impl_createFactory( reinterpret_cast< XMultiServiceFactory* >( pServiceManager ) ) ; + } else if( SecurityEnvironment_MSCryptImpl::impl_getImplementationName().equals( OUString::createFromAscii( pImplName ) ) ) { + xFactory = SecurityEnvironment_MSCryptImpl::impl_createFactory( reinterpret_cast< XMultiServiceFactory* >( pServiceManager ) ) ; + } else if( XMLEncryption_MSCryptImpl::impl_getImplementationName().equals( OUString::createFromAscii( pImplName ) ) ) { + xFactory = XMLEncryption_MSCryptImpl::impl_createFactory( reinterpret_cast< XMultiServiceFactory* >( pServiceManager ) ) ; + } else if( SEInitializer_MSCryptImpl_getImplementationName().equals( OUString::createFromAscii( pImplName ) ) ) { + xFactory = Reference< XSingleServiceFactory >( createSingleFactory( + reinterpret_cast< XMultiServiceFactory * >( pServiceManager ), + OUString::createFromAscii( pImplName ), + SEInitializer_MSCryptImpl_createInstance, SEInitializer_MSCryptImpl_getSupportedServiceNames() ) ); + } + } + + if( xFactory.is() ) { + xFactory->acquire() ; + pRet = xFactory.get() ; + } + + return pRet ; +} + +} diff --git a/xmlsecurity/source/xmlsec/nss/certerrors.h b/xmlsecurity/source/xmlsec/nss/certerrors.h new file mode 100644 index 000000000000..9b9801f21f59 --- /dev/null +++ b/xmlsecurity/source/xmlsec/nss/certerrors.h @@ -0,0 +1,384 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: securityenvironment_nssimpl.cxx,v $ + * $Revision: 1.23 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + + +{SEC_ERROR_IO, "An I/O error occurred during security authorization."}, + +{SEC_ERROR_LIBRARY_FAILURE, "security library failure."}, + +{SEC_ERROR_BAD_DATA, "security library: received bad data."}, + +{SEC_ERROR_OUTPUT_LEN, "security library: output length error."}, + +{SEC_ERROR_INPUT_LEN, "security library has experienced an input length error."}, + +{SEC_ERROR_INVALID_ARGS, "security library: invalid arguments."}, + +{SEC_ERROR_INVALID_ALGORITHM, "security library: invalid algorithm."}, + +{SEC_ERROR_INVALID_AVA, "security library: invalid AVA."}, + +{SEC_ERROR_INVALID_TIME, "Improperly formatted time string."}, + +{SEC_ERROR_BAD_DER, "security library: improperly formatted DER-encoded message."}, + +{SEC_ERROR_BAD_SIGNATURE, "Peer's certificate has an invalid signature."}, + +{SEC_ERROR_EXPIRED_CERTIFICATE, "Peer's Certificate has expired."}, + +{SEC_ERROR_REVOKED_CERTIFICATE, "Peer's Certificate has been revoked."}, + +{SEC_ERROR_UNKNOWN_ISSUER, "Peer's Certificate issuer is not recognized."}, + +{SEC_ERROR_BAD_KEY, "Peer's public key is invalid."}, + +{SEC_ERROR_BAD_PASSWORD, "The security password entered is incorrect."}, + +{SEC_ERROR_RETRY_PASSWORD, "New password entered incorrectly. Please try again."}, + +{SEC_ERROR_NO_NODELOCK, "security library: no nodelock."}, + +{SEC_ERROR_BAD_DATABASE, "security library: bad database."}, + +{SEC_ERROR_NO_MEMORY, "security library: memory allocation failure."}, + +{SEC_ERROR_UNTRUSTED_ISSUER, "Peer's certificate issuer has been marked as not trusted by the user."}, + +{SEC_ERROR_UNTRUSTED_CERT, "Peer's certificate has been marked as not trusted by the user."}, + +{SEC_ERROR_DUPLICATE_CERT, "Certificate already exists in your database."}, + +{SEC_ERROR_DUPLICATE_CERT_NAME, "Downloaded certificate's name duplicates one already in your database."}, + +{SEC_ERROR_ADDING_CERT, "Error adding certificate to database."}, + +{SEC_ERROR_FILING_KEY, "Error refiling the key for this certificate."}, + +{SEC_ERROR_NO_KEY, "The private key for this certificate cannot be found in key database"}, + +{SEC_ERROR_CERT_VALID, "This certificate is valid."}, + +{SEC_ERROR_CERT_NOT_VALID, "This certificate is not valid."}, + +{SEC_ERROR_CERT_NO_RESPONSE, "Cert Library: No Response"}, + +{SEC_ERROR_EXPIRED_ISSUER_CERTIFICATE, "The certificate issuer's certificate has expired. Check your system date and time."}, + +{SEC_ERROR_CRL_EXPIRED, "The CRL for the certificate's issuer has expired. Update it or check your system date and time."}, + +{SEC_ERROR_CRL_BAD_SIGNATURE, "The CRL for the certificate's issuer has an invalid signature."}, + +{SEC_ERROR_CRL_INVALID, "New CRL has an invalid format."}, + +{SEC_ERROR_EXTENSION_VALUE_INVALID, "Certificate extension value is invalid."}, + +{SEC_ERROR_EXTENSION_NOT_FOUND, "Certificate extension not found."}, + +{SEC_ERROR_CA_CERT_INVALID, "Issuer certificate is invalid."}, + +{SEC_ERROR_PATH_LEN_CONSTRAINT_INVALID, "Certificate path length constraint is invalid."}, + +{SEC_ERROR_CERT_USAGES_INVALID, "Certificate usages field is invalid."}, + +{SEC_INTERNAL_ONLY, "**Internal ONLY module**"}, + +{SEC_ERROR_INVALID_KEY, "The key does not support the requested operation."}, + +{SEC_ERROR_UNKNOWN_CRITICAL_EXTENSION, "Certificate contains unknown critical extension."}, + +{SEC_ERROR_OLD_CRL, "New CRL is not later than the current one."}, + +{SEC_ERROR_NO_EMAIL_CERT, "Not encrypted or signed: you do not yet have an email certificate."}, + +{SEC_ERROR_NO_RECIPIENT_CERTS_QUERY, "Not encrypted: you do not have certificates for each of the recipients."}, + +{SEC_ERROR_NOT_A_RECIPIENT, "Cannot decrypt: you are not a recipient, or matching certificate and \ +private key not found."}, + +{SEC_ERROR_PKCS7_KEYALG_MISMATCH, "Cannot decrypt: key encryption algorithm does not match your certificate."}, + +{SEC_ERROR_PKCS7_BAD_SIGNATURE, "Signature verification failed: no signer found, too many signers found, \ +or improper or corrupted data."}, + +{SEC_ERROR_UNSUPPORTED_KEYALG, "Unsupported or unknown key algorithm."}, + +{SEC_ERROR_DECRYPTION_DISALLOWED, "Cannot decrypt: encrypted using a disallowed algorithm or key size."}, + + +/* Fortezza Alerts */ +{XP_SEC_FORTEZZA_BAD_CARD, "Fortezza card has not been properly initialized. \ +Please remove it and return it to your issuer."}, + +{XP_SEC_FORTEZZA_NO_CARD, "No Fortezza cards Found"}, + +{XP_SEC_FORTEZZA_NONE_SELECTED, "No Fortezza card selected"}, + +{XP_SEC_FORTEZZA_MORE_INFO, "Please select a personality to get more info on"}, + +{XP_SEC_FORTEZZA_PERSON_NOT_FOUND, "Personality not found"}, + +{XP_SEC_FORTEZZA_NO_MORE_INFO, "No more information on that Personality"}, + +{XP_SEC_FORTEZZA_BAD_PIN, "Invalid Pin"}, + +{XP_SEC_FORTEZZA_PERSON_ERROR, "Couldn't initialize Fortezza personalities."}, +/* end fortezza alerts. */ + +{SEC_ERROR_NO_KRL, "No KRL for this site's certificate has been found."}, + +{SEC_ERROR_KRL_EXPIRED, "The KRL for this site's certificate has expired."}, + +{SEC_ERROR_KRL_BAD_SIGNATURE, "The KRL for this site's certificate has an invalid signature."}, + +{SEC_ERROR_REVOKED_KEY, "The key for this site's certificate has been revoked."}, + +{SEC_ERROR_KRL_INVALID, "New KRL has an invalid format."}, + +{SEC_ERROR_NEED_RANDOM, "security library: need random data."}, + +{SEC_ERROR_NO_MODULE, "security library: no security module can perform the requested operation."}, + +{SEC_ERROR_NO_TOKEN, "The security card or token does not exist, needs to be initialized, or has been removed."}, + +{SEC_ERROR_READ_ONLY, "security library: read-only database."}, + +{SEC_ERROR_NO_SLOT_SELECTED, "No slot or token was selected."}, + +{SEC_ERROR_CERT_NICKNAME_COLLISION, "A certificate with the same nickname already exists."}, + +{SEC_ERROR_KEY_NICKNAME_COLLISION, "A key with the same nickname already exists."}, + +{SEC_ERROR_SAFE_NOT_CREATED, "error while creating safe object"}, + +{SEC_ERROR_BAGGAGE_NOT_CREATED, "error while creating baggage object"}, + +{XP_JAVA_REMOVE_PRINCIPAL_ERROR, "Couldn't remove the principal"}, + +{XP_JAVA_DELETE_PRIVILEGE_ERROR, "Couldn't delete the privilege"}, + +{XP_JAVA_CERT_NOT_EXISTS_ERROR, "This principal doesn't have a certificate"}, + +{SEC_ERROR_BAD_EXPORT_ALGORITHM, "Required algorithm is not allowed."}, + +{SEC_ERROR_EXPORTING_CERTIFICATES, "Error attempting to export certificates."}, + +{SEC_ERROR_IMPORTING_CERTIFICATES, "Error attempting to import certificates."}, + +{SEC_ERROR_PKCS12_DECODING_PFX, "Unable to import. Decoding error. File not valid."}, + +{SEC_ERROR_PKCS12_INVALID_MAC, "Unable to import. Invalid MAC. Incorrect password or corrupt file."}, + +{SEC_ERROR_PKCS12_UNSUPPORTED_MAC_ALGORITHM, "Unable to import. MAC algorithm not supported."}, + +{SEC_ERROR_PKCS12_UNSUPPORTED_TRANSPORT_MODE, "Unable to import. Only password integrity and privacy modes supported."}, + +{SEC_ERROR_PKCS12_CORRUPT_PFX_STRUCTURE, "Unable to import. File structure is corrupt."}, + +{SEC_ERROR_PKCS12_UNSUPPORTED_PBE_ALGORITHM, "Unable to import. Encryption algorithm not supported."}, + +{SEC_ERROR_PKCS12_UNSUPPORTED_VERSION, "Unable to import. File version not supported."}, + +{SEC_ERROR_PKCS12_PRIVACY_PASSWORD_INCORRECT, "Unable to import. Incorrect privacy password."}, + +{SEC_ERROR_PKCS12_CERT_COLLISION, "Unable to import. Same nickname already exists in database."}, + +{SEC_ERROR_USER_CANCELLED, "The user pressed cancel."}, + +{SEC_ERROR_PKCS12_DUPLICATE_DATA, "Not imported, already in database."}, + +{SEC_ERROR_MESSAGE_SEND_ABORTED, "Message not sent."}, + +{SEC_ERROR_INADEQUATE_KEY_USAGE, "Certificate key usage inadequate for attempted operation."}, + +{SEC_ERROR_INADEQUATE_CERT_TYPE, "Certificate type not approved for application."}, + +{SEC_ERROR_CERT_ADDR_MISMATCH, "Address in signing certificate does not match address in message headers."}, + +{SEC_ERROR_PKCS12_UNABLE_TO_IMPORT_KEY, "Unable to import. Error attempting to import private key."}, + +{SEC_ERROR_PKCS12_IMPORTING_CERT_CHAIN, "Unable to import. Error attempting to import certificate chain."}, + +{SEC_ERROR_PKCS12_UNABLE_TO_LOCATE_OBJECT_BY_NAME, "Unable to export. Unable to locate certificate or key by nickname."}, + +{SEC_ERROR_PKCS12_UNABLE_TO_EXPORT_KEY, "Unable to export. Private Key could not be located and exported."}, + +{SEC_ERROR_PKCS12_UNABLE_TO_WRITE, "Unable to export. Unable to write the export file."}, + +{SEC_ERROR_PKCS12_UNABLE_TO_READ, "Unable to import. Unable to read the import file."}, + +{SEC_ERROR_PKCS12_KEY_DATABASE_NOT_INITIALIZED, "Unable to export. Key database corrupt or deleted."}, + +{SEC_ERROR_KEYGEN_FAIL, "Unable to generate public/private key pair."}, + +{SEC_ERROR_INVALID_PASSWORD, "Password entered is invalid. Please pick a different one."}, + +{SEC_ERROR_RETRY_OLD_PASSWORD, "Old password entered incorrectly. Please try again."}, + +{SEC_ERROR_BAD_NICKNAME, "Certificate nickname already in use."}, + +{SEC_ERROR_NOT_FORTEZZA_ISSUER, "Peer FORTEZZA chain has a non-FORTEZZA Certificate."}, + +{SEC_ERROR_CANNOT_MOVE_SENSITIVE_KEY, "A sensitive key cannot be moved to the slot where it is needed."}, + +{SEC_ERROR_JS_INVALID_MODULE_NAME, "Invalid module name."}, + +{SEC_ERROR_JS_INVALID_DLL, "Invalid module path/filename"}, + +{SEC_ERROR_JS_ADD_MOD_FAILURE, "Unable to add module"}, + +{SEC_ERROR_JS_DEL_MOD_FAILURE, "Unable to delete module"}, + +{SEC_ERROR_OLD_KRL, "New KRL is not later than the current one."}, + +{SEC_ERROR_CKL_CONFLICT, "New CKL has different issuer than current CKL. Delete current CKL."}, + +{SEC_ERROR_CERT_NOT_IN_NAME_SPACE, "The Certifying Authority for this certificate is not permitted to issue a \ +certificate with this name."}, + +{SEC_ERROR_KRL_NOT_YET_VALID, "The key revocation list for this certificate is not yet valid."}, + +{SEC_ERROR_CRL_NOT_YET_VALID, "The certificate revocation list for this certificate is not yet valid."}, + +{SEC_ERROR_UNKNOWN_CERT, "The requested certificate could not be found."}, + +{SEC_ERROR_UNKNOWN_SIGNER, "The signer's certificate could not be found."}, + +{SEC_ERROR_CERT_BAD_ACCESS_LOCATION, "The location for the certificate status server has invalid format."}, + +{SEC_ERROR_OCSP_UNKNOWN_RESPONSE_TYPE, "The OCSP response cannot be fully decoded; it is of an unknown type."}, + +{SEC_ERROR_OCSP_BAD_HTTP_RESPONSE, "The OCSP server returned unexpected/invalid HTTP data."}, + +{SEC_ERROR_OCSP_MALFORMED_REQUEST, "The OCSP server found the request to be corrupted or improperly formed."}, + +{SEC_ERROR_OCSP_SERVER_ERROR, "The OCSP server experienced an internal error."}, + +{SEC_ERROR_OCSP_TRY_SERVER_LATER, "The OCSP server suggests trying again later."}, + +{SEC_ERROR_OCSP_REQUEST_NEEDS_SIG, "The OCSP server requires a signature on this request."}, + +{SEC_ERROR_OCSP_UNAUTHORIZED_REQUEST, "The OCSP server has refused this request as unauthorized."}, + +{SEC_ERROR_OCSP_UNKNOWN_RESPONSE_STATUS, "The OCSP server returned an unrecognizable status."}, + +{SEC_ERROR_OCSP_UNKNOWN_CERT, "The OCSP server has no status for the certificate."}, + +{SEC_ERROR_OCSP_NOT_ENABLED, "You must enable OCSP before performing this operation."}, + +{SEC_ERROR_OCSP_NO_DEFAULT_RESPONDER, "You must set the OCSP default responder before performing this operation."}, + +{SEC_ERROR_OCSP_MALFORMED_RESPONSE, "The response from the OCSP server was corrupted or improperly formed."}, + +{SEC_ERROR_OCSP_UNAUTHORIZED_RESPONSE, "The signer of the OCSP response is not authorized to give status for \ +this certificate."}, + +{SEC_ERROR_OCSP_FUTURE_RESPONSE, "The OCSP response is not yet valid (contains a date in the future},."}, + +{SEC_ERROR_OCSP_OLD_RESPONSE, "The OCSP response contains out-of-date information."}, + +{SEC_ERROR_DIGEST_NOT_FOUND, "The CMS or PKCS #7 Digest was not found in signed message."}, + +{SEC_ERROR_UNSUPPORTED_MESSAGE_TYPE, "The CMS or PKCS #7 Message type is unsupported."}, + +{SEC_ERROR_MODULE_STUCK, "PKCS #11 module could not be removed because it is still in use."}, + +{SEC_ERROR_BAD_TEMPLATE, "Could not decode ASN.1 data. Specified template was invalid."}, + +{SEC_ERROR_CRL_NOT_FOUND, "No matching CRL was found."}, + +{SEC_ERROR_REUSED_ISSUER_AND_SERIAL, "You are attempting to import a cert with the same issuer/serial as \ +an existing cert, but that is not the same cert."}, + +{SEC_ERROR_BUSY, "NSS could not shutdown. Objects are still in use."}, + +{SEC_ERROR_EXTRA_INPUT, "DER-encoded message contained extra unused data."}, + +{SEC_ERROR_UNSUPPORTED_ELLIPTIC_CURVE, "Unsupported elliptic curve."}, + +{SEC_ERROR_UNSUPPORTED_EC_POINT_FORM, "Unsupported elliptic curve point form."}, + +{SEC_ERROR_UNRECOGNIZED_OID, "Unrecognized Object Identifier."}, + +{SEC_ERROR_OCSP_INVALID_SIGNING_CERT, "Invalid OCSP signing certificate in OCSP response."}, + +{SEC_ERROR_REVOKED_CERTIFICATE_CRL, "Certificate is revoked in issuer's certificate revocation list."}, + +{SEC_ERROR_REVOKED_CERTIFICATE_OCSP, "Issuer's OCSP responder reports certificate is revoked."}, + +{SEC_ERROR_CRL_INVALID_VERSION, "Issuer's Certificate Revocation List has an unknown version number."}, + +{SEC_ERROR_CRL_V1_CRITICAL_EXTENSION, "Issuer's V1 Certificate Revocation List has a critical extension."}, + +{SEC_ERROR_CRL_UNKNOWN_CRITICAL_EXTENSION, "Issuer's V2 Certificate Revocation List has an unknown critical extension."}, + +{SEC_ERROR_UNKNOWN_OBJECT_TYPE, "Unknown object type specified."}, + +{SEC_ERROR_INCOMPATIBLE_PKCS11, "PKCS #11 driver violates the spec in an incompatible way."}, + +{SEC_ERROR_NO_EVENT, "No new slot event is available at this time."}, + +{SEC_ERROR_CRL_ALREADY_EXISTS, "CRL already exists."}, + +{SEC_ERROR_NOT_INITIALIZED, "NSS is not initialized."}, + +{SEC_ERROR_TOKEN_NOT_LOGGED_IN, "The operation failed because the PKCS#11 token is not logged in."}, + +{SEC_ERROR_OCSP_RESPONDER_CERT_INVALID, "Configured OCSP responder's certificate is invalid."}, + +{SEC_ERROR_OCSP_BAD_SIGNATURE, "OCSP response has an invalid signature."}, + +{SEC_ERROR_OUT_OF_SEARCH_LIMITS, "Cert validation search is out of search limits"}, + +{SEC_ERROR_INVALID_POLICY_MAPPING, "Policy mapping contains anypolicy"}, + +{SEC_ERROR_POLICY_VALIDATION_FAILED, "Cert chain fails policy validation"}, + +{SEC_ERROR_UNKNOWN_AIA_LOCATION_TYPE, "Unknown location type in cert AIA extension"}, + +{SEC_ERROR_BAD_HTTP_RESPONSE, "Server returned bad HTTP response"}, + +{SEC_ERROR_BAD_LDAP_RESPONSE, "Server returned bad LDAP response"}, + +{SEC_ERROR_FAILED_TO_ENCODE_DATA, "Failed to encode data with ASN1 encoder"}, + +{SEC_ERROR_BAD_INFO_ACCESS_LOCATION, "Bad information access location in cert extension"}, + +{SEC_ERROR_LIBPKIX_INTERNAL, "Libpkix internal error occured during cert validation."}, + +{SEC_ERROR_PKCS11_GENERAL_ERROR, "A PKCS #11 module returned CKR_GENERAL_ERROR, indicating that an unrecoverable error has occurred."}, + +{SEC_ERROR_PKCS11_FUNCTION_FAILED, "A PKCS #11 module returned CKR_FUNCTION_FAILED, indicating that the requested function could not be performed. Trying the same operation again might succeed."}, + +{SEC_ERROR_PKCS11_DEVICE_ERROR, "A PKCS #11 module returned CKR_DEVICE_ERROR, indicating that a problem has occurred with the token or slot."}, + +{SEC_ERROR_BAD_INFO_ACCESS_METHOD, "Unknown information access method in certificate extension."}, + +{SEC_ERROR_CRL_IMPORT_FAILED, "Error attempting to import a CRL."}, + diff --git a/xmlsecurity/source/xmlsec/nss/makefile.mk b/xmlsecurity/source/xmlsec/nss/makefile.mk new file mode 100644 index 000000000000..227b6de88477 --- /dev/null +++ b/xmlsecurity/source/xmlsec/nss/makefile.mk @@ -0,0 +1,142 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2000, 2010 Oracle and/or its affiliates. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# This file is part of OpenOffice.org. +# +# OpenOffice.org is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License version 3 +# only, as published by the Free Software Foundation. +# +# OpenOffice.org is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License version 3 for more details +# (a copy is included in the LICENSE file that accompanied this code). +# +# You should have received a copy of the GNU Lesser General Public License +# version 3 along with OpenOffice.org. If not, see +# <http://www.openoffice.org/license.html> +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +PRJ=..$/..$/.. + +PRJNAME = xmlsecurity +TARGET = xs_nss + +ENABLE_EXCEPTIONS = TRUE + +# --- Settings ----------------------------------------------------- + +.INCLUDE : settings.mk +.INCLUDE : $(PRJ)$/util$/target.pmk + +.IF "$(SYSTEM_LIBXML)" == "YES" +CFLAGS+=-DSYSTEM_LIBXML $(LIBXML_CFLAGS) +.ENDIF + +.IF "$(CRYPTO_ENGINE)" != "nss" +LIBTARGET=NO +.ENDIF + +.IF "$(CRYPTO_ENGINE)" == "nss" + +.IF "$(WITH_MOZILLA)" == "NO" || "$(ENABLE_NSS_MODULE)"!="YES" +.IF "$(SYSTEM_MOZILLA)" != "YES" +@all: + @echo "No mozilla -> no nss -> no libxmlsec -> no xmlsecurity/nss" +.ENDIF +.ENDIF + +.IF "$(SYSTEM_MOZILLA)" != "YES" +MOZ_INC = $(SOLARVERSION)$/$(INPATH)$/inc$(UPDMINOREXT)$/mozilla +NSS_INC = $(MOZ_INC)$/nss +NSPR_INC = $(MOZ_INC)$/nspr +.ELSE +# MOZ_INC already defined from environment +NSS_INC = $(MOZ_NSS_CFLAGS) +NSPR_INC = $(MOZ_INC)$/nspr +.ENDIF + +.IF "$(GUI)"=="UNX" +.IF "$(COMNAME)"=="sunpro5" +CFLAGS += -features=tmplife +#This flag is needed to build mozilla 1.7 code +.ENDIF # "$(COMNAME)"=="sunpro5" +.ENDIF + +.IF "$(GUI)" == "WNT" +.IF "$(DBG_LEVEL)" == "0" +INCPRE += \ +-I$(MOZ_INC)$/profile \ +-I$(MOZ_INC)$/string \ +-I$(MOZ_INC)$/embed_base +CFLAGS += -GR- -W3 -Gy -MD -UDEBUG +.ELSE +INCPRE += \ +-I$(MOZ_INC)$/profile \ +-I$(MOZ_INC)$/string \ +-I$(MOZ_INC)$/embed_base +CFLAGS += -Zi -GR- -W3 -Gy -MDd -UNDEBUG +.ENDIF +.ENDIF +.IF "$(GUI)" == "UNX" +INCPOST += \ +$(MOZ_INC)$/profile \ +-I$(MOZ_INC)$/string \ +-I$(MOZ_INC)$/embed_base +#.IF "$(OS)" == "LINUX" +#CFLAGS += -fPIC -g +#CFLAGSCXX += \ +# -fno-rtti -Wall -Wconversion -Wpointer-arith \ +# -Wbad-function-cast -Wcast-align -Woverloaded-virtual -Wsynth \ +# -Wno-long-long -pthread +#CDEFS += -DTRACING +#.ELIF "$(OS)" == "NETBSD" +#CFLAGS += -fPIC +#CFLAGSCXX += \ +# -fno-rtti -Wall -Wconversion -Wpointer-arith \ +# -Wbad-function-cast -Wcast-align -Woverloaded-virtual -Wsynth \ +# -Wno-long-long +#CDEFS += -DTRACING +#.ENDIF +.ENDIF + +CDEFS += -DXMLSEC_CRYPTO_NSS -DXMLSEC_NO_XSLT + +# --- Files -------------------------------------------------------- + +SOLARINC += \ + -I$(MOZ_INC) \ +-I$(NSPR_INC) \ +-I$(PRJ)$/source$/xmlsec + +.IF "$(SYSTEM_MOZILLA)" == "YES" +SOLARINC += -DSYSTEM_MOZILLA $(NSS_INC) +.ELSE +SOLARINC += -I$(NSS_INC) +.ENDIF + +SLOFILES = \ + $(SLO)$/securityenvironment_nssimpl.obj \ + $(SLO)$/xmlencryption_nssimpl.obj \ + $(SLO)$/xmlsecuritycontext_nssimpl.obj \ + $(SLO)$/xmlsignature_nssimpl.obj \ + $(SLO)$/x509certificate_nssimpl.obj \ + $(SLO)$/seinitializer_nssimpl.obj \ + $(SLO)$/xsec_nss.obj \ + $(SLO)$/secerror.obj + + + +.ENDIF + +# --- Targets ------------------------------------------------------ + +.INCLUDE : target.mk diff --git a/xmlsecurity/source/xmlsec/nss/nssrenam.h b/xmlsecurity/source/xmlsec/nss/nssrenam.h new file mode 100644 index 000000000000..1742e1492d35 --- /dev/null +++ b/xmlsecurity/source/xmlsec/nss/nssrenam.h @@ -0,0 +1,49 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is the Netscape security libraries. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 2001 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU General Public License Version 2 or later (the + * "GPL"), in which case the provisions of the GPL are applicable + * instead of those above. If you wish to allow use of your + * version of this file only under the terms of the GPL and not to + * allow others to use your version of this file under the MPL, + * indicate your decision by deleting the provisions above and + * replace them with the notice and other provisions required by + * the GPL. If you do not delete the provisions above, a recipient + * may use your version of this file under either the MPL or the + * GPL. + */ + +#ifndef __nssrenam_h_ +#define __nssrenam_h_ + +#define CERT_NewTempCertificate __CERT_NewTempCertificate +#define PK11_CreateContextByRawKey __PK11_CreateContextByRawKey +#define PK11_GetKeyData __PK11_GetKeyData +#define nss_InitLock __nss_InitLock +#define CERT_ClosePermCertDB __CERT_ClosePermCertDB +#define CERT_DecodeDERCertificate __CERT_DecodeDERCertificate +#define CERT_TraversePermCertsForNickname __CERT_TraversePermCertsForNickname +#define CERT_TraversePermCertsForSubject __CERT_TraversePermCertsForSubject +#define PBE_CreateContext __PBE_CreateContext +#define PBE_DestroyContext __PBE_DestroyContext +#define PBE_GenerateBits __PBE_GenerateBits + +#endif /* __nssrenam_h_ */ diff --git a/xmlsecurity/source/xmlsec/nss/secerror.cxx b/xmlsecurity/source/xmlsec/nss/secerror.cxx new file mode 100644 index 000000000000..4a9ee3622bc4 --- /dev/null +++ b/xmlsecurity/source/xmlsec/nss/secerror.cxx @@ -0,0 +1,165 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: securityenvironment_nssimpl.cxx,v $ + * $Revision: 1.23 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + + +#include "secerr.h" +#include "sslerr.h" +#include "nspr.h" +#include "certt.h" + +#include "../diagnose.hxx" + +using namespace xmlsecurity; + +struct ErrDesc { + PRErrorCode errNum; + const char * errString; +}; + + + +const ErrDesc allDesc[] = { + +#include "certerrors.h" + +}; + + + +/* Returns a UTF-8 encoded constant error string for "errNum". + * Returns NULL of errNum is unknown. + */ +const char * +getCertError(PRErrorCode errNum) +{ + static char sEmpty[] = ""; + const int numDesc = sizeof(allDesc) / sizeof(ErrDesc); + for (int i = 0; i < numDesc; i++) + { + if (allDesc[i].errNum == errNum) + return allDesc[i].errString; + } + + return sEmpty; +} + +void +printChainFailure(CERTVerifyLog *log) +{ + unsigned long errorFlags = 0; + unsigned int depth = (unsigned int)-1; + const char * specificError = NULL; + const char * issuer = NULL; + CERTVerifyLogNode *node = NULL; + + if (log->count > 0) + { + xmlsec_trace("Bad certifcation path:"); + for (node = log->head; node; node = node->next) + { + if (depth != node->depth) + { + depth = node->depth; + xmlsec_trace("Certificate: %d. %s %s:", depth, + node->cert->subjectName, + depth ? "[Certificate Authority]": ""); + } + xmlsec_trace(" ERROR %ld: %s", node->error, + getCertError(node->error)); + specificError = NULL; + issuer = NULL; + switch (node->error) + { + case SEC_ERROR_INADEQUATE_KEY_USAGE: + errorFlags = (unsigned long)node->arg; + switch (errorFlags) + { + case KU_DIGITAL_SIGNATURE: + specificError = "Certificate cannot sign."; + break; + case KU_KEY_ENCIPHERMENT: + specificError = "Certificate cannot encrypt."; + break; + case KU_KEY_CERT_SIGN: + specificError = "Certificate cannot sign other certs."; + break; + default: + specificError = "[unknown usage]."; + break; + } + case SEC_ERROR_INADEQUATE_CERT_TYPE: + errorFlags = (unsigned long)node->arg; + switch (errorFlags) + { + case NS_CERT_TYPE_SSL_CLIENT: + case NS_CERT_TYPE_SSL_SERVER: + specificError = "Certificate cannot be used for SSL."; + break; + case NS_CERT_TYPE_SSL_CA: + specificError = "Certificate cannot be used as an SSL CA."; + break; + case NS_CERT_TYPE_EMAIL: + specificError = "Certificate cannot be used for SMIME."; + break; + case NS_CERT_TYPE_EMAIL_CA: + specificError = "Certificate cannot be used as an SMIME CA."; + break; + case NS_CERT_TYPE_OBJECT_SIGNING: + specificError = "Certificate cannot be used for object signing."; + break; + case NS_CERT_TYPE_OBJECT_SIGNING_CA: + specificError = "Certificate cannot be used as an object signing CA."; + break; + default: + specificError = "[unknown usage]."; + break; + } + case SEC_ERROR_UNKNOWN_ISSUER: + specificError = "Unknown issuer:"; + issuer = node->cert->issuerName; + break; + case SEC_ERROR_UNTRUSTED_ISSUER: + specificError = "Untrusted issuer:"; + issuer = node->cert->issuerName; + break; + case SEC_ERROR_EXPIRED_ISSUER_CERTIFICATE: + specificError = "Expired issuer certificate:"; + issuer = node->cert->issuerName; + break; + default: + break; + } + if (specificError) + xmlsec_trace("%s", specificError); + if (issuer) + xmlsec_trace("%s", issuer); + } + } +} diff --git a/xmlsecurity/source/xmlsec/nss/secerror.hxx b/xmlsecurity/source/xmlsec/nss/secerror.hxx new file mode 100644 index 000000000000..732fef5fd03e --- /dev/null +++ b/xmlsecurity/source/xmlsec/nss/secerror.hxx @@ -0,0 +1,40 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: securityenvironment_nssimpl.hxx,v $ + * $Revision: 1.9 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _XSECERROR_HXX_ +#define _XSECERROR_HXX_ + +const char * +getCertError(PRErrorCode errNum); + +void +printChainFailure(CERTVerifyLog *log); +#endif // _XSECERROR_HXX_ + diff --git a/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx b/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx new file mode 100644 index 000000000000..f004d0195f88 --- /dev/null +++ b/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx @@ -0,0 +1,1148 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_xmlsecurity.hxx" + +//todo before commit: nssrenam.h is not delivered!!! +#include "nssrenam.h" +#include "cert.h" +#include "secerr.h" +#include "ocsp.h" + +#include <sal/config.h> +#include "securityenvironment_nssimpl.hxx" +#include "x509certificate_nssimpl.hxx" +#include <rtl/uuid.h> +#include "../diagnose.hxx" + +#include <sal/types.h> +//For reasons that escape me, this is what xmlsec does when size_t is not 4 +#if SAL_TYPES_SIZEOFPOINTER != 4 +# define XMLSEC_NO_SIZE_T +#endif +#include <xmlsec/xmlsec.h> +#include <xmlsec/keysmngr.h> +#include <xmlsec/crypto.h> +#include <xmlsec/base64.h> +#include <xmlsec/strings.h> + +#include <tools/string.hxx> +#include <rtl/ustrbuf.hxx> +#include <comphelper/processfactory.hxx> +#include <cppuhelper/servicefactory.hxx> +#include <comphelper/docpasswordrequest.hxx> +#include <xmlsecurity/biginteger.hxx> +#include <rtl/logfile.h> +#include <com/sun/star/task/XInteractionHandler.hpp> +#include <vector> +#include "boost/scoped_array.hpp" + +#include "secerror.hxx" + +// MM : added for password exception +#include <com/sun/star/security/NoPasswordException.hpp> +namespace csss = ::com::sun::star::security; +using namespace xmlsecurity; +using namespace ::com::sun::star::security; +using namespace com::sun::star; +using namespace ::com::sun::star::uno ; +using namespace ::com::sun::star::lang ; +using ::com::sun::star::lang::XMultiServiceFactory ; +using ::com::sun::star::lang::XSingleServiceFactory ; +using ::rtl::OUString ; + +using ::com::sun::star::xml::crypto::XSecurityEnvironment ; +using ::com::sun::star::security::XCertificate ; + +extern X509Certificate_NssImpl* NssCertToXCert( CERTCertificate* cert ) ; +extern X509Certificate_NssImpl* NssPrivKeyToXCert( SECKEYPrivateKey* ) ; + + +struct UsageDescription +{ + SECCertificateUsage usage; + char const * const description; +}; + + + +char* GetPasswordFunction( PK11SlotInfo* pSlot, PRBool bRetry, void* /*arg*/ ) +{ + uno::Reference< lang::XMultiServiceFactory > xMSF( ::comphelper::getProcessServiceFactory() ); + if ( xMSF.is() ) + { + uno::Reference < task::XInteractionHandler > xInteractionHandler( + xMSF->createInstance( rtl::OUString::createFromAscii("com.sun.star.task.InteractionHandler") ), uno::UNO_QUERY ); + + if ( xInteractionHandler.is() ) + { + task::PasswordRequestMode eMode = bRetry ? task::PasswordRequestMode_PASSWORD_REENTER : task::PasswordRequestMode_PASSWORD_ENTER; + ::comphelper::DocPasswordRequest* pPasswordRequest = new ::comphelper::DocPasswordRequest( + ::comphelper::DocPasswordRequestType_STANDARD, eMode, ::rtl::OUString::createFromAscii(PK11_GetTokenName(pSlot)) ); + + uno::Reference< task::XInteractionRequest > xRequest( pPasswordRequest ); + xInteractionHandler->handle( xRequest ); + + if ( pPasswordRequest->isPassword() ) + { + ByteString aPassword = ByteString( String( pPasswordRequest->getPassword() ), gsl_getSystemTextEncoding() ); + sal_uInt16 nLen = aPassword.Len(); + char* pPassword = (char*) PORT_Alloc( nLen+1 ) ; + pPassword[nLen] = 0; + memcpy( pPassword, aPassword.GetBuffer(), nLen ); + return pPassword; + } + } + } + return NULL; +} + +SecurityEnvironment_NssImpl :: SecurityEnvironment_NssImpl( const Reference< XMultiServiceFactory >& ) : +m_pHandler( NULL ) , m_tSymKeyList() , m_tPubKeyList() , m_tPriKeyList() { + + PK11_SetPasswordFunc( GetPasswordFunction ) ; +} + +SecurityEnvironment_NssImpl :: ~SecurityEnvironment_NssImpl() { + + PK11_SetPasswordFunc( NULL ) ; + + for (CIT_SLOTS i = m_Slots.begin(); i != m_Slots.end(); i++) + { + PK11_FreeSlot(*i); + } + + if( !m_tSymKeyList.empty() ) { + std::list< PK11SymKey* >::iterator symKeyIt ; + + for( symKeyIt = m_tSymKeyList.begin() ; symKeyIt != m_tSymKeyList.end() ; symKeyIt ++ ) + PK11_FreeSymKey( *symKeyIt ) ; + } + + if( !m_tPubKeyList.empty() ) { + std::list< SECKEYPublicKey* >::iterator pubKeyIt ; + + for( pubKeyIt = m_tPubKeyList.begin() ; pubKeyIt != m_tPubKeyList.end() ; pubKeyIt ++ ) + SECKEY_DestroyPublicKey( *pubKeyIt ) ; + } + + if( !m_tPriKeyList.empty() ) { + std::list< SECKEYPrivateKey* >::iterator priKeyIt ; + + for( priKeyIt = m_tPriKeyList.begin() ; priKeyIt != m_tPriKeyList.end() ; priKeyIt ++ ) + SECKEY_DestroyPrivateKey( *priKeyIt ) ; + } +} + +/* XInitialization */ +void SAL_CALL SecurityEnvironment_NssImpl :: initialize( const Sequence< Any >& ) throw( Exception, RuntimeException ) { + // TBD +} ; + +/* XServiceInfo */ +OUString SAL_CALL SecurityEnvironment_NssImpl :: getImplementationName() throw( RuntimeException ) { + return impl_getImplementationName() ; +} + +/* XServiceInfo */ +sal_Bool SAL_CALL SecurityEnvironment_NssImpl :: supportsService( const OUString& serviceName) throw( RuntimeException ) { + Sequence< OUString > seqServiceNames = getSupportedServiceNames() ; + const OUString* pArray = seqServiceNames.getConstArray() ; + for( sal_Int32 i = 0 ; i < seqServiceNames.getLength() ; i ++ ) { + if( *( pArray + i ) == serviceName ) + return sal_True ; + } + return sal_False ; +} + +/* XServiceInfo */ +Sequence< OUString > SAL_CALL SecurityEnvironment_NssImpl :: getSupportedServiceNames() throw( RuntimeException ) { + return impl_getSupportedServiceNames() ; +} + +//Helper for XServiceInfo +Sequence< OUString > SecurityEnvironment_NssImpl :: impl_getSupportedServiceNames() { + ::osl::Guard< ::osl::Mutex > aGuard( ::osl::Mutex::getGlobalMutex() ) ; + Sequence< OUString > seqServiceNames( 1 ) ; + seqServiceNames.getArray()[0] = OUString::createFromAscii( "com.sun.star.xml.crypto.SecurityEnvironment" ) ; + return seqServiceNames ; +} + +OUString SecurityEnvironment_NssImpl :: impl_getImplementationName() throw( RuntimeException ) { + return OUString::createFromAscii( "com.sun.star.xml.security.bridge.xmlsec.SecurityEnvironment_NssImpl" ) ; +} + +//Helper for registry +Reference< XInterface > SAL_CALL SecurityEnvironment_NssImpl :: impl_createInstance( const Reference< XMultiServiceFactory >& aServiceManager ) throw( RuntimeException ) { + return Reference< XInterface >( *new SecurityEnvironment_NssImpl( aServiceManager ) ) ; +} + +Reference< XSingleServiceFactory > SecurityEnvironment_NssImpl :: impl_createFactory( const Reference< XMultiServiceFactory >& aServiceManager ) { + //Reference< XSingleServiceFactory > xFactory ; + //xFactory = ::cppu::createSingleFactory( aServiceManager , impl_getImplementationName , impl_createInstance , impl_getSupportedServiceNames ) ; + //return xFactory ; + return ::cppu::createSingleFactory( aServiceManager , impl_getImplementationName() , impl_createInstance , impl_getSupportedServiceNames() ) ; +} + +/* XUnoTunnel */ +sal_Int64 SAL_CALL SecurityEnvironment_NssImpl :: getSomething( const Sequence< sal_Int8 >& aIdentifier ) + throw( RuntimeException ) +{ + if( aIdentifier.getLength() == 16 && 0 == rtl_compareMemory( getUnoTunnelId().getConstArray(), aIdentifier.getConstArray(), 16 ) ) { + return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_uIntPtr>(this)); + } + return 0 ; +} + +/* XUnoTunnel extension */ +const Sequence< sal_Int8>& SecurityEnvironment_NssImpl :: getUnoTunnelId() { + static Sequence< sal_Int8 >* pSeq = 0 ; + if( !pSeq ) { + ::osl::Guard< ::osl::Mutex > aGuard( ::osl::Mutex::getGlobalMutex() ) ; + if( !pSeq ) { + static Sequence< sal_Int8> aSeq( 16 ) ; + rtl_createUuid( ( sal_uInt8* )aSeq.getArray() , 0 , sal_True ) ; + pSeq = &aSeq ; + } + } + return *pSeq ; +} + +/* XUnoTunnel extension */ +SecurityEnvironment_NssImpl* SecurityEnvironment_NssImpl :: getImplementation( const Reference< XInterface > xObj ) { + Reference< XUnoTunnel > xUT( xObj , UNO_QUERY ) ; + if( xUT.is() ) { + return reinterpret_cast<SecurityEnvironment_NssImpl*>( + sal::static_int_cast<sal_uIntPtr>(xUT->getSomething( getUnoTunnelId() ))) ; + } else + return NULL ; +} + + +::rtl::OUString SecurityEnvironment_NssImpl::getSecurityEnvironmentInformation() throw( ::com::sun::star::uno::RuntimeException ) +{ + rtl::OUString result; + ::rtl::OUStringBuffer buff; + for (CIT_SLOTS is = m_Slots.begin(); is != m_Slots.end(); is++) + { + buff.append(rtl::OUString::createFromAscii(PK11_GetTokenName(*is))); + buff.appendAscii("\n"); + } + return buff.makeStringAndClear(); +} + +void SecurityEnvironment_NssImpl::addCryptoSlot( PK11SlotInfo* aSlot) throw( Exception , RuntimeException ) +{ + PK11_ReferenceSlot(aSlot); + m_Slots.push_back(aSlot); +} + +CERTCertDBHandle* SecurityEnvironment_NssImpl :: getCertDb() throw( Exception , RuntimeException ) { + return m_pHandler ; +} + +//Could we have multiple cert dbs? +void SecurityEnvironment_NssImpl :: setCertDb( CERTCertDBHandle* aCertDb ) throw( Exception , RuntimeException ) { + m_pHandler = aCertDb ; +} + +void SecurityEnvironment_NssImpl :: adoptSymKey( PK11SymKey* aSymKey ) throw( Exception , RuntimeException ) { + PK11SymKey* symkey ; + std::list< PK11SymKey* >::iterator keyIt ; + + if( aSymKey != NULL ) { + //First try to find the key in the list + for( keyIt = m_tSymKeyList.begin() ; keyIt != m_tSymKeyList.end() ; keyIt ++ ) { + if( *keyIt == aSymKey ) + return ; + } + + //If we do not find the key in the list, add a new node + symkey = PK11_ReferenceSymKey( aSymKey ) ; + if( symkey == NULL ) + throw RuntimeException() ; + + try { + m_tSymKeyList.push_back( symkey ) ; + } catch ( Exception& ) { + PK11_FreeSymKey( symkey ) ; + } + } +} + +void SecurityEnvironment_NssImpl :: rejectSymKey( PK11SymKey* aSymKey ) throw( Exception , RuntimeException ) { + PK11SymKey* symkey ; + std::list< PK11SymKey* >::iterator keyIt ; + + if( aSymKey != NULL ) { + for( keyIt = m_tSymKeyList.begin() ; keyIt != m_tSymKeyList.end() ; keyIt ++ ) { + if( *keyIt == aSymKey ) { + symkey = *keyIt ; + PK11_FreeSymKey( symkey ) ; + m_tSymKeyList.erase( keyIt ) ; + break ; + } + } + } +} + +PK11SymKey* SecurityEnvironment_NssImpl :: getSymKey( unsigned int position ) throw( Exception , RuntimeException ) { + PK11SymKey* symkey ; + std::list< PK11SymKey* >::iterator keyIt ; + unsigned int pos ; + + symkey = NULL ; + for( pos = 0, keyIt = m_tSymKeyList.begin() ; pos < position && keyIt != m_tSymKeyList.end() ; pos ++ , keyIt ++ ) ; + + if( pos == position && keyIt != m_tSymKeyList.end() ) + symkey = *keyIt ; + + return symkey ; +} + +void SecurityEnvironment_NssImpl :: adoptPubKey( SECKEYPublicKey* aPubKey ) throw( Exception , RuntimeException ) { + SECKEYPublicKey* pubkey ; + std::list< SECKEYPublicKey* >::iterator keyIt ; + + if( aPubKey != NULL ) { + //First try to find the key in the list + for( keyIt = m_tPubKeyList.begin() ; keyIt != m_tPubKeyList.end() ; keyIt ++ ) { + if( *keyIt == aPubKey ) + return ; + } + + //If we do not find the key in the list, add a new node + pubkey = SECKEY_CopyPublicKey( aPubKey ) ; + if( pubkey == NULL ) + throw RuntimeException() ; + + try { + m_tPubKeyList.push_back( pubkey ) ; + } catch ( Exception& ) { + SECKEY_DestroyPublicKey( pubkey ) ; + } + } +} + +void SecurityEnvironment_NssImpl :: rejectPubKey( SECKEYPublicKey* aPubKey ) throw( Exception , RuntimeException ) { + SECKEYPublicKey* pubkey ; + std::list< SECKEYPublicKey* >::iterator keyIt ; + + if( aPubKey != NULL ) { + for( keyIt = m_tPubKeyList.begin() ; keyIt != m_tPubKeyList.end() ; keyIt ++ ) { + if( *keyIt == aPubKey ) { + pubkey = *keyIt ; + SECKEY_DestroyPublicKey( pubkey ) ; + m_tPubKeyList.erase( keyIt ) ; + break ; + } + } + } +} + +SECKEYPublicKey* SecurityEnvironment_NssImpl :: getPubKey( unsigned int position ) throw( Exception , RuntimeException ) { + SECKEYPublicKey* pubkey ; + std::list< SECKEYPublicKey* >::iterator keyIt ; + unsigned int pos ; + + pubkey = NULL ; + for( pos = 0, keyIt = m_tPubKeyList.begin() ; pos < position && keyIt != m_tPubKeyList.end() ; pos ++ , keyIt ++ ) ; + + if( pos == position && keyIt != m_tPubKeyList.end() ) + pubkey = *keyIt ; + + return pubkey ; +} + +void SecurityEnvironment_NssImpl :: adoptPriKey( SECKEYPrivateKey* aPriKey ) throw( Exception , RuntimeException ) { + SECKEYPrivateKey* prikey ; + std::list< SECKEYPrivateKey* >::iterator keyIt ; + + if( aPriKey != NULL ) { + //First try to find the key in the list + for( keyIt = m_tPriKeyList.begin() ; keyIt != m_tPriKeyList.end() ; keyIt ++ ) { + if( *keyIt == aPriKey ) + return ; + } + + //If we do not find the key in the list, add a new node + prikey = SECKEY_CopyPrivateKey( aPriKey ) ; + if( prikey == NULL ) + throw RuntimeException() ; + + try { + m_tPriKeyList.push_back( prikey ) ; + } catch ( Exception& ) { + SECKEY_DestroyPrivateKey( prikey ) ; + } + } +} + +void SecurityEnvironment_NssImpl :: rejectPriKey( SECKEYPrivateKey* aPriKey ) throw( Exception , RuntimeException ) { + SECKEYPrivateKey* prikey ; + std::list< SECKEYPrivateKey* >::iterator keyIt ; + + if( aPriKey != NULL ) { + for( keyIt = m_tPriKeyList.begin() ; keyIt != m_tPriKeyList.end() ; keyIt ++ ) { + if( *keyIt == aPriKey ) { + prikey = *keyIt ; + SECKEY_DestroyPrivateKey( prikey ) ; + m_tPriKeyList.erase( keyIt ) ; + break ; + } + } + } +} + +SECKEYPrivateKey* SecurityEnvironment_NssImpl :: getPriKey( unsigned int position ) throw( ::com::sun::star::uno::Exception , ::com::sun::star::uno::RuntimeException ) { + SECKEYPrivateKey* prikey ; + std::list< SECKEYPrivateKey* >::iterator keyIt ; + unsigned int pos ; + + prikey = NULL ; + for( pos = 0, keyIt = m_tPriKeyList.begin() ; pos < position && keyIt != m_tPriKeyList.end() ; pos ++ , keyIt ++ ) ; + + if( pos == position && keyIt != m_tPriKeyList.end() ) + prikey = *keyIt ; + + return prikey ; +} + +void SecurityEnvironment_NssImpl::updateSlots() +{ + //In case new tokens are present then we can obtain the corresponding slot + PK11SlotList * soltList = NULL; + PK11SlotListElement * soltEle = NULL; + PK11SlotInfo * pSlot = NULL; + PK11SymKey * pSymKey = NULL; + + osl::MutexGuard guard(m_mutex); + + m_Slots.clear(); + m_tSymKeyList.clear(); + + soltList = PK11_GetAllTokens( CKM_INVALID_MECHANISM, PR_FALSE, PR_FALSE, NULL ) ; + if( soltList != NULL ) + { + for( soltEle = soltList->head ; soltEle != NULL; soltEle = soltEle->next ) + { + pSlot = soltEle->slot ; + + if(pSlot != NULL) + { + RTL_LOGFILE_TRACE2( "XMLSEC: Found a slot: SlotName=%s, TokenName=%s", PK11_GetSlotName(pSlot), PK11_GetTokenName(pSlot) ); + +//The following code which is commented out checks if a slot, that is a smart card for example, is +// able to generate a symmetric key of type CKM_DES3_CBC. If this fails then this token +// will not be used. This key is possibly used for the encryption service. However, all +// interfaces and services used for public key signature and encryption are not published +// and the encryption is not used in OOo. Therefore it does not do any harm to remove +// this code, hence allowing smart cards which cannot generate this type of key. +// +// By doing this, the encryption may fail if a smart card is being used which does not +// support this key generation. +// + pSymKey = PK11_KeyGen( pSlot , CKM_DES3_CBC, NULL, 128, NULL ) ; +// if( pSymKey == NULL ) +// { +// PK11_FreeSlot( pSlot ) ; +// RTL_LOGFILE_TRACE( "XMLSEC: Error - pSymKey is NULL" ); +// continue; +// } + addCryptoSlot(pSlot); + PK11_FreeSlot( pSlot ) ; + pSlot = NULL; + + if (pSymKey != NULL) + { + adoptSymKey( pSymKey ) ; + PK11_FreeSymKey( pSymKey ) ; + pSymKey = NULL; + } + + }// end of if(pSlot != NULL) + }// end of for + }// end of if( soltList != NULL ) + +} + + +Sequence< Reference < XCertificate > > +SecurityEnvironment_NssImpl::getPersonalCertificates() throw( SecurityException , RuntimeException ) +{ + sal_Int32 length ; + X509Certificate_NssImpl* xcert ; + std::list< X509Certificate_NssImpl* > certsList ; + + updateSlots(); + //firstly, we try to find private keys in slot + for (CIT_SLOTS is = m_Slots.begin(); is != m_Slots.end(); is++) + { + PK11SlotInfo *slot = *is; + SECKEYPrivateKeyList* priKeyList ; + SECKEYPrivateKeyListNode* curPri ; + + if( PK11_NeedLogin(slot ) ) { + SECStatus nRet = PK11_Authenticate(slot, PR_TRUE, NULL); + //PK11_Authenticate may fail in case the a slot has not been initialized. + //this is the case if the user has a new profile, so that they have never + //added a personal certificate. + if( nRet != SECSuccess && PORT_GetError() != SEC_ERROR_IO) { + throw NoPasswordException(); + } + } + + priKeyList = PK11_ListPrivateKeysInSlot(slot) ; + if( priKeyList != NULL ) { + for( curPri = PRIVKEY_LIST_HEAD( priKeyList ); + !PRIVKEY_LIST_END( curPri, priKeyList ) && curPri != NULL ; + curPri = PRIVKEY_LIST_NEXT( curPri ) ) { + xcert = NssPrivKeyToXCert( curPri->key ) ; + if( xcert != NULL ) + certsList.push_back( xcert ) ; + } + } + + SECKEY_DestroyPrivateKeyList( priKeyList ) ; + } + + //secondly, we try to find certificate from registered private keys. + if( !m_tPriKeyList.empty() ) { + std::list< SECKEYPrivateKey* >::iterator priKeyIt ; + + for( priKeyIt = m_tPriKeyList.begin() ; priKeyIt != m_tPriKeyList.end() ; priKeyIt ++ ) { + xcert = NssPrivKeyToXCert( *priKeyIt ) ; + if( xcert != NULL ) + certsList.push_back( xcert ) ; + } + } + + length = certsList.size() ; + if( length != 0 ) { + int i ; + std::list< X509Certificate_NssImpl* >::iterator xcertIt ; + Sequence< Reference< XCertificate > > certSeq( length ) ; + + for( i = 0, xcertIt = certsList.begin(); xcertIt != certsList.end(); xcertIt ++, i++ ) { + certSeq[i] = *xcertIt ; + } + + return certSeq ; + } + + return Sequence< Reference < XCertificate > > (); +} + +Reference< XCertificate > SecurityEnvironment_NssImpl :: getCertificate( const OUString& issuerName, const Sequence< sal_Int8 >& serialNumber ) throw( SecurityException , RuntimeException ) +{ + X509Certificate_NssImpl* xcert = NULL; + + if( m_pHandler != NULL ) { + CERTIssuerAndSN issuerAndSN ; + CERTCertificate* cert ; + CERTName* nmIssuer ; + char* chIssuer ; + SECItem* derIssuer ; + PRArenaPool* arena ; + + arena = PORT_NewArena( DER_DEFAULT_CHUNKSIZE ) ; + if( arena == NULL ) + throw RuntimeException() ; + + /* + * mmi : because MS Crypto use the 'S' tag (equal to the 'ST' tag in NSS), but the NSS can't recognise + * it, so the 'S' tag should be changed to 'ST' tag + * + * PS : it can work, but inside libxmlsec, the 'S' tag is till used to find cert in NSS engine, so it + * is not useful at all. (comment out now) + */ + + /* + sal_Int32 nIndex = 0; + OUString newIssuerName; + do + { + OUString aToken = issuerName.getToken( 0, ',', nIndex ).trim(); + if (aToken.compareToAscii("S=",2) == 0) + { + newIssuerName+=OUString::createFromAscii("ST="); + newIssuerName+=aToken.copy(2); + } + else + { + newIssuerName+=aToken; + } + + if (nIndex >= 0) + { + newIssuerName+=OUString::createFromAscii(","); + } + } while ( nIndex >= 0 ); + */ + + /* end */ + + //Create cert info from issue and serial + rtl::OString ostr = rtl::OUStringToOString( issuerName , RTL_TEXTENCODING_UTF8 ) ; + chIssuer = PL_strndup( ( char* )ostr.getStr(), ( int )ostr.getLength() ) ; + nmIssuer = CERT_AsciiToName( chIssuer ) ; + if( nmIssuer == NULL ) { + PL_strfree( chIssuer ) ; + PORT_FreeArena( arena, PR_FALSE ) ; + + /* + * i40394 + * + * mmi : no need to throw exception + * just return "no found" + */ + //throw RuntimeException() ; + return NULL; + } + + derIssuer = SEC_ASN1EncodeItem( arena, NULL, ( void* )nmIssuer, SEC_ASN1_GET( CERT_NameTemplate ) ) ; + if( derIssuer == NULL ) { + PL_strfree( chIssuer ) ; + CERT_DestroyName( nmIssuer ) ; + PORT_FreeArena( arena, PR_FALSE ) ; + throw RuntimeException() ; + } + + memset( &issuerAndSN, 0, sizeof( issuerAndSN ) ) ; + + issuerAndSN.derIssuer.data = derIssuer->data ; + issuerAndSN.derIssuer.len = derIssuer->len ; + + issuerAndSN.serialNumber.data = ( unsigned char* )&serialNumber[0] ; + issuerAndSN.serialNumber.len = serialNumber.getLength() ; + + cert = CERT_FindCertByIssuerAndSN( m_pHandler, &issuerAndSN ) ; + if( cert != NULL ) { + xcert = NssCertToXCert( cert ) ; + } else { + xcert = NULL ; + } + + PL_strfree( chIssuer ) ; + CERT_DestroyName( nmIssuer ) ; + //SECITEM_FreeItem( derIssuer, PR_FALSE ) ; + CERT_DestroyCertificate( cert ) ; + PORT_FreeArena( arena, PR_FALSE ) ; + } else { + xcert = NULL ; + } + + return xcert ; +} + +Reference< XCertificate > SecurityEnvironment_NssImpl :: getCertificate( const OUString& issuerName, const OUString& serialNumber ) throw( SecurityException , RuntimeException ) { + Sequence< sal_Int8 > serial = numericStringToBigInteger( serialNumber ) ; + return getCertificate( issuerName, serial ) ; +} + +Sequence< Reference < XCertificate > > SecurityEnvironment_NssImpl :: buildCertificatePath( const Reference< XCertificate >& begin ) throw( SecurityException , RuntimeException ) { + const X509Certificate_NssImpl* xcert ; + const CERTCertificate* cert ; + CERTCertList* certChain ; + + Reference< XUnoTunnel > xCertTunnel( begin, UNO_QUERY ) ; + if( !xCertTunnel.is() ) { + throw RuntimeException() ; + } + + xcert = reinterpret_cast<X509Certificate_NssImpl*>( + sal::static_int_cast<sal_uIntPtr>(xCertTunnel->getSomething( X509Certificate_NssImpl::getUnoTunnelId() ))) ; + if( xcert == NULL ) { + throw RuntimeException() ; + } + + cert = xcert->getNssCert() ; + if( cert != NULL ) { + int64 timeboundary ; + + //Get the system clock time + timeboundary = PR_Now() ; + + certChain = CERT_GetCertChainFromCert( ( CERTCertificate* )cert, timeboundary, certUsageAnyCA ) ; + } else { + certChain = NULL ; + } + + if( certChain != NULL ) { + X509Certificate_NssImpl* pCert ; + CERTCertListNode* node ; + int len ; + + for( len = 0, node = CERT_LIST_HEAD( certChain ); !CERT_LIST_END( node, certChain ); node = CERT_LIST_NEXT( node ), len ++ ) ; + Sequence< Reference< XCertificate > > xCertChain( len ) ; + + for( len = 0, node = CERT_LIST_HEAD( certChain ); !CERT_LIST_END( node, certChain ); node = CERT_LIST_NEXT( node ), len ++ ) { + pCert = new X509Certificate_NssImpl() ; + if( pCert == NULL ) { + CERT_DestroyCertList( certChain ) ; + throw RuntimeException() ; + } + + pCert->setCert( node->cert ) ; + + xCertChain[len] = pCert ; + } + + CERT_DestroyCertList( certChain ) ; + + return xCertChain ; + } + + return Sequence< Reference < XCertificate > >(); +} + +Reference< XCertificate > SecurityEnvironment_NssImpl :: createCertificateFromRaw( const Sequence< sal_Int8 >& rawCertificate ) throw( SecurityException , RuntimeException ) { + X509Certificate_NssImpl* xcert ; + + if( rawCertificate.getLength() > 0 ) { + xcert = new X509Certificate_NssImpl() ; + if( xcert == NULL ) + throw RuntimeException() ; + + xcert->setRawCert( rawCertificate ) ; + } else { + xcert = NULL ; + } + + return xcert ; +} + +Reference< XCertificate > SecurityEnvironment_NssImpl :: createCertificateFromAscii( const OUString& asciiCertificate ) throw( SecurityException , RuntimeException ) { + xmlChar* chCert ; + xmlSecSize certSize ; + + rtl::OString oscert = rtl::OUStringToOString( asciiCertificate , RTL_TEXTENCODING_ASCII_US ) ; + + chCert = xmlStrndup( ( const xmlChar* )oscert.getStr(), ( int )oscert.getLength() ) ; + + certSize = xmlSecBase64Decode( chCert, ( xmlSecByte* )chCert, xmlStrlen( chCert ) ) ; + + Sequence< sal_Int8 > rawCert( certSize ) ; + for( unsigned int i = 0 ; i < certSize ; i ++ ) + rawCert[i] = *( chCert + i ) ; + + xmlFree( chCert ) ; + + return createCertificateFromRaw( rawCert ) ; +} + +sal_Int32 SecurityEnvironment_NssImpl :: +verifyCertificate( const Reference< csss::XCertificate >& aCert, + const Sequence< Reference< csss::XCertificate > >& intermediateCerts ) + throw( ::com::sun::star::uno::SecurityException, ::com::sun::star::uno::RuntimeException ) +{ + sal_Int32 validity = csss::CertificateValidity::INVALID; + const X509Certificate_NssImpl* xcert ; + const CERTCertificate* cert ; + ::std::vector<CERTCertificate*> vecTmpNSSCertificates; + Reference< XUnoTunnel > xCertTunnel( aCert, UNO_QUERY ) ; + if( !xCertTunnel.is() ) { + throw RuntimeException() ; + } + + xmlsec_trace("Start verification of certificate: \n %s \n", + OUStringToOString( + aCert->getSubjectName(), osl_getThreadTextEncoding()).getStr()); + + xcert = reinterpret_cast<X509Certificate_NssImpl*>( + sal::static_int_cast<sal_uIntPtr>(xCertTunnel->getSomething( X509Certificate_NssImpl::getUnoTunnelId() ))) ; + if( xcert == NULL ) { + throw RuntimeException() ; + } + + //CERT_PKIXVerifyCert does not take a db as argument. It will therefore + //internally use CERT_GetDefaultCertDB + //Make sure m_pHandler is the default DB + OSL_ASSERT(m_pHandler == CERT_GetDefaultCertDB()); + CERTCertDBHandle * certDb = m_pHandler != NULL ? m_pHandler : CERT_GetDefaultCertDB(); + cert = xcert->getNssCert() ; + if( cert != NULL ) + { + + //prepare the intermediate certificates + for (sal_Int32 i = 0; i < intermediateCerts.getLength(); i++) + { + Sequence<sal_Int8> der = intermediateCerts[i]->getEncoded(); + SECItem item; + item.type = siBuffer; + item.data = (unsigned char*)der.getArray(); + item.len = der.getLength(); + + CERTCertificate* certTmp = CERT_NewTempCertificate(certDb, &item, + NULL /* nickname */, + PR_FALSE /* isPerm */, + PR_TRUE /* copyDER */); + if (!certTmp) + { + xmlsec_trace("Failed to add a temporary certificate: %s", + OUStringToOString(intermediateCerts[i]->getIssuerName(), + osl_getThreadTextEncoding()).getStr()); + + } + else + { + xmlsec_trace("Added temporary certificate: %s", + certTmp->subjectName ? certTmp->subjectName : ""); + vecTmpNSSCertificates.push_back(certTmp); + } + } + + + SECStatus status ; + + CERTVerifyLog log; + log.arena = PORT_NewArena(512); + log.head = log.tail = NULL; + log.count = 0; + + CERT_EnableOCSPChecking(certDb); + CERT_DisableOCSPDefaultResponder(certDb); + CERTValOutParam cvout[5]; + CERTValInParam cvin[3]; + + cvin[0].type = cert_pi_useAIACertFetch; + cvin[0].value.scalar.b = PR_TRUE; + + PRUint64 revFlagsLeaf[2]; + PRUint64 revFlagsChain[2]; + CERTRevocationFlags rev; + rev.leafTests.number_of_defined_methods = 2; + rev.leafTests.cert_rev_flags_per_method = revFlagsLeaf; + //the flags are defined in cert.h + //We check both leaf and chain. + //It is enough if one revocation method has fresh info, + //but at least one must have some. Otherwise validation fails. + //!!! using leaf test and CERT_REV_MI_REQUIRE_SOME_FRESH_INFO_AVAILABLE + // when validating a root certificate will result in "revoked". Usually + //there is no revocation information available for the root cert because + //it must be trusted anyway and it does itself issue revocation information. + //When we use the flag here and OOo shows the certification path then the root + //cert is invalid while all other can be valid. It would probably best if + //this interface method returned the whole chain. + //Otherwise we need to check if the certificate is self-signed and if it is + //then not use the flag when doing the leaf-test. + rev.leafTests.cert_rev_flags_per_method[cert_revocation_method_crl] = + CERT_REV_M_TEST_USING_THIS_METHOD + | CERT_REV_M_IGNORE_IMPLICIT_DEFAULT_SOURCE; + rev.leafTests.cert_rev_flags_per_method[cert_revocation_method_ocsp] = + CERT_REV_M_TEST_USING_THIS_METHOD + | CERT_REV_M_IGNORE_IMPLICIT_DEFAULT_SOURCE; + rev.leafTests.number_of_preferred_methods = 0; + rev.leafTests.preferred_methods = NULL; + rev.leafTests.cert_rev_method_independent_flags = + CERT_REV_MI_TEST_ALL_LOCAL_INFORMATION_FIRST; +// | CERT_REV_MI_REQUIRE_SOME_FRESH_INFO_AVAILABLE; + + rev.chainTests.number_of_defined_methods = 2; + rev.chainTests.cert_rev_flags_per_method = revFlagsChain; + rev.chainTests.cert_rev_flags_per_method[cert_revocation_method_crl] = + CERT_REV_M_TEST_USING_THIS_METHOD + | CERT_REV_M_IGNORE_IMPLICIT_DEFAULT_SOURCE; + rev.chainTests.cert_rev_flags_per_method[cert_revocation_method_ocsp] = + CERT_REV_M_TEST_USING_THIS_METHOD + | CERT_REV_M_IGNORE_IMPLICIT_DEFAULT_SOURCE; + rev.chainTests.number_of_preferred_methods = 0; + rev.chainTests.preferred_methods = NULL; + rev.chainTests.cert_rev_method_independent_flags = + CERT_REV_MI_TEST_ALL_LOCAL_INFORMATION_FIRST; +// | CERT_REV_MI_REQUIRE_SOME_FRESH_INFO_AVAILABLE; + + + cvin[1].type = cert_pi_revocationFlags; + cvin[1].value.pointer.revocation = &rev; + // does not work, not implemented yet in 3.12.4 +// cvin[2].type = cert_pi_keyusage; +// cvin[2].value.scalar.ui = KU_DIGITAL_SIGNATURE; + cvin[2].type = cert_pi_end; + + cvout[0].type = cert_po_trustAnchor; + cvout[0].value.pointer.cert = NULL; + cvout[1].type = cert_po_errorLog; + cvout[1].value.pointer.log = &log; + cvout[2].type = cert_po_end; + + // We check SSL server certificates, CA certificates and signing sertificates. + // + // ToDo check keyusage, looking at CERT_KeyUsageAndTypeForCertUsage ( + // mozilla/security/nss/lib/certdb/certdb.c indicates that + // certificateUsageSSLClient, certificateUsageSSLServer and certificateUsageSSLCA + // are sufficient. They cover the key usages for digital signature, key agreement + // and encipherment and certificate signature + + //never use the following usages because they are not checked properly + // certificateUsageUserCertImport + // certificateUsageVerifyCA + // certificateUsageAnyCA + // certificateUsageProtectedObjectSigner + + UsageDescription arUsages[] = + { + {certificateUsageSSLClient, "certificateUsageSSLClient" }, + {certificateUsageSSLServer, "certificateUsageSSLServer" }, + {certificateUsageSSLCA, "certificateUsageSSLCA" }, + {certificateUsageEmailSigner, "certificateUsageEmailSigner"}, //only usable for end certs + {certificateUsageEmailRecipient, "certificateUsageEmailRecipient"} + }; + + int numUsages = sizeof(arUsages) / sizeof(UsageDescription); + for (int i = 0; i < numUsages; i++) + { + xmlsec_trace("Testing usage %d of %d: %s (0x%x)", i + 1, + numUsages, arUsages[i].description, (int) arUsages[i].usage); + + status = CERT_PKIXVerifyCert(const_cast<CERTCertificate *>(cert), arUsages[i].usage, + cvin, cvout, NULL); + if( status == SECSuccess ) + { + xmlsec_trace("CERT_PKIXVerifyCert returned SECSuccess."); + //When an intermediate or root certificate is checked then we expect the usage + //certificateUsageSSLCA. This, however, will be only set when in the trust settings dialog + //the button "This certificate can identify websites" is checked. If for example only + //"This certificate can identify mail users" is set then the end certificate can + //be validated and the returned usage will conain certificateUsageEmailRecipient. + //But checking directly the root or intermediate certificate will fail. In the + //certificate path view the end certificate will be shown as valid but the others + //will be displayed as invalid. + + validity = csss::CertificateValidity::VALID; + xmlsec_trace("Certificate is valid.\n"); + CERTCertificate * issuerCert = cvout[0].value.pointer.cert; + if (issuerCert) + { + xmlsec_trace("Root certificate: %s", issuerCert->subjectName); + CERT_DestroyCertificate(issuerCert); + }; + + break; + } + else + { + PRIntn err = PR_GetError(); + xmlsec_trace("Error: , %d = %s", err, getCertError(err)); + + /* Display validation results */ + if ( log.count > 0) + { + CERTVerifyLogNode *node = NULL; + printChainFailure(&log); + + for (node = log.head; node; node = node->next) { + if (node->cert) + CERT_DestroyCertificate(node->cert); + } + log.head = log.tail = NULL; + log.count = 0; + } + xmlsec_trace("Certificate is invalid.\n"); + } + } + + } + else + { + validity = ::com::sun::star::security::CertificateValidity::INVALID ; + } + + //Destroying the temporary certificates + std::vector<CERTCertificate*>::const_iterator cert_i; + for (cert_i = vecTmpNSSCertificates.begin(); cert_i != vecTmpNSSCertificates.end(); cert_i++) + { + xmlsec_trace("Destroying temporary certificate"); + CERT_DestroyCertificate(*cert_i); + } + return validity ; +} + +sal_Int32 SecurityEnvironment_NssImpl::getCertificateCharacters( + const ::com::sun::star::uno::Reference< ::com::sun::star::security::XCertificate >& aCert ) throw( ::com::sun::star::uno::SecurityException, ::com::sun::star::uno::RuntimeException ) { + sal_Int32 characters ; + const X509Certificate_NssImpl* xcert ; + const CERTCertificate* cert ; + + Reference< XUnoTunnel > xCertTunnel( aCert, UNO_QUERY ) ; + if( !xCertTunnel.is() ) { + throw RuntimeException() ; + } + + xcert = reinterpret_cast<X509Certificate_NssImpl*>( + sal::static_int_cast<sal_uIntPtr>(xCertTunnel->getSomething( X509Certificate_NssImpl::getUnoTunnelId() ))) ; + if( xcert == NULL ) { + throw RuntimeException() ; + } + + cert = xcert->getNssCert() ; + + characters = 0x00000000 ; + + //Firstly, find out whether or not the cert is self-signed. + if( SECITEM_CompareItem( &(cert->derIssuer), &(cert->derSubject) ) == SECEqual ) { + characters |= ::com::sun::star::security::CertificateCharacters::SELF_SIGNED ; + } else { + characters &= ~ ::com::sun::star::security::CertificateCharacters::SELF_SIGNED ; + } + + //Secondly, find out whether or not the cert has a private key. + + /* + * i40394 + * + * mmi : need to check whether the cert's slot is valid first + */ + SECKEYPrivateKey* priKey = NULL; + + if (cert->slot != NULL) + { + priKey = PK11_FindPrivateKeyFromCert( cert->slot, ( CERTCertificate* )cert, NULL ) ; + } + if(priKey == NULL) + { + for (CIT_SLOTS is = m_Slots.begin(); is != m_Slots.end(); is++) + { + priKey = PK11_FindPrivateKeyFromCert(*is, (CERTCertificate*)cert, NULL); + if (priKey) + break; + } + } + if( priKey != NULL ) { + characters |= ::com::sun::star::security::CertificateCharacters::HAS_PRIVATE_KEY ; + + SECKEY_DestroyPrivateKey( priKey ) ; + } else { + characters &= ~ ::com::sun::star::security::CertificateCharacters::HAS_PRIVATE_KEY ; + } + + return characters ; +} + +X509Certificate_NssImpl* NssCertToXCert( CERTCertificate* cert ) +{ + X509Certificate_NssImpl* xcert ; + + if( cert != NULL ) { + xcert = new X509Certificate_NssImpl() ; + if( xcert == NULL ) { + xcert = NULL ; + } else { + xcert->setCert( cert ) ; + } + } else { + xcert = NULL ; + } + + return xcert ; +} + +X509Certificate_NssImpl* NssPrivKeyToXCert( SECKEYPrivateKey* priKey ) +{ + CERTCertificate* cert ; + X509Certificate_NssImpl* xcert ; + + if( priKey != NULL ) { + cert = PK11_GetCertFromPrivateKey( priKey ) ; + + if( cert != NULL ) { + xcert = NssCertToXCert( cert ) ; + } else { + xcert = NULL ; + } + + CERT_DestroyCertificate( cert ) ; + } else { + xcert = NULL ; + } + + return xcert ; +} + + +/* Native methods */ +xmlSecKeysMngrPtr SecurityEnvironment_NssImpl::createKeysManager() throw( Exception, RuntimeException ) { + + unsigned int i ; + CERTCertDBHandle* handler = NULL ; + PK11SymKey* symKey = NULL ; + SECKEYPublicKey* pubKey = NULL ; + SECKEYPrivateKey* priKey = NULL ; + xmlSecKeysMngrPtr pKeysMngr = NULL ; + + handler = this->getCertDb() ; + + /*- + * The following lines is based on the private version of xmlSec-NSS + * crypto engine + */ + int cSlots = m_Slots.size(); + boost::scoped_array<PK11SlotInfo*> sarSlots(new PK11SlotInfo*[cSlots]); + PK11SlotInfo** slots = sarSlots.get(); + int count = 0; + for (CIT_SLOTS islots = m_Slots.begin();islots != m_Slots.end(); islots++, count++) + slots[count] = *islots; + + pKeysMngr = xmlSecNssAppliedKeysMngrCreate(slots, cSlots, handler ) ; + if( pKeysMngr == NULL ) + throw RuntimeException() ; + + /*- + * Adopt symmetric key into keys manager + */ + for( i = 0 ; ( symKey = this->getSymKey( i ) ) != NULL ; i ++ ) { + if( xmlSecNssAppliedKeysMngrSymKeyLoad( pKeysMngr, symKey ) < 0 ) { + throw RuntimeException() ; + } + } + + /*- + * Adopt asymmetric public key into keys manager + */ + for( i = 0 ; ( pubKey = this->getPubKey( i ) ) != NULL ; i ++ ) { + if( xmlSecNssAppliedKeysMngrPubKeyLoad( pKeysMngr, pubKey ) < 0 ) { + throw RuntimeException() ; + } + } + + /*- + * Adopt asymmetric private key into keys manager + */ + for( i = 0 ; ( priKey = this->getPriKey( i ) ) != NULL ; i ++ ) { + if( xmlSecNssAppliedKeysMngrPriKeyLoad( pKeysMngr, priKey ) < 0 ) { + throw RuntimeException() ; + } + } + return pKeysMngr ; +} +void SecurityEnvironment_NssImpl::destroyKeysManager(xmlSecKeysMngrPtr pKeysMngr) throw( Exception, RuntimeException ) { + if( pKeysMngr != NULL ) { + xmlSecKeysMngrDestroy( pKeysMngr ) ; + } +} diff --git a/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.hxx b/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.hxx new file mode 100644 index 000000000000..8b2192a00b1f --- /dev/null +++ b/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.hxx @@ -0,0 +1,183 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _XSECURITYENVIRONMENT_NSSIMPL_HXX_ +#define _XSECURITYENVIRONMENT_NSSIMPL_HXX_ + +#include <sal/config.h> +#include <rtl/ustring.hxx> +#include <cppuhelper/factory.hxx> +#include <cppuhelper/implbase4.hxx> +#include <com/sun/star/uno/Exception.hpp> + +#ifndef _COM_SUN_STAR_UNO_REFERENCE_HPP_ +#include <com/sun/star/uno/Reference.hxx> +#endif +#include <com/sun/star/lang/XSingleServiceFactory.hpp> + +#ifndef _COM_SUN_STAR_LANG_XSECVICEINFO_HPP_ +#include <com/sun/star/lang/XServiceInfo.hpp> +#endif +#include <com/sun/star/lang/XInitialization.hpp> +#include <com/sun/star/xml/crypto/XSecurityEnvironment.hpp> +#include <com/sun/star/security/XCertificate.hpp> +#include <com/sun/star/security/CertificateCharacters.hpp> +#include <com/sun/star/security/CertificateValidity.hpp> +#include <com/sun/star/lang/XUnoTunnel.hpp> + +#include "osl/mutex.hxx" + +#include "pk11func.h" +#include "keyhi.h" +#include "certdb.h" +#include "list" + +#include <sal/types.h> +//For reasons that escape me, this is what xmlsec does when size_t is not 4 +#if SAL_TYPES_SIZEOFPOINTER != 4 +# define XMLSEC_NO_SIZE_T +#endif +#include "xmlsec/xmlsec.h" + +class SecurityEnvironment_NssImpl : public ::cppu::WeakImplHelper4< + ::com::sun::star::xml::crypto::XSecurityEnvironment , + ::com::sun::star::lang::XInitialization , + ::com::sun::star::lang::XServiceInfo , + ::com::sun::star::lang::XUnoTunnel > +{ +private : + + std::list< PK11SlotInfo* > m_Slots; + typedef std::list< PK11SlotInfo* >::const_iterator CIT_SLOTS; + + osl::Mutex m_mutex; + + CERTCertDBHandle* m_pHandler ; + std::list< PK11SymKey* > m_tSymKeyList ; + std::list< SECKEYPublicKey* > m_tPubKeyList ; + std::list< SECKEYPrivateKey* > m_tPriKeyList ; + ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xServiceManager ; + + public : + SecurityEnvironment_NssImpl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& aFactory ) ; + virtual ~SecurityEnvironment_NssImpl() ; + + //Methods from XSecurityEnvironment + + //Methods from XInitialization + virtual void SAL_CALL initialize( + const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments + ) throw( ::com::sun::star::uno::Exception , ::com::sun::star::uno::RuntimeException ) ; + + //Methods from XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException ) ; + + virtual sal_Bool SAL_CALL supportsService( + const ::rtl::OUString& ServiceName + ) throw( ::com::sun::star::uno::RuntimeException ) ; + + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException ) ; + + //Helper for XServiceInfo + static ::com::sun::star::uno::Sequence< ::rtl::OUString > impl_getSupportedServiceNames() ; + + static ::rtl::OUString impl_getImplementationName() throw( ::com::sun::star::uno::RuntimeException ) ; + + //Helper for registry + static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL impl_createInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& aServiceManager ) throw( ::com::sun::star::uno::RuntimeException ) ; + + static ::com::sun::star::uno::Reference< ::com::sun::star::lang::XSingleServiceFactory > impl_createFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& aServiceManager ) ; + + virtual ::sal_Int32 SAL_CALL verifyCertificate( + const ::com::sun::star::uno::Reference< + ::com::sun::star::security::XCertificate >& xCert, + const ::com::sun::star::uno::Sequence< + ::com::sun::star::uno::Reference< ::com::sun::star::security::XCertificate > > & + intermediateCerts) + throw (::com::sun::star::uno::SecurityException, ::com::sun::star::uno::RuntimeException) ; + + virtual ::sal_Int32 SAL_CALL getCertificateCharacters( const ::com::sun::star::uno::Reference< ::com::sun::star::security::XCertificate >& xCert ) throw (::com::sun::star::uno::SecurityException, ::com::sun::star::uno::RuntimeException) ; + + virtual ::rtl::OUString SAL_CALL getSecurityEnvironmentInformation( ) throw (::com::sun::star::uno::RuntimeException); + + //Methods from XUnoTunnel + virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) + throw (::com::sun::star::uno::RuntimeException); + + static const ::com::sun::star::uno::Sequence< sal_Int8 >& getUnoTunnelId() ; + static SecurityEnvironment_NssImpl* getImplementation( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > xObj ) ; + + //Native mehtods + virtual CERTCertDBHandle* getCertDb() throw( ::com::sun::star::uno::Exception , ::com::sun::star::uno::RuntimeException ) ; + + virtual void setCertDb( CERTCertDBHandle* aCertDb ) throw( ::com::sun::star::uno::Exception , ::com::sun::star::uno::RuntimeException ) ; + + virtual void adoptSymKey( PK11SymKey* aSymKey ) throw( ::com::sun::star::uno::Exception , ::com::sun::star::uno::RuntimeException ) ; + + virtual void rejectSymKey( PK11SymKey* aSymKey ) throw( ::com::sun::star::uno::Exception , ::com::sun::star::uno::RuntimeException ) ; + + virtual PK11SymKey* getSymKey( unsigned int position ) throw( ::com::sun::star::uno::Exception , ::com::sun::star::uno::RuntimeException ) ; + + virtual void adoptPubKey( SECKEYPublicKey* aPubKey ) throw( ::com::sun::star::uno::Exception , ::com::sun::star::uno::RuntimeException ) ; + + virtual void rejectPubKey( SECKEYPublicKey* aPubKey ) throw( ::com::sun::star::uno::Exception , ::com::sun::star::uno::RuntimeException ) ; + + virtual SECKEYPublicKey* getPubKey( unsigned int position ) throw( ::com::sun::star::uno::Exception , ::com::sun::star::uno::RuntimeException ) ; + + virtual void adoptPriKey( SECKEYPrivateKey* aPriKey ) throw( ::com::sun::star::uno::Exception , ::com::sun::star::uno::RuntimeException ) ; + + virtual void rejectPriKey( SECKEYPrivateKey* aPriKey ) throw( ::com::sun::star::uno::Exception , ::com::sun::star::uno::RuntimeException ) ; + + virtual SECKEYPrivateKey* getPriKey( unsigned int position ) throw( ::com::sun::star::uno::Exception , ::com::sun::star::uno::RuntimeException ) ; + + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::security::XCertificate > > SAL_CALL getPersonalCertificates() throw( ::com::sun::star::uno::SecurityException , ::com::sun::star::uno::RuntimeException ) ; + + virtual ::com::sun::star::uno::Reference< ::com::sun::star::security::XCertificate > SAL_CALL getCertificate( const ::rtl::OUString& issuerName, const ::com::sun::star::uno::Sequence< sal_Int8 >& serialNumber ) throw( ::com::sun::star::uno::SecurityException , ::com::sun::star::uno::RuntimeException ) ; + + virtual ::com::sun::star::uno::Reference< ::com::sun::star::security::XCertificate > SAL_CALL getCertificate( const ::rtl::OUString& issuerName, const ::rtl::OUString& serialNumber ) throw( ::com::sun::star::uno::SecurityException , ::com::sun::star::uno::RuntimeException ) ; + + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::security::XCertificate > > SAL_CALL buildCertificatePath( const ::com::sun::star::uno::Reference< ::com::sun::star::security::XCertificate >& beginCert ) throw( ::com::sun::star::uno::SecurityException , ::com::sun::star::uno::RuntimeException ) ; + + virtual ::com::sun::star::uno::Reference< ::com::sun::star::security::XCertificate > SAL_CALL createCertificateFromRaw( const ::com::sun::star::uno::Sequence< sal_Int8 >& rawCertificate ) throw( ::com::sun::star::uno::SecurityException , ::com::sun::star::uno::RuntimeException ) ; + + virtual ::com::sun::star::uno::Reference< ::com::sun::star::security::XCertificate > SAL_CALL createCertificateFromAscii( const ::rtl::OUString& asciiCertificate ) throw( ::com::sun::star::uno::SecurityException , ::com::sun::star::uno::RuntimeException ) ; + + + //Native mehtods + virtual xmlSecKeysMngrPtr createKeysManager() throw( ::com::sun::star::uno::Exception , ::com::sun::star::uno::RuntimeException ) ; + virtual void destroyKeysManager(xmlSecKeysMngrPtr pKeysMngr) throw( ::com::sun::star::uno::Exception , ::com::sun::star::uno::RuntimeException ) ; + +private: + void updateSlots(); + + virtual void addCryptoSlot( PK11SlotInfo* aSlot ) throw( ::com::sun::star::uno::Exception , ::com::sun::star::uno::RuntimeException ) ; + + +} ; + +#endif // _XSECURITYENVIRONMENT_NSSIMPL_HXX_ + diff --git a/xmlsecurity/source/xmlsec/nss/seinitializer_nssimpl.cxx b/xmlsecurity/source/xmlsec/nss/seinitializer_nssimpl.cxx new file mode 100644 index 000000000000..127d7fa43fe6 --- /dev/null +++ b/xmlsecurity/source/xmlsec/nss/seinitializer_nssimpl.cxx @@ -0,0 +1,516 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_xmlsecurity.hxx" + +/* + * Turn off DEBUG Assertions + */ +#ifdef _DEBUG + #define _DEBUG_WAS_DEFINED _DEBUG + #undef _DEBUG +#else + #undef _DEBUG_WAS_DEFINED +#endif + +/* + * and turn off the additional virtual methods which are part of some interfaces when compiled + * with debug + */ +#ifdef DEBUG + #define DEBUG_WAS_DEFINED DEBUG + #undef DEBUG +#else + #undef DEBUG_WAS_DEFINED +#endif + + +#include <sal/types.h> +#include "rtl/instance.hxx" +#include "rtl/bootstrap.hxx" +#include "rtl/string.hxx" +#include "rtl/strbuf.hxx" +#include "osl/file.hxx" +#include "osl/thread.h" +#include <tools/debug.hxx> +#include <rtl/logfile.hxx> + +#include "seinitializer_nssimpl.hxx" +#include "../diagnose.hxx" + +#include "securityenvironment_nssimpl.hxx" +#include <com/sun/star/mozilla/XMozillaBootstrap.hpp> + +#include "nspr.h" +#include "cert.h" +#include "nss.h" +#include "secmod.h" +#include "nssckbi.h" + + +namespace cssu = com::sun::star::uno; +namespace cssl = com::sun::star::lang; +namespace cssxc = com::sun::star::xml::crypto; + +using namespace xmlsecurity; +using namespace com::sun::star; +using ::rtl::OUString; +using ::rtl::OString; + +#define SERVICE_NAME "com.sun.star.xml.crypto.SEInitializer" +#define IMPLEMENTATION_NAME "com.sun.star.xml.security.bridge.xmlsec.SEInitializer_NssImpl" +#define SECURITY_ENVIRONMENT "com.sun.star.xml.crypto.SecurityEnvironment" +#define SECURITY_CONTEXT "com.sun.star.xml.crypto.XMLSecurityContext" + + +#define ROOT_CERTS "Root Certs for OpenOffice.org" + + +extern "C" void nsscrypto_finalize(); + + +namespace +{ + +bool nsscrypto_initialize( const char * sProfile, bool & out_nss_init); + +struct InitNSSInitialize +{ + //path to the database folder + const OString m_sProfile; + InitNSSInitialize(const OString & sProfile): m_sProfile(sProfile) {}; + bool * operator()() + { + static bool bInitialized = false; + bool bNSSInit = false; + bInitialized = nsscrypto_initialize(m_sProfile.getStr(), bNSSInit); + if (bNSSInit) + atexit(nsscrypto_finalize ); + return & bInitialized; + + } +}; + +bool * initNSS(const OString & sProfile) +{ + return rtl_Instance< bool, InitNSSInitialize, + ::osl::MutexGuard, ::osl::GetGlobalMutex >::create( + InitNSSInitialize(sProfile), ::osl::GetGlobalMutex()); +} + +void deleteRootsModule() +{ + SECMODModule *RootsModule = 0; + SECMODModuleList *list = SECMOD_GetDefaultModuleList(); + SECMODListLock *lock = SECMOD_GetDefaultModuleListLock(); + SECMOD_GetReadLock(lock); + + while (!RootsModule && list) + { + SECMODModule *module = list->module; + + for (int i=0; i < module->slotCount; i++) + { + PK11SlotInfo *slot = module->slots[i]; + if (PK11_IsPresent(slot)) + { + if (PK11_HasRootCerts(slot)) + { + xmlsec_trace("The root certifificates module \"%s" + "\" is already loaded: \n%s", + module->commonName, module->dllName); + + RootsModule = SECMOD_ReferenceModule(module); + break; + } + } + } + list = list->next; + } + SECMOD_ReleaseReadLock(lock); + + if (RootsModule) + { + PRInt32 modType; + if (SECSuccess == SECMOD_DeleteModule(RootsModule->commonName, &modType)) + { + xmlsec_trace("Deleted module \"%s\".", RootsModule->commonName); + } + else + { + xmlsec_trace("Failed to delete \"%s\" : \n%s", + RootsModule->commonName, RootsModule->dllName); + } + SECMOD_DestroyModule(RootsModule); + RootsModule = 0; + } +} + +//Older versions of Firefox (FF), for example FF2, and Thunderbird (TB) 2 write +//the roots certificate module (libnssckbi.so), which they use, into the +//profile. This module will then already be loaded during NSS_Init (and the +//other init functions). This fails in two cases. First, FF3 was used to create +//the profile, or possibly used that profile before, and second the profile was +//used on a different platform. +// +//Then one needs to add the roots module oneself. This should be done with +//SECMOD_LoadUserModule rather then SECMOD_AddNewModule. The latter would write +//the location of the roots module to the profile, which makes FF2 and TB2 use +//it instead of there own module. +// +//When using SYSTEM_MOZILLA then the libnss3.so lib is typically found in +///usr/lib. This folder may, however, NOT contain the roots certificate +//module. That is, just providing the library name in SECMOD_LoadUserModule or +//SECMOD_AddNewModule will FAIL to load the mozilla unless the LD_LIBRARY_PATH +//contains an FF or TB installation. +//ATTENTION: DO NOT call this function directly instead use initNSS +//return true - whole initialization was successful +//param out_nss_init = true: at least the NSS initialization (NSS_InitReadWrite +//was successful and therefor NSS_Shutdown should be called when terminating. +bool nsscrypto_initialize( const char* token, bool & out_nss_init ) +{ + bool return_value = true; + + xmlsec_trace("Using profile: %s", token); + + PR_Init( PR_USER_THREAD, PR_PRIORITY_NORMAL, 1 ) ; + + //token may be an empty string + if (token != NULL && strlen(token) > 0) + { + if( NSS_InitReadWrite( token ) != SECSuccess ) + { + xmlsec_trace("Initializing NSS with profile failed."); + char * error = NULL; + + PR_GetErrorText(error); + if (error) + xmlsec_trace("%s",error); + return false ; + } + } + else + { + xmlsec_trace("Initializing NSS without profile."); + if ( NSS_NoDB_Init(NULL) != SECSuccess ) + { + xmlsec_trace("Initializing NSS without profile failed."); + char * error = NULL; + PR_GetErrorText(error); + if (error) + xmlsec_trace("%s",error); + return false ; + } + } + out_nss_init = true; + +#if defined SYSTEM_MOZILLA + if (!SECMOD_HasRootCerts()) + { +#endif + deleteRootsModule(); + +#if defined SYSTEM_MOZILLA + OUString rootModule(RTL_CONSTASCII_USTRINGPARAM("libnssckbi"SAL_DLLEXTENSION)); +#else + OUString rootModule(RTL_CONSTASCII_USTRINGPARAM("${OOO_BASE_DIR}/program/libnssckbi"SAL_DLLEXTENSION)); +#endif + ::rtl::Bootstrap::expandMacros(rootModule); + + OUString rootModulePath; + if (::osl::File::E_None == ::osl::File::getSystemPathFromFileURL(rootModule, rootModulePath)) + { + ::rtl::OString ospath = ::rtl::OUStringToOString(rootModulePath, osl_getThreadTextEncoding()); + ::rtl::OStringBuffer pkcs11moduleSpec; + pkcs11moduleSpec.append("name=\""); + pkcs11moduleSpec.append(ROOT_CERTS); + pkcs11moduleSpec.append("\" library=\""); + pkcs11moduleSpec.append(ospath.getStr()); + pkcs11moduleSpec.append("\""); + + SECMODModule * RootsModule = + SECMOD_LoadUserModule( + const_cast<char*>(pkcs11moduleSpec.makeStringAndClear().getStr()), + 0, // no parent + PR_FALSE); // do not recurse + + if (RootsModule) + { + + bool found = RootsModule->loaded; + + SECMOD_DestroyModule(RootsModule); + RootsModule = 0; + if (found) + xmlsec_trace("Added new root certificate module " + "\""ROOT_CERTS"\" contained in \n%s", ospath.getStr()); + else + { + xmlsec_trace("FAILED to load the new root certificate module " + "\""ROOT_CERTS"\" contained in \n%s", ospath.getStr()); + return_value = false; + } + } + else + { + xmlsec_trace("FAILED to add new root certifice module: " + "\""ROOT_CERTS"\" contained in \n%s", ospath.getStr()); + return_value = false; + + } + } + else + { + xmlsec_trace("Adding new root certificate module failed."); + return_value = false; + } +#if SYSTEM_MOZILLA + } +#endif + + return return_value; +} + + +// must be extern "C" because we pass the function pointer to atexit +extern "C" void nsscrypto_finalize() +{ + SECMODModule *RootsModule = SECMOD_FindModule(ROOT_CERTS); + + if (RootsModule) + { + + if (SECSuccess == SECMOD_UnloadUserModule(RootsModule)) + { + xmlsec_trace("Unloaded module \""ROOT_CERTS"\"."); + } + else + { + xmlsec_trace("Failed unloadeding module \""ROOT_CERTS"\"."); + } + SECMOD_DestroyModule(RootsModule); + } + else + { + xmlsec_trace("Unloading module \""ROOT_CERTS + "\" failed because it was not found."); + } + PK11_LogoutAll(); + NSS_Shutdown(); +} + + +bool getMozillaCurrentProfile( + const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > &rxMSF, + rtl::OUString& profilePath) +{ + /* + * first, try to get the profile from "MOZILLA_CERTIFICATE_FOLDER" + */ + char * env = getenv("MOZILLA_CERTIFICATE_FOLDER"); + if (env) + { + profilePath = rtl::OUString::createFromAscii( env ); + RTL_LOGFILE_PRODUCT_TRACE1( "XMLSEC: Using env MOZILLA_CERTIFICATE_FOLDER: %s", rtl::OUStringToOString( profilePath, RTL_TEXTENCODING_ASCII_US ).getStr() ); + return true; + } + else + { + mozilla::MozillaProductType productTypes[4] = { + mozilla::MozillaProductType_Thunderbird, + mozilla::MozillaProductType_Mozilla, + mozilla::MozillaProductType_Firefox, + mozilla::MozillaProductType_Default }; + int nProduct = 4; + + uno::Reference<uno::XInterface> xInstance = rxMSF->createInstance( + ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.mozilla.MozillaBootstrap")) ); + OSL_ENSURE( xInstance.is(), "failed to create instance" ); + + uno::Reference<mozilla::XMozillaBootstrap> xMozillaBootstrap + = uno::Reference<mozilla::XMozillaBootstrap>(xInstance,uno::UNO_QUERY); + OSL_ENSURE( xMozillaBootstrap.is(), "failed to create instance" ); + + if (xMozillaBootstrap.is()) + { + for (int i=0; i<nProduct; i++) + { + ::rtl::OUString profile = xMozillaBootstrap->getDefaultProfile(productTypes[i]); + + if (profile != NULL && profile.getLength()>0) + { + profilePath = xMozillaBootstrap->getProfilePath(productTypes[i],profile); + RTL_LOGFILE_PRODUCT_TRACE1( "XMLSEC: Using Mozilla Profile: %s", rtl::OUStringToOString( profilePath, RTL_TEXTENCODING_ASCII_US ).getStr() ); + return true; + } + } + } + + RTL_LOGFILE_PRODUCT_TRACE( "XMLSEC: No Mozilla Profile found!" ); + return false; + } +} + +} // namespace + +SEInitializer_NssImpl::SEInitializer_NssImpl( + const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > &rxMSF) + :mxMSF( rxMSF ) +{ +} + +SEInitializer_NssImpl::~SEInitializer_NssImpl() +{ +} + +/* XSEInitializer */ +cssu::Reference< cssxc::XXMLSecurityContext > SAL_CALL + SEInitializer_NssImpl::createSecurityContext( + const rtl::OUString& sCertDB ) + throw (cssu::RuntimeException) +{ + CERTCertDBHandle *pCertHandle = NULL ; + + rtl::OString sCertDir; + if( sCertDB.getLength() ) + { + sCertDir = rtl::OString(sCertDB, sCertDB.getLength(), RTL_TEXTENCODING_ASCII_US); + } + else + { + static rtl::OString* pDefaultCertDir = NULL; + if ( !pDefaultCertDir ) + { + pDefaultCertDir = new rtl::OString; + rtl::OUString ouCertDir; + + + + if ( getMozillaCurrentProfile(mxMSF, ouCertDir) ) + *pDefaultCertDir = rtl::OString(ouCertDir, ouCertDir.getLength(), RTL_TEXTENCODING_ASCII_US); + } + sCertDir = *pDefaultCertDir; + + } + + if( ! *initNSS( sCertDir.getStr() ) ) + { + return NULL; + } + + pCertHandle = CERT_GetDefaultCertDB() ; + + try + { + /* Build XML Security Context */ + const rtl::OUString sSecyrutyContext ( RTL_CONSTASCII_USTRINGPARAM( SECURITY_CONTEXT ) ); + cssu::Reference< cssxc::XXMLSecurityContext > xSecCtx( mxMSF->createInstance ( sSecyrutyContext ), cssu::UNO_QUERY ); + if( !xSecCtx.is() ) + return NULL; + + const rtl::OUString sSecyrutyEnvironment ( RTL_CONSTASCII_USTRINGPARAM( SECURITY_ENVIRONMENT ) ); + cssu::Reference< cssxc::XSecurityEnvironment > xSecEnv( mxMSF->createInstance ( sSecyrutyEnvironment ), cssu::UNO_QUERY ); + cssu::Reference< cssl::XUnoTunnel > xEnvTunnel( xSecEnv , cssu::UNO_QUERY ) ; + if( !xEnvTunnel.is() ) + return NULL; + SecurityEnvironment_NssImpl* pSecEnv = reinterpret_cast<SecurityEnvironment_NssImpl*>( + sal::static_int_cast<sal_uIntPtr>( + xEnvTunnel->getSomething(SecurityEnvironment_NssImpl::getUnoTunnelId() ))) ; + pSecEnv->setCertDb(pCertHandle); + + sal_Int32 n = xSecCtx->addSecurityEnvironment(xSecEnv); + //originally the SecurityEnvironment with the internal slot was set as default + xSecCtx->setDefaultSecurityEnvironmentIndex( n ); + return xSecCtx; + } + catch( cssu::Exception& ) + { + //PK11_LogoutAll(); + //NSS_Shutdown(); + return NULL; + } +} + +void SAL_CALL SEInitializer_NssImpl::freeSecurityContext( const cssu::Reference< cssxc::XXMLSecurityContext >& ) + throw (cssu::RuntimeException) +{ + /* + * because the security context will free all its content when it + * is destructed, so here no free process for the security context + * is needed. + */ + //PK11_LogoutAll(); + //NSS_Shutdown(); +} + +rtl::OUString SEInitializer_NssImpl_getImplementationName () + throw (cssu::RuntimeException) +{ + + return rtl::OUString ( RTL_CONSTASCII_USTRINGPARAM ( IMPLEMENTATION_NAME ) ); +} + +sal_Bool SAL_CALL SEInitializer_NssImpl_supportsService( const rtl::OUString& ServiceName ) + throw (cssu::RuntimeException) +{ + return ServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( SERVICE_NAME )); +} + +cssu::Sequence< rtl::OUString > SAL_CALL SEInitializer_NssImpl_getSupportedServiceNames( ) + throw (cssu::RuntimeException) +{ + cssu::Sequence < rtl::OUString > aRet(1); + rtl::OUString* pArray = aRet.getArray(); + pArray[0] = rtl::OUString ( RTL_CONSTASCII_USTRINGPARAM ( SERVICE_NAME ) ); + return aRet; +} +#undef SERVICE_NAME + +cssu::Reference< cssu::XInterface > SAL_CALL SEInitializer_NssImpl_createInstance( const cssu::Reference< cssl::XMultiServiceFactory > & rSMgr) + throw( cssu::Exception ) +{ + return (cppu::OWeakObject*) new SEInitializer_NssImpl(rSMgr); +} + +/* XServiceInfo */ +rtl::OUString SAL_CALL SEInitializer_NssImpl::getImplementationName( ) + throw (cssu::RuntimeException) +{ + return SEInitializer_NssImpl_getImplementationName(); +} +sal_Bool SAL_CALL SEInitializer_NssImpl::supportsService( const rtl::OUString& rServiceName ) + throw (cssu::RuntimeException) +{ + return SEInitializer_NssImpl_supportsService( rServiceName ); +} +cssu::Sequence< rtl::OUString > SAL_CALL SEInitializer_NssImpl::getSupportedServiceNames( ) + throw (cssu::RuntimeException) +{ + return SEInitializer_NssImpl_getSupportedServiceNames(); +} + diff --git a/xmlsecurity/source/xmlsec/nss/seinitializer_nssimpl.hxx b/xmlsecurity/source/xmlsec/nss/seinitializer_nssimpl.hxx new file mode 100644 index 000000000000..70075adc84e3 --- /dev/null +++ b/xmlsecurity/source/xmlsec/nss/seinitializer_nssimpl.hxx @@ -0,0 +1,108 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SEINITIALIZERIMPL_HXX +#define _SEINITIALIZERIMPL_HXX + +#include <com/sun/star/xml/crypto/XXMLSecurityContext.hpp> +#ifndef _COM_SUN_STAR_XML_CRYPTO_SEINITIALIZER_HPP_ +#include <com/sun/star/xml/crypto/XSEInitializer.hpp> +#endif +#include <com/sun/star/lang/XUnoTunnel.hpp> +#include <com/sun/star/lang/XServiceInfo.hpp> +#include <com/sun/star/lang/XMultiServiceFactory.hpp> +#include <cppuhelper/implbase2.hxx> + +#include <libxml/tree.h> + +class SEInitializer_NssImpl : public cppu::WeakImplHelper2 +< + com::sun::star::xml::crypto::XSEInitializer, + com::sun::star::lang::XServiceInfo +> +/****** SEInitializer_NssImpl.hxx/CLASS SEInitializer_NssImpl *********** + * + * NAME + * SEInitializer_NssImpl -- Class to initialize a Security Context + * instance + * + * FUNCTION + * Use this class to initialize a XmlSec based Security Context + * instance. After this instance is used up, use this class to free this + * instance. + * + * HISTORY + * 05.01.2004 - Interface supported: XSEInitializer, XSEInitializer + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ +private: + com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > mxMSF; + +public: + SEInitializer_NssImpl(const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > &rxMSF); + virtual ~SEInitializer_NssImpl(); + + /* XSEInitializer */ + virtual com::sun::star::uno::Reference< + com::sun::star::xml::crypto::XXMLSecurityContext > + SAL_CALL createSecurityContext( const rtl::OUString& certDB ) + throw (com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL freeSecurityContext( const com::sun::star::uno::Reference< + com::sun::star::xml::crypto::XXMLSecurityContext >& securityContext ) + throw (com::sun::star::uno::RuntimeException); + + /* XServiceInfo */ + virtual rtl::OUString SAL_CALL getImplementationName( ) + throw (com::sun::star::uno::RuntimeException); + + virtual sal_Bool SAL_CALL supportsService( const rtl::OUString& ServiceName ) + throw (com::sun::star::uno::RuntimeException); + + virtual com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames( ) + throw (com::sun::star::uno::RuntimeException); +}; + +rtl::OUString SEInitializer_NssImpl_getImplementationName() + throw ( com::sun::star::uno::RuntimeException ); + +sal_Bool SAL_CALL SEInitializer_NssImpl_supportsService( const rtl::OUString& ServiceName ) + throw ( com::sun::star::uno::RuntimeException ); + +com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL SEInitializer_NssImpl_getSupportedServiceNames( ) + throw ( com::sun::star::uno::RuntimeException ); + +com::sun::star::uno::Reference< com::sun::star::uno::XInterface > +SAL_CALL SEInitializer_NssImpl_createInstance( const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > & rSMgr) + throw ( com::sun::star::uno::Exception ); + +#endif + diff --git a/xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.cxx b/xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.cxx new file mode 100644 index 000000000000..287dce6408ef --- /dev/null +++ b/xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.cxx @@ -0,0 +1,471 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_xmlsecurity.hxx" + + + +#include "nssrenam.h" +#include "nspr.h" +#include "nss.h" +#include "secder.h" + +//MM : added by MM +#include "hasht.h" +#include "secoid.h" +#include "pk11func.h" +//MM : end + + + +#include <sal/config.h> +#include <rtl/uuid.h> +#include "x509certificate_nssimpl.hxx" + +#ifndef _CERTIFICATEEXTENSION_NSSIMPL_HXX_ +#include "certificateextension_xmlsecimpl.hxx" +#endif + + +using namespace ::com::sun::star::uno ; +using namespace ::com::sun::star::security ; +using ::rtl::OUString ; + +using ::com::sun::star::security::XCertificate ; +using ::com::sun::star::util::DateTime ; + +X509Certificate_NssImpl :: X509Certificate_NssImpl() : + m_pCert( NULL ) +{ +} + +X509Certificate_NssImpl :: ~X509Certificate_NssImpl() { + if( m_pCert != NULL ) { + CERT_DestroyCertificate( m_pCert ) ; + } +} + +//Methods from XCertificate +sal_Int16 SAL_CALL X509Certificate_NssImpl :: getVersion() throw ( ::com::sun::star::uno::RuntimeException) { + if( m_pCert != NULL ) { + if( m_pCert->version.len > 0 ) { + return ( char )*( m_pCert->version.data ) ; + } else + return 0 ; + } else { + return -1 ; + } +} + +::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL X509Certificate_NssImpl :: getSerialNumber() throw ( ::com::sun::star::uno::RuntimeException) { + if( m_pCert != NULL && m_pCert->serialNumber.len > 0 ) { + Sequence< sal_Int8 > serial( m_pCert->serialNumber.len ) ; + for( unsigned int i = 0 ; i < m_pCert->serialNumber.len ; i ++ ) + serial[i] = *( m_pCert->serialNumber.data + i ) ; + + return serial ; + } else { + return ::com::sun::star::uno::Sequence< sal_Int8 >(); + } +} + +::rtl::OUString SAL_CALL X509Certificate_NssImpl :: getIssuerName() throw ( ::com::sun::star::uno::RuntimeException) { + if( m_pCert != NULL ) { + return OUString(m_pCert->issuerName , PL_strlen(m_pCert->issuerName) , RTL_TEXTENCODING_UTF8) ; + } else { + return OUString() ; + } +} + +::rtl::OUString SAL_CALL X509Certificate_NssImpl :: getSubjectName() throw ( ::com::sun::star::uno::RuntimeException) { + if( m_pCert != NULL ) { + return OUString(m_pCert->subjectName , PL_strlen(m_pCert->subjectName) , RTL_TEXTENCODING_UTF8); + } else { + return OUString() ; + } +} + +::com::sun::star::util::DateTime SAL_CALL X509Certificate_NssImpl :: getNotValidBefore() throw ( ::com::sun::star::uno::RuntimeException) { + if( m_pCert != NULL ) { + SECStatus rv ; + PRTime notBefore ; + PRExplodedTime explTime ; + DateTime dateTime ; + + rv = DER_DecodeTimeChoice( ¬Before, &m_pCert->validity.notBefore ) ; + if( rv ) { + return DateTime() ; + } + + //Convert the time to readable local time + PR_ExplodeTime( notBefore, PR_LocalTimeParameters, &explTime ) ; + + dateTime.HundredthSeconds = explTime.tm_usec / 1000 ; + dateTime.Seconds = explTime.tm_sec ; + dateTime.Minutes = explTime.tm_min ; + dateTime.Hours = explTime.tm_hour ; + dateTime.Day = explTime.tm_mday ; + dateTime.Month = explTime.tm_month+1 ; + dateTime.Year = explTime.tm_year ; + + return dateTime ; + } else { + return DateTime() ; + } +} + +::com::sun::star::util::DateTime SAL_CALL X509Certificate_NssImpl :: getNotValidAfter() throw ( ::com::sun::star::uno::RuntimeException) { + if( m_pCert != NULL ) { + SECStatus rv ; + PRTime notAfter ; + PRExplodedTime explTime ; + DateTime dateTime ; + + rv = DER_DecodeTimeChoice( ¬After, &m_pCert->validity.notAfter ) ; + if( rv ) { + return DateTime() ; + } + + //Convert the time to readable local time + PR_ExplodeTime( notAfter, PR_LocalTimeParameters, &explTime ) ; + + dateTime.HundredthSeconds = explTime.tm_usec / 1000 ; + dateTime.Seconds = explTime.tm_sec ; + dateTime.Minutes = explTime.tm_min ; + dateTime.Hours = explTime.tm_hour ; + dateTime.Day = explTime.tm_mday ; + dateTime.Month = explTime.tm_month+1 ; + dateTime.Year = explTime.tm_year ; + + return dateTime ; + } else { + return DateTime() ; + } +} + +::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL X509Certificate_NssImpl :: getIssuerUniqueID() throw ( ::com::sun::star::uno::RuntimeException) { + if( m_pCert != NULL && m_pCert->issuerID.len > 0 ) { + Sequence< sal_Int8 > issuerUid( m_pCert->issuerID.len ) ; + for( unsigned int i = 0 ; i < m_pCert->issuerID.len ; i ++ ) + issuerUid[i] = *( m_pCert->issuerID.data + i ) ; + + return issuerUid ; + } else { + return ::com::sun::star::uno::Sequence< sal_Int8 >(); + } +} + +::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL X509Certificate_NssImpl :: getSubjectUniqueID() throw ( ::com::sun::star::uno::RuntimeException) { + if( m_pCert != NULL && m_pCert->subjectID.len > 0 ) { + Sequence< sal_Int8 > subjectUid( m_pCert->subjectID.len ) ; + for( unsigned int i = 0 ; i < m_pCert->subjectID.len ; i ++ ) + subjectUid[i] = *( m_pCert->subjectID.data + i ) ; + + return subjectUid ; + } else { + return ::com::sun::star::uno::Sequence< sal_Int8 >(); + } +} + +::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::security::XCertificateExtension > > SAL_CALL X509Certificate_NssImpl :: getExtensions() throw ( ::com::sun::star::uno::RuntimeException) { + if( m_pCert != NULL && m_pCert->extensions != NULL ) { + CERTCertExtension** extns ; + CertificateExtension_XmlSecImpl* pExtn ; + sal_Bool crit ; + int len ; + + for( len = 0, extns = m_pCert->extensions; *extns != NULL; len ++, extns ++ ) ; + Sequence< Reference< XCertificateExtension > > xExtns( len ) ; + + for( extns = m_pCert->extensions, len = 0; *extns != NULL; extns ++, len ++ ) { + pExtn = new CertificateExtension_XmlSecImpl() ; + if( (*extns)->critical.data == NULL ) + crit = sal_False ; + else + crit = ( (*extns)->critical.data[0] == 0xFF ) ? sal_True : sal_False ; + pExtn->setCertExtn( (*extns)->value.data, (*extns)->value.len, (*extns)->id.data, (*extns)->id.len, crit ) ; + + xExtns[len] = pExtn ; + } + + return xExtns ; + } else { + return ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::security::XCertificateExtension > > (); + } +} + +::com::sun::star::uno::Reference< ::com::sun::star::security::XCertificateExtension > SAL_CALL X509Certificate_NssImpl :: findCertificateExtension( const ::com::sun::star::uno::Sequence< sal_Int8 >& oid ) throw (::com::sun::star::uno::RuntimeException) { + if( m_pCert != NULL && m_pCert->extensions != NULL ) { + CertificateExtension_XmlSecImpl* pExtn ; + CERTCertExtension** extns ; + SECItem idItem ; + sal_Bool crit ; + + idItem.data = ( unsigned char* )&oid[0] ; + idItem.len = oid.getLength() ; + + pExtn = NULL ; + for( extns = m_pCert->extensions; *extns != NULL; extns ++ ) { + if( SECITEM_CompareItem( &idItem, &(*extns)->id ) == SECEqual ) { + pExtn = new CertificateExtension_XmlSecImpl() ; + if( (*extns)->critical.data == NULL ) + crit = sal_False ; + else + crit = ( (*extns)->critical.data[0] == 0xFF ) ? sal_True : sal_False ; + pExtn->setCertExtn( (*extns)->value.data, (*extns)->value.len, (*extns)->id.data, (*extns)->id.len, crit ) ; + } + } + + return pExtn ; + } else { + return NULL ; + } +} + + +::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL X509Certificate_NssImpl :: getEncoded() throw ( ::com::sun::star::uno::RuntimeException) { + if( m_pCert != NULL && m_pCert->derCert.len > 0 ) { + Sequence< sal_Int8 > rawCert( m_pCert->derCert.len ) ; + + for( unsigned int i = 0 ; i < m_pCert->derCert.len ; i ++ ) + rawCert[i] = *( m_pCert->derCert.data + i ) ; + + return rawCert ; + } else { + return ::com::sun::star::uno::Sequence< sal_Int8 >(); + } +} + +//Helper methods +void X509Certificate_NssImpl :: setCert( CERTCertificate* cert ) { + if( m_pCert != NULL ) { + CERT_DestroyCertificate( m_pCert ) ; + m_pCert = NULL ; + } + + if( cert != NULL ) { + m_pCert = CERT_DupCertificate( cert ) ; + } +} + +const CERTCertificate* X509Certificate_NssImpl :: getNssCert() const { + if( m_pCert != NULL ) { + return m_pCert ; + } else { + return NULL ; + } +} + +void X509Certificate_NssImpl :: setRawCert( Sequence< sal_Int8 > rawCert ) throw ( ::com::sun::star::uno::RuntimeException) { + CERTCertificate* cert ; + SECItem certItem ; + + certItem.data = ( unsigned char* )&rawCert[0] ; + certItem.len = rawCert.getLength() ; + + cert = CERT_DecodeDERCertificate( &certItem, PR_TRUE, NULL ) ; + if( cert == NULL ) + throw RuntimeException() ; + + if( m_pCert != NULL ) { + CERT_DestroyCertificate( m_pCert ) ; + m_pCert = NULL ; + } + + m_pCert = cert ; +} + +/* XUnoTunnel */ +sal_Int64 SAL_CALL X509Certificate_NssImpl :: getSomething( const Sequence< sal_Int8 >& aIdentifier ) throw( RuntimeException ) { + if( aIdentifier.getLength() == 16 && 0 == rtl_compareMemory( getUnoTunnelId().getConstArray(), aIdentifier.getConstArray(), 16 ) ) { + return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_uIntPtr>(this)); + } + return 0 ; +} + +/* XUnoTunnel extension */ +const Sequence< sal_Int8>& X509Certificate_NssImpl :: getUnoTunnelId() { + static Sequence< sal_Int8 >* pSeq = 0 ; + if( !pSeq ) { + ::osl::Guard< ::osl::Mutex > aGuard( ::osl::Mutex::getGlobalMutex() ) ; + if( !pSeq ) { + static Sequence< sal_Int8> aSeq( 16 ) ; + rtl_createUuid( ( sal_uInt8* )aSeq.getArray() , 0 , sal_True ) ; + pSeq = &aSeq ; + } + } + return *pSeq ; +} + +/* XUnoTunnel extension */ +X509Certificate_NssImpl* X509Certificate_NssImpl :: getImplementation( const Reference< XInterface > xObj ) { + Reference< XUnoTunnel > xUT( xObj , UNO_QUERY ) ; + if( xUT.is() ) { + return reinterpret_cast<X509Certificate_NssImpl*>( + sal::static_int_cast<sal_uIntPtr>(xUT->getSomething( getUnoTunnelId() ))); + } else + return NULL ; +} + +// MM : added by MM +::rtl::OUString getAlgorithmDescription(SECAlgorithmID *aid) +{ + SECOidTag tag; + tag = SECOID_GetAlgorithmTag(aid); + + const char *pDesc = SECOID_FindOIDTagDescription(tag); + + return rtl::OUString::createFromAscii( pDesc ) ; +} + +::com::sun::star::uno::Sequence< sal_Int8 > getThumbprint(CERTCertificate *pCert, SECOidTag id) +{ + if( pCert != NULL ) + { + unsigned char fingerprint[20]; + //char *fpStr = NULL; + SECItem fpItem; + int length = ((id == SEC_OID_MD5)?MD5_LENGTH:SHA1_LENGTH); + + memset(fingerprint, 0, sizeof fingerprint); + PK11_HashBuf(id, fingerprint, pCert->derCert.data, pCert->derCert.len); + fpItem.data = fingerprint; + fpItem.len = length; + //fpStr = CERT_Hexify(&fpItem, 1); + + Sequence< sal_Int8 > thumbprint( length ) ; + for( int i = 0 ; i < length ; i ++ ) + { + thumbprint[i] = fingerprint[i]; + } + + //PORT_Free(fpStr); + return thumbprint; + } + else + { + return ::com::sun::star::uno::Sequence< sal_Int8 >(); + } +} + +::rtl::OUString SAL_CALL X509Certificate_NssImpl::getSubjectPublicKeyAlgorithm() + throw ( ::com::sun::star::uno::RuntimeException) +{ + if( m_pCert != NULL ) + { + return getAlgorithmDescription(&(m_pCert->subjectPublicKeyInfo.algorithm)); + } + else + { + return OUString() ; + } +} + +::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL X509Certificate_NssImpl::getSubjectPublicKeyValue() + throw ( ::com::sun::star::uno::RuntimeException) +{ + if( m_pCert != NULL ) + { + SECItem spk = m_pCert->subjectPublicKeyInfo.subjectPublicKey; + DER_ConvertBitString(&spk); + + if ( spk.len>0) + { + Sequence< sal_Int8 > key( spk.len ) ; + for( unsigned int i = 0 ; i < spk.len ; i ++ ) + { + key[i] = *( spk.data + i ) ; + } + + return key ; + } + } + + return ::com::sun::star::uno::Sequence< sal_Int8 >(); +} + +::rtl::OUString SAL_CALL X509Certificate_NssImpl::getSignatureAlgorithm() + throw ( ::com::sun::star::uno::RuntimeException) +{ + if( m_pCert != NULL ) + { + return getAlgorithmDescription(&(m_pCert->signature)); + } + else + { + return OUString() ; + } +} + +::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL X509Certificate_NssImpl::getSHA1Thumbprint() + throw ( ::com::sun::star::uno::RuntimeException) +{ + return getThumbprint(m_pCert, SEC_OID_SHA1); +} + +::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL X509Certificate_NssImpl::getMD5Thumbprint() + throw ( ::com::sun::star::uno::RuntimeException) +{ + return getThumbprint(m_pCert, SEC_OID_MD5); +} + +sal_Int32 SAL_CALL X509Certificate_NssImpl::getCertificateUsage( ) + throw ( ::com::sun::star::uno::RuntimeException) +{ + SECStatus rv; + SECItem tmpitem; + sal_Int32 usage; + + rv = CERT_FindKeyUsageExtension(m_pCert, &tmpitem); + if ( rv == SECSuccess ) + { + usage = tmpitem.data[0]; + PORT_Free(tmpitem.data); + tmpitem.data = NULL; + } + else + { + usage = KU_ALL; + } + + /* + * to make the nss implementation compatible with MSCrypto, + * the following usage is ignored + * + * + if ( CERT_GovtApprovedBitSet(m_pCert) ) + { + usage |= KU_NS_GOVT_APPROVED; + } + */ + + return usage; +} + +// MM : end + diff --git a/xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.hxx b/xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.hxx new file mode 100644 index 000000000000..c486cb4a9e8c --- /dev/null +++ b/xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.hxx @@ -0,0 +1,108 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _X509CERTIFICATE_NSSIMPL_HXX_ +#define _X509CERTIFICATE_NSSIMPL_HXX_ + +#include <sal/config.h> +#include <rtl/ustring.hxx> +#include <cppuhelper/factory.hxx> +#include <cppuhelper/implbase2.hxx> +#include <com/sun/star/uno/Exception.hpp> +#include <com/sun/star/lang/XUnoTunnel.hpp> +#include "com/sun/star/uno/SecurityException.hpp" +#include <com/sun/star/security/XCertificate.hpp> + +#include "cert.h" + +class X509Certificate_NssImpl : public ::cppu::WeakImplHelper2< + ::com::sun::star::security::XCertificate , + ::com::sun::star::lang::XUnoTunnel > +{ + private : + CERTCertificate* m_pCert ; + + public : + X509Certificate_NssImpl() ; + virtual ~X509Certificate_NssImpl() ; + + //Methods from XCertificate + virtual sal_Int16 SAL_CALL getVersion( ) throw ( ::com::sun::star::uno::RuntimeException) ; + + virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getSerialNumber( ) throw ( ::com::sun::star::uno::RuntimeException) ; + + virtual ::rtl::OUString SAL_CALL getIssuerName( ) throw ( ::com::sun::star::uno::RuntimeException) ; + + virtual ::rtl::OUString SAL_CALL getSubjectName( ) throw ( ::com::sun::star::uno::RuntimeException) ; + + virtual ::com::sun::star::util::DateTime SAL_CALL getNotValidBefore( ) throw ( ::com::sun::star::uno::RuntimeException) ; + + virtual ::com::sun::star::util::DateTime SAL_CALL getNotValidAfter( ) throw ( ::com::sun::star::uno::RuntimeException) ; + + virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getIssuerUniqueID( ) throw ( ::com::sun::star::uno::RuntimeException) ; + + virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getSubjectUniqueID( ) throw ( ::com::sun::star::uno::RuntimeException) ; + + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::security::XCertificateExtension > > SAL_CALL getExtensions( ) throw ( ::com::sun::star::uno::RuntimeException) ; + + virtual ::com::sun::star::uno::Reference< ::com::sun::star::security::XCertificateExtension > SAL_CALL findCertificateExtension( const ::com::sun::star::uno::Sequence< sal_Int8 >& oid ) throw (::com::sun::star::uno::RuntimeException) ; + + virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getEncoded( ) throw ( ::com::sun::star::uno::RuntimeException) ; + + // MM : added by MM + virtual ::rtl::OUString SAL_CALL getSubjectPublicKeyAlgorithm() + throw ( ::com::sun::star::uno::RuntimeException) ; + + virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getSubjectPublicKeyValue() + throw ( ::com::sun::star::uno::RuntimeException) ; + + virtual ::rtl::OUString SAL_CALL getSignatureAlgorithm() + throw ( ::com::sun::star::uno::RuntimeException) ; + + virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getSHA1Thumbprint() + throw ( ::com::sun::star::uno::RuntimeException) ; + + virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getMD5Thumbprint() + throw ( ::com::sun::star::uno::RuntimeException) ; + + virtual sal_Int32 SAL_CALL getCertificateUsage( ) throw ( ::com::sun::star::uno::RuntimeException) ; + // MM : end + + //Methods from XUnoTunnel + virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw (com::sun::star::uno::RuntimeException); + + static const ::com::sun::star::uno::Sequence< sal_Int8 >& getUnoTunnelId() ; + static X509Certificate_NssImpl* getImplementation( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > xObj ) ; + + //Helper methods + void setCert( CERTCertificate* cert ) ; + const CERTCertificate* getNssCert() const ; + void setRawCert( ::com::sun::star::uno::Sequence< sal_Int8 > rawCert ) throw ( ::com::sun::star::uno::RuntimeException) ; +} ; + +#endif // _X509CERTIFICATE_NSSIMPL_HXX_ + diff --git a/xmlsecurity/source/xmlsec/nss/xmlencryption_nssimpl.cxx b/xmlsecurity/source/xmlsec/nss/xmlencryption_nssimpl.cxx new file mode 100644 index 000000000000..65da3caaf174 --- /dev/null +++ b/xmlsecurity/source/xmlsec/nss/xmlencryption_nssimpl.cxx @@ -0,0 +1,426 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_xmlsecurity.hxx" +#include <sal/config.h> +#include <rtl/uuid.h> +#include "xmlencryption_nssimpl.hxx" + +#ifndef _XMLDOCUMENTWRAPPER_XMLSECIMPL_HXX_ +#include "xmldocumentwrapper_xmlsecimpl.hxx" +#endif + +#ifndef _XMLELEMENTWRAPPER_XMLSECIMPL_HXX_ +#include "xmlelementwrapper_xmlsecimpl.hxx" +#endif + +#ifndef _SECURITYENVIRONMENT_NSSIMPL_HXX_ +#include "securityenvironment_nssimpl.hxx" +#endif +#include "errorcallback.hxx" + +#include <sal/types.h> +//For reasons that escape me, this is what xmlsec does when size_t is not 4 +#if SAL_TYPES_SIZEOFPOINTER != 4 +# define XMLSEC_NO_SIZE_T +#endif +#include "xmlsec/xmlsec.h" +#include "xmlsec/xmltree.h" +#include "xmlsec/xmlenc.h" +#include "xmlsec/crypto.h" + +#ifdef UNX +#define stricmp strcasecmp +#endif + +using namespace ::com::sun::star::uno ; +using namespace ::com::sun::star::lang ; +using ::com::sun::star::lang::XMultiServiceFactory ; +using ::com::sun::star::lang::XSingleServiceFactory ; +using ::rtl::OUString ; + +using ::com::sun::star::xml::wrapper::XXMLElementWrapper ; +using ::com::sun::star::xml::wrapper::XXMLDocumentWrapper ; +using ::com::sun::star::xml::crypto::XSecurityEnvironment ; +using ::com::sun::star::xml::crypto::XXMLEncryption ; +using ::com::sun::star::xml::crypto::XXMLEncryptionTemplate ; +using ::com::sun::star::xml::crypto::XXMLSecurityContext ; +using ::com::sun::star::xml::crypto::XSecurityEnvironment ; +using ::com::sun::star::xml::crypto::XMLEncryptionException ; + +XMLEncryption_NssImpl :: XMLEncryption_NssImpl( const Reference< XMultiServiceFactory >& aFactory ) : m_xServiceManager( aFactory ) { +} + +XMLEncryption_NssImpl :: ~XMLEncryption_NssImpl() { +} + +/* XXMLEncryption */ +Reference< XXMLEncryptionTemplate > +SAL_CALL XMLEncryption_NssImpl :: encrypt( + const Reference< XXMLEncryptionTemplate >& aTemplate , + const Reference< XSecurityEnvironment >& aEnvironment +) throw( com::sun::star::xml::crypto::XMLEncryptionException, + com::sun::star::uno::SecurityException ) +{ + xmlSecKeysMngrPtr pMngr = NULL ; + xmlSecEncCtxPtr pEncCtx = NULL ; + xmlNodePtr pEncryptedData = NULL ; + xmlNodePtr pContent = NULL ; + + if( !aTemplate.is() ) + throw RuntimeException() ; + + if( !aEnvironment.is() ) + throw RuntimeException() ; + + //Get Keys Manager + Reference< XUnoTunnel > xSecTunnel( aEnvironment , UNO_QUERY ) ; + if( !xSecTunnel.is() ) { + throw RuntimeException() ; + } + +#if 0 + XMLSecurityContext_NssImpl* pSecCtxt = ( XMLSecurityContext_NssImpl* )xSecTunnel->getSomething( XMLSecurityContext_NssImpl::getUnoTunnelId() ) ; + if( pSecCtxt == NULL ) + throw RuntimeException() ; +#endif + + SecurityEnvironment_NssImpl* pSecEnv = + reinterpret_cast<SecurityEnvironment_NssImpl*>( + sal::static_int_cast<sal_uIntPtr>(xSecTunnel->getSomething( SecurityEnvironment_NssImpl::getUnoTunnelId() ))) ; + if( pSecEnv == NULL ) + throw RuntimeException() ; + + //Get the encryption template + Reference< XXMLElementWrapper > xTemplate = aTemplate->getTemplate() ; + if( !xTemplate.is() ) { + throw RuntimeException() ; + } + + Reference< XUnoTunnel > xTplTunnel( xTemplate , UNO_QUERY ) ; + if( !xTplTunnel.is() ) { + throw RuntimeException() ; + } + + XMLElementWrapper_XmlSecImpl* pTemplate = + reinterpret_cast<XMLElementWrapper_XmlSecImpl*>( + sal::static_int_cast<sal_uIntPtr>( + xTplTunnel->getSomething( XMLElementWrapper_XmlSecImpl::getUnoTunnelImplementationId() ))); + if( pTemplate == NULL ) { + throw RuntimeException() ; + } + + //MM : Get the element to be encrypted + Reference< XXMLElementWrapper > xTarget = aTemplate->getTarget() ; + if( !xTarget.is() ) { + throw XMLEncryptionException() ; + } + + Reference< XUnoTunnel > xTgtTunnel( xTarget , UNO_QUERY ) ; + if( !xTgtTunnel.is() ) { + throw XMLEncryptionException() ; + } + + XMLElementWrapper_XmlSecImpl* pTarget = + reinterpret_cast<XMLElementWrapper_XmlSecImpl*>( + sal::static_int_cast<sal_uIntPtr>( + xTgtTunnel->getSomething( XMLElementWrapper_XmlSecImpl::getUnoTunnelImplementationId() ))); + if( pTarget == NULL ) { + throw RuntimeException() ; + } + + pContent = pTarget->getNativeElement() ; + //MM : end + + if( pContent == NULL ) { + throw XMLEncryptionException() ; + } + + /* MM : remove the following 2 lines + xmlUnlinkNode(pContent); + xmlAddNextSibling(pEncryptedData, pContent); + */ + + //remember the position of the element to be signed + sal_Bool isParentRef = sal_True; + xmlNodePtr pParent = pEncryptedData->parent; + xmlNodePtr referenceNode; + + if (pEncryptedData == pParent->children) + { + referenceNode = pParent; + } + else + { + referenceNode = pEncryptedData->prev; + isParentRef = sal_False; + } + + setErrorRecorder( ); + + pMngr = pSecEnv->createKeysManager() ; //i39448 + if( !pMngr ) { + throw RuntimeException() ; + } + + //Create Encryption context + pEncCtx = xmlSecEncCtxCreate( pMngr ) ; + if( pEncCtx == NULL ) + { + pSecEnv->destroyKeysManager( pMngr ) ; //i39448 + //throw XMLEncryptionException() ; + clearErrorRecorder(); + return aTemplate; + } + + pEncryptedData = pTemplate->getNativeElement() ; + + //Find the element to be encrypted. + /* MM : remove the old method to get the target element + //This element is wrapped in the CipherValue sub-element. + xmlNodePtr pCipherData = pEncryptedData->children; + while (pCipherData != NULL && stricmp((const char *)(pCipherData->name), "CipherData")) + { + pCipherData = pCipherData->next; + } + + if( pCipherData == NULL ) { + xmlSecEncCtxDestroy( pEncCtx ) ; + throw XMLEncryptionException() ; + } + + xmlNodePtr pCipherValue = pCipherData->children; + while (pCipherValue != NULL && stricmp((const char *)(pCipherValue->name), "CipherValue")) + { + pCipherValue = pCipherValue->next; + } + + if( pCipherValue == NULL ) { + xmlSecEncCtxDestroy( pEncCtx ) ; + throw XMLEncryptionException() ; + } + + pContent = pCipherValue->children; + */ + + //Encrypt the template + if( xmlSecEncCtxXmlEncrypt( pEncCtx , pEncryptedData , pContent ) < 0 ) + { + xmlSecEncCtxDestroy( pEncCtx ) ; + pSecEnv->destroyKeysManager( pMngr ) ; //i39448 + + //throw XMLEncryptionException() ; + clearErrorRecorder(); + return aTemplate; + } + + xmlSecEncCtxDestroy( pEncCtx ) ; + pSecEnv->destroyKeysManager( pMngr ) ; //i39448 + + //get the new EncryptedData element + if (isParentRef) + { + pTemplate->setNativeElement(referenceNode->children) ; + } + else + { + pTemplate->setNativeElement(referenceNode->next); + } + + return aTemplate ; +} + +/* XXMLEncryption */ +Reference< XXMLEncryptionTemplate > +SAL_CALL XMLEncryption_NssImpl :: decrypt( + const Reference< XXMLEncryptionTemplate >& aTemplate , + const Reference< XXMLSecurityContext >& aSecurityCtx +) throw( com::sun::star::xml::crypto::XMLEncryptionException , + com::sun::star::uno::SecurityException) { + xmlSecKeysMngrPtr pMngr = NULL ; + xmlSecEncCtxPtr pEncCtx = NULL ; + xmlNodePtr pEncryptedData = NULL ; + + if( !aTemplate.is() ) + throw RuntimeException() ; + + if( !aSecurityCtx.is() ) + throw RuntimeException() ; + + //Get the encryption template + Reference< XXMLElementWrapper > xTemplate = aTemplate->getTemplate() ; + if( !xTemplate.is() ) { + throw RuntimeException() ; + } + + Reference< XUnoTunnel > xTplTunnel( xTemplate , UNO_QUERY ) ; + if( !xTplTunnel.is() ) { + throw RuntimeException() ; + } + + XMLElementWrapper_XmlSecImpl* pTemplate = + reinterpret_cast<XMLElementWrapper_XmlSecImpl*>( + sal::static_int_cast<sal_uIntPtr>( + xTplTunnel->getSomething( XMLElementWrapper_XmlSecImpl::getUnoTunnelImplementationId() ))); + if( pTemplate == NULL ) { + throw RuntimeException() ; + } + + pEncryptedData = pTemplate->getNativeElement() ; + + //remember the position of the element to be signed + sal_Bool isParentRef = sal_True; + xmlNodePtr pParent = pEncryptedData->parent; + xmlNodePtr referenceNode; + + if (pEncryptedData == pParent->children) + { + referenceNode = pParent; + } + else + { + referenceNode = pEncryptedData->prev; + isParentRef = sal_False; + } + + setErrorRecorder( ); + + sal_Int32 nSecurityEnvironment = aSecurityCtx->getSecurityEnvironmentNumber(); + sal_Int32 i; + + for (i=0; i<nSecurityEnvironment; ++i) + { + Reference< XSecurityEnvironment > aEnvironment = aSecurityCtx->getSecurityEnvironmentByIndex(i); + + //Get Keys Manager + Reference< XUnoTunnel > xSecTunnel( aEnvironment , UNO_QUERY ) ; + if( !aEnvironment.is() ) { + throw RuntimeException() ; + } + + SecurityEnvironment_NssImpl* pSecEnv = + reinterpret_cast<SecurityEnvironment_NssImpl*>( + sal::static_int_cast<sal_uIntPtr>( + xSecTunnel->getSomething( SecurityEnvironment_NssImpl::getUnoTunnelId() ))); + if( pSecEnv == NULL ) + throw RuntimeException() ; + + pMngr = pSecEnv->createKeysManager() ; //i39448 + if( !pMngr ) { + throw RuntimeException() ; + } + + //Create Encryption context + pEncCtx = xmlSecEncCtxCreate( pMngr ) ; + if( pEncCtx == NULL ) + { + pSecEnv->destroyKeysManager( pMngr ) ; //i39448 + //throw XMLEncryptionException() ; + clearErrorRecorder(); + return aTemplate; + } + + //Decrypt the template + if(!( xmlSecEncCtxDecrypt( pEncCtx , pEncryptedData ) < 0 || pEncCtx->result == NULL )) + { + //The decryption succeeds + + //Destroy the encryption context + xmlSecEncCtxDestroy( pEncCtx ) ; + pSecEnv->destroyKeysManager( pMngr ) ; //i39448 + + //get the decrypted element + XMLElementWrapper_XmlSecImpl * ret = new XMLElementWrapper_XmlSecImpl(isParentRef? + (referenceNode->children):(referenceNode->next)); + + //return ret; + aTemplate->setTemplate(ret); + break; + } + else + { + //The decryption fails, continue with the next security environment + xmlSecEncCtxDestroy( pEncCtx ) ; + pSecEnv->destroyKeysManager( pMngr ) ; //i39448 + } + } + + clearErrorRecorder(); + return aTemplate; +} + +/* XInitialization */ +void SAL_CALL XMLEncryption_NssImpl :: initialize( const Sequence< Any >& /*aArguments*/ ) throw( Exception, RuntimeException ) { + // TBD +} ; + +/* XServiceInfo */ +OUString SAL_CALL XMLEncryption_NssImpl :: getImplementationName() throw( RuntimeException ) { + return impl_getImplementationName() ; +} + +/* XServiceInfo */ +sal_Bool SAL_CALL XMLEncryption_NssImpl :: supportsService( const OUString& serviceName) throw( RuntimeException ) { + Sequence< OUString > seqServiceNames = getSupportedServiceNames() ; + const OUString* pArray = seqServiceNames.getConstArray() ; + for( sal_Int32 i = 0 ; i < seqServiceNames.getLength() ; i ++ ) { + if( *( pArray + i ) == serviceName ) + return sal_True ; + } + return sal_False ; +} + +/* XServiceInfo */ +Sequence< OUString > SAL_CALL XMLEncryption_NssImpl :: getSupportedServiceNames() throw( RuntimeException ) { + return impl_getSupportedServiceNames() ; +} + +//Helper for XServiceInfo +Sequence< OUString > XMLEncryption_NssImpl :: impl_getSupportedServiceNames() { + ::osl::Guard< ::osl::Mutex > aGuard( ::osl::Mutex::getGlobalMutex() ) ; + Sequence< OUString > seqServiceNames( 1 ) ; + seqServiceNames.getArray()[0] = OUString::createFromAscii( "com.sun.star.xml.crypto.XMLEncryption" ) ; + return seqServiceNames ; +} + +OUString XMLEncryption_NssImpl :: impl_getImplementationName() throw( RuntimeException ) { + return OUString::createFromAscii( "com.sun.star.xml.security.bridge.xmlsec.XMLEncryption_NssImpl" ) ; +} + +//Helper for registry +Reference< XInterface > SAL_CALL XMLEncryption_NssImpl :: impl_createInstance( const Reference< XMultiServiceFactory >& aServiceManager ) throw( RuntimeException ) { + return Reference< XInterface >( *new XMLEncryption_NssImpl( aServiceManager ) ) ; +} + +Reference< XSingleServiceFactory > XMLEncryption_NssImpl :: impl_createFactory( const Reference< XMultiServiceFactory >& aServiceManager ) { + //Reference< XSingleServiceFactory > xFactory ; + //xFactory = ::cppu::createSingleFactory( aServiceManager , impl_getImplementationName , impl_createInstance , impl_getSupportedServiceNames ) ; + //return xFactory ; + return ::cppu::createSingleFactory( aServiceManager , impl_getImplementationName() , impl_createInstance , impl_getSupportedServiceNames() ) ; +} + diff --git a/xmlsecurity/source/xmlsec/nss/xmlencryption_nssimpl.hxx b/xmlsecurity/source/xmlsec/nss/xmlencryption_nssimpl.hxx new file mode 100644 index 000000000000..42484532fcae --- /dev/null +++ b/xmlsecurity/source/xmlsec/nss/xmlencryption_nssimpl.hxx @@ -0,0 +1,102 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _XMLENCRYPTION_NSSIMPL_HXX_ +#define _XMLENCRYPTION_NSSIMPL_HXX_ + +#include <sal/config.h> +#include <rtl/ustring.hxx> +#include <cppuhelper/factory.hxx> +#include <cppuhelper/implbase3.hxx> +#include <com/sun/star/uno/Exception.hpp> + +#ifndef _COM_SUN_STAR_UNO_REFERENCE_HPP_ +#include <com/sun/star/uno/Reference.hxx> +#endif +#include <com/sun/star/lang/XSingleServiceFactory.hpp> + +#ifndef _COM_SUN_STAR_LANG_XSECVICEINFO_HPP_ +#include <com/sun/star/lang/XServiceInfo.hpp> +#endif +#include <com/sun/star/lang/XInitialization.hpp> +#include <com/sun/star/xml/crypto/XXMLEncryption.hpp> +#include <com/sun/star/xml/crypto/XXMLEncryptionTemplate.hpp> +#include <com/sun/star/xml/crypto/XXMLSecurityContext.hpp> + +class XMLEncryption_NssImpl : public ::cppu::WeakImplHelper3< + ::com::sun::star::xml::crypto::XXMLEncryption , + ::com::sun::star::lang::XInitialization , + ::com::sun::star::lang::XServiceInfo > +{ + private : + ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xServiceManager ; + + public : + XMLEncryption_NssImpl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& aFactory ) ; + virtual ~XMLEncryption_NssImpl() ; + + //Methods from XXMLEncryption + virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XXMLEncryptionTemplate > SAL_CALL encrypt( + const ::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XXMLEncryptionTemplate >& aTemplate , + const ::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XSecurityEnvironment >& aEnvironment) + // ) throw( ::com::sun::star::uno::Exception , ::com::sun::star::uno::RuntimeException ) ; + throw ( com::sun::star::xml::crypto::XMLEncryptionException , + com::sun::star::uno::SecurityException); + + virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XXMLEncryptionTemplate > SAL_CALL decrypt( + const ::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XXMLEncryptionTemplate >& aTemplate , + const ::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XXMLSecurityContext >& aContext + ) throw( com::sun::star::xml::crypto::XMLEncryptionException , + com::sun::star::uno::SecurityException) ; + + //Methods from XInitialization + virtual void SAL_CALL initialize( + const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments + ) throw( ::com::sun::star::uno::Exception , ::com::sun::star::uno::RuntimeException ) ; + + //Methods from XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException ) ; + + virtual sal_Bool SAL_CALL supportsService( + const ::rtl::OUString& ServiceName + ) throw( ::com::sun::star::uno::RuntimeException ) ; + + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException ) ; + + //Helper for XServiceInfo + static ::com::sun::star::uno::Sequence< ::rtl::OUString > impl_getSupportedServiceNames() ; + + static ::rtl::OUString impl_getImplementationName() throw( ::com::sun::star::uno::RuntimeException ) ; + + //Helper for registry + static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL impl_createInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& aServiceManager ) throw( ::com::sun::star::uno::RuntimeException ) ; + + static ::com::sun::star::uno::Reference< ::com::sun::star::lang::XSingleServiceFactory > impl_createFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& aServiceManager ) ; +} ; + +#endif // _XMLENCRYPTION_NSSIMPL_HXX_ + diff --git a/xmlsecurity/source/xmlsec/nss/xmlsecuritycontext_nssimpl.cxx b/xmlsecurity/source/xmlsec/nss/xmlsecuritycontext_nssimpl.cxx new file mode 100644 index 000000000000..ca881d0ee92b --- /dev/null +++ b/xmlsecurity/source/xmlsec/nss/xmlsecuritycontext_nssimpl.cxx @@ -0,0 +1,325 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_xmlsecurity.hxx" +#include <sal/config.h> +#include <rtl/uuid.h> +#include "securityenvironment_nssimpl.hxx" + +#ifndef _XMLSECURITYCONTEXT_NSSIMPL_HXX_ +#include "xmlsecuritycontext_nssimpl.hxx" +#endif +#include "xmlstreamio.hxx" + +#include <sal/types.h> +//For reasons that escape me, this is what xmlsec does when size_t is not 4 +#if SAL_TYPES_SIZEOFPOINTER != 4 +# define XMLSEC_NO_SIZE_T +#endif +#include "xmlsec/xmlsec.h" +#include "xmlsec/keysmngr.h" +#include "xmlsec/crypto.h" + +using namespace ::com::sun::star::uno ; +using namespace ::com::sun::star::lang ; +using ::com::sun::star::lang::XMultiServiceFactory ; +using ::com::sun::star::lang::XSingleServiceFactory ; +using ::rtl::OUString ; + +using ::com::sun::star::xml::crypto::XSecurityEnvironment ; +using ::com::sun::star::xml::crypto::XXMLSecurityContext ; + +XMLSecurityContext_NssImpl :: XMLSecurityContext_NssImpl( const Reference< XMultiServiceFactory >& aFactory ) + ://i39448 : m_pKeysMngr( NULL ) , + m_xServiceManager( aFactory ) , + m_nDefaultEnvIndex(-1) + //m_xSecurityEnvironment( NULL ) +{ + //Init xmlsec library + if( xmlSecInit() < 0 ) { + throw RuntimeException() ; + } + + //Init xmlsec crypto engine library + if( xmlSecCryptoInit() < 0 ) { + xmlSecShutdown() ; + throw RuntimeException() ; + } + + //Enable external stream handlers + if( xmlEnableStreamInputCallbacks() < 0 ) { + xmlSecCryptoShutdown() ; + xmlSecShutdown() ; + throw RuntimeException() ; + } +} + +XMLSecurityContext_NssImpl :: ~XMLSecurityContext_NssImpl() { +#if 0 //i39448 + if( m_pKeysMngr != NULL ) { + xmlSecKeysMngrDestroy( m_pKeysMngr ) ; + } +#endif + + xmlDisableStreamInputCallbacks() ; + xmlSecCryptoShutdown() ; + xmlSecShutdown() ; +} + +//i39448 : new methods +sal_Int32 SAL_CALL XMLSecurityContext_NssImpl::addSecurityEnvironment( + const ::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XSecurityEnvironment >& aSecurityEnvironment) + throw (::com::sun::star::security::SecurityInfrastructureException, ::com::sun::star::uno::RuntimeException) +{ + if( !aSecurityEnvironment.is() ) + { + throw RuntimeException() ; + } + + m_vSecurityEnvironments.push_back( aSecurityEnvironment ); + + return m_vSecurityEnvironments.size() - 1 ; +} + + +sal_Int32 SAL_CALL XMLSecurityContext_NssImpl::getSecurityEnvironmentNumber( ) + throw (::com::sun::star::uno::RuntimeException) +{ + return m_vSecurityEnvironments.size(); +} + +::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XSecurityEnvironment > SAL_CALL + XMLSecurityContext_NssImpl::getSecurityEnvironmentByIndex( sal_Int32 index ) + throw (::com::sun::star::uno::RuntimeException) +{ + ::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XSecurityEnvironment > xSecurityEnvironment; + + if (index >= 0 && index < ( sal_Int32 )m_vSecurityEnvironments.size()) + { + xSecurityEnvironment = m_vSecurityEnvironments[index]; + } + else + throw RuntimeException() ; + + return xSecurityEnvironment; +} + +::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XSecurityEnvironment > SAL_CALL + XMLSecurityContext_NssImpl::getSecurityEnvironment( ) + throw (::com::sun::star::uno::RuntimeException) +{ + if (m_nDefaultEnvIndex >= 0 && m_nDefaultEnvIndex < ( sal_Int32 )m_vSecurityEnvironments.size()) + return getSecurityEnvironmentByIndex(m_nDefaultEnvIndex); + else + throw RuntimeException() ; +} + +sal_Int32 SAL_CALL XMLSecurityContext_NssImpl::getDefaultSecurityEnvironmentIndex( ) + throw (::com::sun::star::uno::RuntimeException) +{ + return m_nDefaultEnvIndex ; +} + +void SAL_CALL XMLSecurityContext_NssImpl::setDefaultSecurityEnvironmentIndex( sal_Int32 nDefaultEnvIndex ) + throw (::com::sun::star::uno::RuntimeException) +{ + m_nDefaultEnvIndex = nDefaultEnvIndex; +} + +#if 0 //i39448 : old methods should be deleted +/* XXMLSecurityContext */ +void SAL_CALL XMLSecurityContext_NssImpl :: setSecurityEnvironment( const Reference< XSecurityEnvironment >& aSecurityEnvironment ) throw( com::sun::star::security::SecurityInfrastructureException ) { + PK11SlotInfo* slot ; + CERTCertDBHandle* handler ; + //xmlSecKeyPtr key ; + //xmlSecKeyDataPtr keyData ; + PK11SymKey* symKey ; + SECKEYPublicKey* pubKey ; + SECKEYPrivateKey* priKey ; + unsigned int i ; + + if( !aSecurityEnvironment.is() ) + throw RuntimeException() ; + + m_xSecurityEnvironment = aSecurityEnvironment ; + + //Clear key manager + if( m_pKeysMngr != NULL ) { + xmlSecKeysMngrDestroy( m_pKeysMngr ) ; + m_pKeysMngr = NULL ; + } + + //Create key manager + Reference< XUnoTunnel > xEnvTunnel( m_xSecurityEnvironment , UNO_QUERY ) ; + if( !xEnvTunnel.is() ) { + throw RuntimeException() ;^1 + } + + SecurityEnvironment_NssImpl* pSecEnv = ( SecurityEnvironment_NssImpl* )xEnvTunnel->getSomething( SecurityEnvironment_NssImpl::getUnoTunnelId() ) ; + if( pSecEnv == NULL ) + throw RuntimeException() ; + + //todo +// slot = pSecEnv->getCryptoSlot() ; + handler = pSecEnv->getCertDb() ; + + /*- + * The following lines is based on the private version of xmlSec-NSS + * crypto engine + */ + m_pKeysMngr = xmlSecNssAppliedKeysMngrCreate( slot , handler ) ; + if( m_pKeysMngr == NULL ) + throw RuntimeException() ; + + /*- + * Adopt symmetric key into keys manager + */ + for( i = 0 ; ( symKey = pSecEnv->getSymKey( i ) ) != NULL ; i ++ ) { + if( xmlSecNssAppliedKeysMngrSymKeyLoad( m_pKeysMngr, symKey ) < 0 ) { + throw RuntimeException() ; + } + } + + /*- + * Adopt asymmetric public key into keys manager + */ + for( i = 0 ; ( pubKey = pSecEnv->getPubKey( i ) ) != NULL ; i ++ ) { + if( xmlSecNssAppliedKeysMngrPubKeyLoad( m_pKeysMngr, pubKey ) < 0 ) { + throw RuntimeException() ; + } + } + + /*- + * Adopt asymmetric private key into keys manager + */ + for( i = 0 ; ( priKey = pSecEnv->getPriKey( i ) ) != NULL ; i ++ ) { + if( xmlSecNssAppliedKeysMngrPriKeyLoad( m_pKeysMngr, priKey ) < 0 ) { + throw RuntimeException() ; + } + } +} + +/* XXMLSecurityContext */ +Reference< XSecurityEnvironment > SAL_CALL XMLSecurityContext_NssImpl :: getSecurityEnvironment() + throw (RuntimeException) +{ + return m_xSecurityEnvironment ; +} +#endif + + +/* XInitialization */ +void SAL_CALL XMLSecurityContext_NssImpl :: initialize( const Sequence< Any >& /*aArguments*/ ) throw( Exception, RuntimeException ) { + // TBD +} ; + +/* XServiceInfo */ +OUString SAL_CALL XMLSecurityContext_NssImpl :: getImplementationName() throw( RuntimeException ) { + return impl_getImplementationName() ; +} + +/* XServiceInfo */ +sal_Bool SAL_CALL XMLSecurityContext_NssImpl :: supportsService( const OUString& serviceName) throw( RuntimeException ) { + Sequence< OUString > seqServiceNames = getSupportedServiceNames() ; + const OUString* pArray = seqServiceNames.getConstArray() ; + for( sal_Int32 i = 0 ; i < seqServiceNames.getLength() ; i ++ ) { + if( *( pArray + i ) == serviceName ) + return sal_True ; + } + return sal_False ; +} + +/* XServiceInfo */ +Sequence< OUString > SAL_CALL XMLSecurityContext_NssImpl :: getSupportedServiceNames() throw( RuntimeException ) { + return impl_getSupportedServiceNames() ; +} + +//Helper for XServiceInfo +Sequence< OUString > XMLSecurityContext_NssImpl :: impl_getSupportedServiceNames() { + ::osl::Guard< ::osl::Mutex > aGuard( ::osl::Mutex::getGlobalMutex() ) ; + Sequence< OUString > seqServiceNames( 1 ) ; + seqServiceNames.getArray()[0] = OUString::createFromAscii( "com.sun.star.xml.crypto.XMLSecurityContext" ) ; + return seqServiceNames ; +} + +OUString XMLSecurityContext_NssImpl :: impl_getImplementationName() throw( RuntimeException ) { + return OUString::createFromAscii( "com.sun.star.xml.security.bridge.xmlsec.XMLSecurityContext_NssImpl" ) ; +} + +//Helper for registry +Reference< XInterface > SAL_CALL XMLSecurityContext_NssImpl :: impl_createInstance( const Reference< XMultiServiceFactory >& aServiceManager ) throw( RuntimeException ) { + return Reference< XInterface >( *new XMLSecurityContext_NssImpl( aServiceManager ) ) ; +} + +Reference< XSingleServiceFactory > XMLSecurityContext_NssImpl :: impl_createFactory( const Reference< XMultiServiceFactory >& aServiceManager ) { + //Reference< XSingleServiceFactory > xFactory ; + //xFactory = ::cppu::createSingleFactory( aServiceManager , impl_getImplementationName , impl_createInstance , impl_getSupportedServiceNames ) ; + //return xFactory ; + return ::cppu::createSingleFactory( aServiceManager , impl_getImplementationName() , impl_createInstance , impl_getSupportedServiceNames() ) ; +} + +#if 0 //not useful any longer +/* XUnoTunnel */ +sal_Int64 SAL_CALL XMLSecurityContext_NssImpl :: getSomething( const Sequence< sal_Int8 >& aIdentifier ) +throw (RuntimeException) +{ + if( aIdentifier.getLength() == 16 && 0 == rtl_compareMemory( getUnoTunnelId().getConstArray(), aIdentifier.getConstArray(), 16 ) ) { + return ( sal_Int64 )this ; + } + return 0 ; +} + +/* XUnoTunnel extension */ +const Sequence< sal_Int8>& XMLSecurityContext_NssImpl :: getUnoTunnelId() { + static Sequence< sal_Int8 >* pSeq = 0 ; + if( !pSeq ) { + ::osl::Guard< ::osl::Mutex > aGuard( ::osl::Mutex::getGlobalMutex() ) ; + if( !pSeq ) { + static Sequence< sal_Int8> aSeq( 16 ) ; + rtl_createUuid( ( sal_uInt8* )aSeq.getArray() , 0 , sal_True ) ; + pSeq = &aSeq ; + } + } + return *pSeq ; +} + +/* XUnoTunnel extension */ +XMLSecurityContext_NssImpl* XMLSecurityContext_NssImpl :: getImplementation( const Reference< XInterface > xObj ) { + Reference< XUnoTunnel > xUT( xObj , UNO_QUERY ) ; + if( xUT.is() ) { + return ( XMLSecurityContext_NssImpl* )xUT->getSomething( getUnoTunnelId() ) ; + } else + return NULL ; +} + +/* Native methods */ +xmlSecKeysMngrPtr XMLSecurityContext_NssImpl :: keysManager() throw( Exception, RuntimeException ) { + return m_pKeysMngr ; +} + +#endif diff --git a/xmlsecurity/source/xmlsec/nss/xmlsecuritycontext_nssimpl.hxx b/xmlsecurity/source/xmlsec/nss/xmlsecuritycontext_nssimpl.hxx new file mode 100644 index 000000000000..b75f2d0c0c72 --- /dev/null +++ b/xmlsecurity/source/xmlsec/nss/xmlsecuritycontext_nssimpl.hxx @@ -0,0 +1,139 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _XMLSIGNATURECONTEXT_NSSIMPL_HXX_ +#define _XMLSIGNATURECONTEXT_NSSIMPL_HXX_ + +#include <sal/config.h> +#include <rtl/ustring.hxx> +#include <cppuhelper/factory.hxx> +#include <cppuhelper/implbase3.hxx> +#include <com/sun/star/uno/Exception.hpp> + +#ifndef _COM_SUN_STAR_UNO_REFERENCE_HPP_ +#include <com/sun/star/uno/Reference.hxx> +#endif +#include <com/sun/star/lang/XSingleServiceFactory.hpp> + +#ifndef _COM_SUN_STAR_LANG_XSECVICEINFO_HPP_ +#include <com/sun/star/lang/XServiceInfo.hpp> +#endif +#include <com/sun/star/lang/XInitialization.hpp> +#include <com/sun/star/lang/XUnoTunnel.hpp> +#include <com/sun/star/xml/crypto/XSecurityEnvironment.hpp> +#include <com/sun/star/xml/crypto/XXMLSecurityContext.hpp> + +#ifndef INCLUDED_VECTOR +#include <vector> +#define INCLUDED_VECTOR +#endif + +class XMLSecurityContext_NssImpl : public ::cppu::WeakImplHelper3< + ::com::sun::star::xml::crypto::XXMLSecurityContext , + ::com::sun::star::lang::XInitialization , + ::com::sun::star::lang::XServiceInfo > +{ + private : + //xmlSecKeysMngrPtr m_pKeysMngr ; + //::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XSecurityEnvironment > m_xSecurityEnvironment ; + std::vector< ::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XSecurityEnvironment > > m_vSecurityEnvironments; + + ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xServiceManager ; + + sal_Int32 m_nDefaultEnvIndex; + + public : + XMLSecurityContext_NssImpl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& aFactory ) ; + virtual ~XMLSecurityContext_NssImpl() ; + + //Methods from XXMLSecurityContext + virtual sal_Int32 SAL_CALL addSecurityEnvironment( + const ::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XSecurityEnvironment >& aSecurityEnvironment + ) throw (::com::sun::star::security::SecurityInfrastructureException, ::com::sun::star::uno::RuntimeException); + + virtual ::sal_Int32 SAL_CALL getSecurityEnvironmentNumber( ) + throw (::com::sun::star::uno::RuntimeException); + + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::xml::crypto::XSecurityEnvironment > SAL_CALL + getSecurityEnvironmentByIndex( ::sal_Int32 index ) + throw (::com::sun::star::uno::RuntimeException); + + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::xml::crypto::XSecurityEnvironment > SAL_CALL + getSecurityEnvironment( ) + throw (::com::sun::star::uno::RuntimeException); + + virtual ::sal_Int32 SAL_CALL getDefaultSecurityEnvironmentIndex( ) + throw (::com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL setDefaultSecurityEnvironmentIndex( sal_Int32 nDefaultEnvIndex ) + throw (::com::sun::star::uno::RuntimeException); + + //Methods from XInitialization + virtual void SAL_CALL initialize( + const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments + ) throw( ::com::sun::star::uno::Exception , ::com::sun::star::uno::RuntimeException ) ; + + //Methods from XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException ) ; + + virtual sal_Bool SAL_CALL supportsService( + const ::rtl::OUString& ServiceName + ) throw( ::com::sun::star::uno::RuntimeException ) ; + + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException ) ; + + //Helper for XServiceInfo + static ::com::sun::star::uno::Sequence< ::rtl::OUString > impl_getSupportedServiceNames() ; + + static ::rtl::OUString impl_getImplementationName() throw( ::com::sun::star::uno::RuntimeException ) ; + + //Helper for registry + static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL impl_createInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& aServiceManager ) throw( ::com::sun::star::uno::RuntimeException ) ; + + static ::com::sun::star::uno::Reference< ::com::sun::star::lang::XSingleServiceFactory > impl_createFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& aServiceManager ) ; + + /* + * Because of the issue of multi-securityenvironment, so the keyManager method is not useful any longer. + * + + //Methods from XUnoTunnel + virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) + throw (com::sun::star::uno::RuntimeException); + + static const ::com::sun::star::uno::Sequence< sal_Int8 >& getUnoTunnelId() ; + static XMLSecurityContext_NssImpl* getImplementation( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > xObj ) ; + + //Native mehtods + virtual xmlSecKeysMngrPtr keysManager() throw( ::com::sun::star::uno::Exception , ::com::sun::star::uno::RuntimeException ) ; + + */ +} ; + +#endif // _XMLSIGNATURECONTEXT_NSSIMPL_HXX_ + diff --git a/xmlsecurity/source/xmlsec/nss/xmlsignature_nssimpl.cxx b/xmlsecurity/source/xmlsec/nss/xmlsignature_nssimpl.cxx new file mode 100644 index 000000000000..5f03b54580df --- /dev/null +++ b/xmlsecurity/source/xmlsec/nss/xmlsignature_nssimpl.cxx @@ -0,0 +1,354 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_xmlsecurity.hxx" +#include <sal/config.h> +#include <rtl/uuid.h> +#include "xmlsignature_nssimpl.hxx" + +#ifndef _XMLDOCUMENTWRAPPER_XMLSECIMPL_HXX_ +#include "xmldocumentwrapper_xmlsecimpl.hxx" +#endif + +#ifndef _XMLELEMENTWRAPPER_XMLSECIMPL_HXX_ +#include "xmlelementwrapper_xmlsecimpl.hxx" +#endif + +#ifndef _SECURITYENVIRONMENT_NSSIMPL_HXX_ +#include "securityenvironment_nssimpl.hxx" +#endif + +#ifndef _XMLSECURITYCONTEXT_NSSIMPL_HXX_ +#include "xmlsecuritycontext_nssimpl.hxx" +#endif +#include "xmlstreamio.hxx" +#include "errorcallback.hxx" + +#include <sal/types.h> +//For reasons that escape me, this is what xmlsec does when size_t is not 4 +#if SAL_TYPES_SIZEOFPOINTER != 4 +# define XMLSEC_NO_SIZE_T +#endif +#include "xmlsec/xmlsec.h" +#include "xmlsec/xmldsig.h" +#include "xmlsec/crypto.h" + +using namespace ::com::sun::star::uno ; +using namespace ::com::sun::star::lang ; +using ::com::sun::star::lang::XMultiServiceFactory ; +using ::com::sun::star::lang::XSingleServiceFactory ; +using ::rtl::OUString ; + +using ::com::sun::star::xml::wrapper::XXMLElementWrapper ; +using ::com::sun::star::xml::wrapper::XXMLDocumentWrapper ; +using ::com::sun::star::xml::crypto::XSecurityEnvironment ; +using ::com::sun::star::xml::crypto::XXMLSignature ; +using ::com::sun::star::xml::crypto::XXMLSignatureTemplate ; +using ::com::sun::star::xml::crypto::XSecurityEnvironment ; +using ::com::sun::star::xml::crypto::XXMLSecurityContext ; +using ::com::sun::star::xml::crypto::XUriBinding ; +using ::com::sun::star::xml::crypto::XMLSignatureException ; + +XMLSignature_NssImpl :: XMLSignature_NssImpl( const Reference< XMultiServiceFactory >& aFactory ) : m_xServiceManager( aFactory ) { +} + +XMLSignature_NssImpl :: ~XMLSignature_NssImpl() { +} + +/* XXMLSignature */ +Reference< XXMLSignatureTemplate > +SAL_CALL XMLSignature_NssImpl :: generate( + const Reference< XXMLSignatureTemplate >& aTemplate , + const Reference< XSecurityEnvironment >& aEnvironment +) throw( com::sun::star::xml::crypto::XMLSignatureException, + com::sun::star::uno::SecurityException ) +{ + xmlSecKeysMngrPtr pMngr = NULL ; + xmlSecDSigCtxPtr pDsigCtx = NULL ; + xmlNodePtr pNode = NULL ; + + if( !aTemplate.is() ) + throw RuntimeException() ; + + if( !aEnvironment.is() ) + throw RuntimeException() ; + + //Get the xml node + Reference< XXMLElementWrapper > xElement = aTemplate->getTemplate() ; + if( !xElement.is() ) { + throw RuntimeException() ; + } + + Reference< XUnoTunnel > xNodTunnel( xElement , UNO_QUERY ) ; + if( !xNodTunnel.is() ) { + throw RuntimeException() ; + } + + XMLElementWrapper_XmlSecImpl* pElement = + reinterpret_cast<XMLElementWrapper_XmlSecImpl*>( + sal::static_int_cast<sal_uIntPtr>( + xNodTunnel->getSomething( XMLElementWrapper_XmlSecImpl::getUnoTunnelImplementationId() ))); + if( pElement == NULL ) { + throw RuntimeException() ; + } + + pNode = pElement->getNativeElement() ; + + //Get the stream/URI binding + Reference< XUriBinding > xUriBinding = aTemplate->getBinding() ; + if( xUriBinding.is() ) { + //Register the stream input callbacks into libxml2 + if( xmlRegisterStreamInputCallbacks( xUriBinding ) < 0 ) + throw RuntimeException() ; + } + + //Get Keys Manager + Reference< XUnoTunnel > xSecTunnel( aEnvironment , UNO_QUERY ) ; + if( !xSecTunnel.is() ) { + throw RuntimeException() ; + } + +#if 0 //i39448 : the key manager should be retrieved from SecurityEnvironment, instead of SecurityContext + XMLSecurityContext_NssImpl* pSecCtxt = ( XMLSecurityContext_NssImpl* )xSecTunnel->getSomething( XMLSecurityContext_NssImpl::getUnoTunnelId() ) ; + if( pSecCtxt == NULL ) + throw RuntimeException() ; +#endif + + SecurityEnvironment_NssImpl* pSecEnv = + reinterpret_cast<SecurityEnvironment_NssImpl*>( + sal::static_int_cast<sal_uIntPtr>( + xSecTunnel->getSomething( SecurityEnvironment_NssImpl::getUnoTunnelId() ))); + if( pSecEnv == NULL ) + throw RuntimeException() ; + + setErrorRecorder(); + + pMngr = pSecEnv->createKeysManager() ; //i39448 + if( !pMngr ) { + throw RuntimeException() ; + } + + //Create Signature context + pDsigCtx = xmlSecDSigCtxCreate( pMngr ) ; + if( pDsigCtx == NULL ) + { + pSecEnv->destroyKeysManager( pMngr ) ; //i39448 + //throw XMLSignatureException() ; + clearErrorRecorder(); + return aTemplate; + } + + //Sign the template + if( xmlSecDSigCtxSign( pDsigCtx , pNode ) == 0 ) + { + if (pDsigCtx->status == xmlSecDSigStatusSucceeded) + aTemplate->setStatus(com::sun::star::xml::crypto::SecurityOperationStatus_OPERATION_SUCCEEDED); + else + aTemplate->setStatus(com::sun::star::xml::crypto::SecurityOperationStatus_UNKNOWN); + } + else + { + aTemplate->setStatus(com::sun::star::xml::crypto::SecurityOperationStatus_UNKNOWN); + } + + + xmlSecDSigCtxDestroy( pDsigCtx ) ; + pSecEnv->destroyKeysManager( pMngr ) ; //i39448 + + //Unregistered the stream/URI binding + if( xUriBinding.is() ) + xmlUnregisterStreamInputCallbacks() ; + + clearErrorRecorder(); + return aTemplate ; +} + +/* XXMLSignature */ +Reference< XXMLSignatureTemplate > +SAL_CALL XMLSignature_NssImpl :: validate( + const Reference< XXMLSignatureTemplate >& aTemplate , + const Reference< XXMLSecurityContext >& aSecurityCtx +) throw( com::sun::star::uno::RuntimeException, + com::sun::star::uno::SecurityException, + com::sun::star::xml::crypto::XMLSignatureException ) { + xmlSecKeysMngrPtr pMngr = NULL ; + xmlSecDSigCtxPtr pDsigCtx = NULL ; + xmlNodePtr pNode = NULL ; + //sal_Bool valid ; + + if( !aTemplate.is() ) + throw RuntimeException() ; + + if( !aSecurityCtx.is() ) + throw RuntimeException() ; + + //Get the xml node + Reference< XXMLElementWrapper > xElement = aTemplate->getTemplate() ; + if( !xElement.is() ) + throw RuntimeException() ; + + Reference< XUnoTunnel > xNodTunnel( xElement , UNO_QUERY ) ; + if( !xNodTunnel.is() ) { + throw RuntimeException() ; + } + + XMLElementWrapper_XmlSecImpl* pElement = + reinterpret_cast<XMLElementWrapper_XmlSecImpl*>( + sal::static_int_cast<sal_uIntPtr>( + xNodTunnel->getSomething( XMLElementWrapper_XmlSecImpl::getUnoTunnelImplementationId() ))); + if( pElement == NULL ) + throw RuntimeException() ; + + pNode = pElement->getNativeElement() ; + + //Get the stream/URI binding + Reference< XUriBinding > xUriBinding = aTemplate->getBinding() ; + if( xUriBinding.is() ) { + //Register the stream input callbacks into libxml2 + if( xmlRegisterStreamInputCallbacks( xUriBinding ) < 0 ) + throw RuntimeException() ; + } + + setErrorRecorder(); + + sal_Int32 nSecurityEnvironment = aSecurityCtx->getSecurityEnvironmentNumber(); + sal_Int32 i; + + for (i=0; i<nSecurityEnvironment; ++i) + { + Reference< XSecurityEnvironment > aEnvironment = aSecurityCtx->getSecurityEnvironmentByIndex(i); + + //Get Keys Manager + Reference< XUnoTunnel > xSecTunnel( aEnvironment , UNO_QUERY ) ; + if( !xSecTunnel.is() ) { + throw RuntimeException() ; + } + + SecurityEnvironment_NssImpl* pSecEnv = + reinterpret_cast<SecurityEnvironment_NssImpl*>( + sal::static_int_cast<sal_uIntPtr>( + xSecTunnel->getSomething( SecurityEnvironment_NssImpl::getUnoTunnelId() ))); + if( pSecEnv == NULL ) + throw RuntimeException() ; + + pMngr = pSecEnv->createKeysManager() ; //i39448 + if( !pMngr ) { + throw RuntimeException() ; + } + + //Create Signature context + pDsigCtx = xmlSecDSigCtxCreate( pMngr ) ; + if( pDsigCtx == NULL ) + { + pSecEnv->destroyKeysManager( pMngr ) ; //i39448 + //throw XMLSignatureException() ; + clearErrorRecorder(); + return aTemplate; + } + + //Verify signature + int rs = xmlSecDSigCtxVerify( pDsigCtx , pNode ); + + + if (rs == 0 && + pDsigCtx->status == xmlSecDSigStatusSucceeded) + { + aTemplate->setStatus(com::sun::star::xml::crypto::SecurityOperationStatus_OPERATION_SUCCEEDED); + xmlSecDSigCtxDestroy( pDsigCtx ) ; + pSecEnv->destroyKeysManager( pMngr ); + break; + } + else + { + aTemplate->setStatus(com::sun::star::xml::crypto::SecurityOperationStatus_UNKNOWN); + } + xmlSecDSigCtxDestroy( pDsigCtx ) ; + pSecEnv->destroyKeysManager( pMngr ); + } + + + + //Unregistered the stream/URI binding + if( xUriBinding.is() ) + xmlUnregisterStreamInputCallbacks() ; + + //return valid ; + clearErrorRecorder(); + return aTemplate; +} + +/* XInitialization */ +void SAL_CALL XMLSignature_NssImpl :: initialize( const Sequence< Any >& /*aArguments*/ ) throw( Exception, RuntimeException ) { + // TBD +} ; + +/* XServiceInfo */ +OUString SAL_CALL XMLSignature_NssImpl :: getImplementationName() throw( RuntimeException ) { + return impl_getImplementationName() ; +} + +/* XServiceInfo */ +sal_Bool SAL_CALL XMLSignature_NssImpl :: supportsService( const OUString& serviceName) throw( RuntimeException ) { + Sequence< OUString > seqServiceNames = getSupportedServiceNames() ; + const OUString* pArray = seqServiceNames.getConstArray() ; + for( sal_Int32 i = 0 ; i < seqServiceNames.getLength() ; i ++ ) { + if( *( pArray + i ) == serviceName ) + return sal_True ; + } + return sal_False ; +} + +/* XServiceInfo */ +Sequence< OUString > SAL_CALL XMLSignature_NssImpl :: getSupportedServiceNames() throw( RuntimeException ) { + return impl_getSupportedServiceNames() ; +} + +//Helper for XServiceInfo +Sequence< OUString > XMLSignature_NssImpl :: impl_getSupportedServiceNames() { + ::osl::Guard< ::osl::Mutex > aGuard( ::osl::Mutex::getGlobalMutex() ) ; + Sequence< OUString > seqServiceNames( 1 ) ; + seqServiceNames.getArray()[0] = OUString::createFromAscii( "com.sun.star.xml.crypto.XMLSignature" ) ; + return seqServiceNames ; +} + +OUString XMLSignature_NssImpl :: impl_getImplementationName() throw( RuntimeException ) { + return OUString::createFromAscii( "com.sun.star.xml.security.bridge.xmlsec.XMLSignature_NssImpl" ) ; +} + +//Helper for registry +Reference< XInterface > SAL_CALL XMLSignature_NssImpl :: impl_createInstance( const Reference< XMultiServiceFactory >& aServiceManager ) throw( RuntimeException ) { + return Reference< XInterface >( *new XMLSignature_NssImpl( aServiceManager ) ) ; +} + +Reference< XSingleServiceFactory > XMLSignature_NssImpl :: impl_createFactory( const Reference< XMultiServiceFactory >& aServiceManager ) { + //Reference< XSingleServiceFactory > xFactory ; + //xFactory = ::cppu::createSingleFactory( aServiceManager , impl_getImplementationName , impl_createInstance , impl_getSupportedServiceNames ) ; + //return xFactory ; + return ::cppu::createSingleFactory( aServiceManager , impl_getImplementationName() , impl_createInstance , impl_getSupportedServiceNames() ) ; +} + diff --git a/xmlsecurity/source/xmlsec/nss/xmlsignature_nssimpl.hxx b/xmlsecurity/source/xmlsec/nss/xmlsignature_nssimpl.hxx new file mode 100644 index 000000000000..44ed88b0a1bf --- /dev/null +++ b/xmlsecurity/source/xmlsec/nss/xmlsignature_nssimpl.hxx @@ -0,0 +1,102 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _XMLSIGNATURE_NSSIMPL_HXX_ +#define _XMLSIGNATURE_NSSIMPL_HXX_ + +#include <sal/config.h> +#include <rtl/ustring.hxx> +#include <cppuhelper/factory.hxx> +#include <cppuhelper/implbase3.hxx> +#include <com/sun/star/uno/Exception.hpp> + +#ifndef _COM_SUN_STAR_UNO_REFERENCE_HPP_ +#include <com/sun/star/uno/Reference.hxx> +#endif +#include <com/sun/star/lang/XSingleServiceFactory.hpp> + +#ifndef _COM_SUN_STAR_LANG_XSECVICEINFO_HPP_ +#include <com/sun/star/lang/XServiceInfo.hpp> +#endif +#include <com/sun/star/lang/XInitialization.hpp> +#include <com/sun/star/xml/crypto/XXMLSignature.hpp> +#include <com/sun/star/xml/crypto/XXMLSignatureTemplate.hpp> +#include <com/sun/star/xml/crypto/XXMLSecurityContext.hpp> + +class XMLSignature_NssImpl : public ::cppu::WeakImplHelper3< + ::com::sun::star::xml::crypto::XXMLSignature , + ::com::sun::star::lang::XInitialization , + ::com::sun::star::lang::XServiceInfo > +{ + private : + ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xServiceManager ; + + public : + XMLSignature_NssImpl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& aFactory ) ; + virtual ~XMLSignature_NssImpl() ; + + //Methods from XXMLSignature + virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XXMLSignatureTemplate > SAL_CALL generate( + const ::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XXMLSignatureTemplate >& aTemplate , + const ::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XSecurityEnvironment >& aEnvironment + ) throw( com::sun::star::xml::crypto::XMLSignatureException, + com::sun::star::uno::SecurityException) ; + + virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XXMLSignatureTemplate > SAL_CALL validate( + const ::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XXMLSignatureTemplate >& aTemplate , + const ::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XXMLSecurityContext >& aContext + ) throw( com::sun::star::uno::RuntimeException, + com::sun::star::uno::SecurityException, + com::sun::star::xml::crypto::XMLSignatureException); + + //Methods from XInitialization + virtual void SAL_CALL initialize( + const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments + ) throw( ::com::sun::star::uno::Exception , ::com::sun::star::uno::RuntimeException ) ; + + //Methods from XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException ) ; + + virtual sal_Bool SAL_CALL supportsService( + const ::rtl::OUString& ServiceName + ) throw( ::com::sun::star::uno::RuntimeException ) ; + + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException ) ; + + //Helper for XServiceInfo + static ::com::sun::star::uno::Sequence< ::rtl::OUString > impl_getSupportedServiceNames() ; + + static ::rtl::OUString impl_getImplementationName() throw( ::com::sun::star::uno::RuntimeException ) ; + + //Helper for registry + static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL impl_createInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& aServiceManager ) throw( ::com::sun::star::uno::RuntimeException ) ; + + static ::com::sun::star::uno::Reference< ::com::sun::star::lang::XSingleServiceFactory > impl_createFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& aServiceManager ) ; +} ; + +#endif // _XMLSIGNATURE_NSSIMPL_HXX_ + diff --git a/xmlsecurity/source/xmlsec/nss/xsec_nss.cxx b/xmlsecurity/source/xmlsec/nss/xsec_nss.cxx new file mode 100644 index 000000000000..344f76bf3e5d --- /dev/null +++ b/xmlsecurity/source/xmlsec/nss/xsec_nss.cxx @@ -0,0 +1,165 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_xmlsecurity.hxx" + +#include <sal/config.h> +#include <stdio.h> + +#include <osl/mutex.hxx> +#include <osl/thread.h> +#include <cppuhelper/factory.hxx> +#include <com/sun/star/lang/XSingleServiceFactory.hpp> + +#include "seinitializer_nssimpl.hxx" +#include "xmlsignature_nssimpl.hxx" +#include "xmlencryption_nssimpl.hxx" +#include "xmlsecuritycontext_nssimpl.hxx" +#include "securityenvironment_nssimpl.hxx" + +using namespace ::rtl; +using namespace ::cppu; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::lang; +using namespace ::com::sun::star::registry; + +extern "C" +{ + +sal_Bool SAL_CALL nss_component_writeInfo( void* /*pServiceManager*/ , void* pRegistryKey ) +{ + sal_Bool result = sal_False; + sal_Int32 i ; + OUString sKeyName ; + Reference< XRegistryKey > xNewKey ; + Sequence< OUString > seqServices ; + Reference< XRegistryKey > xKey( reinterpret_cast< XRegistryKey* >( pRegistryKey ) ) ; + + if( xKey.is() ) { + // try { + // XMLSignature_NssImpl + sKeyName = OUString( RTL_CONSTASCII_USTRINGPARAM( "/" ) ) ; + sKeyName += XMLSignature_NssImpl::impl_getImplementationName() ; + sKeyName += OUString::createFromAscii( "/UNO/SERVICES" ) ; + + xNewKey = xKey->createKey( sKeyName ) ; + if( xNewKey.is() ) { + seqServices = XMLSignature_NssImpl::impl_getSupportedServiceNames() ; + for( i = seqServices.getLength() ; i -- ; ) + xNewKey->createKey( seqServices.getConstArray()[i] ) ; + } + + // XMLEncryption_NssImpl + sKeyName = OUString( RTL_CONSTASCII_USTRINGPARAM( "/" ) ) ; + sKeyName += XMLEncryption_NssImpl::impl_getImplementationName() ; + sKeyName += OUString::createFromAscii( "/UNO/SERVICES" ) ; + + xNewKey = xKey->createKey( sKeyName ) ; + if( xNewKey.is() ) { + seqServices = XMLEncryption_NssImpl::impl_getSupportedServiceNames() ; + for( i = seqServices.getLength() ; i -- ; ) + xNewKey->createKey( seqServices.getConstArray()[i] ) ; + } + + // XMLSecurityContext_NssImpl + sKeyName = OUString( RTL_CONSTASCII_USTRINGPARAM( "/" ) ) ; + sKeyName += XMLSecurityContext_NssImpl::impl_getImplementationName() ; + sKeyName += OUString::createFromAscii( "/UNO/SERVICES" ) ; + + xNewKey = xKey->createKey( sKeyName ) ; + if( xNewKey.is() ) { + seqServices = XMLSecurityContext_NssImpl::impl_getSupportedServiceNames() ; + for( i = seqServices.getLength() ; i -- ; ) + xNewKey->createKey( seqServices.getConstArray()[i] ) ; + } + + // SecurityEnvironment_NssImpl + sKeyName = OUString( RTL_CONSTASCII_USTRINGPARAM( "/" ) ) ; + sKeyName += SecurityEnvironment_NssImpl::impl_getImplementationName() ; + sKeyName += OUString::createFromAscii( "/UNO/SERVICES" ) ; + + xNewKey = xKey->createKey( sKeyName ) ; + if( xNewKey.is() ) { + seqServices = SecurityEnvironment_NssImpl::impl_getSupportedServiceNames() ; + for( i = seqServices.getLength() ; i -- ; ) + xNewKey->createKey( seqServices.getConstArray()[i] ) ; + } + + // SEInitializer_NssImpl + sKeyName = OUString( RTL_CONSTASCII_USTRINGPARAM( "/" ) ) ; + sKeyName += SEInitializer_NssImpl_getImplementationName() ; + sKeyName += OUString::createFromAscii( "/UNO/SERVICES" ) ; + + xNewKey = xKey->createKey( sKeyName ) ; + if( xNewKey.is() ) { + seqServices = SEInitializer_NssImpl_getSupportedServiceNames() ; + for( i = seqServices.getLength() ; i -- ; ) + xNewKey->createKey( seqServices.getConstArray()[i] ) ; + } + + return sal_True; + //} catch( InvalidRegistryException & ) { + // //we should not ignore exceptions + // return sal_False ; + //} + } + return result; +} + +void* SAL_CALL nss_component_getFactory( const sal_Char* pImplName , void* pServiceManager , void* /*pRegistryKey*/ ) +{ + void* pRet = 0; + Reference< XSingleServiceFactory > xFactory ; + + if( pImplName != NULL && pServiceManager != NULL ) { + if( XMLSignature_NssImpl::impl_getImplementationName().equals( OUString::createFromAscii( pImplName ) ) ) { + xFactory = XMLSignature_NssImpl::impl_createFactory( reinterpret_cast< XMultiServiceFactory* >( pServiceManager ) ) ; + } else if( XMLSecurityContext_NssImpl::impl_getImplementationName().equals( OUString::createFromAscii( pImplName ) ) ) { + xFactory = XMLSecurityContext_NssImpl::impl_createFactory( reinterpret_cast< XMultiServiceFactory* >( pServiceManager ) ) ; + } else if( SecurityEnvironment_NssImpl::impl_getImplementationName().equals( OUString::createFromAscii( pImplName ) ) ) { + xFactory = SecurityEnvironment_NssImpl::impl_createFactory( reinterpret_cast< XMultiServiceFactory* >( pServiceManager ) ) ; + } else if( XMLEncryption_NssImpl::impl_getImplementationName().equals( OUString::createFromAscii( pImplName ) ) ) { + xFactory = XMLEncryption_NssImpl::impl_createFactory( reinterpret_cast< XMultiServiceFactory* >( pServiceManager ) ) ; + } else if( SEInitializer_NssImpl_getImplementationName().equals( OUString::createFromAscii( pImplName ) ) ) { + xFactory = Reference< XSingleServiceFactory >( createSingleFactory( + reinterpret_cast< XMultiServiceFactory * >( pServiceManager ), + OUString::createFromAscii( pImplName ), + SEInitializer_NssImpl_createInstance, SEInitializer_NssImpl_getSupportedServiceNames() ) ); + } + } + + if( xFactory.is() ) { + xFactory->acquire() ; + pRet = xFactory.get() ; + } + + return pRet ; +} + +} + diff --git a/xmlsecurity/source/xmlsec/saxhelper.cxx b/xmlsecurity/source/xmlsec/saxhelper.cxx new file mode 100644 index 000000000000..6e381334136e --- /dev/null +++ b/xmlsecurity/source/xmlsec/saxhelper.cxx @@ -0,0 +1,450 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_xmlsecurity.hxx" + +#include <rtl/ustring.hxx> + +#include "saxhelper.hxx" +#include "libxml/parserInternals.h" + +#ifndef XMLSEC_NO_XSLT +#include "libxslt/xslt.h" +#endif + +namespace cssu = com::sun::star::uno; +namespace cssxs = com::sun::star::xml::sax; +namespace cssxcsax = com::sun::star::xml::csax; + +/** + * The return value is NULL terminated. The application has the responsibilty to + * deallocte the return value. + */ +xmlChar* ous_to_xmlstr( const rtl::OUString& oustr ) +{ + rtl::OString ostr = rtl::OUStringToOString( oustr , RTL_TEXTENCODING_UTF8 ) ; + return xmlStrndup( ( xmlChar* )ostr.getStr(), ( int )ostr.getLength() ) ; +} + +/** + * The return value is NULL terminated. The application has the responsibilty to + * deallocte the return value. + */ +xmlChar* ous_to_nxmlstr( const rtl::OUString& oustr, int& length ) +{ + rtl::OString ostr = rtl::OUStringToOString( oustr , RTL_TEXTENCODING_UTF8 ) ; + length = ostr.getLength(); + + return xmlStrndup( ( xmlChar* )ostr.getStr(), length ) ; +} + +/** + * The input parameter isn't necessaryly NULL terminated. + */ +rtl::OUString xmlchar_to_ous( const xmlChar* pChar, int length ) +{ + if( pChar != NULL ) + { + return rtl::OUString( ( sal_Char* )pChar , length , RTL_TEXTENCODING_UTF8 ) ; + } + else + { + return rtl::OUString() ; + } +} + +/** + * The input parameter is NULL terminated + */ +rtl::OUString xmlstr_to_ous( const xmlChar* pStr ) +{ + if( pStr != NULL ) + { + return xmlchar_to_ous( pStr , xmlStrlen( pStr ) ) ; + } + else + { + return rtl::OUString() ; + } +} + +/** + * The return value and the referenced value must be NULL terminated. + * The application has the responsibilty to deallocte the return value. + */ +const xmlChar** attrlist_to_nxmlstr( const cssu::Sequence< cssxcsax::XMLAttribute >& aAttributes ) +{ + xmlChar* attname = NULL ; + xmlChar* attvalue = NULL ; + const xmlChar** attrs = NULL ; + rtl::OUString oustr ; + + sal_Int32 nLength = aAttributes.getLength();; + + if( nLength != 0 ) + { + attrs = ( const xmlChar** )xmlMalloc( ( nLength * 2 + 2 ) * sizeof( xmlChar* ) ) ; + } + else + { + return NULL ; + } + + for( int i = 0 , j = 0 ; j < nLength ; ++j ) + { + attname = ous_to_xmlstr( aAttributes[j].sName ) ; + attvalue = ous_to_xmlstr( aAttributes[j].sValue ) ; + + if( attname != NULL && attvalue != NULL ) + { + attrs[i++] = attname ; + attrs[i++] = attvalue ; + attrs[i] = NULL ; + attrs[i+1] = NULL ; + } + else + { + if( attname != NULL ) + xmlFree( attname ) ; + if( attvalue != NULL ) + xmlFree( attvalue ) ; + } + } + + return attrs ; +} + +/** + * Constructor + * + * In this constructor, a libxml sax parser context is initialized. a libxml + * default sax handler is initialized with the context. + */ +SAXHelper::SAXHelper( ) + : m_pParserCtxt( NULL ), + m_pSaxHandler( NULL ) +{ + xmlInitParser() ; + LIBXML_TEST_VERSION ; + + /* + * compile error: + * xmlLoadExtDtdDefaultValue = XML_DETECT_IDS | XML_COMPLETE_ATTRS ; + */ + xmlSubstituteEntitiesDefault( 1 ) ; + +#ifndef XMLSEC_NO_XSLT + xmlIndentTreeOutput = 1 ; +#endif /* XMLSEC_NO_XSLT */ + + m_pParserCtxt = xmlNewParserCtxt() ; + + /* + * i41748 + * + * mmi : re-initialize the SAX handler to version 1 + */ + + xmlSAXVersion(m_pParserCtxt->sax, 1); + + /* end */ + + if( m_pParserCtxt->inputTab[0] != NULL ) + { + m_pParserCtxt->inputTab[0] = NULL ; + } + + if( m_pParserCtxt == NULL ) + { +#ifndef XMLSEC_NO_XSLT + xsltCleanupGlobals() ; +#endif +// see issue i74334, we cannot call xmlCleanupParser when libxml is still used +// in other parts of the office. +// xmlCleanupParser() ; + throw cssu::RuntimeException() ; + } + else if( m_pParserCtxt->sax == NULL ) + { + xmlFreeParserCtxt( m_pParserCtxt ) ; + +#ifndef XMLSEC_NO_XSLT + xsltCleanupGlobals() ; +#endif +// see issue i74334, we cannot call xmlCleanupParser when libxml is still used +// in other parts of the office. +// xmlCleanupParser() ; + m_pParserCtxt = NULL ; + throw cssu::RuntimeException() ; + } + else + { + m_pSaxHandler = m_pParserCtxt->sax ; + + //Adjust the context + m_pParserCtxt->recovery = 1 ; + } +} + +/** + * Destructor + * + * In this destructor, a libxml sax parser context is desturcted. The XML tree + * in the context is not deallocated because the tree is bind with a document + * model by the setTargetDocument method, which delegate the target document to + * destruct the xml tree. + */ +SAXHelper::~SAXHelper() { + if( m_pParserCtxt != NULL ) + { + /* + * In the situation that no object refer the Document, this destructor + * must deallocate the Document memory + */ + if( m_pSaxHandler == m_pParserCtxt->sax ) + { + m_pSaxHandler = NULL ; + } + + xmlFreeParserCtxt( m_pParserCtxt ) ; + m_pParserCtxt = NULL ; + } + + if( m_pSaxHandler != NULL ) + { + xmlFree( m_pSaxHandler ) ; + m_pSaxHandler = NULL ; + } +// see issue i74334, we cannot call xmlCleanupParser when libxml is still used +// in other parts of the office. +// xmlCleanupParser() ; +} + +xmlNodePtr SAXHelper::getCurrentNode() +{ + return m_pParserCtxt->node; +} + +void SAXHelper::setCurrentNode(const xmlNodePtr pNode) +{ + /* + * This is really a black trick. + * When the current node is replaced, the nodeTab + * stack's top has to been replaced with the same + * node, in order to make compatibility. + */ + m_pParserCtxt->nodeTab[m_pParserCtxt->nodeNr - 1] + = m_pParserCtxt->node + = pNode; +} + +xmlDocPtr SAXHelper::getDocument() +{ + return m_pParserCtxt->myDoc; +} + +/** + * XDocumentHandler -- start an xml document + */ +void SAXHelper::startDocument( void ) + throw( cssxs::SAXException , cssu::RuntimeException ) +{ + /* + * Adjust inputTab + */ + xmlParserInputPtr pInput = xmlNewInputStream( m_pParserCtxt ) ; + + if( m_pParserCtxt->inputTab != NULL && m_pParserCtxt->inputMax != 0 ) + { + m_pParserCtxt->inputTab[0] = pInput ; + m_pParserCtxt->input = pInput ; + } + + m_pSaxHandler->startDocument( m_pParserCtxt ) ; + + if( m_pParserCtxt == NULL || m_pParserCtxt->myDoc == NULL ) + { + throw cssu::RuntimeException() ; + } +} + +/** + * XDocumentHandler -- end an xml document + */ +void SAXHelper::endDocument( void ) + throw( cssxs::SAXException , cssu::RuntimeException ) +{ + m_pSaxHandler->endDocument( m_pParserCtxt ) ; +} + +/** + * XDocumentHandler -- start an xml element + */ +void SAXHelper::startElement( + const rtl::OUString& aName, + const cssu::Sequence< cssxcsax::XMLAttribute >& aAttributes ) + throw( cssxs::SAXException , cssu::RuntimeException ) +{ + const xmlChar* fullName = NULL ; + const xmlChar** attrs = NULL ; + + fullName = ous_to_xmlstr( aName ) ; + attrs = attrlist_to_nxmlstr( aAttributes ) ; + + if( fullName != NULL || attrs != NULL ) + { + m_pSaxHandler->startElement( m_pParserCtxt , fullName , attrs ) ; + } + + if( fullName != NULL ) + { + xmlFree( ( xmlChar* )fullName ) ; + fullName = NULL ; + } + + if( attrs != NULL ) + { + for( int i = 0 ; attrs[i] != NULL ; ++i ) + { + xmlFree( ( xmlChar* )attrs[i] ) ; + attrs[i] = NULL ; + } + + xmlFree( ( void* ) attrs ) ; + attrs = NULL ; + } +} + +/** + * XDocumentHandler -- end an xml element + */ +void SAXHelper::endElement( const rtl::OUString& aName ) + throw( cssxs::SAXException , cssu::RuntimeException ) +{ + xmlChar* fullname = NULL ; + + fullname = ous_to_xmlstr( aName ) ; + m_pSaxHandler->endElement( m_pParserCtxt , fullname ) ; + + if( fullname != NULL ) + { + xmlFree( ( xmlChar* )fullname ) ; + fullname = NULL ; + } +} + +/** + * XDocumentHandler -- an xml element or cdata characters + */ +void SAXHelper::characters( const rtl::OUString& aChars ) + throw( cssxs::SAXException , cssu::RuntimeException ) +{ + const xmlChar* chars = NULL ; + int length = 0 ; + + chars = ous_to_nxmlstr( aChars, length ) ; + m_pSaxHandler->characters( m_pParserCtxt , chars , length ) ; + + if( chars != NULL ) + { + xmlFree( ( xmlChar* )chars ) ; + } +} + +/** + * XDocumentHandler -- ignorable xml white space + */ +void SAXHelper::ignorableWhitespace( const rtl::OUString& aWhitespaces ) + throw( cssxs::SAXException , cssu::RuntimeException ) +{ + const xmlChar* chars = NULL ; + int length = 0 ; + + chars = ous_to_nxmlstr( aWhitespaces, length ) ; + m_pSaxHandler->ignorableWhitespace( m_pParserCtxt , chars , length ) ; + + if( chars != NULL ) + { + xmlFree( ( xmlChar* )chars ) ; + } +} + +/** + * XDocumentHandler -- preaorocessing instruction + */ +void SAXHelper::processingInstruction( + const rtl::OUString& aTarget, + const rtl::OUString& aData ) + throw( cssxs::SAXException , cssu::RuntimeException ) +{ + xmlChar* target = NULL ; + xmlChar* data = NULL ; + + target = ous_to_xmlstr( aTarget ) ; + data = ous_to_xmlstr( aData ) ; + + m_pSaxHandler->processingInstruction( m_pParserCtxt , target , data ) ; + + if( target != NULL ) + { + xmlFree( ( xmlChar* )target ) ; + target = NULL ; + } + + if( data != NULL ) + { + xmlFree( ( xmlChar* )data ) ; + data = NULL ; + } +} + +/** + * XDocumentHandler -- set document locator + * In this case, locator is useless. + */ +void SAXHelper::setDocumentLocator( + const cssu::Reference< cssxs::XLocator > &) + throw( cssxs::SAXException , cssu::RuntimeException ) +{ + //--Pseudo code if necessary + //--m_pSaxLocator is a member defined as xmlSAXHabdlerPtr + //--m_pSaxLocatorHdl is a member defined as Sax_Locator + + //if( m_pSaxLocator != NULL ) { + // //Deallocate the memory + //} + //if( m_pSaxLocatorHdl != NULL ) { + // //Deallocate the memory + //} + + //m_pSaxLocatorHdl = new Sax_Locator( xLocator ) ; + //m_pSaxLocator = { m_pSaxLocatorHdl->getPublicId , m_pSaxLocatorHdl->getSystemId , m_pSaxLocatorHdl->getLineNumber , m_pSaxLocatorHdl->getColumnNumber } ; + + //m_pSaxHandler->setDocumentLocator( m_pParserCtxt , m_pSaxLocator ) ; +} + diff --git a/xmlsecurity/source/xmlsec/saxhelper.hxx b/xmlsecurity/source/xmlsec/saxhelper.hxx new file mode 100644 index 000000000000..fab6157b6922 --- /dev/null +++ b/xmlsecurity/source/xmlsec/saxhelper.hxx @@ -0,0 +1,88 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SAXHELPER_HXX +#define _SAXHELPER_HXX + +#include "libxml/tree.h" + +#include <com/sun/star/xml/sax/SAXException.hpp> +#include <com/sun/star/xml/sax/XAttributeList.hpp> +#include <com/sun/star/xml/sax/XLocator.hpp> +#include <com/sun/star/lang/XServiceInfo.hpp> +#include <com/sun/star/xml/csax/XMLAttribute.hpp> + +/** This class represents a SAX handler which simply forwards to + the corresponding libxml API and translates parameter if necessary. +*/ +class SAXHelper +{ + private : + xmlParserCtxtPtr m_pParserCtxt ; + xmlSAXHandlerPtr m_pSaxHandler ; + + public: + SAXHelper( ) ; + virtual ~SAXHelper() ; + + xmlNodePtr getCurrentNode(); + void setCurrentNode(const xmlNodePtr pNode); + xmlDocPtr getDocument(); + + void startDocument( void ) + throw( ::com::sun::star::xml::sax::SAXException , ::com::sun::star::uno::RuntimeException ) ; + + void endDocument( void ) + throw( ::com::sun::star::xml::sax::SAXException , ::com::sun::star::uno::RuntimeException ) ; + + void startElement( + const ::rtl::OUString& aName , + const com::sun::star::uno::Sequence< + com::sun::star::xml::csax::XMLAttribute >& aAttributes ) + throw( ::com::sun::star::xml::sax::SAXException , ::com::sun::star::uno::RuntimeException ) ; + + void endElement( const ::rtl::OUString& aName ) + throw( ::com::sun::star::xml::sax::SAXException , ::com::sun::star::uno::RuntimeException ) ; + + void characters( const ::rtl::OUString& aChars ) + throw( ::com::sun::star::xml::sax::SAXException , ::com::sun::star::uno::RuntimeException ) ; + + void ignorableWhitespace( const ::rtl::OUString& aWhitespaces ) + throw( ::com::sun::star::xml::sax::SAXException , ::com::sun::star::uno::RuntimeException ) ; + + void processingInstruction( + const ::rtl::OUString& aTarget , + const ::rtl::OUString& aData ) + throw( ::com::sun::star::xml::sax::SAXException , ::com::sun::star::uno::RuntimeException ) ; + + void setDocumentLocator( const ::com::sun::star::uno::Reference< + ::com::sun::star::xml::sax::XLocator > & xLocator ) + throw( ::com::sun::star::xml::sax::SAXException , ::com::sun::star::uno::RuntimeException ) ; +} ; + +#endif + diff --git a/xmlsecurity/source/xmlsec/xmldocumentwrapper_xmlsecimpl.cxx b/xmlsecurity/source/xmlsec/xmldocumentwrapper_xmlsecimpl.cxx new file mode 100644 index 000000000000..341f66b9ef1f --- /dev/null +++ b/xmlsecurity/source/xmlsec/xmldocumentwrapper_xmlsecimpl.cxx @@ -0,0 +1,1153 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_xmlsecurity.hxx" + +#include "xmldocumentwrapper_xmlsecimpl.hxx" +#include <com/sun/star/lang/XMultiServiceFactory.hpp> + +#include <xmloff/attrlist.hxx> +#include "xmlelementwrapper_xmlsecimpl.hxx" + +//#include <malloc.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +/* + * Deleted by AF +#include <memory.h> + */ + +#include <sys/types.h> +#include <sys/stat.h> + +#ifndef INCLUDED_VECTOR +#include <vector> +#define INCLUDED_VECTOR +#endif + +#ifdef UNX +#define stricmp strcasecmp +#endif + +namespace cssu = com::sun::star::uno; +namespace cssl = com::sun::star::lang; +namespace cssxc = com::sun::star::xml::crypto; +namespace cssxcsax = com::sun::star::xml::csax; +namespace cssxs = com::sun::star::xml::sax; +namespace cssxw = com::sun::star::xml::wrapper; + +#define SERVICE_NAME "com.sun.star.xml.wrapper.XMLDocumentWrapper" +#define IMPLEMENTATION_NAME "com.sun.star.xml.security.bridge.xmlsec.XMLDocumentWrapper_XmlSecImpl" + +#define STRXMLNS "xmlns" + +#define RTL_ASCII_USTRINGPARAM( asciiStr ) asciiStr, strlen( asciiStr ), RTL_TEXTENCODING_ASCII_US +#define RTL_UTF8_USTRINGPARAM( asciiStr ) asciiStr, strlen( asciiStr ), RTL_TEXTENCODING_UTF8 + +/* used by the recursiveDelete method */ +#define NODE_REMOVED 0 +#define NODE_NOTREMOVED 1 +#define NODE_STOPED 2 + +XMLDocumentWrapper_XmlSecImpl::XMLDocumentWrapper_XmlSecImpl( ) +{ + saxHelper.startDocument(); + m_pDocument = saxHelper.getDocument(); + + /* + * creates the virtual root element + */ + saxHelper.startElement(rtl::OUString(RTL_UTF8_USTRINGPARAM( "root" )), cssu::Sequence<cssxcsax::XMLAttribute>()); + + m_pRootElement = saxHelper.getCurrentNode(); + m_pCurrentElement = m_pRootElement; +} + +XMLDocumentWrapper_XmlSecImpl::~XMLDocumentWrapper_XmlSecImpl() +{ + saxHelper.endDocument(); + xmlFreeDoc(m_pDocument); +} + +void XMLDocumentWrapper_XmlSecImpl::getNextSAXEvent() +/****** XMLDocumentWrapper_XmlSecImpl/getNextSAXEvent ************************* + * + * NAME + * getNextSAXEvent -- Prepares the next SAX event to be manipulate + * + * SYNOPSIS + * getNextSAXEvent(); + * + * FUNCTION + * When converting the document into SAX events, this method is used to + * decide the next SAX event to be generated. + * Two member variables are checked to make the decision, the + * m_pCurrentElement and the m_nCurrentPosition. + * The m_pCurrentElement represents the node which have been covered, and + * the m_nCurrentPosition represents the event which have been sent. + * For example, suppose that the m_pCurrentElement + * points to element A, and the m_nCurrentPosition equals to + * NODEPOSITION_STARTELEMENT, then the next SAX event should be the + * endElement for element A if A has no child, or startElement for the + * first child element of element A otherwise. + * The m_nCurrentPosition can be one of following values: + * NODEPOSITION_STARTELEMENT for startElement; + * NODEPOSITION_ENDELEMENT for endElement; + * NODEPOSITION_NORMAL for other SAX events; + * + * INPUTS + * empty + * + * RESULT + * empty + * + * HISTORY + * 05.01.2004 - implemented + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ + OSL_ASSERT( m_pCurrentElement != NULL ); + + /* + * Get the next event through tree order. + * + * if the current event is a startElement, then the next + * event depends on whether or not the current node has + * children. + */ + if (m_nCurrentPosition == NODEPOSITION_STARTELEMENT) + { + /* + * If the current node has children, then its first child + * should be next current node, and the next event will be + * startElement or charaters(PI) based on that child's node + * type. Otherwise, the endElement of current node is the + * next event. + */ + if (m_pCurrentElement->children != NULL) + { + m_pCurrentElement = m_pCurrentElement->children; + m_nCurrentPosition + = (m_pCurrentElement->type == XML_ELEMENT_NODE)? + NODEPOSITION_STARTELEMENT:NODEPOSITION_NORMAL; + } + else + { + m_nCurrentPosition = NODEPOSITION_ENDELEMENT; + } + } + /* + * if the current event is a not startElement, then the next + * event depends on whether or not the current node has + * following sibling. + */ + else if (m_nCurrentPosition == NODEPOSITION_ENDELEMENT || m_nCurrentPosition == NODEPOSITION_NORMAL) + { + xmlNodePtr pNextSibling = m_pCurrentElement->next; + + /* + * If the current node has following sibling, that sibling + * should be next current node, and the next event will be + * startElement or charaters(PI) based on that sibling's node + * type. Otherwise, the endElement of current node's parent + * becomes the next event. + */ + if (pNextSibling != NULL) + { + m_pCurrentElement = pNextSibling; + m_nCurrentPosition + = (m_pCurrentElement->type == XML_ELEMENT_NODE)? + NODEPOSITION_STARTELEMENT:NODEPOSITION_NORMAL; + } + else + { + m_pCurrentElement = m_pCurrentElement->parent; + m_nCurrentPosition = NODEPOSITION_ENDELEMENT; + } + } +} + +void XMLDocumentWrapper_XmlSecImpl::sendStartElement( + const cssu::Reference< cssxs::XDocumentHandler >& xHandler, + const cssu::Reference< cssxs::XDocumentHandler >& xHandler2, + const xmlNodePtr pNode) const + throw (cssxs::SAXException) +/****** XMLDocumentWrapper_XmlSecImpl/sendStartElement ************************ + * + * NAME + * sendStartElement -- Constructs a startElement SAX event + * + * SYNOPSIS + * sendStartElement(xHandler, xHandler2, pNode); + * + * FUNCTION + * Used when converting the document into SAX event stream. + * This method constructs a startElement SAX event for a particular + * element, then calls the startElement methods of the XDocumentHandlers. + * + * INPUTS + * xHandler - the first XDocumentHandler interface to receive the + * startElement SAX event. It can be NULL. + * xHandler2 - the second XDocumentHandler interface to receive the + * startElement SAX event. It can't be NULL. + * pNode - the node on which the startElement should be generated. + * This node must be a element type. + * + * RESULT + * empty + * + * HISTORY + * 05.01.2004 - implemented + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ + SvXMLAttributeList* pAttributeList = new SvXMLAttributeList(); + cssu::Reference < cssxs::XAttributeList > xAttrList = cssu::Reference< cssxs::XAttributeList > (pAttributeList); + + xmlNsPtr pNsDef = pNode->nsDef; + + while (pNsDef != NULL) + { + const xmlChar* pNsPrefix = pNsDef->prefix; + const xmlChar* pNsHref = pNsDef->href; + + if (pNsDef->prefix == NULL) + { + pAttributeList->AddAttribute( + rtl::OUString(RTL_UTF8_USTRINGPARAM( STRXMLNS )), + rtl::OUString(RTL_UTF8_USTRINGPARAM( (sal_Char*)pNsHref ))); + } + else + { + pAttributeList->AddAttribute( + rtl::OUString(RTL_UTF8_USTRINGPARAM( STRXMLNS )) + +rtl::OUString(RTL_UTF8_USTRINGPARAM( ":" )) + +rtl::OUString(RTL_UTF8_USTRINGPARAM( (sal_Char*)pNsPrefix )), + rtl::OUString(RTL_UTF8_USTRINGPARAM( (sal_Char*)pNsHref ))); + } + + pNsDef = pNsDef->next; + } + + xmlAttrPtr pAttr = pNode->properties; + + while (pAttr != NULL) + { + const xmlChar* pAttrName = pAttr->name; + xmlNsPtr pAttrNs = pAttr->ns; + + rtl::OUString ouAttrName; + if (pAttrNs == NULL) + { + ouAttrName = rtl::OUString(RTL_UTF8_USTRINGPARAM( (sal_Char*)pAttrName )); + } + else + { + ouAttrName = rtl::OUString(RTL_UTF8_USTRINGPARAM( (sal_Char*)pAttrNs->prefix)) + +rtl::OUString(RTL_UTF8_USTRINGPARAM( (sal_Char*)":" )) + +rtl::OUString(RTL_UTF8_USTRINGPARAM( (sal_Char*)pAttrName )); + } + + pAttributeList->AddAttribute( + ouAttrName, + rtl::OUString(RTL_UTF8_USTRINGPARAM( (sal_Char*)(pAttr->children->content)))); + pAttr = pAttr->next; + } + + rtl::OString sNodeName = getNodeQName(pNode); + + if (xHandler.is()) + { + xHandler->startElement( + rtl::OUString(RTL_UTF8_USTRINGPARAM ( ((sal_Char*)(sNodeName.getStr())) )), + xAttrList); + } + + xHandler2->startElement( + rtl::OUString(RTL_UTF8_USTRINGPARAM ( ((sal_Char*)(sNodeName.getStr())) )), + xAttrList); +} + +void XMLDocumentWrapper_XmlSecImpl::sendEndElement( + const cssu::Reference< cssxs::XDocumentHandler >& xHandler, + const cssu::Reference< cssxs::XDocumentHandler >& xHandler2, + const xmlNodePtr pNode) const + throw (cssxs::SAXException) +/****** XMLDocumentWrapper_XmlSecImpl/sendEndElement ************************** + * + * NAME + * sendEndElement -- Constructs a endElement SAX event + * + * SYNOPSIS + * sendEndElement(xHandler, xHandler2, pNode); + * + * FUNCTION + * Used when converting the document into SAX event stream. + * This method constructs a endElement SAX event for a particular + * element, then calls the endElement methods of the XDocumentHandlers. + * + * INPUTS + * xHandler - the first XDocumentHandler interface to receive the + * endElement SAX event. It can be NULL. + * xHandler2 - the second XDocumentHandler interface to receive the + * endElement SAX event. It can't be NULL. + * pNode - the node on which the endElement should be generated. + * This node must be a element type. + * + * RESULT + * empty + * + * HISTORY + * 05.01.2004 - implemented + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ + rtl::OString sNodeName = getNodeQName(pNode); + + if (xHandler.is()) + { + xHandler->endElement(rtl::OUString(RTL_UTF8_USTRINGPARAM ( ((sal_Char*)(sNodeName.getStr())) ))); + } + + xHandler2->endElement(rtl::OUString(RTL_UTF8_USTRINGPARAM ( ((sal_Char*)(sNodeName.getStr())) ))); +} + +void XMLDocumentWrapper_XmlSecImpl::sendNode( + const cssu::Reference< cssxs::XDocumentHandler >& xHandler, + const cssu::Reference< cssxs::XDocumentHandler >& xHandler2, + const xmlNodePtr pNode) const + throw (cssxs::SAXException) +/****** XMLDocumentWrapper_XmlSecImpl/sendNode ******************************** + * + * NAME + * sendNode -- Constructs a characters SAX event or a + * processingInstruction SAX event + * + * SYNOPSIS + * sendNode(xHandler, xHandler2, pNode); + * + * FUNCTION + * Used when converting the document into SAX event stream. + * This method constructs a characters SAX event or a + * processingInstructionfor SAX event based on the type of a particular + * element, then calls the corresponding methods of the XDocumentHandlers. + * + * INPUTS + * xHandler - the first XDocumentHandler interface to receive the + * SAX event. It can be NULL. + * xHandler2 - the second XDocumentHandler interface to receive the + * SAX event. It can't be NULL. + * pNode - the node on which the endElement should be generated. + * If it is a text node, then a characters SAX event is + * generated; if it is a PI node, then a + * processingInstructionfor SAX event is generated. + * + * RESULT + * empty + * + * HISTORY + * 05.01.2004 - implemented + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ + xmlElementType type = pNode->type; + + if (type == XML_TEXT_NODE) + { + if (xHandler.is()) + { + xHandler->characters(rtl::OUString(RTL_UTF8_USTRINGPARAM ( ((sal_Char*)(pNode->content)) ))); + } + + xHandler2->characters(rtl::OUString(RTL_UTF8_USTRINGPARAM ( ((sal_Char*)(pNode->content)) ))); + } + else if (type == XML_PI_NODE) + { + if (xHandler.is()) + { + xHandler->processingInstruction( + rtl::OUString(RTL_UTF8_USTRINGPARAM ( ((sal_Char*)(pNode->name)) )), + rtl::OUString(RTL_UTF8_USTRINGPARAM ( ((sal_Char*)(pNode->content)) ))); + } + + xHandler2->processingInstruction( + rtl::OUString(RTL_UTF8_USTRINGPARAM ( ((sal_Char*)(pNode->name)) )), + rtl::OUString(RTL_UTF8_USTRINGPARAM ( ((sal_Char*)(pNode->content)) ))); + } +} + +rtl::OString XMLDocumentWrapper_XmlSecImpl::getNodeQName(const xmlNodePtr pNode) const +/****** XMLDocumentWrapper_XmlSecImpl/getNodeQName **************************** + * + * NAME + * getNodeQName -- Retrives the qualified name of a node + * + * SYNOPSIS + * name = getNodeQName(pNode); + * + * FUNCTION + * see NAME + * + * INPUTS + * pNode - the node whose name will be retrived + * + * RESULT + * name - the node's qualified name + * + * HISTORY + * 05.01.2004 - implemented + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ + rtl::OString sNodeName((const sal_Char*)pNode->name); + if (pNode->ns != NULL) + { + xmlNsPtr pNs = pNode->ns; + + if (pNs->prefix != NULL) + { + rtl::OString sPrefix((const sal_Char*)pNs->prefix); + sNodeName = sPrefix+rtl::OString(":")+sNodeName; + } + } + + return sNodeName; +} + +xmlNodePtr XMLDocumentWrapper_XmlSecImpl::checkElement( const cssu::Reference< cssxw::XXMLElementWrapper >& xXMLElement) const +/****** XMLDocumentWrapper_XmlSecImpl/checkElement **************************** + * + * NAME + * checkElement -- Retrives the node wrapped by an XXMLElementWrapper + * interface + * + * SYNOPSIS + * node = checkElement(xXMLElement); + * + * FUNCTION + * see NAME + * + * INPUTS + * xXMLElement - the XXMLElementWrapper interface wraping a node + * + * RESULT + * node - the node wrapped in the XXMLElementWrapper interface + * + * HISTORY + * 05.01.2004 - implemented + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ + xmlNodePtr rc = NULL; + + if (xXMLElement.is()) + { + cssu::Reference< cssl::XUnoTunnel > xNodTunnel( xXMLElement, cssu::UNO_QUERY ) ; + if( !xNodTunnel.is() ) + { + throw cssu::RuntimeException() ; + } + + XMLElementWrapper_XmlSecImpl* pElement + = reinterpret_cast<XMLElementWrapper_XmlSecImpl*>( + sal::static_int_cast<sal_uIntPtr>( + xNodTunnel->getSomething( + XMLElementWrapper_XmlSecImpl::getUnoTunnelImplementationId() ))) ; + + if( pElement == NULL ) { + throw cssu::RuntimeException() ; + } + + rc = pElement->getNativeElement(); + } + + return rc; +} + +sal_Int32 XMLDocumentWrapper_XmlSecImpl::recursiveDelete( + const xmlNodePtr pNode) +/****** XMLDocumentWrapper_XmlSecImpl/recursiveDelete ************************* + * + * NAME + * recursiveDelete -- Deletes a paticular node with its branch. + * + * SYNOPSIS + * result = recursiveDelete(pNode); + * + * FUNCTION + * Deletes a paticular node with its branch, while reserving the nodes + * (and their brance) listed in the m_aReservedNodes. + * The deletion process is preformed in the tree order, that is, a node + * is deleted after its previous sibling node is deleted, a parent node + * is deleted after its branch is deleted. + * During the deletion process when the m_pStopAtNode is reached, the + * progress is interrupted at once. + * + * INPUTS + * pNode - the node to be deleted + * + * RESULT + * result - the result of the deletion process, can be one of following + * values: + * NODE_STOPED - the process is interrupted by meeting the + * m_pStopAtNode + * NODE_NOTREMOVED - the pNode is not completely removed + * because there is its descendant in the + * m_aReservedNodes list + * NODE_REMOVED - the pNode and its branch are completely + * removed + * + * NOTES + * The node in the m_aReservedNodes list must be in the tree order, otherwise + * the result is unpredictable. + * + * HISTORY + * 05.01.2004 - implemented + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ + if (pNode == m_pStopAtNode) + { + return NODE_STOPED; + } + + if (pNode != m_pCurrentReservedNode) + { + xmlNodePtr pChild = pNode->children; + + xmlNodePtr pNextSibling; + bool bIsRemoved = true; + sal_Int32 nResult; + + while( pChild != NULL ) + { + pNextSibling = pChild->next; + nResult = recursiveDelete(pChild); + + switch (nResult) + { + case NODE_STOPED: + return NODE_STOPED; + case NODE_NOTREMOVED: + bIsRemoved = false; + break; + case NODE_REMOVED: + removeNode(pChild); + break; + default: + throw cssu::RuntimeException(); + } + + pChild = pNextSibling; + } + + if (pNode == m_pCurrentElement) + { + bIsRemoved = false; + } + + return bIsRemoved?NODE_REMOVED:NODE_NOTREMOVED; + } + else + { + getNextReservedNode(); + return NODE_NOTREMOVED; + } +} + +void XMLDocumentWrapper_XmlSecImpl::getNextReservedNode() +/****** XMLDocumentWrapper_XmlSecImpl/getNextReservedNode ********************* + * + * NAME + * getNextReservedNode -- Highlights the next reserved node in the + * reserved node list + * + * SYNOPSIS + * getNextReservedNode(); + * + * FUNCTION + * The m_aReservedNodes array holds a node list, while the + * m_pCurrentReservedNode points to the one currently highlighted. + * This method is used to highlight the next node in the node list. + * This method is called at the time when the current highlighted node + * has been already processed, and the next node should be ready. + * + * INPUTS + * empty + * + * RESULT + * empty + * + * HISTORY + * 05.01.2004 - implemented + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ + if (m_nReservedNodeIndex < m_aReservedNodes.getLength()) + { + m_pCurrentReservedNode = checkElement( m_aReservedNodes[m_nReservedNodeIndex] ); + m_nReservedNodeIndex ++; + } + else + { + m_pCurrentReservedNode = NULL; + } +} + +void XMLDocumentWrapper_XmlSecImpl::removeNode(const xmlNodePtr pNode) const +/****** XMLDocumentWrapper_XmlSecImpl/removeNode ****************************** + * + * NAME + * removeNode -- Deletes a node with its branch unconditionaly + * + * SYNOPSIS + * removeNode( pNode ); + * + * FUNCTION + * Delete the node along with its branch from the document. + * + * INPUTS + * pNode - the node to be deleted + * + * RESULT + * empty + * + * HISTORY + * 05.01.2004 - implemented + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ + /* you can't remove the current node */ + OSL_ASSERT( m_pCurrentElement != pNode ); + + xmlAttrPtr pAttr = pNode->properties; + + while (pAttr != NULL) + { + if (!stricmp((sal_Char*)pAttr->name,"id")) + { + xmlRemoveID(m_pDocument, pAttr); + } + + pAttr = pAttr->next; + } + + xmlUnlinkNode(pNode); + xmlFreeNode(pNode); +} + +void XMLDocumentWrapper_XmlSecImpl::buildIDAttr(xmlNodePtr pNode) const +/****** XMLDocumentWrapper_XmlSecImpl/buildIDAttr ***************************** + * + * NAME + * buildIDAttr -- build the ID attribute of a node + * + * SYNOPSIS + * buildIDAttr( pNode ); + * + * FUNCTION + * see NAME + * + * INPUTS + * pNode - the node whose id attribute will be built + * + * RESULT + * empty + * + * HISTORY + * 14.06.2004 - implemented + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ + xmlAttrPtr idAttr = xmlHasProp( pNode, (const unsigned char *)"id" ); + if (idAttr == NULL) + { + idAttr = xmlHasProp( pNode, (const unsigned char *)"Id" ); + } + + if (idAttr != NULL) + { + xmlChar* idValue = xmlNodeListGetString( m_pDocument, idAttr->children, 1 ) ; + xmlAddID( NULL, m_pDocument, idValue, idAttr ); + } +} + +void XMLDocumentWrapper_XmlSecImpl::rebuildIDLink(xmlNodePtr pNode) const +/****** XMLDocumentWrapper_XmlSecImpl/rebuildIDLink *************************** + * + * NAME + * rebuildIDLink -- rebuild the ID link for the branch + * + * SYNOPSIS + * rebuildIDLink( pNode ); + * + * FUNCTION + * see NAME + * + * INPUTS + * pNode - the node, from which the branch will be rebuilt + * + * RESULT + * empty + * + * HISTORY + * 14.06.2004 - implemented + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ + if (pNode != NULL && pNode->type == XML_ELEMENT_NODE) + { + buildIDAttr( pNode ); + + xmlNodePtr child = pNode->children; + while (child != NULL) + { + rebuildIDLink(child); + child = child->next; + } + } +} + +/* XXMLDocumentWrapper */ +cssu::Reference< cssxw::XXMLElementWrapper > SAL_CALL XMLDocumentWrapper_XmlSecImpl::getCurrentElement( ) + throw (cssu::RuntimeException) +{ + XMLElementWrapper_XmlSecImpl* pElement = new XMLElementWrapper_XmlSecImpl(m_pCurrentElement); + return (cssu::Reference< cssxw::XXMLElementWrapper >)pElement; +} + +void SAL_CALL XMLDocumentWrapper_XmlSecImpl::setCurrentElement( const cssu::Reference< cssxw::XXMLElementWrapper >& element ) + throw (cssu::RuntimeException) +{ + m_pCurrentElement = checkElement( element ); + saxHelper.setCurrentNode( m_pCurrentElement ); +} + +void SAL_CALL XMLDocumentWrapper_XmlSecImpl::removeCurrentElement( ) + throw (cssu::RuntimeException) +{ + OSL_ASSERT( m_pCurrentElement != NULL ); + + xmlNodePtr pOldCurrentElement = m_pCurrentElement; + + /* + * pop the top node in the parser context's + * nodeTab stack, then the parent of that node will + * automatically become the new stack top, and + * the current node as well. + */ + saxHelper.endElement( + rtl::OUString( + RTL_UTF8_USTRINGPARAM ( + (sal_Char*)(pOldCurrentElement->name) + ))); + m_pCurrentElement = saxHelper.getCurrentNode(); + + /* + * remove the node + */ + removeNode(pOldCurrentElement); +} + +sal_Bool SAL_CALL XMLDocumentWrapper_XmlSecImpl::isCurrent( const cssu::Reference< cssxw::XXMLElementWrapper >& node ) + throw (cssu::RuntimeException) +{ + xmlNodePtr pNode = checkElement(node); + return (pNode == m_pCurrentElement); +} + +sal_Bool SAL_CALL XMLDocumentWrapper_XmlSecImpl::isCurrentElementEmpty( ) + throw (cssu::RuntimeException) +{ + sal_Bool rc = sal_False; + + if (m_pCurrentElement->children == NULL) + { + rc = sal_True; + } + + return rc; +} + +rtl::OUString SAL_CALL XMLDocumentWrapper_XmlSecImpl::getNodeName( const cssu::Reference< cssxw::XXMLElementWrapper >& node ) + throw (cssu::RuntimeException) +{ + xmlNodePtr pNode = checkElement(node); + return rtl::OUString(RTL_UTF8_USTRINGPARAM ( (sal_Char*)pNode->name )); +} + +void SAL_CALL XMLDocumentWrapper_XmlSecImpl::clearUselessData( + const cssu::Reference< cssxw::XXMLElementWrapper >& node, + const cssu::Sequence< cssu::Reference< cssxw::XXMLElementWrapper > >& reservedDescendants, + const cssu::Reference< cssxw::XXMLElementWrapper >& stopAtNode ) + throw (cssu::RuntimeException) +{ + xmlNodePtr pTargetNode = checkElement(node); + + m_pStopAtNode = checkElement(stopAtNode); + m_aReservedNodes = reservedDescendants; + m_nReservedNodeIndex = 0; + + getNextReservedNode(); + + recursiveDelete(pTargetNode); +} + +void SAL_CALL XMLDocumentWrapper_XmlSecImpl::collapse( const cssu::Reference< cssxw::XXMLElementWrapper >& node ) + throw (cssu::RuntimeException) +{ + xmlNodePtr pTargetNode = checkElement(node); + xmlNodePtr pParent; + + while (pTargetNode != NULL) + { + if (pTargetNode->children != NULL || pTargetNode == m_pCurrentElement) + { + break; + } + + pParent = pTargetNode->parent; + removeNode(pTargetNode); + pTargetNode = pParent; + } +} + +void SAL_CALL XMLDocumentWrapper_XmlSecImpl::getTree( const cssu::Reference< cssxs::XDocumentHandler >& handler ) + throw (cssxs::SAXException, cssu::RuntimeException) +{ + if (m_pRootElement != NULL) + { + xmlNodePtr pTempCurrentElement = m_pCurrentElement; + sal_Int32 nTempCurrentPosition = m_nCurrentPosition; + + m_pCurrentElement = m_pRootElement; + + m_nCurrentPosition = NODEPOSITION_STARTELEMENT; + cssu::Reference< cssxs::XDocumentHandler > xHandler = handler; + + while(true) + { + switch (m_nCurrentPosition) + { + case NODEPOSITION_STARTELEMENT: + sendStartElement(NULL, xHandler, m_pCurrentElement); + break; + case NODEPOSITION_ENDELEMENT: + sendEndElement(NULL, xHandler, m_pCurrentElement); + break; + case NODEPOSITION_NORMAL: + sendNode(NULL, xHandler, m_pCurrentElement); + break; + } + + if ( (m_pCurrentElement == m_pRootElement) && (m_nCurrentPosition == NODEPOSITION_ENDELEMENT )) + { + break; + } + + getNextSAXEvent(); + } + + m_pCurrentElement = pTempCurrentElement; + m_nCurrentPosition = nTempCurrentPosition; + } +} + +void SAL_CALL XMLDocumentWrapper_XmlSecImpl::generateSAXEvents( + const cssu::Reference< cssxs::XDocumentHandler >& handler, + const cssu::Reference< cssxs::XDocumentHandler >& xEventKeeperHandler, + const cssu::Reference< cssxw::XXMLElementWrapper >& startNode, + const cssu::Reference< cssxw::XXMLElementWrapper >& endNode ) + throw (cssxs::SAXException, cssu::RuntimeException) +{ + /* + * The first SAX event is the startElement of the startNode + * element. + */ + bool bHasCurrentElementChild = (m_pCurrentElement->children != NULL); + + xmlNodePtr pTempCurrentElement = m_pCurrentElement; + + m_pCurrentElement = checkElement(startNode); + + if (m_pCurrentElement->type == XML_ELEMENT_NODE) + { + m_nCurrentPosition = NODEPOSITION_STARTELEMENT; + } + else + { + m_nCurrentPosition = NODEPOSITION_NORMAL; + } + + xmlNodePtr pEndNode = checkElement(endNode); + + cssu::Reference < cssxc::sax::XSAXEventKeeper > xSAXEventKeeper( xEventKeeperHandler, cssu::UNO_QUERY ); + + cssu::Reference< cssxs::XDocumentHandler > xHandler = handler; + + while(true) + { + switch (m_nCurrentPosition) + { + case NODEPOSITION_STARTELEMENT: + sendStartElement(xHandler, xEventKeeperHandler, m_pCurrentElement); + break; + case NODEPOSITION_ENDELEMENT: + sendEndElement(xHandler, xEventKeeperHandler, m_pCurrentElement); + break; + case NODEPOSITION_NORMAL: + sendNode(xHandler, xEventKeeperHandler, m_pCurrentElement); + break; + default: + throw cssu::RuntimeException(); + } + + if (xSAXEventKeeper->isBlocking()) + { + xHandler = NULL; + } + + if (pEndNode == NULL && + ((bHasCurrentElementChild && m_pCurrentElement == xmlGetLastChild(pTempCurrentElement) && m_nCurrentPosition != NODEPOSITION_STARTELEMENT) || + (!bHasCurrentElementChild && m_pCurrentElement == pTempCurrentElement && m_nCurrentPosition == NODEPOSITION_STARTELEMENT))) + { + break; + } + + getNextSAXEvent(); + + /* + * If there is an end point specified, then check whether + * the current node equals to the end point. If so, stop + * generating. + */ + if (pEndNode != NULL && m_pCurrentElement == pEndNode) + { + break; + } + } + + m_pCurrentElement = pTempCurrentElement; +} + +void SAL_CALL XMLDocumentWrapper_XmlSecImpl::rebuildIDLink( + const com::sun::star::uno::Reference< com::sun::star::xml::wrapper::XXMLElementWrapper >& node ) + throw (com::sun::star::uno::RuntimeException) +{ + xmlNodePtr pNode = checkElement( node ); + rebuildIDLink(pNode); +} + + +/* cssxs::XDocumentHandler */ +void SAL_CALL XMLDocumentWrapper_XmlSecImpl::startDocument( ) + throw (cssxs::SAXException, cssu::RuntimeException) +{ +} + +void SAL_CALL XMLDocumentWrapper_XmlSecImpl::endDocument( ) + throw (cssxs::SAXException, cssu::RuntimeException) +{ +} + +void SAL_CALL XMLDocumentWrapper_XmlSecImpl::startElement( const rtl::OUString& aName, const cssu::Reference< cssxs::XAttributeList >& xAttribs ) + throw (cssxs::SAXException, cssu::RuntimeException) +{ + sal_Int32 nLength = xAttribs->getLength(); + cssu::Sequence< cssxcsax::XMLAttribute > aAttributes (nLength); + + for (int i = 0; i < nLength; ++i) + { + aAttributes[i].sName = xAttribs->getNameByIndex((short)i); + aAttributes[i].sValue =xAttribs->getValueByIndex((short)i); + } + + _startElement(aName, aAttributes); +} + +void SAL_CALL XMLDocumentWrapper_XmlSecImpl::endElement( const rtl::OUString& aName ) + throw (cssxs::SAXException, cssu::RuntimeException) +{ + saxHelper.endElement(aName); + m_pCurrentElement = saxHelper.getCurrentNode(); +} + +void SAL_CALL XMLDocumentWrapper_XmlSecImpl::characters( const rtl::OUString& aChars ) + throw (cssxs::SAXException, cssu::RuntimeException) +{ + saxHelper.characters(aChars); +} + +void SAL_CALL XMLDocumentWrapper_XmlSecImpl::ignorableWhitespace( const rtl::OUString& aWhitespaces ) + throw (cssxs::SAXException, cssu::RuntimeException) +{ + saxHelper.ignorableWhitespace(aWhitespaces); +} + +void SAL_CALL XMLDocumentWrapper_XmlSecImpl::processingInstruction( const rtl::OUString& aTarget, const rtl::OUString& aData ) + throw (cssxs::SAXException, cssu::RuntimeException) +{ + saxHelper.processingInstruction(aTarget, aData); +} + +void SAL_CALL XMLDocumentWrapper_XmlSecImpl::setDocumentLocator( const cssu::Reference< cssxs::XLocator >& xLocator ) + throw (cssxs::SAXException, cssu::RuntimeException) +{ + saxHelper.setDocumentLocator(xLocator); +} + +/* XCompressedDocumentHandler */ +void SAL_CALL XMLDocumentWrapper_XmlSecImpl::_startDocument( ) + throw (cssxs::SAXException, cssu::RuntimeException) +{ +} + +void SAL_CALL XMLDocumentWrapper_XmlSecImpl::_endDocument( ) + throw (cssxs::SAXException, cssu::RuntimeException) +{ +} + +void SAL_CALL XMLDocumentWrapper_XmlSecImpl::_startElement( const rtl::OUString& aName, const cssu::Sequence< cssxcsax::XMLAttribute >& aAttributes ) + throw (cssxs::SAXException, cssu::RuntimeException) +{ + saxHelper.startElement(aName, aAttributes); + m_pCurrentElement = saxHelper.getCurrentNode(); + + buildIDAttr( m_pCurrentElement ); +} + +void SAL_CALL XMLDocumentWrapper_XmlSecImpl::_endElement( const rtl::OUString& aName ) + throw (cssxs::SAXException, cssu::RuntimeException) +{ + endElement( aName ); +} + +void SAL_CALL XMLDocumentWrapper_XmlSecImpl::_characters( const rtl::OUString& aChars ) + throw (cssxs::SAXException, cssu::RuntimeException) +{ + characters( aChars ); +} + +void SAL_CALL XMLDocumentWrapper_XmlSecImpl::_ignorableWhitespace( const rtl::OUString& aWhitespaces ) + throw (cssxs::SAXException, cssu::RuntimeException) +{ + ignorableWhitespace( aWhitespaces ); +} + +void SAL_CALL XMLDocumentWrapper_XmlSecImpl::_processingInstruction( const rtl::OUString& aTarget, const rtl::OUString& aData ) + throw (cssxs::SAXException, cssu::RuntimeException) +{ + processingInstruction( aTarget, aData ); +} + +void SAL_CALL XMLDocumentWrapper_XmlSecImpl::_setDocumentLocator( sal_Int32 /*columnNumber*/, sal_Int32 /*lineNumber*/, const rtl::OUString& /*publicId*/, const rtl::OUString& /*systemId*/ ) + throw (cssxs::SAXException, cssu::RuntimeException) +{ +} + +rtl::OUString XMLDocumentWrapper_XmlSecImpl_getImplementationName () + throw (cssu::RuntimeException) +{ + return rtl::OUString ( RTL_ASCII_USTRINGPARAM ( IMPLEMENTATION_NAME ) ); +} + +sal_Bool SAL_CALL XMLDocumentWrapper_XmlSecImpl_supportsService( const rtl::OUString& ServiceName ) + throw (cssu::RuntimeException) +{ + return ServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( SERVICE_NAME )); +} + +cssu::Sequence< rtl::OUString > SAL_CALL XMLDocumentWrapper_XmlSecImpl_getSupportedServiceNames( ) + throw (cssu::RuntimeException) +{ + cssu::Sequence < rtl::OUString > aRet(1); + rtl::OUString* pArray = aRet.getArray(); + pArray[0] = rtl::OUString ( RTL_ASCII_USTRINGPARAM ( SERVICE_NAME ) ); + return aRet; +} +#undef SERVICE_NAME + +cssu::Reference< cssu::XInterface > SAL_CALL XMLDocumentWrapper_XmlSecImpl_createInstance( + const cssu::Reference< cssl::XMultiServiceFactory > &) + throw( cssu::Exception ) +{ + return (cppu::OWeakObject*) new XMLDocumentWrapper_XmlSecImpl( ); +} + +/* XServiceInfo */ +rtl::OUString SAL_CALL XMLDocumentWrapper_XmlSecImpl::getImplementationName( ) + throw (cssu::RuntimeException) +{ + return XMLDocumentWrapper_XmlSecImpl_getImplementationName(); +} +sal_Bool SAL_CALL XMLDocumentWrapper_XmlSecImpl::supportsService( const rtl::OUString& rServiceName ) + throw (cssu::RuntimeException) +{ + return XMLDocumentWrapper_XmlSecImpl_supportsService( rServiceName ); +} +cssu::Sequence< rtl::OUString > SAL_CALL XMLDocumentWrapper_XmlSecImpl::getSupportedServiceNames( ) + throw (cssu::RuntimeException) +{ + return XMLDocumentWrapper_XmlSecImpl_getSupportedServiceNames(); +} + diff --git a/xmlsecurity/source/xmlsec/xmldocumentwrapper_xmlsecimpl.hxx b/xmlsecurity/source/xmlsec/xmldocumentwrapper_xmlsecimpl.hxx new file mode 100644 index 000000000000..d2051fcf1406 --- /dev/null +++ b/xmlsecurity/source/xmlsec/xmldocumentwrapper_xmlsecimpl.hxx @@ -0,0 +1,284 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _XMLDOCUMENTWRAPPER_XMLSECIMPL_HXX +#define _XMLDOCUMENTWRAPPER_XMLSECIMPL_HXX + +#include <com/sun/star/xml/wrapper/XXMLDocumentWrapper.hpp> +#include <com/sun/star/xml/csax/XCompressedDocumentHandler.hpp> +#include <com/sun/star/xml/crypto/sax/XSAXEventKeeper.hpp> +#include <com/sun/star/lang/XServiceInfo.hpp> +#include <cppuhelper/implbase4.hxx> + +#include "saxhelper.hxx" +//#include "libxml/parserInternals.h" +//#include "libxslt/xslt.h" + +#define NODEPOSITION_NORMAL 1 +#define NODEPOSITION_STARTELEMENT 2 +#define NODEPOSITION_ENDELEMENT 3 + +#include <libxml/tree.h> + +class XMLDocumentWrapper_XmlSecImpl : public cppu::WeakImplHelper4 +< + com::sun::star::xml::wrapper::XXMLDocumentWrapper, + com::sun::star::xml::sax::XDocumentHandler, + com::sun::star::xml::csax::XCompressedDocumentHandler, + com::sun::star::lang::XServiceInfo +> +/****** XMLDocumentWrapper_XmlSecImpl.hxx/CLASS XMLDocumentWrapper_XmlSecImpl * + * + * NAME + * XMLDocumentWrapper_XmlSecImpl -- Class to manipulate a libxml2 + * document + * + * FUNCTION + * Converts SAX events into a libxml2 document, converts the document back + * into SAX event stream, and manipulate nodes in the document. + * + * HISTORY + * 05.01.2004 - Interface supported: XXMLDocumentWrapper, + * XDocumentHandler, XCompressedDocumentHandler, + * XServiceInfo + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ +private: + /* the sax helper */ + SAXHelper saxHelper; + + /* the document used to convert SAX events to */ + xmlDocPtr m_pDocument; + + /* the root element */ + xmlNodePtr m_pRootElement; + + /* + * the current active element. The next incoming SAX event will be + * appended to this element + */ + xmlNodePtr m_pCurrentElement; + + /* + * This variable is used when converting the document or part of it into + * SAX events. See getNextSAXEvent method. + */ + sal_Int32 m_nCurrentPosition; + + /* + * used for recursive deletion. See recursiveDelete method + */ + xmlNodePtr m_pStopAtNode; + xmlNodePtr m_pCurrentReservedNode; + com::sun::star::uno::Sequence< com::sun::star::uno::Reference< + com::sun::star::xml::wrapper::XXMLElementWrapper > > m_aReservedNodes; + sal_Int32 m_nReservedNodeIndex; + +private: + void getNextSAXEvent(); + + void sendStartElement( + const com::sun::star::uno::Reference< com::sun::star::xml::sax::XDocumentHandler >& xHandler, + const com::sun::star::uno::Reference< com::sun::star::xml::sax::XDocumentHandler >& xHandler2, + const xmlNodePtr pNode) const + throw (com::sun::star::xml::sax::SAXException); + + void sendEndElement( + const com::sun::star::uno::Reference< com::sun::star::xml::sax::XDocumentHandler >& xHandler, + const com::sun::star::uno::Reference< com::sun::star::xml::sax::XDocumentHandler >& xHandler2, + const xmlNodePtr pNode) const + throw (com::sun::star::xml::sax::SAXException); + + void sendNode( + const com::sun::star::uno::Reference< com::sun::star::xml::sax::XDocumentHandler >& xHandler, + const com::sun::star::uno::Reference< com::sun::star::xml::sax::XDocumentHandler >& xHandler2, + const xmlNodePtr pNode) const + throw (com::sun::star::xml::sax::SAXException); + + rtl::OString getNodeQName(const xmlNodePtr pNode) const; + + sal_Int32 recursiveDelete( const xmlNodePtr pNode); + + void getNextReservedNode(); + + void removeNode( const xmlNodePtr pNode) const; + + xmlNodePtr checkElement( + const com::sun::star::uno::Reference< + com::sun::star::xml::wrapper::XXMLElementWrapper >& xXMLElement) const; + + void buildIDAttr( xmlNodePtr pNode ) const; + void rebuildIDLink( xmlNodePtr pNode ) const; + +public: + XMLDocumentWrapper_XmlSecImpl(); + virtual ~XMLDocumentWrapper_XmlSecImpl(); + + /* com::sun::star::xml::wrapper::XXMLDocumentWrapper */ + virtual com::sun::star::uno::Reference< + com::sun::star::xml::wrapper::XXMLElementWrapper > SAL_CALL getCurrentElement( ) + throw (com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL setCurrentElement( const com::sun::star::uno::Reference< + com::sun::star::xml::wrapper::XXMLElementWrapper >& element ) + throw (com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL removeCurrentElement( ) + throw (com::sun::star::uno::RuntimeException); + + virtual sal_Bool SAL_CALL isCurrent( const com::sun::star::uno::Reference< + com::sun::star::xml::wrapper::XXMLElementWrapper >& node ) + throw (com::sun::star::uno::RuntimeException); + + virtual sal_Bool SAL_CALL isCurrentElementEmpty( ) + throw (com::sun::star::uno::RuntimeException); + + virtual rtl::OUString SAL_CALL getNodeName( const com::sun::star::uno::Reference< + com::sun::star::xml::wrapper::XXMLElementWrapper >& node ) + throw (com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL clearUselessData( + const com::sun::star::uno::Reference< + com::sun::star::xml::wrapper::XXMLElementWrapper >& node, + const com::sun::star::uno::Sequence< com::sun::star::uno::Reference< + com::sun::star::xml::wrapper::XXMLElementWrapper > >& reservedDescendants, + const com::sun::star::uno::Reference< + com::sun::star::xml::wrapper::XXMLElementWrapper >& stopAtNode ) + throw (com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL collapse( const com::sun::star::uno::Reference< + com::sun::star::xml::wrapper::XXMLElementWrapper >& node ) + throw (com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL generateSAXEvents( + const com::sun::star::uno::Reference< com::sun::star::xml::sax::XDocumentHandler >& handler, + const com::sun::star::uno::Reference< com::sun::star::xml::sax::XDocumentHandler >& xEventKeeperHandler, + const com::sun::star::uno::Reference< + com::sun::star::xml::wrapper::XXMLElementWrapper >& startNode, + const com::sun::star::uno::Reference< + com::sun::star::xml::wrapper::XXMLElementWrapper >& endNode ) + throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL getTree( + const com::sun::star::uno::Reference< com::sun::star::xml::sax::XDocumentHandler >& handler ) + throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL rebuildIDLink( + const com::sun::star::uno::Reference< com::sun::star::xml::wrapper::XXMLElementWrapper >& node ) + throw (com::sun::star::uno::RuntimeException); + + /* com::sun::star::xml::sax::XDocumentHandler */ + virtual void SAL_CALL startDocument( ) + throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL endDocument( ) + throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL startElement( + const rtl::OUString& aName, + const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttribs ) + throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL endElement( const rtl::OUString& aName ) + throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL characters( const rtl::OUString& aChars ) + throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL ignorableWhitespace( const rtl::OUString& aWhitespaces ) + throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL processingInstruction( const rtl::OUString& aTarget, const rtl::OUString& aData ) + throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL setDocumentLocator( const com::sun::star::uno::Reference< com::sun::star::xml::sax::XLocator >& xLocator ) + throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException); + + /* com::sun::star::xml::csax::XCompressedDocumentHandler */ + virtual void SAL_CALL _startDocument( ) + throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL _endDocument( ) + throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL _startElement( + const rtl::OUString& aName, + const com::sun::star::uno::Sequence< + com::sun::star::xml::csax::XMLAttribute >& aAttributes ) + throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL _endElement( const rtl::OUString& aName ) + throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL _characters( const rtl::OUString& aChars ) + throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL _ignorableWhitespace( const rtl::OUString& aWhitespaces ) + throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL _processingInstruction( const rtl::OUString& aTarget, const rtl::OUString& aData ) + throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL _setDocumentLocator( + sal_Int32 columnNumber, + sal_Int32 lineNumber, + const rtl::OUString& publicId, + const rtl::OUString& systemId ) + throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException); + + /* com::sun::star::lang::XServiceInfo */ + virtual rtl::OUString SAL_CALL getImplementationName( ) + throw (com::sun::star::uno::RuntimeException); + + virtual sal_Bool SAL_CALL supportsService( const rtl::OUString& ServiceName ) + throw (com::sun::star::uno::RuntimeException); + + virtual com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames( ) + throw (com::sun::star::uno::RuntimeException); +}; + +rtl::OUString XMLDocumentWrapper_XmlSecImpl_getImplementationName() + throw ( com::sun::star::uno::RuntimeException ); + +sal_Bool SAL_CALL XMLDocumentWrapper_XmlSecImpl_supportsService( const rtl::OUString& ServiceName ) + throw ( com::sun::star::uno::RuntimeException ); + +com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL + XMLDocumentWrapper_XmlSecImpl_getSupportedServiceNames( ) + throw ( com::sun::star::uno::RuntimeException ); + +com::sun::star::uno::Reference< com::sun::star::uno::XInterface > +SAL_CALL XMLDocumentWrapper_XmlSecImpl_createInstance( + const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > & rSMgr) + throw ( com::sun::star::uno::Exception ); + +#endif + diff --git a/xmlsecurity/source/xmlsec/xmlelementwrapper_xmlsecimpl.cxx b/xmlsecurity/source/xmlsec/xmlelementwrapper_xmlsecimpl.cxx new file mode 100644 index 000000000000..f9de04c16d5f --- /dev/null +++ b/xmlsecurity/source/xmlsec/xmlelementwrapper_xmlsecimpl.cxx @@ -0,0 +1,187 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_xmlsecurity.hxx" + +#include "xmlelementwrapper_xmlsecimpl.hxx" +#include <cppuhelper/typeprovider.hxx> + +namespace cssu = com::sun::star::uno; +namespace cssl = com::sun::star::lang; + +#define SERVICE_NAME "com.sun.star.xml.wrapper.XMLElementWrapper" +#define IMPLEMENTATION_NAME "com.sun.star.xml.security.bridge.xmlsec.XMLElementWrapper_XmlSecImpl" + +XMLElementWrapper_XmlSecImpl::XMLElementWrapper_XmlSecImpl(const xmlNodePtr pNode) + : m_pElement( pNode ) +{ +} + +/* XXMLElementWrapper */ + + +/* XUnoTunnel */ +cssu::Sequence< sal_Int8 > XMLElementWrapper_XmlSecImpl::getUnoTunnelImplementationId( void ) + throw (cssu::RuntimeException) +{ + static ::cppu::OImplementationId* pId = 0; + if (! pId) + { + ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); + if (! pId) + { + static ::cppu::OImplementationId aId; + pId = &aId; + } + } + return pId->getImplementationId(); +} + +sal_Int64 SAL_CALL XMLElementWrapper_XmlSecImpl::getSomething( const cssu::Sequence< sal_Int8 >& aIdentifier ) + throw (cssu::RuntimeException) +{ + if (aIdentifier.getLength() == 16 && + 0 == rtl_compareMemory( + getUnoTunnelImplementationId().getConstArray(), + aIdentifier.getConstArray(), + 16 )) + { + return reinterpret_cast < sal_Int64 > ( this ); + } + else + { + return 0; + } +} + + +rtl::OUString XMLElementWrapper_XmlSecImpl_getImplementationName () + throw (cssu::RuntimeException) +{ + return rtl::OUString ( RTL_CONSTASCII_USTRINGPARAM ( IMPLEMENTATION_NAME ) ); +} + +sal_Bool SAL_CALL XMLElementWrapper_XmlSecImpl_supportsService( const rtl::OUString& ServiceName ) + throw (cssu::RuntimeException) +{ + return ServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( SERVICE_NAME )); +} + +cssu::Sequence< rtl::OUString > SAL_CALL XMLElementWrapper_XmlSecImpl_getSupportedServiceNames( ) + throw (cssu::RuntimeException) +{ + cssu::Sequence < rtl::OUString > aRet(1); + rtl::OUString* pArray = aRet.getArray(); + pArray[0] = rtl::OUString ( RTL_CONSTASCII_USTRINGPARAM ( SERVICE_NAME ) ); + return aRet; +} +#undef SERVICE_NAME + +cssu::Reference< cssu::XInterface > SAL_CALL + XMLElementWrapper_XmlSecImpl_createInstance( + const cssu::Reference< cssl::XMultiServiceFactory > &) + throw( cssu::Exception ) +{ + return (cppu::OWeakObject*) new XMLElementWrapper_XmlSecImpl(NULL); +} + +/* XServiceInfo */ +rtl::OUString SAL_CALL XMLElementWrapper_XmlSecImpl::getImplementationName( ) + throw (cssu::RuntimeException) +{ + return XMLElementWrapper_XmlSecImpl_getImplementationName(); +} +sal_Bool SAL_CALL XMLElementWrapper_XmlSecImpl::supportsService( const rtl::OUString& rServiceName ) + throw (cssu::RuntimeException) +{ + return XMLElementWrapper_XmlSecImpl_supportsService( rServiceName ); +} +cssu::Sequence< rtl::OUString > SAL_CALL XMLElementWrapper_XmlSecImpl::getSupportedServiceNames( ) + throw (cssu::RuntimeException) +{ + return XMLElementWrapper_XmlSecImpl_getSupportedServiceNames(); +} + +xmlNodePtr XMLElementWrapper_XmlSecImpl::getNativeElement( ) const +/****** XMLElementWrapper_XmlSecImpl/getNativeElement ************************* + * + * NAME + * getNativeElement -- Retrieves the libxml2 node wrapped by this object + * + * SYNOPSIS + * pNode = getNativeElement(); + * + * FUNCTION + * see NAME + * + * INPUTS + * empty + * + * RESULT + * pNode - the libxml2 node wrapped by this object + * + * HISTORY + * 05.01.2004 - implemented + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ + return m_pElement; +} + +void XMLElementWrapper_XmlSecImpl::setNativeElement(const xmlNodePtr pNode) +/****** XMLElementWrapper_XmlSecImpl/setNativeElement ************************* + * + * NAME + * setNativeElement -- Configures the libxml2 node wrapped by this object + * + * SYNOPSIS + * setNativeElement( pNode ); + * + * FUNCTION + * see NAME + * + * INPUTS + * pNode - the new libxml2 node to be wrapped by this object + * + * RESULT + * empty + * + * HISTORY + * 05.01.2004 - implemented + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ + m_pElement = pNode; +} + diff --git a/xmlsecurity/source/xmlsec/xmlelementwrapper_xmlsecimpl.hxx b/xmlsecurity/source/xmlsec/xmlelementwrapper_xmlsecimpl.hxx new file mode 100644 index 000000000000..e90513266ec5 --- /dev/null +++ b/xmlsecurity/source/xmlsec/xmlelementwrapper_xmlsecimpl.hxx @@ -0,0 +1,108 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _XMLELEMENTWRAPPER_XMLSECIMPL_HXX +#define _XMLELEMENTWRAPPER_XMLSECIMPL_HXX + +#include <com/sun/star/xml/wrapper/XXMLElementWrapper.hpp> +#include <com/sun/star/lang/XUnoTunnel.hpp> +#include <com/sun/star/lang/XInitialization.hpp> +#include <com/sun/star/lang/XServiceInfo.hpp> +#include <cppuhelper/implbase3.hxx> + +#include <libxml/tree.h> + +class XMLElementWrapper_XmlSecImpl : public cppu::WeakImplHelper3 +< + com::sun::star::xml::wrapper::XXMLElementWrapper, + com::sun::star::lang::XUnoTunnel, + com::sun::star::lang::XServiceInfo +> +/****** XMLElementWrapper_XmlSecImpl.hxx/CLASS XMLElementWrapper_XmlSecImpl *** + * + * NAME + * XMLElementWrapper_XmlSecImpl -- Class to wrap a libxml2 node + * + * FUNCTION + * Used as a wrapper class to transfer a libxml2 node structure + * between different UNO components. + * + * HISTORY + * 05.01.2004 - Interface supported: XXMLElementWrapper, XUnoTunnel + * XServiceInfo + * + * AUTHOR + * Michael Mi + * Email: michael.mi@sun.com + ******************************************************************************/ +{ +private: + /* the libxml2 node wrapped by this object */ + xmlNodePtr m_pElement; + +public: + explicit XMLElementWrapper_XmlSecImpl(const xmlNodePtr pNode); + virtual ~XMLElementWrapper_XmlSecImpl() {}; + + /* XXMLElementWrapper */ + + /* com::sun::star::lang::XUnoTunnel */ + virtual sal_Int64 SAL_CALL getSomething( const com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) + throw (com::sun::star::uno::RuntimeException); + static com::sun::star::uno::Sequence < sal_Int8 > getUnoTunnelImplementationId( void ) + throw(com::sun::star::uno::RuntimeException); + + /* com::sun::star::lang::XServiceInfo */ + virtual rtl::OUString SAL_CALL getImplementationName( ) + throw (com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL supportsService( const rtl::OUString& ServiceName ) + throw (com::sun::star::uno::RuntimeException); + virtual com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames( ) + throw (com::sun::star::uno::RuntimeException); + +public: + xmlNodePtr getNativeElement( ) const; + void setNativeElement(const xmlNodePtr pNode); +}; + +rtl::OUString XMLElementWrapper_XmlSecImpl_getImplementationName() + throw ( com::sun::star::uno::RuntimeException ); + +sal_Bool SAL_CALL XMLElementWrapper_XmlSecImpl_supportsService( const rtl::OUString& ServiceName ) + throw ( com::sun::star::uno::RuntimeException ); + +com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL XMLElementWrapper_XmlSecImpl_getSupportedServiceNames( ) + throw ( com::sun::star::uno::RuntimeException ); + +com::sun::star::uno::Reference< com::sun::star::uno::XInterface > +SAL_CALL XMLElementWrapper_XmlSecImpl_createInstance( + const com::sun::star::uno::Reference< + com::sun::star::lang::XMultiServiceFactory > & rSMgr) + throw ( com::sun::star::uno::Exception ); + +#endif + diff --git a/xmlsecurity/source/xmlsec/xmlstreamio.cxx b/xmlsecurity/source/xmlsec/xmlstreamio.cxx new file mode 100644 index 000000000000..d5ba439467fe --- /dev/null +++ b/xmlsecurity/source/xmlsec/xmlstreamio.cxx @@ -0,0 +1,244 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_xmlsecurity.hxx" + +/* + * Implementation of the I/O interfaces based on stream and URI binding + */ +#include "xmlstreamio.hxx" +#include <rtl/ustring.hxx> +#include "rtl/uri.hxx" + +#include <libxml/uri.h> +#include <sal/types.h> +//For reasons that escape me, this is what xmlsec does when size_t is not 4 +#if SAL_TYPES_SIZEOFPOINTER != 4 +# define XMLSEC_NO_SIZE_T +#endif +#include <xmlsec/io.h> + +#define XMLSTREAMIO_INITIALIZED 0x01 +#define XMLSTREAMIO_REGISTERED 0x02 + +/* Global variables */ +/*- + * Enable stream I/O or not. + */ +static char enableXmlStreamIO = 0x00 ; + +::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XUriBinding > m_xUriBinding ; + +extern "C" +int xmlStreamMatch( const char* uri ) +{ + ::com::sun::star::uno::Reference< com::sun::star::io::XInputStream > xInputStream ; + + if( ( enableXmlStreamIO & XMLSTREAMIO_INITIALIZED ) && + ( enableXmlStreamIO & XMLSTREAMIO_REGISTERED ) ) { + if( uri == NULL || !m_xUriBinding.is() ) + return 0 ; + //XMLSec first unescapes the uri and calls this function. For example, we pass the Uri + //ObjectReplacements/Object%201 then XMLSec passes ObjectReplacements/Object 1 + //first. If this failed it would try this + //again with the original escaped string. However, it does not get this far, because there + //is another callback registered by libxml which claims to be able to handle this uri. + ::rtl::OUString sUri = + ::rtl::Uri::encode( ::rtl::OUString::createFromAscii( uri ), + rtl_UriCharClassUric, rtl_UriEncodeKeepEscapes, RTL_TEXTENCODING_UTF8); + xInputStream = m_xUriBinding->getUriBinding( sUri ) ; + if (!xInputStream.is()) + { + //Try the the passed in uri directly. + //For old documents prior OOo 3.0. We did not use URIs then. + xInputStream = m_xUriBinding->getUriBinding( + ::rtl::OUString::createFromAscii(uri)); + } + } + if (xInputStream.is()) + return 1; + else + return 0 ; +} + +extern "C" +void* xmlStreamOpen( const char* uri ) +{ + ::com::sun::star::uno::Reference< com::sun::star::io::XInputStream > xInputStream ; + ::com::sun::star::io::XInputStream* pInputStream ; + + if( ( enableXmlStreamIO & XMLSTREAMIO_INITIALIZED ) && + ( enableXmlStreamIO & XMLSTREAMIO_REGISTERED ) ) { + if( uri == NULL || !m_xUriBinding.is() ) + return NULL ; + + //see xmlStreamMatch + ::rtl::OUString sUri = + ::rtl::Uri::encode( ::rtl::OUString::createFromAscii( uri ), + rtl_UriCharClassUric, rtl_UriEncodeKeepEscapes, RTL_TEXTENCODING_UTF8); + xInputStream = m_xUriBinding->getUriBinding( sUri ) ; + if (!xInputStream.is()) + { + //For old documents. + //try the the passed in uri directly. + xInputStream = m_xUriBinding->getUriBinding( + ::rtl::OUString::createFromAscii(uri)); + } + + if( xInputStream.is() ) { + pInputStream = xInputStream.get() ; + pInputStream->acquire() ; + return ( void* )pInputStream ; + } + } + + return NULL ; +} + +extern "C" +int xmlStreamRead( void* context, char* buffer, int len ) +{ + int numbers ; + ::com::sun::star::uno::Reference< com::sun::star::io::XInputStream > xInputStream ; + ::com::sun::star::uno::Sequence< sal_Int8 > outSeqs( len ) ; + + numbers = 0 ; + if( ( enableXmlStreamIO & XMLSTREAMIO_INITIALIZED ) && + ( enableXmlStreamIO & XMLSTREAMIO_REGISTERED ) ) { + if( context != NULL ) { + xInputStream = ( com::sun::star::io::XInputStream* )context ; + if( !xInputStream.is() ) + return 0 ; + + numbers = xInputStream->readBytes( outSeqs, len ) ; + const sal_Int8* readBytes = ( const sal_Int8* )outSeqs.getArray() ; + for( int i = 0 ; i < numbers ; i ++ ) + *( buffer + i ) = *( readBytes + i ) ; + } + } + + return numbers ; +} + +extern "C" +int xmlStreamClose( void * context ) +{ + ::com::sun::star::io::XInputStream* pInputStream ; + + if( ( enableXmlStreamIO & XMLSTREAMIO_INITIALIZED ) && + ( enableXmlStreamIO & XMLSTREAMIO_REGISTERED ) ) { + if( context != NULL ) { + pInputStream = ( ::com::sun::star::io::XInputStream* )context ; + pInputStream->release() ; + } + } + + return 0 ; +} + +int xmlEnableStreamInputCallbacks() +{ + int cbs = 0 ; + + if( !( enableXmlStreamIO & XMLSTREAMIO_INITIALIZED ) ) { + //Register the callbacks into libxml2 + //cbs = xmlRegisterInputCallbacks( + // xmlStreamMatch, + // xmlStreamOpen, + // xmlStreamRead, + // xmlStreamClose ) ; + //if( cbs < 0 ) { + // return -1 ; + //} + + //Register the callbacks into xmlSec + //In order to make the xmlsec io finding the callbacks firstly, + //I put the callbacks at the very begining. + + //Cleanup the older callbacks. + //Notes: all none default callbacks will lose. + xmlSecIOCleanupCallbacks() ; + + //Register my classbacks. + cbs = xmlSecIORegisterCallbacks( + xmlStreamMatch, + xmlStreamOpen, + xmlStreamRead, + xmlStreamClose ) ; + if( cbs < 0 ) { + return -1 ; + } + + //Register the default callbacks. + //Notes: the error will cause xmlsec working problems. + cbs = xmlSecIORegisterDefaultCallbacks() ; + if( cbs < 0 ) { + return -1 ; + } + + enableXmlStreamIO |= XMLSTREAMIO_INITIALIZED ; + } + + return 0 ; +} + +int xmlRegisterStreamInputCallbacks( + ::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XUriBinding >& aUriBinding +) { + if( !( enableXmlStreamIO & XMLSTREAMIO_INITIALIZED ) ) { + if( xmlEnableStreamInputCallbacks() < 0 ) + return -1 ; + } + + if( !( enableXmlStreamIO & XMLSTREAMIO_REGISTERED ) ) { + enableXmlStreamIO |= XMLSTREAMIO_REGISTERED ; + } + + m_xUriBinding = aUriBinding ; + + return 0 ; +} + +int xmlUnregisterStreamInputCallbacks( void ) +{ + if( ( enableXmlStreamIO & XMLSTREAMIO_REGISTERED ) ) { + //Clear the uir-stream binding + m_xUriBinding.clear() ; + + //disable the registered flag + enableXmlStreamIO &= ~XMLSTREAMIO_REGISTERED ; + } + + return 0 ; +} + +void xmlDisableStreamInputCallbacks() { + xmlUnregisterStreamInputCallbacks() ; + enableXmlStreamIO &= ~XMLSTREAMIO_INITIALIZED ; +} + diff --git a/xmlsecurity/source/xmlsec/xmlstreamio.hxx b/xmlsecurity/source/xmlsec/xmlstreamio.hxx new file mode 100644 index 000000000000..3cb2e33528ab --- /dev/null +++ b/xmlsecurity/source/xmlsec/xmlstreamio.hxx @@ -0,0 +1,46 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _XMLSTREAMIO_XMLSECIMPL_HXX_ +#define _XMLSTREAMIO_XMLSECIMPL_HXX_ + +#ifndef _COM_SUN_STAR_UNO_REFERENCE_HPP_ +#include <com/sun/star/uno/Reference.hxx> +#endif +#include <com/sun/star/xml/crypto/XUriBinding.hpp> + +int xmlEnableStreamInputCallbacks( void ) ; +void xmlDisableStreamInputCallbacks( void ) ; + +int xmlRegisterStreamInputCallbacks( + ::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XUriBinding >& aUriBinding +) ; + +int xmlUnregisterStreamInputCallbacks( void ) ; + +#endif //_XMLSTREAMIO_XMLSECIMPL_HXX_ + diff --git a/xmlsecurity/source/xmlsec/xsec_xmlsec.cxx b/xmlsecurity/source/xmlsec/xsec_xmlsec.cxx new file mode 100644 index 000000000000..44f11b8d0874 --- /dev/null +++ b/xmlsecurity/source/xmlsec/xsec_xmlsec.cxx @@ -0,0 +1,160 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_xmlsecurity.hxx" + +#include <sal/config.h> +#include <stdio.h> + +#include <osl/mutex.hxx> +#include <osl/thread.h> +#include <cppuhelper/factory.hxx> +#include <cppuhelper/implbase1.hxx> +#include <com/sun/star/lang/XSingleServiceFactory.hpp> +#include <com/sun/star/security/XSerialNumberAdapter.hpp> + +#include "xmlelementwrapper_xmlsecimpl.hxx" +#include "xmldocumentwrapper_xmlsecimpl.hxx" +#include "xmlsecurity/biginteger.hxx" + +using namespace ::rtl; +using namespace ::cppu; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::lang; +using namespace ::com::sun::star::registry; + +namespace +{ +class SerialNumberAdapterImpl : public WeakImplHelper1< + ::com::sun::star::security::XSerialNumberAdapter > +{ + virtual OUString SAL_CALL toString( const Sequence< sal_Int8 >& rSerialNumber ) + throw (RuntimeException) + { + return bigIntegerToNumericString(rSerialNumber); + } + virtual Sequence< sal_Int8 > SAL_CALL toSequence( const OUString& rSerialNumber ) + throw (RuntimeException) + { + return numericStringToBigInteger(rSerialNumber); + } +}; + +OUString SerialNumberAdapterImpl_getImplementationName() + throw (RuntimeException) +{ + return OUString(RTL_CONSTASCII_USTRINGPARAM( + "com.sun.star.security.SerialNumberAdapter")); +} + +Sequence< OUString > SerialNumberAdapterImpl_getSupportedServiceNames() + throw (RuntimeException) +{ + Sequence < OUString > aRet(1); + OUString* pArray = aRet.getArray(); + pArray[0] = OUString(RTL_CONSTASCII_USTRINGPARAM( + "com.sun.star.security.SerialNumberAdapter" ) ); + return aRet; +} + +Reference< XInterface > SerialNumberAdapterImpl_createInstance( + const Reference< XComponentContext > &) throw( Exception ) +{ + return Reference< XInterface >( *new SerialNumberAdapterImpl() ); +} + +} + +extern "C" +{ + +#if defined( XMLSEC_CRYPTO_NSS ) +extern void* nss_component_getFactory( const sal_Char*, void*, void* ); +#endif + +#if defined( XMLSEC_CRYPTO_MSCRYPTO ) +extern void* mscrypt_component_getFactory( const sal_Char*, void*, void* ); +#endif + +void SAL_CALL component_getImplementationEnvironment( + const sal_Char ** ppEnvTypeName, uno_Environment **) +{ + *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; +} + +void* SAL_CALL component_getFactory( const sal_Char* pImplName , void* pServiceManager , void* pRegistryKey ) +{ + void* pRet = 0; + Reference< XInterface > xFactory ; + + if( pImplName != NULL && pServiceManager != NULL ) { + if( XMLElementWrapper_XmlSecImpl_getImplementationName().equals( OUString::createFromAscii( pImplName ) ) ) + { + xFactory = Reference< XSingleServiceFactory >( createSingleFactory( + reinterpret_cast< XMultiServiceFactory * >( pServiceManager ), + OUString::createFromAscii( pImplName ), + XMLElementWrapper_XmlSecImpl_createInstance, XMLElementWrapper_XmlSecImpl_getSupportedServiceNames() ) ); + } + else if( XMLDocumentWrapper_XmlSecImpl_getImplementationName().equals( OUString::createFromAscii( pImplName ) ) ) + { + xFactory = Reference< XSingleServiceFactory >( createSingleFactory( + reinterpret_cast< XMultiServiceFactory * >( pServiceManager ), + OUString::createFromAscii( pImplName ), + XMLDocumentWrapper_XmlSecImpl_createInstance, XMLDocumentWrapper_XmlSecImpl_getSupportedServiceNames() ) ); + } + else if( SerialNumberAdapterImpl_getImplementationName().equals( OUString::createFromAscii( pImplName ) ) ) + { + xFactory = ::cppu::createSingleComponentFactory( + SerialNumberAdapterImpl_createInstance, + OUString::createFromAscii( pImplName ), + SerialNumberAdapterImpl_getSupportedServiceNames() ); + } + } + + if( xFactory.is() ) { + xFactory->acquire() ; + pRet = xFactory.get() ; + } else { +#if defined( XMLSEC_CRYPTO_NSS ) + pRet = nss_component_getFactory( pImplName, pServiceManager, pRegistryKey ) ; + if( pRet != NULL ) + return pRet ; +#endif + +#if defined( XMLSEC_CRYPTO_MSCRYPTO ) + pRet = mscrypt_component_getFactory( pImplName, pServiceManager, pRegistryKey ) ; + if( pRet != NULL ) + return pRet ; +#endif + } + + return pRet ; +} + +} + diff --git a/xmlsecurity/test_docs/CAs/README.txt b/xmlsecurity/test_docs/CAs/README.txt new file mode 100755 index 000000000000..b454f1fafdd8 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/README.txt @@ -0,0 +1,383 @@ +This folder contains the directory structures needed by openssl to create +and manager certificates. + + + +################################################################################ + +Root 1 +====== +Valid root CA certificate. +Provides CRL = NO +Provides CRL via HTTP = NO +Provides OCSP = NO + +Sub CA 1 Root 1 +=============== +Valid intermediate CA certificate. +Provides CRL = NO +Provides CRL via HTTP = NO +Provides OCSP = NO +CRLDP = NO +AIA = NO + +User 1 Sub CA 1 Root 1 +====================== +Valid end certificate. +CRLDP = NO +AIA = NO + +################################################################################ + +Root 2 +====== +Valid root CA certificate. +Provides CRL = NO +Provides CRL via HTTP = NO +Provides OCSP = NO + +Sub CA 1 Root 2 +=============== +Valid intermediate CA certificate. +Provides CRL = YES +Provides CRL via HTTP = NO +Provides OCSP = NO +CRLDP = NO +AIA = NO + +User 1 Sub CA 1 Root 2 +====================== +Valid end certificate. +CRLDP = NO +AIA = NO + +################################################################################ + +Root 3 +====== +Valid root CA certificate. +Provides CRL = YES +Provides CRL via HTTP = NO +Provides OCSP = NO + +Sub CA 1 Root 3 +=============== +Valid intermediate CA certificate. +Provides CRL = NO +Provides CRL via HTTP = NO +Provides OCSP = NO +CRLDP = NO +AIA = NO + +User 1 Sub CA 1 Root 3 +====================== +Valid end certificate. +CRLDP = NO +AIA = NO + +################################################################################ + +Root 4 +====== +Valid root CA certificate. +Provides CRL = YES +Provides CRL via HTTP = NO +Provides OCSP = NO + +Revoked certificates: + +- Sub CA 2 Root 4 + + +Sub CA 1 Root 4 +=============== +Valid intermediate CA certificate. +Provides CRL = YES +Provides CRL via HTTP = NO +Provides OCSP = NO +CRLDP = NO +AIA = NO + +Revoked certificates: + +- User 2 Sub CA 1 Root 4 + + +User 1 Sub CA 1 Root 4 +====================== +Valid end certificate. +CRLDP = NO +AIA = NO + +User 2 Sub CA 1 Root 4 +====================== +Revoked end certificate. +CRLDP = NO +AIA = NO + +Sub CA 2 Root 4 +=============== +Revoked intermediate CA certificate. Reason = keyCompromise +Provides CRL = YES +Provides CRL via HTTP = NO +Provides OCSP = NO +CRLDP = NO +AIA = NO + +Revoked certificates: + +- User 2 Sub CA 2 Root 4 + +User 1 Sub CA 2 Root 4 +====================== +Valid end certificate. Issuer is revoked. +CRLDP = NO +AIA = NO + +User 2 Sub CA 2 Root 4 +====================== +Revoked end certificate. Reason = keyCompromise. Issuer is revoked. +CRLDP = NO +AIA = NO + +################################################################################ + +Root 5 +====== +Valid root CA certificate. +Provides CRL = NO +Provides CRL via HTTP = NO +Provides OCSP = NO + +Sub CA 1 Root 5 +=============== +Valid intermediate CA certificate. +Provides CRL = NO +Provides CRL via HTTP = YES +Provides OCSP = NO +CRLDP = URL=http://localhost:8901/demoCA/crl/Root_5.crl +AIA = NO + +User 1 Sub CA 1 Root 5 +====================== +Valid end certificate. +CRLDP = URL=http://localhost:8902/demoCA/crl/Sub_CA_1_Root_5.crl +AIA = NO + + +################################################################################ + +Root 6 +====== +Valid root CA certificate. +Provides CRL = NO +Provides CRL via HTTP = YES +Provides OCSP = NO + +Sub CA 1 Root 6 +=============== +Valid intermediate CA certificate. +Provides CRL = NO +Provides CRL via HTTP = NO +Provides OCSP = NO +CRLDP = URL=http://localhost:8901/demoCA/crl/Root_6.crl +AIA = NO + +User 1 Sub CA 1 Root 6 +====================== +Valid end certificate. +CRLDP = URL=http://localhost:8902/demoCA/crl/Sub_CA_1_Root_6.crl +AIA = NO + +################################################################################ + +Root 7 +====== +Valid root CA certificate. +Provides CRL = NO +Provides CRL via HTTP = YES +Provides OCSP = NO + +Revoked certificates: + +- Sub CA 2 Root 7 + + +Sub CA 1 Root 7 +=============== +Valid intermediate CA certificate. +Provides CRL = NO +Provides CRL via HTTP = YES +Provides OCSP = NO +CRLDP = URL=http://localhost:8901/demoCA/crl/Root_7.crl +AIA = NO + +Revoked certificates: + +- User 2 Sub CA 1 Root 7 + + +User 1 Sub CA 1 Root 7 +====================== +Valid end certificate. +CRLDP = URL=http://localhost:8902/demoCA/crl/Sub_CA_1_Root_7.crl +AIA = NO + +User 2 Sub CA 1 Root 7 +====================== +Revoked end certificate. Reason = CACompromise. +CRLDP = URL=http://localhost:8902/demoCA/crl/Sub_CA_1_Root_7.crl +AIA = NO + +Sub CA 2 Root 7 +=============== +Revoked intermediate CA certificate. Reason = keyCompromise +Provides CRL = NO +Provides CRL via HTTP = YES +Provides OCSP = NO +CRLDP = URL=http://localhost:8901/demoCA/crl/Root_7.crl +AIA = NO + +Revoked certificates: + +- User 2 Sub CA 2 Root 7 + +User 1 Sub CA 2 Root 7 +====================== +Valid end certificate. Issuer is revoked. +CRLDP = URL=http://localhost:8902/demoCA/crl/Sub_CA_2_Root_7.crl +AIA = NO + +User 2 Sub CA 2 Root 7 +====================== +Revoked end certificate. Reason = CACompromise. Issuer is revoked. +CRLDP = URL=http://localhost:8902/demoCA/crl/Sub_CA_2_Root_7.crl +AIA = NO + +################################################################################ + +Root 8 +====== +Valid root CA certificate. +Provides CRL = NO +Provides CRL via HTTP = NO +Provides OCSP = YES + +Revoked certificates: + +- Sub CA 2 Root 8 + + +Sub CA 1 Root 8 +=============== +Valid intermediate CA certificate. +Provides CRL = NO +Provides CRL via HTTP = NO +Provides OCSP = YES +CRLDP = +AIA = OCSP;URI:http://localhost:8888 + +Revoked certificates: + +- User 2 Sub CA 1 Root 8 + + +User 1 Sub CA 1 Root 8 +====================== +Valid end certificate. +CRLDP = NO +AIA = OCSP;URI:http://localhost:8889 + +User 2 Sub CA 1 Root 8 +====================== +Revoked end certificate. Reason = superseded. +CRLDP = NO +AIA = OCSP;URI:http://localhost:8889 + +Sub CA 2 Root 8 +=============== +Revoked intermediate CA certificate. Reason = superseded. +Provides CRL = NO +Provides CRL via HTTP = NO +Provides OCSP = YES +CRLDP = NO +AIA = OCSP;URI:http://localhost:8888 + +Revoked certificates: + +- User 2 Sub CA 2 Root 8 + +User 1 Sub CA 2 Root 8 +====================== +Valid end certificate. Issuer is revoked. +CRLDP = NO +AIA = OCSP;URI:http://localhost:8889 + +User 2 Sub CA 2 Root 8 +====================== +Revoked end certificate. Reason = superseded. Issuer is revoked. +CRLDP = NO +AIA = OCSP;URI:http://localhost:8889 + +################################################################################ + +Root 9 +====== +Valid root CA certificate. (Not installed.) +Provides CRL = YES +Provides CRL via HTTP = NO +Provides OCSP = NO + +Sub CA 1 Root 9 +=============== +Valid intermediate CA certificate. +Provides CRL = YES +Provides CRL via HTTP = NO +Provides OCSP = NO +CRLDP = NO +AIA = NO + +User 1 Sub CA 1 Root 9 +====================== +Valid end certificate. +CRLDP = NO +AIA = NO + +################################################################################ + +Root 10 +====== +Valid root CA certificate. +Provides CRL = YES +Provides CRL via HTTP = NO +Provides OCSP = NO + +Sub CA 1 Root 10 +=============== +Valid intermediate CA certificate. (Not installed.) +Provides CRL = NO +Provides CRL via HTTP = YES +Provides OCSP = NO +CRLDP = NO +AIA = NO + +User 1 Sub CA 1 Root 10 +====================== +Valid end certificate. +CRLDP = URI:http://localhost:8902/demoCA/crl/Sub_CA_1_Root_10.crl +AIA = caIssuers;URI:http://localhost:8910/demoCA/Sub_CA_1_Root_10.crt + +################################################################################ + +Root 11 +====== +Valid root CA certificate. +Provides CRL = YES +Provides CRL via HTTP = NO +Provides OCSP = NO + +User x Root 11 +====================== +All certificate issues by Root 11 are valid end certificate. Currently there are +31 certificates. + diff --git a/xmlsecurity/test_docs/CAs/Root_1/demoCA/cacert.pem b/xmlsecurity/test_docs/CAs/Root_1/demoCA/cacert.pem new file mode 100755 index 000000000000..091052e3ab93 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_1/demoCA/cacert.pem @@ -0,0 +1,19 @@ +-----BEGIN CERTIFICATE----- +MIIDBDCCAm2gAwIBAgIJAJWwBSvtwjktMA0GCSqGSIb3DQEBBQUAMF8xCzAJBgNV +BAYTAkRFMRAwDgYDVQQIEwdIYW1idXJnMRcwFQYDVQQKEw5PcGVuT2ZmaWNlLm9y +ZzEUMBIGA1UECxMLRGV2ZWxvcG1lbnQxDzANBgNVBAMTBlJvb3QgMTAeFw0wOTEx +MTgxNDU1NDFaFw0zNDExMTIxNDU1NDFaMF8xCzAJBgNVBAYTAkRFMRAwDgYDVQQI +EwdIYW1idXJnMRcwFQYDVQQKEw5PcGVuT2ZmaWNlLm9yZzEUMBIGA1UECxMLRGV2 +ZWxvcG1lbnQxDzANBgNVBAMTBlJvb3QgMTCBnzANBgkqhkiG9w0BAQEFAAOBjQAw +gYkCgYEAvrD6NFWcOQQVxIuXw5Pzpy667PZbBP80ow2Bbnj+RFCI/LbgfQTsC8Bw +eSlQGX7IqMHkCTuWNJw7CoNeOLFhRMtm0DEKnEkZlM0t6kpFshbs12jZu9okcnII +F5uIoKxx/thbD5AbC1Q74vZr6XOXY5Sc+k9Ic6Jwhe9ZyEt6SUsCAwEAAaOBxzCB +xDAdBgNVHQ4EFgQUD/rG69/OuLuzqT5Cprrs0pPKR6QwgZEGA1UdIwSBiTCBhoAU +D/rG69/OuLuzqT5Cprrs0pPKR6ShY6RhMF8xCzAJBgNVBAYTAkRFMRAwDgYDVQQI +EwdIYW1idXJnMRcwFQYDVQQKEw5PcGVuT2ZmaWNlLm9yZzEUMBIGA1UECxMLRGV2 +ZWxvcG1lbnQxDzANBgNVBAMTBlJvb3QgMYIJAJWwBSvtwjktMA8GA1UdEwEB/wQF +MAMBAf8wDQYJKoZIhvcNAQEFBQADgYEAqORur4HQGdQOQCaiyZR5u0+9mM/0w79y +r8Cmt+H8WB5BBeDgCyOcmaZjF0eEoRBF/ZhtlO54i4CH/yb/Pl6gGlxfGZL9iLu0 +tv4HRIIibnoi0N7Z0r/dhJcrTHo4Ha8EARhAqxoNUSlGVBsaKUfjW9RyCjv4Akyi +WUSwsmtd/sY= +-----END CERTIFICATE----- diff --git a/xmlsecurity/test_docs/CAs/Root_1/demoCA/crl/DO_NOT_CREATE_A_CRL b/xmlsecurity/test_docs/CAs/Root_1/demoCA/crl/DO_NOT_CREATE_A_CRL new file mode 100755 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_1/demoCA/crl/DO_NOT_CREATE_A_CRL diff --git a/xmlsecurity/test_docs/CAs/Root_1/demoCA/crlnumber b/xmlsecurity/test_docs/CAs/Root_1/demoCA/crlnumber new file mode 100755 index 000000000000..83b33d238dab --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_1/demoCA/crlnumber @@ -0,0 +1 @@ +1000 diff --git a/xmlsecurity/test_docs/CAs/Root_1/demoCA/index.txt b/xmlsecurity/test_docs/CAs/Root_1/demoCA/index.txt new file mode 100755 index 000000000000..9a6e64301b43 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_1/demoCA/index.txt @@ -0,0 +1 @@ +V 341112150713Z 1000 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=Sub CA 1 Root 1 diff --git a/xmlsecurity/test_docs/CAs/Root_1/demoCA/index.txt.attr b/xmlsecurity/test_docs/CAs/Root_1/demoCA/index.txt.attr new file mode 100755 index 000000000000..8f7e63a3475c --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_1/demoCA/index.txt.attr @@ -0,0 +1 @@ +unique_subject = yes diff --git a/xmlsecurity/test_docs/CAs/Root_1/demoCA/newcerts/1000.pem b/xmlsecurity/test_docs/CAs/Root_1/demoCA/newcerts/1000.pem new file mode 100755 index 000000000000..be26aa5d8f4b --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_1/demoCA/newcerts/1000.pem @@ -0,0 +1,62 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 4096 (0x1000) + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 1 + Validity + Not Before: Nov 18 15:07:13 2009 GMT + Not After : Nov 12 15:07:13 2034 GMT + Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Sub CA 1 Root 1 + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public Key: (1024 bit) + Modulus (1024 bit): + 00:d9:3a:8d:64:95:87:76:76:e8:61:c3:e9:65:f4: + a6:b7:0c:77:0e:4b:10:e8:14:a3:e1:84:69:7c:8e: + 97:d2:7d:01:ad:b2:dc:5c:cd:c6:91:a1:f3:93:7c: + 54:36:64:e3:ca:22:ca:00:cb:c6:91:ab:6b:26:88: + 69:60:9a:61:d7:59:17:db:93:7d:09:36:da:28:cb: + ec:2d:a4:26:bb:1a:42:20:b8:08:b2:0f:b9:77:a6: + 80:71:cf:13:f5:37:a2:90:4d:ab:e8:97:49:d2:80: + 94:8f:b1:9d:5a:b4:9f:de:ff:fa:b6:d6:e0:45:5f: + cc:d4:10:1e:32:46:7b:ba:55 + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Subject Key Identifier: + 37:71:74:81:44:DD:1E:B1:60:96:41:B7:4B:38:C4:B7:79:1B:CF:8A + X509v3 Authority Key Identifier: + keyid:0F:FA:C6:EB:DF:CE:B8:BB:B3:A9:3E:42:A6:BA:EC:D2:93:CA:47:A4 + DirName:/C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=Root 1 + serial:95:B0:05:2B:ED:C2:39:2D + + X509v3 Basic Constraints: critical + CA:TRUE + Signature Algorithm: sha1WithRSAEncryption + 18:f6:02:5e:75:04:5f:eb:3b:07:41:85:c0:9e:08:29:58:3d: + b5:6f:c2:aa:24:0d:93:1d:17:fc:be:d6:43:ac:43:d7:4d:a0: + 2c:40:fd:3d:d5:7e:91:46:25:49:62:ba:e9:7f:67:c2:fc:8a: + c3:a0:37:bf:ec:f9:54:bf:61:10:35:dd:5b:bb:da:7c:70:54: + 32:13:b9:ae:7d:ea:a5:7d:aa:55:3e:ef:0a:ef:12:fd:c3:f6: + e5:25:98:97:34:02:64:fd:88:79:b3:e2:f4:fc:ff:e7:d3:98: + f1:d9:d5:18:d9:b4:62:ae:99:88:61:2e:ff:02:6a:13:35:fe: + 37:c7 +-----BEGIN CERTIFICATE----- +MIIDBjCCAm+gAwIBAgICEAAwDQYJKoZIhvcNAQEFBQAwXzELMAkGA1UEBhMCREUx +EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD +VQQLEwtEZXZlbG9wbWVudDEPMA0GA1UEAxMGUm9vdCAxMB4XDTA5MTExODE1MDcx +M1oXDTM0MTExMjE1MDcxM1owaDELMAkGA1UEBhMCREUxEDAOBgNVBAgTB0hhbWJ1 +cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtEZXZlbG9wbWVu +dDEYMBYGA1UEAxMPU3ViIENBIDEgUm9vdCAxMIGfMA0GCSqGSIb3DQEBAQUAA4GN +ADCBiQKBgQDZOo1klYd2duhhw+ll9Ka3DHcOSxDoFKPhhGl8jpfSfQGtstxczcaR +ofOTfFQ2ZOPKIsoAy8aRq2smiGlgmmHXWRfbk30JNtooy+wtpCa7GkIguAiyD7l3 +poBxzxP1N6KQTavol0nSgJSPsZ1atJ/e//q21uBFX8zUEB4yRnu6VQIDAQABo4HH +MIHEMB0GA1UdDgQWBBQ3cXSBRN0esWCWQbdLOMS3eRvPijCBkQYDVR0jBIGJMIGG +gBQP+sbr3864u7OpPkKmuuzSk8pHpKFjpGEwXzELMAkGA1UEBhMCREUxEDAOBgNV +BAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtE +ZXZlbG9wbWVudDEPMA0GA1UEAxMGUm9vdCAxggkAlbAFK+3COS0wDwYDVR0TAQH/ +BAUwAwEB/zANBgkqhkiG9w0BAQUFAAOBgQAY9gJedQRf6zsHQYXAnggpWD21b8Kq +JA2THRf8vtZDrEPXTaAsQP091X6RRiVJYrrpf2fC/IrDoDe/7PlUv2EQNd1bu9p8 +cFQyE7mufeqlfapVPu8K7xL9w/blJZiXNAJk/Yh5s+L0/P/n05jx2dUY2bRirpmI +YS7/AmoTNf43xw== +-----END CERTIFICATE----- diff --git a/xmlsecurity/test_docs/CAs/Root_1/demoCA/private/cakey.pem b/xmlsecurity/test_docs/CAs/Root_1/demoCA/private/cakey.pem new file mode 100755 index 000000000000..6d38b24e6fe9 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_1/demoCA/private/cakey.pem @@ -0,0 +1,18 @@ +-----BEGIN RSA PRIVATE KEY----- +Proc-Type: 4,ENCRYPTED +DEK-Info: DES-EDE3-CBC,2D2CC3782F59A842 + +901JcMMdeCfHjfY05bkyLIsgMxwu4SFJPXZH75ebFtJQpkQQf5WNhSlo3sgKJ5MF +GZeqQw4w9CmN+CNqQENZOOGrVKxT+sFtWIgSLVk4hrLzPtsT7domHc1yUKfpBH/w +xo/bsL5wZPqcsxSdlmd4FA0PKzW/rhyYvRxF0oKQx2PVnJKT29WbhwlYurI3+2gG +pS+N6f7awWjmgyqYvFuFo7DWhERDDL/Bi/sJ7qFinijtfp1CkVG1XWFZ8Tu9ij+t +KPT3fpWbh4sV0V1ZGng7EPb4c+p/+GHvKsGM9N5kuyxufllNzAeIy6hfTR3mxn0i +Ep4CoufMi0JwNEfgwBB+o47k1hVoBTn0ofXc2iP6iQWsoC5ZoPPGLLklWK3Tur7P +kpng8UECTxV2s6J3nYkAoHfy+TzK+nssFPpE8zDmaprpeTj9oh3KrPTn0IdoPHcx +oI3yqWqDK9uErJBBCAjLF0SPJWAsmp0HsJaGnj5ErVe0yy3jBxVWogVDSWkoWU0W ++umK1pSQrS1A/oKErsnbhPi8XAD/gd4etEaKdcY538QKgE2tdPvhLoAeXxslyOfG +UiPohtmcm2Mva7vT0Iu1MGKplw76DxmmM1Rpf3+u7Kwf/+K6bMOSBGZQJhjE2AuZ +aPyHX8gCNlZfqB6eeuWdbqIHhTN5dS2Bba3QquvS84Vgb3O2ck+vdjmdPEeetvA7 +7S4WZYHBRmz1ZHwdfSvwyBkdTRP5YrUhrIthbqy2NjcP9TkpQmJaDIlWXsGY738q +zTsjCkcnS06x0/JvHe1I8IAib+MFsmGI7Dw25fzgY3ReS4wZRZdU0A== +-----END RSA PRIVATE KEY----- diff --git a/xmlsecurity/test_docs/CAs/Root_1/demoCA/serial b/xmlsecurity/test_docs/CAs/Root_1/demoCA/serial new file mode 100755 index 000000000000..dd11724042e2 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_1/demoCA/serial @@ -0,0 +1 @@ +1001 diff --git a/xmlsecurity/test_docs/CAs/Root_1/openssl.cfg b/xmlsecurity/test_docs/CAs/Root_1/openssl.cfg new file mode 100755 index 000000000000..bf73e3549d66 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_1/openssl.cfg @@ -0,0 +1,292 @@ +# +# OpenSSL example configuration file. +# This is mostly being used for generation of certificate requests. +# + +# This definition stops the following lines choking if HOME isn't +# defined. +HOME = . +RANDFILE = $ENV::HOME/.rnd + +# Extra OBJECT IDENTIFIER info: +#oid_file = $ENV::HOME/.oid +oid_section = new_oids + +# To use this configuration file with the "-extfile" option of the +# "openssl x509" utility, name here the section containing the +# X.509v3 extensions to use: +# extensions = +# (Alternatively, use a configuration file that has only +# X.509v3 extensions in its main [= default] section.) + +[ new_oids ] + +# We can add new OIDs in here for use by 'ca' and 'req'. +# Add a simple OID like this: +# testoid1=1.2.3.4 +# Or use config file substitution like this: +# testoid2=${testoid1}.5.6 + +#################################################################### +[ ca ] +default_ca = CA_default # The default ca section + +#################################################################### +[ CA_default ] + +dir = ./demoCA # Where everything is kept +certs = $dir/certs # Where the issued certs are kept +crl_dir = $dir/crl # Where the issued crl are kept +database = $dir/index.txt # database index file. +#unique_subject = no # Set to 'no' to allow creation of + # several ctificates with same subject. +new_certs_dir = $dir/newcerts # default place for new certs. + +certificate = $dir/cacert.pem # The CA certificate +serial = $dir/serial # The current serial number +crlnumber = $dir/crlnumber # the current crl number + # must be commented out to leave a V1 CRL +crl = $dir/crl.pem # The current CRL +private_key = $dir/private/cakey.pem # The private key +RANDFILE = $dir/private/.rand # private random number file + +x509_extensions = usr_cert # The extentions to add to the cert + +# Comment out the following two lines for the "traditional" +# (and highly broken) format. +name_opt = ca_default # Subject Name options +cert_opt = ca_default # Certificate field options + +# Extension copying option: use with caution. +# copy_extensions = copy + +# Extensions to add to a CRL. Note: Netscape communicator chokes on V2 CRLs +# so this is commented out by default to leave a V1 CRL. +# crlnumber must also be commented out to leave a V1 CRL. +# crl_extensions = crl_ext + +default_days = 365 # how long to certify for +default_crl_days= 30 # how long before next CRL +default_md = sha1 # which md to use. +preserve = no # keep passed DN ordering + +# A few difference way of specifying how similar the request should look +# For type CA, the listed attributes must be the same, and the optional +# and supplied fields are just that :-) +policy = policy_match + +# For the CA policy +[ policy_match ] +countryName = match +stateOrProvinceName = match +organizationName = match +organizationalUnitName = optional +commonName = supplied +emailAddress = optional + +# For the 'anything' policy +# At this point in time, you must list all acceptable 'object' +# types. +[ policy_anything ] +countryName = optional +stateOrProvinceName = optional +localityName = optional +organizationName = optional +organizationalUnitName = optional +commonName = supplied +emailAddress = optional + +#################################################################### +[ req ] +default_bits = 1024 +default_keyfile = privkey.pem +distinguished_name = req_distinguished_name +attributes = req_attributes +x509_extensions = v3_ca # The extentions to add to the self signed cert + +# Passwords for private keys if not present they will be prompted for +# input_password = secret +# output_password = secret + +# This sets a mask for permitted string types. There are several options. +# default: PrintableString, T61String, BMPString. +# pkix : PrintableString, BMPString. +# utf8only: only UTF8Strings. +# nombstr : PrintableString, T61String (no BMPStrings or UTF8Strings). +# MASK:XXXX a literal mask value. +# WARNING: current versions of Netscape crash on BMPStrings or UTF8Strings +# so use this option with caution! +string_mask = nombstr + +# req_extensions = v3_req # The extensions to add to a certificate request + +[ req_distinguished_name ] +countryName = Country Name (2 letter code) +countryName_default = DE +countryName_min = 2 +countryName_max = 2 + +stateOrProvinceName = State or Province Name (full name) +stateOrProvinceName_default = Hamburg + +localityName = Locality Name (eg, city) + +0.organizationName = Organization Name (eg, company) +0.organizationName_default = OpenOffice.org + +# we can do this but it is not needed normally :-) +#1.organizationName = Second Organization Name (eg, company) +#1.organizationName_default = World Wide Web Pty Ltd + +organizationalUnitName = Organizational Unit Name (eg, section) +organizationalUnitName_default = Development + +commonName = Common Name (eg, YOUR name) +commonName_max = 64 + +emailAddress = Email Address +emailAddress_max = 64 + +# SET-ex3 = SET extension number 3 + +[ req_attributes ] +challengePassword = A challenge password +challengePassword_min = 4 +challengePassword_max = 20 + +unstructuredName = An optional company name + +[ usr_cert ] + +# These extensions are added when 'ca' signs a request. +#authorityInfoAccess = OCSP;URI:http://localhost:8888/ + +# This is typical in keyUsage for a client certificate. +# keyUsage = nonRepudiation, digitalSignature, keyEncipherment + +# This will be displayed in Netscape's comment listbox. +nsComment = "OpenSSL Generated Certificate" + +# PKIX recommendations harmless if included in all certificates. +subjectKeyIdentifier=hash +authorityKeyIdentifier=keyid,issuer + +# This stuff is for subjectAltName and issuerAltname. +# Import the email address. +# subjectAltName=email:copy +# An alternative to produce certificates that aren't +# deprecated according to PKIX. +# subjectAltName=email:move + +# Copy subject details +# issuerAltName=issuer:copy + + + +[ v3_req ] + +# Extensions to add to a certificate request + +basicConstraints = CA:FALSE +keyUsage = nonRepudiation, digitalSignature, keyEncipherment +#authorityInfoAccess = OCSP;URI:http://localhost:8888/ + +[ v3_ca ] + + +# Extensions for a typical CA + + +# PKIX recommendation. + +subjectKeyIdentifier=hash + +authorityKeyIdentifier=keyid:always,issuer:always + +#authorityInfoAccess = OCSP;URI:http://localhost:8888 +#crlDistributionPoints=URI:http://localhost:8901/demoCA/crl/Test_CA_2009.2.crl +# This is what PKIX recommends but some broken software chokes on critical +# extensions. +#basicConstraints = critical,CA:true +# So we do this instead. +basicConstraints = critical, CA:true + +# Key usage: this is typical for a CA certificate. However since it will +# prevent it being used as an test self-signed certificate it is best +# left out by default. +# keyUsage = cRLSign, keyCertSign + +# Some might want this also +# nsCertType = sslCA, emailCA + +# Include email address in subject alt name: another PKIX recommendation +# subjectAltName=email:copy +# Copy issuer details +# issuerAltName=issuer:copy + +# DER hex encoding of an extension: beware experts only! +# obj=DER:02:03 +# Where 'obj' is a standard or added object +# You can even override a supported extension: +# basicConstraints= critical, DER:30:03:01:01:FF + +[ crl_ext ] + +# CRL extensions. +# Only issuerAltName and authorityKeyIdentifier make any sense in a CRL. + +# issuerAltName=issuer:copy +authorityKeyIdentifier=keyid:always,issuer:always + +[ proxy_cert_ext ] +# These extensions should be added when creating a proxy certificate + +# This goes against PKIX guidelines but some CAs do it and some software +# requires this to avoid interpreting an end user certificate as a CA. + +basicConstraints=CA:FALSE + +# Here are some examples of the usage of nsCertType. If it is omitted +# the certificate can be used for anything *except* object signing. + +# This is OK for an SSL server. +# nsCertType = server + +# For an object signing certificate this would be used. +# nsCertType = objsign + +# For normal client use this is typical +# nsCertType = client, email + +# and for everything including object signing: +# nsCertType = client, email, objsign + +# This is typical in keyUsage for a client certificate. +# keyUsage = nonRepudiation, digitalSignature, keyEncipherment + +# This will be displayed in Netscape's comment listbox. +nsComment = "OpenSSL Generated Certificate" + +# PKIX recommendations harmless if included in all certificates. +subjectKeyIdentifier=hash +authorityKeyIdentifier=keyid,issuer:always + +# This stuff is for subjectAltName and issuerAltname. +# Import the email address. +# subjectAltName=email:copy +# An alternative to produce certificates that aren't +# deprecated according to PKIX. +# subjectAltName=email:move + +# Copy subject details +# issuerAltName=issuer:copy + +#nsCaRevocationUrl = http://www.domain.dom/ca-crl.pem +#nsBaseUrl +#nsRevocationUrl +#nsRenewalUrl +#nsCaPolicyUrl +#nsSslServerName + +# This really needs to be in place for it to be a proxy certificate. +proxyCertInfo=critical,language:id-ppl-anyLanguage,pathlen:3,policy:foo diff --git a/xmlsecurity/test_docs/CAs/Root_10/demoCA/cacert.pem b/xmlsecurity/test_docs/CAs/Root_10/demoCA/cacert.pem new file mode 100755 index 000000000000..72e6c66e2eb3 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_10/demoCA/cacert.pem @@ -0,0 +1,19 @@ +-----BEGIN CERTIFICATE----- +MIIDBzCCAnCgAwIBAgIJAL/ID7vZoDprMA0GCSqGSIb3DQEBBQUAMGAxCzAJBgNV +BAYTAkRFMRAwDgYDVQQIEwdIYW1idXJnMRcwFQYDVQQKEw5PcGVuT2ZmaWNlLm9y +ZzEUMBIGA1UECxMLRGV2ZWxvcG1lbnQxEDAOBgNVBAMTB1Jvb3QgMTAwHhcNMDkx +MTIzMTUwNzA0WhcNMzQxMTE3MTUwNzA0WjBgMQswCQYDVQQGEwJERTEQMA4GA1UE +CBMHSGFtYnVyZzEXMBUGA1UEChMOT3Blbk9mZmljZS5vcmcxFDASBgNVBAsTC0Rl +dmVsb3BtZW50MRAwDgYDVQQDEwdSb290IDEwMIGfMA0GCSqGSIb3DQEBAQUAA4GN +ADCBiQKBgQC5qE1pk/tI2i60IrVhlwS77j7jAyktxRuwKJqBECd2ZD2/goO8wcwD +R/wfrh+zuLWRwFb57PF1O7ig+WNhQk3GDhXhMbuB82Bwjb/n5phKDWHsAIqDRbH4 +vpl/7sWYXvE46zf41PpQPgudOtqpeL1ENFoHKZOJthkBc4Yx6HTUSQIDAQABo4HI +MIHFMB0GA1UdDgQWBBTIp6OAIHRsb+wReva+JhA3MYewejCBkgYDVR0jBIGKMIGH +gBTIp6OAIHRsb+wReva+JhA3MYeweqFkpGIwYDELMAkGA1UEBhMCREUxEDAOBgNV +BAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtE +ZXZlbG9wbWVudDEQMA4GA1UEAxMHUm9vdCAxMIIJAL/ID7vZoDprMA8GA1UdEwEB +/wQFMAMBAf8wDQYJKoZIhvcNAQEFBQADgYEAroDDzqZQL+7NeQuePohejcGfFR/0 +vtbQ3AYViQ2JS42gQpaNaMNcVCvO0nUwLHldLNVdQsn9P0ultu6KcUKkBbY4/2Xp +er6RMQWsrKVLnszgIi2gk1NiNwZ+N9RISJvElaQuIciZs+8sM6LOPybVTArMjxEo +U3VqHTViFfOvWC0= +-----END CERTIFICATE----- diff --git a/xmlsecurity/test_docs/CAs/Root_10/demoCA/crlnumber b/xmlsecurity/test_docs/CAs/Root_10/demoCA/crlnumber new file mode 100755 index 000000000000..dd11724042e2 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_10/demoCA/crlnumber @@ -0,0 +1 @@ +1001 diff --git a/xmlsecurity/test_docs/CAs/Root_10/demoCA/index.txt b/xmlsecurity/test_docs/CAs/Root_10/demoCA/index.txt new file mode 100755 index 000000000000..2db3924cea70 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_10/demoCA/index.txt @@ -0,0 +1 @@ +V 341117151448Z 1000 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=Sub CA 1 Root 10 diff --git a/xmlsecurity/test_docs/CAs/Root_10/demoCA/index.txt.attr b/xmlsecurity/test_docs/CAs/Root_10/demoCA/index.txt.attr new file mode 100755 index 000000000000..8f7e63a3475c --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_10/demoCA/index.txt.attr @@ -0,0 +1 @@ +unique_subject = yes diff --git a/xmlsecurity/test_docs/CAs/Root_10/demoCA/newcerts/1000.pem b/xmlsecurity/test_docs/CAs/Root_10/demoCA/newcerts/1000.pem new file mode 100755 index 000000000000..1f27b97b3d17 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_10/demoCA/newcerts/1000.pem @@ -0,0 +1,62 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 4096 (0x1000) + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 10 + Validity + Not Before: Nov 23 15:14:48 2009 GMT + Not After : Nov 17 15:14:48 2034 GMT + Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Sub CA 1 Root 10 + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public Key: (1024 bit) + Modulus (1024 bit): + 00:e4:d5:66:14:88:9f:79:41:50:b0:d1:a0:1b:98: + bf:b0:21:34:30:36:70:58:6f:8b:58:f1:b9:58:3a: + ce:29:6b:65:b6:11:f7:0d:c8:a6:c3:be:db:0f:2a: + 4e:c7:42:df:c9:0e:13:c0:00:0f:af:b5:71:c4:bc: + dd:82:fc:4a:27:c0:ee:af:ba:e1:7b:67:de:6b:bb: + ac:4c:fe:88:01:1a:73:4e:f5:32:15:3a:d0:cb:6b: + 97:84:1b:6c:d0:d6:91:a8:a4:5a:87:2a:69:61:36: + 1d:42:cc:16:d0:03:9c:c6:90:5c:61:20:8b:b1:be: + b6:54:24:5b:6f:1f:a9:5a:6f + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Subject Key Identifier: + 11:63:A1:BE:8B:E3:56:07:E6:A3:9F:23:39:72:7D:E3:22:B6:53:39 + X509v3 Authority Key Identifier: + keyid:C8:A7:A3:80:20:74:6C:6F:EC:11:7A:F6:BE:26:10:37:31:87:B0:7A + DirName:/C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=Root 10 + serial:BF:C8:0F:BB:D9:A0:3A:6B + + X509v3 Basic Constraints: critical + CA:TRUE + Signature Algorithm: sha1WithRSAEncryption + 6b:0f:75:6d:56:b0:4e:45:19:65:ad:50:ef:4e:87:6c:95:5d: + 05:39:5a:43:5c:b4:51:25:9a:ec:f4:93:d1:f0:f6:91:dd:a3: + 77:95:0c:74:3c:a9:7c:c2:f6:62:ce:bf:58:5f:66:1f:d0:55: + ca:d8:2d:c4:1e:29:3a:ad:55:2c:9d:2c:8f:8e:9e:ce:ac:17: + 7e:1b:d1:16:d9:12:76:5c:2d:3f:9d:70:66:aa:39:34:f0:ec: + 31:4b:4b:5a:14:0c:c5:5b:3c:c8:47:02:90:cb:77:d7:4f:88: + 10:a7:80:3d:ca:19:5c:b5:04:c9:f0:e1:1b:5a:5f:fb:61:b2: + 14:b5 +-----BEGIN CERTIFICATE----- +MIIDCTCCAnKgAwIBAgICEAAwDQYJKoZIhvcNAQEFBQAwYDELMAkGA1UEBhMCREUx +EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD +VQQLEwtEZXZlbG9wbWVudDEQMA4GA1UEAxMHUm9vdCAxMDAeFw0wOTExMjMxNTE0 +NDhaFw0zNDExMTcxNTE0NDhaMGkxCzAJBgNVBAYTAkRFMRAwDgYDVQQIEwdIYW1i +dXJnMRcwFQYDVQQKEw5PcGVuT2ZmaWNlLm9yZzEUMBIGA1UECxMLRGV2ZWxvcG1l +bnQxGTAXBgNVBAMTEFN1YiBDQSAxIFJvb3QgMTAwgZ8wDQYJKoZIhvcNAQEBBQAD +gY0AMIGJAoGBAOTVZhSIn3lBULDRoBuYv7AhNDA2cFhvi1jxuVg6zilrZbYR9w3I +psO+2w8qTsdC38kOE8AAD6+1ccS83YL8SifA7q+64Xtn3mu7rEz+iAEac071MhU6 +0Mtrl4QbbNDWkaikWocqaWE2HULMFtADnMaQXGEgi7G+tlQkW28fqVpvAgMBAAGj +gcgwgcUwHQYDVR0OBBYEFBFjob6L41YH5qOfIzlyfeMitlM5MIGSBgNVHSMEgYow +gYeAFMino4AgdGxv7BF69r4mEDcxh7B6oWSkYjBgMQswCQYDVQQGEwJERTEQMA4G +A1UECBMHSGFtYnVyZzEXMBUGA1UEChMOT3Blbk9mZmljZS5vcmcxFDASBgNVBAsT +C0RldmVsb3BtZW50MRAwDgYDVQQDEwdSb290IDEwggkAv8gPu9mgOmswDwYDVR0T +AQH/BAUwAwEB/zANBgkqhkiG9w0BAQUFAAOBgQBrD3VtVrBORRllrVDvTodslV0F +OVpDXLRRJZrs9JPR8PaR3aN3lQx0PKl8wvZizr9YX2Yf0FXK2C3EHik6rVUsnSyP +jp7OrBd+G9EW2RJ2XC0/nXBmqjk08OwxS0taFAzFWzzIRwKQy3fXT4gQp4A9yhlc +tQTJ8OEbWl/7YbIUtQ== +-----END CERTIFICATE----- diff --git a/xmlsecurity/test_docs/CAs/Root_10/demoCA/private/cakey.pem b/xmlsecurity/test_docs/CAs/Root_10/demoCA/private/cakey.pem new file mode 100755 index 000000000000..f75ccc08ef67 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_10/demoCA/private/cakey.pem @@ -0,0 +1,18 @@ +-----BEGIN RSA PRIVATE KEY----- +Proc-Type: 4,ENCRYPTED +DEK-Info: DES-EDE3-CBC,78CCF9A24E7B5044 + +ppKSX6K7DHnU4EvbmBAIzWDJ35yGppjzNdWRKpB7rkGW60dW0Cw0Jmbxf1dfbUC+ +UTWtxE+i0x159jF7jGobPvLFQnAg1ZPUUIgeXJt+fqf/OghY4i8x82BdSlaKJ293 +GgwR9m1N1I2/6ydob+9KwzJhOPhmylyUyRJVAx/OF86E9G4nxtuJA1c1nzSBgwR5 +7uHU0LiY5A42iTDiMmu7Jw4vj6Cy81P88hmyoVzo4JQG8YFuJyLz2ei+DJ3/572z +BCefqDKmlmI2vvayZW1jgpLDlTwmqiIGUDBBipN4vDmqZAdEbv/9BjLkS4Svy3PU +xaFs1tFQzv8ivGpyPWU5naoTKhmMhOEAKpEi6YqWbcD/qKn1pRrYSyVyD9zNXHEK +QrXjTP+D/DMSHNJTo5WI4kxvwSZtPI97vaCTmxkrjnIXDPD5L4v9dJUdejnngsqn +cHB/C/05dR0RLEp5CHrl0hwGiIY1IgQXmGHY2HEUyQYttyJ5jdY0pdnn9n0eQxHr +9Mg3WneWC42XHw0pyqEsgiMmr8SjaF42MSrMB6y4WEVtBstn03LTdFnRIFTgZ5Mj +l/O2mSk+YUBR4CYTUTRaWpzCAZmFVy98I8KQgrhi8t96wrRe0+9tB1uC5PoDNR5P +CcgsmiEPeqolPZwOmnDdij+DcIiT43Sx2vDYGfDtqc+kur/O6noYyX8Kf7wzcpan +V4gHTCEOrlcRiEcVIxAQFDpB8CERG9fJvnBdZE9Gjepz6OatRpE/2kDZMelwRcEx +V5zeE1qNS51gdq2dE0qYkdyU1yfbNUouqtFy/z1sXU6Q5nR1r21jFQ== +-----END RSA PRIVATE KEY----- diff --git a/xmlsecurity/test_docs/CAs/Root_10/demoCA/serial b/xmlsecurity/test_docs/CAs/Root_10/demoCA/serial new file mode 100755 index 000000000000..dd11724042e2 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_10/demoCA/serial @@ -0,0 +1 @@ +1001 diff --git a/xmlsecurity/test_docs/CAs/Root_10/openssl.cfg b/xmlsecurity/test_docs/CAs/Root_10/openssl.cfg new file mode 100755 index 000000000000..cc9663bbd5c5 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_10/openssl.cfg @@ -0,0 +1,292 @@ +# +# OpenSSL example configuration file. +# This is mostly being used for generation of certificate requests. +# + +# This definition stops the following lines choking if HOME isn't +# defined. +HOME = . +RANDFILE = $ENV::HOME/.rnd + +# Extra OBJECT IDENTIFIER info: +#oid_file = $ENV::HOME/.oid +oid_section = new_oids + +# To use this configuration file with the "-extfile" option of the +# "openssl x509" utility, name here the section containing the +# X.509v3 extensions to use: +# extensions = +# (Alternatively, use a configuration file that has only +# X.509v3 extensions in its main [= default] section.) + +[ new_oids ] + +# We can add new OIDs in here for use by 'ca' and 'req'. +# Add a simple OID like this: +# testoid1=1.2.3.4 +# Or use config file substitution like this: +# testoid2=${testoid1}.5.6 + +#################################################################### +[ ca ] +default_ca = CA_default # The default ca section + +#################################################################### +[ CA_default ] + +dir = ./demoCA # Where everything is kept +certs = $dir/certs # Where the issued certs are kept +crl_dir = $dir/crl # Where the issued crl are kept +database = $dir/index.txt # database index file. +#unique_subject = no # Set to 'no' to allow creation of + # several ctificates with same subject. +new_certs_dir = $dir/newcerts # default place for new certs. + +certificate = $dir/cacert.pem # The CA certificate +serial = $dir/serial # The current serial number +crlnumber = $dir/crlnumber # the current crl number + # must be commented out to leave a V1 CRL +crl = $dir/crl.pem # The current CRL +private_key = $dir/private/cakey.pem # The private key +RANDFILE = $dir/private/.rand # private random number file + +x509_extensions = usr_cert # The extentions to add to the cert + +# Comment out the following two lines for the "traditional" +# (and highly broken) format. +name_opt = ca_default # Subject Name options +cert_opt = ca_default # Certificate field options + +# Extension copying option: use with caution. +# copy_extensions = copy + +# Extensions to add to a CRL. Note: Netscape communicator chokes on V2 CRLs +# so this is commented out by default to leave a V1 CRL. +# crlnumber must also be commented out to leave a V1 CRL. +# crl_extensions = crl_ext + +default_days = 365 # how long to certify for +default_crl_days= 30 # how long before next CRL +default_md = sha1 # which md to use. +preserve = no # keep passed DN ordering + +# A few difference way of specifying how similar the request should look +# For type CA, the listed attributes must be the same, and the optional +# and supplied fields are just that :-) +policy = policy_match + +# For the CA policy +[ policy_match ] +countryName = match +stateOrProvinceName = match +organizationName = match +organizationalUnitName = optional +commonName = supplied +emailAddress = optional + +# For the 'anything' policy +# At this point in time, you must list all acceptable 'object' +# types. +[ policy_anything ] +countryName = optional +stateOrProvinceName = optional +localityName = optional +organizationName = optional +organizationalUnitName = optional +commonName = supplied +emailAddress = optional + +#################################################################### +[ req ] +default_bits = 1024 +default_keyfile = privkey.pem +distinguished_name = req_distinguished_name +attributes = req_attributes +x509_extensions = v3_ca # The extentions to add to the self signed cert + +# Passwords for private keys if not present they will be prompted for +# input_password = secret +# output_password = secret + +# This sets a mask for permitted string types. There are several options. +# default: PrintableString, T61String, BMPString. +# pkix : PrintableString, BMPString. +# utf8only: only UTF8Strings. +# nombstr : PrintableString, T61String (no BMPStrings or UTF8Strings). +# MASK:XXXX a literal mask value. +# WARNING: current versions of Netscape crash on BMPStrings or UTF8Strings +# so use this option with caution! +string_mask = nombstr + +# req_extensions = v3_req # The extensions to add to a certificate request + +[ req_distinguished_name ] +countryName = Country Name (2 letter code) +countryName_default = DE +countryName_min = 2 +countryName_max = 2 + +stateOrProvinceName = State or Province Name (full name) +stateOrProvinceName_default = Hamburg + +localityName = Locality Name (eg, city) + +0.organizationName = Organization Name (eg, company) +0.organizationName_default = OpenOffice.org + +# we can do this but it is not needed normally :-) +#1.organizationName = Second Organization Name (eg, company) +#1.organizationName_default = World Wide Web Pty Ltd + +organizationalUnitName = Organizational Unit Name (eg, section) +organizationalUnitName_default = Development + +commonName = Common Name (eg, YOUR name) +commonName_max = 64 + +emailAddress = Email Address +emailAddress_max = 64 + +# SET-ex3 = SET extension number 3 + +[ req_attributes ] +challengePassword = A challenge password +challengePassword_min = 4 +challengePassword_max = 20 + +unstructuredName = An optional company name + +[ usr_cert ] + +# These extensions are added when 'ca' signs a request. +#authorityInfoAccess = OCSP;URI:http://localhost:8888/ + +# This is typical in keyUsage for a client certificate. +keyUsage = nonRepudiation, digitalSignature, keyEncipherment + +# This will be displayed in Netscape's comment listbox. +nsComment = "OpenSSL Generated Certificate" + +# PKIX recommendations harmless if included in all certificates. +subjectKeyIdentifier=hash +authorityKeyIdentifier=keyid,issuer + +# This stuff is for subjectAltName and issuerAltname. +# Import the email address. +# subjectAltName=email:copy +# An alternative to produce certificates that aren't +# deprecated according to PKIX. +# subjectAltName=email:move + +# Copy subject details +# issuerAltName=issuer:copy + + + +[ v3_req ] + +# Extensions to add to a certificate request + +basicConstraints = CA:FALSE +keyUsage = nonRepudiation, digitalSignature, keyEncipherment +#authorityInfoAccess = OCSP;URI:http://localhost:8888/ + +[ v3_ca ] + + +# Extensions for a typical CA + + +# PKIX recommendation. + +subjectKeyIdentifier=hash + +authorityKeyIdentifier=keyid:always,issuer:always + +#authorityInfoAccess = OCSP;URI:http://localhost:8888 +#crlDistributionPoints=URI:http://localhost:8901/demoCA/crl/Root_7.crl +# This is what PKIX recommends but some broken software chokes on critical +# extensions. +#basicConstraints = critical,CA:true +# So we do this instead. +basicConstraints = critical, CA:true + +# Key usage: this is typical for a CA certificate. However since it will +# prevent it being used as an test self-signed certificate it is best +# left out by default. +# keyUsage = cRLSign, keyCertSign + +# Some might want this also +# nsCertType = sslCA, emailCA + +# Include email address in subject alt name: another PKIX recommendation +# subjectAltName=email:copy +# Copy issuer details +# issuerAltName=issuer:copy + +# DER hex encoding of an extension: beware experts only! +# obj=DER:02:03 +# Where 'obj' is a standard or added object +# You can even override a supported extension: +# basicConstraints= critical, DER:30:03:01:01:FF + +[ crl_ext ] + +# CRL extensions. +# Only issuerAltName and authorityKeyIdentifier make any sense in a CRL. + +# issuerAltName=issuer:copy +authorityKeyIdentifier=keyid:always,issuer:always + +[ proxy_cert_ext ] +# These extensions should be added when creating a proxy certificate + +# This goes against PKIX guidelines but some CAs do it and some software +# requires this to avoid interpreting an end user certificate as a CA. + +basicConstraints=CA:FALSE + +# Here are some examples of the usage of nsCertType. If it is omitted +# the certificate can be used for anything *except* object signing. + +# This is OK for an SSL server. +# nsCertType = server + +# For an object signing certificate this would be used. +# nsCertType = objsign + +# For normal client use this is typical +# nsCertType = client, email + +# and for everything including object signing: +# nsCertType = client, email, objsign + +# This is typical in keyUsage for a client certificate. +# keyUsage = nonRepudiation, digitalSignature, keyEncipherment + +# This will be displayed in Netscape's comment listbox. +nsComment = "OpenSSL Generated Certificate" + +# PKIX recommendations harmless if included in all certificates. +subjectKeyIdentifier=hash +authorityKeyIdentifier=keyid,issuer:always + +# This stuff is for subjectAltName and issuerAltname. +# Import the email address. +# subjectAltName=email:copy +# An alternative to produce certificates that aren't +# deprecated according to PKIX. +# subjectAltName=email:move + +# Copy subject details +# issuerAltName=issuer:copy + +#nsCaRevocationUrl = http://www.domain.dom/ca-crl.pem +#nsBaseUrl +#nsRevocationUrl +#nsRenewalUrl +#nsCaPolicyUrl +#nsSslServerName + +# This really needs to be in place for it to be a proxy certificate. +proxyCertInfo=critical,language:id-ppl-anyLanguage,pathlen:3,policy:foo diff --git a/xmlsecurity/test_docs/CAs/Root_11/demoCA/cacert.pem b/xmlsecurity/test_docs/CAs/Root_11/demoCA/cacert.pem new file mode 100755 index 000000000000..8cfffd9a6c35 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_11/demoCA/cacert.pem @@ -0,0 +1,19 @@ +-----BEGIN CERTIFICATE----- +MIIDBzCCAnCgAwIBAgIJAI3gSU2IIGPLMA0GCSqGSIb3DQEBBQUAMGAxCzAJBgNV +BAYTAkRFMRAwDgYDVQQIEwdIYW1idXJnMRcwFQYDVQQKEw5PcGVuT2ZmaWNlLm9y +ZzEUMBIGA1UECxMLRGV2ZWxvcG1lbnQxEDAOBgNVBAMTB1Jvb3QgMTEwHhcNMTAw +MTE0MTEzNzA1WhcNMzUwMTA4MTEzNzA2WjBgMQswCQYDVQQGEwJERTEQMA4GA1UE +CBMHSGFtYnVyZzEXMBUGA1UEChMOT3Blbk9mZmljZS5vcmcxFDASBgNVBAsTC0Rl +dmVsb3BtZW50MRAwDgYDVQQDEwdSb290IDExMIGfMA0GCSqGSIb3DQEBAQUAA4GN +ADCBiQKBgQDKGrq6yC3tyctcBo+iz31MF2yvDiQ7YFgez8TswNvb3USOPOUPsCaB +ufVN6ULSqmGi5BzFIW7CVAj5L+iCrrwMtPyG86fKbvgdWmLepz5a4S1y+vydnQ0B +rJCNdxmLdQK+l/P7jzrH5xhcR62DPQ2lLabvmixvylHv4H6cFjJ98wIDAQABo4HI +MIHFMB0GA1UdDgQWBBToarvCkOpscCI+9vZIGwPmvremVTCBkgYDVR0jBIGKMIGH +gBToarvCkOpscCI+9vZIGwPmvremVaFkpGIwYDELMAkGA1UEBhMCREUxEDAOBgNV +BAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtE +ZXZlbG9wbWVudDEQMA4GA1UEAxMHUm9vdCAxMYIJAI3gSU2IIGPLMA8GA1UdEwEB +/wQFMAMBAf8wDQYJKoZIhvcNAQEFBQADgYEAZRXdBfSqhY+xELs28/gjsZ4/mUvu +LKL3PruRCNqUgIOznEdxsQXsmLIQhEPZ4a4jd31srFD2j5gJmZ8KdeFXII9NRvIX +RpRcrl2uclHXWbIC7s6xiATDWumrL2nXB5bU4qYMZ0ybytXprIwkzqRFXUrEHcYm +OXJCSKayIviQ6G0= +-----END CERTIFICATE----- diff --git a/xmlsecurity/test_docs/CAs/Root_11/demoCA/crlnumber b/xmlsecurity/test_docs/CAs/Root_11/demoCA/crlnumber new file mode 100755 index 000000000000..83b33d238dab --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_11/demoCA/crlnumber @@ -0,0 +1 @@ +1000 diff --git a/xmlsecurity/test_docs/CAs/Root_11/demoCA/index.txt b/xmlsecurity/test_docs/CAs/Root_11/demoCA/index.txt new file mode 100755 index 000000000000..7061a98fa15f --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_11/demoCA/index.txt @@ -0,0 +1,34 @@ +V 350108161110Z 1000 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=\xC5\xB9\xC5\xBA\xC5\xBB\xC5\xBC\xC5\xBD\xC5\xBE \xEF\xAC\xB3 j\xCE\xAC\xCE\xAD\xCE\xAE +V 350108161614Z 1001 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=\xC5\xB9\xC5\xBA\xC5\xBB\xC5\xBC\xC5\xBD\xC5\xBE \xEF\xAD\x86 j\xCE\xAC\xCE\xAD\xCE\xAE +V 350112144417Z 1002 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=\x04\x0F\x04\x10\x04\x11\x04\x12\x04\x13\x04\x14 +V 350112153942Z 1003 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=\x01y\x01z\x01{\x00 \x03\xA6\x03\xA7\x03\xA8\x03\xA9 +V 350112160038Z 1004 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=\x00"\x00e\x00n\x00c\x00l\x00o\x00s\x00i\x00n\x00g\x00 \x00q\x00u\x00o\x00t\x00e\x00s\x00" +V 350112160547Z 1005 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=\x00"\x00"\x00d\x00o\x00u\x00b\x00l\x00e\x00 \x00e\x00n\x00c\x00l\x00o\x00s\x00i\x00n\x00g\x00 \x00q\x00u\x00o\x00t\x00e\x00s\x00"\x00" +V 350112160921Z 1006 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=\x00"\x00"\x00t\x00w\x00o\x00 \x00s\x00t\x00a\x00r\x00t\x00i\x00n\x00g\x00 \x00o\x00n\x00e\x00 \x00e\x00n\x00d\x00i\x00n\x00g\x00 \x00q\x00u\x00o\x00t\x00e\x00" +V 350112161153Z 1007 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=\x00"\x00s\x00t\x00a\x00r\x00t\x00i\x00n\x00g\x00 \x00q\x00u\x00o\x00t\x00e +V 350112161405Z 1008 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=\x00e\x00n\x00d\x00i\x00n\x00g\x00 \x00q\x00u\x00o\x00t\x00e\x00" +V 350112161631Z 1009 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=\x00m\x00i\x00d\x00d\x00l\x00e\x00 \x00"\x00q\x00u\x00o\x00t\x00e +V 350112161857Z 100A unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=\x00d\x00o\x00u\x00b\x00l\x00e\x00 \x00"\x00"\x00m\x00i\x00d\x00d\x00l\x00e\x00 \x00q\x00u\x00o\x00t\x00e +V 350113090237Z 100B unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=\x00p\x00a\x00r\x00t\x00i\x00a\x00l\x00l\x00y\x00 \x00"\x00e\x00n\x00c\x00l\x00o\x00s\x00i\x00n\x00g\x00 \x00q\x00u\x00o\x00t\x00e\x00" +V 350113094852Z 100C unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=\x00"\x00U\x00s\x00e\x00r\x00 \x001\x001\x00,\x00 \x00s\x00t\x00a\x00r\x00t\x00i\x00n\x00g\x00 \x00q\x00u\x00o\x00t\x00e +V 350113095110Z 100D unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=\x00U\x00s\x00e\x00r\x00 \x001\x002\x00,\x00 \x00e\x00n\x00d\x00i\x00n\x00g\x00 \x00q\x00u\x00o\x00t\x00e\x00" +V 350113095308Z 100E unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=\x00"\x00U\x00s\x00e\x00r\x00 \x001\x003\x00,\x00 \x00e\x00n\x00c\x00l\x00o\x00s\x00i\x00n\x00g\x00 \x00q\x00u\x00o\x00t\x00e\x00s\x00" +V 350113095502Z 100F unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=\x00U\x00s\x00e\x00r\x00 \x001\x004\x00 \x00"\x00,\x00m\x00i\x00d\x00d\x00l\x00e\x00 \x00q\x00u\x00o\x00t\x00e\x00" +V 350113095752Z 1010 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=\x00\\x00e\x00n\x00c\x00l\x00o\x00s\x00i\x00n\x00g\x00 \x00q\x00u\x00o\x00t\x00e\x00s\x00\ +V 350113095922Z 1011 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=\x00\\x00\\x00d\x00o\x00u\x00b\x00l\x00e\x00 \x00e\x00n\x00c\x00l\x00o\x00s\x00i\x00n\x00g\x00 \x00q\x00u\x00o\x00t\x00e\x00s\x00\\x00\ +V 350113100207Z 1012 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=\x00\\x00\\x00t\x00w\x00o\x00 \x00s\x00t\x00a\x00r\x00t\x00i\x00n\x00g\x00 \x00o\x00n\x00e\x00 \x00e\x00n\x00d\x00i\x00n\x00g\x00 \x00q\x00u\x00o\x00t\x00e\x00\ +V 350113100436Z 1013 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=\x00\\x00s\x00t\x00a\x00r\x00t\x00i\x00n\x00g\x00 \x00q\x00u\x00o\x00t\x00e +V 350113100550Z 1014 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=\x00e\x00n\x00d\x00i\x00n\x00g\x00 \x00q\x00u\x00o\x00t\x00e\x00\ +V 350113100707Z 1015 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=\x00m\x00i\x00d\x00d\x00l\x00e\x00 \x00\\x00q\x00u\x00o\x00t\x00e +V 350113100950Z 1016 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=\x00d\x00o\x00u\x00b\x00l\x00e\x00 \x00\\x00\\x00m\x00i\x00d\x00d\x00l\x00e\x00 \x00q\x00u\x00o\x00t\x00e +V 350113101153Z 1017 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=\x00p\x00a\x00r\x00t\x00i\x00a\x00l\x00l\x00y\x00 \x00\\x00e\x00n\x00c\x00l\x00o\x00s\x00i\x00n\x00g\x00 \x00q\x00u\x00o\x00t\x00e\x00\ +V 350113101338Z 1018 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=\x00\\x00U\x00s\x00e\x00r\x00 \x002\x003\x00,\x00 \x00s\x00t\x00a\x00r\x00t\x00i\x00n\x00g\x00 \x00q\x00u\x00o\x00t\x00e +V 350113101450Z 1019 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=\x00U\x00s\x00e\x00r\x00 \x002\x004\x00,\x00 \x00e\x00n\x00d\x00i\x00n\x00g\x00 \x00q\x00u\x00o\x00t\x00e\x00\ +V 350113101610Z 101A unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=\x00\\x00U\x00s\x00e\x00r\x00 \x002\x005\x00,\x00 \x00e\x00n\x00c\x00l\x00o\x00s\x00i\x00n\x00g\x00 \x00q\x00u\x00o\x00t\x00e\x00\ +V 350113101745Z 101B unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=\x00U\x00s\x00e\x00r\x00 \x002\x006\x00\\x00,\x00 \x00m\x00i\x00d\x00d\x00l\x00e\x00 \x00q\x00u\x00o\x00t\x00e +V 350113101913Z 101C unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=comma, comma, comma , +V 350113102047Z 101D unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=equal CN=User 28 +V 350113102213Z 101E unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=User 29+OU=ooo +V 350113102601Z 101F unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=\x00U\x00s\x00e\x00r\x00 \x003\x000\x00<\x00 \x00>\x00#\x00;\x00 \x00"\x00+\x00" +V 350113102847Z 1020 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=\x00U\x00s\x00e\x00r\x00 \x003\x001\x00 \x00\\x00"\x00a\x00,\x00b\x00"\x00+\x00C\x00N\x00=\x00U\x00S\x00,\x00 \x00>\x00 \x00\\x00\\x00d\x00e\x00 \x00< +V 350113104059Z 1021 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=\x00U\x00s\x00e\x00r\x00 \x001\x004\x00 \x00"\x00,\x00m\x00i\x00d\x00d\x00l\x00e\x00 \x00q\x00u\x00o\x00t\x00e diff --git a/xmlsecurity/test_docs/CAs/Root_11/demoCA/index.txt.attr b/xmlsecurity/test_docs/CAs/Root_11/demoCA/index.txt.attr new file mode 100755 index 000000000000..8f7e63a3475c --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_11/demoCA/index.txt.attr @@ -0,0 +1 @@ +unique_subject = yes diff --git a/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1000.pem b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1000.pem new file mode 100755 index 000000000000..6efde26f7e69 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1000.pem @@ -0,0 +1,57 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 4096 (0x1000) + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 11 + Validity + Not Before: Jan 14 16:11:10 2010 GMT + Not After : Jan 8 16:11:10 2035 GMT + Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=\xC5\xB9\xC5\xBA\xC5\xBB\xC5\xBC\xC5\xBD\xC5\xBE \xEF\xAC\xB3 j\xCE\xAC\xCE\xAD\xCE\xAE + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public Key: (1024 bit) + Modulus (1024 bit): + 00:c5:8e:23:dc:00:60:ab:13:ac:00:15:c8:2f:13: + 04:4a:05:15:38:1e:ea:43:cb:68:8e:e3:08:cc:a4: + bb:ef:78:3e:4a:d3:3c:89:50:95:c4:16:6f:a4:89: + 97:4a:07:ad:17:b4:96:1e:54:87:82:ed:22:a4:15: + f7:cf:09:83:b7:4d:ee:75:70:8c:71:5a:b8:e7:4d: + 27:b4:f8:eb:19:67:8f:58:3f:4c:5f:b3:ca:aa:bd: + 5b:95:d7:b4:ba:d4:bc:0e:69:01:52:b9:8a:2d:55: + 83:9e:4d:3f:01:0c:f1:d7:bd:c9:82:54:d2:71:d6: + 51:9c:55:4c:a3:82:43:35:2f + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Key Usage: + Digital Signature, Non Repudiation, Key Encipherment + X509v3 Subject Key Identifier: + CA:DF:DA:1A:F7:9C:D8:41:19:34:69:EA:67:74:68:CA:A3:24:0F:9F + X509v3 Authority Key Identifier: + keyid:E8:6A:BB:C2:90:EA:6C:70:22:3E:F6:F6:48:1B:03:E6:BE:B7:A6:55 + + Signature Algorithm: sha1WithRSAEncryption + 28:3a:db:4b:fd:15:4c:bb:ea:74:b4:53:4f:75:2a:92:3c:78: + b6:86:aa:39:bc:b0:67:3a:5a:00:f1:1e:74:5c:c7:2b:19:4f: + f4:c0:4d:ff:01:4c:b2:0f:b5:49:14:c3:9a:96:ce:61:b6:c7: + 37:82:44:75:76:fc:bd:5d:74:f9:22:ae:f2:36:cb:20:b7:e3: + c8:c8:01:ae:d5:01:f6:5e:b4:cb:ca:76:fe:72:98:f3:0a:c3: + ac:76:fa:41:67:b4:5c:92:67:fa:ca:17:02:80:00:d8:b6:d5: + 01:03:89:25:97:96:60:86:0c:0b:d8:64:94:c9:77:43:28:06: + f9:4e +-----BEGIN CERTIFICATE----- +MIIClzCCAgCgAwIBAgICEAAwDQYJKoZIhvcNAQEFBQAwYDELMAkGA1UEBhMCREUx +EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD +VQQLEwtEZXZlbG9wbWVudDEQMA4GA1UEAxMHUm9vdCAxMTAeFw0xMDAxMTQxNjEx +MTBaFw0zNTAxMDgxNjExMTBaMHExCzAJBgNVBAYTAkRFMRAwDgYDVQQIEwdIYW1i +dXJnMRcwFQYDVQQKEw5PcGVuT2ZmaWNlLm9yZzEUMBIGA1UECxMLRGV2ZWxvcG1l +bnQxITAfBgNVBAMUGMW5xbrFu8W8xb3FviDvrLMgas6szq3OrjCBnzANBgkqhkiG +9w0BAQEFAAOBjQAwgYkCgYEAxY4j3ABgqxOsABXILxMESgUVOB7qQ8tojuMIzKS7 +73g+StM8iVCVxBZvpImXSgetF7SWHlSHgu0ipBX3zwmDt03udXCMcVq4500ntPjr +GWePWD9MX7PKqr1blde0utS8DmkBUrmKLVWDnk0/AQzx173JglTScdZRnFVMo4JD +NS8CAwEAAaNPME0wCwYDVR0PBAQDAgXgMB0GA1UdDgQWBBTK39oa95zYQRk0aepn +dGjKoyQPnzAfBgNVHSMEGDAWgBToarvCkOpscCI+9vZIGwPmvremVTANBgkqhkiG +9w0BAQUFAAOBgQAoOttL/RVMu+p0tFNPdSqSPHi2hqo5vLBnOloA8R50XMcrGU/0 +wE3/AUyyD7VJFMOals5htsc3gkR1dvy9XXT5Iq7yNssgt+PIyAGu1QH2XrTLynb+ +cpjzCsOsdvpBZ7Rckmf6yhcCgADYttUBA4kll5ZghgwL2GSUyXdDKAb5Tg== +-----END CERTIFICATE----- diff --git a/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1002.pem b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1002.pem new file mode 100755 index 000000000000..037410ad798b --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1002.pem @@ -0,0 +1,60 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 4098 (0x1002) + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 11 + Validity + Not Before: Jan 18 14:44:17 2010 GMT + Not After : Jan 12 14:44:17 2035 GMT + Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=\x04\x0F\x04\x10\x04\x11\x04\x12\x04\x13\x04\x14 + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public Key: (1024 bit) + Modulus (1024 bit): + 00:b4:d3:fd:a0:56:2b:d9:72:66:e3:fc:4b:5b:70: + fb:9c:23:10:0b:b9:8a:c4:d1:dd:1d:37:cd:20:f4: + 9d:52:c3:8f:80:14:26:c4:3e:dc:3d:af:38:86:70: + 2f:e1:54:1c:a6:5e:b6:6a:2d:73:b4:2d:88:7c:ed: + eb:63:34:bf:ef:d0:a8:e0:00:ea:f0:24:50:68:3b: + ff:03:4a:22:e0:eb:5c:a4:e8:65:e4:c7:e7:38:e9: + ce:0c:44:3e:36:08:fe:82:d8:50:b9:13:43:3b:17: + 77:09:ef:7b:cc:9f:b4:7d:5d:f7:ab:8e:ab:c0:11: + bc:7a:07:ea:98:51:c0:27:1f + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Key Usage: + Digital Signature, Non Repudiation, Key Encipherment + X509v3 Subject Key Identifier: + 49:1F:9A:43:D9:43:B9:89:0C:00:D9:90:C8:BC:9C:67:CD:8D:3E:C6 + X509v3 Authority Key Identifier: + keyid:E8:6A:BB:C2:90:EA:6C:70:22:3E:F6:F6:48:1B:03:E6:BE:B7:A6:55 + + X509v3 Subject Alternative Name: + DirName:/CN=User 2 Root 11 + Signature Algorithm: sha1WithRSAEncryption + 03:bc:24:ba:71:8b:4f:cc:3a:60:5a:04:13:15:4e:b0:79:e7: + 94:6c:9b:3b:4c:5d:d8:26:75:f5:94:04:71:5a:3e:b9:8c:5f: + b5:3d:e0:bb:8b:64:71:8f:0d:9a:99:b8:ff:ec:14:c0:c0:ca: + 63:5a:4e:1d:75:77:7a:2f:fb:12:90:25:44:ba:d8:2f:03:39: + 86:ef:88:4a:cc:69:79:0b:ff:a6:66:83:45:08:17:0b:0c:05: + f9:25:7c:6a:30:05:b3:61:df:1a:fe:2c:ca:49:e9:73:bd:b3: + 11:6b:bf:04:b0:a6:46:76:21:40:95:5c:78:b3:aa:4b:fd:03: + ee:51 +-----BEGIN CERTIFICATE----- +MIICszCCAhygAwIBAgICEAIwDQYJKoZIhvcNAQEFBQAwYDELMAkGA1UEBhMCREUx +EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD +VQQLEwtEZXZlbG9wbWVudDEQMA4GA1UEAxMHUm9vdCAxMTAeFw0xMDAxMTgxNDQ0 +MTdaFw0zNTAxMTIxNDQ0MTdaMGUxCzAJBgNVBAYTAkRFMRAwDgYDVQQIEwdIYW1i +dXJnMRcwFQYDVQQKEw5PcGVuT2ZmaWNlLm9yZzEUMBIGA1UECxMLRGV2ZWxvcG1l +bnQxFTATBgNVBAMeDAQPBBAEEQQSBBMEFDCBnzANBgkqhkiG9w0BAQEFAAOBjQAw +gYkCgYEAtNP9oFYr2XJm4/xLW3D7nCMQC7mKxNHdHTfNIPSdUsOPgBQmxD7cPa84 +hnAv4VQcpl62ai1ztC2IfO3rYzS/79Co4ADq8CRQaDv/A0oi4OtcpOhl5MfnOOnO +DEQ+Ngj+gthQuRNDOxd3Ce97zJ+0fV33q46rwBG8egfqmFHAJx8CAwEAAaN3MHUw +CwYDVR0PBAQDAgXgMB0GA1UdDgQWBBRJH5pD2UO5iQwA2ZDIvJxnzY0+xjAfBgNV +HSMEGDAWgBToarvCkOpscCI+9vZIGwPmvremVTAmBgNVHREEHzAdpBswGTEXMBUG +A1UEAxMOVXNlciAyIFJvb3QgMTEwDQYJKoZIhvcNAQEFBQADgYEAA7wkunGLT8w6 +YFoEExVOsHnnlGybO0xd2CZ19ZQEcVo+uYxftT3gu4tkcY8Nmpm4/+wUwMDKY1pO +HXV3ei/7EpAlRLrYLwM5hu+ISsxpeQv/pmaDRQgXCwwF+SV8ajAFs2HfGv4syknp +c72zEWu/BLCmRnYhQJVceLOqS/0D7lE= +-----END CERTIFICATE----- diff --git a/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1003.pem b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1003.pem new file mode 100755 index 000000000000..95589b227122 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1003.pem @@ -0,0 +1,60 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 4099 (0x1003) + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 11 + Validity + Not Before: Jan 18 15:39:42 2010 GMT + Not After : Jan 12 15:39:42 2035 GMT + Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=\x01y\x01z\x01{\x00 \x03\xA6\x03\xA7\x03\xA8\x03\xA9 + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public Key: (1024 bit) + Modulus (1024 bit): + 00:d6:d8:62:3c:69:c9:dd:93:b3:e9:65:63:89:03: + 4e:f8:8a:e1:8b:9d:92:c6:43:ca:8e:af:fd:6e:9c: + c7:66:31:48:f4:ce:5e:be:38:c5:6c:1b:48:c9:61: + f5:78:8a:e9:74:ac:a8:98:9c:83:f9:b0:74:e3:25: + 7c:5a:bb:df:5f:73:ef:fc:a0:dc:6a:ac:07:a2:b8: + 52:ea:7a:42:ba:9f:74:3c:00:cc:26:46:ba:90:5d: + 45:78:02:57:e7:47:9f:8e:94:9c:5a:31:ab:f3:ff: + bc:9f:7f:d9:b0:a6:f6:86:70:a6:9d:52:ff:c8:19: + 47:88:75:78:6a:73:d5:97:e9 + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Key Usage: + Digital Signature, Non Repudiation, Key Encipherment + X509v3 Subject Key Identifier: + E3:01:F6:1E:51:6D:FC:DB:BF:82:A9:12:21:4B:E2:46:FF:E8:EE:FF + X509v3 Authority Key Identifier: + keyid:E8:6A:BB:C2:90:EA:6C:70:22:3E:F6:F6:48:1B:03:E6:BE:B7:A6:55 + + X509v3 Subject Alternative Name: + DirName:/CN=User 1 Root 11 + Signature Algorithm: sha1WithRSAEncryption + 68:f0:88:18:d5:98:63:da:42:39:47:bf:51:22:f6:0b:8e:46: + b0:8c:83:b0:4d:07:a4:e3:a9:66:76:4d:41:23:1a:6b:dc:d8: + d1:85:b1:bf:4f:f9:e6:01:4a:36:a9:a3:26:2d:0b:33:cc:36: + 97:c6:40:b6:77:26:1c:06:f2:1b:fa:0a:ef:5c:61:8d:0d:9c: + 3c:d3:0f:db:dd:60:69:8c:24:c6:70:bc:f8:3b:38:19:90:7a: + f3:4f:7e:7c:b7:69:b6:0f:55:e1:4b:da:77:cd:b1:fe:5f:f1: + c1:8a:f8:3d:26:10:3d:40:6f:83:17:0a:d8:dd:da:a1:27:10: + a1:73 +-----BEGIN CERTIFICATE----- +MIICtzCCAiCgAwIBAgICEAMwDQYJKoZIhvcNAQEFBQAwYDELMAkGA1UEBhMCREUx +EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD +VQQLEwtEZXZlbG9wbWVudDEQMA4GA1UEAxMHUm9vdCAxMTAeFw0xMDAxMTgxNTM5 +NDJaFw0zNTAxMTIxNTM5NDJaMGkxCzAJBgNVBAYTAkRFMRAwDgYDVQQIEwdIYW1i +dXJnMRcwFQYDVQQKEw5PcGVuT2ZmaWNlLm9yZzEUMBIGA1UECxMLRGV2ZWxvcG1l +bnQxGTAXBgNVBAMeEAF5AXoBewAgA6YDpwOoA6kwgZ8wDQYJKoZIhvcNAQEBBQAD +gY0AMIGJAoGBANbYYjxpyd2Ts+llY4kDTviK4YudksZDyo6v/W6cx2YxSPTOXr44 +xWwbSMlh9XiK6XSsqJicg/mwdOMlfFq7319z7/yg3GqsB6K4Uup6QrqfdDwAzCZG +upBdRXgCV+dHn46UnFoxq/P/vJ9/2bCm9oZwpp1S/8gZR4h1eGpz1ZfpAgMBAAGj +dzB1MAsGA1UdDwQEAwIF4DAdBgNVHQ4EFgQU4wH2HlFt/Nu/gqkSIUviRv/o7v8w +HwYDVR0jBBgwFoAU6Gq7wpDqbHAiPvb2SBsD5r63plUwJgYDVR0RBB8wHaQbMBkx +FzAVBgNVBAMTDlVzZXIgMSBSb290IDExMA0GCSqGSIb3DQEBBQUAA4GBAGjwiBjV +mGPaQjlHv1Ei9guORrCMg7BNB6TjqWZ2TUEjGmvc2NGFsb9P+eYBSjapoyYtCzPM +NpfGQLZ3JhwG8hv6Cu9cYY0NnDzTD9vdYGmMJMZwvPg7OBmQevNPfny3abYPVeFL +2nfNsf5f8cGK+D0mED1Ab4MXCtjd2qEnEKFz +-----END CERTIFICATE----- diff --git a/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1004.pem b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1004.pem new file mode 100755 index 000000000000..6f57ca684532 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1004.pem @@ -0,0 +1,60 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 4100 (0x1004) + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 11 + Validity + Not Before: Jan 18 16:00:38 2010 GMT + Not After : Jan 12 16:00:38 2035 GMT + Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=\x00"\x00e\x00n\x00c\x00l\x00o\x00s\x00i\x00n\x00g\x00 \x00q\x00u\x00o\x00t\x00e\x00s\x00" + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public Key: (1024 bit) + Modulus (1024 bit): + 00:c9:ff:37:16:4d:7a:ad:59:bd:f2:c4:dc:4f:79: + 6a:f6:21:c7:ef:cd:af:f1:39:34:24:92:f4:46:d3: + 8b:43:31:55:11:3e:22:2b:85:19:38:ed:0b:35:3c: + 73:fc:b9:17:e8:73:99:21:a2:20:30:b4:e9:11:c6: + 7a:61:fa:fa:fe:eb:c8:30:c4:73:5f:77:f2:fc:42: + b7:10:29:ac:9e:8a:c2:df:25:9b:44:17:05:a3:39: + d9:1b:58:62:fb:2c:86:07:f7:f0:28:7b:5a:38:1b: + 6a:de:88:fb:ad:32:f4:53:e2:a1:c5:0f:68:db:64: + ae:39:2a:5e:02:d0:b5:38:07 + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Key Usage: + Digital Signature, Non Repudiation, Key Encipherment + X509v3 Subject Key Identifier: + 86:2F:46:D0:A9:F9:3F:22:BD:57:83:51:35:F9:67:11:A2:00:AB:33 + X509v3 Authority Key Identifier: + keyid:E8:6A:BB:C2:90:EA:6C:70:22:3E:F6:F6:48:1B:03:E6:BE:B7:A6:55 + + X509v3 Subject Alternative Name: + DirName:/CN=User 3 Root 11 + Signature Algorithm: sha1WithRSAEncryption + bb:f6:61:ae:30:94:3a:4a:d6:d5:cb:b5:50:bb:ca:0e:ab:9f: + 09:e9:78:d4:2f:20:fe:18:4e:d8:61:db:97:28:a9:d9:dc:e5: + 06:f8:6c:41:c2:5a:95:53:47:7e:a7:73:c9:45:4f:6b:30:fc: + fd:17:9a:7b:a9:d8:27:57:a9:fd:8d:e7:7e:4b:3e:98:11:42: + 00:39:1a:55:4b:3d:a5:de:75:3c:43:5a:33:10:d3:cf:4e:04: + 0a:71:d4:93:2b:0b:2b:15:82:7b:04:46:9b:50:da:18:84:66: + 31:75:36:5b:09:eb:82:5d:7d:e1:35:a3:a4:6c:b2:ac:c8:fa: + bd:5f +-----BEGIN CERTIFICATE----- +MIICyzCCAjSgAwIBAgICEAQwDQYJKoZIhvcNAQEFBQAwYDELMAkGA1UEBhMCREUx +EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD +VQQLEwtEZXZlbG9wbWVudDEQMA4GA1UEAxMHUm9vdCAxMTAeFw0xMDAxMTgxNjAw +MzhaFw0zNTAxMTIxNjAwMzhaMH0xCzAJBgNVBAYTAkRFMRAwDgYDVQQIEwdIYW1i +dXJnMRcwFQYDVQQKEw5PcGVuT2ZmaWNlLm9yZzEUMBIGA1UECxMLRGV2ZWxvcG1l +bnQxLTArBgNVBAMeJAAiAGUAbgBjAGwAbwBzAGkAbgBnACAAcQB1AG8AdABlAHMA +IjCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAyf83Fk16rVm98sTcT3lq9iHH +782v8Tk0JJL0RtOLQzFVET4iK4UZOO0LNTxz/LkX6HOZIaIgMLTpEcZ6Yfr6/uvI +MMRzX3fy/EK3ECmsnorC3yWbRBcFoznZG1hi+yyGB/fwKHtaOBtq3oj7rTL0U+Kh +xQ9o22SuOSpeAtC1OAcCAwEAAaN3MHUwCwYDVR0PBAQDAgXgMB0GA1UdDgQWBBSG +L0bQqfk/Ir1Xg1E1+WcRogCrMzAfBgNVHSMEGDAWgBToarvCkOpscCI+9vZIGwPm +vremVTAmBgNVHREEHzAdpBswGTEXMBUGA1UEAxMOVXNlciAzIFJvb3QgMTEwDQYJ +KoZIhvcNAQEFBQADgYEAu/ZhrjCUOkrW1cu1ULvKDqufCel41C8g/hhO2GHblyip +2dzlBvhsQcJalVNHfqdzyUVPazD8/Reae6nYJ1ep/Y3nfks+mBFCADkaVUs9pd51 +PENaMxDTz04ECnHUkysLKxWCewRGm1DaGIRmMXU2Wwnrgl194TWjpGyyrMj6vV8= +-----END CERTIFICATE----- diff --git a/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1005.pem b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1005.pem new file mode 100755 index 000000000000..3a2f7522d19d --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1005.pem @@ -0,0 +1,61 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 4101 (0x1005) + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 11 + Validity + Not Before: Jan 18 16:05:47 2010 GMT + Not After : Jan 12 16:05:47 2035 GMT + Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=\x00"\x00"\x00d\x00o\x00u\x00b\x00l\x00e\x00 \x00e\x00n\x00c\x00l\x00o\x00s\x00i\x00n\x00g\x00 \x00q\x00u\x00o\x00t\x00e\x00s\x00"\x00" + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public Key: (1024 bit) + Modulus (1024 bit): + 00:de:4d:31:93:c5:1b:7c:2b:85:86:da:89:3d:06: + 6f:6d:44:a5:de:6c:6a:06:28:b0:96:7b:40:34:01: + af:e4:b1:f4:93:f1:25:78:b0:43:ea:92:2a:87:60: + e8:be:7e:c9:b6:02:f8:14:93:1b:b8:5f:cb:2c:24: + e2:80:24:f0:5c:6d:77:f2:dc:ef:90:d6:d1:78:22: + 53:f0:7f:45:ad:f2:1a:9d:25:08:13:c8:62:6b:9e: + 88:79:3d:9e:b4:0a:05:11:79:7d:a1:b2:46:89:f3: + 45:ce:f3:22:2e:17:ab:e1:a9:b1:04:93:3b:f3:ca: + e6:60:c0:fd:91:7f:34:80:65 + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Key Usage: + Digital Signature, Non Repudiation, Key Encipherment + X509v3 Subject Key Identifier: + C1:6E:6A:FB:5A:B1:0C:67:07:C8:7E:F1:8D:86:F6:D0:27:56:6D:73 + X509v3 Authority Key Identifier: + keyid:E8:6A:BB:C2:90:EA:6C:70:22:3E:F6:F6:48:1B:03:E6:BE:B7:A6:55 + + X509v3 Subject Alternative Name: + DirName:/CN=User 4 Root 11 + Signature Algorithm: sha1WithRSAEncryption + 61:72:4b:33:1d:60:91:08:19:4f:ff:ec:8e:9e:83:71:d7:00: + 96:0a:b5:82:b7:8c:a6:3f:70:64:36:ac:25:a7:f1:a9:83:f1: + 63:f8:29:06:fa:58:86:8a:fd:25:9e:77:38:dd:c7:3b:cd:68: + 91:8e:f4:57:42:c9:6b:88:87:ec:24:57:38:84:fb:c0:d9:bc: + 6c:1c:6e:9d:9d:b9:da:cc:7e:fe:f9:bd:29:be:14:26:6f:63: + 1f:6f:6a:f1:dd:fd:d2:03:69:f2:36:e1:35:e0:57:72:d5:e3: + 09:ee:6a:08:45:b4:73:e9:d1:18:c2:38:1d:86:53:53:6d:bf: + f0:1e +-----BEGIN CERTIFICATE----- +MIIC3jCCAkegAwIBAgICEAUwDQYJKoZIhvcNAQEFBQAwYDELMAkGA1UEBhMCREUx +EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD +VQQLEwtEZXZlbG9wbWVudDEQMA4GA1UEAxMHUm9vdCAxMTAeFw0xMDAxMTgxNjA1 +NDdaFw0zNTAxMTIxNjA1NDdaMIGPMQswCQYDVQQGEwJERTEQMA4GA1UECBMHSGFt +YnVyZzEXMBUGA1UEChMOT3Blbk9mZmljZS5vcmcxFDASBgNVBAsTC0RldmVsb3Bt +ZW50MT8wPQYDVQQDHjYAIgAiAGQAbwB1AGIAbABlACAAZQBuAGMAbABvAHMAaQBu +AGcAIABxAHUAbwB0AGUAcwAiACIwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGB +AN5NMZPFG3wrhYbaiT0Gb21Epd5sagYosJZ7QDQBr+Sx9JPxJXiwQ+qSKodg6L5+ +ybYC+BSTG7hfyywk4oAk8Fxtd/Lc75DW0XgiU/B/Ra3yGp0lCBPIYmueiHk9nrQK +BRF5faGyRonzRc7zIi4Xq+GpsQSTO/PK5mDA/ZF/NIBlAgMBAAGjdzB1MAsGA1Ud +DwQEAwIF4DAdBgNVHQ4EFgQUwW5q+1qxDGcHyH7xjYb20CdWbXMwHwYDVR0jBBgw +FoAU6Gq7wpDqbHAiPvb2SBsD5r63plUwJgYDVR0RBB8wHaQbMBkxFzAVBgNVBAMT +DlVzZXIgNCBSb290IDExMA0GCSqGSIb3DQEBBQUAA4GBAGFySzMdYJEIGU//7I6e +g3HXAJYKtYK3jKY/cGQ2rCWn8amD8WP4KQb6WIaK/SWedzjdxzvNaJGO9FdCyWuI +h+wkVziE+8DZvGwcbp2dudrMfv75vSm+FCZvYx9vavHd/dIDafI24TXgV3LV4wnu +aghFtHPp0RjCOB2GU1Ntv/Ae +-----END CERTIFICATE----- diff --git a/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1006.pem b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1006.pem new file mode 100755 index 000000000000..cb72b8d1610a --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1006.pem @@ -0,0 +1,61 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 4102 (0x1006) + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 11 + Validity + Not Before: Jan 18 16:09:21 2010 GMT + Not After : Jan 12 16:09:21 2035 GMT + Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=\x00"\x00"\x00t\x00w\x00o\x00 \x00s\x00t\x00a\x00r\x00t\x00i\x00n\x00g\x00 \x00o\x00n\x00e\x00 \x00e\x00n\x00d\x00i\x00n\x00g\x00 \x00q\x00u\x00o\x00t\x00e\x00" + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public Key: (1024 bit) + Modulus (1024 bit): + 00:d1:a4:91:c7:28:84:f8:54:63:09:1f:bc:2e:4e: + a3:be:54:01:42:2e:f7:ef:4f:b8:46:a9:35:b1:b3: + 29:0e:8b:f7:b5:fa:b7:71:5b:33:03:ac:e6:b5:f6: + ba:f5:ba:21:72:ed:7d:ea:f0:f1:2c:55:2a:a9:c6: + d8:54:ef:12:f0:f5:37:ca:57:b2:3c:ce:7c:5a:57: + 86:68:a2:51:82:80:bd:58:a5:04:1c:e8:cf:f6:5b: + 4e:d2:6a:79:63:eb:ac:52:7c:61:8c:fe:0a:6b:b2: + f6:16:9c:94:ae:a6:f6:69:b9:d5:0b:26:0d:01:7f: + 62:d2:58:c2:02:53:25:63:0d + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Key Usage: + Digital Signature, Non Repudiation, Key Encipherment + X509v3 Subject Key Identifier: + 45:DF:D7:35:D1:13:E4:8F:E3:0D:E3:7E:A9:9A:5D:56:00:64:4E:43 + X509v3 Authority Key Identifier: + keyid:E8:6A:BB:C2:90:EA:6C:70:22:3E:F6:F6:48:1B:03:E6:BE:B7:A6:55 + + X509v3 Subject Alternative Name: + DirName:/CN=User 5 Root 11 + Signature Algorithm: sha1WithRSAEncryption + 9d:bd:dc:dc:8e:a8:e8:e4:15:cb:14:c1:6a:ab:d8:ab:e6:e5: + 4f:f5:a8:8b:2c:ab:80:e2:31:f9:89:d8:12:ba:9c:4f:b3:f5: + bb:7e:ee:8b:df:58:d3:b2:ee:f8:c5:46:c3:5d:2e:a9:35:d0: + 7a:1e:80:18:14:4d:78:6e:f1:c8:9a:51:db:86:3e:2c:04:4a: + 0a:2f:f1:7a:01:e3:1b:31:d7:1d:f1:32:c4:04:db:b9:7e:c4: + fd:b0:c1:41:3f:8a:b3:88:4f:4a:9c:a6:38:11:2a:4a:0f:8b: + d0:9a:8a:2c:33:fe:7f:42:b5:93:8d:54:df:de:2b:b1:08:5c: + d9:0d +-----BEGIN CERTIFICATE----- +MIIC6DCCAlGgAwIBAgICEAYwDQYJKoZIhvcNAQEFBQAwYDELMAkGA1UEBhMCREUx +EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD +VQQLEwtEZXZlbG9wbWVudDEQMA4GA1UEAxMHUm9vdCAxMTAeFw0xMDAxMTgxNjA5 +MjFaFw0zNTAxMTIxNjA5MjFaMIGZMQswCQYDVQQGEwJERTEQMA4GA1UECBMHSGFt +YnVyZzEXMBUGA1UEChMOT3Blbk9mZmljZS5vcmcxFDASBgNVBAsTC0RldmVsb3Bt +ZW50MUkwRwYDVQQDHkAAIgAiAHQAdwBvACAAcwB0AGEAcgB0AGkAbgBnACAAbwBu +AGUAIABlAG4AZABpAG4AZwAgAHEAdQBvAHQAZQAiMIGfMA0GCSqGSIb3DQEBAQUA +A4GNADCBiQKBgQDRpJHHKIT4VGMJH7wuTqO+VAFCLvfvT7hGqTWxsykOi/e1+rdx +WzMDrOa19rr1uiFy7X3q8PEsVSqpxthU7xLw9TfKV7I8znxaV4ZoolGCgL1YpQQc +6M/2W07Sanlj66xSfGGM/gprsvYWnJSupvZpudULJg0Bf2LSWMICUyVjDQIDAQAB +o3cwdTALBgNVHQ8EBAMCBeAwHQYDVR0OBBYEFEXf1zXRE+SP4w3jfqmaXVYAZE5D +MB8GA1UdIwQYMBaAFOhqu8KQ6mxwIj729kgbA+a+t6ZVMCYGA1UdEQQfMB2kGzAZ +MRcwFQYDVQQDEw5Vc2VyIDUgUm9vdCAxMTANBgkqhkiG9w0BAQUFAAOBgQCdvdzc +jqjo5BXLFMFqq9ir5uVP9aiLLKuA4jH5idgSupxPs/W7fu6L31jTsu74xUbDXS6p +NdB6HoAYFE14bvHImlHbhj4sBEoKL/F6AeMbMdcd8TLEBNu5fsT9sMFBP4qziE9K +nKY4ESpKD4vQmoosM/5/QrWTjVTf3iuxCFzZDQ== +-----END CERTIFICATE----- diff --git a/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1007.pem b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1007.pem new file mode 100755 index 000000000000..ce9b36d12d7a --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1007.pem @@ -0,0 +1,60 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 4103 (0x1007) + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 11 + Validity + Not Before: Jan 18 16:11:53 2010 GMT + Not After : Jan 12 16:11:53 2035 GMT + Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=\x00"\x00s\x00t\x00a\x00r\x00t\x00i\x00n\x00g\x00 \x00q\x00u\x00o\x00t\x00e + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public Key: (1024 bit) + Modulus (1024 bit): + 00:d1:99:9c:20:2e:65:ee:0f:ce:cb:8a:d8:70:c8: + 04:3c:ac:2f:14:7c:6c:8f:5e:95:36:f8:53:74:5b: + 88:bf:a1:43:73:04:ab:3a:42:b4:7c:2c:3c:3b:63: + 7e:ef:82:c5:bb:b1:28:9b:8b:b7:29:72:3d:30:08: + e9:a2:d7:4b:08:e2:2e:e6:d4:9f:75:29:31:23:be: + b4:30:5d:94:30:41:38:a1:d5:34:bc:69:f5:d8:8d: + c6:08:cc:28:4a:92:22:2b:19:89:f5:ad:7c:49:89: + b3:63:c6:e5:6c:86:d7:62:05:1b:97:db:2d:fb:c2: + 47:e5:51:a6:f0:50:6f:e3:53 + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Key Usage: + Digital Signature, Non Repudiation, Key Encipherment + X509v3 Subject Key Identifier: + 5F:DA:34:F6:6F:BA:9E:12:99:DC:02:2A:4C:3E:8C:0D:14:A1:9B:2B + X509v3 Authority Key Identifier: + keyid:E8:6A:BB:C2:90:EA:6C:70:22:3E:F6:F6:48:1B:03:E6:BE:B7:A6:55 + + X509v3 Subject Alternative Name: + DirName:/CN=User 6 Root 11 + Signature Algorithm: sha1WithRSAEncryption + 24:af:11:b6:1a:5c:d1:bf:70:93:85:c0:2e:10:96:4d:b7:ad: + 4e:d7:c4:7e:87:a1:3b:20:d7:bf:04:07:cc:91:13:0c:ad:66: + 08:d6:2e:b6:d0:aa:d0:45:0e:c0:92:3d:7c:a6:82:19:04:3c: + 9a:b3:5e:e8:fe:9e:5c:d6:17:75:73:e3:3c:64:0c:ae:5d:92: + 2a:eb:0e:ef:04:f5:ce:a5:7f:1f:2f:1d:05:a0:70:f4:24:80: + c3:38:35:2d:e5:ac:a7:11:4a:3e:a2:b2:d1:14:91:ba:b0:d8: + 5f:be:80:8a:34:2c:72:fb:00:47:88:47:9e:34:65:12:ad:9f: + ff:99 +-----BEGIN CERTIFICATE----- +MIICxTCCAi6gAwIBAgICEAcwDQYJKoZIhvcNAQEFBQAwYDELMAkGA1UEBhMCREUx +EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD +VQQLEwtEZXZlbG9wbWVudDEQMA4GA1UEAxMHUm9vdCAxMTAeFw0xMDAxMTgxNjEx +NTNaFw0zNTAxMTIxNjExNTNaMHcxCzAJBgNVBAYTAkRFMRAwDgYDVQQIEwdIYW1i +dXJnMRcwFQYDVQQKEw5PcGVuT2ZmaWNlLm9yZzEUMBIGA1UECxMLRGV2ZWxvcG1l +bnQxJzAlBgNVBAMeHgAiAHMAdABhAHIAdABpAG4AZwAgAHEAdQBvAHQAZTCBnzAN +BgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA0ZmcIC5l7g/Oy4rYcMgEPKwvFHxsj16V +NvhTdFuIv6FDcwSrOkK0fCw8O2N+74LFu7Eom4u3KXI9MAjpotdLCOIu5tSfdSkx +I760MF2UMEE4odU0vGn12I3GCMwoSpIiKxmJ9a18SYmzY8blbIbXYgUbl9st+8JH +5VGm8FBv41MCAwEAAaN3MHUwCwYDVR0PBAQDAgXgMB0GA1UdDgQWBBRf2jT2b7qe +EpncAipMPowNFKGbKzAfBgNVHSMEGDAWgBToarvCkOpscCI+9vZIGwPmvremVTAm +BgNVHREEHzAdpBswGTEXMBUGA1UEAxMOVXNlciA2IFJvb3QgMTEwDQYJKoZIhvcN +AQEFBQADgYEAJK8Rthpc0b9wk4XALhCWTbetTtfEfoehOyDXvwQHzJETDK1mCNYu +ttCq0EUOwJI9fKaCGQQ8mrNe6P6eXNYXdXPjPGQMrl2SKusO7wT1zqV/Hy8dBaBw +9CSAwzg1LeWspxFKPqKy0RSRurDYX76AijQscvsAR4hHnjRlEq2f/5k= +-----END CERTIFICATE----- diff --git a/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1008.pem b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1008.pem new file mode 100755 index 000000000000..8d6f2bd25c05 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1008.pem @@ -0,0 +1,60 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 4104 (0x1008) + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 11 + Validity + Not Before: Jan 18 16:14:05 2010 GMT + Not After : Jan 12 16:14:05 2035 GMT + Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=\x00e\x00n\x00d\x00i\x00n\x00g\x00 \x00q\x00u\x00o\x00t\x00e\x00" + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public Key: (1024 bit) + Modulus (1024 bit): + 00:a6:a8:3f:60:a7:9a:3b:20:c9:2c:8c:4f:cd:11: + 1f:0d:a9:2a:2c:eb:12:80:0c:55:8a:4d:06:ef:b2: + 5f:2e:47:be:0d:10:22:8a:15:57:29:4a:90:63:f9: + 1c:13:85:47:c7:c9:b9:76:09:10:a9:b1:94:5c:8d: + c9:f4:01:26:43:e4:d4:98:d6:00:1a:d4:cd:2a:d1: + cd:7e:4c:4e:ab:18:78:5a:fb:b2:ec:a3:87:a1:0e: + 84:3f:70:cf:ca:02:24:c8:d7:1b:83:a3:ac:a5:f0: + 10:c5:de:b7:a2:6c:0b:0c:9d:ab:32:a3:1a:c9:ae: + 9b:48:a8:65:cd:50:db:0b:cf + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Key Usage: + Digital Signature, Non Repudiation, Key Encipherment + X509v3 Subject Key Identifier: + 91:32:56:26:62:63:A1:32:B0:BC:D0:91:F1:D8:F2:94:CB:10:F1:91 + X509v3 Authority Key Identifier: + keyid:E8:6A:BB:C2:90:EA:6C:70:22:3E:F6:F6:48:1B:03:E6:BE:B7:A6:55 + + X509v3 Subject Alternative Name: + DirName:/CN=User 7 Root 11 + Signature Algorithm: sha1WithRSAEncryption + 4c:d5:2f:ab:fb:83:f8:11:c9:d2:df:aa:dc:e9:b8:38:2e:53: + e1:3a:5b:bb:0a:bf:72:f7:47:b5:57:de:82:8a:e6:bb:7d:62: + af:1b:9c:8e:4a:f5:cf:0b:ac:e9:06:16:ca:59:f1:7f:d7:45: + c0:88:84:ee:f4:c7:8b:e0:39:aa:c7:b7:95:b9:fe:a2:4a:3a: + 41:df:d0:02:bf:6f:54:30:9a:9a:0a:a6:04:5f:f4:17:52:d6: + c2:39:43:5e:b9:a3:86:0f:3d:ad:eb:a3:81:f4:cc:90:29:17: + dc:46:5e:6b:9c:f6:70:0f:b2:0f:dc:0f:9c:9f:09:6c:fa:31: + 6c:01 +-----BEGIN CERTIFICATE----- +MIICwTCCAiqgAwIBAgICEAgwDQYJKoZIhvcNAQEFBQAwYDELMAkGA1UEBhMCREUx +EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD +VQQLEwtEZXZlbG9wbWVudDEQMA4GA1UEAxMHUm9vdCAxMTAeFw0xMDAxMTgxNjE0 +MDVaFw0zNTAxMTIxNjE0MDVaMHMxCzAJBgNVBAYTAkRFMRAwDgYDVQQIEwdIYW1i +dXJnMRcwFQYDVQQKEw5PcGVuT2ZmaWNlLm9yZzEUMBIGA1UECxMLRGV2ZWxvcG1l +bnQxIzAhBgNVBAMeGgBlAG4AZABpAG4AZwAgAHEAdQBvAHQAZQAiMIGfMA0GCSqG +SIb3DQEBAQUAA4GNADCBiQKBgQCmqD9gp5o7IMksjE/NER8NqSos6xKADFWKTQbv +sl8uR74NECKKFVcpSpBj+RwThUfHybl2CRCpsZRcjcn0ASZD5NSY1gAa1M0q0c1+ +TE6rGHha+7Lso4ehDoQ/cM/KAiTI1xuDo6yl8BDF3reibAsMnasyoxrJrptIqGXN +UNsLzwIDAQABo3cwdTALBgNVHQ8EBAMCBeAwHQYDVR0OBBYEFJEyViZiY6EysLzQ +kfHY8pTLEPGRMB8GA1UdIwQYMBaAFOhqu8KQ6mxwIj729kgbA+a+t6ZVMCYGA1Ud +EQQfMB2kGzAZMRcwFQYDVQQDEw5Vc2VyIDcgUm9vdCAxMTANBgkqhkiG9w0BAQUF +AAOBgQBM1S+r+4P4EcnS36rc6bg4LlPhOlu7Cr9y90e1V96Ciua7fWKvG5yOSvXP +C6zpBhbKWfF/10XAiITu9MeL4Dmqx7eVuf6iSjpB39ACv29UMJqaCqYEX/QXUtbC +OUNeuaOGDz2t66OB9MyQKRfcRl5rnPZwD7IP3A+cnwls+jFsAQ== +-----END CERTIFICATE----- diff --git a/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1009.pem b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1009.pem new file mode 100755 index 000000000000..c1a94dae5d59 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1009.pem @@ -0,0 +1,60 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 4105 (0x1009) + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 11 + Validity + Not Before: Jan 18 16:16:31 2010 GMT + Not After : Jan 12 16:16:31 2035 GMT + Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=\x00m\x00i\x00d\x00d\x00l\x00e\x00 \x00"\x00q\x00u\x00o\x00t\x00e + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public Key: (1024 bit) + Modulus (1024 bit): + 00:b4:3b:c7:b0:6c:b5:f2:b3:a5:79:89:54:de:af: + 03:3c:0e:c9:57:15:8e:73:2a:48:83:18:59:ce:b4: + 12:fb:5c:92:28:69:75:18:f9:0f:24:15:95:38:b2: + 4c:81:07:90:97:3b:d7:3a:ab:a6:92:5a:9f:5a:1f: + fe:14:ac:4d:b5:5e:6a:a6:0f:98:55:08:07:09:07: + a5:fb:79:9e:a0:2d:73:99:92:ad:6e:bc:75:36:d0: + b5:f1:1c:91:3a:d4:49:8a:60:1e:a7:01:2f:bc:d9: + cd:b4:f4:70:b4:38:d1:3c:d3:ee:00:df:b3:83:45: + 63:5c:5d:28:47:bc:b1:b9:57 + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Key Usage: + Digital Signature, Non Repudiation, Key Encipherment + X509v3 Subject Key Identifier: + D6:18:38:7B:14:4B:D6:72:42:A9:53:E2:1D:BE:81:88:26:DB:0A:06 + X509v3 Authority Key Identifier: + keyid:E8:6A:BB:C2:90:EA:6C:70:22:3E:F6:F6:48:1B:03:E6:BE:B7:A6:55 + + X509v3 Subject Alternative Name: + DirName:/CN=User 8 Root 11 + Signature Algorithm: sha1WithRSAEncryption + 98:f3:ac:db:7b:a0:00:d2:58:be:74:21:ff:09:29:4c:0c:1a: + 7a:1f:dd:e2:f3:f4:9a:52:5d:da:ac:10:30:f9:b8:93:10:60: + 46:bf:48:47:bd:af:87:a1:d9:c6:46:81:b3:0d:a4:f8:ba:ca: + 17:7c:f2:f9:46:03:62:7f:32:6b:f0:7c:75:a4:05:44:cb:10: + 42:36:ce:12:c0:b9:e5:5f:e0:7b:c6:c8:39:5c:0c:50:30:a0: + f6:fe:e1:a2:e6:00:b3:fc:86:56:11:66:d8:41:81:e3:4e:15: + e5:68:9d:1c:b0:c4:4f:ab:86:75:55:fa:39:58:3f:7c:68:03: + e0:76 +-----BEGIN CERTIFICATE----- +MIICwTCCAiqgAwIBAgICEAkwDQYJKoZIhvcNAQEFBQAwYDELMAkGA1UEBhMCREUx +EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD +VQQLEwtEZXZlbG9wbWVudDEQMA4GA1UEAxMHUm9vdCAxMTAeFw0xMDAxMTgxNjE2 +MzFaFw0zNTAxMTIxNjE2MzFaMHMxCzAJBgNVBAYTAkRFMRAwDgYDVQQIEwdIYW1i +dXJnMRcwFQYDVQQKEw5PcGVuT2ZmaWNlLm9yZzEUMBIGA1UECxMLRGV2ZWxvcG1l +bnQxIzAhBgNVBAMeGgBtAGkAZABkAGwAZQAgACIAcQB1AG8AdABlMIGfMA0GCSqG +SIb3DQEBAQUAA4GNADCBiQKBgQC0O8ewbLXys6V5iVTerwM8DslXFY5zKkiDGFnO +tBL7XJIoaXUY+Q8kFZU4skyBB5CXO9c6q6aSWp9aH/4UrE21XmqmD5hVCAcJB6X7 +eZ6gLXOZkq1uvHU20LXxHJE61EmKYB6nAS+82c209HC0ONE80+4A37ODRWNcXShH +vLG5VwIDAQABo3cwdTALBgNVHQ8EBAMCBeAwHQYDVR0OBBYEFNYYOHsUS9ZyQqlT +4h2+gYgm2woGMB8GA1UdIwQYMBaAFOhqu8KQ6mxwIj729kgbA+a+t6ZVMCYGA1Ud +EQQfMB2kGzAZMRcwFQYDVQQDEw5Vc2VyIDggUm9vdCAxMTANBgkqhkiG9w0BAQUF +AAOBgQCY86zbe6AA0li+dCH/CSlMDBp6H93i8/SaUl3arBAw+biTEGBGv0hHva+H +odnGRoGzDaT4usoXfPL5RgNifzJr8Hx1pAVEyxBCNs4SwLnlX+B7xsg5XAxQMKD2 +/uGi5gCz/IZWEWbYQYHjThXlaJ0csMRPq4Z1Vfo5WD98aAPgdg== +-----END CERTIFICATE----- diff --git a/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/100A.pem b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/100A.pem new file mode 100755 index 000000000000..a3a79bf83111 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/100A.pem @@ -0,0 +1,61 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 4106 (0x100a) + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 11 + Validity + Not Before: Jan 18 16:18:57 2010 GMT + Not After : Jan 12 16:18:57 2035 GMT + Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=\x00d\x00o\x00u\x00b\x00l\x00e\x00 \x00"\x00"\x00m\x00i\x00d\x00d\x00l\x00e\x00 \x00q\x00u\x00o\x00t\x00e + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public Key: (1024 bit) + Modulus (1024 bit): + 00:e5:3f:d4:e1:d6:26:2a:c9:40:1d:34:3c:1e:e8: + f4:54:67:6b:6c:a5:b7:fe:04:bb:cb:0e:c0:2d:26: + 61:c1:81:80:9d:da:1b:fd:d3:7a:7a:57:78:c5:f6: + e6:4b:ad:2d:a2:8d:49:b3:ac:18:ca:1c:25:67:44: + 7c:8e:b5:ab:ec:f7:a8:da:b7:37:ed:77:76:b2:8f: + bb:15:b2:e3:45:5f:b2:2a:aa:27:b7:f1:bc:37:8f: + b7:b4:c5:ff:45:fd:67:04:25:47:2c:1a:a7:63:1e: + 97:f6:ac:d7:39:cf:ef:24:63:a1:87:9b:36:97:92: + fa:d9:4d:a9:fa:dd:c9:fb:75 + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Key Usage: + Digital Signature, Non Repudiation, Key Encipherment + X509v3 Subject Key Identifier: + 62:F1:43:E3:B1:7B:98:0D:69:A4:8F:CF:32:F7:6D:E6:88:D6:23:90 + X509v3 Authority Key Identifier: + keyid:E8:6A:BB:C2:90:EA:6C:70:22:3E:F6:F6:48:1B:03:E6:BE:B7:A6:55 + + X509v3 Subject Alternative Name: + DirName:/CN=User 9 Root 11 + Signature Algorithm: sha1WithRSAEncryption + ab:46:88:13:e8:02:63:4e:f2:a0:5a:48:7e:35:a4:c2:f8:55: + 33:cb:ef:45:55:30:81:a1:9e:c2:c7:43:cd:19:23:1f:df:3f: + 8b:b8:7e:69:5e:98:06:b1:47:dd:e5:05:e2:3a:19:cf:af:e3: + dd:7b:75:e5:53:b0:bc:4e:58:40:bf:3b:d2:9c:7f:9e:b1:66: + f8:3f:58:c4:5f:ab:be:1f:03:fb:89:47:a4:25:8a:1e:10:e0: + 20:33:70:07:13:92:32:e1:bf:92:6a:d5:89:03:2c:ad:e1:85: + 8c:b3:1d:ee:0c:35:70:2f:aa:e5:e0:77:97:b0:9b:a3:0d:22: + 6f:dc +-----BEGIN CERTIFICATE----- +MIIC0jCCAjugAwIBAgICEAowDQYJKoZIhvcNAQEFBQAwYDELMAkGA1UEBhMCREUx +EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD +VQQLEwtEZXZlbG9wbWVudDEQMA4GA1UEAxMHUm9vdCAxMTAeFw0xMDAxMTgxNjE4 +NTdaFw0zNTAxMTIxNjE4NTdaMIGDMQswCQYDVQQGEwJERTEQMA4GA1UECBMHSGFt +YnVyZzEXMBUGA1UEChMOT3Blbk9mZmljZS5vcmcxFDASBgNVBAsTC0RldmVsb3Bt +ZW50MTMwMQYDVQQDHioAZABvAHUAYgBsAGUAIAAiACIAbQBpAGQAZABsAGUAIABx +AHUAbwB0AGUwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAOU/1OHWJirJQB00 +PB7o9FRna2ylt/4Eu8sOwC0mYcGBgJ3aG/3TenpXeMX25kutLaKNSbOsGMocJWdE +fI61q+z3qNq3N+13drKPuxWy40VfsiqqJ7fxvDePt7TF/0X9ZwQlRywap2Mel/as +1znP7yRjoYebNpeS+tlNqfrdyft1AgMBAAGjdzB1MAsGA1UdDwQEAwIF4DAdBgNV +HQ4EFgQUYvFD47F7mA1ppI/PMvdt5ojWI5AwHwYDVR0jBBgwFoAU6Gq7wpDqbHAi +Pvb2SBsD5r63plUwJgYDVR0RBB8wHaQbMBkxFzAVBgNVBAMTDlVzZXIgOSBSb290 +IDExMA0GCSqGSIb3DQEBBQUAA4GBAKtGiBPoAmNO8qBaSH41pML4VTPL70VVMIGh +nsLHQ80ZIx/fP4u4fmlemAaxR93lBeI6Gc+v4917deVTsLxOWEC/O9Kcf56xZvg/ +WMRfq74fA/uJR6Qlih4Q4CAzcAcTkjLhv5Jq1YkDLK3hhYyzHe4MNXAvquXgd5ew +m6MNIm/c +-----END CERTIFICATE----- diff --git a/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/100B.pem b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/100B.pem new file mode 100755 index 000000000000..75684732d762 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/100B.pem @@ -0,0 +1,61 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 4107 (0x100b) + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 11 + Validity + Not Before: Jan 19 09:02:37 2010 GMT + Not After : Jan 13 09:02:37 2035 GMT + Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=\x00p\x00a\x00r\x00t\x00i\x00a\x00l\x00l\x00y\x00 \x00"\x00e\x00n\x00c\x00l\x00o\x00s\x00i\x00n\x00g\x00 \x00q\x00u\x00o\x00t\x00e\x00" + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public Key: (1024 bit) + Modulus (1024 bit): + 00:ae:9f:8e:b8:88:8e:ed:53:aa:2a:2c:ed:f1:6c: + 99:47:9f:ab:8b:4e:8e:d8:2e:c2:78:2c:54:f9:29: + 14:27:b9:6a:3c:33:3f:06:51:ba:76:15:0a:16:60: + db:f2:f0:db:af:5b:38:be:18:42:b4:31:02:ba:6f: + 19:00:57:be:d0:f3:7c:6b:34:36:e8:7c:45:77:0d: + f5:d0:7c:0e:23:64:7c:59:02:5c:54:15:71:82:be: + 98:3f:c9:2d:f0:9e:d5:f0:32:02:44:61:5b:2f:71: + 16:13:9a:b3:2b:28:ff:d5:d8:3d:00:9c:eb:ec:b7: + 04:e2:b6:15:42:45:e5:ef:3f + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Key Usage: + Digital Signature, Non Repudiation, Key Encipherment + X509v3 Subject Key Identifier: + 8C:2C:B6:8B:82:43:DC:41:EC:AC:D4:75:E8:DA:D8:3F:A9:A0:F5:31 + X509v3 Authority Key Identifier: + keyid:E8:6A:BB:C2:90:EA:6C:70:22:3E:F6:F6:48:1B:03:E6:BE:B7:A6:55 + + X509v3 Subject Alternative Name: + DirName:/CN=User 10 Root 11 + Signature Algorithm: sha1WithRSAEncryption + 48:a6:51:46:5b:44:a5:be:18:ed:8f:d4:c6:d2:3c:86:8f:e7: + e5:f4:a2:5d:51:aa:00:9b:bc:d8:b1:d3:f4:24:a0:a1:0d:80: + 2e:7e:62:26:ee:8c:4b:bd:79:0c:39:bd:6e:af:db:92:b6:03: + b1:b0:49:95:a7:59:28:54:30:33:fc:7e:2f:0f:a2:ce:90:27: + 29:b9:d8:3f:99:36:e9:81:9f:f5:fa:cb:f9:f2:05:b5:48:60: + 4d:50:4d:1e:ba:45:fd:f1:99:84:a6:79:0b:6b:76:eb:73:9d: + 5c:47:27:be:0d:23:0b:97:cc:9d:5a:80:fa:9b:ff:66:e7:37: + 60:a4 +-----BEGIN CERTIFICATE----- +MIIC3zCCAkigAwIBAgICEAswDQYJKoZIhvcNAQEFBQAwYDELMAkGA1UEBhMCREUx +EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD +VQQLEwtEZXZlbG9wbWVudDEQMA4GA1UEAxMHUm9vdCAxMTAeFw0xMDAxMTkwOTAy +MzdaFw0zNTAxMTMwOTAyMzdaMIGPMQswCQYDVQQGEwJERTEQMA4GA1UECBMHSGFt +YnVyZzEXMBUGA1UEChMOT3Blbk9mZmljZS5vcmcxFDASBgNVBAsTC0RldmVsb3Bt +ZW50MT8wPQYDVQQDHjYAcABhAHIAdABpAGEAbABsAHkAIAAiAGUAbgBjAGwAbwBz +AGkAbgBnACAAcQB1AG8AdABlACIwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGB +AK6fjriIju1Tqios7fFsmUefq4tOjtguwngsVPkpFCe5ajwzPwZRunYVChZg2/Lw +269bOL4YQrQxArpvGQBXvtDzfGs0Nuh8RXcN9dB8DiNkfFkCXFQVcYK+mD/JLfCe +1fAyAkRhWy9xFhOasyso/9XYPQCc6+y3BOK2FUJF5e8/AgMBAAGjeDB2MAsGA1Ud +DwQEAwIF4DAdBgNVHQ4EFgQUjCy2i4JD3EHsrNR16NrYP6mg9TEwHwYDVR0jBBgw +FoAU6Gq7wpDqbHAiPvb2SBsD5r63plUwJwYDVR0RBCAwHqQcMBoxGDAWBgNVBAMT +D1VzZXIgMTAgUm9vdCAxMTANBgkqhkiG9w0BAQUFAAOBgQBIplFGW0Slvhjtj9TG +0jyGj+fl9KJdUaoAm7zYsdP0JKChDYAufmIm7oxLvXkMOb1ur9uStgOxsEmVp1ko +VDAz/H4vD6LOkCcpudg/mTbpgZ/1+sv58gW1SGBNUE0eukX98ZmEpnkLa3brc51c +Rye+DSMLl8ydWoD6m/9m5zdgpA== +-----END CERTIFICATE----- diff --git a/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/100C.pem b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/100C.pem new file mode 100755 index 000000000000..115190ca6780 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/100C.pem @@ -0,0 +1,61 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 4108 (0x100c) + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 11 + Validity + Not Before: Jan 19 09:48:52 2010 GMT + Not After : Jan 13 09:48:52 2035 GMT + Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=\x00"\x00U\x00s\x00e\x00r\x00 \x001\x001\x00,\x00 \x00s\x00t\x00a\x00r\x00t\x00i\x00n\x00g\x00 \x00q\x00u\x00o\x00t\x00e + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public Key: (1024 bit) + Modulus (1024 bit): + 00:e2:8b:a9:94:06:b0:cb:e7:1b:a3:fd:7c:70:d1: + 66:e6:2d:aa:c7:ec:2e:e3:08:c3:39:3f:48:47:fd: + 09:67:2d:16:17:87:c0:e3:4d:c1:cc:6b:3f:c4:7b: + 74:d5:71:70:d6:74:8a:a2:17:fd:39:78:f8:c7:b3: + 42:54:ac:f7:07:d7:6f:55:da:03:15:11:e0:c2:d8: + 95:d2:87:c3:9c:3d:94:96:9d:01:81:5d:61:43:aa: + 4c:92:d5:68:aa:6c:73:88:52:7b:ee:9b:76:65:0d: + 2a:ae:3d:83:71:41:44:8b:23:7d:a6:f9:3c:81:56: + 6c:9b:52:96:87:c8:97:18:8d + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Key Usage: + Digital Signature, Non Repudiation, Key Encipherment + X509v3 Subject Key Identifier: + 48:89:BE:3C:AA:C9:5A:38:6B:CA:FA:C8:B2:BB:F7:E1:44:4B:7B:08 + X509v3 Authority Key Identifier: + keyid:E8:6A:BB:C2:90:EA:6C:70:22:3E:F6:F6:48:1B:03:E6:BE:B7:A6:55 + + X509v3 Subject Alternative Name: + DirName:/CN=User 11 Root 11 + Signature Algorithm: sha1WithRSAEncryption + 23:c9:5b:f5:9f:59:ff:97:0b:79:35:2d:32:db:b7:4b:b1:c9: + 2b:1e:cf:88:7b:b4:4e:f0:ed:13:a3:64:85:8f:d6:70:b5:ed: + 2a:57:92:a0:b4:14:96:48:7a:aa:a4:19:59:df:d9:a9:0f:86: + a3:e5:ec:b5:67:ef:c3:ee:23:dd:c3:3e:24:86:6c:09:03:59: + ab:93:d6:c7:0a:4c:ef:c5:4a:be:d6:ff:0f:2e:81:8e:18:d5: + 44:21:3a:0e:86:04:aa:86:8a:38:1e:d6:07:75:d0:08:be:ef: + 29:7d:d2:fc:85:8d:0c:d3:bd:ea:47:be:40:bb:fa:2f:29:fc: + c6:d8 +-----BEGIN CERTIFICATE----- +MIIC2TCCAkKgAwIBAgICEAwwDQYJKoZIhvcNAQEFBQAwYDELMAkGA1UEBhMCREUx +EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD +VQQLEwtEZXZlbG9wbWVudDEQMA4GA1UEAxMHUm9vdCAxMTAeFw0xMDAxMTkwOTQ4 +NTJaFw0zNTAxMTMwOTQ4NTJaMIGJMQswCQYDVQQGEwJERTEQMA4GA1UECBMHSGFt +YnVyZzEXMBUGA1UEChMOT3Blbk9mZmljZS5vcmcxFDASBgNVBAsTC0RldmVsb3Bt +ZW50MTkwNwYDVQQDHjAAIgBVAHMAZQByACAAMQAxACwAIABzAHQAYQByAHQAaQBu +AGcAIABxAHUAbwB0AGUwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAOKLqZQG +sMvnG6P9fHDRZuYtqsfsLuMIwzk/SEf9CWctFheHwONNwcxrP8R7dNVxcNZ0iqIX +/Tl4+MezQlSs9wfXb1XaAxUR4MLYldKHw5w9lJadAYFdYUOqTJLVaKpsc4hSe+6b +dmUNKq49g3FBRIsjfab5PIFWbJtSlofIlxiNAgMBAAGjeDB2MAsGA1UdDwQEAwIF +4DAdBgNVHQ4EFgQUSIm+PKrJWjhryvrIsrv34URLewgwHwYDVR0jBBgwFoAU6Gq7 +wpDqbHAiPvb2SBsD5r63plUwJwYDVR0RBCAwHqQcMBoxGDAWBgNVBAMTD1VzZXIg +MTEgUm9vdCAxMTANBgkqhkiG9w0BAQUFAAOBgQAjyVv1n1n/lwt5NS0y27dLsckr +Hs+Ie7RO8O0To2SFj9Zwte0qV5KgtBSWSHqqpBlZ39mpD4aj5ey1Z+/D7iPdwz4k +hmwJA1mrk9bHCkzvxUq+1v8PLoGOGNVEIToOhgSqhoo4HtYHddAIvu8pfdL8hY0M +073qR75Au/ovKfzG2A== +-----END CERTIFICATE----- diff --git a/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/100D.pem b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/100D.pem new file mode 100755 index 000000000000..95e419a174a3 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/100D.pem @@ -0,0 +1,61 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 4109 (0x100d) + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 11 + Validity + Not Before: Jan 19 09:51:10 2010 GMT + Not After : Jan 13 09:51:10 2035 GMT + Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=\x00U\x00s\x00e\x00r\x00 \x001\x002\x00,\x00 \x00e\x00n\x00d\x00i\x00n\x00g\x00 \x00q\x00u\x00o\x00t\x00e\x00" + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public Key: (1024 bit) + Modulus (1024 bit): + 00:bf:4f:93:6b:6b:86:76:30:31:3b:0e:eb:b7:a6: + b9:a3:3e:84:ea:d5:31:50:5a:df:f4:3f:67:11:5a: + a5:28:23:58:37:67:a5:5c:72:6d:f2:fc:80:81:55: + 78:86:28:e9:60:c2:0a:d0:17:3c:3a:e9:a8:01:71: + 64:b8:27:f4:42:e0:d7:69:f5:4e:ef:14:07:69:fd: + de:7b:af:c8:a4:0c:9c:56:00:8b:76:67:d1:ba:a9: + e7:40:63:77:da:44:d3:89:5c:a7:5a:ea:d5:f3:9b: + 15:43:f3:08:2d:bc:8a:bf:4a:5b:57:01:f0:c7:97: + fe:b0:93:b2:1b:79:a0:4e:ad + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Key Usage: + Digital Signature, Non Repudiation, Key Encipherment + X509v3 Subject Key Identifier: + 0A:A2:A6:09:88:23:56:82:9E:60:8B:79:23:61:CA:BF:D4:F7:ED:A9 + X509v3 Authority Key Identifier: + keyid:E8:6A:BB:C2:90:EA:6C:70:22:3E:F6:F6:48:1B:03:E6:BE:B7:A6:55 + + X509v3 Subject Alternative Name: + DirName:/CN=User 12 Root 11 + Signature Algorithm: sha1WithRSAEncryption + 64:3e:b6:a6:5e:0d:6f:b3:e7:f6:c7:1f:4a:48:96:4c:fe:13: + 3c:4a:7b:e7:46:51:56:45:66:02:e4:79:1a:7f:15:a4:e9:5b: + f7:4c:68:cf:cf:b0:7b:e2:ba:57:37:23:c6:cd:ba:75:85:e8: + eb:d5:ca:a2:6d:9a:75:84:4b:7b:47:38:58:bc:0a:4b:cc:2c: + 2a:0d:eb:7e:ac:36:6f:0b:a5:26:b7:d3:0b:0f:e7:cc:26:db: + bb:01:48:5b:38:49:f5:3e:2d:75:c0:d6:11:ad:3e:a0:b6:8a: + 8e:7f:4d:10:2c:7b:d7:03:0d:de:da:6b:e0:07:06:90:73:1f: + dd:f1 +-----BEGIN CERTIFICATE----- +MIIC1TCCAj6gAwIBAgICEA0wDQYJKoZIhvcNAQEFBQAwYDELMAkGA1UEBhMCREUx +EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD +VQQLEwtEZXZlbG9wbWVudDEQMA4GA1UEAxMHUm9vdCAxMTAeFw0xMDAxMTkwOTUx +MTBaFw0zNTAxMTMwOTUxMTBaMIGFMQswCQYDVQQGEwJERTEQMA4GA1UECBMHSGFt +YnVyZzEXMBUGA1UEChMOT3Blbk9mZmljZS5vcmcxFDASBgNVBAsTC0RldmVsb3Bt +ZW50MTUwMwYDVQQDHiwAVQBzAGUAcgAgADEAMgAsACAAZQBuAGQAaQBuAGcAIABx +AHUAbwB0AGUAIjCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAv0+Ta2uGdjAx +Ow7rt6a5oz6E6tUxUFrf9D9nEVqlKCNYN2elXHJt8vyAgVV4hijpYMIK0Bc8Oumo +AXFkuCf0QuDXafVO7xQHaf3ee6/IpAycVgCLdmfRuqnnQGN32kTTiVynWurV85sV +Q/MILbyKv0pbVwHwx5f+sJOyG3mgTq0CAwEAAaN4MHYwCwYDVR0PBAQDAgXgMB0G +A1UdDgQWBBQKoqYJiCNWgp5gi3kjYcq/1PftqTAfBgNVHSMEGDAWgBToarvCkOps +cCI+9vZIGwPmvremVTAnBgNVHREEIDAepBwwGjEYMBYGA1UEAxMPVXNlciAxMiBS +b290IDExMA0GCSqGSIb3DQEBBQUAA4GBAGQ+tqZeDW+z5/bHH0pIlkz+EzxKe+dG +UVZFZgLkeRp/FaTpW/dMaM/PsHviulc3I8bNunWF6OvVyqJtmnWES3tHOFi8CkvM +LCoN636sNm8LpSa30wsP58wm27sBSFs4SfU+LXXA1hGtPqC2io5/TRAse9cDDd7a +a+AHBpBzH93x +-----END CERTIFICATE----- diff --git a/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/100E.pem b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/100E.pem new file mode 100755 index 000000000000..f91766a0a8f1 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/100E.pem @@ -0,0 +1,61 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 4110 (0x100e) + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 11 + Validity + Not Before: Jan 19 09:53:08 2010 GMT + Not After : Jan 13 09:53:08 2035 GMT + Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=\x00"\x00U\x00s\x00e\x00r\x00 \x001\x003\x00,\x00 \x00e\x00n\x00c\x00l\x00o\x00s\x00i\x00n\x00g\x00 \x00q\x00u\x00o\x00t\x00e\x00s\x00" + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public Key: (1024 bit) + Modulus (1024 bit): + 00:e0:b2:b3:77:34:32:23:3c:45:ce:1f:5f:9a:60: + c5:59:af:2f:bf:73:8e:be:3d:88:8d:97:4f:fe:8a: + 00:b9:71:7f:07:3a:1e:6a:5b:37:8a:ff:58:8f:f1: + b3:e5:0b:9d:35:58:57:6d:da:d1:15:cd:52:7f:e2: + 15:25:16:d4:d6:1e:71:a6:f3:f7:c5:6d:01:64:fc: + 20:d4:4e:6a:f2:f9:b9:2a:36:f8:ae:e6:17:a8:f9: + 8e:7c:bb:75:e5:24:39:ad:4c:18:c8:bb:07:22:cd: + d1:a6:52:93:7f:24:5f:90:dd:0f:64:07:70:42:67: + 39:9b:1f:ea:5e:bb:cd:df:ab + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Key Usage: + Digital Signature, Non Repudiation, Key Encipherment + X509v3 Subject Key Identifier: + 75:49:D0:1F:A0:B3:A2:C6:F2:7F:CF:16:A3:4C:4B:DF:D6:4C:07:9D + X509v3 Authority Key Identifier: + keyid:E8:6A:BB:C2:90:EA:6C:70:22:3E:F6:F6:48:1B:03:E6:BE:B7:A6:55 + + X509v3 Subject Alternative Name: + DirName:/CN=User 13 Root 11 + Signature Algorithm: sha1WithRSAEncryption + 5d:60:60:06:aa:8a:2d:ee:20:2a:ee:fb:b5:99:8c:ed:d8:67: + 28:30:d8:26:a7:e0:1c:6e:5d:e1:4c:5e:c8:f9:02:e2:2e:c4: + 1e:58:e9:84:bc:d7:79:4e:d5:c5:ea:ba:74:aa:4e:30:9d:2b: + 98:c8:0b:fe:7f:eb:fb:e9:24:5f:f8:17:27:a9:ce:7c:ff:4b: + 88:15:3e:25:18:71:73:bf:b6:bf:c5:51:6b:1d:db:32:1d:ae: + 00:bf:ed:a5:65:99:16:43:8d:d2:6d:27:53:fc:65:9a:91:94: + 7b:44:c8:58:a1:f1:2b:95:86:0b:2d:2d:94:10:6f:5e:be:f8: + 7b:8e +-----BEGIN CERTIFICATE----- +MIIC3zCCAkigAwIBAgICEA4wDQYJKoZIhvcNAQEFBQAwYDELMAkGA1UEBhMCREUx +EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD +VQQLEwtEZXZlbG9wbWVudDEQMA4GA1UEAxMHUm9vdCAxMTAeFw0xMDAxMTkwOTUz +MDhaFw0zNTAxMTMwOTUzMDhaMIGPMQswCQYDVQQGEwJERTEQMA4GA1UECBMHSGFt +YnVyZzEXMBUGA1UEChMOT3Blbk9mZmljZS5vcmcxFDASBgNVBAsTC0RldmVsb3Bt +ZW50MT8wPQYDVQQDHjYAIgBVAHMAZQByACAAMQAzACwAIABlAG4AYwBsAG8AcwBp +AG4AZwAgAHEAdQBvAHQAZQBzACIwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGB +AOCys3c0MiM8Rc4fX5pgxVmvL79zjr49iI2XT/6KALlxfwc6HmpbN4r/WI/xs+UL +nTVYV23a0RXNUn/iFSUW1NYecabz98VtAWT8INROavL5uSo2+K7mF6j5jny7deUk +Oa1MGMi7ByLN0aZSk38kX5DdD2QHcEJnOZsf6l67zd+rAgMBAAGjeDB2MAsGA1Ud +DwQEAwIF4DAdBgNVHQ4EFgQUdUnQH6Czosbyf88Wo0xL39ZMB50wHwYDVR0jBBgw +FoAU6Gq7wpDqbHAiPvb2SBsD5r63plUwJwYDVR0RBCAwHqQcMBoxGDAWBgNVBAMT +D1VzZXIgMTMgUm9vdCAxMTANBgkqhkiG9w0BAQUFAAOBgQBdYGAGqoot7iAq7vu1 +mYzt2GcoMNgmp+Acbl3hTF7I+QLiLsQeWOmEvNd5TtXF6rp0qk4wnSuYyAv+f+v7 +6SRf+Bcnqc58/0uIFT4lGHFzv7a/xVFrHdsyHa4Av+2lZZkWQ43SbSdT/GWakZR7 +RMhYofErlYYLLS2UEG9evvh7jg== +-----END CERTIFICATE----- diff --git a/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/100F.pem b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/100F.pem new file mode 100755 index 000000000000..34a9b97c5f60 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/100F.pem @@ -0,0 +1,61 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 4111 (0x100f) + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 11 + Validity + Not Before: Jan 19 09:55:02 2010 GMT + Not After : Jan 13 09:55:02 2035 GMT + Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=\x00U\x00s\x00e\x00r\x00 \x001\x004\x00 \x00"\x00,\x00m\x00i\x00d\x00d\x00l\x00e\x00 \x00q\x00u\x00o\x00t\x00e\x00" + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public Key: (1024 bit) + Modulus (1024 bit): + 00:d7:b7:68:39:6e:80:18:83:2e:d7:0a:e5:f1:3f: + 27:80:68:59:a8:05:ac:7f:d9:6e:5d:7f:1c:58:86: + b7:74:b5:51:3d:64:09:4a:a0:ff:e7:10:0e:bc:8a: + f0:d1:54:18:0a:ed:68:0a:a2:33:e5:9f:f0:3d:7f: + 24:9c:46:34:ba:45:8f:05:59:51:2d:fb:32:1d:79: + 51:37:1a:4b:f8:6e:c5:49:c0:49:9e:ef:2b:ae:aa: + 03:fa:ff:55:08:69:85:0d:b4:06:53:ee:20:4e:74: + 6c:ca:b8:98:8d:64:8f:b5:99:a9:06:37:32:ca:ca: + eb:31:16:ce:97:e8:17:0d:9d + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Key Usage: + Digital Signature, Non Repudiation, Key Encipherment + X509v3 Subject Key Identifier: + A7:D8:65:FB:E9:A1:F6:A4:16:76:1C:2E:5B:F3:1B:8E:08:B1:1D:7F + X509v3 Authority Key Identifier: + keyid:E8:6A:BB:C2:90:EA:6C:70:22:3E:F6:F6:48:1B:03:E6:BE:B7:A6:55 + + X509v3 Subject Alternative Name: + DirName:/CN=User 14 Root 11 + Signature Algorithm: sha1WithRSAEncryption + 35:54:0f:d2:d3:ec:9e:a6:ea:e6:51:69:27:a3:f1:ae:ea:ef: + f9:da:ca:2a:50:f1:9e:2a:7c:74:43:d6:7f:91:ad:5a:5c:e2: + da:f3:cb:27:a2:78:99:75:0b:9e:e9:3a:bd:3e:31:14:6a:06: + b7:3f:59:d1:0a:67:03:a4:32:63:cd:b1:b6:5c:68:bb:bb:e2: + 23:a6:ff:8e:55:e5:92:a6:a8:b3:87:3d:25:21:9c:2a:6f:ab: + 09:ad:f5:e6:e6:d8:37:62:f2:30:ac:51:da:f4:9c:1d:06:f6: + f3:73:2f:6a:3b:7f:53:0d:c0:2e:ad:cc:6e:81:fe:ce:e3:53: + 0e:23 +-----BEGIN CERTIFICATE----- +MIIC1zCCAkCgAwIBAgICEA8wDQYJKoZIhvcNAQEFBQAwYDELMAkGA1UEBhMCREUx +EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD +VQQLEwtEZXZlbG9wbWVudDEQMA4GA1UEAxMHUm9vdCAxMTAeFw0xMDAxMTkwOTU1 +MDJaFw0zNTAxMTMwOTU1MDJaMIGHMQswCQYDVQQGEwJERTEQMA4GA1UECBMHSGFt +YnVyZzEXMBUGA1UEChMOT3Blbk9mZmljZS5vcmcxFDASBgNVBAsTC0RldmVsb3Bt +ZW50MTcwNQYDVQQDHi4AVQBzAGUAcgAgADEANAAgACIALABtAGkAZABkAGwAZQAg +AHEAdQBvAHQAZQAiMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDXt2g5boAY +gy7XCuXxPyeAaFmoBax/2W5dfxxYhrd0tVE9ZAlKoP/nEA68ivDRVBgK7WgKojPl +n/A9fyScRjS6RY8FWVEt+zIdeVE3Gkv4bsVJwEme7yuuqgP6/1UIaYUNtAZT7iBO +dGzKuJiNZI+1makGNzLKyusxFs6X6BcNnQIDAQABo3gwdjALBgNVHQ8EBAMCBeAw +HQYDVR0OBBYEFKfYZfvpofakFnYcLlvzG44IsR1/MB8GA1UdIwQYMBaAFOhqu8KQ +6mxwIj729kgbA+a+t6ZVMCcGA1UdEQQgMB6kHDAaMRgwFgYDVQQDEw9Vc2VyIDE0 +IFJvb3QgMTEwDQYJKoZIhvcNAQEFBQADgYEANVQP0tPsnqbq5lFpJ6Pxrurv+drK +KlDxnip8dEPWf5GtWlzi2vPLJ6J4mXULnuk6vT4xFGoGtz9Z0QpnA6QyY82xtlxo +u7viI6b/jlXlkqaos4c9JSGcKm+rCa315ubYN2LyMKxR2vScHQb283Mvajt/Uw3A +Lq3MboH+zuNTDiM= +-----END CERTIFICATE----- diff --git a/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1010.pem b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1010.pem new file mode 100755 index 000000000000..ae0a4174738d --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1010.pem @@ -0,0 +1,60 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 4112 (0x1010) + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 11 + Validity + Not Before: Jan 19 09:57:52 2010 GMT + Not After : Jan 13 09:57:52 2035 GMT + Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=\x00\\x00e\x00n\x00c\x00l\x00o\x00s\x00i\x00n\x00g\x00 \x00q\x00u\x00o\x00t\x00e\x00s\x00\ + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public Key: (1024 bit) + Modulus (1024 bit): + 00:a1:cc:00:2b:07:2b:e7:ac:80:29:cb:40:37:e3: + 1f:a3:c5:13:86:16:63:6b:cc:b8:c1:aa:54:fd:57: + 0f:de:4c:69:2f:e5:5f:f0:a9:bb:25:74:48:ee:36: + 77:6b:08:b5:95:a9:00:aa:15:31:9e:d8:f6:25:53: + 78:9d:bc:2b:8f:7a:19:32:12:8c:13:60:7d:76:1e: + 4e:b1:e4:51:c7:43:c0:e6:ee:d9:61:df:85:90:a0: + 95:3c:a2:81:83:3d:22:f6:8d:42:ee:69:fa:5c:ae: + 1c:b5:52:02:fb:ec:a6:12:2f:bb:fb:6c:a8:61:95: + 08:6c:d2:e5:1e:90:61:a6:27 + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Key Usage: + Digital Signature, Non Repudiation, Key Encipherment + X509v3 Subject Key Identifier: + 2F:C9:F6:94:E6:1E:91:13:CE:75:A1:17:FD:1D:93:7E:45:CE:4D:67 + X509v3 Authority Key Identifier: + keyid:E8:6A:BB:C2:90:EA:6C:70:22:3E:F6:F6:48:1B:03:E6:BE:B7:A6:55 + + X509v3 Subject Alternative Name: + DirName:/CN=User 15 Root 11 + Signature Algorithm: sha1WithRSAEncryption + 19:d0:dc:4c:c8:59:f0:7a:14:f2:51:54:e5:9e:5a:b3:27:0b: + d7:36:0f:74:38:07:26:65:1a:b5:94:1a:1f:b2:b7:3d:ee:b1: + 90:05:83:41:6a:98:5f:25:b4:cb:5c:49:12:24:35:d6:97:cf: + 50:2e:0a:17:41:0b:75:e9:6a:a4:fb:bb:c2:cc:c1:94:64:03: + 81:c4:25:d2:3f:3e:8f:d1:29:44:db:a9:3c:7f:0c:2c:6d:48: + 38:cb:8f:56:82:9c:d3:f3:f3:20:1f:45:19:8e:ea:91:9c:c1: + 25:cf:20:1d:bb:70:7e:b9:a0:c5:34:78:93:5f:2b:d9:fd:d5: + de:ad +-----BEGIN CERTIFICATE----- +MIICzDCCAjWgAwIBAgICEBAwDQYJKoZIhvcNAQEFBQAwYDELMAkGA1UEBhMCREUx +EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD +VQQLEwtEZXZlbG9wbWVudDEQMA4GA1UEAxMHUm9vdCAxMTAeFw0xMDAxMTkwOTU3 +NTJaFw0zNTAxMTMwOTU3NTJaMH0xCzAJBgNVBAYTAkRFMRAwDgYDVQQIEwdIYW1i +dXJnMRcwFQYDVQQKEw5PcGVuT2ZmaWNlLm9yZzEUMBIGA1UECxMLRGV2ZWxvcG1l +bnQxLTArBgNVBAMeJABcAGUAbgBjAGwAbwBzAGkAbgBnACAAcQB1AG8AdABlAHMA +XDCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAocwAKwcr56yAKctAN+Mfo8UT +hhZja8y4wapU/VcP3kxpL+Vf8Km7JXRI7jZ3awi1lakAqhUxntj2JVN4nbwrj3oZ +MhKME2B9dh5OseRRx0PA5u7ZYd+FkKCVPKKBgz0i9o1C7mn6XK4ctVIC++ymEi+7 ++2yoYZUIbNLlHpBhpicCAwEAAaN4MHYwCwYDVR0PBAQDAgXgMB0GA1UdDgQWBBQv +yfaU5h6RE851oRf9HZN+Rc5NZzAfBgNVHSMEGDAWgBToarvCkOpscCI+9vZIGwPm +vremVTAnBgNVHREEIDAepBwwGjEYMBYGA1UEAxMPVXNlciAxNSBSb290IDExMA0G +CSqGSIb3DQEBBQUAA4GBABnQ3EzIWfB6FPJRVOWeWrMnC9c2D3Q4ByZlGrWUGh+y +tz3usZAFg0FqmF8ltMtcSRIkNdaXz1AuChdBC3XpaqT7u8LMwZRkA4HEJdI/Po/R +KUTbqTx/DCxtSDjLj1aCnNPz8yAfRRmO6pGcwSXPIB27cH65oMU0eJNfK9n91d6t +-----END CERTIFICATE----- diff --git a/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1011.pem b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1011.pem new file mode 100755 index 000000000000..21222706f476 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1011.pem @@ -0,0 +1,61 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 4113 (0x1011) + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 11 + Validity + Not Before: Jan 19 09:59:22 2010 GMT + Not After : Jan 13 09:59:22 2035 GMT + Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=\x00\\x00\\x00d\x00o\x00u\x00b\x00l\x00e\x00 \x00e\x00n\x00c\x00l\x00o\x00s\x00i\x00n\x00g\x00 \x00q\x00u\x00o\x00t\x00e\x00s\x00\\x00\ + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public Key: (1024 bit) + Modulus (1024 bit): + 00:a4:e3:64:10:9f:0a:e4:35:bb:e3:e1:f0:28:86: + 8a:f2:6e:d3:f8:44:ac:58:7b:f5:dd:1c:71:17:bf: + 3e:14:29:55:f0:5c:c9:ed:36:c0:7f:e7:cc:7c:a3: + c4:9a:13:4f:7d:6c:b3:1e:ab:24:ba:1a:ff:48:96: + 67:a5:ca:e5:75:30:24:70:3a:94:d2:92:db:29:2b: + 69:1f:1d:a4:da:37:91:57:03:79:d7:0a:c7:a9:09: + 14:a8:70:60:b5:a3:62:4f:b8:bf:0a:22:0a:9c:83: + 3a:4d:1a:47:06:97:f1:4a:38:78:95:45:10:9e:44: + 90:fb:6e:13:ba:3a:1b:b7:4b + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Key Usage: + Digital Signature, Non Repudiation, Key Encipherment + X509v3 Subject Key Identifier: + A5:32:FD:E7:0D:90:82:17:34:E1:AD:2A:48:5D:78:27:2B:C9:2A:B8 + X509v3 Authority Key Identifier: + keyid:E8:6A:BB:C2:90:EA:6C:70:22:3E:F6:F6:48:1B:03:E6:BE:B7:A6:55 + + X509v3 Subject Alternative Name: + DirName:/CN=User 16 Root 11 + Signature Algorithm: sha1WithRSAEncryption + 96:ee:46:fc:41:4f:55:0d:bc:46:27:5a:3c:09:7c:17:6c:e3: + 9e:3a:85:eb:3b:e2:f7:a5:ab:b5:ae:aa:44:81:d7:b7:29:39: + b8:20:40:1e:36:da:a8:03:8b:3a:96:c3:2e:ba:cd:81:b9:af: + a0:a5:95:b0:3b:55:c1:85:9d:3d:c2:d0:7b:a4:d0:0e:16:7c: + 26:ba:85:e5:96:f0:f9:cc:28:c4:ed:83:e8:6f:30:a8:22:7a: + 7e:3b:99:d6:b2:3d:a2:90:1e:c9:9b:70:0a:af:04:d9:7c:46: + 52:e2:5a:d3:57:d6:18:a9:e9:55:ee:00:e8:10:a1:84:ed:ca: + 2b:bf +-----BEGIN CERTIFICATE----- +MIIC3zCCAkigAwIBAgICEBEwDQYJKoZIhvcNAQEFBQAwYDELMAkGA1UEBhMCREUx +EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD +VQQLEwtEZXZlbG9wbWVudDEQMA4GA1UEAxMHUm9vdCAxMTAeFw0xMDAxMTkwOTU5 +MjJaFw0zNTAxMTMwOTU5MjJaMIGPMQswCQYDVQQGEwJERTEQMA4GA1UECBMHSGFt +YnVyZzEXMBUGA1UEChMOT3Blbk9mZmljZS5vcmcxFDASBgNVBAsTC0RldmVsb3Bt +ZW50MT8wPQYDVQQDHjYAXABcAGQAbwB1AGIAbABlACAAZQBuAGMAbABvAHMAaQBu +AGcAIABxAHUAbwB0AGUAcwBcAFwwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGB +AKTjZBCfCuQ1u+Ph8CiGivJu0/hErFh79d0ccRe/PhQpVfBcye02wH/nzHyjxJoT +T31ssx6rJLoa/0iWZ6XK5XUwJHA6lNKS2ykraR8dpNo3kVcDedcKx6kJFKhwYLWj +Yk+4vwoiCpyDOk0aRwaX8Uo4eJVFEJ5EkPtuE7o6G7dLAgMBAAGjeDB2MAsGA1Ud +DwQEAwIF4DAdBgNVHQ4EFgQUpTL95w2Qghc04a0qSF14JyvJKrgwHwYDVR0jBBgw +FoAU6Gq7wpDqbHAiPvb2SBsD5r63plUwJwYDVR0RBCAwHqQcMBoxGDAWBgNVBAMT +D1VzZXIgMTYgUm9vdCAxMTANBgkqhkiG9w0BAQUFAAOBgQCW7kb8QU9VDbxGJ1o8 +CXwXbOOeOoXrO+L3pau1rqpEgde3KTm4IEAeNtqoA4s6lsMuus2Bua+gpZWwO1XB +hZ09wtB7pNAOFnwmuoXllvD5zCjE7YPobzCoInp+O5nWsj2ikB7Jm3AKrwTZfEZS +4lrTV9YYqelV7gDoEKGE7corvw== +-----END CERTIFICATE----- diff --git a/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1012.pem b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1012.pem new file mode 100755 index 000000000000..b75551711c37 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1012.pem @@ -0,0 +1,61 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 4114 (0x1012) + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 11 + Validity + Not Before: Jan 19 10:02:07 2010 GMT + Not After : Jan 13 10:02:07 2035 GMT + Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=\x00\\x00\\x00t\x00w\x00o\x00 \x00s\x00t\x00a\x00r\x00t\x00i\x00n\x00g\x00 \x00o\x00n\x00e\x00 \x00e\x00n\x00d\x00i\x00n\x00g\x00 \x00q\x00u\x00o\x00t\x00e\x00\ + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public Key: (1024 bit) + Modulus (1024 bit): + 00:e9:8c:31:90:52:8d:ef:c6:6a:10:17:7d:37:a3: + ef:00:34:19:dd:a4:1a:f6:cc:37:b0:19:c8:9d:f6: + 9f:f8:3d:15:c9:cf:73:ab:0a:42:f2:54:5b:cc:12: + fb:64:35:54:c9:50:36:18:6c:b6:b0:cf:d6:1e:30: + 0b:0d:fa:f3:25:99:d7:49:20:dd:cc:04:d7:bb:07: + 00:b9:b9:87:8c:75:e5:28:a6:74:a9:b4:96:36:b8: + 15:62:84:0c:7a:a2:f3:07:9c:5c:8f:7a:22:3d:ba: + a4:06:69:f6:ce:d2:36:a0:62:e1:ae:67:aa:23:24: + ac:1d:53:ac:bf:b6:30:74:f7 + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Key Usage: + Digital Signature, Non Repudiation, Key Encipherment + X509v3 Subject Key Identifier: + C0:28:3E:BA:44:88:99:A0:80:67:AA:3E:B6:D4:12:A7:35:DA:A6:BB + X509v3 Authority Key Identifier: + keyid:E8:6A:BB:C2:90:EA:6C:70:22:3E:F6:F6:48:1B:03:E6:BE:B7:A6:55 + + X509v3 Subject Alternative Name: + DirName:/CN=User 17 Root 11 + Signature Algorithm: sha1WithRSAEncryption + 06:5b:fb:65:55:34:ca:2c:1a:c2:2d:2a:97:1b:a1:68:f6:0c: + 13:18:03:44:f9:0d:37:a1:8c:b1:f7:bc:b7:74:a8:aa:c1:e7: + 36:e7:b9:e0:64:79:76:63:98:7b:1d:d8:80:8c:d9:26:61:a8: + e7:07:96:60:e9:8a:24:78:cb:9c:f3:35:15:c9:d9:0c:2e:68: + 68:48:9c:df:6b:56:3f:aa:47:34:36:b0:ef:0e:d2:e0:ee:a9: + a9:6a:27:93:60:27:5f:42:76:9c:e0:aa:74:6c:b9:aa:de:fe: + 86:98:5a:3d:73:c5:15:38:c8:ff:09:8e:ed:da:06:74:fb:67: + 92:51 +-----BEGIN CERTIFICATE----- +MIIC6TCCAlKgAwIBAgICEBIwDQYJKoZIhvcNAQEFBQAwYDELMAkGA1UEBhMCREUx +EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD +VQQLEwtEZXZlbG9wbWVudDEQMA4GA1UEAxMHUm9vdCAxMTAeFw0xMDAxMTkxMDAy +MDdaFw0zNTAxMTMxMDAyMDdaMIGZMQswCQYDVQQGEwJERTEQMA4GA1UECBMHSGFt +YnVyZzEXMBUGA1UEChMOT3Blbk9mZmljZS5vcmcxFDASBgNVBAsTC0RldmVsb3Bt +ZW50MUkwRwYDVQQDHkAAXABcAHQAdwBvACAAcwB0AGEAcgB0AGkAbgBnACAAbwBu +AGUAIABlAG4AZABpAG4AZwAgAHEAdQBvAHQAZQBcMIGfMA0GCSqGSIb3DQEBAQUA +A4GNADCBiQKBgQDpjDGQUo3vxmoQF303o+8ANBndpBr2zDewGcid9p/4PRXJz3Or +CkLyVFvMEvtkNVTJUDYYbLawz9YeMAsN+vMlmddJIN3MBNe7BwC5uYeMdeUopnSp +tJY2uBVihAx6ovMHnFyPeiI9uqQGafbO0jagYuGuZ6ojJKwdU6y/tjB09wIDAQAB +o3gwdjALBgNVHQ8EBAMCBeAwHQYDVR0OBBYEFMAoPrpEiJmggGeqPrbUEqc12qa7 +MB8GA1UdIwQYMBaAFOhqu8KQ6mxwIj729kgbA+a+t6ZVMCcGA1UdEQQgMB6kHDAa +MRgwFgYDVQQDEw9Vc2VyIDE3IFJvb3QgMTEwDQYJKoZIhvcNAQEFBQADgYEABlv7 +ZVU0yiwawi0qlxuhaPYMExgDRPkNN6GMsfe8t3SoqsHnNue54GR5dmOYex3YgIzZ +JmGo5weWYOmKJHjLnPM1FcnZDC5oaEic32tWP6pHNDaw7w7S4O6pqWonk2AnX0J2 +nOCqdGy5qt7+hphaPXPFFTjI/wmO7doGdPtnklE= +-----END CERTIFICATE----- diff --git a/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1013.pem b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1013.pem new file mode 100755 index 000000000000..2b48a29b0efb --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1013.pem @@ -0,0 +1,60 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 4115 (0x1013) + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 11 + Validity + Not Before: Jan 19 10:04:36 2010 GMT + Not After : Jan 13 10:04:36 2035 GMT + Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=\x00\\x00s\x00t\x00a\x00r\x00t\x00i\x00n\x00g\x00 \x00q\x00u\x00o\x00t\x00e + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public Key: (1024 bit) + Modulus (1024 bit): + 00:bb:73:a4:4e:45:8e:80:b1:65:b6:d8:3b:96:c8: + 3b:c4:2e:40:98:2a:a9:0d:2e:75:29:df:dd:28:8f: + dc:65:4e:2f:8b:24:55:f4:5b:95:5e:d8:29:c8:31: + aa:53:41:a6:1b:2a:cc:8d:67:b6:d8:5f:56:7d:bd: + 0e:17:88:9b:28:b8:fc:54:ff:0e:1f:d9:59:f7:6f: + 99:46:76:86:69:87:f7:07:51:f6:1a:76:91:37:40: + 96:de:5a:0e:c1:20:7f:b5:1b:79:c2:63:13:50:dc: + f0:35:11:2c:4a:30:e0:68:8f:dc:51:4c:2b:61:ba: + a5:e6:ad:72:8b:c4:e1:2d:73 + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Key Usage: + Digital Signature, Non Repudiation, Key Encipherment + X509v3 Subject Key Identifier: + 31:AE:51:BD:37:3E:EB:D6:98:7D:BD:DF:45:0C:92:4E:73:58:35:AA + X509v3 Authority Key Identifier: + keyid:E8:6A:BB:C2:90:EA:6C:70:22:3E:F6:F6:48:1B:03:E6:BE:B7:A6:55 + + X509v3 Subject Alternative Name: + DirName:/CN=User 18 Root 11 + Signature Algorithm: sha1WithRSAEncryption + 51:34:24:4b:78:89:95:5d:43:15:3e:62:fc:40:a0:34:a5:6e: + 83:b5:ee:f0:93:ae:8a:27:97:9c:66:54:c9:aa:f5:9b:96:88: + 43:25:76:b6:0d:06:36:6c:0e:08:5f:15:45:c6:cc:d1:62:18: + 6b:fa:cd:af:53:7c:7c:97:30:13:a7:03:ac:db:04:25:bb:22: + 7d:49:70:30:69:9f:c8:22:94:32:40:83:d3:d1:9d:1c:2a:64: + cf:a9:42:0c:ce:0c:b8:3d:63:33:bb:e1:85:45:a7:79:89:ac: + 0c:1b:b5:a4:e0:1d:4d:99:d6:68:9b:c2:67:97:9c:9d:2c:57: + 12:fe +-----BEGIN CERTIFICATE----- +MIICxjCCAi+gAwIBAgICEBMwDQYJKoZIhvcNAQEFBQAwYDELMAkGA1UEBhMCREUx +EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD +VQQLEwtEZXZlbG9wbWVudDEQMA4GA1UEAxMHUm9vdCAxMTAeFw0xMDAxMTkxMDA0 +MzZaFw0zNTAxMTMxMDA0MzZaMHcxCzAJBgNVBAYTAkRFMRAwDgYDVQQIEwdIYW1i +dXJnMRcwFQYDVQQKEw5PcGVuT2ZmaWNlLm9yZzEUMBIGA1UECxMLRGV2ZWxvcG1l +bnQxJzAlBgNVBAMeHgBcAHMAdABhAHIAdABpAG4AZwAgAHEAdQBvAHQAZTCBnzAN +BgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAu3OkTkWOgLFlttg7lsg7xC5AmCqpDS51 +Kd/dKI/cZU4viyRV9FuVXtgpyDGqU0GmGyrMjWe22F9Wfb0OF4ibKLj8VP8OH9lZ +92+ZRnaGaYf3B1H2GnaRN0CW3loOwSB/tRt5wmMTUNzwNREsSjDgaI/cUUwrYbql +5q1yi8ThLXMCAwEAAaN4MHYwCwYDVR0PBAQDAgXgMB0GA1UdDgQWBBQxrlG9Nz7r +1ph9vd9FDJJOc1g1qjAfBgNVHSMEGDAWgBToarvCkOpscCI+9vZIGwPmvremVTAn +BgNVHREEIDAepBwwGjEYMBYGA1UEAxMPVXNlciAxOCBSb290IDExMA0GCSqGSIb3 +DQEBBQUAA4GBAFE0JEt4iZVdQxU+YvxAoDSlboO17vCTroonl5xmVMmq9ZuWiEMl +drYNBjZsDghfFUXGzNFiGGv6za9TfHyXMBOnA6zbBCW7In1JcDBpn8gilDJAg9PR +nRwqZM+pQgzODLg9YzO74YVFp3mJrAwbtaTgHU2Z1mibwmeXnJ0sVxL+ +-----END CERTIFICATE----- diff --git a/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1014.pem b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1014.pem new file mode 100755 index 000000000000..a2027e9d8a43 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1014.pem @@ -0,0 +1,60 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 4116 (0x1014) + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 11 + Validity + Not Before: Jan 19 10:05:50 2010 GMT + Not After : Jan 13 10:05:50 2035 GMT + Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=\x00e\x00n\x00d\x00i\x00n\x00g\x00 \x00q\x00u\x00o\x00t\x00e\x00\ + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public Key: (1024 bit) + Modulus (1024 bit): + 00:ca:cc:98:77:0c:10:dd:0e:87:a2:da:b6:e6:97: + 91:36:71:54:de:2b:f8:de:18:b7:23:eb:e5:e3:57: + ae:cf:0b:6d:86:0f:63:f0:c4:4e:2a:66:48:33:c4: + e3:0b:2c:f5:e6:e5:e5:0f:f8:e0:a1:bc:11:06:a1: + 19:16:ec:44:77:a6:db:7d:d6:78:29:1f:57:f1:9d: + 3c:b4:3a:2b:3b:94:64:6d:e3:ce:b3:fa:d8:28:e2: + ed:76:9a:97:41:64:7c:0d:48:b8:1d:6a:56:e3:f9: + 4c:88:e9:1a:3c:b8:af:7a:13:67:19:59:36:46:79: + 52:72:ea:51:80:65:be:e2:0f + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Key Usage: + Digital Signature, Non Repudiation, Key Encipherment + X509v3 Subject Key Identifier: + D2:D8:8D:EE:39:D7:EA:15:23:00:7C:9D:48:1C:51:17:F8:80:86:CE + X509v3 Authority Key Identifier: + keyid:E8:6A:BB:C2:90:EA:6C:70:22:3E:F6:F6:48:1B:03:E6:BE:B7:A6:55 + + X509v3 Subject Alternative Name: + DirName:/CN=User 19 Root 11 + Signature Algorithm: sha1WithRSAEncryption + 6e:05:c4:48:32:4a:62:6f:a3:8c:23:af:47:dd:d4:c7:c1:91: + 17:7e:cd:36:73:39:a3:7b:c9:ae:da:f6:e1:bd:82:d6:72:17: + 78:20:a2:27:ad:f5:d2:3f:10:66:e0:d8:ba:10:00:c3:76:5b: + de:36:cb:2a:91:25:89:08:0e:2a:6a:81:d0:a7:49:70:42:f3: + 94:a3:bf:6c:6b:b9:fa:fd:f9:d4:1f:6f:75:27:b9:0d:d3:d2: + fd:5d:0d:dc:f5:34:29:a2:3a:2f:04:ab:48:41:6d:d7:2b:fd: + 42:02:99:3c:cf:aa:6b:98:66:17:83:39:4a:6f:47:36:ad:db: + 22:6e +-----BEGIN CERTIFICATE----- +MIICwjCCAiugAwIBAgICEBQwDQYJKoZIhvcNAQEFBQAwYDELMAkGA1UEBhMCREUx +EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD +VQQLEwtEZXZlbG9wbWVudDEQMA4GA1UEAxMHUm9vdCAxMTAeFw0xMDAxMTkxMDA1 +NTBaFw0zNTAxMTMxMDA1NTBaMHMxCzAJBgNVBAYTAkRFMRAwDgYDVQQIEwdIYW1i +dXJnMRcwFQYDVQQKEw5PcGVuT2ZmaWNlLm9yZzEUMBIGA1UECxMLRGV2ZWxvcG1l +bnQxIzAhBgNVBAMeGgBlAG4AZABpAG4AZwAgAHEAdQBvAHQAZQBcMIGfMA0GCSqG +SIb3DQEBAQUAA4GNADCBiQKBgQDKzJh3DBDdDoei2rbml5E2cVTeK/jeGLcj6+Xj +V67PC22GD2PwxE4qZkgzxOMLLPXm5eUP+OChvBEGoRkW7ER3ptt91ngpH1fxnTy0 +Ois7lGRt486z+tgo4u12mpdBZHwNSLgdalbj+UyI6Ro8uK96E2cZWTZGeVJy6lGA +Zb7iDwIDAQABo3gwdjALBgNVHQ8EBAMCBeAwHQYDVR0OBBYEFNLYje451+oVIwB8 +nUgcURf4gIbOMB8GA1UdIwQYMBaAFOhqu8KQ6mxwIj729kgbA+a+t6ZVMCcGA1Ud +EQQgMB6kHDAaMRgwFgYDVQQDEw9Vc2VyIDE5IFJvb3QgMTEwDQYJKoZIhvcNAQEF +BQADgYEAbgXESDJKYm+jjCOvR93Ux8GRF37NNnM5o3vJrtr24b2C1nIXeCCiJ631 +0j8QZuDYuhAAw3Zb3jbLKpEliQgOKmqB0KdJcELzlKO/bGu5+v351B9vdSe5DdPS +/V0N3PU0KaI6LwSrSEFt1yv9QgKZPM+qa5hmF4M5Sm9HNq3bIm4= +-----END CERTIFICATE----- diff --git a/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1015.pem b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1015.pem new file mode 100755 index 000000000000..d9d3f941e628 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1015.pem @@ -0,0 +1,60 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 4117 (0x1015) + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 11 + Validity + Not Before: Jan 19 10:07:07 2010 GMT + Not After : Jan 13 10:07:07 2035 GMT + Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=\x00m\x00i\x00d\x00d\x00l\x00e\x00 \x00\\x00q\x00u\x00o\x00t\x00e + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public Key: (1024 bit) + Modulus (1024 bit): + 00:f0:7c:07:f6:13:52:ce:13:cf:8a:5f:7f:5f:3c: + d4:93:c8:a0:43:1f:e2:fc:3f:62:63:be:b5:17:e0: + 32:b0:d0:c2:9a:35:9e:3b:29:30:b4:13:78:18:ae: + 80:ba:fb:f3:fc:81:ad:aa:47:18:eb:fc:d1:76:de: + b6:cf:55:65:5e:3e:15:93:8e:9c:39:4e:a3:ae:1d: + c0:49:22:dc:25:09:33:95:0d:b5:62:7c:96:0b:05: + b6:10:ae:ee:f8:18:24:9f:d4:ed:b3:4c:a9:4d:f2: + be:6c:66:37:b9:17:cb:14:df:52:b4:a8:de:63:0d: + 4f:78:58:16:ab:f2:3f:f6:a9 + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Key Usage: + Digital Signature, Non Repudiation, Key Encipherment + X509v3 Subject Key Identifier: + 41:CC:3D:88:34:10:21:13:A2:34:24:B6:4E:F9:33:3C:B3:FA:56:BC + X509v3 Authority Key Identifier: + keyid:E8:6A:BB:C2:90:EA:6C:70:22:3E:F6:F6:48:1B:03:E6:BE:B7:A6:55 + + X509v3 Subject Alternative Name: + DirName:/CN=User 20 Root 11 + Signature Algorithm: sha1WithRSAEncryption + a7:17:c3:92:37:10:ee:9a:12:65:32:82:56:93:82:fa:0e:40: + 9f:ae:30:6a:b1:6f:85:18:7f:ff:9c:30:49:b7:56:bf:a3:86: + d7:dd:5d:79:d1:7f:9a:95:b6:bd:1d:43:cc:2c:aa:7a:40:c4: + de:17:02:22:74:ec:a9:cd:8d:93:f6:6c:98:7e:bb:6a:68:70: + 66:d4:a0:8f:1a:7a:8e:9e:38:35:aa:87:6a:e5:db:80:69:51: + 51:68:46:4f:3d:da:17:df:6f:22:60:77:95:55:d3:12:1b:11: + c1:6f:c1:96:78:00:47:61:af:53:c0:37:44:6b:92:67:7f:14: + 79:80 +-----BEGIN CERTIFICATE----- +MIICwjCCAiugAwIBAgICEBUwDQYJKoZIhvcNAQEFBQAwYDELMAkGA1UEBhMCREUx +EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD +VQQLEwtEZXZlbG9wbWVudDEQMA4GA1UEAxMHUm9vdCAxMTAeFw0xMDAxMTkxMDA3 +MDdaFw0zNTAxMTMxMDA3MDdaMHMxCzAJBgNVBAYTAkRFMRAwDgYDVQQIEwdIYW1i +dXJnMRcwFQYDVQQKEw5PcGVuT2ZmaWNlLm9yZzEUMBIGA1UECxMLRGV2ZWxvcG1l +bnQxIzAhBgNVBAMeGgBtAGkAZABkAGwAZQAgAFwAcQB1AG8AdABlMIGfMA0GCSqG +SIb3DQEBAQUAA4GNADCBiQKBgQDwfAf2E1LOE8+KX39fPNSTyKBDH+L8P2JjvrUX +4DKw0MKaNZ47KTC0E3gYroC6+/P8ga2qRxjr/NF23rbPVWVePhWTjpw5TqOuHcBJ +ItwlCTOVDbVifJYLBbYQru74GCSf1O2zTKlN8r5sZje5F8sU31K0qN5jDU94WBar +8j/2qQIDAQABo3gwdjALBgNVHQ8EBAMCBeAwHQYDVR0OBBYEFEHMPYg0ECETojQk +tk75Mzyz+la8MB8GA1UdIwQYMBaAFOhqu8KQ6mxwIj729kgbA+a+t6ZVMCcGA1Ud +EQQgMB6kHDAaMRgwFgYDVQQDEw9Vc2VyIDIwIFJvb3QgMTEwDQYJKoZIhvcNAQEF +BQADgYEApxfDkjcQ7poSZTKCVpOC+g5An64warFvhRh//5wwSbdWv6OG191dedF/ +mpW2vR1DzCyqekDE3hcCInTsqc2Nk/ZsmH67amhwZtSgjxp6jp44NaqHauXbgGlR +UWhGTz3aF99vImB3lVXTEhsRwW/BlngAR2GvU8A3RGuSZ38UeYA= +-----END CERTIFICATE----- diff --git a/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1016.pem b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1016.pem new file mode 100755 index 000000000000..9f4e006f02eb --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1016.pem @@ -0,0 +1,61 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 4118 (0x1016) + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 11 + Validity + Not Before: Jan 19 10:09:50 2010 GMT + Not After : Jan 13 10:09:50 2035 GMT + Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=\x00d\x00o\x00u\x00b\x00l\x00e\x00 \x00\\x00\\x00m\x00i\x00d\x00d\x00l\x00e\x00 \x00q\x00u\x00o\x00t\x00e + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public Key: (1024 bit) + Modulus (1024 bit): + 00:cd:22:93:9a:93:18:34:2f:50:e0:cc:23:f4:60: + bc:96:60:d5:a5:f9:da:45:9a:5b:a3:0a:fb:71:25: + 4c:bd:60:84:19:f5:93:28:c1:5d:b9:8d:05:05:4d: + 01:85:aa:9e:5b:08:9c:01:f8:32:90:fe:ef:7f:eb: + cb:b3:8b:b2:c8:d1:79:d6:47:a3:d8:df:f1:d0:56: + 04:04:bd:41:72:fc:98:75:10:d2:9b:b5:bc:55:a1: + fa:19:01:67:93:09:48:0a:67:ec:4d:12:47:37:6f: + c2:53:0e:c9:7a:30:ec:1d:9d:a5:e2:64:d8:92:4d: + ed:ec:b2:bb:10:96:76:28:47 + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Key Usage: + Digital Signature, Non Repudiation, Key Encipherment + X509v3 Subject Key Identifier: + DC:FF:9A:2B:49:51:1E:FB:A7:3A:90:94:1B:E0:3E:34:89:13:48:EE + X509v3 Authority Key Identifier: + keyid:E8:6A:BB:C2:90:EA:6C:70:22:3E:F6:F6:48:1B:03:E6:BE:B7:A6:55 + + X509v3 Subject Alternative Name: + DirName:/CN=User 21 Root 11 + Signature Algorithm: sha1WithRSAEncryption + 16:aa:a6:b7:0e:e3:d2:ba:7e:9b:59:f6:cc:ce:5d:4d:2a:f2: + 95:60:46:24:dd:ea:e8:08:e6:60:9c:33:82:8c:34:a2:d8:38: + fb:75:fe:31:79:10:78:7d:93:44:3b:00:90:83:a4:15:52:8d: + 3a:b4:9c:c0:6f:95:2c:4f:d8:b3:3b:cf:69:ab:3c:41:3a:43: + 1b:0a:8b:b0:b4:aa:8b:bf:6f:96:e2:65:4a:00:3a:49:bc:9a: + a1:cd:13:b1:24:93:f6:44:cd:d3:71:91:da:4f:dd:75:3d:68: + 5c:6b:49:14:8a:23:b5:b6:4f:b6:41:d0:a7:16:7c:67:4c:b3: + 0a:88 +-----BEGIN CERTIFICATE----- +MIIC0zCCAjygAwIBAgICEBYwDQYJKoZIhvcNAQEFBQAwYDELMAkGA1UEBhMCREUx +EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD +VQQLEwtEZXZlbG9wbWVudDEQMA4GA1UEAxMHUm9vdCAxMTAeFw0xMDAxMTkxMDA5 +NTBaFw0zNTAxMTMxMDA5NTBaMIGDMQswCQYDVQQGEwJERTEQMA4GA1UECBMHSGFt +YnVyZzEXMBUGA1UEChMOT3Blbk9mZmljZS5vcmcxFDASBgNVBAsTC0RldmVsb3Bt +ZW50MTMwMQYDVQQDHioAZABvAHUAYgBsAGUAIABcAFwAbQBpAGQAZABsAGUAIABx +AHUAbwB0AGUwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAM0ik5qTGDQvUODM +I/RgvJZg1aX52kWaW6MK+3ElTL1ghBn1kyjBXbmNBQVNAYWqnlsInAH4MpD+73/r +y7OLssjRedZHo9jf8dBWBAS9QXL8mHUQ0pu1vFWh+hkBZ5MJSApn7E0SRzdvwlMO +yXow7B2dpeJk2JJN7eyyuxCWdihHAgMBAAGjeDB2MAsGA1UdDwQEAwIF4DAdBgNV +HQ4EFgQU3P+aK0lRHvunOpCUG+A+NIkTSO4wHwYDVR0jBBgwFoAU6Gq7wpDqbHAi +Pvb2SBsD5r63plUwJwYDVR0RBCAwHqQcMBoxGDAWBgNVBAMTD1VzZXIgMjEgUm9v +dCAxMTANBgkqhkiG9w0BAQUFAAOBgQAWqqa3DuPSun6bWfbMzl1NKvKVYEYk3ero +COZgnDOCjDSi2Dj7df4xeRB4fZNEOwCQg6QVUo06tJzAb5UsT9izO89pqzxBOkMb +CouwtKqLv2+W4mVKADpJvJqhzROxJJP2RM3TcZHaT911PWhca0kUiiO1tk+2QdCn +FnxnTLMKiA== +-----END CERTIFICATE----- diff --git a/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1017.pem b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1017.pem new file mode 100755 index 000000000000..7bb12fa78903 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1017.pem @@ -0,0 +1,61 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 4119 (0x1017) + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 11 + Validity + Not Before: Jan 19 10:11:53 2010 GMT + Not After : Jan 13 10:11:53 2035 GMT + Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=\x00p\x00a\x00r\x00t\x00i\x00a\x00l\x00l\x00y\x00 \x00\\x00e\x00n\x00c\x00l\x00o\x00s\x00i\x00n\x00g\x00 \x00q\x00u\x00o\x00t\x00e\x00\ + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public Key: (1024 bit) + Modulus (1024 bit): + 00:e7:c9:bb:89:11:2f:2c:39:bc:d3:f5:d9:86:d4: + 8e:d7:20:11:81:75:30:25:7e:2b:29:70:61:83:38: + 24:d1:0f:cc:0b:88:71:29:06:05:a5:53:d2:00:2f: + 12:0c:7d:42:e6:47:33:de:cc:f8:7b:2a:5d:d9:cb: + 69:24:91:38:bf:0c:1a:12:cf:1e:f9:44:c2:1c:e8: + 6f:ea:ab:8b:92:4c:93:8c:69:61:b9:57:b3:1d:d0: + 03:3e:13:9d:30:bd:b2:b9:d9:c7:9b:4d:18:45:b0: + 19:19:15:58:4c:bd:5a:a1:59:4f:f0:1f:99:26:3b: + 4e:76:c6:bb:21:3c:94:bc:d9 + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Key Usage: + Digital Signature, Non Repudiation, Key Encipherment + X509v3 Subject Key Identifier: + 43:E4:70:39:E3:91:80:2A:C3:BC:1A:F4:A3:51:4B:99:C5:20:93:A6 + X509v3 Authority Key Identifier: + keyid:E8:6A:BB:C2:90:EA:6C:70:22:3E:F6:F6:48:1B:03:E6:BE:B7:A6:55 + + X509v3 Subject Alternative Name: + DirName:/CN=User 22 Root 11 + Signature Algorithm: sha1WithRSAEncryption + 28:ce:8c:f0:bf:56:c6:a4:02:df:dd:1d:75:dc:cf:62:a0:92: + 58:64:91:8c:bb:96:3c:52:d5:66:6c:31:7e:1c:d9:a8:e5:1c: + a6:9f:5e:26:3f:69:71:c6:d7:5d:02:4f:a7:42:a5:85:fa:38: + 01:43:36:54:75:4c:51:a2:99:5d:72:05:9a:9b:fc:5e:83:9b: + a0:ef:11:b1:a4:dd:a5:50:2f:d0:14:dd:04:0f:8b:93:7e:4b: + 3e:24:04:45:d0:98:46:49:74:9f:d7:b4:68:09:dc:b6:ac:35: + 3f:5d:f9:ee:77:a4:35:46:75:a4:6a:d6:c1:53:4f:d2:0c:38: + 3c:df +-----BEGIN CERTIFICATE----- +MIIC3zCCAkigAwIBAgICEBcwDQYJKoZIhvcNAQEFBQAwYDELMAkGA1UEBhMCREUx +EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD +VQQLEwtEZXZlbG9wbWVudDEQMA4GA1UEAxMHUm9vdCAxMTAeFw0xMDAxMTkxMDEx +NTNaFw0zNTAxMTMxMDExNTNaMIGPMQswCQYDVQQGEwJERTEQMA4GA1UECBMHSGFt +YnVyZzEXMBUGA1UEChMOT3Blbk9mZmljZS5vcmcxFDASBgNVBAsTC0RldmVsb3Bt +ZW50MT8wPQYDVQQDHjYAcABhAHIAdABpAGEAbABsAHkAIABcAGUAbgBjAGwAbwBz +AGkAbgBnACAAcQB1AG8AdABlAFwwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGB +AOfJu4kRLyw5vNP12YbUjtcgEYF1MCV+KylwYYM4JNEPzAuIcSkGBaVT0gAvEgx9 +QuZHM97M+HsqXdnLaSSROL8MGhLPHvlEwhzob+qri5JMk4xpYblXsx3QAz4TnTC9 +srnZx5tNGEWwGRkVWEy9WqFZT/AfmSY7TnbGuyE8lLzZAgMBAAGjeDB2MAsGA1Ud +DwQEAwIF4DAdBgNVHQ4EFgQUQ+RwOeORgCrDvBr0o1FLmcUgk6YwHwYDVR0jBBgw +FoAU6Gq7wpDqbHAiPvb2SBsD5r63plUwJwYDVR0RBCAwHqQcMBoxGDAWBgNVBAMT +D1VzZXIgMjIgUm9vdCAxMTANBgkqhkiG9w0BAQUFAAOBgQAozozwv1bGpALf3R11 +3M9ioJJYZJGMu5Y8UtVmbDF+HNmo5Rymn14mP2lxxtddAk+nQqWF+jgBQzZUdUxR +opldcgWam/xeg5ug7xGxpN2lUC/QFN0ED4uTfks+JARF0JhGSXSf17RoCdy2rDU/ +Xfnud6Q1RnWkatbBU0/SDDg83w== +-----END CERTIFICATE----- diff --git a/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1018.pem b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1018.pem new file mode 100755 index 000000000000..d134dc5f3ea5 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1018.pem @@ -0,0 +1,61 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 4120 (0x1018) + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 11 + Validity + Not Before: Jan 19 10:13:38 2010 GMT + Not After : Jan 13 10:13:38 2035 GMT + Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=\x00\\x00U\x00s\x00e\x00r\x00 \x002\x003\x00,\x00 \x00s\x00t\x00a\x00r\x00t\x00i\x00n\x00g\x00 \x00q\x00u\x00o\x00t\x00e + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public Key: (1024 bit) + Modulus (1024 bit): + 00:b9:e3:64:f8:02:be:98:47:de:c6:f4:22:14:4f: + 22:fe:17:8c:14:7f:b8:27:44:51:9d:5a:79:33:b4: + d0:21:27:b0:ed:f9:9f:3d:54:ef:ba:3a:d8:89:2a: + ca:a8:8f:f3:f6:a7:6b:5f:0a:58:2d:a0:e3:05:3a: + 26:a6:1e:b6:89:a1:e1:71:11:e7:16:93:29:69:f8: + 14:a2:e3:d7:4e:e5:60:40:d7:40:c5:37:d6:95:7c: + 4f:35:fd:a8:82:7f:90:32:1d:99:e7:8a:b9:93:a4: + f3:23:0a:a5:f9:56:31:73:d8:e3:cb:d6:0e:2f:2b: + ee:8e:b5:ca:eb:63:82:1c:0b + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Key Usage: + Digital Signature, Non Repudiation, Key Encipherment + X509v3 Subject Key Identifier: + 80:A8:F7:13:E3:E8:F8:A6:60:94:21:C1:FE:54:54:89:AC:4B:DF:45 + X509v3 Authority Key Identifier: + keyid:E8:6A:BB:C2:90:EA:6C:70:22:3E:F6:F6:48:1B:03:E6:BE:B7:A6:55 + + X509v3 Subject Alternative Name: + DirName:/CN=User 23 Root 11 + Signature Algorithm: sha1WithRSAEncryption + be:31:bd:4a:56:80:64:f0:1e:ea:77:4a:f3:e3:ec:f0:ad:27: + cc:05:01:fa:d2:12:7c:8e:85:5b:37:54:9c:4f:96:2d:1c:81: + e4:21:3d:4b:d9:86:1a:6c:29:5e:88:f2:ae:04:f1:70:87:25: + b9:9a:4a:ef:dd:21:f9:17:33:ee:a1:eb:38:fb:c4:73:72:70: + 0c:67:58:96:95:8c:2c:5a:4a:31:28:50:52:64:65:5c:63:60: + de:24:df:a0:e9:0d:c0:b6:d6:4c:51:a7:5a:e8:dd:f6:ff:49: + e6:6f:7f:86:38:5d:c7:f9:eb:55:f1:b2:89:3b:cd:41:f7:5d: + a8:b0 +-----BEGIN CERTIFICATE----- +MIIC2TCCAkKgAwIBAgICEBgwDQYJKoZIhvcNAQEFBQAwYDELMAkGA1UEBhMCREUx +EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD +VQQLEwtEZXZlbG9wbWVudDEQMA4GA1UEAxMHUm9vdCAxMTAeFw0xMDAxMTkxMDEz +MzhaFw0zNTAxMTMxMDEzMzhaMIGJMQswCQYDVQQGEwJERTEQMA4GA1UECBMHSGFt +YnVyZzEXMBUGA1UEChMOT3Blbk9mZmljZS5vcmcxFDASBgNVBAsTC0RldmVsb3Bt +ZW50MTkwNwYDVQQDHjAAXABVAHMAZQByACAAMgAzACwAIABzAHQAYQByAHQAaQBu +AGcAIABxAHUAbwB0AGUwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBALnjZPgC +vphH3sb0IhRPIv4XjBR/uCdEUZ1aeTO00CEnsO35nz1U77o62IkqyqiP8/ana18K +WC2g4wU6JqYetomh4XER5xaTKWn4FKLj107lYEDXQMU31pV8TzX9qIJ/kDIdmeeK +uZOk8yMKpflWMXPY48vWDi8r7o61yutjghwLAgMBAAGjeDB2MAsGA1UdDwQEAwIF +4DAdBgNVHQ4EFgQUgKj3E+Po+KZglCHB/lRUiaxL30UwHwYDVR0jBBgwFoAU6Gq7 +wpDqbHAiPvb2SBsD5r63plUwJwYDVR0RBCAwHqQcMBoxGDAWBgNVBAMTD1VzZXIg +MjMgUm9vdCAxMTANBgkqhkiG9w0BAQUFAAOBgQC+Mb1KVoBk8B7qd0rz4+zwrSfM +BQH60hJ8joVbN1ScT5YtHIHkIT1L2YYabCleiPKuBPFwhyW5mkrv3SH5FzPuoes4 ++8RzcnAMZ1iWlYwsWkoxKFBSZGVcY2DeJN+g6Q3AttZMUada6N32/0nmb3+GOF3H ++etV8bKJO81B912osA== +-----END CERTIFICATE----- diff --git a/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1019.pem b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1019.pem new file mode 100755 index 000000000000..66c3f15bfdbf --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1019.pem @@ -0,0 +1,61 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 4121 (0x1019) + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 11 + Validity + Not Before: Jan 19 10:14:50 2010 GMT + Not After : Jan 13 10:14:50 2035 GMT + Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=\x00U\x00s\x00e\x00r\x00 \x002\x004\x00,\x00 \x00e\x00n\x00d\x00i\x00n\x00g\x00 \x00q\x00u\x00o\x00t\x00e\x00\ + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public Key: (1024 bit) + Modulus (1024 bit): + 00:9c:cd:78:e7:11:1d:61:d4:0c:c6:87:c9:28:47: + 84:23:6b:86:c3:38:37:62:5a:9a:4b:50:fc:b7:f3: + d9:4b:1b:20:ff:06:42:bb:22:33:c5:22:12:2c:bb: + e6:c8:08:69:0e:af:e9:22:45:9f:ef:2c:26:46:d7: + 1b:36:db:70:58:32:bc:3d:d7:7d:64:27:44:54:6c: + 89:12:88:d7:31:3d:3f:5c:96:cb:69:9f:b1:a9:e0: + 9a:de:50:b7:ad:d8:29:bf:bc:3c:21:e9:a2:79:21: + 46:81:ea:90:df:44:0c:6c:bb:f8:47:c8:e9:79:d1: + 8d:40:1b:5d:d3:75:9b:e4:0b + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Key Usage: + Digital Signature, Non Repudiation, Key Encipherment + X509v3 Subject Key Identifier: + 81:14:09:35:7F:F6:7A:83:6B:19:C2:22:24:92:E6:D4:EF:52:1C:0B + X509v3 Authority Key Identifier: + keyid:E8:6A:BB:C2:90:EA:6C:70:22:3E:F6:F6:48:1B:03:E6:BE:B7:A6:55 + + X509v3 Subject Alternative Name: + DirName:/CN=User 24 Root 11 + Signature Algorithm: sha1WithRSAEncryption + 7c:65:0b:e2:cd:ca:00:e8:40:0f:37:70:a1:89:54:5d:03:06: + 2c:60:56:dc:2f:b7:01:ac:75:58:f6:82:8f:91:63:e2:91:d1: + 17:7b:bd:63:b9:9c:4e:46:86:3e:a6:f5:a6:56:ac:90:2a:f4: + d8:a0:6c:02:15:6e:d9:f6:2a:f8:9a:c4:48:bd:cd:54:82:55: + c6:d5:52:76:09:e3:3d:17:8d:5c:46:16:ae:9e:56:df:9f:c3: + 05:15:6f:ae:d0:b5:76:67:48:2d:5a:3c:59:da:1b:13:c3:84: + 5e:2a:57:8d:86:9a:f1:8a:5d:01:47:93:44:62:af:65:03:e1: + df:10 +-----BEGIN CERTIFICATE----- +MIIC1TCCAj6gAwIBAgICEBkwDQYJKoZIhvcNAQEFBQAwYDELMAkGA1UEBhMCREUx +EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD +VQQLEwtEZXZlbG9wbWVudDEQMA4GA1UEAxMHUm9vdCAxMTAeFw0xMDAxMTkxMDE0 +NTBaFw0zNTAxMTMxMDE0NTBaMIGFMQswCQYDVQQGEwJERTEQMA4GA1UECBMHSGFt +YnVyZzEXMBUGA1UEChMOT3Blbk9mZmljZS5vcmcxFDASBgNVBAsTC0RldmVsb3Bt +ZW50MTUwMwYDVQQDHiwAVQBzAGUAcgAgADIANAAsACAAZQBuAGQAaQBuAGcAIABx +AHUAbwB0AGUAXDCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAnM145xEdYdQM +xofJKEeEI2uGwzg3YlqaS1D8t/PZSxsg/wZCuyIzxSISLLvmyAhpDq/pIkWf7ywm +RtcbNttwWDK8Pdd9ZCdEVGyJEojXMT0/XJbLaZ+xqeCa3lC3rdgpv7w8IemieSFG +geqQ30QMbLv4R8jpedGNQBtd03Wb5AsCAwEAAaN4MHYwCwYDVR0PBAQDAgXgMB0G +A1UdDgQWBBSBFAk1f/Z6g2sZwiIkkubU71IcCzAfBgNVHSMEGDAWgBToarvCkOps +cCI+9vZIGwPmvremVTAnBgNVHREEIDAepBwwGjEYMBYGA1UEAxMPVXNlciAyNCBS +b290IDExMA0GCSqGSIb3DQEBBQUAA4GBAHxlC+LNygDoQA83cKGJVF0DBixgVtwv +twGsdVj2go+RY+KR0Rd7vWO5nE5Ghj6m9aZWrJAq9NigbAIVbtn2KviaxEi9zVSC +VcbVUnYJ4z0XjVxGFq6eVt+fwwUVb67QtXZnSC1aPFnaGxPDhF4qV42GmvGKXQFH +k0Rir2UD4d8Q +-----END CERTIFICATE----- diff --git a/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/101A.pem b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/101A.pem new file mode 100755 index 000000000000..ba352d83d135 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/101A.pem @@ -0,0 +1,61 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 4122 (0x101a) + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 11 + Validity + Not Before: Jan 19 10:16:10 2010 GMT + Not After : Jan 13 10:16:10 2035 GMT + Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=\x00\\x00U\x00s\x00e\x00r\x00 \x002\x005\x00,\x00 \x00e\x00n\x00c\x00l\x00o\x00s\x00i\x00n\x00g\x00 \x00q\x00u\x00o\x00t\x00e\x00\ + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public Key: (1024 bit) + Modulus (1024 bit): + 00:ad:20:4a:85:d2:a8:2a:f8:0e:4c:b5:2d:72:a5: + 1d:0e:b1:8a:76:2c:b0:bf:7a:48:b8:57:29:cb:40: + c5:8a:e8:0e:d3:f6:f9:b1:90:a6:4a:bb:82:45:fd: + c2:ff:03:fa:fc:4a:5d:93:0b:52:a2:17:10:b1:7e: + 13:1d:9d:28:26:e3:44:bd:fd:26:da:b2:7b:47:e1: + c4:35:ea:53:1b:94:76:cc:f2:f6:c1:86:f2:18:46: + e1:71:c0:5d:e5:8f:0a:10:7a:ea:61:af:d0:ba:28: + 22:13:77:0f:7d:9e:e0:0a:f0:92:ce:dd:b3:5d:a6: + df:c1:eb:a8:29:57:e6:71:65 + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Key Usage: + Digital Signature, Non Repudiation, Key Encipherment + X509v3 Subject Key Identifier: + C3:EE:4A:7E:AC:46:2D:BA:42:F7:33:1F:E7:49:FA:21:D3:BC:DD:49 + X509v3 Authority Key Identifier: + keyid:E8:6A:BB:C2:90:EA:6C:70:22:3E:F6:F6:48:1B:03:E6:BE:B7:A6:55 + + X509v3 Subject Alternative Name: + DirName:/CN=User 25 Root 11 + Signature Algorithm: sha1WithRSAEncryption + bf:63:34:12:e3:4b:83:4e:e5:c5:08:c3:b3:ea:be:38:33:38: + 3c:99:c3:ca:08:84:05:d4:21:53:7a:7d:43:86:c2:63:e2:d3: + 7c:21:3c:72:fa:c6:f3:bf:2b:10:5e:ca:4b:2c:2c:1c:e3:10: + eb:7c:ff:b1:20:b2:47:1b:b3:3e:77:b6:74:fb:83:85:ac:b8: + c9:5b:ca:8a:14:2f:e4:81:6e:04:6f:c8:37:c0:9f:c0:41:0f: + b4:6e:21:82:69:51:e8:68:09:72:c4:8c:72:db:47:0b:a5:52: + d7:e7:b3:5d:10:9c:ed:14:af:1c:fd:0b:11:a3:fd:f9:b9:2d: + 48:b5 +-----BEGIN CERTIFICATE----- +MIIC3TCCAkagAwIBAgICEBowDQYJKoZIhvcNAQEFBQAwYDELMAkGA1UEBhMCREUx +EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD +VQQLEwtEZXZlbG9wbWVudDEQMA4GA1UEAxMHUm9vdCAxMTAeFw0xMDAxMTkxMDE2 +MTBaFw0zNTAxMTMxMDE2MTBaMIGNMQswCQYDVQQGEwJERTEQMA4GA1UECBMHSGFt +YnVyZzEXMBUGA1UEChMOT3Blbk9mZmljZS5vcmcxFDASBgNVBAsTC0RldmVsb3Bt +ZW50MT0wOwYDVQQDHjQAXABVAHMAZQByACAAMgA1ACwAIABlAG4AYwBsAG8AcwBp +AG4AZwAgAHEAdQBvAHQAZQBcMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCt +IEqF0qgq+A5MtS1ypR0OsYp2LLC/eki4VynLQMWK6A7T9vmxkKZKu4JF/cL/A/r8 +Sl2TC1KiFxCxfhMdnSgm40S9/SbasntH4cQ16lMblHbM8vbBhvIYRuFxwF3ljwoQ +euphr9C6KCITdw99nuAK8JLO3bNdpt/B66gpV+ZxZQIDAQABo3gwdjALBgNVHQ8E +BAMCBeAwHQYDVR0OBBYEFMPuSn6sRi26QvczH+dJ+iHTvN1JMB8GA1UdIwQYMBaA +FOhqu8KQ6mxwIj729kgbA+a+t6ZVMCcGA1UdEQQgMB6kHDAaMRgwFgYDVQQDEw9V +c2VyIDI1IFJvb3QgMTEwDQYJKoZIhvcNAQEFBQADgYEAv2M0EuNLg07lxQjDs+q+ +ODM4PJnDygiEBdQhU3p9Q4bCY+LTfCE8cvrG878rEF7KSywsHOMQ63z/sSCyRxuz +Pne2dPuDhay4yVvKihQv5IFuBG/IN8CfwEEPtG4hgmlR6GgJcsSMcttHC6VS1+ez +XRCc7RSvHP0LEaP9+bktSLU= +-----END CERTIFICATE----- diff --git a/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/101B.pem b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/101B.pem new file mode 100755 index 000000000000..4c03562a8ea9 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/101B.pem @@ -0,0 +1,61 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 4123 (0x101b) + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 11 + Validity + Not Before: Jan 19 10:17:45 2010 GMT + Not After : Jan 13 10:17:45 2035 GMT + Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=\x00U\x00s\x00e\x00r\x00 \x002\x006\x00\\x00,\x00 \x00m\x00i\x00d\x00d\x00l\x00e\x00 \x00q\x00u\x00o\x00t\x00e + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public Key: (1024 bit) + Modulus (1024 bit): + 00:ec:4c:2b:ba:b1:e5:ba:83:e8:64:6c:67:fe:f9: + 84:9a:71:68:0b:10:b0:2e:2c:21:d8:6d:c8:cc:de: + 82:76:15:b8:74:a0:4b:3c:39:f0:ee:3a:08:6c:0e: + 0c:36:51:ed:44:04:ca:2b:76:30:6f:85:d4:f6:f0: + 7e:53:2b:17:90:6a:7b:79:e0:c2:00:f2:5f:dd:19: + 8f:09:7a:a2:c8:85:95:24:e0:41:39:ec:75:e1:c7: + 03:ba:6d:e9:81:48:8b:36:38:e0:99:3e:58:04:e3: + 03:8d:e4:3b:95:98:0a:23:96:f1:96:50:06:5d:71: + 6f:02:e1:c5:cd:e0:5c:c4:7b + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Key Usage: + Digital Signature, Non Repudiation, Key Encipherment + X509v3 Subject Key Identifier: + 1D:A3:64:F0:93:51:C2:F2:1A:BB:D0:2D:20:95:5E:19:94:4C:72:BB + X509v3 Authority Key Identifier: + keyid:E8:6A:BB:C2:90:EA:6C:70:22:3E:F6:F6:48:1B:03:E6:BE:B7:A6:55 + + X509v3 Subject Alternative Name: + DirName:/CN=User 26 Root 11 + Signature Algorithm: sha1WithRSAEncryption + 8c:c1:56:7d:d9:a8:f7:af:4b:57:4a:a5:2a:32:11:12:e0:d8: + 0e:10:39:8f:17:53:25:f5:c6:57:55:e4:f0:16:f2:11:cc:af: + cc:44:6b:23:6f:8e:2a:df:ee:ff:f0:d4:3f:0a:85:7e:19:de: + f8:cf:69:be:8b:59:ad:3c:be:3c:d7:32:ac:ba:82:91:28:23: + 71:ba:b5:29:05:e4:98:ee:2b:bb:56:04:7f:8b:69:c5:f9:4c: + 1b:0b:2e:3a:46:41:8e:da:16:68:9f:c7:57:71:8e:97:0d:b0: + a1:92:ae:7c:75:46:ef:b4:6d:8e:e7:53:07:23:a4:e1:e0:f0: + e7:3b +-----BEGIN CERTIFICATE----- +MIIC1TCCAj6gAwIBAgICEBswDQYJKoZIhvcNAQEFBQAwYDELMAkGA1UEBhMCREUx +EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD +VQQLEwtEZXZlbG9wbWVudDEQMA4GA1UEAxMHUm9vdCAxMTAeFw0xMDAxMTkxMDE3 +NDVaFw0zNTAxMTMxMDE3NDVaMIGFMQswCQYDVQQGEwJERTEQMA4GA1UECBMHSGFt +YnVyZzEXMBUGA1UEChMOT3Blbk9mZmljZS5vcmcxFDASBgNVBAsTC0RldmVsb3Bt +ZW50MTUwMwYDVQQDHiwAVQBzAGUAcgAgADIANgBcACwAIABtAGkAZABkAGwAZQAg +AHEAdQBvAHQAZTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA7EwrurHluoPo +ZGxn/vmEmnFoCxCwLiwh2G3IzN6CdhW4dKBLPDnw7joIbA4MNlHtRATKK3Ywb4XU +9vB+UysXkGp7eeDCAPJf3RmPCXqiyIWVJOBBOex14ccDum3pgUiLNjjgmT5YBOMD +jeQ7lZgKI5bxllAGXXFvAuHFzeBcxHsCAwEAAaN4MHYwCwYDVR0PBAQDAgXgMB0G +A1UdDgQWBBQdo2Twk1HC8hq70C0glV4ZlExyuzAfBgNVHSMEGDAWgBToarvCkOps +cCI+9vZIGwPmvremVTAnBgNVHREEIDAepBwwGjEYMBYGA1UEAxMPVXNlciAyNiBS +b290IDExMA0GCSqGSIb3DQEBBQUAA4GBAIzBVn3ZqPevS1dKpSoyERLg2A4QOY8X +UyX1xldV5PAW8hHMr8xEayNvjirf7v/w1D8KhX4Z3vjPab6LWa08vjzXMqy6gpEo +I3G6tSkF5JjuK7tWBH+LacX5TBsLLjpGQY7aFmifx1dxjpcNsKGSrnx1Ru+0bY7n +UwcjpOHg8Oc7 +-----END CERTIFICATE----- diff --git a/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/101C.pem b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/101C.pem new file mode 100755 index 000000000000..c403402f3dd4 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/101C.pem @@ -0,0 +1,60 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 4124 (0x101c) + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 11 + Validity + Not Before: Jan 19 10:19:13 2010 GMT + Not After : Jan 13 10:19:13 2035 GMT + Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=comma, comma, comma , + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public Key: (1024 bit) + Modulus (1024 bit): + 00:af:2e:02:1a:b8:ed:7e:6e:27:2f:6e:ca:dc:57: + 11:17:88:37:38:37:26:d0:fb:d0:ee:ad:f3:a8:ad: + f5:8a:53:04:6a:82:a7:31:b5:e6:ce:88:24:fa:22: + 75:84:1b:a8:8c:fd:7f:63:0c:fc:13:41:82:60:a3: + 19:33:3d:d3:18:6e:09:c5:c7:e7:e9:9e:49:dd:f4: + 77:ef:f1:06:91:9a:c5:57:68:e5:0f:59:19:8d:53: + ff:cb:ae:11:33:48:5c:eb:72:e8:2f:67:ae:94:42: + d3:5b:2e:31:e3:6f:a7:5e:5e:9c:ea:2c:d2:c3:af: + 66:10:34:32:e5:2d:3f:55:c1 + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Key Usage: + Digital Signature, Non Repudiation, Key Encipherment + X509v3 Subject Key Identifier: + A1:FB:82:9C:27:AD:83:67:5E:8C:CC:A2:BA:32:3C:30:26:74:F4:CE + X509v3 Authority Key Identifier: + keyid:E8:6A:BB:C2:90:EA:6C:70:22:3E:F6:F6:48:1B:03:E6:BE:B7:A6:55 + + X509v3 Subject Alternative Name: + DirName:/CN=User 27 Root 11 + Signature Algorithm: sha1WithRSAEncryption + c6:72:8b:f8:57:9e:b7:bf:b1:f3:99:41:1c:8c:47:a1:93:d8: + 62:8e:2d:68:6c:db:12:02:86:e0:66:65:c1:7c:c4:83:35:4c: + 16:53:fd:34:c1:3c:60:15:fc:3d:3b:90:07:68:ca:af:a1:10: + 39:c4:6b:15:a6:1a:71:51:20:ea:35:84:ef:8f:ac:51:bc:d7: + 84:d8:35:71:44:8e:8c:4f:59:76:3d:b3:5f:5c:26:9e:bc:ee: + 09:40:13:3b:38:85:02:56:7d:97:db:4d:3d:b5:a1:66:cf:df: + 19:7a:2f:71:b7:a4:12:c3:9b:df:83:f9:a8:8a:00:68:e4:3a: + ee:25 +-----BEGIN CERTIFICATE----- +MIICvTCCAiagAwIBAgICEBwwDQYJKoZIhvcNAQEFBQAwYDELMAkGA1UEBhMCREUx +EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD +VQQLEwtEZXZlbG9wbWVudDEQMA4GA1UEAxMHUm9vdCAxMTAeFw0xMDAxMTkxMDE5 +MTNaFw0zNTAxMTMxMDE5MTNaMG4xCzAJBgNVBAYTAkRFMRAwDgYDVQQIEwdIYW1i +dXJnMRcwFQYDVQQKEw5PcGVuT2ZmaWNlLm9yZzEUMBIGA1UECxMLRGV2ZWxvcG1l +bnQxHjAcBgNVBAMTFWNvbW1hLCBjb21tYSwgY29tbWEgLDCBnzANBgkqhkiG9w0B +AQEFAAOBjQAwgYkCgYEAry4CGrjtfm4nL27K3FcRF4g3ODcm0PvQ7q3zqK31ilME +aoKnMbXmzogk+iJ1hBuojP1/Ywz8E0GCYKMZMz3TGG4Jxcfn6Z5J3fR37/EGkZrF +V2jlD1kZjVP/y64RM0hc63LoL2eulELTWy4x42+nXl6c6izSw69mEDQy5S0/VcEC +AwEAAaN4MHYwCwYDVR0PBAQDAgXgMB0GA1UdDgQWBBSh+4KcJ62DZ16MzKK6Mjww +JnT0zjAfBgNVHSMEGDAWgBToarvCkOpscCI+9vZIGwPmvremVTAnBgNVHREEIDAe +pBwwGjEYMBYGA1UEAxMPVXNlciAyNyBSb290IDExMA0GCSqGSIb3DQEBBQUAA4GB +AMZyi/hXnre/sfOZQRyMR6GT2GKOLWhs2xIChuBmZcF8xIM1TBZT/TTBPGAV/D07 +kAdoyq+hEDnEaxWmGnFRIOo1hO+PrFG814TYNXFEjoxPWXY9s19cJp687glAEzs4 +hQJWfZfbTT21oWbP3xl6L3G3pBLDm9+D+aiKAGjkOu4l +-----END CERTIFICATE----- diff --git a/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/101D.pem b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/101D.pem new file mode 100755 index 000000000000..2790a2abd2a1 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/101D.pem @@ -0,0 +1,60 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 4125 (0x101d) + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 11 + Validity + Not Before: Jan 19 10:20:47 2010 GMT + Not After : Jan 13 10:20:47 2035 GMT + Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=equal CN=User 28 + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public Key: (1024 bit) + Modulus (1024 bit): + 00:ae:df:12:64:ab:d9:2f:ee:21:64:b5:08:c5:c8: + 8f:a1:ad:0e:b9:28:91:69:74:13:a5:aa:49:fe:fa: + 02:9d:37:db:0a:3b:26:6a:20:25:3d:f9:2d:b2:3b: + 39:c8:c6:e3:a7:aa:a1:0b:b2:1b:58:43:e6:3c:3f: + 67:fe:bb:bd:9b:b5:d9:de:e9:ed:76:ab:fd:f5:c8: + 15:b2:fb:a6:3f:23:ef:9f:5f:71:43:b3:be:55:1e: + 85:5f:13:b1:6b:9d:42:d7:30:a8:d2:9b:fe:71:7a: + c7:d3:60:7a:cf:e2:83:75:83:b8:1c:d3:ef:ee:94: + 3f:14:63:aa:7c:15:4e:42:1d + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Key Usage: + Digital Signature, Non Repudiation, Key Encipherment + X509v3 Subject Key Identifier: + 3B:2D:2B:5F:2E:E6:32:23:AE:47:B7:30:25:CB:ED:B0:6D:0C:30:E4 + X509v3 Authority Key Identifier: + keyid:E8:6A:BB:C2:90:EA:6C:70:22:3E:F6:F6:48:1B:03:E6:BE:B7:A6:55 + + X509v3 Subject Alternative Name: + DirName:/CN=User 28 Root 11 + Signature Algorithm: sha1WithRSAEncryption + 5b:cf:de:92:f8:ac:39:fb:0a:81:70:5b:17:d0:0d:0d:85:5e: + 2e:7d:be:d1:1a:ad:1d:99:a4:a6:f0:48:5a:7b:04:39:e2:93: + ff:80:84:f6:a1:e6:8a:52:12:55:46:c0:57:84:d9:c3:13:92: + 61:d7:41:af:39:09:57:05:25:01:90:68:7c:7c:5c:85:c6:f2: + fe:0e:37:e3:58:68:f9:32:fc:41:2c:35:36:f4:cf:ea:55:2d: + 52:7c:fb:37:32:35:cf:82:eb:fc:f1:39:f1:51:f1:e1:5b:d6: + 58:e1:7f:d4:50:ce:cf:07:f2:e5:f5:e2:dd:fe:55:3f:64:07: + 90:4f +-----BEGIN CERTIFICATE----- +MIICuDCCAiGgAwIBAgICEB0wDQYJKoZIhvcNAQEFBQAwYDELMAkGA1UEBhMCREUx +EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD +VQQLEwtEZXZlbG9wbWVudDEQMA4GA1UEAxMHUm9vdCAxMTAeFw0xMDAxMTkxMDIw +NDdaFw0zNTAxMTMxMDIwNDdaMGkxCzAJBgNVBAYTAkRFMRAwDgYDVQQIEwdIYW1i +dXJnMRcwFQYDVQQKEw5PcGVuT2ZmaWNlLm9yZzEUMBIGA1UECxMLRGV2ZWxvcG1l +bnQxGTAXBgNVBAMTEGVxdWFsIENOPVVzZXIgMjgwgZ8wDQYJKoZIhvcNAQEBBQAD +gY0AMIGJAoGBAK7fEmSr2S/uIWS1CMXIj6GtDrkokWl0E6WqSf76Ap032wo7Jmog +JT35LbI7OcjG46eqoQuyG1hD5jw/Z/67vZu12d7p7Xar/fXIFbL7pj8j759fcUOz +vlUehV8TsWudQtcwqNKb/nF6x9Nges/ig3WDuBzT7+6UPxRjqnwVTkIdAgMBAAGj +eDB2MAsGA1UdDwQEAwIF4DAdBgNVHQ4EFgQUOy0rXy7mMiOuR7cwJcvtsG0MMOQw +HwYDVR0jBBgwFoAU6Gq7wpDqbHAiPvb2SBsD5r63plUwJwYDVR0RBCAwHqQcMBox +GDAWBgNVBAMTD1VzZXIgMjggUm9vdCAxMTANBgkqhkiG9w0BAQUFAAOBgQBbz96S ++Kw5+wqBcFsX0A0NhV4ufb7RGq0dmaSm8EhaewQ54pP/gIT2oeaKUhJVRsBXhNnD +E5Jh10GvOQlXBSUBkGh8fFyFxvL+DjfjWGj5MvxBLDU29M/qVS1SfPs3MjXPguv8 +8TnxUfHhW9ZY4X/UUM7PB/Ll9eLd/lU/ZAeQTw== +-----END CERTIFICATE----- diff --git a/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/101E.pem b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/101E.pem new file mode 100755 index 000000000000..f12a0c1c0d9d --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/101E.pem @@ -0,0 +1,60 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 4126 (0x101e) + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 11 + Validity + Not Before: Jan 19 10:22:13 2010 GMT + Not After : Jan 13 10:22:13 2035 GMT + Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=User 29+OU=ooo + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public Key: (1024 bit) + Modulus (1024 bit): + 00:ae:12:dc:26:fe:7f:b8:3f:47:a2:dc:83:a1:70: + 6d:ab:db:e5:3c:28:d5:18:32:2c:8d:ee:85:c6:f9: + f4:8b:31:34:71:de:91:79:fb:56:b4:9c:af:3e:b1: + c6:de:06:3f:32:fc:45:9d:9b:dd:15:0f:b5:c3:98: + ab:8c:1e:3d:63:7c:2a:c5:b9:38:3d:50:6c:81:9e: + f0:b3:5b:41:1a:ec:15:b2:7f:2b:b4:d4:42:aa:ca: + e6:89:b0:c6:58:bd:2d:38:f3:4d:85:c3:08:d7:45: + 48:42:d7:fe:ee:7a:c0:22:41:c0:c6:cb:77:7c:22: + 43:07:35:dc:88:7c:49:3a:9b + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Key Usage: + Digital Signature, Non Repudiation, Key Encipherment + X509v3 Subject Key Identifier: + E0:19:7F:AC:F8:6A:42:7E:84:CA:8C:84:45:75:4E:9D:A1:D1:2A:72 + X509v3 Authority Key Identifier: + keyid:E8:6A:BB:C2:90:EA:6C:70:22:3E:F6:F6:48:1B:03:E6:BE:B7:A6:55 + + X509v3 Subject Alternative Name: + DirName:/CN=User 29 Root 11 + Signature Algorithm: sha1WithRSAEncryption + 85:c9:ea:82:e2:ac:f6:b3:15:51:11:bd:69:81:31:8f:ee:d3: + f9:f4:8e:d5:27:34:20:89:76:eb:8a:5b:02:69:9b:97:89:d7: + 6b:aa:03:7f:b5:40:f9:ac:54:ce:8f:30:fd:3e:78:72:91:96: + dc:a6:bd:64:42:f8:e4:18:1a:e3:b5:db:08:fe:1e:fc:3d:a2: + 55:21:ad:0f:1a:87:df:f2:65:87:4d:91:52:c1:46:c1:c0:7c: + cc:81:79:97:dc:2e:41:cc:ae:8c:8e:79:4e:02:49:7c:c5:b0: + 3e:8e:d9:f0:aa:6b:a6:2f:e7:d2:21:5b:7f:57:e8:f7:f6:00: + 3c:ad +-----BEGIN CERTIFICATE----- +MIICtjCCAh+gAwIBAgICEB4wDQYJKoZIhvcNAQEFBQAwYDELMAkGA1UEBhMCREUx +EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD +VQQLEwtEZXZlbG9wbWVudDEQMA4GA1UEAxMHUm9vdCAxMTAeFw0xMDAxMTkxMDIy +MTNaFw0zNTAxMTMxMDIyMTNaMGcxCzAJBgNVBAYTAkRFMRAwDgYDVQQIEwdIYW1i +dXJnMRcwFQYDVQQKEw5PcGVuT2ZmaWNlLm9yZzEUMBIGA1UECxMLRGV2ZWxvcG1l +bnQxFzAVBgNVBAMTDlVzZXIgMjkrT1U9b29vMIGfMA0GCSqGSIb3DQEBAQUAA4GN +ADCBiQKBgQCuEtwm/n+4P0ei3IOhcG2r2+U8KNUYMiyN7oXG+fSLMTRx3pF5+1a0 +nK8+scbeBj8y/EWdm90VD7XDmKuMHj1jfCrFuTg9UGyBnvCzW0Ea7BWyfyu01EKq +yuaJsMZYvS04802FwwjXRUhC1/7uesAiQcDGy3d8IkMHNdyIfEk6mwIDAQABo3gw +djALBgNVHQ8EBAMCBeAwHQYDVR0OBBYEFOAZf6z4akJ+hMqMhEV1Tp2h0SpyMB8G +A1UdIwQYMBaAFOhqu8KQ6mxwIj729kgbA+a+t6ZVMCcGA1UdEQQgMB6kHDAaMRgw +FgYDVQQDEw9Vc2VyIDI5IFJvb3QgMTEwDQYJKoZIhvcNAQEFBQADgYEAhcnqguKs +9rMVURG9aYExj+7T+fSO1Sc0IIl264pbAmmbl4nXa6oDf7VA+axUzo8w/T54cpGW +3Ka9ZEL45Bga47XbCP4e/D2iVSGtDxqH3/Jlh02RUsFGwcB8zIF5l9wuQcyujI55 +TgJJfMWwPo7Z8Kprpi/n0iFbf1fo9/YAPK0= +-----END CERTIFICATE----- diff --git a/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/101F.pem b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/101F.pem new file mode 100755 index 000000000000..1393b9ed3ed3 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/101F.pem @@ -0,0 +1,60 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 4127 (0x101f) + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 11 + Validity + Not Before: Jan 19 10:26:01 2010 GMT + Not After : Jan 13 10:26:01 2035 GMT + Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=\x00U\x00s\x00e\x00r\x00 \x003\x000\x00<\x00 \x00>\x00#\x00;\x00 \x00"\x00+\x00" + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public Key: (1024 bit) + Modulus (1024 bit): + 00:cf:40:99:4d:a5:5d:73:2a:78:72:9c:32:94:15: + 1e:01:40:b4:68:8f:b8:4e:38:aa:b9:82:96:5a:5c: + 03:d5:db:09:42:46:d8:2d:f0:da:f8:1a:f0:85:10: + f2:cb:1f:be:50:b7:ae:6f:22:80:f2:bf:14:73:84: + da:30:b9:54:26:0d:72:1c:55:99:50:c6:78:a3:37: + 15:b2:9c:03:22:dc:ea:8b:f5:07:32:f3:d9:76:64: + 92:a3:4f:73:12:e2:43:79:0e:e6:44:17:99:79:49: + 73:65:da:03:3d:be:db:e3:4f:ae:6c:d0:6c:e6:4a: + d3:83:45:5d:83:18:d5:cc:29 + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Key Usage: + Digital Signature, Non Repudiation, Key Encipherment + X509v3 Subject Key Identifier: + D9:EA:10:1D:D3:F5:30:AD:30:0E:80:73:14:22:1A:26:35:90:DC:67 + X509v3 Authority Key Identifier: + keyid:E8:6A:BB:C2:90:EA:6C:70:22:3E:F6:F6:48:1B:03:E6:BE:B7:A6:55 + + X509v3 Subject Alternative Name: + DirName:/CN=User 30 Root 11 + Signature Algorithm: sha1WithRSAEncryption + 42:3a:02:d5:7b:23:9f:cc:5b:b8:d4:c8:e8:0c:e3:0d:8a:17: + 65:b6:87:ce:c9:dc:f7:84:95:e0:17:ea:11:8b:15:30:e1:a2: + 42:6c:4e:f0:31:fa:fd:ff:03:37:d4:ec:4c:1d:29:8d:07:8a: + c8:de:0b:d6:df:d7:2e:12:8a:00:a0:ca:be:48:af:17:36:63: + 8e:f2:cf:80:8b:a1:e2:33:ef:42:db:91:d3:8e:4b:02:55:5e: + f7:79:11:5c:6d:ef:64:8b:53:a6:af:f5:0f:e2:75:7a:d6:85: + f6:60:d5:7e:d6:8c:0e:37:84:a9:50:2b:c7:e6:63:bf:1d:14: + aa:bf +-----BEGIN CERTIFICATE----- +MIICyDCCAjGgAwIBAgICEB8wDQYJKoZIhvcNAQEFBQAwYDELMAkGA1UEBhMCREUx +EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD +VQQLEwtEZXZlbG9wbWVudDEQMA4GA1UEAxMHUm9vdCAxMTAeFw0xMDAxMTkxMDI2 +MDFaFw0zNTAxMTMxMDI2MDFaMHkxCzAJBgNVBAYTAkRFMRAwDgYDVQQIEwdIYW1i +dXJnMRcwFQYDVQQKEw5PcGVuT2ZmaWNlLm9yZzEUMBIGA1UECxMLRGV2ZWxvcG1l +bnQxKTAnBgNVBAMeIABVAHMAZQByACAAMwAwADwAIAA+ACMAOwAgACIAKwAiMIGf +MA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDPQJlNpV1zKnhynDKUFR4BQLRoj7hO +OKq5gpZaXAPV2wlCRtgt8Nr4GvCFEPLLH75Qt65vIoDyvxRzhNowuVQmDXIcVZlQ +xnijNxWynAMi3OqL9Qcy89l2ZJKjT3MS4kN5DuZEF5l5SXNl2gM9vtvjT65s0Gzm +StODRV2DGNXMKQIDAQABo3gwdjALBgNVHQ8EBAMCBeAwHQYDVR0OBBYEFNnqEB3T +9TCtMA6AcxQiGiY1kNxnMB8GA1UdIwQYMBaAFOhqu8KQ6mxwIj729kgbA+a+t6ZV +MCcGA1UdEQQgMB6kHDAaMRgwFgYDVQQDEw9Vc2VyIDMwIFJvb3QgMTEwDQYJKoZI +hvcNAQEFBQADgYEAQjoC1Xsjn8xbuNTI6AzjDYoXZbaHzsnc94SV4BfqEYsVMOGi +QmxO8DH6/f8DN9TsTB0pjQeKyN4L1t/XLhKKAKDKvkivFzZjjvLPgIuh4jPvQtuR +045LAlVe93kRXG3vZItTpq/1D+J1etaF9mDVftaMDjeEqVArx+Zjvx0Uqr8= +-----END CERTIFICATE----- diff --git a/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1020.pem b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1020.pem new file mode 100755 index 000000000000..40e90d4cbea9 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1020.pem @@ -0,0 +1,61 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 4128 (0x1020) + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 11 + Validity + Not Before: Jan 19 10:28:47 2010 GMT + Not After : Jan 13 10:28:47 2035 GMT + Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=\x00U\x00s\x00e\x00r\x00 \x003\x001\x00 \x00\\x00"\x00a\x00,\x00b\x00"\x00+\x00C\x00N\x00=\x00U\x00S\x00,\x00 \x00>\x00 \x00\\x00\\x00d\x00e\x00 \x00< + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public Key: (1024 bit) + Modulus (1024 bit): + 00:ac:02:18:e0:1c:54:bb:76:97:2e:d3:67:78:b7: + 14:78:46:83:7c:e9:5c:2b:2f:25:bb:bf:90:c0:52: + ea:2c:79:d6:9d:af:b5:f8:86:a2:bf:56:9b:0f:33: + ed:ef:d2:2c:57:c6:0a:25:b3:f7:9b:a1:7a:3b:75: + 0b:18:86:23:64:2a:23:b0:60:f1:d8:05:b4:a6:7b: + 77:21:30:b4:0d:f1:af:e1:fb:d6:88:a8:5b:5d:7e: + a2:bf:ce:20:f6:c0:7a:89:f2:0f:33:47:6d:49:0f: + 3d:59:27:f9:95:c0:3b:a3:1c:18:a1:2d:95:09:e8: + d2:95:ac:10:92:fc:db:84:e3 + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Key Usage: + Digital Signature, Non Repudiation, Key Encipherment + X509v3 Subject Key Identifier: + F8:BA:7E:78:BC:70:33:D3:45:68:37:59:3A:06:AC:65:B1:15:74:F0 + X509v3 Authority Key Identifier: + keyid:E8:6A:BB:C2:90:EA:6C:70:22:3E:F6:F6:48:1B:03:E6:BE:B7:A6:55 + + X509v3 Subject Alternative Name: + DirName:/CN=User 31 Root 11 + Signature Algorithm: sha1WithRSAEncryption + 0f:a8:53:f0:56:76:df:a8:b3:5b:d1:e8:98:62:8f:a6:13:96: + c3:6b:ca:3f:e1:09:37:54:6f:ac:15:4b:74:0c:6c:3f:fe:de: + 36:58:a2:9d:a0:1f:18:97:2c:1d:bc:c6:df:ee:aa:5b:d3:da: + 2f:51:02:7a:ba:a9:7e:4d:cf:47:16:0b:f1:b1:e1:28:2b:fe: + a4:9d:50:96:cd:c5:45:09:35:50:93:9b:97:a9:23:2a:5e:f0: + 2e:16:18:3f:50:7a:83:59:c5:6c:79:99:d3:ea:12:ef:15:a9: + b0:93:1e:4b:26:6c:63:13:7f:d3:5a:0c:4d:0b:f4:51:21:98: + 4f:81 +-----BEGIN CERTIFICATE----- +MIIC5TCCAk6gAwIBAgICECAwDQYJKoZIhvcNAQEFBQAwYDELMAkGA1UEBhMCREUx +EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD +VQQLEwtEZXZlbG9wbWVudDEQMA4GA1UEAxMHUm9vdCAxMTAeFw0xMDAxMTkxMDI4 +NDdaFw0zNTAxMTMxMDI4NDdaMIGVMQswCQYDVQQGEwJERTEQMA4GA1UECBMHSGFt +YnVyZzEXMBUGA1UEChMOT3Blbk9mZmljZS5vcmcxFDASBgNVBAsTC0RldmVsb3Bt +ZW50MUUwQwYDVQQDHjwAVQBzAGUAcgAgADMAMQAgAFwAIgBhACwAYgAiACsAQwBO +AD0AVQBTACwAIAA+ACAAXABcAGQAZQAgADwwgZ8wDQYJKoZIhvcNAQEBBQADgY0A +MIGJAoGBAKwCGOAcVLt2ly7TZ3i3FHhGg3zpXCsvJbu/kMBS6ix51p2vtfiGor9W +mw8z7e/SLFfGCiWz95uhejt1CxiGI2QqI7Bg8dgFtKZ7dyEwtA3xr+H71oioW11+ +or/OIPbAeonyDzNHbUkPPVkn+ZXAO6McGKEtlQno0pWsEJL824TjAgMBAAGjeDB2 +MAsGA1UdDwQEAwIF4DAdBgNVHQ4EFgQU+Lp+eLxwM9NFaDdZOgasZbEVdPAwHwYD +VR0jBBgwFoAU6Gq7wpDqbHAiPvb2SBsD5r63plUwJwYDVR0RBCAwHqQcMBoxGDAW +BgNVBAMTD1VzZXIgMzEgUm9vdCAxMTANBgkqhkiG9w0BAQUFAAOBgQAPqFPwVnbf +qLNb0eiYYo+mE5bDa8o/4Qk3VG+sFUt0DGw//t42WKKdoB8YlywdvMbf7qpb09ov +UQJ6uql+Tc9HFgvxseEoK/6knVCWzcVFCTVQk5uXqSMqXvAuFhg/UHqDWcVseZnT +6hLvFamwkx5LJmxjE3/TWgxNC/RRIZhPgQ== +-----END CERTIFICATE----- diff --git a/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1021.pem b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1021.pem new file mode 100755 index 000000000000..443c07462820 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_11/demoCA/newcerts/1021.pem @@ -0,0 +1,61 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 4129 (0x1021) + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 11 + Validity + Not Before: Jan 19 10:40:59 2010 GMT + Not After : Jan 13 10:40:59 2035 GMT + Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=\x00U\x00s\x00e\x00r\x00 \x001\x004\x00 \x00"\x00,\x00m\x00i\x00d\x00d\x00l\x00e\x00 \x00q\x00u\x00o\x00t\x00e + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public Key: (1024 bit) + Modulus (1024 bit): + 00:da:7a:30:0d:63:da:74:05:ef:3e:d2:f4:2b:1b: + 50:e3:64:67:98:7d:2f:83:e7:77:7b:b8:72:9b:c8: + 9e:65:de:cc:2a:7b:76:c2:08:05:7a:ce:88:3e:ed: + b5:75:89:36:d2:4a:bb:3b:66:ac:57:2b:15:99:c9: + d4:74:ca:f5:eb:ff:80:b7:9f:6b:48:2f:3b:a7:51: + c4:12:af:96:ca:ac:b9:ea:23:fd:93:f7:7d:5b:d1: + ab:7c:24:1e:fe:48:dc:33:de:45:d6:8c:86:5a:b9: + 56:3c:e4:a9:f1:8c:d7:41:01:da:04:2a:7d:06:c3: + 5b:a4:cc:5f:6c:ef:7c:4e:ef + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Key Usage: + Digital Signature, Non Repudiation, Key Encipherment + X509v3 Subject Key Identifier: + 49:E2:AE:12:D7:EF:C3:B5:02:65:DD:CF:B2:62:E6:25:ED:3D:10:9C + X509v3 Authority Key Identifier: + keyid:E8:6A:BB:C2:90:EA:6C:70:22:3E:F6:F6:48:1B:03:E6:BE:B7:A6:55 + + X509v3 Subject Alternative Name: + DirName:/CN=User 14 Root 11 + Signature Algorithm: sha1WithRSAEncryption + 8b:ca:d2:93:cb:d1:cc:a9:67:a3:be:75:cf:ca:cd:22:78:cc: + 7c:f9:f1:2c:94:2c:60:bd:0f:18:16:26:fe:de:0d:19:5a:87: + de:34:8c:1f:eb:89:37:74:63:d4:d9:cd:59:35:06:24:a5:6f: + f2:c6:69:f4:b5:37:6d:ae:8b:d3:5d:5e:43:8f:36:7d:f8:0c: + 30:3f:74:3d:e2:85:89:75:58:36:0f:df:72:17:47:22:c6:fd: + 47:e3:d6:73:d1:40:89:e8:9a:ba:53:14:5c:3a:de:a9:85:a8: + 8f:b0:27:81:4d:87:ef:bb:6b:bf:8c:8a:71:9b:94:1d:30:d5: + 12:ed +-----BEGIN CERTIFICATE----- +MIIC1TCCAj6gAwIBAgICECEwDQYJKoZIhvcNAQEFBQAwYDELMAkGA1UEBhMCREUx +EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD +VQQLEwtEZXZlbG9wbWVudDEQMA4GA1UEAxMHUm9vdCAxMTAeFw0xMDAxMTkxMDQw +NTlaFw0zNTAxMTMxMDQwNTlaMIGFMQswCQYDVQQGEwJERTEQMA4GA1UECBMHSGFt +YnVyZzEXMBUGA1UEChMOT3Blbk9mZmljZS5vcmcxFDASBgNVBAsTC0RldmVsb3Bt +ZW50MTUwMwYDVQQDHiwAVQBzAGUAcgAgADEANAAgACIALABtAGkAZABkAGwAZQAg +AHEAdQBvAHQAZTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA2nowDWPadAXv +PtL0KxtQ42RnmH0vg+d3e7hym8ieZd7MKnt2wggFes6IPu21dYk20kq7O2asVysV +mcnUdMr16/+At59rSC87p1HEEq+Wyqy56iP9k/d9W9GrfCQe/kjcM95F1oyGWrlW +POSp8YzXQQHaBCp9BsNbpMxfbO98Tu8CAwEAAaN4MHYwCwYDVR0PBAQDAgXgMB0G +A1UdDgQWBBRJ4q4S1+/DtQJl3c+yYuYl7T0QnDAfBgNVHSMEGDAWgBToarvCkOps +cCI+9vZIGwPmvremVTAnBgNVHREEIDAepBwwGjEYMBYGA1UEAxMPVXNlciAxNCBS +b290IDExMA0GCSqGSIb3DQEBBQUAA4GBAIvK0pPL0cypZ6O+dc/KzSJ4zHz58SyU +LGC9DxgWJv7eDRlah940jB/riTd0Y9TZzVk1BiSlb/LGafS1N22ui9NdXkOPNn34 +DDA/dD3ihYl1WDYP33IXRyLG/Ufj1nPRQInomrpTFFw63qmFqI+wJ4FNh++7a7+M +inGblB0w1RLt +-----END CERTIFICATE----- diff --git a/xmlsecurity/test_docs/CAs/Root_11/demoCA/private/cakey.pem b/xmlsecurity/test_docs/CAs/Root_11/demoCA/private/cakey.pem new file mode 100755 index 000000000000..fb0dd164efc2 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_11/demoCA/private/cakey.pem @@ -0,0 +1,18 @@ +-----BEGIN RSA PRIVATE KEY----- +Proc-Type: 4,ENCRYPTED +DEK-Info: DES-EDE3-CBC,F268674FF1377D42 + +kJQy9qJMCqZyDVs3+ZKQnh22enecltKSYzd0S1dIN1chgQ0RzLEiWBHmHCVP/yB0 +YoKrQ07FUR/uSLqTbyhAl+KDVcNvqrj/NeWs0n8zqN0ZF6wQtxtDrWFWmHNAvQXU +2kO1CvjYiruapgwmVDDJV1qf25byenQv9LMyQMD6EPU1XqFeamklidALdkb7DylA +WL6EIg4vhh96ZaG6PwLcB9rho0QRrXrLS6SHiklNBN5fHUWOfDyhXJ7K4HvzH1SS +/EtqgyKKxH5irTRdoJg2OaDBAahyW93CneEnFdufDgzvCdrsg79Z2GFz7TDJEfW4 +rnoqoXTdei1Ah+t1BC4uXXAU8DR0xusnJi0qJDJ7ETRBhROlNhTRF8TAHll+5dIf +9772GwVT+hADZn1qJgmhPiN4f8Fx33k5NOcwb0X/0Z1mzULrwm1P6lng0DsusDo0 +dr/wFyRjWZEWhMcL/sIO1BwVTBPcE8CACnXutehs44DBWd91EQ4+PWNq7oPtHFw8 +09d30h4aJJZF/SGRi+f/czFyZF4WS2Q+UWmNNKJX8wCGQqzUb02kVwMEWHiNFiEo +V8xI3JXVmKHDWlgdoIz9kVe//3AfY5y+52cYLdqaNW8IsgWZC8SC9Lk9j5uaNZ/I +leNppt4ID7mfYPqjEXEKleC+1ncwFwdVl/zaa/fM78sWqDYrLZC47DToLfoQ9Gez +3dj3554iHTe61Jd7JsK85pYsrIHAeYppOpqzLyQmCu3twBl3uGD7KXxvdZRt8foE +Vrg/QSIB4E6gfSBP0UrXzsnga8tjVyqRW2vAvt0uLn945ducapf9oQ== +-----END RSA PRIVATE KEY----- diff --git a/xmlsecurity/test_docs/CAs/Root_11/demoCA/serial b/xmlsecurity/test_docs/CAs/Root_11/demoCA/serial new file mode 100755 index 000000000000..c7781419a38b --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_11/demoCA/serial @@ -0,0 +1 @@ +1022 diff --git a/xmlsecurity/test_docs/CAs/Root_11/openssl.cfg b/xmlsecurity/test_docs/CAs/Root_11/openssl.cfg new file mode 100755 index 000000000000..8bf98da50e74 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_11/openssl.cfg @@ -0,0 +1,295 @@ +# +# OpenSSL example configuration file. +# This is mostly being used for generation of certificate requests. +# + +# This definition stops the following lines choking if HOME isn't +# defined. +HOME = . +RANDFILE = $ENV::HOME/.rnd + +# Extra OBJECT IDENTIFIER info: +#oid_file = $ENV::HOME/.oid +oid_section = new_oids + +# To use this configuration file with the "-extfile" option of the +# "openssl x509" utility, name here the section containing the +# X.509v3 extensions to use: +# extensions = +# (Alternatively, use a configuration file that has only +# X.509v3 extensions in its main [= default] section.) + +[ new_oids ] + +# We can add new OIDs in here for use by 'ca' and 'req'. +# Add a simple OID like this: +# testoid1=1.2.3.4 +# Or use config file substitution like this: +# testoid2=${testoid1}.5.6 + +#################################################################### +[ ca ] +default_ca = CA_default # The default ca section + +#################################################################### +[ CA_default ] + +dir = ./demoCA # Where everything is kept +certs = $dir/certs # Where the issued certs are kept +crl_dir = $dir/crl # Where the issued crl are kept +database = $dir/index.txt # database index file. +#unique_subject = no # Set to 'no' to allow creation of + # several ctificates with same subject. +new_certs_dir = $dir/newcerts # default place for new certs. + +certificate = $dir/cacert.pem # The CA certificate +serial = $dir/serial # The current serial number +crlnumber = $dir/crlnumber # the current crl number + # must be commented out to leave a V1 CRL +crl = $dir/crl.pem # The current CRL +private_key = $dir/private/cakey.pem # The private key +RANDFILE = $dir/private/.rand # private random number file + +x509_extensions = usr_cert # The extentions to add to the cert + +# Comment out the following two lines for the "traditional" +# (and highly broken) format. +name_opt = ca_default # Subject Name options +cert_opt = ca_default # Certificate field options + +# Extension copying option: use with caution. +# copy_extensions = copy + +# Extensions to add to a CRL. Note: Netscape communicator chokes on V2 CRLs +# so this is commented out by default to leave a V1 CRL. +# crlnumber must also be commented out to leave a V1 CRL. +# crl_extensions = crl_ext + +default_days = 365 # how long to certify for +default_crl_days= 30 # how long before next CRL +default_md = sha1 # which md to use. +preserve = no # keep passed DN ordering + +# A few difference way of specifying how similar the request should look +# For type CA, the listed attributes must be the same, and the optional +# and supplied fields are just that :-) +policy = policy_match + +# For the CA policy +[ policy_match ] +countryName = match +stateOrProvinceName = match +organizationName = match +organizationalUnitName = optional +commonName = supplied +emailAddress = optional + +# For the 'anything' policy +# At this point in time, you must list all acceptable 'object' +# types. +[ policy_anything ] +countryName = optional +stateOrProvinceName = optional +localityName = optional +organizationName = optional +organizationalUnitName = optional +commonName = supplied +emailAddress = optional + +#################################################################### +[ req ] +default_bits = 1024 +default_keyfile = privkey.pem +distinguished_name = req_distinguished_name +attributes = req_attributes +x509_extensions = v3_ca # The extentions to add to the self signed cert +utf8 = yes +# Passwords for private keys if not present they will be prompted for +# input_password = secret +# output_password = secret + +# This sets a mask for permitted string types. There are several options. +# default: PrintableString, T61String, BMPString. +# pkix : PrintableString, BMPString. +# utf8only: only UTF8Strings. +# nombstr : PrintableString, T61String (no BMPStrings or UTF8Strings). +# MASK:XXXX a literal mask value. +# WARNING: current versions of Netscape crash on BMPStrings or UTF8Strings +# so use this option with caution! +string_mask =pkix + +# req_extensions = v3_req # The extensions to add to a certificate request + +[ req_distinguished_name ] +countryName = Country Name (2 letter code) +countryName_default = DE +countryName_min = 2 +countryName_max = 2 + +stateOrProvinceName = State or Province Name (full name) +stateOrProvinceName_default = Hamburg + +localityName = Locality Name (eg, city) + +0.organizationName = Organization Name (eg, company) +0.organizationName_default = OpenOffice.org + +# we can do this but it is not needed normally :-) +#1.organizationName = Second Organization Name (eg, company) +#1.organizationName_default = World Wide Web Pty Ltd + +organizationalUnitName = Organizational Unit Name (eg, section) +organizationalUnitName_default = Development + +commonName = Common Name (eg, YOUR name) +commonName_max = 64 +commonName_default =User 14 \",middle quote + +emailAddress = Email Address +emailAddress_max = 64 + +# SET-ex3 = SET extension number 3 + +[ req_attributes ] +challengePassword = A challenge password +challengePassword_min = 4 +challengePassword_max = 20 + +unstructuredName = An optional company name + +[ usr_cert ] + +# These extensions are added when 'ca' signs a request. +#authorityInfoAccess = OCSP;URI:http://localhost:8888/ + +# This is typical in keyUsage for a client certificate. +keyUsage = nonRepudiation, digitalSignature, keyEncipherment + +# This will be displayed in Netscape's comment listbox. +#nsComment = "OpenSSL Generated Certificate" + +# PKIX recommendations harmless if included in all certificates. +subjectKeyIdentifier=hash +authorityKeyIdentifier=keyid,issuer + +# This stuff is for subjectAltName and issuerAltname. +# Import the email address. +# subjectAltName=email:copy +# An alternative to produce certificates that aren't +# deprecated according to PKIX. +# subjectAltName=email:move +subjectAltName=dirName:dn_subjectAlt +# Copy subject details +# issuerAltName=issuer:copy + + +[dn_subjectAlt] +CN=User 14 Root 11 + +[ v3_req ] + +# Extensions to add to a certificate request + +basicConstraints = CA:FALSE +keyUsage = nonRepudiation, digitalSignature, keyEncipherment +#authorityInfoAccess = OCSP;URI:http://localhost:8888/ + +[ v3_ca ] + + +# Extensions for a typical CA + + +# PKIX recommendation. + +subjectKeyIdentifier=hash + +authorityKeyIdentifier=keyid:always,issuer:always + +#authorityInfoAccess = OCSP;URI:http://localhost:8888 +#crlDistributionPoints=URI:http://localhost:8901/demoCA/crl/Root_7.crl +# This is what PKIX recommends but some broken software chokes on critical +# extensions. +#basicConstraints = critical,CA:true +# So we do this instead. +basicConstraints = critical, CA:true + +# Key usage: this is typical for a CA certificate. However since it will +# prevent it being used as an test self-signed certificate it is best +# left out by default. +# keyUsage = cRLSign, keyCertSign + +# Some might want this also +# nsCertType = sslCA, emailCA + +# Include email address in subject alt name: another PKIX recommendation +# subjectAltName=email:copy +# Copy issuer details +# issuerAltName=issuer:copy + +# DER hex encoding of an extension: beware experts only! +# obj=DER:02:03 +# Where 'obj' is a standard or added object +# You can even override a supported extension: +# basicConstraints= critical, DER:30:03:01:01:FF + +[ crl_ext ] + +# CRL extensions. +# Only issuerAltName and authorityKeyIdentifier make any sense in a CRL. + +# issuerAltName=issuer:copy +authorityKeyIdentifier=keyid:always,issuer:always + +[ proxy_cert_ext ] +# These extensions should be added when creating a proxy certificate + +# This goes against PKIX guidelines but some CAs do it and some software +# requires this to avoid interpreting an end user certificate as a CA. + +basicConstraints=CA:FALSE + +# Here are some examples of the usage of nsCertType. If it is omitted +# the certificate can be used for anything *except* object signing. + +# This is OK for an SSL server. +# nsCertType = server + +# For an object signing certificate this would be used. +# nsCertType = objsign + +# For normal client use this is typical +# nsCertType = client, email + +# and for everything including object signing: +# nsCertType = client, email, objsign + +# This is typical in keyUsage for a client certificate. +# keyUsage = nonRepudiation, digitalSignature, keyEncipherment + +# This will be displayed in Netscape's comment listbox. +nsComment = "OpenSSL Generated Certificate" + +# PKIX recommendations harmless if included in all certificates. +subjectKeyIdentifier=hash +authorityKeyIdentifier=keyid,issuer:always + +# This stuff is for subjectAltName and issuerAltname. +# Import the email address. +# subjectAltName=email:copy +# An alternative to produce certificates that aren't +# deprecated according to PKIX. +# subjectAltName=email:move + +# Copy subject details +# issuerAltName=issuer:copy + +#nsCaRevocationUrl = http://www.domain.dom/ca-crl.pem +#nsBaseUrl +#nsRevocationUrl +#nsRenewalUrl +#nsCaPolicyUrl +#nsSslServerName + +# This really needs to be in place for it to be a proxy certificate. +proxyCertInfo=critical,language:id-ppl-anyLanguage,pathlen:3,policy:foo diff --git a/xmlsecurity/test_docs/CAs/Root_2/demoCA/cacert.pem b/xmlsecurity/test_docs/CAs/Root_2/demoCA/cacert.pem new file mode 100755 index 000000000000..e64badeef6c7 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_2/demoCA/cacert.pem @@ -0,0 +1,19 @@ +-----BEGIN CERTIFICATE----- +MIIDBDCCAm2gAwIBAgIJAKKvFYnsc1SGMA0GCSqGSIb3DQEBBQUAMF8xCzAJBgNV +BAYTAkRFMRAwDgYDVQQIEwdIYW1idXJnMRcwFQYDVQQKEw5PcGVuT2ZmaWNlLm9y +ZzEUMBIGA1UECxMLRGV2ZWxvcG1lbnQxDzANBgNVBAMTBlJvb3QgMjAeFw0wOTEx +MTgxNTQ2NTJaFw0zNDExMTIxNTQ2NTJaMF8xCzAJBgNVBAYTAkRFMRAwDgYDVQQI +EwdIYW1idXJnMRcwFQYDVQQKEw5PcGVuT2ZmaWNlLm9yZzEUMBIGA1UECxMLRGV2 +ZWxvcG1lbnQxDzANBgNVBAMTBlJvb3QgMjCBnzANBgkqhkiG9w0BAQEFAAOBjQAw +gYkCgYEAsJSDLnSsoNY1U8hS0g5cmu7ihp+nvDvx8C75Wav80KumG9gcS3icmSOm +vPVqUmJq5o9CKM8z4vJR7D3e+Wf7S7XHMdL0uXuQi+QQCB1aMAWMxo7xnoWAXZrS +LG1BWUjD9sdKCHuQfFQv9ke3cA2dGZFSMsUD73JYoo0RD72ftFkCAwEAAaOBxzCB +xDAdBgNVHQ4EFgQUX7xM2usKDLUjQ14kMid5QfWCowIwgZEGA1UdIwSBiTCBhoAU +X7xM2usKDLUjQ14kMid5QfWCowKhY6RhMF8xCzAJBgNVBAYTAkRFMRAwDgYDVQQI +EwdIYW1idXJnMRcwFQYDVQQKEw5PcGVuT2ZmaWNlLm9yZzEUMBIGA1UECxMLRGV2 +ZWxvcG1lbnQxDzANBgNVBAMTBlJvb3QgMoIJAKKvFYnsc1SGMA8GA1UdEwEB/wQF +MAMBAf8wDQYJKoZIhvcNAQEFBQADgYEAqfEPhXASt24n8P9mDKisEn2EIYmJKLaY +AVwXLPXUOiMlqrfPRKpseQII4WmDCRxMa6bKCwf4pKUWIpTpDhRZCUespaLz1AcU +ntv+HTXq1ECK+akK33fsh5qMvokfzZM+Q0zCiFV/c2aTTGSM5mV3/q810RUlNQY3 +1y+AN+6fRqE= +-----END CERTIFICATE----- diff --git a/xmlsecurity/test_docs/CAs/Root_2/demoCA/crl/DO_NOT_CREATE_A_CRL b/xmlsecurity/test_docs/CAs/Root_2/demoCA/crl/DO_NOT_CREATE_A_CRL new file mode 100755 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_2/demoCA/crl/DO_NOT_CREATE_A_CRL diff --git a/xmlsecurity/test_docs/CAs/Root_2/demoCA/crlnumber b/xmlsecurity/test_docs/CAs/Root_2/demoCA/crlnumber new file mode 100755 index 000000000000..83b33d238dab --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_2/demoCA/crlnumber @@ -0,0 +1 @@ +1000 diff --git a/xmlsecurity/test_docs/CAs/Root_2/demoCA/index.txt b/xmlsecurity/test_docs/CAs/Root_2/demoCA/index.txt new file mode 100755 index 000000000000..3e79e22d7cf1 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_2/demoCA/index.txt @@ -0,0 +1 @@ +V 341112155538Z 1000 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=Sub CA 1 Root 2 diff --git a/xmlsecurity/test_docs/CAs/Root_2/demoCA/index.txt.attr b/xmlsecurity/test_docs/CAs/Root_2/demoCA/index.txt.attr new file mode 100755 index 000000000000..8f7e63a3475c --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_2/demoCA/index.txt.attr @@ -0,0 +1 @@ +unique_subject = yes diff --git a/xmlsecurity/test_docs/CAs/Root_2/demoCA/newcerts/1000.pem b/xmlsecurity/test_docs/CAs/Root_2/demoCA/newcerts/1000.pem new file mode 100755 index 000000000000..36a8eb3c0709 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_2/demoCA/newcerts/1000.pem @@ -0,0 +1,62 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 4096 (0x1000) + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 2 + Validity + Not Before: Nov 18 15:55:38 2009 GMT + Not After : Nov 12 15:55:38 2034 GMT + Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Sub CA 1 Root 2 + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public Key: (1024 bit) + Modulus (1024 bit): + 00:f0:7a:16:4c:ab:06:b2:af:27:9c:7d:3f:86:da: + de:7a:c3:01:67:77:56:49:09:ed:ed:31:72:83:e8: + 75:9c:4c:ce:f9:97:b6:63:3c:e2:ca:83:80:92:03: + 9c:96:e2:de:72:79:c1:cf:3e:3f:b9:0d:b4:87:c7: + 75:e6:56:8d:aa:f8:77:47:11:4e:fe:07:b0:1d:64: + 06:73:4b:6f:d4:ac:da:0f:05:87:b1:f1:98:a9:f5: + 8a:a1:a8:ed:17:9c:26:b8:da:92:63:d2:53:87:e6: + fc:ed:44:de:94:56:90:3e:a2:a1:67:08:cb:38:d4: + cf:17:3b:7e:ff:7a:97:c0:7b + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Subject Key Identifier: + 8C:F3:2C:30:A2:E8:62:50:70:BC:FC:71:A0:41:FA:E0:58:B4:4D:B8 + X509v3 Authority Key Identifier: + keyid:5F:BC:4C:DA:EB:0A:0C:B5:23:43:5E:24:32:27:79:41:F5:82:A3:02 + DirName:/C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=Root 2 + serial:A2:AF:15:89:EC:73:54:86 + + X509v3 Basic Constraints: critical + CA:TRUE + Signature Algorithm: sha1WithRSAEncryption + 52:83:16:ab:0e:43:2d:b3:e4:0f:6c:c1:63:d4:86:ac:e7:1e: + ee:7b:ee:9b:0c:ff:4f:e0:59:d5:e4:27:af:68:bf:a7:f5:2a: + a3:c9:e3:2b:8d:b7:31:26:f6:04:80:4e:f2:a5:bf:da:63:5e: + 8c:d6:c6:b2:46:a0:46:10:2f:84:9f:02:76:f3:c8:33:05:62: + 0c:5f:2d:cc:06:23:53:9f:d9:f8:46:e4:2e:5c:da:05:fc:bf: + db:45:b4:ac:8d:8b:b5:4b:60:7b:7b:26:34:7f:b1:4b:41:96: + 41:26:70:7a:9d:78:a2:9b:e0:de:62:a2:04:86:9f:ed:7c:a6: + 20:eb +-----BEGIN CERTIFICATE----- +MIIDBjCCAm+gAwIBAgICEAAwDQYJKoZIhvcNAQEFBQAwXzELMAkGA1UEBhMCREUx +EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD +VQQLEwtEZXZlbG9wbWVudDEPMA0GA1UEAxMGUm9vdCAyMB4XDTA5MTExODE1NTUz +OFoXDTM0MTExMjE1NTUzOFowaDELMAkGA1UEBhMCREUxEDAOBgNVBAgTB0hhbWJ1 +cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtEZXZlbG9wbWVu +dDEYMBYGA1UEAxMPU3ViIENBIDEgUm9vdCAyMIGfMA0GCSqGSIb3DQEBAQUAA4GN +ADCBiQKBgQDwehZMqwayryecfT+G2t56wwFnd1ZJCe3tMXKD6HWcTM75l7ZjPOLK +g4CSA5yW4t5yecHPPj+5DbSHx3XmVo2q+HdHEU7+B7AdZAZzS2/UrNoPBYex8Zip +9YqhqO0XnCa42pJj0lOH5vztRN6UVpA+oqFnCMs41M8XO37/epfAewIDAQABo4HH +MIHEMB0GA1UdDgQWBBSM8ywwouhiUHC8/HGgQfrgWLRNuDCBkQYDVR0jBIGJMIGG +gBRfvEza6woMtSNDXiQyJ3lB9YKjAqFjpGEwXzELMAkGA1UEBhMCREUxEDAOBgNV +BAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtE +ZXZlbG9wbWVudDEPMA0GA1UEAxMGUm9vdCAyggkAoq8ViexzVIYwDwYDVR0TAQH/ +BAUwAwEB/zANBgkqhkiG9w0BAQUFAAOBgQBSgxarDkMts+QPbMFj1Ias5x7ue+6b +DP9P4FnV5CevaL+n9SqjyeMrjbcxJvYEgE7ypb/aY16M1sayRqBGEC+EnwJ288gz +BWIMXy3MBiNTn9n4RuQuXNoF/L/bRbSsjYu1S2B7eyY0f7FLQZZBJnB6nXiim+De +YqIEhp/tfKYg6w== +-----END CERTIFICATE----- diff --git a/xmlsecurity/test_docs/CAs/Root_2/demoCA/private/cakey.pem b/xmlsecurity/test_docs/CAs/Root_2/demoCA/private/cakey.pem new file mode 100755 index 000000000000..7ef7ef0a5e81 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_2/demoCA/private/cakey.pem @@ -0,0 +1,18 @@ +-----BEGIN RSA PRIVATE KEY----- +Proc-Type: 4,ENCRYPTED +DEK-Info: DES-EDE3-CBC,52B792B2B0E03BD6 + +GIFY+N2q5LMcrtTplZUToF0/nuplr7ASLAe7lEcDLTTHeBTO+w4ScB62Dl6veeEU +3/pPevG+V3HIA5ukywX334DuWjL3bFIsPg8a3NKKn0nTpmwqHqXZ53kbSMHIiu6v +MkvGeVLLxLhnCsqQ8HI2ccuxGSXLA0rqlnrZTOtvQpw9ohpCM3CX1GeekLc83bL/ +4HHmw8nNL+OCH4l9g3Y8XpN3ySRgl+lWmoKxl9s2Mn7jFoaqSXuuH3wIu9D2kJxS +qfVs/fo12j8RWXSIMpiCJFCOx1v+zzX7dJ0cyim83WF2OHsOW03UYnWzgk44iz4d +/WVWJuRU3gEwpN3CDdhzBZuYw9DmaG8HLHYT15CSdkQrfHeFM3Axcoju7b887JX7 +sOHU6h4ebMVhAswAXKGlTKOY2PO1GE9cKoa2jxnB2z8Dhe8rxzuvWyr5BfXrS3KT +lM6pjxZSoGMcmG7FtDgU/aAIn+DPR/rdB7tfZwP3GoVV+n3jRi8LU5I3wbi4z70o +bwXMb7zN13WHFszZgPX4tHD3jjyLwk7rFmMJ17L3K6eOAlGg8o+FBgoqYFQo05sY +2SElOibX8RIj9m9lerNLOxB5ty2VDUSaytJ0b1gPTXAdsaryq7tKFxIrNKpiJ1qk +snQSJyr2JwRqBLRwkXZV5CliWwZJGGJsC9I5fAMuuW6qkDhsSQ1fIJsGn/SbbiZj +lnZVY/33vHMltbwEgY4GuQWm29VYJwLWk925BY/nQ5fWPARYsap04JIwtperrZKj +XETzTrnTje6sVl32aCLdYlwsVbh04zRwUFharCz5vtDdVeHrfsBDKA== +-----END RSA PRIVATE KEY----- diff --git a/xmlsecurity/test_docs/CAs/Root_2/demoCA/serial b/xmlsecurity/test_docs/CAs/Root_2/demoCA/serial new file mode 100755 index 000000000000..dd11724042e2 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_2/demoCA/serial @@ -0,0 +1 @@ +1001 diff --git a/xmlsecurity/test_docs/CAs/Root_2/openssl.cfg b/xmlsecurity/test_docs/CAs/Root_2/openssl.cfg new file mode 100755 index 000000000000..bf73e3549d66 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_2/openssl.cfg @@ -0,0 +1,292 @@ +# +# OpenSSL example configuration file. +# This is mostly being used for generation of certificate requests. +# + +# This definition stops the following lines choking if HOME isn't +# defined. +HOME = . +RANDFILE = $ENV::HOME/.rnd + +# Extra OBJECT IDENTIFIER info: +#oid_file = $ENV::HOME/.oid +oid_section = new_oids + +# To use this configuration file with the "-extfile" option of the +# "openssl x509" utility, name here the section containing the +# X.509v3 extensions to use: +# extensions = +# (Alternatively, use a configuration file that has only +# X.509v3 extensions in its main [= default] section.) + +[ new_oids ] + +# We can add new OIDs in here for use by 'ca' and 'req'. +# Add a simple OID like this: +# testoid1=1.2.3.4 +# Or use config file substitution like this: +# testoid2=${testoid1}.5.6 + +#################################################################### +[ ca ] +default_ca = CA_default # The default ca section + +#################################################################### +[ CA_default ] + +dir = ./demoCA # Where everything is kept +certs = $dir/certs # Where the issued certs are kept +crl_dir = $dir/crl # Where the issued crl are kept +database = $dir/index.txt # database index file. +#unique_subject = no # Set to 'no' to allow creation of + # several ctificates with same subject. +new_certs_dir = $dir/newcerts # default place for new certs. + +certificate = $dir/cacert.pem # The CA certificate +serial = $dir/serial # The current serial number +crlnumber = $dir/crlnumber # the current crl number + # must be commented out to leave a V1 CRL +crl = $dir/crl.pem # The current CRL +private_key = $dir/private/cakey.pem # The private key +RANDFILE = $dir/private/.rand # private random number file + +x509_extensions = usr_cert # The extentions to add to the cert + +# Comment out the following two lines for the "traditional" +# (and highly broken) format. +name_opt = ca_default # Subject Name options +cert_opt = ca_default # Certificate field options + +# Extension copying option: use with caution. +# copy_extensions = copy + +# Extensions to add to a CRL. Note: Netscape communicator chokes on V2 CRLs +# so this is commented out by default to leave a V1 CRL. +# crlnumber must also be commented out to leave a V1 CRL. +# crl_extensions = crl_ext + +default_days = 365 # how long to certify for +default_crl_days= 30 # how long before next CRL +default_md = sha1 # which md to use. +preserve = no # keep passed DN ordering + +# A few difference way of specifying how similar the request should look +# For type CA, the listed attributes must be the same, and the optional +# and supplied fields are just that :-) +policy = policy_match + +# For the CA policy +[ policy_match ] +countryName = match +stateOrProvinceName = match +organizationName = match +organizationalUnitName = optional +commonName = supplied +emailAddress = optional + +# For the 'anything' policy +# At this point in time, you must list all acceptable 'object' +# types. +[ policy_anything ] +countryName = optional +stateOrProvinceName = optional +localityName = optional +organizationName = optional +organizationalUnitName = optional +commonName = supplied +emailAddress = optional + +#################################################################### +[ req ] +default_bits = 1024 +default_keyfile = privkey.pem +distinguished_name = req_distinguished_name +attributes = req_attributes +x509_extensions = v3_ca # The extentions to add to the self signed cert + +# Passwords for private keys if not present they will be prompted for +# input_password = secret +# output_password = secret + +# This sets a mask for permitted string types. There are several options. +# default: PrintableString, T61String, BMPString. +# pkix : PrintableString, BMPString. +# utf8only: only UTF8Strings. +# nombstr : PrintableString, T61String (no BMPStrings or UTF8Strings). +# MASK:XXXX a literal mask value. +# WARNING: current versions of Netscape crash on BMPStrings or UTF8Strings +# so use this option with caution! +string_mask = nombstr + +# req_extensions = v3_req # The extensions to add to a certificate request + +[ req_distinguished_name ] +countryName = Country Name (2 letter code) +countryName_default = DE +countryName_min = 2 +countryName_max = 2 + +stateOrProvinceName = State or Province Name (full name) +stateOrProvinceName_default = Hamburg + +localityName = Locality Name (eg, city) + +0.organizationName = Organization Name (eg, company) +0.organizationName_default = OpenOffice.org + +# we can do this but it is not needed normally :-) +#1.organizationName = Second Organization Name (eg, company) +#1.organizationName_default = World Wide Web Pty Ltd + +organizationalUnitName = Organizational Unit Name (eg, section) +organizationalUnitName_default = Development + +commonName = Common Name (eg, YOUR name) +commonName_max = 64 + +emailAddress = Email Address +emailAddress_max = 64 + +# SET-ex3 = SET extension number 3 + +[ req_attributes ] +challengePassword = A challenge password +challengePassword_min = 4 +challengePassword_max = 20 + +unstructuredName = An optional company name + +[ usr_cert ] + +# These extensions are added when 'ca' signs a request. +#authorityInfoAccess = OCSP;URI:http://localhost:8888/ + +# This is typical in keyUsage for a client certificate. +# keyUsage = nonRepudiation, digitalSignature, keyEncipherment + +# This will be displayed in Netscape's comment listbox. +nsComment = "OpenSSL Generated Certificate" + +# PKIX recommendations harmless if included in all certificates. +subjectKeyIdentifier=hash +authorityKeyIdentifier=keyid,issuer + +# This stuff is for subjectAltName and issuerAltname. +# Import the email address. +# subjectAltName=email:copy +# An alternative to produce certificates that aren't +# deprecated according to PKIX. +# subjectAltName=email:move + +# Copy subject details +# issuerAltName=issuer:copy + + + +[ v3_req ] + +# Extensions to add to a certificate request + +basicConstraints = CA:FALSE +keyUsage = nonRepudiation, digitalSignature, keyEncipherment +#authorityInfoAccess = OCSP;URI:http://localhost:8888/ + +[ v3_ca ] + + +# Extensions for a typical CA + + +# PKIX recommendation. + +subjectKeyIdentifier=hash + +authorityKeyIdentifier=keyid:always,issuer:always + +#authorityInfoAccess = OCSP;URI:http://localhost:8888 +#crlDistributionPoints=URI:http://localhost:8901/demoCA/crl/Test_CA_2009.2.crl +# This is what PKIX recommends but some broken software chokes on critical +# extensions. +#basicConstraints = critical,CA:true +# So we do this instead. +basicConstraints = critical, CA:true + +# Key usage: this is typical for a CA certificate. However since it will +# prevent it being used as an test self-signed certificate it is best +# left out by default. +# keyUsage = cRLSign, keyCertSign + +# Some might want this also +# nsCertType = sslCA, emailCA + +# Include email address in subject alt name: another PKIX recommendation +# subjectAltName=email:copy +# Copy issuer details +# issuerAltName=issuer:copy + +# DER hex encoding of an extension: beware experts only! +# obj=DER:02:03 +# Where 'obj' is a standard or added object +# You can even override a supported extension: +# basicConstraints= critical, DER:30:03:01:01:FF + +[ crl_ext ] + +# CRL extensions. +# Only issuerAltName and authorityKeyIdentifier make any sense in a CRL. + +# issuerAltName=issuer:copy +authorityKeyIdentifier=keyid:always,issuer:always + +[ proxy_cert_ext ] +# These extensions should be added when creating a proxy certificate + +# This goes against PKIX guidelines but some CAs do it and some software +# requires this to avoid interpreting an end user certificate as a CA. + +basicConstraints=CA:FALSE + +# Here are some examples of the usage of nsCertType. If it is omitted +# the certificate can be used for anything *except* object signing. + +# This is OK for an SSL server. +# nsCertType = server + +# For an object signing certificate this would be used. +# nsCertType = objsign + +# For normal client use this is typical +# nsCertType = client, email + +# and for everything including object signing: +# nsCertType = client, email, objsign + +# This is typical in keyUsage for a client certificate. +# keyUsage = nonRepudiation, digitalSignature, keyEncipherment + +# This will be displayed in Netscape's comment listbox. +nsComment = "OpenSSL Generated Certificate" + +# PKIX recommendations harmless if included in all certificates. +subjectKeyIdentifier=hash +authorityKeyIdentifier=keyid,issuer:always + +# This stuff is for subjectAltName and issuerAltname. +# Import the email address. +# subjectAltName=email:copy +# An alternative to produce certificates that aren't +# deprecated according to PKIX. +# subjectAltName=email:move + +# Copy subject details +# issuerAltName=issuer:copy + +#nsCaRevocationUrl = http://www.domain.dom/ca-crl.pem +#nsBaseUrl +#nsRevocationUrl +#nsRenewalUrl +#nsCaPolicyUrl +#nsSslServerName + +# This really needs to be in place for it to be a proxy certificate. +proxyCertInfo=critical,language:id-ppl-anyLanguage,pathlen:3,policy:foo diff --git a/xmlsecurity/test_docs/CAs/Root_3/demoCA/cacert.pem b/xmlsecurity/test_docs/CAs/Root_3/demoCA/cacert.pem new file mode 100755 index 000000000000..55be1552189e --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_3/demoCA/cacert.pem @@ -0,0 +1,19 @@ +-----BEGIN CERTIFICATE----- +MIIDBDCCAm2gAwIBAgIJAJVv8OMrvnb5MA0GCSqGSIb3DQEBBQUAMF8xCzAJBgNV +BAYTAkRFMRAwDgYDVQQIEwdIYW1idXJnMRcwFQYDVQQKEw5PcGVuT2ZmaWNlLm9y +ZzEUMBIGA1UECxMLRGV2ZWxvcG1lbnQxDzANBgNVBAMTBlJvb3QgMzAeFw0wOTEx +MjAwNzM2MTVaFw0zNDExMTQwNzM2MTVaMF8xCzAJBgNVBAYTAkRFMRAwDgYDVQQI +EwdIYW1idXJnMRcwFQYDVQQKEw5PcGVuT2ZmaWNlLm9yZzEUMBIGA1UECxMLRGV2 +ZWxvcG1lbnQxDzANBgNVBAMTBlJvb3QgMzCBnzANBgkqhkiG9w0BAQEFAAOBjQAw +gYkCgYEA3L6zaGhxFC+Mf55dzotmPKxdZndlxSVVOVI93JrxKVfn8mYOCZEjdb9Q +65vgLxGXMC9LCiF6SfT8dIfav1hUugmLaLzBesPu6h4kHN33/7Asj8BzY5I57uvF +sMLNL5hHFRRqtBqHvmO2G8zjHPluObnBzaQNCbdZxYODeh1GFpECAwEAAaOBxzCB +xDAdBgNVHQ4EFgQUaf8w7B80mmc6ayDS33/1BQTt+RwwgZEGA1UdIwSBiTCBhoAU +af8w7B80mmc6ayDS33/1BQTt+RyhY6RhMF8xCzAJBgNVBAYTAkRFMRAwDgYDVQQI +EwdIYW1idXJnMRcwFQYDVQQKEw5PcGVuT2ZmaWNlLm9yZzEUMBIGA1UECxMLRGV2 +ZWxvcG1lbnQxDzANBgNVBAMTBlJvb3QgM4IJAJVv8OMrvnb5MA8GA1UdEwEB/wQF +MAMBAf8wDQYJKoZIhvcNAQEFBQADgYEABPdAJer/8FoOAMWszhfz/BEjF97TTFs1 +KqSEiuymswG706weo9tcnP8u81AITQPSWZE1ALQN5L35Zvg6ubJsNM3+VSoQ6hZj +G9oWAJzFN7DhIqs3Xb13eBH/0yqAdTuFB5uLcJdR3GIXGFvcU/5FZBpYnORVqvg4 +irKv2VvyCR0= +-----END CERTIFICATE----- diff --git a/xmlsecurity/test_docs/CAs/Root_3/demoCA/crlnumber b/xmlsecurity/test_docs/CAs/Root_3/demoCA/crlnumber new file mode 100755 index 000000000000..dd11724042e2 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_3/demoCA/crlnumber @@ -0,0 +1 @@ +1001 diff --git a/xmlsecurity/test_docs/CAs/Root_3/demoCA/index.txt b/xmlsecurity/test_docs/CAs/Root_3/demoCA/index.txt new file mode 100755 index 000000000000..dd9a47ee641b --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_3/demoCA/index.txt @@ -0,0 +1 @@ +V 341114074039Z 1000 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=Sub CA 1 Root 3 diff --git a/xmlsecurity/test_docs/CAs/Root_3/demoCA/index.txt.attr b/xmlsecurity/test_docs/CAs/Root_3/demoCA/index.txt.attr new file mode 100755 index 000000000000..8f7e63a3475c --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_3/demoCA/index.txt.attr @@ -0,0 +1 @@ +unique_subject = yes diff --git a/xmlsecurity/test_docs/CAs/Root_3/demoCA/newcerts/1000.pem b/xmlsecurity/test_docs/CAs/Root_3/demoCA/newcerts/1000.pem new file mode 100755 index 000000000000..c14880b580c7 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_3/demoCA/newcerts/1000.pem @@ -0,0 +1,62 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 4096 (0x1000) + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 3 + Validity + Not Before: Nov 20 07:40:39 2009 GMT + Not After : Nov 14 07:40:39 2034 GMT + Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Sub CA 1 Root 3 + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public Key: (1024 bit) + Modulus (1024 bit): + 00:9e:87:1f:af:f0:a0:1c:f4:9e:f8:c3:e7:ee:d3: + cb:a8:e2:54:98:ba:dd:7e:dc:6e:14:e1:7e:7f:5b: + 1e:ef:53:3d:89:76:ea:e2:b3:6c:08:0d:e8:c8:4d: + 24:40:ff:92:f3:5b:51:f7:90:ac:69:37:29:90:f5: + e8:95:6f:67:d1:10:cd:7b:dd:65:38:d6:25:ec:63: + 39:ba:2e:ea:13:58:8e:7a:82:8e:10:d1:7b:77:7a: + 08:d5:82:66:62:a4:83:39:ad:f5:83:d5:2f:5c:bc: + 23:6e:c8:78:8b:38:9f:eb:a3:67:ba:43:fa:e4:07: + 3f:90:72:db:0c:f9:49:0e:0d + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Subject Key Identifier: + 1B:2D:E0:A2:26:7F:0D:BA:38:7E:EC:06:81:81:0F:12:74:4C:5A:4D + X509v3 Authority Key Identifier: + keyid:69:FF:30:EC:1F:34:9A:67:3A:6B:20:D2:DF:7F:F5:05:04:ED:F9:1C + DirName:/C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=Root 3 + serial:95:6F:F0:E3:2B:BE:76:F9 + + X509v3 Basic Constraints: critical + CA:TRUE + Signature Algorithm: sha1WithRSAEncryption + 6f:ac:53:9d:16:6e:95:ed:97:60:ed:c8:a8:96:ab:24:c5:1e: + d5:d7:26:98:fb:b5:aa:ef:da:a4:91:6a:82:55:ec:21:a2:08: + 24:c7:0c:a7:58:0c:06:69:3d:04:7d:08:f1:0b:77:41:ad:1c: + 13:c2:bd:17:c9:9e:ff:df:64:69:8b:58:f1:bc:40:bd:cf:e4: + 57:29:bc:5e:93:84:61:56:4c:e6:c1:3a:2c:6e:71:ea:5d:67: + c0:54:be:4f:2f:27:a8:59:8d:29:94:ba:c6:6c:ff:ed:25:3d: + 0b:fa:93:c9:45:f4:d5:a3:3d:be:8a:f1:9d:c4:92:d5:5c:d2: + 77:7c +-----BEGIN CERTIFICATE----- +MIIDBjCCAm+gAwIBAgICEAAwDQYJKoZIhvcNAQEFBQAwXzELMAkGA1UEBhMCREUx +EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD +VQQLEwtEZXZlbG9wbWVudDEPMA0GA1UEAxMGUm9vdCAzMB4XDTA5MTEyMDA3NDAz +OVoXDTM0MTExNDA3NDAzOVowaDELMAkGA1UEBhMCREUxEDAOBgNVBAgTB0hhbWJ1 +cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtEZXZlbG9wbWVu +dDEYMBYGA1UEAxMPU3ViIENBIDEgUm9vdCAzMIGfMA0GCSqGSIb3DQEBAQUAA4GN +ADCBiQKBgQCehx+v8KAc9J74w+fu08uo4lSYut1+3G4U4X5/Wx7vUz2Jduris2wI +DejITSRA/5LzW1H3kKxpNymQ9eiVb2fREM173WU41iXsYzm6LuoTWI56go4Q0Xt3 +egjVgmZipIM5rfWD1S9cvCNuyHiLOJ/ro2e6Q/rkBz+QctsM+UkODQIDAQABo4HH +MIHEMB0GA1UdDgQWBBQbLeCiJn8Nujh+7AaBgQ8SdExaTTCBkQYDVR0jBIGJMIGG +gBRp/zDsHzSaZzprINLff/UFBO35HKFjpGEwXzELMAkGA1UEBhMCREUxEDAOBgNV +BAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtE +ZXZlbG9wbWVudDEPMA0GA1UEAxMGUm9vdCAzggkAlW/w4yu+dvkwDwYDVR0TAQH/ +BAUwAwEB/zANBgkqhkiG9w0BAQUFAAOBgQBvrFOdFm6V7Zdg7ciolqskxR7V1yaY ++7Wq79qkkWqCVewhoggkxwynWAwGaT0EfQjxC3dBrRwTwr0XyZ7/32Rpi1jxvEC9 +z+RXKbxek4RhVkzmwTosbnHqXWfAVL5PLyeoWY0plLrGbP/tJT0L+pPJRfTVoz2+ +ivGdxJLVXNJ3fA== +-----END CERTIFICATE----- diff --git a/xmlsecurity/test_docs/CAs/Root_3/demoCA/private/cakey.pem b/xmlsecurity/test_docs/CAs/Root_3/demoCA/private/cakey.pem new file mode 100755 index 000000000000..445d86f99540 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_3/demoCA/private/cakey.pem @@ -0,0 +1,18 @@ +-----BEGIN RSA PRIVATE KEY----- +Proc-Type: 4,ENCRYPTED +DEK-Info: DES-EDE3-CBC,24B61B9BC2D90894 + +pJUmVTVcjD3b4WKoSDJHrxHYOJ5/6P0FyQRYaJhnDXpcC5cQywl7yuD3HpRh3cXT +Y5k6d1E64St3I/IDImdbiEEDbjlSG9gfFf9vYeP/Xlpaja0Y9Q2ePnQvJY47HB7+ +qkrt6b+3yIW024wHi83dzaeYeNUJaY1jGsra2TzGk/+hYrf6yvnyehEAsy5WChof +bfaQ29RrGTlzf6IpSRpiHUL7nVl+eHfbGLX4Ih8aEFXpcnoWtpY8FgQ5+bJxMeR4 +R2ge0c3G0VIBXBRRUoGsU0ZcRLdxYUFcDGZse50ZboUwvROfPCimowcyWKluV9yj +l4+e3glYcwGHRqHYArsLDUV2hzHHEJ1IKn4E+oExqQSGgDQgUDN0kjlRPPxWQb29 +6dZSHW4VXW609Q10FKbPuCocgQ2Ut2bNGWqXsiNNTr39iB0r/hA/V4bKy3G8ogsH +AQFp6D9LaFlt9ZFA49Y4WoPzSY9J2C4eFJzQ+jhCpeapzQ54BWNTYMQe+SJHkp1O +PWVovUrRbTDesIUeY1UJuSnbDotOc6vzEAsP+FIL2qUySUGG/CPyAf3R4FyahwjL +bgU5kmpzBKsgqRYrO2yfLz5/3/e9xUGfHVi8lbI5f21NQKesqHY2xS2NmGvakzbe +ZvD3bhythAR5L0Pp+tiiHE1LUAbcKp90aFPeaONDpUtrRU21gqqvEKnnubCvnjmE +l6GrH2WKSgxJbQ3GGqNaDg1ivB8XXyjx7guvBzpA0Pe2YCYMa0RI27GywNkv+RsR +eo3ox2QhUpvPxUl3ijwOPN3EFXrq0gdlYQJBWW3GLlX4Q71KJF+jUQ== +-----END RSA PRIVATE KEY----- diff --git a/xmlsecurity/test_docs/CAs/Root_3/demoCA/serial b/xmlsecurity/test_docs/CAs/Root_3/demoCA/serial new file mode 100755 index 000000000000..dd11724042e2 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_3/demoCA/serial @@ -0,0 +1 @@ +1001 diff --git a/xmlsecurity/test_docs/CAs/Root_3/openssl.cfg b/xmlsecurity/test_docs/CAs/Root_3/openssl.cfg new file mode 100755 index 000000000000..5f9493f47e9b --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_3/openssl.cfg @@ -0,0 +1,292 @@ +# +# OpenSSL example configuration file. +# This is mostly being used for generation of certificate requests. +# + +# This definition stops the following lines choking if HOME isn't +# defined. +HOME = . +RANDFILE = $ENV::HOME/.rnd + +# Extra OBJECT IDENTIFIER info: +#oid_file = $ENV::HOME/.oid +oid_section = new_oids + +# To use this configuration file with the "-extfile" option of the +# "openssl x509" utility, name here the section containing the +# X.509v3 extensions to use: +# extensions = +# (Alternatively, use a configuration file that has only +# X.509v3 extensions in its main [= default] section.) + +[ new_oids ] + +# We can add new OIDs in here for use by 'ca' and 'req'. +# Add a simple OID like this: +# testoid1=1.2.3.4 +# Or use config file substitution like this: +# testoid2=${testoid1}.5.6 + +#################################################################### +[ ca ] +default_ca = CA_default # The default ca section + +#################################################################### +[ CA_default ] + +dir = ./demoCA # Where everything is kept +certs = $dir/certs # Where the issued certs are kept +crl_dir = $dir/crl # Where the issued crl are kept +database = $dir/index.txt # database index file. +#unique_subject = no # Set to 'no' to allow creation of + # several ctificates with same subject. +new_certs_dir = $dir/newcerts # default place for new certs. + +certificate = $dir/cacert.pem # The CA certificate +serial = $dir/serial # The current serial number +crlnumber = $dir/crlnumber # the current crl number + # must be commented out to leave a V1 CRL +crl = $dir/crl.pem # The current CRL +private_key = $dir/private/cakey.pem # The private key +RANDFILE = $dir/private/.rand # private random number file + +x509_extensions = usr_cert # The extentions to add to the cert + +# Comment out the following two lines for the "traditional" +# (and highly broken) format. +name_opt = ca_default # Subject Name options +cert_opt = ca_default # Certificate field options + +# Extension copying option: use with caution. +# copy_extensions = copy + +# Extensions to add to a CRL. Note: Netscape communicator chokes on V2 CRLs +# so this is commented out by default to leave a V1 CRL. +# crlnumber must also be commented out to leave a V1 CRL. +# crl_extensions = crl_ext + +default_days = 365 # how long to certify for +default_crl_days= 30 # how long before next CRL +default_md = sha1 # which md to use. +preserve = no # keep passed DN ordering + +# A few difference way of specifying how similar the request should look +# For type CA, the listed attributes must be the same, and the optional +# and supplied fields are just that :-) +policy = policy_match + +# For the CA policy +[ policy_match ] +countryName = match +stateOrProvinceName = match +organizationName = match +organizationalUnitName = optional +commonName = supplied +emailAddress = optional + +# For the 'anything' policy +# At this point in time, you must list all acceptable 'object' +# types. +[ policy_anything ] +countryName = optional +stateOrProvinceName = optional +localityName = optional +organizationName = optional +organizationalUnitName = optional +commonName = supplied +emailAddress = optional + +#################################################################### +[ req ] +default_bits = 1024 +default_keyfile = privkey.pem +distinguished_name = req_distinguished_name +attributes = req_attributes +x509_extensions = v3_ca # The extentions to add to the self signed cert + +# Passwords for private keys if not present they will be prompted for +# input_password = secret +# output_password = secret + +# This sets a mask for permitted string types. There are several options. +# default: PrintableString, T61String, BMPString. +# pkix : PrintableString, BMPString. +# utf8only: only UTF8Strings. +# nombstr : PrintableString, T61String (no BMPStrings or UTF8Strings). +# MASK:XXXX a literal mask value. +# WARNING: current versions of Netscape crash on BMPStrings or UTF8Strings +# so use this option with caution! +string_mask = nombstr + +# req_extensions = v3_req # The extensions to add to a certificate request + +[ req_distinguished_name ] +countryName = Country Name (2 letter code) +countryName_default = DE +countryName_min = 2 +countryName_max = 2 + +stateOrProvinceName = State or Province Name (full name) +stateOrProvinceName_default = Hamburg + +localityName = Locality Name (eg, city) + +0.organizationName = Organization Name (eg, company) +0.organizationName_default = OpenOffice.org + +# we can do this but it is not needed normally :-) +#1.organizationName = Second Organization Name (eg, company) +#1.organizationName_default = World Wide Web Pty Ltd + +organizationalUnitName = Organizational Unit Name (eg, section) +organizationalUnitName_default = Development + +commonName = Common Name (eg, YOUR name) +commonName_max = 64 + +emailAddress = Email Address +emailAddress_max = 64 + +# SET-ex3 = SET extension number 3 + +[ req_attributes ] +challengePassword = A challenge password +challengePassword_min = 4 +challengePassword_max = 20 + +unstructuredName = An optional company name + +[ usr_cert ] + +# These extensions are added when 'ca' signs a request. +#authorityInfoAccess = OCSP;URI:http://localhost:8888/ + +# This is typical in keyUsage for a client certificate. +keyUsage = nonRepudiation, digitalSignature, keyEncipherment + +# This will be displayed in Netscape's comment listbox. +nsComment = "OpenSSL Generated Certificate" + +# PKIX recommendations harmless if included in all certificates. +subjectKeyIdentifier=hash +authorityKeyIdentifier=keyid,issuer + +# This stuff is for subjectAltName and issuerAltname. +# Import the email address. +# subjectAltName=email:copy +# An alternative to produce certificates that aren't +# deprecated according to PKIX. +# subjectAltName=email:move + +# Copy subject details +# issuerAltName=issuer:copy + + + +[ v3_req ] + +# Extensions to add to a certificate request + +basicConstraints = CA:FALSE +keyUsage = nonRepudiation, digitalSignature, keyEncipherment +#authorityInfoAccess = OCSP;URI:http://localhost:8888/ + +[ v3_ca ] + + +# Extensions for a typical CA + + +# PKIX recommendation. + +subjectKeyIdentifier=hash + +authorityKeyIdentifier=keyid:always,issuer:always + +#authorityInfoAccess = OCSP;URI:http://localhost:8888 +#crlDistributionPoints=URI:http://localhost:8901/demoCA/crl/Test_CA_2009.2.crl +# This is what PKIX recommends but some broken software chokes on critical +# extensions. +#basicConstraints = critical,CA:true +# So we do this instead. +basicConstraints = critical, CA:true + +# Key usage: this is typical for a CA certificate. However since it will +# prevent it being used as an test self-signed certificate it is best +# left out by default. +# keyUsage = cRLSign, keyCertSign + +# Some might want this also +# nsCertType = sslCA, emailCA + +# Include email address in subject alt name: another PKIX recommendation +# subjectAltName=email:copy +# Copy issuer details +# issuerAltName=issuer:copy + +# DER hex encoding of an extension: beware experts only! +# obj=DER:02:03 +# Where 'obj' is a standard or added object +# You can even override a supported extension: +# basicConstraints= critical, DER:30:03:01:01:FF + +[ crl_ext ] + +# CRL extensions. +# Only issuerAltName and authorityKeyIdentifier make any sense in a CRL. + +# issuerAltName=issuer:copy +authorityKeyIdentifier=keyid:always,issuer:always + +[ proxy_cert_ext ] +# These extensions should be added when creating a proxy certificate + +# This goes against PKIX guidelines but some CAs do it and some software +# requires this to avoid interpreting an end user certificate as a CA. + +basicConstraints=CA:FALSE + +# Here are some examples of the usage of nsCertType. If it is omitted +# the certificate can be used for anything *except* object signing. + +# This is OK for an SSL server. +# nsCertType = server + +# For an object signing certificate this would be used. +# nsCertType = objsign + +# For normal client use this is typical +# nsCertType = client, email + +# and for everything including object signing: +# nsCertType = client, email, objsign + +# This is typical in keyUsage for a client certificate. +# keyUsage = nonRepudiation, digitalSignature, keyEncipherment + +# This will be displayed in Netscape's comment listbox. +nsComment = "OpenSSL Generated Certificate" + +# PKIX recommendations harmless if included in all certificates. +subjectKeyIdentifier=hash +authorityKeyIdentifier=keyid,issuer:always + +# This stuff is for subjectAltName and issuerAltname. +# Import the email address. +# subjectAltName=email:copy +# An alternative to produce certificates that aren't +# deprecated according to PKIX. +# subjectAltName=email:move + +# Copy subject details +# issuerAltName=issuer:copy + +#nsCaRevocationUrl = http://www.domain.dom/ca-crl.pem +#nsBaseUrl +#nsRevocationUrl +#nsRenewalUrl +#nsCaPolicyUrl +#nsSslServerName + +# This really needs to be in place for it to be a proxy certificate. +proxyCertInfo=critical,language:id-ppl-anyLanguage,pathlen:3,policy:foo diff --git a/xmlsecurity/test_docs/CAs/Root_4/README.txt b/xmlsecurity/test_docs/CAs/Root_4/README.txt new file mode 100755 index 000000000000..b9fb278a2724 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_4/README.txt @@ -0,0 +1,4 @@ +Revoked certificates: + +- Sub CA 2 Root 4 + diff --git a/xmlsecurity/test_docs/CAs/Root_4/demoCA/cacert.pem b/xmlsecurity/test_docs/CAs/Root_4/demoCA/cacert.pem new file mode 100755 index 000000000000..45b4ce8a5f29 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_4/demoCA/cacert.pem @@ -0,0 +1,19 @@ +-----BEGIN CERTIFICATE----- +MIIDBDCCAm2gAwIBAgIJAKKTRnQ7puOtMA0GCSqGSIb3DQEBBQUAMF8xCzAJBgNV +BAYTAkRFMRAwDgYDVQQIEwdIYW1idXJnMRcwFQYDVQQKEw5PcGVuT2ZmaWNlLm9y +ZzEUMBIGA1UECxMLRGV2ZWxvcG1lbnQxDzANBgNVBAMTBlJvb3QgNDAeFw0wOTEx +MjAwODM1MDRaFw0zNDExMTQwODM1MDRaMF8xCzAJBgNVBAYTAkRFMRAwDgYDVQQI +EwdIYW1idXJnMRcwFQYDVQQKEw5PcGVuT2ZmaWNlLm9yZzEUMBIGA1UECxMLRGV2 +ZWxvcG1lbnQxDzANBgNVBAMTBlJvb3QgNDCBnzANBgkqhkiG9w0BAQEFAAOBjQAw +gYkCgYEA2k+jPArotoY09an0BpF3RYIPP/5RN04E4S+Ulp/ipttaVxtAC0ojJSlp +0PGp/vIodFT9pkBb0nq56LHjFLj+lyW5tKAR+4B+VVvzwJhUBD8qHjYJE30vWZ88 +3+3I+GmXDzy962kQxrb4J6dBwGImoqhBTXWOxGnPjXxtovzYmMECAwEAAaOBxzCB +xDAdBgNVHQ4EFgQUuo2hl9zEOR+QtVFrEBnyRg2pZY4wgZEGA1UdIwSBiTCBhoAU +uo2hl9zEOR+QtVFrEBnyRg2pZY6hY6RhMF8xCzAJBgNVBAYTAkRFMRAwDgYDVQQI +EwdIYW1idXJnMRcwFQYDVQQKEw5PcGVuT2ZmaWNlLm9yZzEUMBIGA1UECxMLRGV2 +ZWxvcG1lbnQxDzANBgNVBAMTBlJvb3QgNIIJAKKTRnQ7puOtMA8GA1UdEwEB/wQF +MAMBAf8wDQYJKoZIhvcNAQEFBQADgYEARdHX1KRJ/DE1zOkbjINPX4pFjTMIIfKd +ncEBM7Po20it75Hbl8bHoxwCrjOu+9L1xaTCWcunyqv26yrjVpORPHPODLMc2W8x +FQm39hL6a0RjqurDlhcrjor3HD7hQ+GjEUDAX6Pk9RDxN+uMHvF5/5WCEhSn2aLT +IozGu5SmZys= +-----END CERTIFICATE----- diff --git a/xmlsecurity/test_docs/CAs/Root_4/demoCA/crlnumber b/xmlsecurity/test_docs/CAs/Root_4/demoCA/crlnumber new file mode 100755 index 000000000000..dd11724042e2 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_4/demoCA/crlnumber @@ -0,0 +1 @@ +1001 diff --git a/xmlsecurity/test_docs/CAs/Root_4/demoCA/index.txt b/xmlsecurity/test_docs/CAs/Root_4/demoCA/index.txt new file mode 100755 index 000000000000..f07b3377de4a --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_4/demoCA/index.txt @@ -0,0 +1,2 @@ +V 341114083727Z 1000 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=Sub CA 1 Root 4 +R 341114092227Z 091120092718Z,keyCompromise 1001 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=Sub CA 2 Root 4 diff --git a/xmlsecurity/test_docs/CAs/Root_4/demoCA/index.txt.attr b/xmlsecurity/test_docs/CAs/Root_4/demoCA/index.txt.attr new file mode 100755 index 000000000000..8f7e63a3475c --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_4/demoCA/index.txt.attr @@ -0,0 +1 @@ +unique_subject = yes diff --git a/xmlsecurity/test_docs/CAs/Root_4/demoCA/newcerts/1000.pem b/xmlsecurity/test_docs/CAs/Root_4/demoCA/newcerts/1000.pem new file mode 100755 index 000000000000..391037118147 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_4/demoCA/newcerts/1000.pem @@ -0,0 +1,62 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 4096 (0x1000) + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 4 + Validity + Not Before: Nov 20 08:37:27 2009 GMT + Not After : Nov 14 08:37:27 2034 GMT + Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Sub CA 1 Root 4 + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public Key: (1024 bit) + Modulus (1024 bit): + 00:da:b0:21:94:89:b0:00:89:cb:69:59:9b:0d:fe: + 1f:b9:a0:a8:44:92:55:5f:0b:d5:e5:08:63:bd:47: + 6b:11:4d:b1:a8:12:6f:c1:cf:cb:9e:ae:e2:c1:03: + 68:46:59:0b:96:7c:21:45:9b:14:81:d8:f1:83:70: + 6b:3d:b4:56:65:49:87:1d:ab:e2:08:6a:49:66:0e: + 59:b4:da:7a:3f:72:23:b8:1f:fb:78:f5:f0:2d:c4: + fe:d9:94:6e:2e:c3:6e:95:ba:38:60:d1:0b:fa:16: + c7:02:71:ef:3e:71:72:63:26:56:35:1e:8b:ec:47: + 87:25:6e:bc:90:d0:8b:37:2d + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Subject Key Identifier: + 96:9A:2D:06:F6:76:4F:83:68:7B:9C:69:C4:18:BB:4A:EB:46:38:E4 + X509v3 Authority Key Identifier: + keyid:BA:8D:A1:97:DC:C4:39:1F:90:B5:51:6B:10:19:F2:46:0D:A9:65:8E + DirName:/C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=Root 4 + serial:A2:93:46:74:3B:A6:E3:AD + + X509v3 Basic Constraints: critical + CA:TRUE + Signature Algorithm: sha1WithRSAEncryption + 45:77:ba:6b:b6:a7:2a:0f:6b:38:90:9f:0a:18:11:c7:54:7b: + c9:3b:9a:93:90:96:f0:04:0a:56:87:30:e0:f5:d8:84:40:39: + 90:85:ca:e7:38:1b:d8:df:2f:bd:73:91:13:cb:a6:c9:b0:7a: + f7:59:77:6b:9a:d5:86:78:06:dc:40:14:ce:ea:43:a8:ae:ed: + a2:03:64:51:3a:47:7a:9f:df:2d:65:49:56:a5:39:cf:28:2a: + ac:ab:fd:e1:93:fd:3e:56:e8:eb:7a:11:a8:f7:f9:1a:a1:83: + 1f:92:f7:da:4e:c6:d9:67:dd:67:ff:be:6f:e5:24:e1:6e:cc: + 94:3c +-----BEGIN CERTIFICATE----- +MIIDBjCCAm+gAwIBAgICEAAwDQYJKoZIhvcNAQEFBQAwXzELMAkGA1UEBhMCREUx +EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD +VQQLEwtEZXZlbG9wbWVudDEPMA0GA1UEAxMGUm9vdCA0MB4XDTA5MTEyMDA4Mzcy +N1oXDTM0MTExNDA4MzcyN1owaDELMAkGA1UEBhMCREUxEDAOBgNVBAgTB0hhbWJ1 +cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtEZXZlbG9wbWVu +dDEYMBYGA1UEAxMPU3ViIENBIDEgUm9vdCA0MIGfMA0GCSqGSIb3DQEBAQUAA4GN +ADCBiQKBgQDasCGUibAAictpWZsN/h+5oKhEklVfC9XlCGO9R2sRTbGoEm/Bz8ue +ruLBA2hGWQuWfCFFmxSB2PGDcGs9tFZlSYcdq+IIaklmDlm02no/ciO4H/t49fAt +xP7ZlG4uw26Vujhg0Qv6FscCce8+cXJjJlY1HovsR4clbryQ0Is3LQIDAQABo4HH +MIHEMB0GA1UdDgQWBBSWmi0G9nZPg2h7nGnEGLtK60Y45DCBkQYDVR0jBIGJMIGG +gBS6jaGX3MQ5H5C1UWsQGfJGDalljqFjpGEwXzELMAkGA1UEBhMCREUxEDAOBgNV +BAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtE +ZXZlbG9wbWVudDEPMA0GA1UEAxMGUm9vdCA0ggkAopNGdDum460wDwYDVR0TAQH/ +BAUwAwEB/zANBgkqhkiG9w0BAQUFAAOBgQBFd7prtqcqD2s4kJ8KGBHHVHvJO5qT +kJbwBApWhzDg9diEQDmQhcrnOBvY3y+9c5ETy6bJsHr3WXdrmtWGeAbcQBTO6kOo +ru2iA2RROkd6n98tZUlWpTnPKCqsq/3hk/0+VujrehGo9/kaoYMfkvfaTsbZZ91n +/75v5SThbsyUPA== +-----END CERTIFICATE----- diff --git a/xmlsecurity/test_docs/CAs/Root_4/demoCA/newcerts/1001.pem b/xmlsecurity/test_docs/CAs/Root_4/demoCA/newcerts/1001.pem new file mode 100755 index 000000000000..9d951ee26728 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_4/demoCA/newcerts/1001.pem @@ -0,0 +1,62 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 4097 (0x1001) + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 4 + Validity + Not Before: Nov 20 09:22:27 2009 GMT + Not After : Nov 14 09:22:27 2034 GMT + Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Sub CA 2 Root 4 + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public Key: (1024 bit) + Modulus (1024 bit): + 00:e5:8d:27:4e:09:53:08:61:c6:23:25:9e:dd:9c: + 07:bf:81:38:5c:5c:10:8f:e4:12:2f:4e:2e:b1:a1: + cf:21:46:53:bf:e8:5e:de:17:3a:9d:f7:e8:ef:3e: + 9c:b4:29:37:4c:31:35:15:dc:98:e0:93:9c:ce:6a: + d6:e1:35:19:6b:d4:1d:3b:81:86:b1:e7:ff:1f:b8: + 34:a9:f9:de:4d:b8:62:ac:3b:d4:58:8e:5c:76:b5: + 07:7f:32:8a:3a:90:73:71:d5:da:f1:79:39:14:ed: + 1b:f1:8a:3e:be:48:bc:07:ec:f9:7c:03:14:fc:e7: + 55:a3:65:81:c7:6c:70:0b:ff + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Subject Key Identifier: + 69:DE:B6:99:C4:95:F7:5A:FA:41:6B:4C:F6:C3:6D:89:AA:37:31:9D + X509v3 Authority Key Identifier: + keyid:BA:8D:A1:97:DC:C4:39:1F:90:B5:51:6B:10:19:F2:46:0D:A9:65:8E + DirName:/C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=Root 4 + serial:A2:93:46:74:3B:A6:E3:AD + + X509v3 Basic Constraints: critical + CA:TRUE + Signature Algorithm: sha1WithRSAEncryption + bc:cf:43:eb:72:b1:71:a7:94:8e:cd:5b:fc:d8:21:31:83:db: + a9:de:c7:5b:14:e5:7b:90:43:e6:05:df:db:6e:95:5f:24:ac: + 0c:a1:8a:ac:c6:cf:f2:03:cd:a0:30:ae:d3:a9:41:07:c9:b1: + be:4b:e0:fc:a2:76:09:07:75:6a:fa:e4:2f:a3:3a:cd:81:68: + ab:f6:06:c4:32:08:25:6e:e8:e7:36:9c:1a:f7:42:73:f8:b0: + d8:42:3e:85:c2:11:23:10:d6:6a:e4:8f:53:cb:8b:8b:1b:5a: + 4d:6d:9d:34:45:26:52:d2:ee:6d:8f:23:ff:00:92:f5:99:62: + 4c:41 +-----BEGIN CERTIFICATE----- +MIIDBjCCAm+gAwIBAgICEAEwDQYJKoZIhvcNAQEFBQAwXzELMAkGA1UEBhMCREUx +EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD +VQQLEwtEZXZlbG9wbWVudDEPMA0GA1UEAxMGUm9vdCA0MB4XDTA5MTEyMDA5MjIy +N1oXDTM0MTExNDA5MjIyN1owaDELMAkGA1UEBhMCREUxEDAOBgNVBAgTB0hhbWJ1 +cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtEZXZlbG9wbWVu +dDEYMBYGA1UEAxMPU3ViIENBIDIgUm9vdCA0MIGfMA0GCSqGSIb3DQEBAQUAA4GN +ADCBiQKBgQDljSdOCVMIYcYjJZ7dnAe/gThcXBCP5BIvTi6xoc8hRlO/6F7eFzqd +9+jvPpy0KTdMMTUV3Jjgk5zOatbhNRlr1B07gYax5/8fuDSp+d5NuGKsO9RYjlx2 +tQd/Moo6kHNx1drxeTkU7Rvxij6+SLwH7Pl8AxT851WjZYHHbHAL/wIDAQABo4HH +MIHEMB0GA1UdDgQWBBRp3raZxJX3WvpBa0z2w22JqjcxnTCBkQYDVR0jBIGJMIGG +gBS6jaGX3MQ5H5C1UWsQGfJGDalljqFjpGEwXzELMAkGA1UEBhMCREUxEDAOBgNV +BAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtE +ZXZlbG9wbWVudDEPMA0GA1UEAxMGUm9vdCA0ggkAopNGdDum460wDwYDVR0TAQH/ +BAUwAwEB/zANBgkqhkiG9w0BAQUFAAOBgQC8z0PrcrFxp5SOzVv82CExg9up3sdb +FOV7kEPmBd/bbpVfJKwMoYqsxs/yA82gMK7TqUEHybG+S+D8onYJB3Vq+uQvozrN +gWir9gbEMgglbujnNpwa90Jz+LDYQj6FwhEjENZq5I9Ty4uLG1pNbZ00RSZS0u5t +jyP/AJL1mWJMQQ== +-----END CERTIFICATE----- diff --git a/xmlsecurity/test_docs/CAs/Root_4/demoCA/private/cakey.pem b/xmlsecurity/test_docs/CAs/Root_4/demoCA/private/cakey.pem new file mode 100755 index 000000000000..003d2f3b56d5 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_4/demoCA/private/cakey.pem @@ -0,0 +1,18 @@ +-----BEGIN RSA PRIVATE KEY----- +Proc-Type: 4,ENCRYPTED +DEK-Info: DES-EDE3-CBC,26D3AA1ECCD64EF2 + +Smy62JNi1/1qKZI1q2lF13336vwJWfw+ii4g/ZwMJWuwTWUGXWZ1o9B9pZFo78KM +pMlasoCwAoI3lepMIwxtSRMgstxacJ4QRVPdevo7Qq6+++qNXdkqq9pYM19dsOiu +UNpbPXVvKQZnvm0ZFCjqiylvjCaQVQRScdwu9cJyq2qIQ1laXQoW2fPYBb8KSsCO +B5E76zAGdRlzEglT9Qkjbi2dQWxWpMHFfWZydFJnNbuh7O+RxCSOJN3jXlDRGPag +IwL4mFX8dElCwWhNpdd1pXF2ZXQ2S6Ke1MoOXRvJ7XVvEfnGyHpHQRdNB0M9gJCf +3ynJ0UUiCvXJs/6NEcOZzZ+R38XfMvsOcG1jNuh2KE5hW3cGbQMV2TPZMHjGE/qn +EhX+vzIOhRUPTUQjrjmV/lgioL4pMKFBXyfr2tkNLVOfzQtIXVfgxF1ooVmZFGKR +fAmHRbXKSrGWPJkX75bdlVnQ15qz5dU7PkIohGwGojOHuTWLXzKtOuLs7KMmH/i1 +5MhxcoXbI4R+hX/oj2Es4MKYFcSI0MID9Z5Se6z/yaz++5P9OrEGrXydg4W5YSuc +Q+MovUuqNoDH+Mo0z2P2DL4OxcIkBYoUVFOnIL2v5thRgbdWk05m0OBWYnvue9MG +CiuA49Lqg0H2ViZrDCyGDQNBkDkW7AKHYhVe3afHSDENX+wsgB1oj1bMvWNLQfCB +2IOYjv+of7tNOvIH6AuaJDqF2TYOm4ipcjSD/SEuKfrOgXlq6702tRhL4aAfHa6K +o1yrUfAxLwqN/TjSDNfOIUr5ro24tYnUaUnYPpn/zwZ5WfitZ4RGBg== +-----END RSA PRIVATE KEY----- diff --git a/xmlsecurity/test_docs/CAs/Root_4/demoCA/serial b/xmlsecurity/test_docs/CAs/Root_4/demoCA/serial new file mode 100755 index 000000000000..7d802a3e7104 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_4/demoCA/serial @@ -0,0 +1 @@ +1002 diff --git a/xmlsecurity/test_docs/CAs/Root_4/openssl.cfg b/xmlsecurity/test_docs/CAs/Root_4/openssl.cfg new file mode 100755 index 000000000000..5f9493f47e9b --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_4/openssl.cfg @@ -0,0 +1,292 @@ +# +# OpenSSL example configuration file. +# This is mostly being used for generation of certificate requests. +# + +# This definition stops the following lines choking if HOME isn't +# defined. +HOME = . +RANDFILE = $ENV::HOME/.rnd + +# Extra OBJECT IDENTIFIER info: +#oid_file = $ENV::HOME/.oid +oid_section = new_oids + +# To use this configuration file with the "-extfile" option of the +# "openssl x509" utility, name here the section containing the +# X.509v3 extensions to use: +# extensions = +# (Alternatively, use a configuration file that has only +# X.509v3 extensions in its main [= default] section.) + +[ new_oids ] + +# We can add new OIDs in here for use by 'ca' and 'req'. +# Add a simple OID like this: +# testoid1=1.2.3.4 +# Or use config file substitution like this: +# testoid2=${testoid1}.5.6 + +#################################################################### +[ ca ] +default_ca = CA_default # The default ca section + +#################################################################### +[ CA_default ] + +dir = ./demoCA # Where everything is kept +certs = $dir/certs # Where the issued certs are kept +crl_dir = $dir/crl # Where the issued crl are kept +database = $dir/index.txt # database index file. +#unique_subject = no # Set to 'no' to allow creation of + # several ctificates with same subject. +new_certs_dir = $dir/newcerts # default place for new certs. + +certificate = $dir/cacert.pem # The CA certificate +serial = $dir/serial # The current serial number +crlnumber = $dir/crlnumber # the current crl number + # must be commented out to leave a V1 CRL +crl = $dir/crl.pem # The current CRL +private_key = $dir/private/cakey.pem # The private key +RANDFILE = $dir/private/.rand # private random number file + +x509_extensions = usr_cert # The extentions to add to the cert + +# Comment out the following two lines for the "traditional" +# (and highly broken) format. +name_opt = ca_default # Subject Name options +cert_opt = ca_default # Certificate field options + +# Extension copying option: use with caution. +# copy_extensions = copy + +# Extensions to add to a CRL. Note: Netscape communicator chokes on V2 CRLs +# so this is commented out by default to leave a V1 CRL. +# crlnumber must also be commented out to leave a V1 CRL. +# crl_extensions = crl_ext + +default_days = 365 # how long to certify for +default_crl_days= 30 # how long before next CRL +default_md = sha1 # which md to use. +preserve = no # keep passed DN ordering + +# A few difference way of specifying how similar the request should look +# For type CA, the listed attributes must be the same, and the optional +# and supplied fields are just that :-) +policy = policy_match + +# For the CA policy +[ policy_match ] +countryName = match +stateOrProvinceName = match +organizationName = match +organizationalUnitName = optional +commonName = supplied +emailAddress = optional + +# For the 'anything' policy +# At this point in time, you must list all acceptable 'object' +# types. +[ policy_anything ] +countryName = optional +stateOrProvinceName = optional +localityName = optional +organizationName = optional +organizationalUnitName = optional +commonName = supplied +emailAddress = optional + +#################################################################### +[ req ] +default_bits = 1024 +default_keyfile = privkey.pem +distinguished_name = req_distinguished_name +attributes = req_attributes +x509_extensions = v3_ca # The extentions to add to the self signed cert + +# Passwords for private keys if not present they will be prompted for +# input_password = secret +# output_password = secret + +# This sets a mask for permitted string types. There are several options. +# default: PrintableString, T61String, BMPString. +# pkix : PrintableString, BMPString. +# utf8only: only UTF8Strings. +# nombstr : PrintableString, T61String (no BMPStrings or UTF8Strings). +# MASK:XXXX a literal mask value. +# WARNING: current versions of Netscape crash on BMPStrings or UTF8Strings +# so use this option with caution! +string_mask = nombstr + +# req_extensions = v3_req # The extensions to add to a certificate request + +[ req_distinguished_name ] +countryName = Country Name (2 letter code) +countryName_default = DE +countryName_min = 2 +countryName_max = 2 + +stateOrProvinceName = State or Province Name (full name) +stateOrProvinceName_default = Hamburg + +localityName = Locality Name (eg, city) + +0.organizationName = Organization Name (eg, company) +0.organizationName_default = OpenOffice.org + +# we can do this but it is not needed normally :-) +#1.organizationName = Second Organization Name (eg, company) +#1.organizationName_default = World Wide Web Pty Ltd + +organizationalUnitName = Organizational Unit Name (eg, section) +organizationalUnitName_default = Development + +commonName = Common Name (eg, YOUR name) +commonName_max = 64 + +emailAddress = Email Address +emailAddress_max = 64 + +# SET-ex3 = SET extension number 3 + +[ req_attributes ] +challengePassword = A challenge password +challengePassword_min = 4 +challengePassword_max = 20 + +unstructuredName = An optional company name + +[ usr_cert ] + +# These extensions are added when 'ca' signs a request. +#authorityInfoAccess = OCSP;URI:http://localhost:8888/ + +# This is typical in keyUsage for a client certificate. +keyUsage = nonRepudiation, digitalSignature, keyEncipherment + +# This will be displayed in Netscape's comment listbox. +nsComment = "OpenSSL Generated Certificate" + +# PKIX recommendations harmless if included in all certificates. +subjectKeyIdentifier=hash +authorityKeyIdentifier=keyid,issuer + +# This stuff is for subjectAltName and issuerAltname. +# Import the email address. +# subjectAltName=email:copy +# An alternative to produce certificates that aren't +# deprecated according to PKIX. +# subjectAltName=email:move + +# Copy subject details +# issuerAltName=issuer:copy + + + +[ v3_req ] + +# Extensions to add to a certificate request + +basicConstraints = CA:FALSE +keyUsage = nonRepudiation, digitalSignature, keyEncipherment +#authorityInfoAccess = OCSP;URI:http://localhost:8888/ + +[ v3_ca ] + + +# Extensions for a typical CA + + +# PKIX recommendation. + +subjectKeyIdentifier=hash + +authorityKeyIdentifier=keyid:always,issuer:always + +#authorityInfoAccess = OCSP;URI:http://localhost:8888 +#crlDistributionPoints=URI:http://localhost:8901/demoCA/crl/Test_CA_2009.2.crl +# This is what PKIX recommends but some broken software chokes on critical +# extensions. +#basicConstraints = critical,CA:true +# So we do this instead. +basicConstraints = critical, CA:true + +# Key usage: this is typical for a CA certificate. However since it will +# prevent it being used as an test self-signed certificate it is best +# left out by default. +# keyUsage = cRLSign, keyCertSign + +# Some might want this also +# nsCertType = sslCA, emailCA + +# Include email address in subject alt name: another PKIX recommendation +# subjectAltName=email:copy +# Copy issuer details +# issuerAltName=issuer:copy + +# DER hex encoding of an extension: beware experts only! +# obj=DER:02:03 +# Where 'obj' is a standard or added object +# You can even override a supported extension: +# basicConstraints= critical, DER:30:03:01:01:FF + +[ crl_ext ] + +# CRL extensions. +# Only issuerAltName and authorityKeyIdentifier make any sense in a CRL. + +# issuerAltName=issuer:copy +authorityKeyIdentifier=keyid:always,issuer:always + +[ proxy_cert_ext ] +# These extensions should be added when creating a proxy certificate + +# This goes against PKIX guidelines but some CAs do it and some software +# requires this to avoid interpreting an end user certificate as a CA. + +basicConstraints=CA:FALSE + +# Here are some examples of the usage of nsCertType. If it is omitted +# the certificate can be used for anything *except* object signing. + +# This is OK for an SSL server. +# nsCertType = server + +# For an object signing certificate this would be used. +# nsCertType = objsign + +# For normal client use this is typical +# nsCertType = client, email + +# and for everything including object signing: +# nsCertType = client, email, objsign + +# This is typical in keyUsage for a client certificate. +# keyUsage = nonRepudiation, digitalSignature, keyEncipherment + +# This will be displayed in Netscape's comment listbox. +nsComment = "OpenSSL Generated Certificate" + +# PKIX recommendations harmless if included in all certificates. +subjectKeyIdentifier=hash +authorityKeyIdentifier=keyid,issuer:always + +# This stuff is for subjectAltName and issuerAltname. +# Import the email address. +# subjectAltName=email:copy +# An alternative to produce certificates that aren't +# deprecated according to PKIX. +# subjectAltName=email:move + +# Copy subject details +# issuerAltName=issuer:copy + +#nsCaRevocationUrl = http://www.domain.dom/ca-crl.pem +#nsBaseUrl +#nsRevocationUrl +#nsRenewalUrl +#nsCaPolicyUrl +#nsSslServerName + +# This really needs to be in place for it to be a proxy certificate. +proxyCertInfo=critical,language:id-ppl-anyLanguage,pathlen:3,policy:foo diff --git a/xmlsecurity/test_docs/CAs/Root_5/demoCA/cacert.pem b/xmlsecurity/test_docs/CAs/Root_5/demoCA/cacert.pem new file mode 100755 index 000000000000..631deb24de3f --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_5/demoCA/cacert.pem @@ -0,0 +1,19 @@ +-----BEGIN CERTIFICATE----- +MIIDBDCCAm2gAwIBAgIJAPA9tqmpnKNOMA0GCSqGSIb3DQEBBQUAMF8xCzAJBgNV +BAYTAkRFMRAwDgYDVQQIEwdIYW1idXJnMRcwFQYDVQQKEw5PcGVuT2ZmaWNlLm9y +ZzEUMBIGA1UECxMLRGV2ZWxvcG1lbnQxDzANBgNVBAMTBlJvb3QgNTAeFw0wOTEx +MjAxMDEwMzdaFw0zNDExMTQxMDEwMzdaMF8xCzAJBgNVBAYTAkRFMRAwDgYDVQQI +EwdIYW1idXJnMRcwFQYDVQQKEw5PcGVuT2ZmaWNlLm9yZzEUMBIGA1UECxMLRGV2 +ZWxvcG1lbnQxDzANBgNVBAMTBlJvb3QgNTCBnzANBgkqhkiG9w0BAQEFAAOBjQAw +gYkCgYEAwbqFK0+BWGylCl9gJj/eVuuNBcSgVetgx0cXwMRPHiwFZ8ilxPJm4kd0 +k2WDKHox5Ol8T0pU4n3fA5VmxjcfGnx03R8rFTn5deetrKQzyWUjz7EIl4mZYSvK +hwlbg5ZB4FJDYUoC/3eVHdQq2jUvRaQad1TvdBmvIMbDaYmTT3cCAwEAAaOBxzCB +xDAdBgNVHQ4EFgQUwdGg1FsLnX4xYfk5EJ8xEODSBrUwgZEGA1UdIwSBiTCBhoAU +wdGg1FsLnX4xYfk5EJ8xEODSBrWhY6RhMF8xCzAJBgNVBAYTAkRFMRAwDgYDVQQI +EwdIYW1idXJnMRcwFQYDVQQKEw5PcGVuT2ZmaWNlLm9yZzEUMBIGA1UECxMLRGV2 +ZWxvcG1lbnQxDzANBgNVBAMTBlJvb3QgNYIJAPA9tqmpnKNOMA8GA1UdEwEB/wQF +MAMBAf8wDQYJKoZIhvcNAQEFBQADgYEAeX2QYyrs9an5ObWjzauPCzr8hx6k8dF3 +YXU8f/JCf/fKG5u5WQZmmu0YZXMSaDyzqS3rKupDSm4kbfB9l9oTkgZszueI29pd +C/QIh8vUTiAlV5zxR4ypqmBg489W/uXdQPicuFhGFYX9EWjuGhwk8dL0dcUCufwX +UBYBlUiceFU= +-----END CERTIFICATE----- diff --git a/xmlsecurity/test_docs/CAs/Root_5/demoCA/crl/DO_NOT_CREATE_A_CRL b/xmlsecurity/test_docs/CAs/Root_5/demoCA/crl/DO_NOT_CREATE_A_CRL new file mode 100755 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_5/demoCA/crl/DO_NOT_CREATE_A_CRL diff --git a/xmlsecurity/test_docs/CAs/Root_5/demoCA/crlnumber b/xmlsecurity/test_docs/CAs/Root_5/demoCA/crlnumber new file mode 100755 index 000000000000..83b33d238dab --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_5/demoCA/crlnumber @@ -0,0 +1 @@ +1000 diff --git a/xmlsecurity/test_docs/CAs/Root_5/demoCA/index.txt b/xmlsecurity/test_docs/CAs/Root_5/demoCA/index.txt new file mode 100755 index 000000000000..d910b9acc97e --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_5/demoCA/index.txt @@ -0,0 +1 @@ +V 341114113023Z 1001 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=Sub CA 1 Root 5 diff --git a/xmlsecurity/test_docs/CAs/Root_5/demoCA/index.txt.attr b/xmlsecurity/test_docs/CAs/Root_5/demoCA/index.txt.attr new file mode 100755 index 000000000000..8f7e63a3475c --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_5/demoCA/index.txt.attr @@ -0,0 +1 @@ +unique_subject = yes diff --git a/xmlsecurity/test_docs/CAs/Root_5/demoCA/newcerts/1001.pem b/xmlsecurity/test_docs/CAs/Root_5/demoCA/newcerts/1001.pem new file mode 100755 index 000000000000..b350f6eb33ef --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_5/demoCA/newcerts/1001.pem @@ -0,0 +1,66 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 4097 (0x1001) + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 5 + Validity + Not Before: Nov 20 11:30:23 2009 GMT + Not After : Nov 14 11:30:23 2034 GMT + Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Sub CA 1 Root 5 + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public Key: (1024 bit) + Modulus (1024 bit): + 00:97:fa:a2:49:d3:bf:c1:2e:7a:ed:83:83:3c:78: + 96:c8:b2:b9:67:af:c0:5e:0a:89:89:fb:94:59:32: + a8:2a:e4:20:2f:3b:3d:ce:53:4f:72:fc:6c:0b:93: + 38:c3:df:66:6e:d5:79:d0:a4:4e:41:84:43:3c:99: + 79:0c:e0:5f:19:1a:3d:f5:4b:11:28:0f:80:b0:a0: + 71:34:5b:90:71:c2:ef:1e:85:2e:5b:9f:3b:22:c3: + 18:f8:7c:1f:ef:1b:78:17:a0:44:60:46:7e:88:eb: + a7:60:a0:5c:2a:7c:37:99:fa:27:97:08:e8:89:ba: + bc:69:4b:79:93:8f:ad:b5:9b + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Subject Key Identifier: + 01:E9:B5:99:E4:6D:F9:8C:42:3D:09:10:0F:A7:75:C6:27:78:4A:AF + X509v3 Authority Key Identifier: + keyid:C1:D1:A0:D4:5B:0B:9D:7E:31:61:F9:39:10:9F:31:10:E0:D2:06:B5 + DirName:/C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=Root 5 + serial:F0:3D:B6:A9:A9:9C:A3:4E + + X509v3 CRL Distribution Points: + URI:http://localhost:8901/demoCA/crl/Root_5.crl + + X509v3 Basic Constraints: critical + CA:TRUE + Signature Algorithm: sha1WithRSAEncryption + 6d:ca:34:05:99:ff:99:49:d3:6d:9d:ad:c6:99:da:9d:6c:94: + 62:77:ed:1c:39:23:d2:e8:b6:3e:df:63:dc:7c:10:3f:c2:ed: + f4:04:26:58:05:01:4c:ed:a9:83:43:3a:5d:fe:60:6d:5b:58: + dc:93:8c:94:69:b6:7f:02:48:30:9c:31:f4:7d:de:e0:de:04: + d2:dc:79:b7:60:c2:87:f7:c7:92:a2:f5:86:a7:0c:70:3b:a3: + a7:35:11:cf:a4:28:21:aa:8b:24:50:2e:96:41:be:66:01:bd: + b9:ec:04:0c:92:d9:8a:e7:a0:96:24:9b:f1:a2:9f:59:59:4a: + 32:a4 +-----BEGIN CERTIFICATE----- +MIIDRjCCAq+gAwIBAgICEAEwDQYJKoZIhvcNAQEFBQAwXzELMAkGA1UEBhMCREUx +EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD +VQQLEwtEZXZlbG9wbWVudDEPMA0GA1UEAxMGUm9vdCA1MB4XDTA5MTEyMDExMzAy +M1oXDTM0MTExNDExMzAyM1owaDELMAkGA1UEBhMCREUxEDAOBgNVBAgTB0hhbWJ1 +cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtEZXZlbG9wbWVu +dDEYMBYGA1UEAxMPU3ViIENBIDEgUm9vdCA1MIGfMA0GCSqGSIb3DQEBAQUAA4GN +ADCBiQKBgQCX+qJJ07/BLnrtg4M8eJbIsrlnr8BeComJ+5RZMqgq5CAvOz3OU09y +/GwLkzjD32Zu1XnQpE5BhEM8mXkM4F8ZGj31SxEoD4CwoHE0W5Bxwu8ehS5bnzsi +wxj4fB/vG3gXoERgRn6I66dgoFwqfDeZ+ieXCOiJurxpS3mTj621mwIDAQABo4IB +BjCCAQIwHQYDVR0OBBYEFAHptZnkbfmMQj0JEA+ndcYneEqvMIGRBgNVHSMEgYkw +gYaAFMHRoNRbC51+MWH5ORCfMRDg0ga1oWOkYTBfMQswCQYDVQQGEwJERTEQMA4G +A1UECBMHSGFtYnVyZzEXMBUGA1UEChMOT3Blbk9mZmljZS5vcmcxFDASBgNVBAsT +C0RldmVsb3BtZW50MQ8wDQYDVQQDEwZSb290IDWCCQDwPbapqZyjTjA8BgNVHR8E +NTAzMDGgL6AthitodHRwOi8vbG9jYWxob3N0Ojg5MDEvZGVtb0NBL2NybC9Sb290 +XzUuY3JsMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEFBQADgYEAbco0BZn/ +mUnTbZ2txpnanWyUYnftHDkj0ui2Pt9j3HwQP8Lt9AQmWAUBTO2pg0M6Xf5gbVtY +3JOMlGm2fwJIMJwx9H3e4N4E0tx5t2DCh/fHkqL1hqcMcDujpzURz6QoIaqLJFAu +lkG+ZgG9uewEDJLZiuegliSb8aKfWVlKMqQ= +-----END CERTIFICATE----- diff --git a/xmlsecurity/test_docs/CAs/Root_5/demoCA/private/cakey.pem b/xmlsecurity/test_docs/CAs/Root_5/demoCA/private/cakey.pem new file mode 100755 index 000000000000..222320a9a05e --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_5/demoCA/private/cakey.pem @@ -0,0 +1,18 @@ +-----BEGIN RSA PRIVATE KEY----- +Proc-Type: 4,ENCRYPTED +DEK-Info: DES-EDE3-CBC,5F2D7F26BBEBD8FB + +qFyJ/G/DFwA+Kx3cVldc6bOMRbbduL7x5DBjCqS20YfoQoyvDcyel8FYz4/8CQ9d +kmb4nrM0Dj8/FgDiite2E8+qJV4U8OIBsXelFd8FWC8hB4z0DtwVxIAiM6mTMMcu +bWta3Lu5xrNvU/vosB967COztoYB5XLLQ/DrRPoV+tvJx0Le3zXLzceIj4PicuIk +/Mh5NVqN5a5blaV1/1JvcfOQLCI0rNebP3iAYhwCkKyu6WkpSNuHIw5gaMC6KXpq +ORPf3m+3/YKHLS9/tg+9CPQrRpyzLV/TOUduq6HFfzh9ZRXd04Dpn0P61JVCypYo +9u62lnNCAtreyvCUttzANLgujbgT9HNsjzKTAD2g+zjwQPgIS4epNm5LBPsQv15A +Vuw7CnNlLa8PxUxuDUjoW2YaGUR3PHNUz+TA1U0UFxlNK/lgeekIvmSvPjVyROOB +SxOH88yAZWe6pWioS3uzeg1kf1F5sj9u+KHPyikUe3nUBrS1cZSRtQczhlWWocgm +GtfwQSSVSwRtd7CWe/nQHuSJyrIJCbWFaDhnVXRhr+tyDpLtoeApCvefvel0p/AY +LTaRcno3zUxZS3G8Cv71hBPR8y5di5dAxBSfLgMYxwBD3UFO6CPkmiJteIhHska9 +FJqR98hfvF+0hwFnaFUTszDMGK1xV20MeTMhLAwSlttbuwtWMTourFKtS6t1SomB +JOTkpiVfojTSAJX40ExQgNtvY+7ayNUBLX9NIuIcOjFbQa1LNmGy9cOPQD49x067 +fALGA+V1KO7sFeUrunkpHncYoux5OThq3iDJ2tPfBmyhTQhOSzN38w== +-----END RSA PRIVATE KEY----- diff --git a/xmlsecurity/test_docs/CAs/Root_5/demoCA/serial b/xmlsecurity/test_docs/CAs/Root_5/demoCA/serial new file mode 100755 index 000000000000..7d802a3e7104 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_5/demoCA/serial @@ -0,0 +1 @@ +1002 diff --git a/xmlsecurity/test_docs/CAs/Root_5/openssl.cfg b/xmlsecurity/test_docs/CAs/Root_5/openssl.cfg new file mode 100755 index 000000000000..7a23cf2df5b9 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_5/openssl.cfg @@ -0,0 +1,292 @@ +# +# OpenSSL example configuration file. +# This is mostly being used for generation of certificate requests. +# + +# This definition stops the following lines choking if HOME isn't +# defined. +HOME = . +RANDFILE = $ENV::HOME/.rnd + +# Extra OBJECT IDENTIFIER info: +#oid_file = $ENV::HOME/.oid +oid_section = new_oids + +# To use this configuration file with the "-extfile" option of the +# "openssl x509" utility, name here the section containing the +# X.509v3 extensions to use: +# extensions = +# (Alternatively, use a configuration file that has only +# X.509v3 extensions in its main [= default] section.) + +[ new_oids ] + +# We can add new OIDs in here for use by 'ca' and 'req'. +# Add a simple OID like this: +# testoid1=1.2.3.4 +# Or use config file substitution like this: +# testoid2=${testoid1}.5.6 + +#################################################################### +[ ca ] +default_ca = CA_default # The default ca section + +#################################################################### +[ CA_default ] + +dir = ./demoCA # Where everything is kept +certs = $dir/certs # Where the issued certs are kept +crl_dir = $dir/crl # Where the issued crl are kept +database = $dir/index.txt # database index file. +#unique_subject = no # Set to 'no' to allow creation of + # several ctificates with same subject. +new_certs_dir = $dir/newcerts # default place for new certs. + +certificate = $dir/cacert.pem # The CA certificate +serial = $dir/serial # The current serial number +crlnumber = $dir/crlnumber # the current crl number + # must be commented out to leave a V1 CRL +crl = $dir/crl.pem # The current CRL +private_key = $dir/private/cakey.pem # The private key +RANDFILE = $dir/private/.rand # private random number file + +x509_extensions = usr_cert # The extentions to add to the cert + +# Comment out the following two lines for the "traditional" +# (and highly broken) format. +name_opt = ca_default # Subject Name options +cert_opt = ca_default # Certificate field options + +# Extension copying option: use with caution. +# copy_extensions = copy + +# Extensions to add to a CRL. Note: Netscape communicator chokes on V2 CRLs +# so this is commented out by default to leave a V1 CRL. +# crlnumber must also be commented out to leave a V1 CRL. +# crl_extensions = crl_ext + +default_days = 365 # how long to certify for +default_crl_days= 30 # how long before next CRL +default_md = sha1 # which md to use. +preserve = no # keep passed DN ordering + +# A few difference way of specifying how similar the request should look +# For type CA, the listed attributes must be the same, and the optional +# and supplied fields are just that :-) +policy = policy_match + +# For the CA policy +[ policy_match ] +countryName = match +stateOrProvinceName = match +organizationName = match +organizationalUnitName = optional +commonName = supplied +emailAddress = optional + +# For the 'anything' policy +# At this point in time, you must list all acceptable 'object' +# types. +[ policy_anything ] +countryName = optional +stateOrProvinceName = optional +localityName = optional +organizationName = optional +organizationalUnitName = optional +commonName = supplied +emailAddress = optional + +#################################################################### +[ req ] +default_bits = 1024 +default_keyfile = privkey.pem +distinguished_name = req_distinguished_name +attributes = req_attributes +x509_extensions = v3_ca # The extentions to add to the self signed cert + +# Passwords for private keys if not present they will be prompted for +# input_password = secret +# output_password = secret + +# This sets a mask for permitted string types. There are several options. +# default: PrintableString, T61String, BMPString. +# pkix : PrintableString, BMPString. +# utf8only: only UTF8Strings. +# nombstr : PrintableString, T61String (no BMPStrings or UTF8Strings). +# MASK:XXXX a literal mask value. +# WARNING: current versions of Netscape crash on BMPStrings or UTF8Strings +# so use this option with caution! +string_mask = nombstr + +# req_extensions = v3_req # The extensions to add to a certificate request + +[ req_distinguished_name ] +countryName = Country Name (2 letter code) +countryName_default = DE +countryName_min = 2 +countryName_max = 2 + +stateOrProvinceName = State or Province Name (full name) +stateOrProvinceName_default = Hamburg + +localityName = Locality Name (eg, city) + +0.organizationName = Organization Name (eg, company) +0.organizationName_default = OpenOffice.org + +# we can do this but it is not needed normally :-) +#1.organizationName = Second Organization Name (eg, company) +#1.organizationName_default = World Wide Web Pty Ltd + +organizationalUnitName = Organizational Unit Name (eg, section) +organizationalUnitName_default = Development + +commonName = Common Name (eg, YOUR name) +commonName_max = 64 + +emailAddress = Email Address +emailAddress_max = 64 + +# SET-ex3 = SET extension number 3 + +[ req_attributes ] +challengePassword = A challenge password +challengePassword_min = 4 +challengePassword_max = 20 + +unstructuredName = An optional company name + +[ usr_cert ] + +# These extensions are added when 'ca' signs a request. +#authorityInfoAccess = OCSP;URI:http://localhost:8888/ + +# This is typical in keyUsage for a client certificate. +keyUsage = nonRepudiation, digitalSignature, keyEncipherment + +# This will be displayed in Netscape's comment listbox. +nsComment = "OpenSSL Generated Certificate" + +# PKIX recommendations harmless if included in all certificates. +subjectKeyIdentifier=hash +authorityKeyIdentifier=keyid,issuer + +# This stuff is for subjectAltName and issuerAltname. +# Import the email address. +# subjectAltName=email:copy +# An alternative to produce certificates that aren't +# deprecated according to PKIX. +# subjectAltName=email:move + +# Copy subject details +# issuerAltName=issuer:copy + + + +[ v3_req ] + +# Extensions to add to a certificate request + +basicConstraints = CA:FALSE +keyUsage = nonRepudiation, digitalSignature, keyEncipherment +#authorityInfoAccess = OCSP;URI:http://localhost:8888/ + +[ v3_ca ] + + +# Extensions for a typical CA + + +# PKIX recommendation. + +subjectKeyIdentifier=hash + +authorityKeyIdentifier=keyid:always,issuer:always + +#authorityInfoAccess = OCSP;URI:http://localhost:8888 +crlDistributionPoints=URI:http://localhost:8901/demoCA/crl/Root_5.crl +# This is what PKIX recommends but some broken software chokes on critical +# extensions. +#basicConstraints = critical,CA:true +# So we do this instead. +basicConstraints = critical, CA:true + +# Key usage: this is typical for a CA certificate. However since it will +# prevent it being used as an test self-signed certificate it is best +# left out by default. +# keyUsage = cRLSign, keyCertSign + +# Some might want this also +# nsCertType = sslCA, emailCA + +# Include email address in subject alt name: another PKIX recommendation +# subjectAltName=email:copy +# Copy issuer details +# issuerAltName=issuer:copy + +# DER hex encoding of an extension: beware experts only! +# obj=DER:02:03 +# Where 'obj' is a standard or added object +# You can even override a supported extension: +# basicConstraints= critical, DER:30:03:01:01:FF + +[ crl_ext ] + +# CRL extensions. +# Only issuerAltName and authorityKeyIdentifier make any sense in a CRL. + +# issuerAltName=issuer:copy +authorityKeyIdentifier=keyid:always,issuer:always + +[ proxy_cert_ext ] +# These extensions should be added when creating a proxy certificate + +# This goes against PKIX guidelines but some CAs do it and some software +# requires this to avoid interpreting an end user certificate as a CA. + +basicConstraints=CA:FALSE + +# Here are some examples of the usage of nsCertType. If it is omitted +# the certificate can be used for anything *except* object signing. + +# This is OK for an SSL server. +# nsCertType = server + +# For an object signing certificate this would be used. +# nsCertType = objsign + +# For normal client use this is typical +# nsCertType = client, email + +# and for everything including object signing: +# nsCertType = client, email, objsign + +# This is typical in keyUsage for a client certificate. +# keyUsage = nonRepudiation, digitalSignature, keyEncipherment + +# This will be displayed in Netscape's comment listbox. +nsComment = "OpenSSL Generated Certificate" + +# PKIX recommendations harmless if included in all certificates. +subjectKeyIdentifier=hash +authorityKeyIdentifier=keyid,issuer:always + +# This stuff is for subjectAltName and issuerAltname. +# Import the email address. +# subjectAltName=email:copy +# An alternative to produce certificates that aren't +# deprecated according to PKIX. +# subjectAltName=email:move + +# Copy subject details +# issuerAltName=issuer:copy + +#nsCaRevocationUrl = http://www.domain.dom/ca-crl.pem +#nsBaseUrl +#nsRevocationUrl +#nsRenewalUrl +#nsCaPolicyUrl +#nsSslServerName + +# This really needs to be in place for it to be a proxy certificate. +proxyCertInfo=critical,language:id-ppl-anyLanguage,pathlen:3,policy:foo diff --git a/xmlsecurity/test_docs/CAs/Root_6/README.txt b/xmlsecurity/test_docs/CAs/Root_6/README.txt new file mode 100755 index 000000000000..e49615a51c0c --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_6/README.txt @@ -0,0 +1,5 @@ +To provide the CRL via HTTP run + +java -jar ../../tools/httpserv/dist/httpserv.jar -a 8901 + + diff --git a/xmlsecurity/test_docs/CAs/Root_6/demoCA/cacert.pem b/xmlsecurity/test_docs/CAs/Root_6/demoCA/cacert.pem new file mode 100755 index 000000000000..5a7fc185b421 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_6/demoCA/cacert.pem @@ -0,0 +1,19 @@ +-----BEGIN CERTIFICATE----- +MIIDBDCCAm2gAwIBAgIJANhqTyT5yZQnMA0GCSqGSIb3DQEBBQUAMF8xCzAJBgNV +BAYTAkRFMRAwDgYDVQQIEwdIYW1idXJnMRcwFQYDVQQKEw5PcGVuT2ZmaWNlLm9y +ZzEUMBIGA1UECxMLRGV2ZWxvcG1lbnQxDzANBgNVBAMTBlJvb3QgNjAeFw0wOTEx +MjAxMjI2MDFaFw0zNDExMTQxMjI2MDFaMF8xCzAJBgNVBAYTAkRFMRAwDgYDVQQI +EwdIYW1idXJnMRcwFQYDVQQKEw5PcGVuT2ZmaWNlLm9yZzEUMBIGA1UECxMLRGV2 +ZWxvcG1lbnQxDzANBgNVBAMTBlJvb3QgNjCBnzANBgkqhkiG9w0BAQEFAAOBjQAw +gYkCgYEAslt6KM0bikDy8n0lNMeaNQiZk9Pcfsf6Vaasn9A8FABFn1chxV5zOMag +jo6CyZG1CNLhA841RtgiWVMc8BA+pDKzOQAzfgSk4VjXaY8nYgKEmGDKuNvls+kE +OKMkJibh/scNMDUOx8Bnc6S9LyYJAhZFrxm/lgmoIo7QMcdseIsCAwEAAaOBxzCB +xDAdBgNVHQ4EFgQUrCVem7W6TY69d7Kd2eKErnoxj/IwgZEGA1UdIwSBiTCBhoAU +rCVem7W6TY69d7Kd2eKErnoxj/KhY6RhMF8xCzAJBgNVBAYTAkRFMRAwDgYDVQQI +EwdIYW1idXJnMRcwFQYDVQQKEw5PcGVuT2ZmaWNlLm9yZzEUMBIGA1UECxMLRGV2 +ZWxvcG1lbnQxDzANBgNVBAMTBlJvb3QgNoIJANhqTyT5yZQnMA8GA1UdEwEB/wQF +MAMBAf8wDQYJKoZIhvcNAQEFBQADgYEAU6Sjyeo650mhSGK8JJBhDroVJgAryVF4 +wXEKWxK0yuO0TVZJxUWeHOESpegBW1eP5m9Pz0IHnxj6MsGBYq7SZU84awt4HJto +6O1ARZYfT9r+qTts33I/VVQVTJbvETF1vGsuAZfTTDhAJDqS2oueiPDSinzQxNMy +16L4Rajm8LE= +-----END CERTIFICATE----- diff --git a/xmlsecurity/test_docs/CAs/Root_6/demoCA/crl/DO_NOT_INSTALL_THIS_CRL b/xmlsecurity/test_docs/CAs/Root_6/demoCA/crl/DO_NOT_INSTALL_THIS_CRL new file mode 100755 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_6/demoCA/crl/DO_NOT_INSTALL_THIS_CRL diff --git a/xmlsecurity/test_docs/CAs/Root_6/demoCA/crl/Root_6.crl b/xmlsecurity/test_docs/CAs/Root_6/demoCA/crl/Root_6.crl Binary files differnew file mode 100755 index 000000000000..df6dcb21eec7 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_6/demoCA/crl/Root_6.crl diff --git a/xmlsecurity/test_docs/CAs/Root_6/demoCA/crlnumber b/xmlsecurity/test_docs/CAs/Root_6/demoCA/crlnumber new file mode 100755 index 000000000000..dd11724042e2 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_6/demoCA/crlnumber @@ -0,0 +1 @@ +1001 diff --git a/xmlsecurity/test_docs/CAs/Root_6/demoCA/index.txt b/xmlsecurity/test_docs/CAs/Root_6/demoCA/index.txt new file mode 100755 index 000000000000..7f0df0d959b5 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_6/demoCA/index.txt @@ -0,0 +1 @@ +V 341114122807Z 1001 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=Sub CA 1 Root 6 diff --git a/xmlsecurity/test_docs/CAs/Root_6/demoCA/index.txt.attr b/xmlsecurity/test_docs/CAs/Root_6/demoCA/index.txt.attr new file mode 100755 index 000000000000..8f7e63a3475c --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_6/demoCA/index.txt.attr @@ -0,0 +1 @@ +unique_subject = yes diff --git a/xmlsecurity/test_docs/CAs/Root_6/demoCA/newcerts/1001.pem b/xmlsecurity/test_docs/CAs/Root_6/demoCA/newcerts/1001.pem new file mode 100755 index 000000000000..0490b88cd769 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_6/demoCA/newcerts/1001.pem @@ -0,0 +1,66 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 4097 (0x1001) + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 6 + Validity + Not Before: Nov 20 12:28:07 2009 GMT + Not After : Nov 14 12:28:07 2034 GMT + Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Sub CA 1 Root 6 + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public Key: (1024 bit) + Modulus (1024 bit): + 00:c4:d9:ab:27:06:66:41:0e:36:ff:d4:b1:d0:8c: + f7:b4:25:55:cd:fd:fa:a4:5a:e6:4f:d0:05:dc:a3: + e5:bd:8d:53:77:d1:ea:95:5a:52:81:c8:b6:36:a0: + 5f:3a:e1:85:1e:8a:48:91:7d:29:78:ff:ea:c5:e3: + ad:c4:27:d5:b7:8f:59:20:26:d4:45:87:6a:56:db: + ac:f5:f8:0a:88:82:9e:c2:00:06:fc:98:8a:fe:35: + c3:02:a1:67:08:06:42:e3:88:48:e0:8f:33:ff:f8: + a4:87:1a:3a:d9:54:0e:1c:09:3e:a0:f0:70:cd:b5: + b0:b2:7e:07:73:ad:20:64:69 + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Subject Key Identifier: + 89:8C:D7:71:EB:67:78:4E:D6:01:35:B2:AC:A1:B4:88:43:CE:70:A7 + X509v3 Authority Key Identifier: + keyid:AC:25:5E:9B:B5:BA:4D:8E:BD:77:B2:9D:D9:E2:84:AE:7A:31:8F:F2 + DirName:/C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=Root 6 + serial:D8:6A:4F:24:F9:C9:94:27 + + X509v3 CRL Distribution Points: + URI:http://localhost:8901/demoCA/crl/Root_6.crl + + X509v3 Basic Constraints: critical + CA:TRUE + Signature Algorithm: sha1WithRSAEncryption + 55:5b:3b:6b:8a:d0:1b:d8:19:d9:96:85:4d:b4:a0:98:b1:bd: + 9f:0b:62:21:92:8b:4e:d3:d0:1b:91:3d:e3:f5:bd:ce:16:57: + fc:b7:84:15:51:fd:98:ab:32:59:28:0b:44:57:49:ec:ac:11: + 67:26:7a:a3:c5:b8:9d:2a:de:b6:7c:76:0a:e9:18:9f:98:87: + e8:80:c8:72:99:56:74:ab:73:1b:f4:e7:b9:b1:3a:f3:7b:0d: + 2f:5d:82:6c:d1:99:9f:23:be:23:fb:4c:0e:15:5e:f5:9f:90: + 88:d7:51:3a:6a:7a:f0:54:a5:c4:89:a5:0d:0a:4e:94:59:64: + 59:54 +-----BEGIN CERTIFICATE----- +MIIDRjCCAq+gAwIBAgICEAEwDQYJKoZIhvcNAQEFBQAwXzELMAkGA1UEBhMCREUx +EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD +VQQLEwtEZXZlbG9wbWVudDEPMA0GA1UEAxMGUm9vdCA2MB4XDTA5MTEyMDEyMjgw +N1oXDTM0MTExNDEyMjgwN1owaDELMAkGA1UEBhMCREUxEDAOBgNVBAgTB0hhbWJ1 +cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtEZXZlbG9wbWVu +dDEYMBYGA1UEAxMPU3ViIENBIDEgUm9vdCA2MIGfMA0GCSqGSIb3DQEBAQUAA4GN +ADCBiQKBgQDE2asnBmZBDjb/1LHQjPe0JVXN/fqkWuZP0AXco+W9jVN30eqVWlKB +yLY2oF864YUeikiRfSl4/+rF463EJ9W3j1kgJtRFh2pW26z1+AqIgp7CAAb8mIr+ +NcMCoWcIBkLjiEjgjzP/+KSHGjrZVA4cCT6g8HDNtbCyfgdzrSBkaQIDAQABo4IB +BjCCAQIwHQYDVR0OBBYEFImM13HrZ3hO1gE1sqyhtIhDznCnMIGRBgNVHSMEgYkw +gYaAFKwlXpu1uk2OvXeyndnihK56MY/yoWOkYTBfMQswCQYDVQQGEwJERTEQMA4G +A1UECBMHSGFtYnVyZzEXMBUGA1UEChMOT3Blbk9mZmljZS5vcmcxFDASBgNVBAsT +C0RldmVsb3BtZW50MQ8wDQYDVQQDEwZSb290IDaCCQDYak8k+cmUJzA8BgNVHR8E +NTAzMDGgL6AthitodHRwOi8vbG9jYWxob3N0Ojg5MDEvZGVtb0NBL2NybC9Sb290 +XzYuY3JsMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEFBQADgYEAVVs7a4rQ +G9gZ2ZaFTbSgmLG9nwtiIZKLTtPQG5E94/W9zhZX/LeEFVH9mKsyWSgLRFdJ7KwR +ZyZ6o8W4nSretnx2CukYn5iH6IDIcplWdKtzG/TnubE683sNL12CbNGZnyO+I/tM +DhVe9Z+QiNdROmp68FSlxImlDQpOlFlkWVQ= +-----END CERTIFICATE----- diff --git a/xmlsecurity/test_docs/CAs/Root_6/demoCA/private/cakey.pem b/xmlsecurity/test_docs/CAs/Root_6/demoCA/private/cakey.pem new file mode 100755 index 000000000000..166be0166530 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_6/demoCA/private/cakey.pem @@ -0,0 +1,18 @@ +-----BEGIN RSA PRIVATE KEY----- +Proc-Type: 4,ENCRYPTED +DEK-Info: DES-EDE3-CBC,BADC417CBCEF5888 + +5vIfuyyd2rgqSPUElPa2YM8on+FeoYuAIB+mfVHy0nSGisUKjmQQACaeTVD+aO6S +UFBz3W/RJXCj/8x5+ZYa8Rj44DeSwlDrxSy5VBrWegOzujfGPqrzwCL/ASKGPPFN +RwK0i0niJsj6+oQOGgP6AIb08reX1tkT0GItwQMjIQAFETcDP8m1sA1kFpLhvBCF +dHyw0lfnh+NZ9nnpAdpVXwt8teccLUyEHARNscebg8vqjc2gRxi3KpT3pURg0dUc +eaGH8DIB5CuAYW2Mo1LLRQ0uvkFgSl56WcolYiRTy2KUMW7Gz7oBA5Qyb9lz25yV +9djt4Hrs9cI1p1TGmvSklGPKJUaTf0Yrf0XRkS6xknFVX4zzkbD4vYFelITSxeMT +pPVbjLSWiIo+mqBuW6i+LUNMt45b1RWM96pomrPRrGne4saJOkhVXTvv/pR4KB+S +J2iwlEDNOwzkxeqSB7lJuzIce/iUqERAzlXe8e0VVgy0P0UfOIViLWS98cuqR86H +P1rMYtWilAkLKBUYo+lS7f/3YD8E3V10XdBmYJFvmpHPXM2SP5HQZXtoNCXJNcvB +aAlb3c7InxfqLLn+kH6WgPzXXcXO7cxlZ3cXBbJf3IhRT3aBEnAH+s+DDCi0RCII +UiLOnrgfOEZuNyRhGin9R7WFRtnGYJjHTP54FMOY0f0Rj7ElT+xymeAZE8wyXKfi +MWDgswTYYkcC7uPJAJ8HnLtFixr9aEriug7yemGyr686oX8gLPdwrYwPYJBt7Q+b +0nf22SoMqMNWSCWcr89sc1AIb0ebX+FxtsN6j45ztEjZGjXYkk2iXQ== +-----END RSA PRIVATE KEY----- diff --git a/xmlsecurity/test_docs/CAs/Root_6/demoCA/serial b/xmlsecurity/test_docs/CAs/Root_6/demoCA/serial new file mode 100755 index 000000000000..7d802a3e7104 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_6/demoCA/serial @@ -0,0 +1 @@ +1002 diff --git a/xmlsecurity/test_docs/CAs/Root_6/openssl.cfg b/xmlsecurity/test_docs/CAs/Root_6/openssl.cfg new file mode 100755 index 000000000000..ee8469fe548b --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_6/openssl.cfg @@ -0,0 +1,292 @@ +# +# OpenSSL example configuration file. +# This is mostly being used for generation of certificate requests. +# + +# This definition stops the following lines choking if HOME isn't +# defined. +HOME = . +RANDFILE = $ENV::HOME/.rnd + +# Extra OBJECT IDENTIFIER info: +#oid_file = $ENV::HOME/.oid +oid_section = new_oids + +# To use this configuration file with the "-extfile" option of the +# "openssl x509" utility, name here the section containing the +# X.509v3 extensions to use: +# extensions = +# (Alternatively, use a configuration file that has only +# X.509v3 extensions in its main [= default] section.) + +[ new_oids ] + +# We can add new OIDs in here for use by 'ca' and 'req'. +# Add a simple OID like this: +# testoid1=1.2.3.4 +# Or use config file substitution like this: +# testoid2=${testoid1}.5.6 + +#################################################################### +[ ca ] +default_ca = CA_default # The default ca section + +#################################################################### +[ CA_default ] + +dir = ./demoCA # Where everything is kept +certs = $dir/certs # Where the issued certs are kept +crl_dir = $dir/crl # Where the issued crl are kept +database = $dir/index.txt # database index file. +#unique_subject = no # Set to 'no' to allow creation of + # several ctificates with same subject. +new_certs_dir = $dir/newcerts # default place for new certs. + +certificate = $dir/cacert.pem # The CA certificate +serial = $dir/serial # The current serial number +crlnumber = $dir/crlnumber # the current crl number + # must be commented out to leave a V1 CRL +crl = $dir/crl.pem # The current CRL +private_key = $dir/private/cakey.pem # The private key +RANDFILE = $dir/private/.rand # private random number file + +x509_extensions = usr_cert # The extentions to add to the cert + +# Comment out the following two lines for the "traditional" +# (and highly broken) format. +name_opt = ca_default # Subject Name options +cert_opt = ca_default # Certificate field options + +# Extension copying option: use with caution. +# copy_extensions = copy + +# Extensions to add to a CRL. Note: Netscape communicator chokes on V2 CRLs +# so this is commented out by default to leave a V1 CRL. +# crlnumber must also be commented out to leave a V1 CRL. +# crl_extensions = crl_ext + +default_days = 365 # how long to certify for +default_crl_days= 30 # how long before next CRL +default_md = sha1 # which md to use. +preserve = no # keep passed DN ordering + +# A few difference way of specifying how similar the request should look +# For type CA, the listed attributes must be the same, and the optional +# and supplied fields are just that :-) +policy = policy_match + +# For the CA policy +[ policy_match ] +countryName = match +stateOrProvinceName = match +organizationName = match +organizationalUnitName = optional +commonName = supplied +emailAddress = optional + +# For the 'anything' policy +# At this point in time, you must list all acceptable 'object' +# types. +[ policy_anything ] +countryName = optional +stateOrProvinceName = optional +localityName = optional +organizationName = optional +organizationalUnitName = optional +commonName = supplied +emailAddress = optional + +#################################################################### +[ req ] +default_bits = 1024 +default_keyfile = privkey.pem +distinguished_name = req_distinguished_name +attributes = req_attributes +x509_extensions = v3_ca # The extentions to add to the self signed cert + +# Passwords for private keys if not present they will be prompted for +# input_password = secret +# output_password = secret + +# This sets a mask for permitted string types. There are several options. +# default: PrintableString, T61String, BMPString. +# pkix : PrintableString, BMPString. +# utf8only: only UTF8Strings. +# nombstr : PrintableString, T61String (no BMPStrings or UTF8Strings). +# MASK:XXXX a literal mask value. +# WARNING: current versions of Netscape crash on BMPStrings or UTF8Strings +# so use this option with caution! +string_mask = nombstr + +# req_extensions = v3_req # The extensions to add to a certificate request + +[ req_distinguished_name ] +countryName = Country Name (2 letter code) +countryName_default = DE +countryName_min = 2 +countryName_max = 2 + +stateOrProvinceName = State or Province Name (full name) +stateOrProvinceName_default = Hamburg + +localityName = Locality Name (eg, city) + +0.organizationName = Organization Name (eg, company) +0.organizationName_default = OpenOffice.org + +# we can do this but it is not needed normally :-) +#1.organizationName = Second Organization Name (eg, company) +#1.organizationName_default = World Wide Web Pty Ltd + +organizationalUnitName = Organizational Unit Name (eg, section) +organizationalUnitName_default = Development + +commonName = Common Name (eg, YOUR name) +commonName_max = 64 + +emailAddress = Email Address +emailAddress_max = 64 + +# SET-ex3 = SET extension number 3 + +[ req_attributes ] +challengePassword = A challenge password +challengePassword_min = 4 +challengePassword_max = 20 + +unstructuredName = An optional company name + +[ usr_cert ] + +# These extensions are added when 'ca' signs a request. +#authorityInfoAccess = OCSP;URI:http://localhost:8888/ + +# This is typical in keyUsage for a client certificate. +keyUsage = nonRepudiation, digitalSignature, keyEncipherment + +# This will be displayed in Netscape's comment listbox. +nsComment = "OpenSSL Generated Certificate" + +# PKIX recommendations harmless if included in all certificates. +subjectKeyIdentifier=hash +authorityKeyIdentifier=keyid,issuer + +# This stuff is for subjectAltName and issuerAltname. +# Import the email address. +# subjectAltName=email:copy +# An alternative to produce certificates that aren't +# deprecated according to PKIX. +# subjectAltName=email:move + +# Copy subject details +# issuerAltName=issuer:copy + + + +[ v3_req ] + +# Extensions to add to a certificate request + +basicConstraints = CA:FALSE +keyUsage = nonRepudiation, digitalSignature, keyEncipherment +#authorityInfoAccess = OCSP;URI:http://localhost:8888/ + +[ v3_ca ] + + +# Extensions for a typical CA + + +# PKIX recommendation. + +subjectKeyIdentifier=hash + +authorityKeyIdentifier=keyid:always,issuer:always + +#authorityInfoAccess = OCSP;URI:http://localhost:8888 +crlDistributionPoints=URI:http://localhost:8901/demoCA/crl/Root_6.crl +# This is what PKIX recommends but some broken software chokes on critical +# extensions. +#basicConstraints = critical,CA:true +# So we do this instead. +basicConstraints = critical, CA:true + +# Key usage: this is typical for a CA certificate. However since it will +# prevent it being used as an test self-signed certificate it is best +# left out by default. +# keyUsage = cRLSign, keyCertSign + +# Some might want this also +# nsCertType = sslCA, emailCA + +# Include email address in subject alt name: another PKIX recommendation +# subjectAltName=email:copy +# Copy issuer details +# issuerAltName=issuer:copy + +# DER hex encoding of an extension: beware experts only! +# obj=DER:02:03 +# Where 'obj' is a standard or added object +# You can even override a supported extension: +# basicConstraints= critical, DER:30:03:01:01:FF + +[ crl_ext ] + +# CRL extensions. +# Only issuerAltName and authorityKeyIdentifier make any sense in a CRL. + +# issuerAltName=issuer:copy +authorityKeyIdentifier=keyid:always,issuer:always + +[ proxy_cert_ext ] +# These extensions should be added when creating a proxy certificate + +# This goes against PKIX guidelines but some CAs do it and some software +# requires this to avoid interpreting an end user certificate as a CA. + +basicConstraints=CA:FALSE + +# Here are some examples of the usage of nsCertType. If it is omitted +# the certificate can be used for anything *except* object signing. + +# This is OK for an SSL server. +# nsCertType = server + +# For an object signing certificate this would be used. +# nsCertType = objsign + +# For normal client use this is typical +# nsCertType = client, email + +# and for everything including object signing: +# nsCertType = client, email, objsign + +# This is typical in keyUsage for a client certificate. +# keyUsage = nonRepudiation, digitalSignature, keyEncipherment + +# This will be displayed in Netscape's comment listbox. +nsComment = "OpenSSL Generated Certificate" + +# PKIX recommendations harmless if included in all certificates. +subjectKeyIdentifier=hash +authorityKeyIdentifier=keyid,issuer:always + +# This stuff is for subjectAltName and issuerAltname. +# Import the email address. +# subjectAltName=email:copy +# An alternative to produce certificates that aren't +# deprecated according to PKIX. +# subjectAltName=email:move + +# Copy subject details +# issuerAltName=issuer:copy + +#nsCaRevocationUrl = http://www.domain.dom/ca-crl.pem +#nsBaseUrl +#nsRevocationUrl +#nsRenewalUrl +#nsCaPolicyUrl +#nsSslServerName + +# This really needs to be in place for it to be a proxy certificate. +proxyCertInfo=critical,language:id-ppl-anyLanguage,pathlen:3,policy:foo diff --git a/xmlsecurity/test_docs/CAs/Root_7/README.txt b/xmlsecurity/test_docs/CAs/Root_7/README.txt new file mode 100755 index 000000000000..056f1b13397e --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_7/README.txt @@ -0,0 +1,10 @@ +Revoked certificates: + +- Sub CA 2 Root 7 + + +To provide the CRL via HTTP run + +java -jar ../../tools/httpserv/dist/httpserv.jar -a 8901 + + diff --git a/xmlsecurity/test_docs/CAs/Root_7/demoCA/cacert.pem b/xmlsecurity/test_docs/CAs/Root_7/demoCA/cacert.pem new file mode 100755 index 000000000000..01761f55bf00 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_7/demoCA/cacert.pem @@ -0,0 +1,19 @@ +-----BEGIN CERTIFICATE----- +MIIDBDCCAm2gAwIBAgIJANXmY18YCYKJMA0GCSqGSIb3DQEBBQUAMF8xCzAJBgNV +BAYTAkRFMRAwDgYDVQQIEwdIYW1idXJnMRcwFQYDVQQKEw5PcGVuT2ZmaWNlLm9y +ZzEUMBIGA1UECxMLRGV2ZWxvcG1lbnQxDzANBgNVBAMTBlJvb3QgNzAeFw0wOTEx +MjAxMzA0NDhaFw0zNDExMTQxMzA0NDhaMF8xCzAJBgNVBAYTAkRFMRAwDgYDVQQI +EwdIYW1idXJnMRcwFQYDVQQKEw5PcGVuT2ZmaWNlLm9yZzEUMBIGA1UECxMLRGV2 +ZWxvcG1lbnQxDzANBgNVBAMTBlJvb3QgNzCBnzANBgkqhkiG9w0BAQEFAAOBjQAw +gYkCgYEAvG//bRySIKOz1hmmH6qx02wtf2ZO2skK/wxPnTAd+LLuH2upOfGkaFCi +hd1zsIshs9/TjtLNa4nplkYSvZlYBsbpIuNQZrEedbvLYV/zNdsnLfht+aX3yMuk +q1dh2BI0LdwXiyMyPwATJwQ96AXq/a+cZi1ZRBToCztZArJK/xMCAwEAAaOBxzCB +xDAdBgNVHQ4EFgQUgMb4C198SeSG/ciSxoBw2cBve94wgZEGA1UdIwSBiTCBhoAU +gMb4C198SeSG/ciSxoBw2cBve96hY6RhMF8xCzAJBgNVBAYTAkRFMRAwDgYDVQQI +EwdIYW1idXJnMRcwFQYDVQQKEw5PcGVuT2ZmaWNlLm9yZzEUMBIGA1UECxMLRGV2 +ZWxvcG1lbnQxDzANBgNVBAMTBlJvb3QgN4IJANXmY18YCYKJMA8GA1UdEwEB/wQF +MAMBAf8wDQYJKoZIhvcNAQEFBQADgYEAg15QATKSYmz+XGtnBLDnWu2Gk59nglH4 +gG3p1xiVVgOyQVGsvNr+3ETPTTcf6x+ap1+AHE9SJJ0/WQSuUHtOv6y/prp4MWbw +/QBL2WHS7adTFWxOJ/VWpb8GhTtJdG9PKYeSmVAtC1qzdI1zsjPYvHO3UJnokDkB +fY7kpaTJprg= +-----END CERTIFICATE----- diff --git a/xmlsecurity/test_docs/CAs/Root_7/demoCA/crl/DO_NOT_INSTALL_THIS_CRL b/xmlsecurity/test_docs/CAs/Root_7/demoCA/crl/DO_NOT_INSTALL_THIS_CRL new file mode 100755 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_7/demoCA/crl/DO_NOT_INSTALL_THIS_CRL diff --git a/xmlsecurity/test_docs/CAs/Root_7/demoCA/crl/Root_7.crl b/xmlsecurity/test_docs/CAs/Root_7/demoCA/crl/Root_7.crl Binary files differnew file mode 100755 index 000000000000..0eefbda68048 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_7/demoCA/crl/Root_7.crl diff --git a/xmlsecurity/test_docs/CAs/Root_7/demoCA/crlnumber b/xmlsecurity/test_docs/CAs/Root_7/demoCA/crlnumber new file mode 100755 index 000000000000..dd11724042e2 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_7/demoCA/crlnumber @@ -0,0 +1 @@ +1001 diff --git a/xmlsecurity/test_docs/CAs/Root_7/demoCA/index.txt b/xmlsecurity/test_docs/CAs/Root_7/demoCA/index.txt new file mode 100755 index 000000000000..24c3538724a1 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_7/demoCA/index.txt @@ -0,0 +1,2 @@ +V 341114130753Z 1000 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=Sub CA 1 Root 7 +R 341114133506Z 091120133621Z,keyCompromise 1001 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=Sub CA 2 Root 7 diff --git a/xmlsecurity/test_docs/CAs/Root_7/demoCA/index.txt.attr b/xmlsecurity/test_docs/CAs/Root_7/demoCA/index.txt.attr new file mode 100755 index 000000000000..8f7e63a3475c --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_7/demoCA/index.txt.attr @@ -0,0 +1 @@ +unique_subject = yes diff --git a/xmlsecurity/test_docs/CAs/Root_7/demoCA/newcerts/1000.pem b/xmlsecurity/test_docs/CAs/Root_7/demoCA/newcerts/1000.pem new file mode 100755 index 000000000000..2dda8f2b286f --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_7/demoCA/newcerts/1000.pem @@ -0,0 +1,66 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 4096 (0x1000) + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 7 + Validity + Not Before: Nov 20 13:07:53 2009 GMT + Not After : Nov 14 13:07:53 2034 GMT + Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Sub CA 1 Root 7 + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public Key: (1024 bit) + Modulus (1024 bit): + 00:b0:ae:6d:0a:21:ae:8a:92:b1:16:25:d3:08:cb: + ac:b7:4c:53:6d:4b:b3:12:82:40:54:c9:44:28:fc: + 4e:10:e6:65:40:de:70:5d:8b:ab:1f:5c:77:03:43: + 3d:3a:3d:9e:f7:37:66:9a:33:68:a0:cf:ad:8f:f4: + fb:9c:a3:87:57:5d:ec:d6:55:5a:18:b5:e1:2b:d2: + c4:10:fe:f0:01:a5:da:29:ee:c4:af:15:c9:8c:dc: + 7c:45:84:bd:e5:5b:09:1f:16:1d:11:e7:61:e6:22: + e7:1f:c8:86:bf:a1:da:cb:fe:6b:7e:c0:6e:aa:7f: + 97:84:e8:8f:81:69:f1:26:87 + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Subject Key Identifier: + 54:64:15:7E:93:8A:19:C8:F9:B7:EF:60:A0:DF:5C:C8:15:56:C0:EE + X509v3 Authority Key Identifier: + keyid:80:C6:F8:0B:5F:7C:49:E4:86:FD:C8:92:C6:80:70:D9:C0:6F:7B:DE + DirName:/C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=Root 7 + serial:D5:E6:63:5F:18:09:82:89 + + X509v3 CRL Distribution Points: + URI:http://localhost:8901/demoCA/crl/Root_7.crl + + X509v3 Basic Constraints: critical + CA:TRUE + Signature Algorithm: sha1WithRSAEncryption + 1a:bc:5a:4b:9a:d5:e8:c0:35:c2:61:0a:58:7d:33:e2:87:01: + 61:83:80:42:8d:1a:7e:b1:9a:58:d5:01:fd:e7:ae:5c:c8:65: + fb:9e:1d:bf:49:ba:ed:40:f4:05:7c:3b:2d:db:0e:53:d0:05: + a0:bd:15:87:c4:37:22:0b:a0:04:a3:ad:cb:57:b2:00:97:ee: + 8f:89:91:8e:7d:0b:e2:27:96:6e:0f:ab:73:33:59:fa:9f:37: + f2:77:79:99:af:72:ad:f9:49:05:ed:55:08:31:eb:97:0f:99: + 6e:9c:a3:df:f0:52:1a:14:4e:78:25:0c:8b:02:cb:56:e9:4d: + f5:9f +-----BEGIN CERTIFICATE----- +MIIDRjCCAq+gAwIBAgICEAAwDQYJKoZIhvcNAQEFBQAwXzELMAkGA1UEBhMCREUx +EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD +VQQLEwtEZXZlbG9wbWVudDEPMA0GA1UEAxMGUm9vdCA3MB4XDTA5MTEyMDEzMDc1 +M1oXDTM0MTExNDEzMDc1M1owaDELMAkGA1UEBhMCREUxEDAOBgNVBAgTB0hhbWJ1 +cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtEZXZlbG9wbWVu +dDEYMBYGA1UEAxMPU3ViIENBIDEgUm9vdCA3MIGfMA0GCSqGSIb3DQEBAQUAA4GN +ADCBiQKBgQCwrm0KIa6KkrEWJdMIy6y3TFNtS7MSgkBUyUQo/E4Q5mVA3nBdi6sf +XHcDQz06PZ73N2aaM2igz62P9Puco4dXXezWVVoYteEr0sQQ/vABpdop7sSvFcmM +3HxFhL3lWwkfFh0R52HmIucfyIa/odrL/mt+wG6qf5eE6I+BafEmhwIDAQABo4IB +BjCCAQIwHQYDVR0OBBYEFFRkFX6TihnI+bfvYKDfXMgVVsDuMIGRBgNVHSMEgYkw +gYaAFIDG+AtffEnkhv3IksaAcNnAb3veoWOkYTBfMQswCQYDVQQGEwJERTEQMA4G +A1UECBMHSGFtYnVyZzEXMBUGA1UEChMOT3Blbk9mZmljZS5vcmcxFDASBgNVBAsT +C0RldmVsb3BtZW50MQ8wDQYDVQQDEwZSb290IDeCCQDV5mNfGAmCiTA8BgNVHR8E +NTAzMDGgL6AthitodHRwOi8vbG9jYWxob3N0Ojg5MDEvZGVtb0NBL2NybC9Sb290 +XzcuY3JsMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEFBQADgYEAGrxaS5rV +6MA1wmEKWH0z4ocBYYOAQo0afrGaWNUB/eeuXMhl+54dv0m67UD0BXw7LdsOU9AF +oL0Vh8Q3IgugBKOty1eyAJfuj4mRjn0L4ieWbg+rczNZ+p838nd5ma9yrflJBe1V +CDHrlw+Zbpyj3/BSGhROeCUMiwLLVulN9Z8= +-----END CERTIFICATE----- diff --git a/xmlsecurity/test_docs/CAs/Root_7/demoCA/newcerts/1001.pem b/xmlsecurity/test_docs/CAs/Root_7/demoCA/newcerts/1001.pem new file mode 100755 index 000000000000..0d2a0f02a3eb --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_7/demoCA/newcerts/1001.pem @@ -0,0 +1,66 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 4097 (0x1001) + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 7 + Validity + Not Before: Nov 20 13:35:06 2009 GMT + Not After : Nov 14 13:35:06 2034 GMT + Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Sub CA 2 Root 7 + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public Key: (1024 bit) + Modulus (1024 bit): + 00:f9:3f:5e:76:52:9a:ce:5d:98:b0:00:d8:e0:65: + e7:78:11:4c:7b:c7:e2:d3:44:bf:8e:60:42:69:3e: + 75:67:65:24:ab:f7:07:d8:9d:be:0f:23:b5:c1:26: + 00:6b:c3:22:84:72:a9:96:dc:5f:63:fc:f5:e0:e3: + cc:da:0c:74:e9:31:51:91:89:27:8f:e5:17:41:6e: + 3d:5e:2a:13:cd:08:f7:f3:61:34:a1:f7:79:c6:bd: + 5d:2c:34:01:ea:5a:8c:48:97:36:d6:57:e0:80:03: + 2e:7a:03:83:4c:bd:b4:af:a2:fd:d7:4b:1a:f7:ab: + 9f:5a:22:2b:d1:25:73:dd:6f + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Subject Key Identifier: + 3B:50:26:45:6C:E2:FE:28:B1:71:0A:A8:95:2D:78:63:8E:2C:48:92 + X509v3 Authority Key Identifier: + keyid:80:C6:F8:0B:5F:7C:49:E4:86:FD:C8:92:C6:80:70:D9:C0:6F:7B:DE + DirName:/C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=Root 7 + serial:D5:E6:63:5F:18:09:82:89 + + X509v3 CRL Distribution Points: + URI:http://localhost:8901/demoCA/crl/Root_7.crl + + X509v3 Basic Constraints: critical + CA:TRUE + Signature Algorithm: sha1WithRSAEncryption + 5f:b4:70:11:4f:d9:df:6a:6a:5a:4a:97:fe:8b:5d:9e:46:84: + e2:27:67:41:7c:a9:2e:9d:77:cc:e4:8c:d6:16:3c:39:7d:51: + 29:60:80:32:4f:a1:d0:b4:7f:2a:e5:60:f4:b8:d3:3b:94:f8: + a5:fb:15:99:cf:a9:c5:a7:59:c1:11:89:67:11:9c:ff:a9:ac: + dd:ca:a9:92:a8:60:26:c3:ab:74:41:86:b9:4d:1e:4a:c5:de: + 63:e6:da:2a:36:39:7b:6c:66:f3:20:57:d1:f1:36:4b:69:c5: + 04:a3:1f:cf:de:0c:10:d0:3f:07:e2:8e:0f:cd:41:26:c9:2e: + e9:1b +-----BEGIN CERTIFICATE----- +MIIDRjCCAq+gAwIBAgICEAEwDQYJKoZIhvcNAQEFBQAwXzELMAkGA1UEBhMCREUx +EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD +VQQLEwtEZXZlbG9wbWVudDEPMA0GA1UEAxMGUm9vdCA3MB4XDTA5MTEyMDEzMzUw +NloXDTM0MTExNDEzMzUwNlowaDELMAkGA1UEBhMCREUxEDAOBgNVBAgTB0hhbWJ1 +cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtEZXZlbG9wbWVu +dDEYMBYGA1UEAxMPU3ViIENBIDIgUm9vdCA3MIGfMA0GCSqGSIb3DQEBAQUAA4GN +ADCBiQKBgQD5P152UprOXZiwANjgZed4EUx7x+LTRL+OYEJpPnVnZSSr9wfYnb4P +I7XBJgBrwyKEcqmW3F9j/PXg48zaDHTpMVGRiSeP5RdBbj1eKhPNCPfzYTSh93nG +vV0sNAHqWoxIlzbWV+CAAy56A4NMvbSvov3XSxr3q59aIivRJXPdbwIDAQABo4IB +BjCCAQIwHQYDVR0OBBYEFDtQJkVs4v4osXEKqJUteGOOLEiSMIGRBgNVHSMEgYkw +gYaAFIDG+AtffEnkhv3IksaAcNnAb3veoWOkYTBfMQswCQYDVQQGEwJERTEQMA4G +A1UECBMHSGFtYnVyZzEXMBUGA1UEChMOT3Blbk9mZmljZS5vcmcxFDASBgNVBAsT +C0RldmVsb3BtZW50MQ8wDQYDVQQDEwZSb290IDeCCQDV5mNfGAmCiTA8BgNVHR8E +NTAzMDGgL6AthitodHRwOi8vbG9jYWxob3N0Ojg5MDEvZGVtb0NBL2NybC9Sb290 +XzcuY3JsMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEFBQADgYEAX7RwEU/Z +32pqWkqX/otdnkaE4idnQXypLp13zOSM1hY8OX1RKWCAMk+h0LR/KuVg9LjTO5T4 +pfsVmc+pxadZwRGJZxGc/6ms3cqpkqhgJsOrdEGGuU0eSsXeY+baKjY5e2xm8yBX +0fE2S2nFBKMfz94MENA/B+KOD81BJsku6Rs= +-----END CERTIFICATE----- diff --git a/xmlsecurity/test_docs/CAs/Root_7/demoCA/private/cakey.pem b/xmlsecurity/test_docs/CAs/Root_7/demoCA/private/cakey.pem new file mode 100755 index 000000000000..147ca4e9b6f7 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_7/demoCA/private/cakey.pem @@ -0,0 +1,18 @@ +-----BEGIN RSA PRIVATE KEY----- +Proc-Type: 4,ENCRYPTED +DEK-Info: DES-EDE3-CBC,B17A06040862AC63 + +9VJMswLGoelYtmpO17/f34Lb7j1I2vaK+RUg7fH09M6rQKurA2SmpsO7kJo7lMUb +lwXEC8+JC5b3OoUcPeHLkZ5e9bB+flMJQq+bkzWs4NWYI17gRs2Tc74xm04XRTsO +OYU+H7uOyRMAuS86hkQF13H3hCHcZkg8RZcvqfDXhsY8S7iyp0gErQv8IDmbIije +R7go3NdZXCmkuINKhhABFYnPxnEpaHxhIMNKykbSn+jby02LX57X/u4JDGfkzjCH +wyJMi9PiO7VbXvi8IPYnFz0IaCMVr5cltTh47/KiqACeAADQ6ETekrX9r7lngkRz +sqFuyqEtdi02ujElsGIaDCImQ5KbD2u2IQ3FX2b6Jwmd/uDmqQQwtEfarEoUxich +chCEUBGAiqRxLcrnRzjT+Reqgx7qGNurjP78kmKeD91hDm3tEHeWtecy4iA3C8z0 +aMZFOZLx1r7kf5/YaRMREcLPmreEWgFmkIMN004GdIvOwlsUjmAM7UMle+cef17v +h1hxbFsznzYLBk0zOYjmsTpI3dQHtxSUVsyUWXXVJ0Y4YhJSjMHlMOOCanGYOpGS +vipUNzLx4aIWfMmQdJePQM4uxO2FNwTc1IGyRpoOhj6vxroICuGK3WkxqZsN3VwR +hwNol0cNMNHbVacKvhh5PQJcmWiqmLEXaQD8VWgCNQVa0otS59vj+SeyW4ZvULBM +Od/9FhFfEBHQDxNSL+c6B/dXFIO1oY159ErdElAn+NPRtQcHAsnu8HknKLhry1NP +b4d+KZcTZAq9q97ltRQf9/hXBpA3ophMtbBFnnnh5WJuMMdDMNgGsg== +-----END RSA PRIVATE KEY----- diff --git a/xmlsecurity/test_docs/CAs/Root_7/demoCA/serial b/xmlsecurity/test_docs/CAs/Root_7/demoCA/serial new file mode 100755 index 000000000000..7d802a3e7104 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_7/demoCA/serial @@ -0,0 +1 @@ +1002 diff --git a/xmlsecurity/test_docs/CAs/Root_7/openssl.cfg b/xmlsecurity/test_docs/CAs/Root_7/openssl.cfg new file mode 100755 index 000000000000..a63458d084b4 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_7/openssl.cfg @@ -0,0 +1,292 @@ +# +# OpenSSL example configuration file. +# This is mostly being used for generation of certificate requests. +# + +# This definition stops the following lines choking if HOME isn't +# defined. +HOME = . +RANDFILE = $ENV::HOME/.rnd + +# Extra OBJECT IDENTIFIER info: +#oid_file = $ENV::HOME/.oid +oid_section = new_oids + +# To use this configuration file with the "-extfile" option of the +# "openssl x509" utility, name here the section containing the +# X.509v3 extensions to use: +# extensions = +# (Alternatively, use a configuration file that has only +# X.509v3 extensions in its main [= default] section.) + +[ new_oids ] + +# We can add new OIDs in here for use by 'ca' and 'req'. +# Add a simple OID like this: +# testoid1=1.2.3.4 +# Or use config file substitution like this: +# testoid2=${testoid1}.5.6 + +#################################################################### +[ ca ] +default_ca = CA_default # The default ca section + +#################################################################### +[ CA_default ] + +dir = ./demoCA # Where everything is kept +certs = $dir/certs # Where the issued certs are kept +crl_dir = $dir/crl # Where the issued crl are kept +database = $dir/index.txt # database index file. +#unique_subject = no # Set to 'no' to allow creation of + # several ctificates with same subject. +new_certs_dir = $dir/newcerts # default place for new certs. + +certificate = $dir/cacert.pem # The CA certificate +serial = $dir/serial # The current serial number +crlnumber = $dir/crlnumber # the current crl number + # must be commented out to leave a V1 CRL +crl = $dir/crl.pem # The current CRL +private_key = $dir/private/cakey.pem # The private key +RANDFILE = $dir/private/.rand # private random number file + +x509_extensions = usr_cert # The extentions to add to the cert + +# Comment out the following two lines for the "traditional" +# (and highly broken) format. +name_opt = ca_default # Subject Name options +cert_opt = ca_default # Certificate field options + +# Extension copying option: use with caution. +# copy_extensions = copy + +# Extensions to add to a CRL. Note: Netscape communicator chokes on V2 CRLs +# so this is commented out by default to leave a V1 CRL. +# crlnumber must also be commented out to leave a V1 CRL. +# crl_extensions = crl_ext + +default_days = 365 # how long to certify for +default_crl_days= 30 # how long before next CRL +default_md = sha1 # which md to use. +preserve = no # keep passed DN ordering + +# A few difference way of specifying how similar the request should look +# For type CA, the listed attributes must be the same, and the optional +# and supplied fields are just that :-) +policy = policy_match + +# For the CA policy +[ policy_match ] +countryName = match +stateOrProvinceName = match +organizationName = match +organizationalUnitName = optional +commonName = supplied +emailAddress = optional + +# For the 'anything' policy +# At this point in time, you must list all acceptable 'object' +# types. +[ policy_anything ] +countryName = optional +stateOrProvinceName = optional +localityName = optional +organizationName = optional +organizationalUnitName = optional +commonName = supplied +emailAddress = optional + +#################################################################### +[ req ] +default_bits = 1024 +default_keyfile = privkey.pem +distinguished_name = req_distinguished_name +attributes = req_attributes +x509_extensions = v3_ca # The extentions to add to the self signed cert + +# Passwords for private keys if not present they will be prompted for +# input_password = secret +# output_password = secret + +# This sets a mask for permitted string types. There are several options. +# default: PrintableString, T61String, BMPString. +# pkix : PrintableString, BMPString. +# utf8only: only UTF8Strings. +# nombstr : PrintableString, T61String (no BMPStrings or UTF8Strings). +# MASK:XXXX a literal mask value. +# WARNING: current versions of Netscape crash on BMPStrings or UTF8Strings +# so use this option with caution! +string_mask = nombstr + +# req_extensions = v3_req # The extensions to add to a certificate request + +[ req_distinguished_name ] +countryName = Country Name (2 letter code) +countryName_default = DE +countryName_min = 2 +countryName_max = 2 + +stateOrProvinceName = State or Province Name (full name) +stateOrProvinceName_default = Hamburg + +localityName = Locality Name (eg, city) + +0.organizationName = Organization Name (eg, company) +0.organizationName_default = OpenOffice.org + +# we can do this but it is not needed normally :-) +#1.organizationName = Second Organization Name (eg, company) +#1.organizationName_default = World Wide Web Pty Ltd + +organizationalUnitName = Organizational Unit Name (eg, section) +organizationalUnitName_default = Development + +commonName = Common Name (eg, YOUR name) +commonName_max = 64 + +emailAddress = Email Address +emailAddress_max = 64 + +# SET-ex3 = SET extension number 3 + +[ req_attributes ] +challengePassword = A challenge password +challengePassword_min = 4 +challengePassword_max = 20 + +unstructuredName = An optional company name + +[ usr_cert ] + +# These extensions are added when 'ca' signs a request. +#authorityInfoAccess = OCSP;URI:http://localhost:8888/ + +# This is typical in keyUsage for a client certificate. +keyUsage = nonRepudiation, digitalSignature, keyEncipherment + +# This will be displayed in Netscape's comment listbox. +nsComment = "OpenSSL Generated Certificate" + +# PKIX recommendations harmless if included in all certificates. +subjectKeyIdentifier=hash +authorityKeyIdentifier=keyid,issuer + +# This stuff is for subjectAltName and issuerAltname. +# Import the email address. +# subjectAltName=email:copy +# An alternative to produce certificates that aren't +# deprecated according to PKIX. +# subjectAltName=email:move + +# Copy subject details +# issuerAltName=issuer:copy + + + +[ v3_req ] + +# Extensions to add to a certificate request + +basicConstraints = CA:FALSE +keyUsage = nonRepudiation, digitalSignature, keyEncipherment +#authorityInfoAccess = OCSP;URI:http://localhost:8888/ + +[ v3_ca ] + + +# Extensions for a typical CA + + +# PKIX recommendation. + +subjectKeyIdentifier=hash + +authorityKeyIdentifier=keyid:always,issuer:always + +#authorityInfoAccess = OCSP;URI:http://localhost:8888 +crlDistributionPoints=URI:http://localhost:8901/demoCA/crl/Root_7.crl +# This is what PKIX recommends but some broken software chokes on critical +# extensions. +#basicConstraints = critical,CA:true +# So we do this instead. +basicConstraints = critical, CA:true + +# Key usage: this is typical for a CA certificate. However since it will +# prevent it being used as an test self-signed certificate it is best +# left out by default. +# keyUsage = cRLSign, keyCertSign + +# Some might want this also +# nsCertType = sslCA, emailCA + +# Include email address in subject alt name: another PKIX recommendation +# subjectAltName=email:copy +# Copy issuer details +# issuerAltName=issuer:copy + +# DER hex encoding of an extension: beware experts only! +# obj=DER:02:03 +# Where 'obj' is a standard or added object +# You can even override a supported extension: +# basicConstraints= critical, DER:30:03:01:01:FF + +[ crl_ext ] + +# CRL extensions. +# Only issuerAltName and authorityKeyIdentifier make any sense in a CRL. + +# issuerAltName=issuer:copy +authorityKeyIdentifier=keyid:always,issuer:always + +[ proxy_cert_ext ] +# These extensions should be added when creating a proxy certificate + +# This goes against PKIX guidelines but some CAs do it and some software +# requires this to avoid interpreting an end user certificate as a CA. + +basicConstraints=CA:FALSE + +# Here are some examples of the usage of nsCertType. If it is omitted +# the certificate can be used for anything *except* object signing. + +# This is OK for an SSL server. +# nsCertType = server + +# For an object signing certificate this would be used. +# nsCertType = objsign + +# For normal client use this is typical +# nsCertType = client, email + +# and for everything including object signing: +# nsCertType = client, email, objsign + +# This is typical in keyUsage for a client certificate. +# keyUsage = nonRepudiation, digitalSignature, keyEncipherment + +# This will be displayed in Netscape's comment listbox. +nsComment = "OpenSSL Generated Certificate" + +# PKIX recommendations harmless if included in all certificates. +subjectKeyIdentifier=hash +authorityKeyIdentifier=keyid,issuer:always + +# This stuff is for subjectAltName and issuerAltname. +# Import the email address. +# subjectAltName=email:copy +# An alternative to produce certificates that aren't +# deprecated according to PKIX. +# subjectAltName=email:move + +# Copy subject details +# issuerAltName=issuer:copy + +#nsCaRevocationUrl = http://www.domain.dom/ca-crl.pem +#nsBaseUrl +#nsRevocationUrl +#nsRenewalUrl +#nsCaPolicyUrl +#nsSslServerName + +# This really needs to be in place for it to be a proxy certificate. +proxyCertInfo=critical,language:id-ppl-anyLanguage,pathlen:3,policy:foo diff --git a/xmlsecurity/test_docs/CAs/Root_8/README.txt b/xmlsecurity/test_docs/CAs/Root_8/README.txt new file mode 100755 index 000000000000..d749d8ebcfe8 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_8/README.txt @@ -0,0 +1,9 @@ +Revoked certificates: + +- Sub CA 2 Root 8 + + +Start the OCSP responder: +openssl ocsp -index demoCA/index.txt -port 8888 -rsigner demoCA/cacert.pem -rkey demoCA/private/cakey.pem -CA demoCA/cacert.pem -text + + diff --git a/xmlsecurity/test_docs/CAs/Root_8/demoCA/cacert.pem b/xmlsecurity/test_docs/CAs/Root_8/demoCA/cacert.pem new file mode 100755 index 000000000000..ef431ec9528f --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_8/demoCA/cacert.pem @@ -0,0 +1,19 @@ +-----BEGIN CERTIFICATE----- +MIIDBDCCAm2gAwIBAgIJALJH3moqTIMZMA0GCSqGSIb3DQEBBQUAMF8xCzAJBgNV +BAYTAkRFMRAwDgYDVQQIEwdIYW1idXJnMRcwFQYDVQQKEw5PcGVuT2ZmaWNlLm9y +ZzEUMBIGA1UECxMLRGV2ZWxvcG1lbnQxDzANBgNVBAMTBlJvb3QgODAeFw0wOTEx +MjAxNTI4NTZaFw0zNDExMTQxNTI4NTZaMF8xCzAJBgNVBAYTAkRFMRAwDgYDVQQI +EwdIYW1idXJnMRcwFQYDVQQKEw5PcGVuT2ZmaWNlLm9yZzEUMBIGA1UECxMLRGV2 +ZWxvcG1lbnQxDzANBgNVBAMTBlJvb3QgODCBnzANBgkqhkiG9w0BAQEFAAOBjQAw +gYkCgYEAmR4R07C/I8zEPsAEQdc/nzH74hLjEwImtiWKL8nVc70fwquIRzWLaavm +DaQE3g/ha00d2hepB2dUiR1nV2GhMYdV64eq1utEPU+tTIYpx163axOGLYLWwKc3 +cBaR2mCqZmAkS+WABHkCX9hsBn+Ju/XNxLDVcpBohVrx882+3kMCAwEAAaOBxzCB +xDAdBgNVHQ4EFgQU1mZ2yQX/qVCIlmDd+8cwGHJnQRkwgZEGA1UdIwSBiTCBhoAU +1mZ2yQX/qVCIlmDd+8cwGHJnQRmhY6RhMF8xCzAJBgNVBAYTAkRFMRAwDgYDVQQI +EwdIYW1idXJnMRcwFQYDVQQKEw5PcGVuT2ZmaWNlLm9yZzEUMBIGA1UECxMLRGV2 +ZWxvcG1lbnQxDzANBgNVBAMTBlJvb3QgOIIJALJH3moqTIMZMA8GA1UdEwEB/wQF +MAMBAf8wDQYJKoZIhvcNAQEFBQADgYEAfZylT15q6Dnpvf9jWoCovzvUoBqAwL1Z +UDEikhCpajYsrfXI3MRvKYkTvt18lgg2Y09gJ2vhfLBCaDp+ELUq0Vc5hIbblGGO +EA4vBuH5Yfho3AK3gKAtk7Rc9l/qP2rBPb1JVw79pRaz95IkYGeOp35pVDQfBN+i +jji5JSyOeYQ= +-----END CERTIFICATE----- diff --git a/xmlsecurity/test_docs/CAs/Root_8/demoCA/crl/DO_NOT_INSTALL_THIS_CRL b/xmlsecurity/test_docs/CAs/Root_8/demoCA/crl/DO_NOT_INSTALL_THIS_CRL new file mode 100755 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_8/demoCA/crl/DO_NOT_INSTALL_THIS_CRL diff --git a/xmlsecurity/test_docs/CAs/Root_8/demoCA/crl/Root_8.crl b/xmlsecurity/test_docs/CAs/Root_8/demoCA/crl/Root_8.crl Binary files differnew file mode 100755 index 000000000000..8f91a1949a68 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_8/demoCA/crl/Root_8.crl diff --git a/xmlsecurity/test_docs/CAs/Root_8/demoCA/crlnumber b/xmlsecurity/test_docs/CAs/Root_8/demoCA/crlnumber new file mode 100755 index 000000000000..dd11724042e2 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_8/demoCA/crlnumber @@ -0,0 +1 @@ +1001 diff --git a/xmlsecurity/test_docs/CAs/Root_8/demoCA/index.txt b/xmlsecurity/test_docs/CAs/Root_8/demoCA/index.txt new file mode 100755 index 000000000000..831cbf1a38ed --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_8/demoCA/index.txt @@ -0,0 +1,2 @@ +V 341114153321Z 1000 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=Sub CA 1 Root 8 +R 341114155533Z 091120155655Z,superseded 1001 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=Sub CA 2 Root 8 diff --git a/xmlsecurity/test_docs/CAs/Root_8/demoCA/index.txt.attr b/xmlsecurity/test_docs/CAs/Root_8/demoCA/index.txt.attr new file mode 100755 index 000000000000..8f7e63a3475c --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_8/demoCA/index.txt.attr @@ -0,0 +1 @@ +unique_subject = yes diff --git a/xmlsecurity/test_docs/CAs/Root_8/demoCA/newcerts/1000.pem b/xmlsecurity/test_docs/CAs/Root_8/demoCA/newcerts/1000.pem new file mode 100755 index 000000000000..b2d1deb75960 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_8/demoCA/newcerts/1000.pem @@ -0,0 +1,66 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 4096 (0x1000) + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 8 + Validity + Not Before: Nov 20 15:33:21 2009 GMT + Not After : Nov 14 15:33:21 2034 GMT + Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Sub CA 1 Root 8 + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public Key: (1024 bit) + Modulus (1024 bit): + 00:96:79:01:9f:4f:68:c1:09:0d:44:3a:82:e4:eb: + ad:70:7a:cf:b9:71:e5:fb:e0:c8:0c:21:79:3e:cb: + 78:91:7f:4a:a0:de:3e:37:0f:a1:6b:73:10:12:9b: + 08:c4:96:dc:cb:a8:5b:87:9b:75:24:e4:00:5e:4a: + 6f:4c:13:79:1f:57:13:8c:3e:1b:38:31:e1:77:74: + 52:f9:94:47:36:57:33:bd:de:08:11:a3:01:e1:53: + 1c:bd:7b:39:9c:5e:96:5c:a9:61:6c:cc:2b:90:8d: + 5a:3c:9e:f4:4b:6e:e5:97:64:86:f3:8e:e8:72:20: + 5d:0d:50:bf:e9:cf:be:d4:13 + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Subject Key Identifier: + EF:BD:C8:8E:78:79:F9:76:4B:11:59:B6:C3:32:10:07:C0:BC:E3:8A + X509v3 Authority Key Identifier: + keyid:D6:66:76:C9:05:FF:A9:50:88:96:60:DD:FB:C7:30:18:72:67:41:19 + DirName:/C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=Root 8 + serial:B2:47:DE:6A:2A:4C:83:19 + + Authority Information Access: + OCSP - URI:http://localhost:8888 + + X509v3 Basic Constraints: critical + CA:TRUE + Signature Algorithm: sha1WithRSAEncryption + 4c:95:44:3b:57:08:ec:01:ec:f9:3e:7c:89:1c:30:b1:4e:26: + 32:b6:57:fa:25:bc:ed:eb:d4:a2:1c:67:ee:b9:8b:d0:4c:57: + 8a:0e:db:a0:9d:92:e7:de:c6:73:01:e7:de:61:1b:b5:0e:d0: + c5:c1:a7:a6:ab:e0:c6:0b:51:dd:e5:a2:32:1f:c6:52:ea:d3: + 03:68:3a:f5:92:bd:8b:b8:03:bb:50:70:63:cc:ec:ed:3c:11: + 76:ca:ac:72:47:ad:99:6b:8e:07:9e:38:f2:63:e1:ba:d4:df: + a9:73:54:1d:74:89:94:01:2e:68:dd:97:e7:53:f9:cf:b6:7d: + fc:87 +-----BEGIN CERTIFICATE----- +MIIDOTCCAqKgAwIBAgICEAAwDQYJKoZIhvcNAQEFBQAwXzELMAkGA1UEBhMCREUx +EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD +VQQLEwtEZXZlbG9wbWVudDEPMA0GA1UEAxMGUm9vdCA4MB4XDTA5MTEyMDE1MzMy +MVoXDTM0MTExNDE1MzMyMVowaDELMAkGA1UEBhMCREUxEDAOBgNVBAgTB0hhbWJ1 +cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtEZXZlbG9wbWVu +dDEYMBYGA1UEAxMPU3ViIENBIDEgUm9vdCA4MIGfMA0GCSqGSIb3DQEBAQUAA4GN +ADCBiQKBgQCWeQGfT2jBCQ1EOoLk661wes+5ceX74MgMIXk+y3iRf0qg3j43D6Fr +cxASmwjEltzLqFuHm3Uk5ABeSm9ME3kfVxOMPhs4MeF3dFL5lEc2VzO93ggRowHh +Uxy9ezmcXpZcqWFszCuQjVo8nvRLbuWXZIbzjuhyIF0NUL/pz77UEwIDAQABo4H6 +MIH3MB0GA1UdDgQWBBTvvciOeHn5dksRWbbDMhAHwLzjijCBkQYDVR0jBIGJMIGG +gBTWZnbJBf+pUIiWYN37xzAYcmdBGaFjpGEwXzELMAkGA1UEBhMCREUxEDAOBgNV +BAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtE +ZXZlbG9wbWVudDEPMA0GA1UEAxMGUm9vdCA4ggkAskfeaipMgxkwMQYIKwYBBQUH +AQEEJTAjMCEGCCsGAQUFBzABhhVodHRwOi8vbG9jYWxob3N0Ojg4ODgwDwYDVR0T +AQH/BAUwAwEB/zANBgkqhkiG9w0BAQUFAAOBgQBMlUQ7VwjsAez5PnyJHDCxTiYy +tlf6Jbzt69SiHGfuuYvQTFeKDtugnZLn3sZzAefeYRu1DtDFwaemq+DGC1Hd5aIy +H8ZS6tMDaDr1kr2LuAO7UHBjzOztPBF2yqxyR62Za44HnjjyY+G61N+pc1QddImU +AS5o3ZfnU/nPtn38hw== +-----END CERTIFICATE----- diff --git a/xmlsecurity/test_docs/CAs/Root_8/demoCA/newcerts/1001.pem b/xmlsecurity/test_docs/CAs/Root_8/demoCA/newcerts/1001.pem new file mode 100755 index 000000000000..26368962e8d0 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_8/demoCA/newcerts/1001.pem @@ -0,0 +1,66 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 4097 (0x1001) + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 8 + Validity + Not Before: Nov 20 15:55:33 2009 GMT + Not After : Nov 14 15:55:33 2034 GMT + Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Sub CA 2 Root 8 + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public Key: (1024 bit) + Modulus (1024 bit): + 00:e9:91:38:d8:c1:36:e5:c1:d0:32:e8:ae:02:11: + 97:e5:c5:07:8f:5b:46:3a:3c:d9:49:5e:9a:4b:51: + 4c:b7:7d:e9:d1:4f:a7:15:8c:c6:10:f6:fa:5f:a9: + 0b:1b:bc:de:56:f5:ad:a3:a0:40:f1:75:10:58:74: + 37:f9:b7:9f:76:ca:46:96:4c:1a:81:f4:a2:ce:88: + 8b:9e:00:6d:42:b3:d6:68:d1:67:d6:9f:b8:9c:3f: + 43:c7:36:bf:41:88:1b:e8:74:26:a0:51:5c:e2:ee: + 6d:9d:73:bb:0d:36:e1:5c:68:9f:21:3b:b2:aa:ed: + 39:1d:ae:fc:b4:ca:38:c2:fb + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Subject Key Identifier: + 1B:AB:6B:0F:42:91:DC:1E:D4:7A:95:87:30:2D:CC:11:4F:35:B7:73 + X509v3 Authority Key Identifier: + keyid:D6:66:76:C9:05:FF:A9:50:88:96:60:DD:FB:C7:30:18:72:67:41:19 + DirName:/C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=Root 8 + serial:B2:47:DE:6A:2A:4C:83:19 + + Authority Information Access: + OCSP - URI:http://localhost:8888 + + X509v3 Basic Constraints: critical + CA:TRUE + Signature Algorithm: sha1WithRSAEncryption + 89:f8:8d:a8:e5:0b:2a:fb:f3:6a:80:2c:26:a1:a7:36:7e:a0: + c5:61:65:9d:7e:d6:47:60:b4:f6:72:e9:6e:2c:d9:f8:7f:c8: + 7a:5d:75:98:ad:88:de:e7:1b:44:a3:96:37:84:c0:b3:20:98: + 3b:b5:f6:ee:70:9c:04:7a:6c:88:05:75:7f:12:cf:b9:76:e8: + c0:17:0c:5e:eb:10:38:1e:54:41:58:56:f6:3c:ec:07:a5:c0: + 74:24:34:af:b3:c7:b2:58:85:47:0f:6c:e4:a0:9f:c8:7b:5c: + 95:77:17:e5:ad:eb:c3:86:44:f7:81:ef:cb:58:12:1a:6a:c7: + 19:95 +-----BEGIN CERTIFICATE----- +MIIDOTCCAqKgAwIBAgICEAEwDQYJKoZIhvcNAQEFBQAwXzELMAkGA1UEBhMCREUx +EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD +VQQLEwtEZXZlbG9wbWVudDEPMA0GA1UEAxMGUm9vdCA4MB4XDTA5MTEyMDE1NTUz +M1oXDTM0MTExNDE1NTUzM1owaDELMAkGA1UEBhMCREUxEDAOBgNVBAgTB0hhbWJ1 +cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtEZXZlbG9wbWVu +dDEYMBYGA1UEAxMPU3ViIENBIDIgUm9vdCA4MIGfMA0GCSqGSIb3DQEBAQUAA4GN +ADCBiQKBgQDpkTjYwTblwdAy6K4CEZflxQePW0Y6PNlJXppLUUy3fenRT6cVjMYQ +9vpfqQsbvN5W9a2joEDxdRBYdDf5t592ykaWTBqB9KLOiIueAG1Cs9Zo0WfWn7ic +P0PHNr9BiBvodCagUVzi7m2dc7sNNuFcaJ8hO7Kq7Tkdrvy0yjjC+wIDAQABo4H6 +MIH3MB0GA1UdDgQWBBQbq2sPQpHcHtR6lYcwLcwRTzW3czCBkQYDVR0jBIGJMIGG +gBTWZnbJBf+pUIiWYN37xzAYcmdBGaFjpGEwXzELMAkGA1UEBhMCREUxEDAOBgNV +BAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtE +ZXZlbG9wbWVudDEPMA0GA1UEAxMGUm9vdCA4ggkAskfeaipMgxkwMQYIKwYBBQUH +AQEEJTAjMCEGCCsGAQUFBzABhhVodHRwOi8vbG9jYWxob3N0Ojg4ODgwDwYDVR0T +AQH/BAUwAwEB/zANBgkqhkiG9w0BAQUFAAOBgQCJ+I2o5Qsq+/NqgCwmoac2fqDF +YWWdftZHYLT2culuLNn4f8h6XXWYrYje5xtEo5Y3hMCzIJg7tfbucJwEemyIBXV/ +Es+5dujAFwxe6xA4HlRBWFb2POwHpcB0JDSvs8eyWIVHD2zkoJ/Ie1yVdxflrevD +hkT3ge/LWBIaascZlQ== +-----END CERTIFICATE----- diff --git a/xmlsecurity/test_docs/CAs/Root_8/demoCA/private/cakey.pem b/xmlsecurity/test_docs/CAs/Root_8/demoCA/private/cakey.pem new file mode 100755 index 000000000000..dd11db44373a --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_8/demoCA/private/cakey.pem @@ -0,0 +1,18 @@ +-----BEGIN RSA PRIVATE KEY----- +Proc-Type: 4,ENCRYPTED +DEK-Info: DES-EDE3-CBC,1DE6DE80057C280E + +1pXaFFR4KgVEWQzq73tQrfEkLZn7J0G0fxp1ZZYKOVdL3g/S4su2cXn5zfkSypjG +sTPnj9YuHzZiW1sB5M+U84b0aCSuh4+HK1Y+K6Us99psx/VaDq36uEBJZQviJ4zb +uF7ZT6NRGWMs3pIkFEHqi9TQ6mmeRgHMgkiI/mpM/26Y00dLpXdxBIGOCpKIPXwp +02mx/o9CHqI7ASuXV6ZAhawEmvFKKRNCKsKOaSs0CylGOT5nAaqWRp/IVMrm46wr +o7cErGgCZCPzQ5Ndx4553oSeWTjnm4iTS5UKg0nwPgS6sVhsr3zrTxIhS9zzcW2G +ycREX312K7q0zxtCxdNZxGeSfowRRy54JRoLf+O5yoNTRXYFjLxXGHgCTQRWgpIh +ggOmgUyIeNQXts4Qf6ddUtEcfGzMowCAJWTakXpOBoWj42mF85lDlcAAn8V1L90Q +MDF31HzrDAe3po4g+dNA6qdZrpSpnDDVp0oPsr3ooz1dLlwa8LWpPpq5PRgDWeQF +hcYrywI5tfUJyXv0xkEv+BIGKjGofWHGNtZWazBunhAVgWG/GQbzWxdSBS5w2waE +2Zo65PBqfLgRdnO6HYl15Pc5wm3gEQJo5VYgl7HmRpEt7lQrcnReqLWnsuHmqZ/H +vaEmGnSfXauVTvBVRXnrpznM/ROC9n2FR50lNIO1nAtMM7a0S0PIKgB+uNwAtsAR +Y4dY4YCS/io8wCL+DNBPtdvuY85/y5lnURpj9ojWO916WZsK/EFPJIQFuVwhal2C +Q9NVu8PXPDiBAHTVGZz8HoG32eYYUtqzeIY4Xo5ybUlnsNGlncWSqw== +-----END RSA PRIVATE KEY----- diff --git a/xmlsecurity/test_docs/CAs/Root_8/demoCA/serial b/xmlsecurity/test_docs/CAs/Root_8/demoCA/serial new file mode 100755 index 000000000000..7d802a3e7104 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_8/demoCA/serial @@ -0,0 +1 @@ +1002 diff --git a/xmlsecurity/test_docs/CAs/Root_8/openssl.cfg b/xmlsecurity/test_docs/CAs/Root_8/openssl.cfg new file mode 100755 index 000000000000..0353bced3bd2 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_8/openssl.cfg @@ -0,0 +1,292 @@ +# +# OpenSSL example configuration file. +# This is mostly being used for generation of certificate requests. +# + +# This definition stops the following lines choking if HOME isn't +# defined. +HOME = . +RANDFILE = $ENV::HOME/.rnd + +# Extra OBJECT IDENTIFIER info: +#oid_file = $ENV::HOME/.oid +oid_section = new_oids + +# To use this configuration file with the "-extfile" option of the +# "openssl x509" utility, name here the section containing the +# X.509v3 extensions to use: +# extensions = +# (Alternatively, use a configuration file that has only +# X.509v3 extensions in its main [= default] section.) + +[ new_oids ] + +# We can add new OIDs in here for use by 'ca' and 'req'. +# Add a simple OID like this: +# testoid1=1.2.3.4 +# Or use config file substitution like this: +# testoid2=${testoid1}.5.6 + +#################################################################### +[ ca ] +default_ca = CA_default # The default ca section + +#################################################################### +[ CA_default ] + +dir = ./demoCA # Where everything is kept +certs = $dir/certs # Where the issued certs are kept +crl_dir = $dir/crl # Where the issued crl are kept +database = $dir/index.txt # database index file. +#unique_subject = no # Set to 'no' to allow creation of + # several ctificates with same subject. +new_certs_dir = $dir/newcerts # default place for new certs. + +certificate = $dir/cacert.pem # The CA certificate +serial = $dir/serial # The current serial number +crlnumber = $dir/crlnumber # the current crl number + # must be commented out to leave a V1 CRL +crl = $dir/crl.pem # The current CRL +private_key = $dir/private/cakey.pem # The private key +RANDFILE = $dir/private/.rand # private random number file + +x509_extensions = usr_cert # The extentions to add to the cert + +# Comment out the following two lines for the "traditional" +# (and highly broken) format. +name_opt = ca_default # Subject Name options +cert_opt = ca_default # Certificate field options + +# Extension copying option: use with caution. +# copy_extensions = copy + +# Extensions to add to a CRL. Note: Netscape communicator chokes on V2 CRLs +# so this is commented out by default to leave a V1 CRL. +# crlnumber must also be commented out to leave a V1 CRL. +# crl_extensions = crl_ext + +default_days = 365 # how long to certify for +default_crl_days= 30 # how long before next CRL +default_md = sha1 # which md to use. +preserve = no # keep passed DN ordering + +# A few difference way of specifying how similar the request should look +# For type CA, the listed attributes must be the same, and the optional +# and supplied fields are just that :-) +policy = policy_match + +# For the CA policy +[ policy_match ] +countryName = match +stateOrProvinceName = match +organizationName = match +organizationalUnitName = optional +commonName = supplied +emailAddress = optional + +# For the 'anything' policy +# At this point in time, you must list all acceptable 'object' +# types. +[ policy_anything ] +countryName = optional +stateOrProvinceName = optional +localityName = optional +organizationName = optional +organizationalUnitName = optional +commonName = supplied +emailAddress = optional + +#################################################################### +[ req ] +default_bits = 1024 +default_keyfile = privkey.pem +distinguished_name = req_distinguished_name +attributes = req_attributes +x509_extensions = v3_ca # The extentions to add to the self signed cert + +# Passwords for private keys if not present they will be prompted for +# input_password = secret +# output_password = secret + +# This sets a mask for permitted string types. There are several options. +# default: PrintableString, T61String, BMPString. +# pkix : PrintableString, BMPString. +# utf8only: only UTF8Strings. +# nombstr : PrintableString, T61String (no BMPStrings or UTF8Strings). +# MASK:XXXX a literal mask value. +# WARNING: current versions of Netscape crash on BMPStrings or UTF8Strings +# so use this option with caution! +string_mask = nombstr + +# req_extensions = v3_req # The extensions to add to a certificate request + +[ req_distinguished_name ] +countryName = Country Name (2 letter code) +countryName_default = DE +countryName_min = 2 +countryName_max = 2 + +stateOrProvinceName = State or Province Name (full name) +stateOrProvinceName_default = Hamburg + +localityName = Locality Name (eg, city) + +0.organizationName = Organization Name (eg, company) +0.organizationName_default = OpenOffice.org + +# we can do this but it is not needed normally :-) +#1.organizationName = Second Organization Name (eg, company) +#1.organizationName_default = World Wide Web Pty Ltd + +organizationalUnitName = Organizational Unit Name (eg, section) +organizationalUnitName_default = Development + +commonName = Common Name (eg, YOUR name) +commonName_max = 64 + +emailAddress = Email Address +emailAddress_max = 64 + +# SET-ex3 = SET extension number 3 + +[ req_attributes ] +challengePassword = A challenge password +challengePassword_min = 4 +challengePassword_max = 20 + +unstructuredName = An optional company name + +[ usr_cert ] + +# These extensions are added when 'ca' signs a request. +#authorityInfoAccess = OCSP;URI:http://localhost:8888/ + +# This is typical in keyUsage for a client certificate. +keyUsage = nonRepudiation, digitalSignature, keyEncipherment + +# This will be displayed in Netscape's comment listbox. +nsComment = "OpenSSL Generated Certificate" + +# PKIX recommendations harmless if included in all certificates. +subjectKeyIdentifier=hash +authorityKeyIdentifier=keyid,issuer + +# This stuff is for subjectAltName and issuerAltname. +# Import the email address. +# subjectAltName=email:copy +# An alternative to produce certificates that aren't +# deprecated according to PKIX. +# subjectAltName=email:move + +# Copy subject details +# issuerAltName=issuer:copy + + + +[ v3_req ] + +# Extensions to add to a certificate request + +basicConstraints = CA:FALSE +keyUsage = nonRepudiation, digitalSignature, keyEncipherment +#authorityInfoAccess = OCSP;URI:http://localhost:8888/ + +[ v3_ca ] + + +# Extensions for a typical CA + + +# PKIX recommendation. + +subjectKeyIdentifier=hash + +authorityKeyIdentifier=keyid:always,issuer:always + +authorityInfoAccess = OCSP;URI:http://localhost:8888 +#crlDistributionPoints=URI:http://localhost:8901/demoCA/crl/Root_7.crl +# This is what PKIX recommends but some broken software chokes on critical +# extensions. +#basicConstraints = critical,CA:true +# So we do this instead. +basicConstraints = critical, CA:true + +# Key usage: this is typical for a CA certificate. However since it will +# prevent it being used as an test self-signed certificate it is best +# left out by default. +# keyUsage = cRLSign, keyCertSign + +# Some might want this also +# nsCertType = sslCA, emailCA + +# Include email address in subject alt name: another PKIX recommendation +# subjectAltName=email:copy +# Copy issuer details +# issuerAltName=issuer:copy + +# DER hex encoding of an extension: beware experts only! +# obj=DER:02:03 +# Where 'obj' is a standard or added object +# You can even override a supported extension: +# basicConstraints= critical, DER:30:03:01:01:FF + +[ crl_ext ] + +# CRL extensions. +# Only issuerAltName and authorityKeyIdentifier make any sense in a CRL. + +# issuerAltName=issuer:copy +authorityKeyIdentifier=keyid:always,issuer:always + +[ proxy_cert_ext ] +# These extensions should be added when creating a proxy certificate + +# This goes against PKIX guidelines but some CAs do it and some software +# requires this to avoid interpreting an end user certificate as a CA. + +basicConstraints=CA:FALSE + +# Here are some examples of the usage of nsCertType. If it is omitted +# the certificate can be used for anything *except* object signing. + +# This is OK for an SSL server. +# nsCertType = server + +# For an object signing certificate this would be used. +# nsCertType = objsign + +# For normal client use this is typical +# nsCertType = client, email + +# and for everything including object signing: +# nsCertType = client, email, objsign + +# This is typical in keyUsage for a client certificate. +# keyUsage = nonRepudiation, digitalSignature, keyEncipherment + +# This will be displayed in Netscape's comment listbox. +nsComment = "OpenSSL Generated Certificate" + +# PKIX recommendations harmless if included in all certificates. +subjectKeyIdentifier=hash +authorityKeyIdentifier=keyid,issuer:always + +# This stuff is for subjectAltName and issuerAltname. +# Import the email address. +# subjectAltName=email:copy +# An alternative to produce certificates that aren't +# deprecated according to PKIX. +# subjectAltName=email:move + +# Copy subject details +# issuerAltName=issuer:copy + +#nsCaRevocationUrl = http://www.domain.dom/ca-crl.pem +#nsBaseUrl +#nsRevocationUrl +#nsRenewalUrl +#nsCaPolicyUrl +#nsSslServerName + +# This really needs to be in place for it to be a proxy certificate. +proxyCertInfo=critical,language:id-ppl-anyLanguage,pathlen:3,policy:foo diff --git a/xmlsecurity/test_docs/CAs/Root_9/DO_NOT_INSTALL_THIS_ROOT_CERT.txt b/xmlsecurity/test_docs/CAs/Root_9/DO_NOT_INSTALL_THIS_ROOT_CERT.txt new file mode 100755 index 000000000000..ee3d2b339ef1 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_9/DO_NOT_INSTALL_THIS_ROOT_CERT.txt @@ -0,0 +1 @@ +!!!DO NOT INSTALL THIS ROOT CERTIFICATE!!! diff --git a/xmlsecurity/test_docs/CAs/Root_9/demoCA/DO_NO_INSTALL_THIS_ROOT_CERTIFICATE b/xmlsecurity/test_docs/CAs/Root_9/demoCA/DO_NO_INSTALL_THIS_ROOT_CERTIFICATE new file mode 100755 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_9/demoCA/DO_NO_INSTALL_THIS_ROOT_CERTIFICATE diff --git a/xmlsecurity/test_docs/CAs/Root_9/demoCA/Root_9.crt b/xmlsecurity/test_docs/CAs/Root_9/demoCA/Root_9.crt Binary files differnew file mode 100755 index 000000000000..66e316546ed4 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_9/demoCA/Root_9.crt diff --git a/xmlsecurity/test_docs/CAs/Root_9/demoCA/cacert.pem b/xmlsecurity/test_docs/CAs/Root_9/demoCA/cacert.pem new file mode 100755 index 000000000000..ca53f28f7adb --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_9/demoCA/cacert.pem @@ -0,0 +1,19 @@ +-----BEGIN CERTIFICATE----- +MIIDBDCCAm2gAwIBAgIJAKTbFg1LjNSmMA0GCSqGSIb3DQEBBQUAMF8xCzAJBgNV +BAYTAkRFMRAwDgYDVQQIEwdIYW1idXJnMRcwFQYDVQQKEw5PcGVuT2ZmaWNlLm9y +ZzEUMBIGA1UECxMLRGV2ZWxvcG1lbnQxDzANBgNVBAMTBlJvb3QgOTAeFw0wOTEx +MjMxMzUyNDNaFw0zNDExMTcxMzUyNDNaMF8xCzAJBgNVBAYTAkRFMRAwDgYDVQQI +EwdIYW1idXJnMRcwFQYDVQQKEw5PcGVuT2ZmaWNlLm9yZzEUMBIGA1UECxMLRGV2 +ZWxvcG1lbnQxDzANBgNVBAMTBlJvb3QgOTCBnzANBgkqhkiG9w0BAQEFAAOBjQAw +gYkCgYEAsOgehurKuYszsH2LFeGyHA9WYmCOMZmQfBFOgS/kO1Hkv6tNrDbshzyc +I/qOlpkosXUbQaaJPYoQmv3eTpfYxM9Dju5GkzOL03Q9J8AGe8RW1urMCfD5fC9g +XmhxAnIbrmDhS4K0lV8ngWwTQjmec9CV8SVBLQerrNtmcY/VvcMCAwEAAaOBxzCB +xDAdBgNVHQ4EFgQUzTNeq3MjUYC4A60SAQvFXo5VymQwgZEGA1UdIwSBiTCBhoAU +zTNeq3MjUYC4A60SAQvFXo5VymShY6RhMF8xCzAJBgNVBAYTAkRFMRAwDgYDVQQI +EwdIYW1idXJnMRcwFQYDVQQKEw5PcGVuT2ZmaWNlLm9yZzEUMBIGA1UECxMLRGV2 +ZWxvcG1lbnQxDzANBgNVBAMTBlJvb3QgOYIJAKTbFg1LjNSmMA8GA1UdEwEB/wQF +MAMBAf8wDQYJKoZIhvcNAQEFBQADgYEAqQkfiXNJm8l5v6qQzv6HwcDIgSQBuwkp +bN5FgHdLXaae/UOelXpmLSfrAbizw0Om1xLH/tnSeNY9MCGMGA4ScGU1hdNLUTIU +LK9upl/q+cHQayZL/Hz4Z8sqRNrP+E2m0GY0RMF1getJunfYZZV9VcsfbO3SqgAQ +exqICFDFi8M= +-----END CERTIFICATE----- diff --git a/xmlsecurity/test_docs/CAs/Root_9/demoCA/crlnumber b/xmlsecurity/test_docs/CAs/Root_9/demoCA/crlnumber new file mode 100755 index 000000000000..dd11724042e2 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_9/demoCA/crlnumber @@ -0,0 +1 @@ +1001 diff --git a/xmlsecurity/test_docs/CAs/Root_9/demoCA/index.txt b/xmlsecurity/test_docs/CAs/Root_9/demoCA/index.txt new file mode 100755 index 000000000000..c741bbfdaccc --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_9/demoCA/index.txt @@ -0,0 +1 @@ +V 341117135919Z 1000 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=Sub CA 1 Root 9 diff --git a/xmlsecurity/test_docs/CAs/Root_9/demoCA/index.txt.attr b/xmlsecurity/test_docs/CAs/Root_9/demoCA/index.txt.attr new file mode 100755 index 000000000000..8f7e63a3475c --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_9/demoCA/index.txt.attr @@ -0,0 +1 @@ +unique_subject = yes diff --git a/xmlsecurity/test_docs/CAs/Root_9/demoCA/newcerts/1000.pem b/xmlsecurity/test_docs/CAs/Root_9/demoCA/newcerts/1000.pem new file mode 100755 index 000000000000..0b38d4db4c7a --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_9/demoCA/newcerts/1000.pem @@ -0,0 +1,62 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 4096 (0x1000) + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 9 + Validity + Not Before: Nov 23 13:59:19 2009 GMT + Not After : Nov 17 13:59:19 2034 GMT + Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Sub CA 1 Root 9 + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public Key: (1024 bit) + Modulus (1024 bit): + 00:a9:6d:7f:6a:08:fb:e2:3a:5e:83:3f:ff:58:ba: + 92:a1:79:9d:ce:d2:0c:16:15:f2:7e:b3:e4:45:9c: + 02:32:65:9b:02:90:78:05:95:e4:04:1d:4a:05:bb: + ea:f6:ac:ab:15:74:c2:bc:ee:2a:c1:80:55:3e:93: + 1f:5c:94:eb:cf:cf:8f:15:eb:b8:22:fe:69:61:51: + a9:08:b8:80:bd:48:99:da:85:10:1c:75:97:fd:d3: + c3:c4:0b:dd:eb:01:12:5d:ee:62:62:c3:0c:18:ea: + ed:76:ff:9b:1c:1f:c7:81:f9:9a:cd:e5:25:89:b2: + 13:57:56:f3:27:53:72:76:69 + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Subject Key Identifier: + 7B:D3:57:BF:6A:CB:6C:10:81:91:DA:95:DC:88:4F:A5:D0:DB:D1:46 + X509v3 Authority Key Identifier: + keyid:CD:33:5E:AB:73:23:51:80:B8:03:AD:12:01:0B:C5:5E:8E:55:CA:64 + DirName:/C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=Root 9 + serial:A4:DB:16:0D:4B:8C:D4:A6 + + X509v3 Basic Constraints: critical + CA:TRUE + Signature Algorithm: sha1WithRSAEncryption + 17:67:b0:21:da:0d:a1:fe:09:62:d0:cf:1d:c0:c8:bd:d4:22: + dd:75:ec:04:e2:23:ae:ea:8c:15:fa:73:2e:83:f4:16:eb:c1: + e1:87:36:bd:58:d0:64:e0:6e:2c:bc:27:cb:dc:4b:58:01:80: + 48:27:53:bb:75:85:a7:19:b8:e2:c0:1f:9f:a2:18:27:82:3f: + 25:bf:17:d1:34:32:de:c4:81:9d:8a:39:6f:6b:1f:b6:12:61: + 74:78:96:6d:6e:52:23:4a:67:30:78:03:91:b7:89:bf:3c:4a: + 36:e3:95:21:38:35:af:05:55:81:05:25:91:78:ca:2f:5d:79: + d2:05 +-----BEGIN CERTIFICATE----- +MIIDBjCCAm+gAwIBAgICEAAwDQYJKoZIhvcNAQEFBQAwXzELMAkGA1UEBhMCREUx +EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD +VQQLEwtEZXZlbG9wbWVudDEPMA0GA1UEAxMGUm9vdCA5MB4XDTA5MTEyMzEzNTkx +OVoXDTM0MTExNzEzNTkxOVowaDELMAkGA1UEBhMCREUxEDAOBgNVBAgTB0hhbWJ1 +cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtEZXZlbG9wbWVu +dDEYMBYGA1UEAxMPU3ViIENBIDEgUm9vdCA5MIGfMA0GCSqGSIb3DQEBAQUAA4GN +ADCBiQKBgQCpbX9qCPviOl6DP/9YupKheZ3O0gwWFfJ+s+RFnAIyZZsCkHgFleQE +HUoFu+r2rKsVdMK87irBgFU+kx9clOvPz48V67gi/mlhUakIuIC9SJnahRAcdZf9 +08PEC93rARJd7mJiwwwY6u12/5scH8eB+ZrN5SWJshNXVvMnU3J2aQIDAQABo4HH +MIHEMB0GA1UdDgQWBBR701e/astsEIGR2pXciE+l0NvRRjCBkQYDVR0jBIGJMIGG +gBTNM16rcyNRgLgDrRIBC8VejlXKZKFjpGEwXzELMAkGA1UEBhMCREUxEDAOBgNV +BAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtE +ZXZlbG9wbWVudDEPMA0GA1UEAxMGUm9vdCA5ggkApNsWDUuM1KYwDwYDVR0TAQH/ +BAUwAwEB/zANBgkqhkiG9w0BAQUFAAOBgQAXZ7Ah2g2h/gli0M8dwMi91CLddewE +4iOu6owV+nMug/QW68Hhhza9WNBk4G4svCfL3EtYAYBIJ1O7dYWnGbjiwB+fohgn +gj8lvxfRNDLexIGdijlvax+2EmF0eJZtblIjSmcweAORt4m/PEo245UhODWvBVWB +BSWReMovXXnSBQ== +-----END CERTIFICATE----- diff --git a/xmlsecurity/test_docs/CAs/Root_9/demoCA/private/cakey.pem b/xmlsecurity/test_docs/CAs/Root_9/demoCA/private/cakey.pem new file mode 100755 index 000000000000..65149ff6505b --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_9/demoCA/private/cakey.pem @@ -0,0 +1,18 @@ +-----BEGIN RSA PRIVATE KEY----- +Proc-Type: 4,ENCRYPTED +DEK-Info: DES-EDE3-CBC,EEC173CF380C4BEC + +3ZAmsMS1aFKb3EfOncYO+hg0ucK80Y7pHg7GaH2/XZ+b6HmVQrHKuDrIcQNGEY5Z +QTCBeCGhmh7hnemBSrco4HURl/2LlA5CoYyd6CCc79VeUQZRJdLjL2thD4x/QwQs +Vh9uG+nunEAXK2kI2sFAxCScoCXSZmAgQqAANQ3SHyJ14e8BlOVgucfD0afYEDNE +udc86lO8+Lz7HfTvysnKO06pgp30ZFJlnBzSBXkXsTShPWEPg8f+2JRc+A5PbxVM +gz/S/ZrPMg8QyIfwwCGjRKzyRBeXVfquXqrwNqtGI+HXo4QaYYT8zuYUn9XuJsac +ZFn2BoXhI6TCBzyM+yuoXp+Xx5plY2A8QXaiLdKO2usV5xcXaBY3XTczrnOfJh7f +F3B2mbfhr/s4UJaFmnG4eULklFGADRY5tN2bIutsWmuuw17/ZwUSZxsjl+TybqVi +uvfmEqrSgoZ9Qz1vvRngVAAwJPAvQqsBQwkq3WapNeoLqmQeSHq/6z4G5RKPbkMs +t21L4SBUGQMhkZWAnJEtECDGsQpDjjwbDuJzrbVTSBiNvDWWeXJuGdyhzI6b17v7 +CZosIrzE82Oo0C+afWJVek2cB8rIMbgqEL+3Sj7x9c/kGeLx957d+geTSStqjD3z +P574kcEDP9ppEHalg1ygJ6t3SjkTNMWrbuYH+GlY8all7rniMDYUDMECIj3Xrv+Q +x3Yzv07FAooDYBE4pdWtTjpBlmwxa68XaMSDG28jQwTHck30GU/gwrM74CKWsg8y +4eZAaeQKHeUYFGsxWeYfmwr7aD4pG+VYGOmRmdia5PA= +-----END RSA PRIVATE KEY----- diff --git a/xmlsecurity/test_docs/CAs/Root_9/demoCA/serial b/xmlsecurity/test_docs/CAs/Root_9/demoCA/serial new file mode 100755 index 000000000000..dd11724042e2 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_9/demoCA/serial @@ -0,0 +1 @@ +1001 diff --git a/xmlsecurity/test_docs/CAs/Root_9/openssl.cfg b/xmlsecurity/test_docs/CAs/Root_9/openssl.cfg new file mode 100755 index 000000000000..cc9663bbd5c5 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Root_9/openssl.cfg @@ -0,0 +1,292 @@ +# +# OpenSSL example configuration file. +# This is mostly being used for generation of certificate requests. +# + +# This definition stops the following lines choking if HOME isn't +# defined. +HOME = . +RANDFILE = $ENV::HOME/.rnd + +# Extra OBJECT IDENTIFIER info: +#oid_file = $ENV::HOME/.oid +oid_section = new_oids + +# To use this configuration file with the "-extfile" option of the +# "openssl x509" utility, name here the section containing the +# X.509v3 extensions to use: +# extensions = +# (Alternatively, use a configuration file that has only +# X.509v3 extensions in its main [= default] section.) + +[ new_oids ] + +# We can add new OIDs in here for use by 'ca' and 'req'. +# Add a simple OID like this: +# testoid1=1.2.3.4 +# Or use config file substitution like this: +# testoid2=${testoid1}.5.6 + +#################################################################### +[ ca ] +default_ca = CA_default # The default ca section + +#################################################################### +[ CA_default ] + +dir = ./demoCA # Where everything is kept +certs = $dir/certs # Where the issued certs are kept +crl_dir = $dir/crl # Where the issued crl are kept +database = $dir/index.txt # database index file. +#unique_subject = no # Set to 'no' to allow creation of + # several ctificates with same subject. +new_certs_dir = $dir/newcerts # default place for new certs. + +certificate = $dir/cacert.pem # The CA certificate +serial = $dir/serial # The current serial number +crlnumber = $dir/crlnumber # the current crl number + # must be commented out to leave a V1 CRL +crl = $dir/crl.pem # The current CRL +private_key = $dir/private/cakey.pem # The private key +RANDFILE = $dir/private/.rand # private random number file + +x509_extensions = usr_cert # The extentions to add to the cert + +# Comment out the following two lines for the "traditional" +# (and highly broken) format. +name_opt = ca_default # Subject Name options +cert_opt = ca_default # Certificate field options + +# Extension copying option: use with caution. +# copy_extensions = copy + +# Extensions to add to a CRL. Note: Netscape communicator chokes on V2 CRLs +# so this is commented out by default to leave a V1 CRL. +# crlnumber must also be commented out to leave a V1 CRL. +# crl_extensions = crl_ext + +default_days = 365 # how long to certify for +default_crl_days= 30 # how long before next CRL +default_md = sha1 # which md to use. +preserve = no # keep passed DN ordering + +# A few difference way of specifying how similar the request should look +# For type CA, the listed attributes must be the same, and the optional +# and supplied fields are just that :-) +policy = policy_match + +# For the CA policy +[ policy_match ] +countryName = match +stateOrProvinceName = match +organizationName = match +organizationalUnitName = optional +commonName = supplied +emailAddress = optional + +# For the 'anything' policy +# At this point in time, you must list all acceptable 'object' +# types. +[ policy_anything ] +countryName = optional +stateOrProvinceName = optional +localityName = optional +organizationName = optional +organizationalUnitName = optional +commonName = supplied +emailAddress = optional + +#################################################################### +[ req ] +default_bits = 1024 +default_keyfile = privkey.pem +distinguished_name = req_distinguished_name +attributes = req_attributes +x509_extensions = v3_ca # The extentions to add to the self signed cert + +# Passwords for private keys if not present they will be prompted for +# input_password = secret +# output_password = secret + +# This sets a mask for permitted string types. There are several options. +# default: PrintableString, T61String, BMPString. +# pkix : PrintableString, BMPString. +# utf8only: only UTF8Strings. +# nombstr : PrintableString, T61String (no BMPStrings or UTF8Strings). +# MASK:XXXX a literal mask value. +# WARNING: current versions of Netscape crash on BMPStrings or UTF8Strings +# so use this option with caution! +string_mask = nombstr + +# req_extensions = v3_req # The extensions to add to a certificate request + +[ req_distinguished_name ] +countryName = Country Name (2 letter code) +countryName_default = DE +countryName_min = 2 +countryName_max = 2 + +stateOrProvinceName = State or Province Name (full name) +stateOrProvinceName_default = Hamburg + +localityName = Locality Name (eg, city) + +0.organizationName = Organization Name (eg, company) +0.organizationName_default = OpenOffice.org + +# we can do this but it is not needed normally :-) +#1.organizationName = Second Organization Name (eg, company) +#1.organizationName_default = World Wide Web Pty Ltd + +organizationalUnitName = Organizational Unit Name (eg, section) +organizationalUnitName_default = Development + +commonName = Common Name (eg, YOUR name) +commonName_max = 64 + +emailAddress = Email Address +emailAddress_max = 64 + +# SET-ex3 = SET extension number 3 + +[ req_attributes ] +challengePassword = A challenge password +challengePassword_min = 4 +challengePassword_max = 20 + +unstructuredName = An optional company name + +[ usr_cert ] + +# These extensions are added when 'ca' signs a request. +#authorityInfoAccess = OCSP;URI:http://localhost:8888/ + +# This is typical in keyUsage for a client certificate. +keyUsage = nonRepudiation, digitalSignature, keyEncipherment + +# This will be displayed in Netscape's comment listbox. +nsComment = "OpenSSL Generated Certificate" + +# PKIX recommendations harmless if included in all certificates. +subjectKeyIdentifier=hash +authorityKeyIdentifier=keyid,issuer + +# This stuff is for subjectAltName and issuerAltname. +# Import the email address. +# subjectAltName=email:copy +# An alternative to produce certificates that aren't +# deprecated according to PKIX. +# subjectAltName=email:move + +# Copy subject details +# issuerAltName=issuer:copy + + + +[ v3_req ] + +# Extensions to add to a certificate request + +basicConstraints = CA:FALSE +keyUsage = nonRepudiation, digitalSignature, keyEncipherment +#authorityInfoAccess = OCSP;URI:http://localhost:8888/ + +[ v3_ca ] + + +# Extensions for a typical CA + + +# PKIX recommendation. + +subjectKeyIdentifier=hash + +authorityKeyIdentifier=keyid:always,issuer:always + +#authorityInfoAccess = OCSP;URI:http://localhost:8888 +#crlDistributionPoints=URI:http://localhost:8901/demoCA/crl/Root_7.crl +# This is what PKIX recommends but some broken software chokes on critical +# extensions. +#basicConstraints = critical,CA:true +# So we do this instead. +basicConstraints = critical, CA:true + +# Key usage: this is typical for a CA certificate. However since it will +# prevent it being used as an test self-signed certificate it is best +# left out by default. +# keyUsage = cRLSign, keyCertSign + +# Some might want this also +# nsCertType = sslCA, emailCA + +# Include email address in subject alt name: another PKIX recommendation +# subjectAltName=email:copy +# Copy issuer details +# issuerAltName=issuer:copy + +# DER hex encoding of an extension: beware experts only! +# obj=DER:02:03 +# Where 'obj' is a standard or added object +# You can even override a supported extension: +# basicConstraints= critical, DER:30:03:01:01:FF + +[ crl_ext ] + +# CRL extensions. +# Only issuerAltName and authorityKeyIdentifier make any sense in a CRL. + +# issuerAltName=issuer:copy +authorityKeyIdentifier=keyid:always,issuer:always + +[ proxy_cert_ext ] +# These extensions should be added when creating a proxy certificate + +# This goes against PKIX guidelines but some CAs do it and some software +# requires this to avoid interpreting an end user certificate as a CA. + +basicConstraints=CA:FALSE + +# Here are some examples of the usage of nsCertType. If it is omitted +# the certificate can be used for anything *except* object signing. + +# This is OK for an SSL server. +# nsCertType = server + +# For an object signing certificate this would be used. +# nsCertType = objsign + +# For normal client use this is typical +# nsCertType = client, email + +# and for everything including object signing: +# nsCertType = client, email, objsign + +# This is typical in keyUsage for a client certificate. +# keyUsage = nonRepudiation, digitalSignature, keyEncipherment + +# This will be displayed in Netscape's comment listbox. +nsComment = "OpenSSL Generated Certificate" + +# PKIX recommendations harmless if included in all certificates. +subjectKeyIdentifier=hash +authorityKeyIdentifier=keyid,issuer:always + +# This stuff is for subjectAltName and issuerAltname. +# Import the email address. +# subjectAltName=email:copy +# An alternative to produce certificates that aren't +# deprecated according to PKIX. +# subjectAltName=email:move + +# Copy subject details +# issuerAltName=issuer:copy + +#nsCaRevocationUrl = http://www.domain.dom/ca-crl.pem +#nsBaseUrl +#nsRevocationUrl +#nsRenewalUrl +#nsCaPolicyUrl +#nsSslServerName + +# This really needs to be in place for it to be a proxy certificate. +proxyCertInfo=critical,language:id-ppl-anyLanguage,pathlen:3,policy:foo diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_1/demoCA/cacert.pem b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_1/demoCA/cacert.pem new file mode 100755 index 000000000000..be26aa5d8f4b --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_1/demoCA/cacert.pem @@ -0,0 +1,62 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 4096 (0x1000) + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 1 + Validity + Not Before: Nov 18 15:07:13 2009 GMT + Not After : Nov 12 15:07:13 2034 GMT + Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Sub CA 1 Root 1 + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public Key: (1024 bit) + Modulus (1024 bit): + 00:d9:3a:8d:64:95:87:76:76:e8:61:c3:e9:65:f4: + a6:b7:0c:77:0e:4b:10:e8:14:a3:e1:84:69:7c:8e: + 97:d2:7d:01:ad:b2:dc:5c:cd:c6:91:a1:f3:93:7c: + 54:36:64:e3:ca:22:ca:00:cb:c6:91:ab:6b:26:88: + 69:60:9a:61:d7:59:17:db:93:7d:09:36:da:28:cb: + ec:2d:a4:26:bb:1a:42:20:b8:08:b2:0f:b9:77:a6: + 80:71:cf:13:f5:37:a2:90:4d:ab:e8:97:49:d2:80: + 94:8f:b1:9d:5a:b4:9f:de:ff:fa:b6:d6:e0:45:5f: + cc:d4:10:1e:32:46:7b:ba:55 + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Subject Key Identifier: + 37:71:74:81:44:DD:1E:B1:60:96:41:B7:4B:38:C4:B7:79:1B:CF:8A + X509v3 Authority Key Identifier: + keyid:0F:FA:C6:EB:DF:CE:B8:BB:B3:A9:3E:42:A6:BA:EC:D2:93:CA:47:A4 + DirName:/C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=Root 1 + serial:95:B0:05:2B:ED:C2:39:2D + + X509v3 Basic Constraints: critical + CA:TRUE + Signature Algorithm: sha1WithRSAEncryption + 18:f6:02:5e:75:04:5f:eb:3b:07:41:85:c0:9e:08:29:58:3d: + b5:6f:c2:aa:24:0d:93:1d:17:fc:be:d6:43:ac:43:d7:4d:a0: + 2c:40:fd:3d:d5:7e:91:46:25:49:62:ba:e9:7f:67:c2:fc:8a: + c3:a0:37:bf:ec:f9:54:bf:61:10:35:dd:5b:bb:da:7c:70:54: + 32:13:b9:ae:7d:ea:a5:7d:aa:55:3e:ef:0a:ef:12:fd:c3:f6: + e5:25:98:97:34:02:64:fd:88:79:b3:e2:f4:fc:ff:e7:d3:98: + f1:d9:d5:18:d9:b4:62:ae:99:88:61:2e:ff:02:6a:13:35:fe: + 37:c7 +-----BEGIN CERTIFICATE----- +MIIDBjCCAm+gAwIBAgICEAAwDQYJKoZIhvcNAQEFBQAwXzELMAkGA1UEBhMCREUx +EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD +VQQLEwtEZXZlbG9wbWVudDEPMA0GA1UEAxMGUm9vdCAxMB4XDTA5MTExODE1MDcx +M1oXDTM0MTExMjE1MDcxM1owaDELMAkGA1UEBhMCREUxEDAOBgNVBAgTB0hhbWJ1 +cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtEZXZlbG9wbWVu +dDEYMBYGA1UEAxMPU3ViIENBIDEgUm9vdCAxMIGfMA0GCSqGSIb3DQEBAQUAA4GN +ADCBiQKBgQDZOo1klYd2duhhw+ll9Ka3DHcOSxDoFKPhhGl8jpfSfQGtstxczcaR +ofOTfFQ2ZOPKIsoAy8aRq2smiGlgmmHXWRfbk30JNtooy+wtpCa7GkIguAiyD7l3 +poBxzxP1N6KQTavol0nSgJSPsZ1atJ/e//q21uBFX8zUEB4yRnu6VQIDAQABo4HH +MIHEMB0GA1UdDgQWBBQ3cXSBRN0esWCWQbdLOMS3eRvPijCBkQYDVR0jBIGJMIGG +gBQP+sbr3864u7OpPkKmuuzSk8pHpKFjpGEwXzELMAkGA1UEBhMCREUxEDAOBgNV +BAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtE +ZXZlbG9wbWVudDEPMA0GA1UEAxMGUm9vdCAxggkAlbAFK+3COS0wDwYDVR0TAQH/ +BAUwAwEB/zANBgkqhkiG9w0BAQUFAAOBgQAY9gJedQRf6zsHQYXAnggpWD21b8Kq +JA2THRf8vtZDrEPXTaAsQP091X6RRiVJYrrpf2fC/IrDoDe/7PlUv2EQNd1bu9p8 +cFQyE7mufeqlfapVPu8K7xL9w/blJZiXNAJk/Yh5s+L0/P/n05jx2dUY2bRirpmI +YS7/AmoTNf43xw== +-----END CERTIFICATE----- diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_1/demoCA/crl/DO_NOT_CREATE_A_CRL b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_1/demoCA/crl/DO_NOT_CREATE_A_CRL new file mode 100755 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_1/demoCA/crl/DO_NOT_CREATE_A_CRL diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_1/demoCA/crlnumber b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_1/demoCA/crlnumber new file mode 100755 index 000000000000..83b33d238dab --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_1/demoCA/crlnumber @@ -0,0 +1 @@ +1000 diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_1/demoCA/index.txt b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_1/demoCA/index.txt new file mode 100755 index 000000000000..e2027ce9f4ce --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_1/demoCA/index.txt @@ -0,0 +1 @@ +V 341112152323Z 1000 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=User 1 Sub CA 1 Root 1 diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_1/demoCA/index.txt.attr b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_1/demoCA/index.txt.attr new file mode 100755 index 000000000000..8f7e63a3475c --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_1/demoCA/index.txt.attr @@ -0,0 +1 @@ +unique_subject = yes diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_1/demoCA/newcerts/1000.pem b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_1/demoCA/newcerts/1000.pem new file mode 100755 index 000000000000..e7d22dfd0c87 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_1/demoCA/newcerts/1000.pem @@ -0,0 +1,58 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 4096 (0x1000) + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Sub CA 1 Root 1 + Validity + Not Before: Nov 18 15:23:23 2009 GMT + Not After : Nov 12 15:23:23 2034 GMT + Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=User 1 Sub CA 1 Root 1 + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public Key: (1024 bit) + Modulus (1024 bit): + 00:c8:41:66:84:c7:d5:c5:72:8f:a6:98:1b:59:e2: + 33:ca:0d:d2:24:b3:c1:47:db:11:e2:bf:23:da:32: + 68:41:cc:ff:28:fe:9a:39:49:e7:08:f0:22:75:15: + 61:99:9e:99:e5:14:65:71:60:00:0f:58:42:70:78: + 5a:1e:d8:fa:97:92:82:0e:e3:0c:ac:20:dc:b8:e3: + 5e:87:8b:89:e3:a1:c3:87:49:1d:92:a5:fd:7c:77: + 79:ce:1f:fa:9c:5a:17:d9:11:0c:f2:7f:1a:fa:d8: + 32:41:f8:69:80:ae:8a:66:bd:36:c2:21:65:57:08: + be:cf:f0:ec:83:15:98:6d:65 + Exponent: 65537 (0x10001) + X509v3 extensions: + Netscape Comment: + OpenSSL Generated Certificate + X509v3 Subject Key Identifier: + FF:BB:B0:7F:E3:0E:E3:8C:CF:EC:88:49:A9:0E:62:B5:D3:60:12:46 + X509v3 Authority Key Identifier: + keyid:37:71:74:81:44:DD:1E:B1:60:96:41:B7:4B:38:C4:B7:79:1B:CF:8A + + Signature Algorithm: sha1WithRSAEncryption + 33:dd:e8:57:3e:69:1b:a0:4c:83:51:99:dd:73:b0:0c:cb:c7: + c0:ff:12:8b:b6:3b:59:12:b9:f1:20:87:75:f0:71:6e:bc:94: + 47:72:62:ae:93:90:05:e2:ff:63:31:5a:d2:80:a5:4a:7f:57: + e9:f7:4e:3e:be:bd:4c:9e:74:07:19:b0:4d:88:97:af:23:a7: + 5a:23:af:d1:a9:98:9b:55:7e:fa:6b:18:77:03:c4:aa:49:bc: + b6:3d:66:3e:8d:0a:80:5f:ac:b9:58:fb:11:ef:60:db:ad:a8: + 79:41:83:1a:6a:61:87:99:64:2d:e4:6a:bb:c0:30:00:dd:69: + e5:92 +-----BEGIN CERTIFICATE----- +MIICvjCCAiegAwIBAgICEAAwDQYJKoZIhvcNAQEFBQAwaDELMAkGA1UEBhMCREUx +EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD +VQQLEwtEZXZlbG9wbWVudDEYMBYGA1UEAxMPU3ViIENBIDEgUm9vdCAxMB4XDTA5 +MTExODE1MjMyM1oXDTM0MTExMjE1MjMyM1owbzELMAkGA1UEBhMCREUxEDAOBgNV +BAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtE +ZXZlbG9wbWVudDEfMB0GA1UEAxMWVXNlciAxIFN1YiBDQSAxIFJvb3QgMTCBnzAN +BgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAyEFmhMfVxXKPppgbWeIzyg3SJLPBR9sR +4r8j2jJoQcz/KP6aOUnnCPAidRVhmZ6Z5RRlcWAAD1hCcHhaHtj6l5KCDuMMrCDc +uONeh4uJ46HDh0kdkqX9fHd5zh/6nFoX2REM8n8a+tgyQfhpgK6KZr02wiFlVwi+ +z/DsgxWYbWUCAwEAAaNwMG4wLAYJYIZIAYb4QgENBB8WHU9wZW5TU0wgR2VuZXJh +dGVkIENlcnRpZmljYXRlMB0GA1UdDgQWBBT/u7B/4w7jjM/siEmpDmK102ASRjAf +BgNVHSMEGDAWgBQ3cXSBRN0esWCWQbdLOMS3eRvPijANBgkqhkiG9w0BAQUFAAOB +gQAz3ehXPmkboEyDUZndc7AMy8fA/xKLtjtZErnxIId18HFuvJRHcmKuk5AF4v9j +MVrSgKVKf1fp904+vr1MnnQHGbBNiJevI6daI6/RqZibVX76axh3A8SqSby2PWY+ +jQqAX6y5WPsR72Dbrah5QYMaamGHmWQt5Gq7wDAA3Wnlkg== +-----END CERTIFICATE----- diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_1/demoCA/private/cakey.pem b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_1/demoCA/private/cakey.pem new file mode 100755 index 000000000000..602026a47014 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_1/demoCA/private/cakey.pem @@ -0,0 +1,18 @@ +-----BEGIN RSA PRIVATE KEY----- +Proc-Type: 4,ENCRYPTED +DEK-Info: DES-EDE3-CBC,4E900CB191575111 + +vHLTGKUgxa3C35alVr0gWT30x8WW5Pmz4oFv23fMMWIXjrp/QLlRRmd2AO9H8rLb +3MWnA7cby5UTcrcsqwBA30TqhduNDi4iQFcOM60/S7yUFKjF5nj9bGi8XuUzMgTx +OrJuxMGkayLiELskZxEpi6SJvTEsSdreT6OvyhzXQfAFDodoJSW65oF08cuYxXzi +FFYFqvyWXa29WUyinBav5k3Mjax3Av3dYfMf/1u2n4vjGyjkfMg7mHrno19daWqa +FJsxHHFezq//G5+JvePWFQUo1b0fVh13fx9x1dCbCRGQ9duSXaI7BNfl2Jd2rlVk +xUMqnvd8VBNkW1AHxZL4csurQyO8ZQzg46w/kWaIMroeXbUnZYNJV7/TCs6nLGJF +iNwtsFAjunWgWttFbMx3X7L7T6f6cWXocOOTNeIDpH+W6Pw9vltrjzNPAyBBok17 +sboWXDtlihMrSq5lWzUSPE8gOueh7Bcf7fSnLTeXuOXgKooJVXelookSQzsilWmS +Fo5PTM+jOOaXVlbf8zfKFreLawohNkzagIxrCEP+HU+tF52ybJDP4mwPi1sQNcA0 +0luHyCL5EmaH5hVIqYeGUQoNPois5TqgYH1SEujyIuoNdEBi5r5qIRR/zz+BEpKU +Z1B+HmmSWb0hjfenFSSaSSmGyS6VW1wZsU2B+wcPr7r0uFqoWllkxYNmSdky6qmw +4Or0D6ayFUaJOQG6aTEfEVS31B4TUfFGfOLbeuUdwNa4/pNwMeFFSx+Xj7J3oYrn +udjIL0Hz8hhjLVXaPVcu/qkZ7pXhOVlRQJ7byx730G3+elUFalJ/eQ== +-----END RSA PRIVATE KEY----- diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_1/demoCA/serial b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_1/demoCA/serial new file mode 100755 index 000000000000..dd11724042e2 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_1/demoCA/serial @@ -0,0 +1 @@ +1001 diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_1/openssl.cfg b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_1/openssl.cfg new file mode 100755 index 000000000000..bf73e3549d66 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_1/openssl.cfg @@ -0,0 +1,292 @@ +# +# OpenSSL example configuration file. +# This is mostly being used for generation of certificate requests. +# + +# This definition stops the following lines choking if HOME isn't +# defined. +HOME = . +RANDFILE = $ENV::HOME/.rnd + +# Extra OBJECT IDENTIFIER info: +#oid_file = $ENV::HOME/.oid +oid_section = new_oids + +# To use this configuration file with the "-extfile" option of the +# "openssl x509" utility, name here the section containing the +# X.509v3 extensions to use: +# extensions = +# (Alternatively, use a configuration file that has only +# X.509v3 extensions in its main [= default] section.) + +[ new_oids ] + +# We can add new OIDs in here for use by 'ca' and 'req'. +# Add a simple OID like this: +# testoid1=1.2.3.4 +# Or use config file substitution like this: +# testoid2=${testoid1}.5.6 + +#################################################################### +[ ca ] +default_ca = CA_default # The default ca section + +#################################################################### +[ CA_default ] + +dir = ./demoCA # Where everything is kept +certs = $dir/certs # Where the issued certs are kept +crl_dir = $dir/crl # Where the issued crl are kept +database = $dir/index.txt # database index file. +#unique_subject = no # Set to 'no' to allow creation of + # several ctificates with same subject. +new_certs_dir = $dir/newcerts # default place for new certs. + +certificate = $dir/cacert.pem # The CA certificate +serial = $dir/serial # The current serial number +crlnumber = $dir/crlnumber # the current crl number + # must be commented out to leave a V1 CRL +crl = $dir/crl.pem # The current CRL +private_key = $dir/private/cakey.pem # The private key +RANDFILE = $dir/private/.rand # private random number file + +x509_extensions = usr_cert # The extentions to add to the cert + +# Comment out the following two lines for the "traditional" +# (and highly broken) format. +name_opt = ca_default # Subject Name options +cert_opt = ca_default # Certificate field options + +# Extension copying option: use with caution. +# copy_extensions = copy + +# Extensions to add to a CRL. Note: Netscape communicator chokes on V2 CRLs +# so this is commented out by default to leave a V1 CRL. +# crlnumber must also be commented out to leave a V1 CRL. +# crl_extensions = crl_ext + +default_days = 365 # how long to certify for +default_crl_days= 30 # how long before next CRL +default_md = sha1 # which md to use. +preserve = no # keep passed DN ordering + +# A few difference way of specifying how similar the request should look +# For type CA, the listed attributes must be the same, and the optional +# and supplied fields are just that :-) +policy = policy_match + +# For the CA policy +[ policy_match ] +countryName = match +stateOrProvinceName = match +organizationName = match +organizationalUnitName = optional +commonName = supplied +emailAddress = optional + +# For the 'anything' policy +# At this point in time, you must list all acceptable 'object' +# types. +[ policy_anything ] +countryName = optional +stateOrProvinceName = optional +localityName = optional +organizationName = optional +organizationalUnitName = optional +commonName = supplied +emailAddress = optional + +#################################################################### +[ req ] +default_bits = 1024 +default_keyfile = privkey.pem +distinguished_name = req_distinguished_name +attributes = req_attributes +x509_extensions = v3_ca # The extentions to add to the self signed cert + +# Passwords for private keys if not present they will be prompted for +# input_password = secret +# output_password = secret + +# This sets a mask for permitted string types. There are several options. +# default: PrintableString, T61String, BMPString. +# pkix : PrintableString, BMPString. +# utf8only: only UTF8Strings. +# nombstr : PrintableString, T61String (no BMPStrings or UTF8Strings). +# MASK:XXXX a literal mask value. +# WARNING: current versions of Netscape crash on BMPStrings or UTF8Strings +# so use this option with caution! +string_mask = nombstr + +# req_extensions = v3_req # The extensions to add to a certificate request + +[ req_distinguished_name ] +countryName = Country Name (2 letter code) +countryName_default = DE +countryName_min = 2 +countryName_max = 2 + +stateOrProvinceName = State or Province Name (full name) +stateOrProvinceName_default = Hamburg + +localityName = Locality Name (eg, city) + +0.organizationName = Organization Name (eg, company) +0.organizationName_default = OpenOffice.org + +# we can do this but it is not needed normally :-) +#1.organizationName = Second Organization Name (eg, company) +#1.organizationName_default = World Wide Web Pty Ltd + +organizationalUnitName = Organizational Unit Name (eg, section) +organizationalUnitName_default = Development + +commonName = Common Name (eg, YOUR name) +commonName_max = 64 + +emailAddress = Email Address +emailAddress_max = 64 + +# SET-ex3 = SET extension number 3 + +[ req_attributes ] +challengePassword = A challenge password +challengePassword_min = 4 +challengePassword_max = 20 + +unstructuredName = An optional company name + +[ usr_cert ] + +# These extensions are added when 'ca' signs a request. +#authorityInfoAccess = OCSP;URI:http://localhost:8888/ + +# This is typical in keyUsage for a client certificate. +# keyUsage = nonRepudiation, digitalSignature, keyEncipherment + +# This will be displayed in Netscape's comment listbox. +nsComment = "OpenSSL Generated Certificate" + +# PKIX recommendations harmless if included in all certificates. +subjectKeyIdentifier=hash +authorityKeyIdentifier=keyid,issuer + +# This stuff is for subjectAltName and issuerAltname. +# Import the email address. +# subjectAltName=email:copy +# An alternative to produce certificates that aren't +# deprecated according to PKIX. +# subjectAltName=email:move + +# Copy subject details +# issuerAltName=issuer:copy + + + +[ v3_req ] + +# Extensions to add to a certificate request + +basicConstraints = CA:FALSE +keyUsage = nonRepudiation, digitalSignature, keyEncipherment +#authorityInfoAccess = OCSP;URI:http://localhost:8888/ + +[ v3_ca ] + + +# Extensions for a typical CA + + +# PKIX recommendation. + +subjectKeyIdentifier=hash + +authorityKeyIdentifier=keyid:always,issuer:always + +#authorityInfoAccess = OCSP;URI:http://localhost:8888 +#crlDistributionPoints=URI:http://localhost:8901/demoCA/crl/Test_CA_2009.2.crl +# This is what PKIX recommends but some broken software chokes on critical +# extensions. +#basicConstraints = critical,CA:true +# So we do this instead. +basicConstraints = critical, CA:true + +# Key usage: this is typical for a CA certificate. However since it will +# prevent it being used as an test self-signed certificate it is best +# left out by default. +# keyUsage = cRLSign, keyCertSign + +# Some might want this also +# nsCertType = sslCA, emailCA + +# Include email address in subject alt name: another PKIX recommendation +# subjectAltName=email:copy +# Copy issuer details +# issuerAltName=issuer:copy + +# DER hex encoding of an extension: beware experts only! +# obj=DER:02:03 +# Where 'obj' is a standard or added object +# You can even override a supported extension: +# basicConstraints= critical, DER:30:03:01:01:FF + +[ crl_ext ] + +# CRL extensions. +# Only issuerAltName and authorityKeyIdentifier make any sense in a CRL. + +# issuerAltName=issuer:copy +authorityKeyIdentifier=keyid:always,issuer:always + +[ proxy_cert_ext ] +# These extensions should be added when creating a proxy certificate + +# This goes against PKIX guidelines but some CAs do it and some software +# requires this to avoid interpreting an end user certificate as a CA. + +basicConstraints=CA:FALSE + +# Here are some examples of the usage of nsCertType. If it is omitted +# the certificate can be used for anything *except* object signing. + +# This is OK for an SSL server. +# nsCertType = server + +# For an object signing certificate this would be used. +# nsCertType = objsign + +# For normal client use this is typical +# nsCertType = client, email + +# and for everything including object signing: +# nsCertType = client, email, objsign + +# This is typical in keyUsage for a client certificate. +# keyUsage = nonRepudiation, digitalSignature, keyEncipherment + +# This will be displayed in Netscape's comment listbox. +nsComment = "OpenSSL Generated Certificate" + +# PKIX recommendations harmless if included in all certificates. +subjectKeyIdentifier=hash +authorityKeyIdentifier=keyid,issuer:always + +# This stuff is for subjectAltName and issuerAltname. +# Import the email address. +# subjectAltName=email:copy +# An alternative to produce certificates that aren't +# deprecated according to PKIX. +# subjectAltName=email:move + +# Copy subject details +# issuerAltName=issuer:copy + +#nsCaRevocationUrl = http://www.domain.dom/ca-crl.pem +#nsBaseUrl +#nsRevocationUrl +#nsRenewalUrl +#nsCaPolicyUrl +#nsSslServerName + +# This really needs to be in place for it to be a proxy certificate. +proxyCertInfo=critical,language:id-ppl-anyLanguage,pathlen:3,policy:foo diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_10/DO_NOT_INSTALL_THIS_CERTIFICATE b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_10/DO_NOT_INSTALL_THIS_CERTIFICATE new file mode 100755 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_10/DO_NOT_INSTALL_THIS_CERTIFICATE diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_10/README.txt b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_10/README.txt new file mode 100755 index 000000000000..a18ed9ce0cd9 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_10/README.txt @@ -0,0 +1,19 @@ +Do NOT install !!! + + + +To provide the CRL via HTTP run + + + +java -jar ../../tools/httpserv/dist/httpserv.jar -a 8902 + + +To provide the intermediate certificate run + +java -jar ../../tools/httpserv/dist/httpserv.jar -a 8910 + + + + + diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_10/demoCA/DO_NOT_INSTALL_THIS_CERTIFICATE b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_10/demoCA/DO_NOT_INSTALL_THIS_CERTIFICATE new file mode 100755 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_10/demoCA/DO_NOT_INSTALL_THIS_CERTIFICATE diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_10/demoCA/Sub_CA_1_Root_10.crt b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_10/demoCA/Sub_CA_1_Root_10.crt Binary files differnew file mode 100755 index 000000000000..2bb9a4289404 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_10/demoCA/Sub_CA_1_Root_10.crt diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_10/demoCA/cacert.pem b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_10/demoCA/cacert.pem new file mode 100755 index 000000000000..1f27b97b3d17 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_10/demoCA/cacert.pem @@ -0,0 +1,62 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 4096 (0x1000) + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 10 + Validity + Not Before: Nov 23 15:14:48 2009 GMT + Not After : Nov 17 15:14:48 2034 GMT + Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Sub CA 1 Root 10 + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public Key: (1024 bit) + Modulus (1024 bit): + 00:e4:d5:66:14:88:9f:79:41:50:b0:d1:a0:1b:98: + bf:b0:21:34:30:36:70:58:6f:8b:58:f1:b9:58:3a: + ce:29:6b:65:b6:11:f7:0d:c8:a6:c3:be:db:0f:2a: + 4e:c7:42:df:c9:0e:13:c0:00:0f:af:b5:71:c4:bc: + dd:82:fc:4a:27:c0:ee:af:ba:e1:7b:67:de:6b:bb: + ac:4c:fe:88:01:1a:73:4e:f5:32:15:3a:d0:cb:6b: + 97:84:1b:6c:d0:d6:91:a8:a4:5a:87:2a:69:61:36: + 1d:42:cc:16:d0:03:9c:c6:90:5c:61:20:8b:b1:be: + b6:54:24:5b:6f:1f:a9:5a:6f + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Subject Key Identifier: + 11:63:A1:BE:8B:E3:56:07:E6:A3:9F:23:39:72:7D:E3:22:B6:53:39 + X509v3 Authority Key Identifier: + keyid:C8:A7:A3:80:20:74:6C:6F:EC:11:7A:F6:BE:26:10:37:31:87:B0:7A + DirName:/C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=Root 10 + serial:BF:C8:0F:BB:D9:A0:3A:6B + + X509v3 Basic Constraints: critical + CA:TRUE + Signature Algorithm: sha1WithRSAEncryption + 6b:0f:75:6d:56:b0:4e:45:19:65:ad:50:ef:4e:87:6c:95:5d: + 05:39:5a:43:5c:b4:51:25:9a:ec:f4:93:d1:f0:f6:91:dd:a3: + 77:95:0c:74:3c:a9:7c:c2:f6:62:ce:bf:58:5f:66:1f:d0:55: + ca:d8:2d:c4:1e:29:3a:ad:55:2c:9d:2c:8f:8e:9e:ce:ac:17: + 7e:1b:d1:16:d9:12:76:5c:2d:3f:9d:70:66:aa:39:34:f0:ec: + 31:4b:4b:5a:14:0c:c5:5b:3c:c8:47:02:90:cb:77:d7:4f:88: + 10:a7:80:3d:ca:19:5c:b5:04:c9:f0:e1:1b:5a:5f:fb:61:b2: + 14:b5 +-----BEGIN CERTIFICATE----- +MIIDCTCCAnKgAwIBAgICEAAwDQYJKoZIhvcNAQEFBQAwYDELMAkGA1UEBhMCREUx +EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD +VQQLEwtEZXZlbG9wbWVudDEQMA4GA1UEAxMHUm9vdCAxMDAeFw0wOTExMjMxNTE0 +NDhaFw0zNDExMTcxNTE0NDhaMGkxCzAJBgNVBAYTAkRFMRAwDgYDVQQIEwdIYW1i +dXJnMRcwFQYDVQQKEw5PcGVuT2ZmaWNlLm9yZzEUMBIGA1UECxMLRGV2ZWxvcG1l +bnQxGTAXBgNVBAMTEFN1YiBDQSAxIFJvb3QgMTAwgZ8wDQYJKoZIhvcNAQEBBQAD +gY0AMIGJAoGBAOTVZhSIn3lBULDRoBuYv7AhNDA2cFhvi1jxuVg6zilrZbYR9w3I +psO+2w8qTsdC38kOE8AAD6+1ccS83YL8SifA7q+64Xtn3mu7rEz+iAEac071MhU6 +0Mtrl4QbbNDWkaikWocqaWE2HULMFtADnMaQXGEgi7G+tlQkW28fqVpvAgMBAAGj +gcgwgcUwHQYDVR0OBBYEFBFjob6L41YH5qOfIzlyfeMitlM5MIGSBgNVHSMEgYow +gYeAFMino4AgdGxv7BF69r4mEDcxh7B6oWSkYjBgMQswCQYDVQQGEwJERTEQMA4G +A1UECBMHSGFtYnVyZzEXMBUGA1UEChMOT3Blbk9mZmljZS5vcmcxFDASBgNVBAsT +C0RldmVsb3BtZW50MRAwDgYDVQQDEwdSb290IDEwggkAv8gPu9mgOmswDwYDVR0T +AQH/BAUwAwEB/zANBgkqhkiG9w0BAQUFAAOBgQBrD3VtVrBORRllrVDvTodslV0F +OVpDXLRRJZrs9JPR8PaR3aN3lQx0PKl8wvZizr9YX2Yf0FXK2C3EHik6rVUsnSyP +jp7OrBd+G9EW2RJ2XC0/nXBmqjk08OwxS0taFAzFWzzIRwKQy3fXT4gQp4A9yhlc +tQTJ8OEbWl/7YbIUtQ== +-----END CERTIFICATE----- diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_10/demoCA/crl/DO_NOT_INSTALL_THIS_CRL b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_10/demoCA/crl/DO_NOT_INSTALL_THIS_CRL new file mode 100755 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_10/demoCA/crl/DO_NOT_INSTALL_THIS_CRL diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_10/demoCA/crl/Sub_CA_1_Root_10.crl b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_10/demoCA/crl/Sub_CA_1_Root_10.crl Binary files differnew file mode 100755 index 000000000000..67ed32da5f5b --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_10/demoCA/crl/Sub_CA_1_Root_10.crl diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_10/demoCA/crlnumber b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_10/demoCA/crlnumber new file mode 100755 index 000000000000..dd11724042e2 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_10/demoCA/crlnumber @@ -0,0 +1 @@ +1001 diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_10/demoCA/index.txt b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_10/demoCA/index.txt new file mode 100755 index 000000000000..810ec7ef2ffe --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_10/demoCA/index.txt @@ -0,0 +1 @@ +V 341117153149Z 1000 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=User 1 Sub CA 1 Root 10 diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_10/demoCA/index.txt.attr b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_10/demoCA/index.txt.attr new file mode 100755 index 000000000000..8f7e63a3475c --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_10/demoCA/index.txt.attr @@ -0,0 +1 @@ +unique_subject = yes diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_10/demoCA/newcerts/1000.pem b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_10/demoCA/newcerts/1000.pem new file mode 100755 index 000000000000..7449048bbc59 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_10/demoCA/newcerts/1000.pem @@ -0,0 +1,67 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 4096 (0x1000) + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Sub CA 1 Root 10 + Validity + Not Before: Nov 23 15:31:49 2009 GMT + Not After : Nov 17 15:31:49 2034 GMT + Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=User 1 Sub CA 1 Root 10 + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public Key: (1024 bit) + Modulus (1024 bit): + 00:ce:41:53:5f:ba:d9:26:e4:45:14:74:a9:f2:9e: + fa:91:50:ea:fe:e7:76:76:6e:62:26:4c:a2:bd:c9: + 98:ce:1d:b3:74:ea:95:04:ec:d8:24:ac:29:de:2d: + 7f:2f:7f:10:94:24:d2:0c:0b:ff:d0:38:f1:a9:8f: + ee:25:97:bf:bd:b0:1f:24:d7:9d:7a:20:79:c0:73: + 97:12:cb:5a:cf:6d:4f:df:4a:a8:9c:1b:be:49:63: + 1f:b1:03:6d:c6:5f:69:5c:0d:7e:81:23:48:2a:76: + 80:53:53:d2:03:f6:56:6d:dc:e3:cc:be:cb:0f:c3: + 1b:b7:6e:79:33:e0:da:f6:5d + Exponent: 65537 (0x10001) + X509v3 extensions: + Authority Information Access: + CA Issuers - URI:http://localhost:8910/demoCA/Sub_CA_1_Root_10.crt + + X509v3 CRL Distribution Points: + URI:http://localhost:8902/demoCA/crl/Sub_CA_1_Root_10.crl + + X509v3 Key Usage: + Digital Signature, Non Repudiation, Key Encipherment + X509v3 Subject Key Identifier: + 90:DC:ED:B0:CB:62:A1:BE:8F:23:65:01:79:14:85:22:48:70:7B:A1 + X509v3 Authority Key Identifier: + keyid:11:63:A1:BE:8B:E3:56:07:E6:A3:9F:23:39:72:7D:E3:22:B6:53:39 + + Signature Algorithm: sha1WithRSAEncryption + 54:e3:d2:eb:dc:aa:db:8b:88:34:c6:b9:5b:f6:d8:ca:81:24: + d0:ba:4c:c2:a7:8e:82:22:d3:68:64:c9:61:9b:0a:00:3e:d1: + 4e:cb:83:1d:b9:c7:07:6a:5e:7b:b4:ca:92:0c:93:d7:9e:99: + e1:58:47:17:b0:a7:6d:68:5f:e5:59:f9:2a:d1:96:df:b6:9f: + bc:47:40:f2:71:ed:71:2b:8a:6e:6f:aa:29:9f:4d:98:ee:f1: + aa:63:b4:44:39:58:8a:f8:c2:af:8d:c1:49:92:b4:99:02:2f: + 27:c7:5b:f5:30:7c:ed:67:ff:cd:12:dc:a7:c4:8e:98:4f:2c: + e0:05 +-----BEGIN CERTIFICATE----- +MIIDODCCAqGgAwIBAgICEAAwDQYJKoZIhvcNAQEFBQAwaTELMAkGA1UEBhMCREUx +EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD +VQQLEwtEZXZlbG9wbWVudDEZMBcGA1UEAxMQU3ViIENBIDEgUm9vdCAxMDAeFw0w +OTExMjMxNTMxNDlaFw0zNDExMTcxNTMxNDlaMHAxCzAJBgNVBAYTAkRFMRAwDgYD +VQQIEwdIYW1idXJnMRcwFQYDVQQKEw5PcGVuT2ZmaWNlLm9yZzEUMBIGA1UECxML +RGV2ZWxvcG1lbnQxIDAeBgNVBAMTF1VzZXIgMSBTdWIgQ0EgMSBSb290IDEwMIGf +MA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDOQVNfutkm5EUUdKnynvqRUOr+53Z2 +bmImTKK9yZjOHbN06pUE7NgkrCneLX8vfxCUJNIMC//QOPGpj+4ll7+9sB8k1516 +IHnAc5cSy1rPbU/fSqicG75JYx+xA23GX2lcDX6BI0gqdoBTU9ID9lZt3OPMvssP +wxu3bnkz4Nr2XQIDAQABo4HnMIHkME0GCCsGAQUFBwEBBEEwPzA9BggrBgEFBQcw +AoYxaHR0cDovL2xvY2FsaG9zdDo4OTEwL2RlbW9DQS9TdWJfQ0FfMV9Sb290XzEw +LmNydDBGBgNVHR8EPzA9MDugOaA3hjVodHRwOi8vbG9jYWxob3N0Ojg5MDIvZGVt +b0NBL2NybC9TdWJfQ0FfMV9Sb290XzEwLmNybDALBgNVHQ8EBAMCBeAwHQYDVR0O +BBYEFJDc7bDLYqG+jyNlAXkUhSJIcHuhMB8GA1UdIwQYMBaAFBFjob6L41YH5qOf +IzlyfeMitlM5MA0GCSqGSIb3DQEBBQUAA4GBAFTj0uvcqtuLiDTGuVv22MqBJNC6 +TMKnjoIi02hkyWGbCgA+0U7Lgx25xwdqXnu0ypIMk9eemeFYRxewp21oX+VZ+SrR +lt+2n7xHQPJx7XErim5vqimfTZju8apjtEQ5WIr4wq+NwUmStJkCLyfHW/UwfO1n +/80S3KfEjphPLOAF +-----END CERTIFICATE----- diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_10/demoCA/private/cakey.pem b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_10/demoCA/private/cakey.pem new file mode 100755 index 000000000000..260e3aa94624 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_10/demoCA/private/cakey.pem @@ -0,0 +1,18 @@ +-----BEGIN RSA PRIVATE KEY----- +Proc-Type: 4,ENCRYPTED +DEK-Info: DES-EDE3-CBC,170F9697C268C4B5 + +eIaE0ShuxMcOUBJBlI7PXIuKg69hDunjUz55iy0I+4sGc9tFK+vtjvDZWxx+dpZI +WKGto0fDeobBf3f2xgKQFcwAtUPtiTMXk8C0BYfAbXsTYBgOgvKwJGOIo5FsjukZ +VJCNlUM1mwX5P3OrLdyT0j8OoL6lINztYDhSC8XL12YJk1j05yN4Gl8N108JQMLA +sywA2Q6WIhPloZQXtHkiN2mlQ7WWwbSBbaUbdXNQKk6sXelFLPMOk+JOTCLp9kHU +svTBAg7RyWKBuUmtEmkipNLtYhdkRVJ/dgL3/TAsZET6cjDd/eZg+1Kl0pn93KGv +avSQKppkKNjUcWkZiuM1imS8+0qeMiw56JQGzMdEeSjadcTdsyYb0lssXmndK/z0 +90bA6GegvCnsq6Wj0Nz97GbK+ZMzA76e+HPQLli0j3poAlVwdzBCFRyLO4ET5Qzl +OhTewxKZxe2yx75chECWJS+CLOajHkVyUe3x6QzyVuU+YZqjXWkJP7rTcQJZFcml ++3PHYWy5RnZ2sKOegksr3+QtL+UmDVa1xEeIhk3m0IMiYZ9HNWlrg1gedY02y9yY +MGsCOkCF10KnCNIp4j5s1kGMicdMquDt0jTXwu+8jt6Skh8FWcr9aLf0bNc63oHg +NaI7Y3+Ssl3GLUGFOGwC0lpooZ10SoJJDK9xxEjt48vUfX+Npn3bRv+UlwfLBYLo +GENyNV3OVAsKYQ8fGIh/gTeIqwMUdo7Efcs6bdeqiOrYQhBl04Gty0I4cO6/lFGd +by/4SesYDXoVtaKto1B5VOQn+QxovF7eY1pK6wDBU8+EaJbGSNK9Rw== +-----END RSA PRIVATE KEY----- diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_10/demoCA/serial b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_10/demoCA/serial new file mode 100755 index 000000000000..dd11724042e2 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_10/demoCA/serial @@ -0,0 +1 @@ +1001 diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_10/openssl.cfg b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_10/openssl.cfg new file mode 100755 index 000000000000..c67e455ac4e2 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_10/openssl.cfg @@ -0,0 +1,293 @@ +# +# OpenSSL example configuration file. +# This is mostly being used for generation of certificate requests. +# + +# This definition stops the following lines choking if HOME isn't +# defined. +HOME = . +RANDFILE = $ENV::HOME/.rnd + +# Extra OBJECT IDENTIFIER info: +#oid_file = $ENV::HOME/.oid +oid_section = new_oids + +# To use this configuration file with the "-extfile" option of the +# "openssl x509" utility, name here the section containing the +# X.509v3 extensions to use: +# extensions = +# (Alternatively, use a configuration file that has only +# X.509v3 extensions in its main [= default] section.) + +[ new_oids ] + +# We can add new OIDs in here for use by 'ca' and 'req'. +# Add a simple OID like this: +# testoid1=1.2.3.4 +# Or use config file substitution like this: +# testoid2=${testoid1}.5.6 + +#################################################################### +[ ca ] +default_ca = CA_default # The default ca section + +#################################################################### +[ CA_default ] + +dir = ./demoCA # Where everything is kept +certs = $dir/certs # Where the issued certs are kept +crl_dir = $dir/crl # Where the issued crl are kept +database = $dir/index.txt # database index file. +#unique_subject = no # Set to 'no' to allow creation of + # several ctificates with same subject. +new_certs_dir = $dir/newcerts # default place for new certs. + +certificate = $dir/cacert.pem # The CA certificate +serial = $dir/serial # The current serial number +crlnumber = $dir/crlnumber # the current crl number + # must be commented out to leave a V1 CRL +crl = $dir/crl.pem # The current CRL +private_key = $dir/private/cakey.pem # The private key +RANDFILE = $dir/private/.rand # private random number file + +x509_extensions = usr_cert # The extentions to add to the cert + +# Comment out the following two lines for the "traditional" +# (and highly broken) format. +name_opt = ca_default # Subject Name options +cert_opt = ca_default # Certificate field options + +# Extension copying option: use with caution. +# copy_extensions = copy + +# Extensions to add to a CRL. Note: Netscape communicator chokes on V2 CRLs +# so this is commented out by default to leave a V1 CRL. +# crlnumber must also be commented out to leave a V1 CRL. +# crl_extensions = crl_ext + +default_days = 365 # how long to certify for +default_crl_days= 30 # how long before next CRL +default_md = sha1 # which md to use. +preserve = no # keep passed DN ordering + +# A few difference way of specifying how similar the request should look +# For type CA, the listed attributes must be the same, and the optional +# and supplied fields are just that :-) +policy = policy_match + +# For the CA policy +[ policy_match ] +countryName = match +stateOrProvinceName = match +organizationName = match +organizationalUnitName = optional +commonName = supplied +emailAddress = optional + +# For the 'anything' policy +# At this point in time, you must list all acceptable 'object' +# types. +[ policy_anything ] +countryName = optional +stateOrProvinceName = optional +localityName = optional +organizationName = optional +organizationalUnitName = optional +commonName = supplied +emailAddress = optional + +#################################################################### +[ req ] +default_bits = 1024 +default_keyfile = privkey.pem +distinguished_name = req_distinguished_name +attributes = req_attributes +x509_extensions = v3_ca # The extentions to add to the self signed cert + +# Passwords for private keys if not present they will be prompted for +# input_password = secret +# output_password = secret + +# This sets a mask for permitted string types. There are several options. +# default: PrintableString, T61String, BMPString. +# pkix : PrintableString, BMPString. +# utf8only: only UTF8Strings. +# nombstr : PrintableString, T61String (no BMPStrings or UTF8Strings). +# MASK:XXXX a literal mask value. +# WARNING: current versions of Netscape crash on BMPStrings or UTF8Strings +# so use this option with caution! +string_mask = nombstr + +# req_extensions = v3_req # The extensions to add to a certificate request + +[ req_distinguished_name ] +countryName = Country Name (2 letter code) +countryName_default = DE +countryName_min = 2 +countryName_max = 2 + +stateOrProvinceName = State or Province Name (full name) +stateOrProvinceName_default = Hamburg + +localityName = Locality Name (eg, city) + +0.organizationName = Organization Name (eg, company) +0.organizationName_default = OpenOffice.org + +# we can do this but it is not needed normally :-) +#1.organizationName = Second Organization Name (eg, company) +#1.organizationName_default = World Wide Web Pty Ltd + +organizationalUnitName = Organizational Unit Name (eg, section) +organizationalUnitName_default = Development + +commonName = Common Name (eg, YOUR name) +commonName_max = 64 + +emailAddress = Email Address +emailAddress_max = 64 + +# SET-ex3 = SET extension number 3 + +[ req_attributes ] +challengePassword = A challenge password +challengePassword_min = 4 +challengePassword_max = 20 + +unstructuredName = An optional company name + +[ usr_cert ] + +# These extensions are added when 'ca' signs a request. +#authorityInfoAccess = OCSP;URI:http://localhost:8889 +authorityInfoAccess = caIssuers;URI:http://localhost:8910/demoCA/Sub_CA_1_Root_10.crt +crlDistributionPoints=URI:http://localhost:8902/demoCA/crl/Sub_CA_1_Root_10.crl +# This is typical in keyUsage for a client certificate. +keyUsage = nonRepudiation, digitalSignature, keyEncipherment + +# This will be displayed in Netscape's comment listbox. +#nsComment = "OpenSSL Generated Certificate" + +# PKIX recommendations harmless if included in all certificates. +subjectKeyIdentifier=hash +authorityKeyIdentifier=keyid,issuer + +# This stuff is for subjectAltName and issuerAltname. +# Import the email address. +# subjectAltName=email:copy +# An alternative to produce certificates that aren't +# deprecated according to PKIX. +# subjectAltName=email:move + +# Copy subject details +# issuerAltName=issuer:copy + + + +[ v3_req ] + +# Extensions to add to a certificate request + +basicConstraints = CA:FALSE +keyUsage = nonRepudiation, digitalSignature, keyEncipherment +#authorityInfoAccess = OCSP;URI:http://localhost:8888/ + +[ v3_ca ] + + +# Extensions for a typical CA + + +# PKIX recommendation. + +subjectKeyIdentifier=hash + +authorityKeyIdentifier=keyid:always,issuer:always + +#authorityInfoAccess = OCSP;URI:http://localhost:8888 +#crlDistributionPoints=URI:http://localhost:8901/demoCA/crl/Test_CA_2009.2.crl +# This is what PKIX recommends but some broken software chokes on critical +# extensions. +#basicConstraints = critical,CA:true +# So we do this instead. +basicConstraints = critical, CA:true + +# Key usage: this is typical for a CA certificate. However since it will +# prevent it being used as an test self-signed certificate it is best +# left out by default. +# keyUsage = cRLSign, keyCertSign + +# Some might want this also +# nsCertType = sslCA, emailCA + +# Include email address in subject alt name: another PKIX recommendation +# subjectAltName=email:copy +# Copy issuer details +# issuerAltName=issuer:copy + +# DER hex encoding of an extension: beware experts only! +# obj=DER:02:03 +# Where 'obj' is a standard or added object +# You can even override a supported extension: +# basicConstraints= critical, DER:30:03:01:01:FF + +[ crl_ext ] + +# CRL extensions. +# Only issuerAltName and authorityKeyIdentifier make any sense in a CRL. + +# issuerAltName=issuer:copy +authorityKeyIdentifier=keyid:always,issuer:always + +[ proxy_cert_ext ] +# These extensions should be added when creating a proxy certificate + +# This goes against PKIX guidelines but some CAs do it and some software +# requires this to avoid interpreting an end user certificate as a CA. + +basicConstraints=CA:FALSE + +# Here are some examples of the usage of nsCertType. If it is omitted +# the certificate can be used for anything *except* object signing. + +# This is OK for an SSL server. +# nsCertType = server + +# For an object signing certificate this would be used. +# nsCertType = objsign + +# For normal client use this is typical +# nsCertType = client, email + +# and for everything including object signing: +# nsCertType = client, email, objsign + +# This is typical in keyUsage for a client certificate. +# keyUsage = nonRepudiation, digitalSignature, keyEncipherment + +# This will be displayed in Netscape's comment listbox. +nsComment = "OpenSSL Generated Certificate" + +# PKIX recommendations harmless if included in all certificates. +subjectKeyIdentifier=hash +authorityKeyIdentifier=keyid,issuer:always + +# This stuff is for subjectAltName and issuerAltname. +# Import the email address. +# subjectAltName=email:copy +# An alternative to produce certificates that aren't +# deprecated according to PKIX. +# subjectAltName=email:move + +# Copy subject details +# issuerAltName=issuer:copy + +#nsCaRevocationUrl = http://www.domain.dom/ca-crl.pem +#nsBaseUrl +#nsRevocationUrl +#nsRenewalUrl +#nsCaPolicyUrl +#nsSslServerName + +# This really needs to be in place for it to be a proxy certificate. +proxyCertInfo=critical,language:id-ppl-anyLanguage,pathlen:3,policy:foo diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_2/demoCA/cacert.pem b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_2/demoCA/cacert.pem new file mode 100755 index 000000000000..36a8eb3c0709 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_2/demoCA/cacert.pem @@ -0,0 +1,62 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 4096 (0x1000) + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 2 + Validity + Not Before: Nov 18 15:55:38 2009 GMT + Not After : Nov 12 15:55:38 2034 GMT + Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Sub CA 1 Root 2 + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public Key: (1024 bit) + Modulus (1024 bit): + 00:f0:7a:16:4c:ab:06:b2:af:27:9c:7d:3f:86:da: + de:7a:c3:01:67:77:56:49:09:ed:ed:31:72:83:e8: + 75:9c:4c:ce:f9:97:b6:63:3c:e2:ca:83:80:92:03: + 9c:96:e2:de:72:79:c1:cf:3e:3f:b9:0d:b4:87:c7: + 75:e6:56:8d:aa:f8:77:47:11:4e:fe:07:b0:1d:64: + 06:73:4b:6f:d4:ac:da:0f:05:87:b1:f1:98:a9:f5: + 8a:a1:a8:ed:17:9c:26:b8:da:92:63:d2:53:87:e6: + fc:ed:44:de:94:56:90:3e:a2:a1:67:08:cb:38:d4: + cf:17:3b:7e:ff:7a:97:c0:7b + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Subject Key Identifier: + 8C:F3:2C:30:A2:E8:62:50:70:BC:FC:71:A0:41:FA:E0:58:B4:4D:B8 + X509v3 Authority Key Identifier: + keyid:5F:BC:4C:DA:EB:0A:0C:B5:23:43:5E:24:32:27:79:41:F5:82:A3:02 + DirName:/C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=Root 2 + serial:A2:AF:15:89:EC:73:54:86 + + X509v3 Basic Constraints: critical + CA:TRUE + Signature Algorithm: sha1WithRSAEncryption + 52:83:16:ab:0e:43:2d:b3:e4:0f:6c:c1:63:d4:86:ac:e7:1e: + ee:7b:ee:9b:0c:ff:4f:e0:59:d5:e4:27:af:68:bf:a7:f5:2a: + a3:c9:e3:2b:8d:b7:31:26:f6:04:80:4e:f2:a5:bf:da:63:5e: + 8c:d6:c6:b2:46:a0:46:10:2f:84:9f:02:76:f3:c8:33:05:62: + 0c:5f:2d:cc:06:23:53:9f:d9:f8:46:e4:2e:5c:da:05:fc:bf: + db:45:b4:ac:8d:8b:b5:4b:60:7b:7b:26:34:7f:b1:4b:41:96: + 41:26:70:7a:9d:78:a2:9b:e0:de:62:a2:04:86:9f:ed:7c:a6: + 20:eb +-----BEGIN CERTIFICATE----- +MIIDBjCCAm+gAwIBAgICEAAwDQYJKoZIhvcNAQEFBQAwXzELMAkGA1UEBhMCREUx +EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD +VQQLEwtEZXZlbG9wbWVudDEPMA0GA1UEAxMGUm9vdCAyMB4XDTA5MTExODE1NTUz +OFoXDTM0MTExMjE1NTUzOFowaDELMAkGA1UEBhMCREUxEDAOBgNVBAgTB0hhbWJ1 +cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtEZXZlbG9wbWVu +dDEYMBYGA1UEAxMPU3ViIENBIDEgUm9vdCAyMIGfMA0GCSqGSIb3DQEBAQUAA4GN +ADCBiQKBgQDwehZMqwayryecfT+G2t56wwFnd1ZJCe3tMXKD6HWcTM75l7ZjPOLK +g4CSA5yW4t5yecHPPj+5DbSHx3XmVo2q+HdHEU7+B7AdZAZzS2/UrNoPBYex8Zip +9YqhqO0XnCa42pJj0lOH5vztRN6UVpA+oqFnCMs41M8XO37/epfAewIDAQABo4HH +MIHEMB0GA1UdDgQWBBSM8ywwouhiUHC8/HGgQfrgWLRNuDCBkQYDVR0jBIGJMIGG +gBRfvEza6woMtSNDXiQyJ3lB9YKjAqFjpGEwXzELMAkGA1UEBhMCREUxEDAOBgNV +BAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtE +ZXZlbG9wbWVudDEPMA0GA1UEAxMGUm9vdCAyggkAoq8ViexzVIYwDwYDVR0TAQH/ +BAUwAwEB/zANBgkqhkiG9w0BAQUFAAOBgQBSgxarDkMts+QPbMFj1Ias5x7ue+6b +DP9P4FnV5CevaL+n9SqjyeMrjbcxJvYEgE7ypb/aY16M1sayRqBGEC+EnwJ288gz +BWIMXy3MBiNTn9n4RuQuXNoF/L/bRbSsjYu1S2B7eyY0f7FLQZZBJnB6nXiim+De +YqIEhp/tfKYg6w== +-----END CERTIFICATE----- diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_2/demoCA/crlnumber b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_2/demoCA/crlnumber new file mode 100755 index 000000000000..dd11724042e2 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_2/demoCA/crlnumber @@ -0,0 +1 @@ +1001 diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_2/demoCA/index.txt b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_2/demoCA/index.txt new file mode 100755 index 000000000000..ae1f2d1e4c05 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_2/demoCA/index.txt @@ -0,0 +1 @@ +V 341112160955Z 1000 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=User 1 Sub CA 1 Root 2 diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_2/demoCA/index.txt.attr b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_2/demoCA/index.txt.attr new file mode 100755 index 000000000000..8f7e63a3475c --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_2/demoCA/index.txt.attr @@ -0,0 +1 @@ +unique_subject = yes diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_2/demoCA/newcerts/1000.pem b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_2/demoCA/newcerts/1000.pem new file mode 100755 index 000000000000..a8c0b74caf11 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_2/demoCA/newcerts/1000.pem @@ -0,0 +1,60 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 4096 (0x1000) + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Sub CA 1 Root 2 + Validity + Not Before: Nov 18 16:09:55 2009 GMT + Not After : Nov 12 16:09:55 2034 GMT + Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=User 1 Sub CA 1 Root 2 + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public Key: (1024 bit) + Modulus (1024 bit): + 00:c7:00:aa:e0:5a:42:af:9c:b5:43:8c:f4:7d:7a: + 0f:ee:a9:19:22:d8:47:14:af:b4:e4:dd:5d:41:92: + a1:2b:32:39:5c:71:88:10:e3:77:87:b6:d5:38:85: + de:4b:91:c6:17:97:8e:3d:96:b3:af:8c:9d:74:8c: + 88:7f:2a:72:9a:ca:1a:1b:56:6c:63:2e:a4:a0:fc: + 3a:7b:0d:c2:16:15:d0:80:15:29:de:cd:0b:74:bc: + 5e:31:84:71:a4:fd:be:9b:06:6a:0c:47:1d:f9:e4: + c1:98:ae:46:e6:e2:51:55:d5:bb:ab:05:28:69:b5: + f8:35:32:d6:f0:64:d8:44:81 + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Key Usage: + Digital Signature, Non Repudiation, Key Encipherment + Netscape Comment: + OpenSSL Generated Certificate + X509v3 Subject Key Identifier: + 71:60:2B:22:B5:DF:FC:38:7E:79:F3:EF:7C:96:5F:C1:D2:42:9C:61 + X509v3 Authority Key Identifier: + keyid:8C:F3:2C:30:A2:E8:62:50:70:BC:FC:71:A0:41:FA:E0:58:B4:4D:B8 + + Signature Algorithm: sha1WithRSAEncryption + e5:b8:1a:43:82:75:20:48:e0:52:d0:46:25:6f:f7:5b:a9:3f: + 9e:cd:db:45:da:15:53:95:e7:c8:74:7b:e0:e4:2c:8c:f6:4d: + 1c:73:6e:2c:11:eb:c1:dc:4c:1d:50:e3:e8:10:2f:03:20:06: + ff:d7:4f:c9:a2:2e:ef:85:27:92:31:47:64:c8:75:f2:fc:a4: + 9d:c9:53:55:c5:da:69:b0:96:99:fd:ac:c4:16:40:ea:0c:1b: + 32:c3:fd:65:1d:03:ad:be:60:88:7c:70:53:35:91:ce:13:e2: + 3d:23:6b:e8:23:c0:3c:9a:57:5f:ad:4b:03:94:92:16:62:f9: + d4:01 +-----BEGIN CERTIFICATE----- +MIICyzCCAjSgAwIBAgICEAAwDQYJKoZIhvcNAQEFBQAwaDELMAkGA1UEBhMCREUx +EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD +VQQLEwtEZXZlbG9wbWVudDEYMBYGA1UEAxMPU3ViIENBIDEgUm9vdCAyMB4XDTA5 +MTExODE2MDk1NVoXDTM0MTExMjE2MDk1NVowbzELMAkGA1UEBhMCREUxEDAOBgNV +BAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtE +ZXZlbG9wbWVudDEfMB0GA1UEAxMWVXNlciAxIFN1YiBDQSAxIFJvb3QgMjCBnzAN +BgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAxwCq4FpCr5y1Q4z0fXoP7qkZIthHFK+0 +5N1dQZKhKzI5XHGIEON3h7bVOIXeS5HGF5eOPZazr4yddIyIfypymsoaG1ZsYy6k +oPw6ew3CFhXQgBUp3s0LdLxeMYRxpP2+mwZqDEcd+eTBmK5G5uJRVdW7qwUoabX4 +NTLW8GTYRIECAwEAAaN9MHswCwYDVR0PBAQDAgXgMCwGCWCGSAGG+EIBDQQfFh1P +cGVuU1NMIEdlbmVyYXRlZCBDZXJ0aWZpY2F0ZTAdBgNVHQ4EFgQUcWArIrXf/Dh+ +efPvfJZfwdJCnGEwHwYDVR0jBBgwFoAUjPMsMKLoYlBwvPxxoEH64Fi0TbgwDQYJ +KoZIhvcNAQEFBQADgYEA5bgaQ4J1IEjgUtBGJW/3W6k/ns3bRdoVU5XnyHR74OQs +jPZNHHNuLBHrwdxMHVDj6BAvAyAG/9dPyaIu74UnkjFHZMh18vyknclTVcXaabCW +mf2sxBZA6gwbMsP9ZR0Drb5giHxwUzWRzhPiPSNr6CPAPJpXX61LA5SSFmL51AE= +-----END CERTIFICATE----- diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_2/demoCA/private/cakey.pem b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_2/demoCA/private/cakey.pem new file mode 100755 index 000000000000..ba6119464f9e --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_2/demoCA/private/cakey.pem @@ -0,0 +1,18 @@ +-----BEGIN RSA PRIVATE KEY----- +Proc-Type: 4,ENCRYPTED +DEK-Info: DES-EDE3-CBC,A5EF3D451C410026 + +RByk5Bn7uG1eixW1qTghnNri2bQHvnrNUYcpSL/mJIx6NjuYEY6vE/vQ9A9qcjuZ +8NInLR1w+EmSlDS499za8dfllaJ4/djswWN+4gtkoP/kKF390AcNgIpf/gIiJX6d +tkrw3Esst2gUwdtdhWItQNh0qZoeWpY9KlraDdEYVZt46JmsgwEIufzHyHTHf53C +E9ZP7/vYBQeHPOvMGsvhwZWAZZOO5GnD4fktbVAnybQdnlPgJDrRTGabbTdawQNc +8GJoG6hgJPcwlYm7NbRrtB18L3bG4bxx95fjqeOtvGDSUxSY+FNV7B2xQpivnBu6 +ppLdwTRYHQGOCJSCZoCtW+GYM7wXR2L4kGXMPwB4hHUAQXt+Tva9TP0t96313lMW +bFTRgTcT71eBidEkUIn1OrOL/Al2lXvSaDhm0P2F0yElzj3JN/gqrIUChaXWcLrS +CZuOGA2zGpoBASQ5jF+CyC+5mEkmDgvbmAXiJNjNmK/ColklpTNRSGk65Vr8AufA +d/yoSQCGprhMgqhviue40MGSsOD58TLwR4Tsm5ptze0QYRNC2SkKCrgtS0IEXh/Z +/9cMAgwOypW1T7LMOV+rG9DOyKx9Ye+oxPLCHdS7wN4h6blusiESbbUW0f5wqAzF +FCe6VEd+AjahnQLjw7O8vP4zl8q99cjOYD5SB+wqYrr0beEely7xdpKrDMgXqiBe +tOE9XvgU9KR59GZd0l6FPRkpZCUA+3Wuu4Zvrbam5kEbxVy+VTamWd5cRrxbJBM4 +Ipn414lfeq/5Foz13roErJE6gbWxXeCFDzg0z5fjWc2T41PX58x4Tw== +-----END RSA PRIVATE KEY----- diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_2/demoCA/req.pem b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_2/demoCA/req.pem new file mode 100755 index 000000000000..cc93d02e540c --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_2/demoCA/req.pem @@ -0,0 +1,11 @@ +-----BEGIN CERTIFICATE REQUEST----- +MIIBqDCCARECAQAwaDELMAkGA1UEBhMCREUxEDAOBgNVBAgTB0hhbWJ1cmcxFzAV +BgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtEZXZlbG9wbWVudDEYMBYG +A1UEAxMPU3ViIENBIDEgUm9vdCAyMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKB +gQDwehZMqwayryecfT+G2t56wwFnd1ZJCe3tMXKD6HWcTM75l7ZjPOLKg4CSA5yW +4t5yecHPPj+5DbSHx3XmVo2q+HdHEU7+B7AdZAZzS2/UrNoPBYex8Zip9YqhqO0X +nCa42pJj0lOH5vztRN6UVpA+oqFnCMs41M8XO37/epfAewIDAQABoAAwDQYJKoZI +hvcNAQEFBQADgYEADbuni6Yq0l5FJGFDUaabv4T75XxyMWy+k6wSojSt1thtwcJI +Bx5x1ngG5VyxeNmqyjLvd2KeYsVaV8M9J9ty40QGL8F83OArJPGADtBSM+gwmjdu +C+ksYL+5Yl8vSY3M7tKqJB2AFk2QlfP5okMQWRJ5QFTTwA8EFpHFsy4gsks= +-----END CERTIFICATE REQUEST----- diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_2/demoCA/serial b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_2/demoCA/serial new file mode 100755 index 000000000000..dd11724042e2 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_2/demoCA/serial @@ -0,0 +1 @@ +1001 diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_2/openssl.cfg b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_2/openssl.cfg new file mode 100755 index 000000000000..5f9493f47e9b --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_2/openssl.cfg @@ -0,0 +1,292 @@ +# +# OpenSSL example configuration file. +# This is mostly being used for generation of certificate requests. +# + +# This definition stops the following lines choking if HOME isn't +# defined. +HOME = . +RANDFILE = $ENV::HOME/.rnd + +# Extra OBJECT IDENTIFIER info: +#oid_file = $ENV::HOME/.oid +oid_section = new_oids + +# To use this configuration file with the "-extfile" option of the +# "openssl x509" utility, name here the section containing the +# X.509v3 extensions to use: +# extensions = +# (Alternatively, use a configuration file that has only +# X.509v3 extensions in its main [= default] section.) + +[ new_oids ] + +# We can add new OIDs in here for use by 'ca' and 'req'. +# Add a simple OID like this: +# testoid1=1.2.3.4 +# Or use config file substitution like this: +# testoid2=${testoid1}.5.6 + +#################################################################### +[ ca ] +default_ca = CA_default # The default ca section + +#################################################################### +[ CA_default ] + +dir = ./demoCA # Where everything is kept +certs = $dir/certs # Where the issued certs are kept +crl_dir = $dir/crl # Where the issued crl are kept +database = $dir/index.txt # database index file. +#unique_subject = no # Set to 'no' to allow creation of + # several ctificates with same subject. +new_certs_dir = $dir/newcerts # default place for new certs. + +certificate = $dir/cacert.pem # The CA certificate +serial = $dir/serial # The current serial number +crlnumber = $dir/crlnumber # the current crl number + # must be commented out to leave a V1 CRL +crl = $dir/crl.pem # The current CRL +private_key = $dir/private/cakey.pem # The private key +RANDFILE = $dir/private/.rand # private random number file + +x509_extensions = usr_cert # The extentions to add to the cert + +# Comment out the following two lines for the "traditional" +# (and highly broken) format. +name_opt = ca_default # Subject Name options +cert_opt = ca_default # Certificate field options + +# Extension copying option: use with caution. +# copy_extensions = copy + +# Extensions to add to a CRL. Note: Netscape communicator chokes on V2 CRLs +# so this is commented out by default to leave a V1 CRL. +# crlnumber must also be commented out to leave a V1 CRL. +# crl_extensions = crl_ext + +default_days = 365 # how long to certify for +default_crl_days= 30 # how long before next CRL +default_md = sha1 # which md to use. +preserve = no # keep passed DN ordering + +# A few difference way of specifying how similar the request should look +# For type CA, the listed attributes must be the same, and the optional +# and supplied fields are just that :-) +policy = policy_match + +# For the CA policy +[ policy_match ] +countryName = match +stateOrProvinceName = match +organizationName = match +organizationalUnitName = optional +commonName = supplied +emailAddress = optional + +# For the 'anything' policy +# At this point in time, you must list all acceptable 'object' +# types. +[ policy_anything ] +countryName = optional +stateOrProvinceName = optional +localityName = optional +organizationName = optional +organizationalUnitName = optional +commonName = supplied +emailAddress = optional + +#################################################################### +[ req ] +default_bits = 1024 +default_keyfile = privkey.pem +distinguished_name = req_distinguished_name +attributes = req_attributes +x509_extensions = v3_ca # The extentions to add to the self signed cert + +# Passwords for private keys if not present they will be prompted for +# input_password = secret +# output_password = secret + +# This sets a mask for permitted string types. There are several options. +# default: PrintableString, T61String, BMPString. +# pkix : PrintableString, BMPString. +# utf8only: only UTF8Strings. +# nombstr : PrintableString, T61String (no BMPStrings or UTF8Strings). +# MASK:XXXX a literal mask value. +# WARNING: current versions of Netscape crash on BMPStrings or UTF8Strings +# so use this option with caution! +string_mask = nombstr + +# req_extensions = v3_req # The extensions to add to a certificate request + +[ req_distinguished_name ] +countryName = Country Name (2 letter code) +countryName_default = DE +countryName_min = 2 +countryName_max = 2 + +stateOrProvinceName = State or Province Name (full name) +stateOrProvinceName_default = Hamburg + +localityName = Locality Name (eg, city) + +0.organizationName = Organization Name (eg, company) +0.organizationName_default = OpenOffice.org + +# we can do this but it is not needed normally :-) +#1.organizationName = Second Organization Name (eg, company) +#1.organizationName_default = World Wide Web Pty Ltd + +organizationalUnitName = Organizational Unit Name (eg, section) +organizationalUnitName_default = Development + +commonName = Common Name (eg, YOUR name) +commonName_max = 64 + +emailAddress = Email Address +emailAddress_max = 64 + +# SET-ex3 = SET extension number 3 + +[ req_attributes ] +challengePassword = A challenge password +challengePassword_min = 4 +challengePassword_max = 20 + +unstructuredName = An optional company name + +[ usr_cert ] + +# These extensions are added when 'ca' signs a request. +#authorityInfoAccess = OCSP;URI:http://localhost:8888/ + +# This is typical in keyUsage for a client certificate. +keyUsage = nonRepudiation, digitalSignature, keyEncipherment + +# This will be displayed in Netscape's comment listbox. +nsComment = "OpenSSL Generated Certificate" + +# PKIX recommendations harmless if included in all certificates. +subjectKeyIdentifier=hash +authorityKeyIdentifier=keyid,issuer + +# This stuff is for subjectAltName and issuerAltname. +# Import the email address. +# subjectAltName=email:copy +# An alternative to produce certificates that aren't +# deprecated according to PKIX. +# subjectAltName=email:move + +# Copy subject details +# issuerAltName=issuer:copy + + + +[ v3_req ] + +# Extensions to add to a certificate request + +basicConstraints = CA:FALSE +keyUsage = nonRepudiation, digitalSignature, keyEncipherment +#authorityInfoAccess = OCSP;URI:http://localhost:8888/ + +[ v3_ca ] + + +# Extensions for a typical CA + + +# PKIX recommendation. + +subjectKeyIdentifier=hash + +authorityKeyIdentifier=keyid:always,issuer:always + +#authorityInfoAccess = OCSP;URI:http://localhost:8888 +#crlDistributionPoints=URI:http://localhost:8901/demoCA/crl/Test_CA_2009.2.crl +# This is what PKIX recommends but some broken software chokes on critical +# extensions. +#basicConstraints = critical,CA:true +# So we do this instead. +basicConstraints = critical, CA:true + +# Key usage: this is typical for a CA certificate. However since it will +# prevent it being used as an test self-signed certificate it is best +# left out by default. +# keyUsage = cRLSign, keyCertSign + +# Some might want this also +# nsCertType = sslCA, emailCA + +# Include email address in subject alt name: another PKIX recommendation +# subjectAltName=email:copy +# Copy issuer details +# issuerAltName=issuer:copy + +# DER hex encoding of an extension: beware experts only! +# obj=DER:02:03 +# Where 'obj' is a standard or added object +# You can even override a supported extension: +# basicConstraints= critical, DER:30:03:01:01:FF + +[ crl_ext ] + +# CRL extensions. +# Only issuerAltName and authorityKeyIdentifier make any sense in a CRL. + +# issuerAltName=issuer:copy +authorityKeyIdentifier=keyid:always,issuer:always + +[ proxy_cert_ext ] +# These extensions should be added when creating a proxy certificate + +# This goes against PKIX guidelines but some CAs do it and some software +# requires this to avoid interpreting an end user certificate as a CA. + +basicConstraints=CA:FALSE + +# Here are some examples of the usage of nsCertType. If it is omitted +# the certificate can be used for anything *except* object signing. + +# This is OK for an SSL server. +# nsCertType = server + +# For an object signing certificate this would be used. +# nsCertType = objsign + +# For normal client use this is typical +# nsCertType = client, email + +# and for everything including object signing: +# nsCertType = client, email, objsign + +# This is typical in keyUsage for a client certificate. +# keyUsage = nonRepudiation, digitalSignature, keyEncipherment + +# This will be displayed in Netscape's comment listbox. +nsComment = "OpenSSL Generated Certificate" + +# PKIX recommendations harmless if included in all certificates. +subjectKeyIdentifier=hash +authorityKeyIdentifier=keyid,issuer:always + +# This stuff is for subjectAltName and issuerAltname. +# Import the email address. +# subjectAltName=email:copy +# An alternative to produce certificates that aren't +# deprecated according to PKIX. +# subjectAltName=email:move + +# Copy subject details +# issuerAltName=issuer:copy + +#nsCaRevocationUrl = http://www.domain.dom/ca-crl.pem +#nsBaseUrl +#nsRevocationUrl +#nsRenewalUrl +#nsCaPolicyUrl +#nsSslServerName + +# This really needs to be in place for it to be a proxy certificate. +proxyCertInfo=critical,language:id-ppl-anyLanguage,pathlen:3,policy:foo diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_3/demoCA/cacert.pem b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_3/demoCA/cacert.pem new file mode 100755 index 000000000000..c14880b580c7 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_3/demoCA/cacert.pem @@ -0,0 +1,62 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 4096 (0x1000) + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 3 + Validity + Not Before: Nov 20 07:40:39 2009 GMT + Not After : Nov 14 07:40:39 2034 GMT + Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Sub CA 1 Root 3 + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public Key: (1024 bit) + Modulus (1024 bit): + 00:9e:87:1f:af:f0:a0:1c:f4:9e:f8:c3:e7:ee:d3: + cb:a8:e2:54:98:ba:dd:7e:dc:6e:14:e1:7e:7f:5b: + 1e:ef:53:3d:89:76:ea:e2:b3:6c:08:0d:e8:c8:4d: + 24:40:ff:92:f3:5b:51:f7:90:ac:69:37:29:90:f5: + e8:95:6f:67:d1:10:cd:7b:dd:65:38:d6:25:ec:63: + 39:ba:2e:ea:13:58:8e:7a:82:8e:10:d1:7b:77:7a: + 08:d5:82:66:62:a4:83:39:ad:f5:83:d5:2f:5c:bc: + 23:6e:c8:78:8b:38:9f:eb:a3:67:ba:43:fa:e4:07: + 3f:90:72:db:0c:f9:49:0e:0d + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Subject Key Identifier: + 1B:2D:E0:A2:26:7F:0D:BA:38:7E:EC:06:81:81:0F:12:74:4C:5A:4D + X509v3 Authority Key Identifier: + keyid:69:FF:30:EC:1F:34:9A:67:3A:6B:20:D2:DF:7F:F5:05:04:ED:F9:1C + DirName:/C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=Root 3 + serial:95:6F:F0:E3:2B:BE:76:F9 + + X509v3 Basic Constraints: critical + CA:TRUE + Signature Algorithm: sha1WithRSAEncryption + 6f:ac:53:9d:16:6e:95:ed:97:60:ed:c8:a8:96:ab:24:c5:1e: + d5:d7:26:98:fb:b5:aa:ef:da:a4:91:6a:82:55:ec:21:a2:08: + 24:c7:0c:a7:58:0c:06:69:3d:04:7d:08:f1:0b:77:41:ad:1c: + 13:c2:bd:17:c9:9e:ff:df:64:69:8b:58:f1:bc:40:bd:cf:e4: + 57:29:bc:5e:93:84:61:56:4c:e6:c1:3a:2c:6e:71:ea:5d:67: + c0:54:be:4f:2f:27:a8:59:8d:29:94:ba:c6:6c:ff:ed:25:3d: + 0b:fa:93:c9:45:f4:d5:a3:3d:be:8a:f1:9d:c4:92:d5:5c:d2: + 77:7c +-----BEGIN CERTIFICATE----- +MIIDBjCCAm+gAwIBAgICEAAwDQYJKoZIhvcNAQEFBQAwXzELMAkGA1UEBhMCREUx +EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD +VQQLEwtEZXZlbG9wbWVudDEPMA0GA1UEAxMGUm9vdCAzMB4XDTA5MTEyMDA3NDAz +OVoXDTM0MTExNDA3NDAzOVowaDELMAkGA1UEBhMCREUxEDAOBgNVBAgTB0hhbWJ1 +cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtEZXZlbG9wbWVu +dDEYMBYGA1UEAxMPU3ViIENBIDEgUm9vdCAzMIGfMA0GCSqGSIb3DQEBAQUAA4GN +ADCBiQKBgQCehx+v8KAc9J74w+fu08uo4lSYut1+3G4U4X5/Wx7vUz2Jduris2wI +DejITSRA/5LzW1H3kKxpNymQ9eiVb2fREM173WU41iXsYzm6LuoTWI56go4Q0Xt3 +egjVgmZipIM5rfWD1S9cvCNuyHiLOJ/ro2e6Q/rkBz+QctsM+UkODQIDAQABo4HH +MIHEMB0GA1UdDgQWBBQbLeCiJn8Nujh+7AaBgQ8SdExaTTCBkQYDVR0jBIGJMIGG +gBRp/zDsHzSaZzprINLff/UFBO35HKFjpGEwXzELMAkGA1UEBhMCREUxEDAOBgNV +BAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtE +ZXZlbG9wbWVudDEPMA0GA1UEAxMGUm9vdCAzggkAlW/w4yu+dvkwDwYDVR0TAQH/ +BAUwAwEB/zANBgkqhkiG9w0BAQUFAAOBgQBvrFOdFm6V7Zdg7ciolqskxR7V1yaY ++7Wq79qkkWqCVewhoggkxwynWAwGaT0EfQjxC3dBrRwTwr0XyZ7/32Rpi1jxvEC9 +z+RXKbxek4RhVkzmwTosbnHqXWfAVL5PLyeoWY0plLrGbP/tJT0L+pPJRfTVoz2+ +ivGdxJLVXNJ3fA== +-----END CERTIFICATE----- diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_3/demoCA/crl/DO_NOT_CREATE_A_CRL b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_3/demoCA/crl/DO_NOT_CREATE_A_CRL new file mode 100755 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_3/demoCA/crl/DO_NOT_CREATE_A_CRL diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_3/demoCA/crlnumber b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_3/demoCA/crlnumber new file mode 100755 index 000000000000..83b33d238dab --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_3/demoCA/crlnumber @@ -0,0 +1 @@ +1000 diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_3/demoCA/index.txt b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_3/demoCA/index.txt new file mode 100755 index 000000000000..bd3b5eaeaeb0 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_3/demoCA/index.txt @@ -0,0 +1 @@ +V 341114075225Z 1000 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=User 1 Sub CA 1 Root 3 diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_3/demoCA/index.txt.attr b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_3/demoCA/index.txt.attr new file mode 100755 index 000000000000..8f7e63a3475c --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_3/demoCA/index.txt.attr @@ -0,0 +1 @@ +unique_subject = yes diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_3/demoCA/newcerts/1000.pem b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_3/demoCA/newcerts/1000.pem new file mode 100755 index 000000000000..46d60bda0a83 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_3/demoCA/newcerts/1000.pem @@ -0,0 +1,60 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 4096 (0x1000) + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Sub CA 1 Root 3 + Validity + Not Before: Nov 20 07:52:25 2009 GMT + Not After : Nov 14 07:52:25 2034 GMT + Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=User 1 Sub CA 1 Root 3 + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public Key: (1024 bit) + Modulus (1024 bit): + 00:bc:82:f1:75:77:02:f8:fb:3a:c2:8d:3c:1b:cb: + b2:63:2e:89:07:92:6b:b4:e1:ab:ce:30:a1:a4:82: + 38:30:64:2a:ba:01:c6:ac:ee:03:cc:65:bf:83:3e: + 39:b8:ce:ac:45:99:97:f9:94:e2:7d:5d:f3:c5:f7: + d4:a5:d6:57:cf:24:c1:d7:56:eb:00:9c:5d:80:bc: + 23:0c:91:d6:8e:2a:62:f6:af:4d:c9:19:5b:dd:16: + be:21:54:51:71:be:f2:c6:64:c5:bb:8e:37:49:c9: + 4d:68:82:3a:42:8a:e3:de:ab:fa:c7:ff:a5:b4:c7: + 53:8f:17:a4:66:9d:c3:8e:b1 + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Key Usage: + Digital Signature, Non Repudiation, Key Encipherment + Netscape Comment: + OpenSSL Generated Certificate + X509v3 Subject Key Identifier: + 0B:DD:2E:E9:5C:8A:5F:67:C9:75:4C:B3:04:DB:95:2F:D8:74:76:EF + X509v3 Authority Key Identifier: + keyid:1B:2D:E0:A2:26:7F:0D:BA:38:7E:EC:06:81:81:0F:12:74:4C:5A:4D + + Signature Algorithm: sha1WithRSAEncryption + 18:2f:af:1a:27:c7:f8:81:cd:d5:31:a0:f2:06:05:94:d6:12: + 11:88:24:ae:4f:f6:86:18:bf:d0:1b:c9:19:7a:47:30:0e:fb: + 30:b2:50:31:8d:30:6b:8b:54:17:67:bc:b8:c1:d5:1c:6c:95: + c5:e4:c4:ad:12:39:2f:38:ee:53:6a:cf:be:1c:4f:ac:98:0c: + ea:eb:0b:48:3d:5e:7a:2b:ed:02:8b:34:89:0a:d8:32:b4:6f: + f4:b2:06:96:aa:6b:ae:19:38:ec:9f:47:43:3b:7b:bd:71:38: + 99:4f:b4:1e:87:95:73:63:76:d4:ff:21:57:2c:c3:f4:3c:fd: + cb:c3 +-----BEGIN CERTIFICATE----- +MIICyzCCAjSgAwIBAgICEAAwDQYJKoZIhvcNAQEFBQAwaDELMAkGA1UEBhMCREUx +EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD +VQQLEwtEZXZlbG9wbWVudDEYMBYGA1UEAxMPU3ViIENBIDEgUm9vdCAzMB4XDTA5 +MTEyMDA3NTIyNVoXDTM0MTExNDA3NTIyNVowbzELMAkGA1UEBhMCREUxEDAOBgNV +BAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtE +ZXZlbG9wbWVudDEfMB0GA1UEAxMWVXNlciAxIFN1YiBDQSAxIFJvb3QgMzCBnzAN +BgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAvILxdXcC+Ps6wo08G8uyYy6JB5JrtOGr +zjChpII4MGQqugHGrO4DzGW/gz45uM6sRZmX+ZTifV3zxffUpdZXzyTB11brAJxd +gLwjDJHWjipi9q9NyRlb3Ra+IVRRcb7yxmTFu443SclNaII6Qorj3qv6x/+ltMdT +jxekZp3DjrECAwEAAaN9MHswCwYDVR0PBAQDAgXgMCwGCWCGSAGG+EIBDQQfFh1P +cGVuU1NMIEdlbmVyYXRlZCBDZXJ0aWZpY2F0ZTAdBgNVHQ4EFgQUC90u6VyKX2fJ +dUyzBNuVL9h0du8wHwYDVR0jBBgwFoAUGy3goiZ/Dbo4fuwGgYEPEnRMWk0wDQYJ +KoZIhvcNAQEFBQADgYEAGC+vGifH+IHN1TGg8gYFlNYSEYgkrk/2hhi/0BvJGXpH +MA77MLJQMY0wa4tUF2e8uMHVHGyVxeTErRI5LzjuU2rPvhxPrJgM6usLSD1eeivt +Aos0iQrYMrRv9LIGlqprrhk47J9HQzt7vXE4mU+0HoeVc2N21P8hVyzD9Dz9y8M= +-----END CERTIFICATE----- diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_3/demoCA/private/cakey.pem b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_3/demoCA/private/cakey.pem new file mode 100755 index 000000000000..8d893cdf9e43 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_3/demoCA/private/cakey.pem @@ -0,0 +1,18 @@ +-----BEGIN RSA PRIVATE KEY----- +Proc-Type: 4,ENCRYPTED +DEK-Info: DES-EDE3-CBC,EF032FCF0827A7AA + +vTlvOy1d4MK41zEZfeUWDO7kjLqZ53jK6JdXhKT2P9MnstGf1S0QxwbEKP+KWj+4 +lwS7fSXs6/s2Q5OrG9QSV4bm5Sob0OpDfoc1GS24uSGvYXzhuyM9sjiITXvyGKCH ++0VQPV/GSXWShsk5CCzUXIBSBHDVxlEzmBvzWiHfcLEAwF1JJlh6ex9Xju9JL9sN +Gp4VMw9PML11V4iqNXKeyBZ87Bv/yew+bDACLCe7e1liBxdOj2ntc7mtpCrkf/pn +hLnJ1qKodcwgmmMLufa7//E1RCBMn1gml0YXMe+Grrn7tFdVWT/puKiSrKGgIbbB +RNf7JnG5E8Oy2V8NRk4SV5Au784fw5NMykQDCMJFp9aldwP7LlIUBPtPm/jpaY0V +e6tKT20e4Ru2mDzyfef8nhFRogMxvPrxVSxN8aI1u/soPMp55ypWrqg99QlsiZgG +MhpHaFODSWvHaFcwFY+gEDUmEH76S3wuOSgeFolvIPEETjw6Vc46Zi32N1ycQ1wz +NCbIGy2ftEzKIEOeXHAsuQiP+Cic1QYJEOxhvOq9VteYfilT7D9FQ2+QOqrl4+2X +hj2RaTJawpSFoWfEh7QM1ir0TPj3wRSTg6g3e0f+vAvI9AfVEP3ctPm6tpXirUgh +QOA1LZKZzHUYqr0q2TBvItyGsg3w7dxyeB6brCtzOzg+GpvNhaRZ1/+SVPxzYVgf +buLQIfvvLE6TmABxOloop1m61u6c6+Bg5kKHXSnUKehGv+iIxVLZgxrNkCFyyzX0 +Dpu9hkGYzVzE8QCujC09MZCKH/85iYGuEZtP81Mjyjs= +-----END RSA PRIVATE KEY----- diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_3/demoCA/req.pem b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_3/demoCA/req.pem new file mode 100755 index 000000000000..dd08bf6717c7 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_3/demoCA/req.pem @@ -0,0 +1,11 @@ +-----BEGIN CERTIFICATE REQUEST----- +MIIBqDCCARECAQAwaDELMAkGA1UEBhMCREUxEDAOBgNVBAgTB0hhbWJ1cmcxFzAV +BgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtEZXZlbG9wbWVudDEYMBYG +A1UEAxMPU3ViIENBIDEgUm9vdCAzMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKB +gQCehx+v8KAc9J74w+fu08uo4lSYut1+3G4U4X5/Wx7vUz2Jduris2wIDejITSRA +/5LzW1H3kKxpNymQ9eiVb2fREM173WU41iXsYzm6LuoTWI56go4Q0Xt3egjVgmZi +pIM5rfWD1S9cvCNuyHiLOJ/ro2e6Q/rkBz+QctsM+UkODQIDAQABoAAwDQYJKoZI +hvcNAQEFBQADgYEAiwW4WbC3V3wEBfPlIFiUagJHOettp5NyCzLULyQZE1FXs/zV +RxIi3Oxdaj643QZ8h6upKf9F60T8+oG15RBdp1ZjmBXnv7ZRx33LynExbxX0XKjo +Pg/8dGLFBomZqE8MpWbQtY5lRkQOkgt5XZLj5SMJQsgpVaAOPQcOg5Sqfag= +-----END CERTIFICATE REQUEST----- diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_3/demoCA/serial b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_3/demoCA/serial new file mode 100755 index 000000000000..dd11724042e2 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_3/demoCA/serial @@ -0,0 +1 @@ +1001 diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_3/openssl.cfg b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_3/openssl.cfg new file mode 100755 index 000000000000..5f9493f47e9b --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_3/openssl.cfg @@ -0,0 +1,292 @@ +# +# OpenSSL example configuration file. +# This is mostly being used for generation of certificate requests. +# + +# This definition stops the following lines choking if HOME isn't +# defined. +HOME = . +RANDFILE = $ENV::HOME/.rnd + +# Extra OBJECT IDENTIFIER info: +#oid_file = $ENV::HOME/.oid +oid_section = new_oids + +# To use this configuration file with the "-extfile" option of the +# "openssl x509" utility, name here the section containing the +# X.509v3 extensions to use: +# extensions = +# (Alternatively, use a configuration file that has only +# X.509v3 extensions in its main [= default] section.) + +[ new_oids ] + +# We can add new OIDs in here for use by 'ca' and 'req'. +# Add a simple OID like this: +# testoid1=1.2.3.4 +# Or use config file substitution like this: +# testoid2=${testoid1}.5.6 + +#################################################################### +[ ca ] +default_ca = CA_default # The default ca section + +#################################################################### +[ CA_default ] + +dir = ./demoCA # Where everything is kept +certs = $dir/certs # Where the issued certs are kept +crl_dir = $dir/crl # Where the issued crl are kept +database = $dir/index.txt # database index file. +#unique_subject = no # Set to 'no' to allow creation of + # several ctificates with same subject. +new_certs_dir = $dir/newcerts # default place for new certs. + +certificate = $dir/cacert.pem # The CA certificate +serial = $dir/serial # The current serial number +crlnumber = $dir/crlnumber # the current crl number + # must be commented out to leave a V1 CRL +crl = $dir/crl.pem # The current CRL +private_key = $dir/private/cakey.pem # The private key +RANDFILE = $dir/private/.rand # private random number file + +x509_extensions = usr_cert # The extentions to add to the cert + +# Comment out the following two lines for the "traditional" +# (and highly broken) format. +name_opt = ca_default # Subject Name options +cert_opt = ca_default # Certificate field options + +# Extension copying option: use with caution. +# copy_extensions = copy + +# Extensions to add to a CRL. Note: Netscape communicator chokes on V2 CRLs +# so this is commented out by default to leave a V1 CRL. +# crlnumber must also be commented out to leave a V1 CRL. +# crl_extensions = crl_ext + +default_days = 365 # how long to certify for +default_crl_days= 30 # how long before next CRL +default_md = sha1 # which md to use. +preserve = no # keep passed DN ordering + +# A few difference way of specifying how similar the request should look +# For type CA, the listed attributes must be the same, and the optional +# and supplied fields are just that :-) +policy = policy_match + +# For the CA policy +[ policy_match ] +countryName = match +stateOrProvinceName = match +organizationName = match +organizationalUnitName = optional +commonName = supplied +emailAddress = optional + +# For the 'anything' policy +# At this point in time, you must list all acceptable 'object' +# types. +[ policy_anything ] +countryName = optional +stateOrProvinceName = optional +localityName = optional +organizationName = optional +organizationalUnitName = optional +commonName = supplied +emailAddress = optional + +#################################################################### +[ req ] +default_bits = 1024 +default_keyfile = privkey.pem +distinguished_name = req_distinguished_name +attributes = req_attributes +x509_extensions = v3_ca # The extentions to add to the self signed cert + +# Passwords for private keys if not present they will be prompted for +# input_password = secret +# output_password = secret + +# This sets a mask for permitted string types. There are several options. +# default: PrintableString, T61String, BMPString. +# pkix : PrintableString, BMPString. +# utf8only: only UTF8Strings. +# nombstr : PrintableString, T61String (no BMPStrings or UTF8Strings). +# MASK:XXXX a literal mask value. +# WARNING: current versions of Netscape crash on BMPStrings or UTF8Strings +# so use this option with caution! +string_mask = nombstr + +# req_extensions = v3_req # The extensions to add to a certificate request + +[ req_distinguished_name ] +countryName = Country Name (2 letter code) +countryName_default = DE +countryName_min = 2 +countryName_max = 2 + +stateOrProvinceName = State or Province Name (full name) +stateOrProvinceName_default = Hamburg + +localityName = Locality Name (eg, city) + +0.organizationName = Organization Name (eg, company) +0.organizationName_default = OpenOffice.org + +# we can do this but it is not needed normally :-) +#1.organizationName = Second Organization Name (eg, company) +#1.organizationName_default = World Wide Web Pty Ltd + +organizationalUnitName = Organizational Unit Name (eg, section) +organizationalUnitName_default = Development + +commonName = Common Name (eg, YOUR name) +commonName_max = 64 + +emailAddress = Email Address +emailAddress_max = 64 + +# SET-ex3 = SET extension number 3 + +[ req_attributes ] +challengePassword = A challenge password +challengePassword_min = 4 +challengePassword_max = 20 + +unstructuredName = An optional company name + +[ usr_cert ] + +# These extensions are added when 'ca' signs a request. +#authorityInfoAccess = OCSP;URI:http://localhost:8888/ + +# This is typical in keyUsage for a client certificate. +keyUsage = nonRepudiation, digitalSignature, keyEncipherment + +# This will be displayed in Netscape's comment listbox. +nsComment = "OpenSSL Generated Certificate" + +# PKIX recommendations harmless if included in all certificates. +subjectKeyIdentifier=hash +authorityKeyIdentifier=keyid,issuer + +# This stuff is for subjectAltName and issuerAltname. +# Import the email address. +# subjectAltName=email:copy +# An alternative to produce certificates that aren't +# deprecated according to PKIX. +# subjectAltName=email:move + +# Copy subject details +# issuerAltName=issuer:copy + + + +[ v3_req ] + +# Extensions to add to a certificate request + +basicConstraints = CA:FALSE +keyUsage = nonRepudiation, digitalSignature, keyEncipherment +#authorityInfoAccess = OCSP;URI:http://localhost:8888/ + +[ v3_ca ] + + +# Extensions for a typical CA + + +# PKIX recommendation. + +subjectKeyIdentifier=hash + +authorityKeyIdentifier=keyid:always,issuer:always + +#authorityInfoAccess = OCSP;URI:http://localhost:8888 +#crlDistributionPoints=URI:http://localhost:8901/demoCA/crl/Test_CA_2009.2.crl +# This is what PKIX recommends but some broken software chokes on critical +# extensions. +#basicConstraints = critical,CA:true +# So we do this instead. +basicConstraints = critical, CA:true + +# Key usage: this is typical for a CA certificate. However since it will +# prevent it being used as an test self-signed certificate it is best +# left out by default. +# keyUsage = cRLSign, keyCertSign + +# Some might want this also +# nsCertType = sslCA, emailCA + +# Include email address in subject alt name: another PKIX recommendation +# subjectAltName=email:copy +# Copy issuer details +# issuerAltName=issuer:copy + +# DER hex encoding of an extension: beware experts only! +# obj=DER:02:03 +# Where 'obj' is a standard or added object +# You can even override a supported extension: +# basicConstraints= critical, DER:30:03:01:01:FF + +[ crl_ext ] + +# CRL extensions. +# Only issuerAltName and authorityKeyIdentifier make any sense in a CRL. + +# issuerAltName=issuer:copy +authorityKeyIdentifier=keyid:always,issuer:always + +[ proxy_cert_ext ] +# These extensions should be added when creating a proxy certificate + +# This goes against PKIX guidelines but some CAs do it and some software +# requires this to avoid interpreting an end user certificate as a CA. + +basicConstraints=CA:FALSE + +# Here are some examples of the usage of nsCertType. If it is omitted +# the certificate can be used for anything *except* object signing. + +# This is OK for an SSL server. +# nsCertType = server + +# For an object signing certificate this would be used. +# nsCertType = objsign + +# For normal client use this is typical +# nsCertType = client, email + +# and for everything including object signing: +# nsCertType = client, email, objsign + +# This is typical in keyUsage for a client certificate. +# keyUsage = nonRepudiation, digitalSignature, keyEncipherment + +# This will be displayed in Netscape's comment listbox. +nsComment = "OpenSSL Generated Certificate" + +# PKIX recommendations harmless if included in all certificates. +subjectKeyIdentifier=hash +authorityKeyIdentifier=keyid,issuer:always + +# This stuff is for subjectAltName and issuerAltname. +# Import the email address. +# subjectAltName=email:copy +# An alternative to produce certificates that aren't +# deprecated according to PKIX. +# subjectAltName=email:move + +# Copy subject details +# issuerAltName=issuer:copy + +#nsCaRevocationUrl = http://www.domain.dom/ca-crl.pem +#nsBaseUrl +#nsRevocationUrl +#nsRenewalUrl +#nsCaPolicyUrl +#nsSslServerName + +# This really needs to be in place for it to be a proxy certificate. +proxyCertInfo=critical,language:id-ppl-anyLanguage,pathlen:3,policy:foo diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_4/README.txt b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_4/README.txt new file mode 100755 index 000000000000..3ac354b8f8c7 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_4/README.txt @@ -0,0 +1,4 @@ +Revoked certificates: +--------------------- +- User 2 Sub CA 1 Root 4 + diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_4/demoCA/cacert.pem b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_4/demoCA/cacert.pem new file mode 100755 index 000000000000..391037118147 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_4/demoCA/cacert.pem @@ -0,0 +1,62 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 4096 (0x1000) + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 4 + Validity + Not Before: Nov 20 08:37:27 2009 GMT + Not After : Nov 14 08:37:27 2034 GMT + Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Sub CA 1 Root 4 + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public Key: (1024 bit) + Modulus (1024 bit): + 00:da:b0:21:94:89:b0:00:89:cb:69:59:9b:0d:fe: + 1f:b9:a0:a8:44:92:55:5f:0b:d5:e5:08:63:bd:47: + 6b:11:4d:b1:a8:12:6f:c1:cf:cb:9e:ae:e2:c1:03: + 68:46:59:0b:96:7c:21:45:9b:14:81:d8:f1:83:70: + 6b:3d:b4:56:65:49:87:1d:ab:e2:08:6a:49:66:0e: + 59:b4:da:7a:3f:72:23:b8:1f:fb:78:f5:f0:2d:c4: + fe:d9:94:6e:2e:c3:6e:95:ba:38:60:d1:0b:fa:16: + c7:02:71:ef:3e:71:72:63:26:56:35:1e:8b:ec:47: + 87:25:6e:bc:90:d0:8b:37:2d + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Subject Key Identifier: + 96:9A:2D:06:F6:76:4F:83:68:7B:9C:69:C4:18:BB:4A:EB:46:38:E4 + X509v3 Authority Key Identifier: + keyid:BA:8D:A1:97:DC:C4:39:1F:90:B5:51:6B:10:19:F2:46:0D:A9:65:8E + DirName:/C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=Root 4 + serial:A2:93:46:74:3B:A6:E3:AD + + X509v3 Basic Constraints: critical + CA:TRUE + Signature Algorithm: sha1WithRSAEncryption + 45:77:ba:6b:b6:a7:2a:0f:6b:38:90:9f:0a:18:11:c7:54:7b: + c9:3b:9a:93:90:96:f0:04:0a:56:87:30:e0:f5:d8:84:40:39: + 90:85:ca:e7:38:1b:d8:df:2f:bd:73:91:13:cb:a6:c9:b0:7a: + f7:59:77:6b:9a:d5:86:78:06:dc:40:14:ce:ea:43:a8:ae:ed: + a2:03:64:51:3a:47:7a:9f:df:2d:65:49:56:a5:39:cf:28:2a: + ac:ab:fd:e1:93:fd:3e:56:e8:eb:7a:11:a8:f7:f9:1a:a1:83: + 1f:92:f7:da:4e:c6:d9:67:dd:67:ff:be:6f:e5:24:e1:6e:cc: + 94:3c +-----BEGIN CERTIFICATE----- +MIIDBjCCAm+gAwIBAgICEAAwDQYJKoZIhvcNAQEFBQAwXzELMAkGA1UEBhMCREUx +EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD +VQQLEwtEZXZlbG9wbWVudDEPMA0GA1UEAxMGUm9vdCA0MB4XDTA5MTEyMDA4Mzcy +N1oXDTM0MTExNDA4MzcyN1owaDELMAkGA1UEBhMCREUxEDAOBgNVBAgTB0hhbWJ1 +cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtEZXZlbG9wbWVu +dDEYMBYGA1UEAxMPU3ViIENBIDEgUm9vdCA0MIGfMA0GCSqGSIb3DQEBAQUAA4GN +ADCBiQKBgQDasCGUibAAictpWZsN/h+5oKhEklVfC9XlCGO9R2sRTbGoEm/Bz8ue +ruLBA2hGWQuWfCFFmxSB2PGDcGs9tFZlSYcdq+IIaklmDlm02no/ciO4H/t49fAt +xP7ZlG4uw26Vujhg0Qv6FscCce8+cXJjJlY1HovsR4clbryQ0Is3LQIDAQABo4HH +MIHEMB0GA1UdDgQWBBSWmi0G9nZPg2h7nGnEGLtK60Y45DCBkQYDVR0jBIGJMIGG +gBS6jaGX3MQ5H5C1UWsQGfJGDalljqFjpGEwXzELMAkGA1UEBhMCREUxEDAOBgNV +BAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtE +ZXZlbG9wbWVudDEPMA0GA1UEAxMGUm9vdCA0ggkAopNGdDum460wDwYDVR0TAQH/ +BAUwAwEB/zANBgkqhkiG9w0BAQUFAAOBgQBFd7prtqcqD2s4kJ8KGBHHVHvJO5qT +kJbwBApWhzDg9diEQDmQhcrnOBvY3y+9c5ETy6bJsHr3WXdrmtWGeAbcQBTO6kOo +ru2iA2RROkd6n98tZUlWpTnPKCqsq/3hk/0+VujrehGo9/kaoYMfkvfaTsbZZ91n +/75v5SThbsyUPA== +-----END CERTIFICATE----- diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_4/demoCA/crlnumber b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_4/demoCA/crlnumber new file mode 100755 index 000000000000..dd11724042e2 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_4/demoCA/crlnumber @@ -0,0 +1 @@ +1001 diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_4/demoCA/index.txt b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_4/demoCA/index.txt new file mode 100755 index 000000000000..88e41b76acb1 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_4/demoCA/index.txt @@ -0,0 +1,2 @@ +V 341114084401Z 1000 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=User 1 Sub CA 1 Root 4 +R 341114085720Z 091120085929Z,keyCompromise 1001 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=User 2 Sub CA 1 Root 4 diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_4/demoCA/index.txt.attr b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_4/demoCA/index.txt.attr new file mode 100755 index 000000000000..8f7e63a3475c --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_4/demoCA/index.txt.attr @@ -0,0 +1 @@ +unique_subject = yes diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_4/demoCA/newcerts/1000.pem b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_4/demoCA/newcerts/1000.pem new file mode 100755 index 000000000000..73563ed969ab --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_4/demoCA/newcerts/1000.pem @@ -0,0 +1,60 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 4096 (0x1000) + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Sub CA 1 Root 4 + Validity + Not Before: Nov 20 08:44:01 2009 GMT + Not After : Nov 14 08:44:01 2034 GMT + Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=User 1 Sub CA 1 Root 4 + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public Key: (1024 bit) + Modulus (1024 bit): + 00:c3:55:aa:1b:4f:f6:b4:78:be:ac:61:2a:92:94: + 73:1b:39:4c:0e:57:7e:da:78:03:7e:65:11:57:97: + e6:f4:0d:72:1f:f6:2b:a4:33:f9:5c:bd:2b:25:6c: + 58:29:73:b9:46:d5:db:e9:03:1d:a2:f8:8e:6e:c2: + b5:95:ec:ba:95:c3:ac:2e:c0:b6:40:ba:23:1d:74: + 75:91:cc:d6:3a:4c:15:4d:15:03:a4:e6:80:4a:93: + fe:6c:91:ab:77:60:3b:43:65:21:cd:04:3d:01:71: + 99:47:28:12:c8:9d:f9:d7:25:7a:30:82:76:c0:27: + 5e:c3:70:42:54:2a:0a:02:97 + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Key Usage: + Digital Signature, Non Repudiation, Key Encipherment + Netscape Comment: + OpenSSL Generated Certificate + X509v3 Subject Key Identifier: + D5:2F:1A:60:8E:F9:2E:8F:51:EB:F7:AB:24:47:80:CE:B6:8D:F1:63 + X509v3 Authority Key Identifier: + keyid:96:9A:2D:06:F6:76:4F:83:68:7B:9C:69:C4:18:BB:4A:EB:46:38:E4 + + Signature Algorithm: sha1WithRSAEncryption + 7a:83:0c:a0:2d:14:52:97:a1:0e:dd:b3:2e:a1:1f:0d:51:e7: + 98:2e:89:9a:36:a3:1b:af:28:95:13:ab:3e:31:2e:f6:fa:5f: + f7:85:8c:01:7a:1b:25:63:7e:d6:f9:8e:ad:84:9e:42:3e:1d: + f4:ad:dc:b1:20:91:83:8b:48:ad:34:2a:b9:cc:ae:06:e6:bc: + e1:05:e6:35:71:ca:43:98:3a:e5:93:52:e1:3c:3a:1b:83:53: + d3:a6:ba:6a:43:38:00:92:ba:fb:8f:a8:17:46:f9:32:ac:42: + 47:87:7f:2e:ae:76:49:88:55:1e:65:70:6c:d6:35:ab:64:48: + a9:66 +-----BEGIN CERTIFICATE----- +MIICyzCCAjSgAwIBAgICEAAwDQYJKoZIhvcNAQEFBQAwaDELMAkGA1UEBhMCREUx +EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD +VQQLEwtEZXZlbG9wbWVudDEYMBYGA1UEAxMPU3ViIENBIDEgUm9vdCA0MB4XDTA5 +MTEyMDA4NDQwMVoXDTM0MTExNDA4NDQwMVowbzELMAkGA1UEBhMCREUxEDAOBgNV +BAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtE +ZXZlbG9wbWVudDEfMB0GA1UEAxMWVXNlciAxIFN1YiBDQSAxIFJvb3QgNDCBnzAN +BgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAw1WqG0/2tHi+rGEqkpRzGzlMDld+2ngD +fmURV5fm9A1yH/YrpDP5XL0rJWxYKXO5RtXb6QMdoviObsK1ley6lcOsLsC2QLoj +HXR1kczWOkwVTRUDpOaASpP+bJGrd2A7Q2UhzQQ9AXGZRygSyJ351yV6MIJ2wCde +w3BCVCoKApcCAwEAAaN9MHswCwYDVR0PBAQDAgXgMCwGCWCGSAGG+EIBDQQfFh1P +cGVuU1NMIEdlbmVyYXRlZCBDZXJ0aWZpY2F0ZTAdBgNVHQ4EFgQU1S8aYI75Lo9R +6/erJEeAzraN8WMwHwYDVR0jBBgwFoAUlpotBvZ2T4Noe5xpxBi7SutGOOQwDQYJ +KoZIhvcNAQEFBQADgYEAeoMMoC0UUpehDt2zLqEfDVHnmC6JmjajG68olROrPjEu +9vpf94WMAXobJWN+1vmOrYSeQj4d9K3csSCRg4tIrTQqucyuBua84QXmNXHKQ5g6 +5ZNS4Tw6G4NT06a6akM4AJK6+4+oF0b5MqxCR4d/Lq52SYhVHmVwbNY1q2RIqWY= +-----END CERTIFICATE----- diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_4/demoCA/newcerts/1001.pem b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_4/demoCA/newcerts/1001.pem new file mode 100755 index 000000000000..7068aa0afdc9 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_4/demoCA/newcerts/1001.pem @@ -0,0 +1,60 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 4097 (0x1001) + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Sub CA 1 Root 4 + Validity + Not Before: Nov 20 08:57:20 2009 GMT + Not After : Nov 14 08:57:20 2034 GMT + Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=User 2 Sub CA 1 Root 4 + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public Key: (1024 bit) + Modulus (1024 bit): + 00:ab:2a:df:93:6c:f0:b1:34:54:15:5b:06:4e:15: + bb:94:53:89:96:96:47:db:43:49:e7:66:d5:6b:53: + eb:04:54:d0:96:48:08:8f:8e:cc:70:e1:62:88:6a: + f3:ff:bc:65:55:b9:55:a6:29:22:c1:f6:16:9a:01: + 25:86:a9:72:c8:7c:0f:29:87:b9:14:51:34:d2:fc: + 01:3e:20:46:dc:54:3f:f3:03:d8:07:e0:6b:0c:78: + 70:d0:d0:93:83:e2:cf:53:fc:3b:d5:b0:c9:7d:40: + 8b:ee:5d:d3:30:e9:24:01:1e:b0:ac:de:1a:18:97: + a1:0d:58:79:5e:67:cd:99:bf + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Key Usage: + Digital Signature, Non Repudiation, Key Encipherment + Netscape Comment: + OpenSSL Generated Certificate + X509v3 Subject Key Identifier: + 47:DB:A7:93:38:C2:0F:34:7F:B7:DE:35:C9:23:75:CC:30:93:A4:42 + X509v3 Authority Key Identifier: + keyid:96:9A:2D:06:F6:76:4F:83:68:7B:9C:69:C4:18:BB:4A:EB:46:38:E4 + + Signature Algorithm: sha1WithRSAEncryption + 97:70:47:74:ce:e1:f6:51:bf:cc:cf:0f:cf:cc:23:75:df:4b: + 3d:36:f0:70:0f:47:5d:c7:96:ad:b0:78:95:89:3a:2a:7a:ba: + 79:45:fe:2f:37:4c:69:76:ab:0a:10:ea:0d:5e:fe:28:04:44: + 9c:f3:8d:43:f5:15:fa:79:be:d3:86:f3:c1:b5:8b:5a:74:a9: + c5:b7:fe:e8:63:6e:1f:13:3a:c9:49:3b:45:0c:a6:64:b9:07: + 9b:1a:30:09:1d:5e:f0:2b:a9:55:aa:41:fa:85:0d:ef:dd:c3: + f5:58:52:bf:7f:6d:f4:18:06:f4:5a:71:af:e4:57:b0:0a:6e: + f6:76 +-----BEGIN CERTIFICATE----- +MIICyzCCAjSgAwIBAgICEAEwDQYJKoZIhvcNAQEFBQAwaDELMAkGA1UEBhMCREUx +EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD +VQQLEwtEZXZlbG9wbWVudDEYMBYGA1UEAxMPU3ViIENBIDEgUm9vdCA0MB4XDTA5 +MTEyMDA4NTcyMFoXDTM0MTExNDA4NTcyMFowbzELMAkGA1UEBhMCREUxEDAOBgNV +BAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtE +ZXZlbG9wbWVudDEfMB0GA1UEAxMWVXNlciAyIFN1YiBDQSAxIFJvb3QgNDCBnzAN +BgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAqyrfk2zwsTRUFVsGThW7lFOJlpZH20NJ +52bVa1PrBFTQlkgIj47McOFiiGrz/7xlVblVpikiwfYWmgElhqlyyHwPKYe5FFE0 +0vwBPiBG3FQ/8wPYB+BrDHhw0NCTg+LPU/w71bDJfUCL7l3TMOkkAR6wrN4aGJeh +DVh5XmfNmb8CAwEAAaN9MHswCwYDVR0PBAQDAgXgMCwGCWCGSAGG+EIBDQQfFh1P +cGVuU1NMIEdlbmVyYXRlZCBDZXJ0aWZpY2F0ZTAdBgNVHQ4EFgQUR9unkzjCDzR/ +t941ySN1zDCTpEIwHwYDVR0jBBgwFoAUlpotBvZ2T4Noe5xpxBi7SutGOOQwDQYJ +KoZIhvcNAQEFBQADgYEAl3BHdM7h9lG/zM8Pz8wjdd9LPTbwcA9HXceWrbB4lYk6 +Knq6eUX+LzdMaXarChDqDV7+KAREnPONQ/UV+nm+04bzwbWLWnSpxbf+6GNuHxM6 +yUk7RQymZLkHmxowCR1e8CupVapB+oUN793D9VhSv39t9BgG9Fpxr+RXsApu9nY= +-----END CERTIFICATE----- diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_4/demoCA/private/cakey.pem b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_4/demoCA/private/cakey.pem new file mode 100755 index 000000000000..4c3de720f9eb --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_4/demoCA/private/cakey.pem @@ -0,0 +1,18 @@ +-----BEGIN RSA PRIVATE KEY----- +Proc-Type: 4,ENCRYPTED +DEK-Info: DES-EDE3-CBC,48187111D008BD14 + +9y5tseMMq8fPCuUelw75mRr1ALSrxNWatiMrmFM44I27wxIlaVgePNk3ovpuUpjB +RTArkp0zqA8tHCE/ZzE0cKtkxabTfrghxeKb2lAIrIUFwAFnMPEoB69M23qKblQD +/CbYquy6mpjzLBYwM0Ub8fj4d6fMCJ29Mqlbzj9XJ2oif8zW90lxE4CZNGEWKWaO +pF0ytqUM0aVIBVXZOGmeUpJlAgwdshYHD0JwoULWzFOa+9aks+wjYwQcDxbPq3YC +TBSzHiKd68YSDvK5VevIAIrSKEEqrXgsnL0k23/xkK5ZN8w9gmROrwpqg78Aa/cp +13luMYMRAm+hBfCFzKXvc8hV49UCPWOJcB4/p8to8Bx95UcJ17npG71yrNJgwTA6 +Wgj4pxtddt4QItVqv6usIvkMwD4pQqZ4y+5UMEvw2paG428+SN6YElH6/6yB/9Cc +B7BxhhaazM+AEulpvvfQgjpIqn5+QyaZ7GVcNh/Bi66tenNv9NBVqP1PmuZUMF77 +QddQGzCpxaSb/x/3InhMP2PgGN37B9ezm8ee+AQpmk1VzJ5zpiuoGbQ3oLnDVMKS +aNe7VIyhovq7tnJIuIft8jOEMFfPot9vgIwnHVQ4PF+KK0bzWjSK+6HyO+1Jkw/5 +TpHfQSxEVf8brC8g9l7+FjGSbHF80EzOUx1lMDe/BUzuVvRhiewqrlkCrPf90uuy +hEf1UKqrDK2i2iLBzZ0+OXba3wj20jFRaYLN5YykE6fKo/H6UjEn203nMI2Qi+2m +5j5dgDAOXnNWQN45MxIMu6xxPSaEcb8YUgfMqwytfVmo/xSioyoV+w== +-----END RSA PRIVATE KEY----- diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_4/demoCA/serial b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_4/demoCA/serial new file mode 100755 index 000000000000..7d802a3e7104 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_4/demoCA/serial @@ -0,0 +1 @@ +1002 diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_4/openssl.cfg b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_4/openssl.cfg new file mode 100755 index 000000000000..5f9493f47e9b --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_4/openssl.cfg @@ -0,0 +1,292 @@ +# +# OpenSSL example configuration file. +# This is mostly being used for generation of certificate requests. +# + +# This definition stops the following lines choking if HOME isn't +# defined. +HOME = . +RANDFILE = $ENV::HOME/.rnd + +# Extra OBJECT IDENTIFIER info: +#oid_file = $ENV::HOME/.oid +oid_section = new_oids + +# To use this configuration file with the "-extfile" option of the +# "openssl x509" utility, name here the section containing the +# X.509v3 extensions to use: +# extensions = +# (Alternatively, use a configuration file that has only +# X.509v3 extensions in its main [= default] section.) + +[ new_oids ] + +# We can add new OIDs in here for use by 'ca' and 'req'. +# Add a simple OID like this: +# testoid1=1.2.3.4 +# Or use config file substitution like this: +# testoid2=${testoid1}.5.6 + +#################################################################### +[ ca ] +default_ca = CA_default # The default ca section + +#################################################################### +[ CA_default ] + +dir = ./demoCA # Where everything is kept +certs = $dir/certs # Where the issued certs are kept +crl_dir = $dir/crl # Where the issued crl are kept +database = $dir/index.txt # database index file. +#unique_subject = no # Set to 'no' to allow creation of + # several ctificates with same subject. +new_certs_dir = $dir/newcerts # default place for new certs. + +certificate = $dir/cacert.pem # The CA certificate +serial = $dir/serial # The current serial number +crlnumber = $dir/crlnumber # the current crl number + # must be commented out to leave a V1 CRL +crl = $dir/crl.pem # The current CRL +private_key = $dir/private/cakey.pem # The private key +RANDFILE = $dir/private/.rand # private random number file + +x509_extensions = usr_cert # The extentions to add to the cert + +# Comment out the following two lines for the "traditional" +# (and highly broken) format. +name_opt = ca_default # Subject Name options +cert_opt = ca_default # Certificate field options + +# Extension copying option: use with caution. +# copy_extensions = copy + +# Extensions to add to a CRL. Note: Netscape communicator chokes on V2 CRLs +# so this is commented out by default to leave a V1 CRL. +# crlnumber must also be commented out to leave a V1 CRL. +# crl_extensions = crl_ext + +default_days = 365 # how long to certify for +default_crl_days= 30 # how long before next CRL +default_md = sha1 # which md to use. +preserve = no # keep passed DN ordering + +# A few difference way of specifying how similar the request should look +# For type CA, the listed attributes must be the same, and the optional +# and supplied fields are just that :-) +policy = policy_match + +# For the CA policy +[ policy_match ] +countryName = match +stateOrProvinceName = match +organizationName = match +organizationalUnitName = optional +commonName = supplied +emailAddress = optional + +# For the 'anything' policy +# At this point in time, you must list all acceptable 'object' +# types. +[ policy_anything ] +countryName = optional +stateOrProvinceName = optional +localityName = optional +organizationName = optional +organizationalUnitName = optional +commonName = supplied +emailAddress = optional + +#################################################################### +[ req ] +default_bits = 1024 +default_keyfile = privkey.pem +distinguished_name = req_distinguished_name +attributes = req_attributes +x509_extensions = v3_ca # The extentions to add to the self signed cert + +# Passwords for private keys if not present they will be prompted for +# input_password = secret +# output_password = secret + +# This sets a mask for permitted string types. There are several options. +# default: PrintableString, T61String, BMPString. +# pkix : PrintableString, BMPString. +# utf8only: only UTF8Strings. +# nombstr : PrintableString, T61String (no BMPStrings or UTF8Strings). +# MASK:XXXX a literal mask value. +# WARNING: current versions of Netscape crash on BMPStrings or UTF8Strings +# so use this option with caution! +string_mask = nombstr + +# req_extensions = v3_req # The extensions to add to a certificate request + +[ req_distinguished_name ] +countryName = Country Name (2 letter code) +countryName_default = DE +countryName_min = 2 +countryName_max = 2 + +stateOrProvinceName = State or Province Name (full name) +stateOrProvinceName_default = Hamburg + +localityName = Locality Name (eg, city) + +0.organizationName = Organization Name (eg, company) +0.organizationName_default = OpenOffice.org + +# we can do this but it is not needed normally :-) +#1.organizationName = Second Organization Name (eg, company) +#1.organizationName_default = World Wide Web Pty Ltd + +organizationalUnitName = Organizational Unit Name (eg, section) +organizationalUnitName_default = Development + +commonName = Common Name (eg, YOUR name) +commonName_max = 64 + +emailAddress = Email Address +emailAddress_max = 64 + +# SET-ex3 = SET extension number 3 + +[ req_attributes ] +challengePassword = A challenge password +challengePassword_min = 4 +challengePassword_max = 20 + +unstructuredName = An optional company name + +[ usr_cert ] + +# These extensions are added when 'ca' signs a request. +#authorityInfoAccess = OCSP;URI:http://localhost:8888/ + +# This is typical in keyUsage for a client certificate. +keyUsage = nonRepudiation, digitalSignature, keyEncipherment + +# This will be displayed in Netscape's comment listbox. +nsComment = "OpenSSL Generated Certificate" + +# PKIX recommendations harmless if included in all certificates. +subjectKeyIdentifier=hash +authorityKeyIdentifier=keyid,issuer + +# This stuff is for subjectAltName and issuerAltname. +# Import the email address. +# subjectAltName=email:copy +# An alternative to produce certificates that aren't +# deprecated according to PKIX. +# subjectAltName=email:move + +# Copy subject details +# issuerAltName=issuer:copy + + + +[ v3_req ] + +# Extensions to add to a certificate request + +basicConstraints = CA:FALSE +keyUsage = nonRepudiation, digitalSignature, keyEncipherment +#authorityInfoAccess = OCSP;URI:http://localhost:8888/ + +[ v3_ca ] + + +# Extensions for a typical CA + + +# PKIX recommendation. + +subjectKeyIdentifier=hash + +authorityKeyIdentifier=keyid:always,issuer:always + +#authorityInfoAccess = OCSP;URI:http://localhost:8888 +#crlDistributionPoints=URI:http://localhost:8901/demoCA/crl/Test_CA_2009.2.crl +# This is what PKIX recommends but some broken software chokes on critical +# extensions. +#basicConstraints = critical,CA:true +# So we do this instead. +basicConstraints = critical, CA:true + +# Key usage: this is typical for a CA certificate. However since it will +# prevent it being used as an test self-signed certificate it is best +# left out by default. +# keyUsage = cRLSign, keyCertSign + +# Some might want this also +# nsCertType = sslCA, emailCA + +# Include email address in subject alt name: another PKIX recommendation +# subjectAltName=email:copy +# Copy issuer details +# issuerAltName=issuer:copy + +# DER hex encoding of an extension: beware experts only! +# obj=DER:02:03 +# Where 'obj' is a standard or added object +# You can even override a supported extension: +# basicConstraints= critical, DER:30:03:01:01:FF + +[ crl_ext ] + +# CRL extensions. +# Only issuerAltName and authorityKeyIdentifier make any sense in a CRL. + +# issuerAltName=issuer:copy +authorityKeyIdentifier=keyid:always,issuer:always + +[ proxy_cert_ext ] +# These extensions should be added when creating a proxy certificate + +# This goes against PKIX guidelines but some CAs do it and some software +# requires this to avoid interpreting an end user certificate as a CA. + +basicConstraints=CA:FALSE + +# Here are some examples of the usage of nsCertType. If it is omitted +# the certificate can be used for anything *except* object signing. + +# This is OK for an SSL server. +# nsCertType = server + +# For an object signing certificate this would be used. +# nsCertType = objsign + +# For normal client use this is typical +# nsCertType = client, email + +# and for everything including object signing: +# nsCertType = client, email, objsign + +# This is typical in keyUsage for a client certificate. +# keyUsage = nonRepudiation, digitalSignature, keyEncipherment + +# This will be displayed in Netscape's comment listbox. +nsComment = "OpenSSL Generated Certificate" + +# PKIX recommendations harmless if included in all certificates. +subjectKeyIdentifier=hash +authorityKeyIdentifier=keyid,issuer:always + +# This stuff is for subjectAltName and issuerAltname. +# Import the email address. +# subjectAltName=email:copy +# An alternative to produce certificates that aren't +# deprecated according to PKIX. +# subjectAltName=email:move + +# Copy subject details +# issuerAltName=issuer:copy + +#nsCaRevocationUrl = http://www.domain.dom/ca-crl.pem +#nsBaseUrl +#nsRevocationUrl +#nsRenewalUrl +#nsCaPolicyUrl +#nsSslServerName + +# This really needs to be in place for it to be a proxy certificate. +proxyCertInfo=critical,language:id-ppl-anyLanguage,pathlen:3,policy:foo diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_5/README.txt b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_5/README.txt new file mode 100755 index 000000000000..b266749a9e78 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_5/README.txt @@ -0,0 +1,5 @@ +To provide the CRL via HTTP run + +java -jar ../../tools/httpserv/dist/httpserv.jar -a 8902 + + diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_5/demoCA/cacert.pem b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_5/demoCA/cacert.pem new file mode 100755 index 000000000000..b350f6eb33ef --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_5/demoCA/cacert.pem @@ -0,0 +1,66 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 4097 (0x1001) + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 5 + Validity + Not Before: Nov 20 11:30:23 2009 GMT + Not After : Nov 14 11:30:23 2034 GMT + Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Sub CA 1 Root 5 + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public Key: (1024 bit) + Modulus (1024 bit): + 00:97:fa:a2:49:d3:bf:c1:2e:7a:ed:83:83:3c:78: + 96:c8:b2:b9:67:af:c0:5e:0a:89:89:fb:94:59:32: + a8:2a:e4:20:2f:3b:3d:ce:53:4f:72:fc:6c:0b:93: + 38:c3:df:66:6e:d5:79:d0:a4:4e:41:84:43:3c:99: + 79:0c:e0:5f:19:1a:3d:f5:4b:11:28:0f:80:b0:a0: + 71:34:5b:90:71:c2:ef:1e:85:2e:5b:9f:3b:22:c3: + 18:f8:7c:1f:ef:1b:78:17:a0:44:60:46:7e:88:eb: + a7:60:a0:5c:2a:7c:37:99:fa:27:97:08:e8:89:ba: + bc:69:4b:79:93:8f:ad:b5:9b + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Subject Key Identifier: + 01:E9:B5:99:E4:6D:F9:8C:42:3D:09:10:0F:A7:75:C6:27:78:4A:AF + X509v3 Authority Key Identifier: + keyid:C1:D1:A0:D4:5B:0B:9D:7E:31:61:F9:39:10:9F:31:10:E0:D2:06:B5 + DirName:/C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=Root 5 + serial:F0:3D:B6:A9:A9:9C:A3:4E + + X509v3 CRL Distribution Points: + URI:http://localhost:8901/demoCA/crl/Root_5.crl + + X509v3 Basic Constraints: critical + CA:TRUE + Signature Algorithm: sha1WithRSAEncryption + 6d:ca:34:05:99:ff:99:49:d3:6d:9d:ad:c6:99:da:9d:6c:94: + 62:77:ed:1c:39:23:d2:e8:b6:3e:df:63:dc:7c:10:3f:c2:ed: + f4:04:26:58:05:01:4c:ed:a9:83:43:3a:5d:fe:60:6d:5b:58: + dc:93:8c:94:69:b6:7f:02:48:30:9c:31:f4:7d:de:e0:de:04: + d2:dc:79:b7:60:c2:87:f7:c7:92:a2:f5:86:a7:0c:70:3b:a3: + a7:35:11:cf:a4:28:21:aa:8b:24:50:2e:96:41:be:66:01:bd: + b9:ec:04:0c:92:d9:8a:e7:a0:96:24:9b:f1:a2:9f:59:59:4a: + 32:a4 +-----BEGIN CERTIFICATE----- +MIIDRjCCAq+gAwIBAgICEAEwDQYJKoZIhvcNAQEFBQAwXzELMAkGA1UEBhMCREUx +EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD +VQQLEwtEZXZlbG9wbWVudDEPMA0GA1UEAxMGUm9vdCA1MB4XDTA5MTEyMDExMzAy +M1oXDTM0MTExNDExMzAyM1owaDELMAkGA1UEBhMCREUxEDAOBgNVBAgTB0hhbWJ1 +cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtEZXZlbG9wbWVu +dDEYMBYGA1UEAxMPU3ViIENBIDEgUm9vdCA1MIGfMA0GCSqGSIb3DQEBAQUAA4GN +ADCBiQKBgQCX+qJJ07/BLnrtg4M8eJbIsrlnr8BeComJ+5RZMqgq5CAvOz3OU09y +/GwLkzjD32Zu1XnQpE5BhEM8mXkM4F8ZGj31SxEoD4CwoHE0W5Bxwu8ehS5bnzsi +wxj4fB/vG3gXoERgRn6I66dgoFwqfDeZ+ieXCOiJurxpS3mTj621mwIDAQABo4IB +BjCCAQIwHQYDVR0OBBYEFAHptZnkbfmMQj0JEA+ndcYneEqvMIGRBgNVHSMEgYkw +gYaAFMHRoNRbC51+MWH5ORCfMRDg0ga1oWOkYTBfMQswCQYDVQQGEwJERTEQMA4G +A1UECBMHSGFtYnVyZzEXMBUGA1UEChMOT3Blbk9mZmljZS5vcmcxFDASBgNVBAsT +C0RldmVsb3BtZW50MQ8wDQYDVQQDEwZSb290IDWCCQDwPbapqZyjTjA8BgNVHR8E +NTAzMDGgL6AthitodHRwOi8vbG9jYWxob3N0Ojg5MDEvZGVtb0NBL2NybC9Sb290 +XzUuY3JsMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEFBQADgYEAbco0BZn/ +mUnTbZ2txpnanWyUYnftHDkj0ui2Pt9j3HwQP8Lt9AQmWAUBTO2pg0M6Xf5gbVtY +3JOMlGm2fwJIMJwx9H3e4N4E0tx5t2DCh/fHkqL1hqcMcDujpzURz6QoIaqLJFAu +lkG+ZgG9uewEDJLZiuegliSb8aKfWVlKMqQ= +-----END CERTIFICATE----- diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_5/demoCA/crl/DO_NOT_INSTALL_THIS_CRL b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_5/demoCA/crl/DO_NOT_INSTALL_THIS_CRL new file mode 100755 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_5/demoCA/crl/DO_NOT_INSTALL_THIS_CRL diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_5/demoCA/crl/Sub_CA_1_Root_5.crl b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_5/demoCA/crl/Sub_CA_1_Root_5.crl Binary files differnew file mode 100755 index 000000000000..3aec2bba1d83 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_5/demoCA/crl/Sub_CA_1_Root_5.crl diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_5/demoCA/crlnumber b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_5/demoCA/crlnumber new file mode 100755 index 000000000000..dd11724042e2 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_5/demoCA/crlnumber @@ -0,0 +1 @@ +1001 diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_5/demoCA/index.txt b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_5/demoCA/index.txt new file mode 100755 index 000000000000..2f83d6f9b733 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_5/demoCA/index.txt @@ -0,0 +1 @@ +V 341114113322Z 1002 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=User 1 Sub CA 1 Root 5 diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_5/demoCA/index.txt.attr b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_5/demoCA/index.txt.attr new file mode 100755 index 000000000000..8f7e63a3475c --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_5/demoCA/index.txt.attr @@ -0,0 +1 @@ +unique_subject = yes diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_5/demoCA/newcerts/1002.pem b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_5/demoCA/newcerts/1002.pem new file mode 100755 index 000000000000..59d5f7a2b431 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_5/demoCA/newcerts/1002.pem @@ -0,0 +1,62 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 4098 (0x1002) + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Sub CA 1 Root 5 + Validity + Not Before: Nov 20 11:33:22 2009 GMT + Not After : Nov 14 11:33:22 2034 GMT + Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=User 1 Sub CA 1 Root 5 + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public Key: (1024 bit) + Modulus (1024 bit): + 00:d3:fd:a7:4f:ea:02:e2:b4:32:80:3f:64:bb:37: + 9d:9e:fa:86:b2:25:b3:1d:f6:5d:05:8e:2b:0c:bd: + 60:1e:e6:52:39:4c:84:9e:93:6c:d2:b4:2d:34:1a: + e7:42:b6:bf:34:bd:ca:44:31:fb:06:5e:20:0a:a1: + 22:ca:9b:4f:01:57:bd:b1:30:57:a9:0f:fc:06:ae: + 18:6c:2d:9e:70:7a:21:2a:fd:0c:f8:03:00:32:60: + 5d:37:c5:11:56:74:30:e4:03:3c:88:71:d5:79:d3: + 76:02:e1:85:87:63:4b:5b:cd:c9:1f:ca:85:7a:8c: + 3a:fd:a9:83:94:b9:6d:f6:95 + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 CRL Distribution Points: + URI:http://localhost:8902/demoCA/crl/Sub_CA_1_Root_5.crl + + X509v3 Key Usage: + Digital Signature, Non Repudiation, Key Encipherment + X509v3 Subject Key Identifier: + E0:53:2E:E4:6B:0B:99:C0:AD:C1:02:40:46:6C:35:EE:49:73:5D:0B + X509v3 Authority Key Identifier: + keyid:01:E9:B5:99:E4:6D:F9:8C:42:3D:09:10:0F:A7:75:C6:27:78:4A:AF + + Signature Algorithm: sha1WithRSAEncryption + 5f:6a:81:3b:56:e8:6d:33:0e:1e:6a:73:b1:e8:69:b7:3f:83: + 81:6c:73:7c:9d:f7:12:c9:bf:99:16:cf:56:38:e4:58:db:28: + a5:9c:e3:8e:ed:27:d2:da:53:41:80:2a:d4:c3:92:5d:b5:b4: + 5a:d6:17:f7:74:9d:83:13:06:7f:20:8e:50:5f:60:5b:3a:9a: + 9f:c2:58:5f:fa:07:90:df:a0:02:cf:c4:d7:7d:2e:b7:72:df: + 8f:93:ce:5a:b3:17:ba:73:93:20:64:b9:b2:ad:6e:89:63:c5: + 08:e1:a0:6a:b2:9d:1e:33:31:83:98:d1:05:7d:ec:48:72:1f: + dd:60 +-----BEGIN CERTIFICATE----- +MIIC5jCCAk+gAwIBAgICEAIwDQYJKoZIhvcNAQEFBQAwaDELMAkGA1UEBhMCREUx +EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD +VQQLEwtEZXZlbG9wbWVudDEYMBYGA1UEAxMPU3ViIENBIDEgUm9vdCA1MB4XDTA5 +MTEyMDExMzMyMloXDTM0MTExNDExMzMyMlowbzELMAkGA1UEBhMCREUxEDAOBgNV +BAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtE +ZXZlbG9wbWVudDEfMB0GA1UEAxMWVXNlciAxIFN1YiBDQSAxIFJvb3QgNTCBnzAN +BgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA0/2nT+oC4rQygD9kuzednvqGsiWzHfZd +BY4rDL1gHuZSOUyEnpNs0rQtNBrnQra/NL3KRDH7Bl4gCqEiyptPAVe9sTBXqQ/8 +Bq4YbC2ecHohKv0M+AMAMmBdN8URVnQw5AM8iHHVedN2AuGFh2NLW83JH8qFeow6 +/amDlLlt9pUCAwEAAaOBlzCBlDBFBgNVHR8EPjA8MDqgOKA2hjRodHRwOi8vbG9j +YWxob3N0Ojg5MDIvZGVtb0NBL2NybC9TdWJfQ0FfMV9Sb290XzUuY3JsMAsGA1Ud +DwQEAwIF4DAdBgNVHQ4EFgQU4FMu5GsLmcCtwQJARmw17klzXQswHwYDVR0jBBgw +FoAUAem1meRt+YxCPQkQD6d1xid4Sq8wDQYJKoZIhvcNAQEFBQADgYEAX2qBO1bo +bTMOHmpzsehptz+DgWxzfJ33Esm/mRbPVjjkWNsopZzjju0n0tpTQYAq1MOSXbW0 +WtYX93SdgxMGfyCOUF9gWzqan8JYX/oHkN+gAs/E130ut3Lfj5POWrMXunOTIGS5 +sq1uiWPFCOGgarKdHjMxg5jRBX3sSHIf3WA= +-----END CERTIFICATE----- diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_5/demoCA/private/cakey.pem b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_5/demoCA/private/cakey.pem new file mode 100755 index 000000000000..fb9af1caa35e --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_5/demoCA/private/cakey.pem @@ -0,0 +1,18 @@ +-----BEGIN RSA PRIVATE KEY----- +Proc-Type: 4,ENCRYPTED +DEK-Info: DES-EDE3-CBC,30B50FFE9747C5F2 + +pXO59gJmBcDztjZDwRRcJV+m/BBdF/NlI0WD7WBr4vR663B6hZw0hqAkCn3o0VbO +DzLsoQUMUv/70aXc2SgvS8LleG+mWCkPE+huzFjPAn6Z6+p0MhHrYRJ7iulPAVV0 ++wCs8+1UbvKyozLy+BfvEwGHEho8sr3w81y2noE2pjaQOE1JGKY91VnFz1yPhYHC +r26sO1DqoqtWS8XSe2FdREG/guKpoHtoUazQhCkgeBk18OImKlrxp1pT/haObv5i +5qILjSvMBjmrTCJDi1vgShEiAZTE318ipK5wCLKiA6UvZ3GMxb2xjy+na3CUTrzf +AAefrW4NaoyIWI8dRtPxFic678ZgqcRMdMW7BgdffLXX5IueCqHeTNS7xcr2T2gd +hzKxinZnY8MQosFeyzP3fYWxv5PY54HNmCnsN2SXJSOq+CPSsIvbDR5p1bhrcEf9 +1O815NhJTx2nPAkIC+7bemAkz2f3g09SuhtQTaCnZMwcAmnMAT0ewWJSxDCVOg5s +B/OPe8RJ1tiO7DnaZH6RQDPUCKaUgS9xSzCu1q0IWWbzUWioPIX13fFlvl9gAxbY ++FI6dD2DwHBTyiPLLyT7FBfwjnHul2zSn/jXnby7n1sILQIP0AQK0cJDS1ZdC2CB +oe4gwzSVCxp7v3Zfp1ZoyYOtei0gT6+bDvjBYsl90jyvyucWfKjlZiEauQV8gSOQ +G2iY5QZ0clAFg7MQKmHuTaAALk0IrauSW20eR/HF0/2R6xCt91zcyhwbOiZFNyQ3 +gtvwLu9ZzAHfWcnIEWxpYF68O+vj+g6Jpl/q6j8KaTta3smEBzgpow== +-----END RSA PRIVATE KEY----- diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_5/demoCA/serial b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_5/demoCA/serial new file mode 100755 index 000000000000..baccd0398f98 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_5/demoCA/serial @@ -0,0 +1 @@ +1003 diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_5/openssl.cfg b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_5/openssl.cfg new file mode 100755 index 000000000000..eaa527d3dc41 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_5/openssl.cfg @@ -0,0 +1,292 @@ +# +# OpenSSL example configuration file. +# This is mostly being used for generation of certificate requests. +# + +# This definition stops the following lines choking if HOME isn't +# defined. +HOME = . +RANDFILE = $ENV::HOME/.rnd + +# Extra OBJECT IDENTIFIER info: +#oid_file = $ENV::HOME/.oid +oid_section = new_oids + +# To use this configuration file with the "-extfile" option of the +# "openssl x509" utility, name here the section containing the +# X.509v3 extensions to use: +# extensions = +# (Alternatively, use a configuration file that has only +# X.509v3 extensions in its main [= default] section.) + +[ new_oids ] + +# We can add new OIDs in here for use by 'ca' and 'req'. +# Add a simple OID like this: +# testoid1=1.2.3.4 +# Or use config file substitution like this: +# testoid2=${testoid1}.5.6 + +#################################################################### +[ ca ] +default_ca = CA_default # The default ca section + +#################################################################### +[ CA_default ] + +dir = ./demoCA # Where everything is kept +certs = $dir/certs # Where the issued certs are kept +crl_dir = $dir/crl # Where the issued crl are kept +database = $dir/index.txt # database index file. +#unique_subject = no # Set to 'no' to allow creation of + # several ctificates with same subject. +new_certs_dir = $dir/newcerts # default place for new certs. + +certificate = $dir/cacert.pem # The CA certificate +serial = $dir/serial # The current serial number +crlnumber = $dir/crlnumber # the current crl number + # must be commented out to leave a V1 CRL +crl = $dir/crl.pem # The current CRL +private_key = $dir/private/cakey.pem # The private key +RANDFILE = $dir/private/.rand # private random number file + +x509_extensions = usr_cert # The extentions to add to the cert + +# Comment out the following two lines for the "traditional" +# (and highly broken) format. +name_opt = ca_default # Subject Name options +cert_opt = ca_default # Certificate field options + +# Extension copying option: use with caution. +# copy_extensions = copy + +# Extensions to add to a CRL. Note: Netscape communicator chokes on V2 CRLs +# so this is commented out by default to leave a V1 CRL. +# crlnumber must also be commented out to leave a V1 CRL. +# crl_extensions = crl_ext + +default_days = 365 # how long to certify for +default_crl_days= 30 # how long before next CRL +default_md = sha1 # which md to use. +preserve = no # keep passed DN ordering + +# A few difference way of specifying how similar the request should look +# For type CA, the listed attributes must be the same, and the optional +# and supplied fields are just that :-) +policy = policy_match + +# For the CA policy +[ policy_match ] +countryName = match +stateOrProvinceName = match +organizationName = match +organizationalUnitName = optional +commonName = supplied +emailAddress = optional + +# For the 'anything' policy +# At this point in time, you must list all acceptable 'object' +# types. +[ policy_anything ] +countryName = optional +stateOrProvinceName = optional +localityName = optional +organizationName = optional +organizationalUnitName = optional +commonName = supplied +emailAddress = optional + +#################################################################### +[ req ] +default_bits = 1024 +default_keyfile = privkey.pem +distinguished_name = req_distinguished_name +attributes = req_attributes +x509_extensions = v3_ca # The extentions to add to the self signed cert + +# Passwords for private keys if not present they will be prompted for +# input_password = secret +# output_password = secret + +# This sets a mask for permitted string types. There are several options. +# default: PrintableString, T61String, BMPString. +# pkix : PrintableString, BMPString. +# utf8only: only UTF8Strings. +# nombstr : PrintableString, T61String (no BMPStrings or UTF8Strings). +# MASK:XXXX a literal mask value. +# WARNING: current versions of Netscape crash on BMPStrings or UTF8Strings +# so use this option with caution! +string_mask = nombstr + +# req_extensions = v3_req # The extensions to add to a certificate request + +[ req_distinguished_name ] +countryName = Country Name (2 letter code) +countryName_default = DE +countryName_min = 2 +countryName_max = 2 + +stateOrProvinceName = State or Province Name (full name) +stateOrProvinceName_default = Hamburg + +localityName = Locality Name (eg, city) + +0.organizationName = Organization Name (eg, company) +0.organizationName_default = OpenOffice.org + +# we can do this but it is not needed normally :-) +#1.organizationName = Second Organization Name (eg, company) +#1.organizationName_default = World Wide Web Pty Ltd + +organizationalUnitName = Organizational Unit Name (eg, section) +organizationalUnitName_default = Development + +commonName = Common Name (eg, YOUR name) +commonName_max = 64 + +emailAddress = Email Address +emailAddress_max = 64 + +# SET-ex3 = SET extension number 3 + +[ req_attributes ] +challengePassword = A challenge password +challengePassword_min = 4 +challengePassword_max = 20 + +unstructuredName = An optional company name + +[ usr_cert ] + +# These extensions are added when 'ca' signs a request. +#authorityInfoAccess = OCSP;URI:http://localhost:8888/ +crlDistributionPoints=URI:http://localhost:8902/demoCA/crl/Sub_CA_1_Root_5.crl +# This is typical in keyUsage for a client certificate. +keyUsage = nonRepudiation, digitalSignature, keyEncipherment + +# This will be displayed in Netscape's comment listbox. +#nsComment = "OpenSSL Generated Certificate" + +# PKIX recommendations harmless if included in all certificates. +subjectKeyIdentifier=hash +authorityKeyIdentifier=keyid,issuer + +# This stuff is for subjectAltName and issuerAltname. +# Import the email address. +# subjectAltName=email:copy +# An alternative to produce certificates that aren't +# deprecated according to PKIX. +# subjectAltName=email:move + +# Copy subject details +# issuerAltName=issuer:copy + + + +[ v3_req ] + +# Extensions to add to a certificate request + +basicConstraints = CA:FALSE +keyUsage = nonRepudiation, digitalSignature, keyEncipherment +#authorityInfoAccess = OCSP;URI:http://localhost:8888/ + +[ v3_ca ] + + +# Extensions for a typical CA + + +# PKIX recommendation. + +subjectKeyIdentifier=hash + +authorityKeyIdentifier=keyid:always,issuer:always + +#authorityInfoAccess = OCSP;URI:http://localhost:8888 +#crlDistributionPoints=URI:http://localhost:8901/demoCA/crl/Test_CA_2009.2.crl +# This is what PKIX recommends but some broken software chokes on critical +# extensions. +#basicConstraints = critical,CA:true +# So we do this instead. +basicConstraints = critical, CA:true + +# Key usage: this is typical for a CA certificate. However since it will +# prevent it being used as an test self-signed certificate it is best +# left out by default. +# keyUsage = cRLSign, keyCertSign + +# Some might want this also +# nsCertType = sslCA, emailCA + +# Include email address in subject alt name: another PKIX recommendation +# subjectAltName=email:copy +# Copy issuer details +# issuerAltName=issuer:copy + +# DER hex encoding of an extension: beware experts only! +# obj=DER:02:03 +# Where 'obj' is a standard or added object +# You can even override a supported extension: +# basicConstraints= critical, DER:30:03:01:01:FF + +[ crl_ext ] + +# CRL extensions. +# Only issuerAltName and authorityKeyIdentifier make any sense in a CRL. + +# issuerAltName=issuer:copy +authorityKeyIdentifier=keyid:always,issuer:always + +[ proxy_cert_ext ] +# These extensions should be added when creating a proxy certificate + +# This goes against PKIX guidelines but some CAs do it and some software +# requires this to avoid interpreting an end user certificate as a CA. + +basicConstraints=CA:FALSE + +# Here are some examples of the usage of nsCertType. If it is omitted +# the certificate can be used for anything *except* object signing. + +# This is OK for an SSL server. +# nsCertType = server + +# For an object signing certificate this would be used. +# nsCertType = objsign + +# For normal client use this is typical +# nsCertType = client, email + +# and for everything including object signing: +# nsCertType = client, email, objsign + +# This is typical in keyUsage for a client certificate. +# keyUsage = nonRepudiation, digitalSignature, keyEncipherment + +# This will be displayed in Netscape's comment listbox. +nsComment = "OpenSSL Generated Certificate" + +# PKIX recommendations harmless if included in all certificates. +subjectKeyIdentifier=hash +authorityKeyIdentifier=keyid,issuer:always + +# This stuff is for subjectAltName and issuerAltname. +# Import the email address. +# subjectAltName=email:copy +# An alternative to produce certificates that aren't +# deprecated according to PKIX. +# subjectAltName=email:move + +# Copy subject details +# issuerAltName=issuer:copy + +#nsCaRevocationUrl = http://www.domain.dom/ca-crl.pem +#nsBaseUrl +#nsRevocationUrl +#nsRenewalUrl +#nsCaPolicyUrl +#nsSslServerName + +# This really needs to be in place for it to be a proxy certificate. +proxyCertInfo=critical,language:id-ppl-anyLanguage,pathlen:3,policy:foo diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_6/demoCA/cacert.pem b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_6/demoCA/cacert.pem new file mode 100755 index 000000000000..0490b88cd769 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_6/demoCA/cacert.pem @@ -0,0 +1,66 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 4097 (0x1001) + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 6 + Validity + Not Before: Nov 20 12:28:07 2009 GMT + Not After : Nov 14 12:28:07 2034 GMT + Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Sub CA 1 Root 6 + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public Key: (1024 bit) + Modulus (1024 bit): + 00:c4:d9:ab:27:06:66:41:0e:36:ff:d4:b1:d0:8c: + f7:b4:25:55:cd:fd:fa:a4:5a:e6:4f:d0:05:dc:a3: + e5:bd:8d:53:77:d1:ea:95:5a:52:81:c8:b6:36:a0: + 5f:3a:e1:85:1e:8a:48:91:7d:29:78:ff:ea:c5:e3: + ad:c4:27:d5:b7:8f:59:20:26:d4:45:87:6a:56:db: + ac:f5:f8:0a:88:82:9e:c2:00:06:fc:98:8a:fe:35: + c3:02:a1:67:08:06:42:e3:88:48:e0:8f:33:ff:f8: + a4:87:1a:3a:d9:54:0e:1c:09:3e:a0:f0:70:cd:b5: + b0:b2:7e:07:73:ad:20:64:69 + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Subject Key Identifier: + 89:8C:D7:71:EB:67:78:4E:D6:01:35:B2:AC:A1:B4:88:43:CE:70:A7 + X509v3 Authority Key Identifier: + keyid:AC:25:5E:9B:B5:BA:4D:8E:BD:77:B2:9D:D9:E2:84:AE:7A:31:8F:F2 + DirName:/C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=Root 6 + serial:D8:6A:4F:24:F9:C9:94:27 + + X509v3 CRL Distribution Points: + URI:http://localhost:8901/demoCA/crl/Root_6.crl + + X509v3 Basic Constraints: critical + CA:TRUE + Signature Algorithm: sha1WithRSAEncryption + 55:5b:3b:6b:8a:d0:1b:d8:19:d9:96:85:4d:b4:a0:98:b1:bd: + 9f:0b:62:21:92:8b:4e:d3:d0:1b:91:3d:e3:f5:bd:ce:16:57: + fc:b7:84:15:51:fd:98:ab:32:59:28:0b:44:57:49:ec:ac:11: + 67:26:7a:a3:c5:b8:9d:2a:de:b6:7c:76:0a:e9:18:9f:98:87: + e8:80:c8:72:99:56:74:ab:73:1b:f4:e7:b9:b1:3a:f3:7b:0d: + 2f:5d:82:6c:d1:99:9f:23:be:23:fb:4c:0e:15:5e:f5:9f:90: + 88:d7:51:3a:6a:7a:f0:54:a5:c4:89:a5:0d:0a:4e:94:59:64: + 59:54 +-----BEGIN CERTIFICATE----- +MIIDRjCCAq+gAwIBAgICEAEwDQYJKoZIhvcNAQEFBQAwXzELMAkGA1UEBhMCREUx +EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD +VQQLEwtEZXZlbG9wbWVudDEPMA0GA1UEAxMGUm9vdCA2MB4XDTA5MTEyMDEyMjgw +N1oXDTM0MTExNDEyMjgwN1owaDELMAkGA1UEBhMCREUxEDAOBgNVBAgTB0hhbWJ1 +cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtEZXZlbG9wbWVu +dDEYMBYGA1UEAxMPU3ViIENBIDEgUm9vdCA2MIGfMA0GCSqGSIb3DQEBAQUAA4GN +ADCBiQKBgQDE2asnBmZBDjb/1LHQjPe0JVXN/fqkWuZP0AXco+W9jVN30eqVWlKB +yLY2oF864YUeikiRfSl4/+rF463EJ9W3j1kgJtRFh2pW26z1+AqIgp7CAAb8mIr+ +NcMCoWcIBkLjiEjgjzP/+KSHGjrZVA4cCT6g8HDNtbCyfgdzrSBkaQIDAQABo4IB +BjCCAQIwHQYDVR0OBBYEFImM13HrZ3hO1gE1sqyhtIhDznCnMIGRBgNVHSMEgYkw +gYaAFKwlXpu1uk2OvXeyndnihK56MY/yoWOkYTBfMQswCQYDVQQGEwJERTEQMA4G +A1UECBMHSGFtYnVyZzEXMBUGA1UEChMOT3Blbk9mZmljZS5vcmcxFDASBgNVBAsT +C0RldmVsb3BtZW50MQ8wDQYDVQQDEwZSb290IDaCCQDYak8k+cmUJzA8BgNVHR8E +NTAzMDGgL6AthitodHRwOi8vbG9jYWxob3N0Ojg5MDEvZGVtb0NBL2NybC9Sb290 +XzYuY3JsMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEFBQADgYEAVVs7a4rQ +G9gZ2ZaFTbSgmLG9nwtiIZKLTtPQG5E94/W9zhZX/LeEFVH9mKsyWSgLRFdJ7KwR +ZyZ6o8W4nSretnx2CukYn5iH6IDIcplWdKtzG/TnubE683sNL12CbNGZnyO+I/tM +DhVe9Z+QiNdROmp68FSlxImlDQpOlFlkWVQ= +-----END CERTIFICATE----- diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_6/demoCA/crl/DO_NOT_CREATE_A_CRL b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_6/demoCA/crl/DO_NOT_CREATE_A_CRL new file mode 100755 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_6/demoCA/crl/DO_NOT_CREATE_A_CRL diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_6/demoCA/crlnumber b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_6/demoCA/crlnumber new file mode 100755 index 000000000000..83b33d238dab --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_6/demoCA/crlnumber @@ -0,0 +1 @@ +1000 diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_6/demoCA/index.txt b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_6/demoCA/index.txt new file mode 100755 index 000000000000..6e4d7577dfdc --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_6/demoCA/index.txt @@ -0,0 +1 @@ +V 341114123743Z 1000 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=User 1 Sub CA 1 Root 6 diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_6/demoCA/index.txt.attr b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_6/demoCA/index.txt.attr new file mode 100755 index 000000000000..8f7e63a3475c --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_6/demoCA/index.txt.attr @@ -0,0 +1 @@ +unique_subject = yes diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_6/demoCA/newcerts/1000.pem b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_6/demoCA/newcerts/1000.pem new file mode 100755 index 000000000000..538cb4e0bfcb --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_6/demoCA/newcerts/1000.pem @@ -0,0 +1,62 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 4096 (0x1000) + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Sub CA 1 Root 6 + Validity + Not Before: Nov 20 12:37:43 2009 GMT + Not After : Nov 14 12:37:43 2034 GMT + Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=User 1 Sub CA 1 Root 6 + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public Key: (1024 bit) + Modulus (1024 bit): + 00:bb:ac:68:10:41:28:94:fd:fe:39:5e:63:cf:eb: + 9f:2b:20:82:f3:86:d2:e1:38:05:7e:95:cc:46:e5: + 42:8b:5c:0d:2c:ad:ad:44:c0:4c:2f:7c:75:e8:bd: + aa:cd:f2:05:16:18:a5:a3:fa:e7:a0:ba:57:31:e2: + b0:4d:85:9d:60:e4:41:92:49:3f:e1:79:47:52:e8: + 9e:71:be:88:10:6c:30:89:9f:55:84:9d:83:d0:c9: + 11:66:95:33:8b:44:38:86:45:05:b3:3a:54:c4:cf: + 4e:72:4c:00:07:d7:59:3a:8d:2f:cd:5e:0c:a0:95: + be:00:85:7a:a4:42:c2:f3:b7 + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 CRL Distribution Points: + URI:http://localhost:8902/demoCA/crl/Sub_CA_1_Root_6.crl + + X509v3 Key Usage: + Digital Signature, Non Repudiation, Key Encipherment + X509v3 Subject Key Identifier: + 57:51:A4:44:AE:92:01:3C:9F:7E:82:67:C0:E5:B9:D7:A6:8F:A5:79 + X509v3 Authority Key Identifier: + keyid:89:8C:D7:71:EB:67:78:4E:D6:01:35:B2:AC:A1:B4:88:43:CE:70:A7 + + Signature Algorithm: sha1WithRSAEncryption + 7b:de:f2:2b:d7:94:ce:12:e2:f9:a7:b2:91:08:c6:51:3f:bc: + e2:87:ed:79:6d:3b:f5:38:6e:02:d4:63:e6:b8:a7:e5:df:f4: + 6e:b0:8a:bd:bb:b1:0b:e0:c2:cf:fa:af:0a:6a:a5:1f:28:ff: + de:21:bd:8a:f7:ec:48:35:bb:ab:97:c2:7a:31:6d:d1:73:8e: + ae:74:9b:94:86:73:06:06:da:6a:2c:82:04:b1:49:19:62:a9: + 05:e5:e7:2c:68:a1:3b:f4:bf:80:85:5b:1b:dc:21:7b:3d:c1: + ee:97:6c:72:35:2d:80:19:90:b4:ab:19:34:bb:88:5e:ea:70: + 27:df +-----BEGIN CERTIFICATE----- +MIIC5jCCAk+gAwIBAgICEAAwDQYJKoZIhvcNAQEFBQAwaDELMAkGA1UEBhMCREUx +EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD +VQQLEwtEZXZlbG9wbWVudDEYMBYGA1UEAxMPU3ViIENBIDEgUm9vdCA2MB4XDTA5 +MTEyMDEyMzc0M1oXDTM0MTExNDEyMzc0M1owbzELMAkGA1UEBhMCREUxEDAOBgNV +BAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtE +ZXZlbG9wbWVudDEfMB0GA1UEAxMWVXNlciAxIFN1YiBDQSAxIFJvb3QgNjCBnzAN +BgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAu6xoEEEolP3+OV5jz+ufKyCC84bS4TgF +fpXMRuVCi1wNLK2tRMBML3x16L2qzfIFFhilo/rnoLpXMeKwTYWdYORBkkk/4XlH +Uuiecb6IEGwwiZ9VhJ2D0MkRZpUzi0Q4hkUFszpUxM9OckwAB9dZOo0vzV4MoJW+ +AIV6pELC87cCAwEAAaOBlzCBlDBFBgNVHR8EPjA8MDqgOKA2hjRodHRwOi8vbG9j +YWxob3N0Ojg5MDIvZGVtb0NBL2NybC9TdWJfQ0FfMV9Sb290XzYuY3JsMAsGA1Ud +DwQEAwIF4DAdBgNVHQ4EFgQUV1GkRK6SATyffoJnwOW516aPpXkwHwYDVR0jBBgw +FoAUiYzXcetneE7WATWyrKG0iEPOcKcwDQYJKoZIhvcNAQEFBQADgYEAe97yK9eU +zhLi+aeykQjGUT+84ofteW079ThuAtRj5rin5d/0brCKvbuxC+DCz/qvCmqlHyj/ +3iG9ivfsSDW7q5fCejFt0XOOrnSblIZzBgbaaiyCBLFJGWKpBeXnLGihO/S/gIVb +G9whez3B7pdscjUtgBmQtKsZNLuIXupwJ98= +-----END CERTIFICATE----- diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_6/demoCA/private/cakey.pem b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_6/demoCA/private/cakey.pem new file mode 100755 index 000000000000..9912ee088064 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_6/demoCA/private/cakey.pem @@ -0,0 +1,18 @@ +-----BEGIN RSA PRIVATE KEY----- +Proc-Type: 4,ENCRYPTED +DEK-Info: DES-EDE3-CBC,8F1C89446B1EC221 + +joSSrVc7E1RavSuMdWDDAozXOV4Z0XIusMv5NjIWHLyKdW/SmFv6yfPy7PeuK1Qj +p/DuEO/ULU6SLmAhESXrdC8UzyL/B3hfPK3UzUzJzIRrDitF21SXLjMKU+KVxMrb +GkmstfsIQM157TZHOHJbk4F9zs9Xkl8ipKYDBpJrtVJo8gf4SeLfcEVXW9J0tlLU +Qi13SWWn4kGK+Latypx684S247Y0JfKSJ5BVHUGunmd+b/3mRpH1WARU03JmNqG9 +tyCJxyvCkkQh5Jnm4UEI72ywxSscemtFAzd5fa5LOrsVWOImSixfP1VdJvU0jCTv +gyXK03e/L+B+DhbUm2a6xkt+u83hQ2QjoGdmnfKwhX4vdYZBYINlBnHtHn2B8x2o +IXgLQmBFO/heY/K9wJ1BwwqPW31wHG3MhjRY7ooac1JAZsxS0/pU8cR/GNMpKjvE +fer3tGGUvPL3H1v3pT2XAA4Gm9pOtvnOHuLjbzg2mgNZScYMpcqa/vaQ5gXqCnhw +dtFrGVxEEQ5jTL23EAh4WfhPvsnewujr7Rkc6+a8xKpDJOHejgAPJYpXrYHg4poA +L0aQlIFSX1jriGu4KYAQiZO7bouhVWqcf9B3BNewr0kTaD7qq0gDvygCKLyrUyb7 +hqk0TwVfvmk7nYNFLBsTEcsB/el6jqH40oOfFo+ErlQzmdzRrKy9gBEaecDj8DxV +Fa8XPapE81O8WjS09a/WJNPW+3NdrI5wYMg72srOW8ll+AMtiUTWrAY2hIRxzZGt +VntCKwG/3j0v60jg+0wCP+l/IV4pPbV4He3ysxwM6lH1Y86XfaUBiA== +-----END RSA PRIVATE KEY----- diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_6/demoCA/serial b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_6/demoCA/serial new file mode 100755 index 000000000000..dd11724042e2 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_6/demoCA/serial @@ -0,0 +1 @@ +1001 diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_6/openssl.cfg b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_6/openssl.cfg new file mode 100755 index 000000000000..6251ef7ee99e --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_6/openssl.cfg @@ -0,0 +1,292 @@ +# +# OpenSSL example configuration file. +# This is mostly being used for generation of certificate requests. +# + +# This definition stops the following lines choking if HOME isn't +# defined. +HOME = . +RANDFILE = $ENV::HOME/.rnd + +# Extra OBJECT IDENTIFIER info: +#oid_file = $ENV::HOME/.oid +oid_section = new_oids + +# To use this configuration file with the "-extfile" option of the +# "openssl x509" utility, name here the section containing the +# X.509v3 extensions to use: +# extensions = +# (Alternatively, use a configuration file that has only +# X.509v3 extensions in its main [= default] section.) + +[ new_oids ] + +# We can add new OIDs in here for use by 'ca' and 'req'. +# Add a simple OID like this: +# testoid1=1.2.3.4 +# Or use config file substitution like this: +# testoid2=${testoid1}.5.6 + +#################################################################### +[ ca ] +default_ca = CA_default # The default ca section + +#################################################################### +[ CA_default ] + +dir = ./demoCA # Where everything is kept +certs = $dir/certs # Where the issued certs are kept +crl_dir = $dir/crl # Where the issued crl are kept +database = $dir/index.txt # database index file. +#unique_subject = no # Set to 'no' to allow creation of + # several ctificates with same subject. +new_certs_dir = $dir/newcerts # default place for new certs. + +certificate = $dir/cacert.pem # The CA certificate +serial = $dir/serial # The current serial number +crlnumber = $dir/crlnumber # the current crl number + # must be commented out to leave a V1 CRL +crl = $dir/crl.pem # The current CRL +private_key = $dir/private/cakey.pem # The private key +RANDFILE = $dir/private/.rand # private random number file + +x509_extensions = usr_cert # The extentions to add to the cert + +# Comment out the following two lines for the "traditional" +# (and highly broken) format. +name_opt = ca_default # Subject Name options +cert_opt = ca_default # Certificate field options + +# Extension copying option: use with caution. +# copy_extensions = copy + +# Extensions to add to a CRL. Note: Netscape communicator chokes on V2 CRLs +# so this is commented out by default to leave a V1 CRL. +# crlnumber must also be commented out to leave a V1 CRL. +# crl_extensions = crl_ext + +default_days = 365 # how long to certify for +default_crl_days= 30 # how long before next CRL +default_md = sha1 # which md to use. +preserve = no # keep passed DN ordering + +# A few difference way of specifying how similar the request should look +# For type CA, the listed attributes must be the same, and the optional +# and supplied fields are just that :-) +policy = policy_match + +# For the CA policy +[ policy_match ] +countryName = match +stateOrProvinceName = match +organizationName = match +organizationalUnitName = optional +commonName = supplied +emailAddress = optional + +# For the 'anything' policy +# At this point in time, you must list all acceptable 'object' +# types. +[ policy_anything ] +countryName = optional +stateOrProvinceName = optional +localityName = optional +organizationName = optional +organizationalUnitName = optional +commonName = supplied +emailAddress = optional + +#################################################################### +[ req ] +default_bits = 1024 +default_keyfile = privkey.pem +distinguished_name = req_distinguished_name +attributes = req_attributes +x509_extensions = v3_ca # The extentions to add to the self signed cert + +# Passwords for private keys if not present they will be prompted for +# input_password = secret +# output_password = secret + +# This sets a mask for permitted string types. There are several options. +# default: PrintableString, T61String, BMPString. +# pkix : PrintableString, BMPString. +# utf8only: only UTF8Strings. +# nombstr : PrintableString, T61String (no BMPStrings or UTF8Strings). +# MASK:XXXX a literal mask value. +# WARNING: current versions of Netscape crash on BMPStrings or UTF8Strings +# so use this option with caution! +string_mask = nombstr + +# req_extensions = v3_req # The extensions to add to a certificate request + +[ req_distinguished_name ] +countryName = Country Name (2 letter code) +countryName_default = DE +countryName_min = 2 +countryName_max = 2 + +stateOrProvinceName = State or Province Name (full name) +stateOrProvinceName_default = Hamburg + +localityName = Locality Name (eg, city) + +0.organizationName = Organization Name (eg, company) +0.organizationName_default = OpenOffice.org + +# we can do this but it is not needed normally :-) +#1.organizationName = Second Organization Name (eg, company) +#1.organizationName_default = World Wide Web Pty Ltd + +organizationalUnitName = Organizational Unit Name (eg, section) +organizationalUnitName_default = Development + +commonName = Common Name (eg, YOUR name) +commonName_max = 64 + +emailAddress = Email Address +emailAddress_max = 64 + +# SET-ex3 = SET extension number 3 + +[ req_attributes ] +challengePassword = A challenge password +challengePassword_min = 4 +challengePassword_max = 20 + +unstructuredName = An optional company name + +[ usr_cert ] + +# These extensions are added when 'ca' signs a request. +#authorityInfoAccess = OCSP;URI:http://localhost:8888/ +crlDistributionPoints=URI:http://localhost:8902/demoCA/crl/Sub_CA_1_Root_6.crl +# This is typical in keyUsage for a client certificate. +keyUsage = nonRepudiation, digitalSignature, keyEncipherment + +# This will be displayed in Netscape's comment listbox. +#nsComment = "OpenSSL Generated Certificate" + +# PKIX recommendations harmless if included in all certificates. +subjectKeyIdentifier=hash +authorityKeyIdentifier=keyid,issuer + +# This stuff is for subjectAltName and issuerAltname. +# Import the email address. +# subjectAltName=email:copy +# An alternative to produce certificates that aren't +# deprecated according to PKIX. +# subjectAltName=email:move + +# Copy subject details +# issuerAltName=issuer:copy + + + +[ v3_req ] + +# Extensions to add to a certificate request + +basicConstraints = CA:FALSE +keyUsage = nonRepudiation, digitalSignature, keyEncipherment +#authorityInfoAccess = OCSP;URI:http://localhost:8888/ + +[ v3_ca ] + + +# Extensions for a typical CA + + +# PKIX recommendation. + +subjectKeyIdentifier=hash + +authorityKeyIdentifier=keyid:always,issuer:always + +#authorityInfoAccess = OCSP;URI:http://localhost:8888 +#crlDistributionPoints=URI:http://localhost:8901/demoCA/crl/Test_CA_2009.2.crl +# This is what PKIX recommends but some broken software chokes on critical +# extensions. +#basicConstraints = critical,CA:true +# So we do this instead. +basicConstraints = critical, CA:true + +# Key usage: this is typical for a CA certificate. However since it will +# prevent it being used as an test self-signed certificate it is best +# left out by default. +# keyUsage = cRLSign, keyCertSign + +# Some might want this also +# nsCertType = sslCA, emailCA + +# Include email address in subject alt name: another PKIX recommendation +# subjectAltName=email:copy +# Copy issuer details +# issuerAltName=issuer:copy + +# DER hex encoding of an extension: beware experts only! +# obj=DER:02:03 +# Where 'obj' is a standard or added object +# You can even override a supported extension: +# basicConstraints= critical, DER:30:03:01:01:FF + +[ crl_ext ] + +# CRL extensions. +# Only issuerAltName and authorityKeyIdentifier make any sense in a CRL. + +# issuerAltName=issuer:copy +authorityKeyIdentifier=keyid:always,issuer:always + +[ proxy_cert_ext ] +# These extensions should be added when creating a proxy certificate + +# This goes against PKIX guidelines but some CAs do it and some software +# requires this to avoid interpreting an end user certificate as a CA. + +basicConstraints=CA:FALSE + +# Here are some examples of the usage of nsCertType. If it is omitted +# the certificate can be used for anything *except* object signing. + +# This is OK for an SSL server. +# nsCertType = server + +# For an object signing certificate this would be used. +# nsCertType = objsign + +# For normal client use this is typical +# nsCertType = client, email + +# and for everything including object signing: +# nsCertType = client, email, objsign + +# This is typical in keyUsage for a client certificate. +# keyUsage = nonRepudiation, digitalSignature, keyEncipherment + +# This will be displayed in Netscape's comment listbox. +nsComment = "OpenSSL Generated Certificate" + +# PKIX recommendations harmless if included in all certificates. +subjectKeyIdentifier=hash +authorityKeyIdentifier=keyid,issuer:always + +# This stuff is for subjectAltName and issuerAltname. +# Import the email address. +# subjectAltName=email:copy +# An alternative to produce certificates that aren't +# deprecated according to PKIX. +# subjectAltName=email:move + +# Copy subject details +# issuerAltName=issuer:copy + +#nsCaRevocationUrl = http://www.domain.dom/ca-crl.pem +#nsBaseUrl +#nsRevocationUrl +#nsRenewalUrl +#nsCaPolicyUrl +#nsSslServerName + +# This really needs to be in place for it to be a proxy certificate. +proxyCertInfo=critical,language:id-ppl-anyLanguage,pathlen:3,policy:foo diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_7/README.txt b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_7/README.txt new file mode 100755 index 000000000000..d70e0550a90a --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_7/README.txt @@ -0,0 +1,3 @@ +To provide the CRL run: + +java -jar ../../tools/httpserv/dist/httpserv.jar -a 8902 diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_7/demoCA/cacert.pem b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_7/demoCA/cacert.pem new file mode 100755 index 000000000000..2dda8f2b286f --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_7/demoCA/cacert.pem @@ -0,0 +1,66 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 4096 (0x1000) + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 7 + Validity + Not Before: Nov 20 13:07:53 2009 GMT + Not After : Nov 14 13:07:53 2034 GMT + Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Sub CA 1 Root 7 + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public Key: (1024 bit) + Modulus (1024 bit): + 00:b0:ae:6d:0a:21:ae:8a:92:b1:16:25:d3:08:cb: + ac:b7:4c:53:6d:4b:b3:12:82:40:54:c9:44:28:fc: + 4e:10:e6:65:40:de:70:5d:8b:ab:1f:5c:77:03:43: + 3d:3a:3d:9e:f7:37:66:9a:33:68:a0:cf:ad:8f:f4: + fb:9c:a3:87:57:5d:ec:d6:55:5a:18:b5:e1:2b:d2: + c4:10:fe:f0:01:a5:da:29:ee:c4:af:15:c9:8c:dc: + 7c:45:84:bd:e5:5b:09:1f:16:1d:11:e7:61:e6:22: + e7:1f:c8:86:bf:a1:da:cb:fe:6b:7e:c0:6e:aa:7f: + 97:84:e8:8f:81:69:f1:26:87 + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Subject Key Identifier: + 54:64:15:7E:93:8A:19:C8:F9:B7:EF:60:A0:DF:5C:C8:15:56:C0:EE + X509v3 Authority Key Identifier: + keyid:80:C6:F8:0B:5F:7C:49:E4:86:FD:C8:92:C6:80:70:D9:C0:6F:7B:DE + DirName:/C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=Root 7 + serial:D5:E6:63:5F:18:09:82:89 + + X509v3 CRL Distribution Points: + URI:http://localhost:8901/demoCA/crl/Root_7.crl + + X509v3 Basic Constraints: critical + CA:TRUE + Signature Algorithm: sha1WithRSAEncryption + 1a:bc:5a:4b:9a:d5:e8:c0:35:c2:61:0a:58:7d:33:e2:87:01: + 61:83:80:42:8d:1a:7e:b1:9a:58:d5:01:fd:e7:ae:5c:c8:65: + fb:9e:1d:bf:49:ba:ed:40:f4:05:7c:3b:2d:db:0e:53:d0:05: + a0:bd:15:87:c4:37:22:0b:a0:04:a3:ad:cb:57:b2:00:97:ee: + 8f:89:91:8e:7d:0b:e2:27:96:6e:0f:ab:73:33:59:fa:9f:37: + f2:77:79:99:af:72:ad:f9:49:05:ed:55:08:31:eb:97:0f:99: + 6e:9c:a3:df:f0:52:1a:14:4e:78:25:0c:8b:02:cb:56:e9:4d: + f5:9f +-----BEGIN CERTIFICATE----- +MIIDRjCCAq+gAwIBAgICEAAwDQYJKoZIhvcNAQEFBQAwXzELMAkGA1UEBhMCREUx +EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD +VQQLEwtEZXZlbG9wbWVudDEPMA0GA1UEAxMGUm9vdCA3MB4XDTA5MTEyMDEzMDc1 +M1oXDTM0MTExNDEzMDc1M1owaDELMAkGA1UEBhMCREUxEDAOBgNVBAgTB0hhbWJ1 +cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtEZXZlbG9wbWVu +dDEYMBYGA1UEAxMPU3ViIENBIDEgUm9vdCA3MIGfMA0GCSqGSIb3DQEBAQUAA4GN +ADCBiQKBgQCwrm0KIa6KkrEWJdMIy6y3TFNtS7MSgkBUyUQo/E4Q5mVA3nBdi6sf +XHcDQz06PZ73N2aaM2igz62P9Puco4dXXezWVVoYteEr0sQQ/vABpdop7sSvFcmM +3HxFhL3lWwkfFh0R52HmIucfyIa/odrL/mt+wG6qf5eE6I+BafEmhwIDAQABo4IB +BjCCAQIwHQYDVR0OBBYEFFRkFX6TihnI+bfvYKDfXMgVVsDuMIGRBgNVHSMEgYkw +gYaAFIDG+AtffEnkhv3IksaAcNnAb3veoWOkYTBfMQswCQYDVQQGEwJERTEQMA4G +A1UECBMHSGFtYnVyZzEXMBUGA1UEChMOT3Blbk9mZmljZS5vcmcxFDASBgNVBAsT +C0RldmVsb3BtZW50MQ8wDQYDVQQDEwZSb290IDeCCQDV5mNfGAmCiTA8BgNVHR8E +NTAzMDGgL6AthitodHRwOi8vbG9jYWxob3N0Ojg5MDEvZGVtb0NBL2NybC9Sb290 +XzcuY3JsMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEFBQADgYEAGrxaS5rV +6MA1wmEKWH0z4ocBYYOAQo0afrGaWNUB/eeuXMhl+54dv0m67UD0BXw7LdsOU9AF +oL0Vh8Q3IgugBKOty1eyAJfuj4mRjn0L4ieWbg+rczNZ+p838nd5ma9yrflJBe1V +CDHrlw+Zbpyj3/BSGhROeCUMiwLLVulN9Z8= +-----END CERTIFICATE----- diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_7/demoCA/crl/DO_NOT_INSTALL_THIS_CRL b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_7/demoCA/crl/DO_NOT_INSTALL_THIS_CRL new file mode 100755 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_7/demoCA/crl/DO_NOT_INSTALL_THIS_CRL diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_7/demoCA/crl/Sub_CA_1_Root_7.crl b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_7/demoCA/crl/Sub_CA_1_Root_7.crl Binary files differnew file mode 100755 index 000000000000..f3f7e5cba23b --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_7/demoCA/crl/Sub_CA_1_Root_7.crl diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_7/demoCA/crlnumber b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_7/demoCA/crlnumber new file mode 100755 index 000000000000..dd11724042e2 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_7/demoCA/crlnumber @@ -0,0 +1 @@ +1001 diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_7/demoCA/index.txt b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_7/demoCA/index.txt new file mode 100755 index 000000000000..8bcb130f6c23 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_7/demoCA/index.txt @@ -0,0 +1,2 @@ +V 341114131904Z 1000 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=User 1 Sub CA 1 Root 7 +R 341114132648Z 091120132827Z,CACompromise 1001 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=User 2 Sub CA 1 Root 7 diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_7/demoCA/index.txt.attr b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_7/demoCA/index.txt.attr new file mode 100755 index 000000000000..8f7e63a3475c --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_7/demoCA/index.txt.attr @@ -0,0 +1 @@ +unique_subject = yes diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_7/demoCA/newcerts/1000.pem b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_7/demoCA/newcerts/1000.pem new file mode 100755 index 000000000000..234638d8ce9e --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_7/demoCA/newcerts/1000.pem @@ -0,0 +1,62 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 4096 (0x1000) + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Sub CA 1 Root 7 + Validity + Not Before: Nov 20 13:19:04 2009 GMT + Not After : Nov 14 13:19:04 2034 GMT + Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=User 1 Sub CA 1 Root 7 + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public Key: (1024 bit) + Modulus (1024 bit): + 00:ce:23:98:19:ac:0d:7c:f0:60:a2:94:72:c3:ab: + a5:a1:6b:d3:af:8c:cb:b9:c9:ee:0b:3e:a4:2e:0e: + 08:a5:a9:4c:09:2f:1a:a0:fe:87:89:41:4a:aa:b6: + ac:b4:bc:d3:0e:f9:c3:12:1f:b1:90:b3:6d:72:a6: + 38:5b:9d:05:7e:97:ff:f4:e1:31:2b:b4:08:de:b1: + 43:fe:1d:7e:32:54:ce:db:d5:14:21:f3:ad:9f:26: + f3:c6:0b:77:51:e4:11:88:ad:86:e1:30:d1:af:87: + 29:c0:7b:92:db:68:06:74:ca:27:ac:0b:61:3a:ac: + ba:03:35:e7:8e:08:28:58:7d + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 CRL Distribution Points: + URI:http://localhost:8902/demoCA/crl/Sub_CA_1_Root_7.crl + + X509v3 Key Usage: + Digital Signature, Non Repudiation, Key Encipherment + X509v3 Subject Key Identifier: + DE:66:84:E4:9B:BF:70:00:BD:60:3D:34:45:96:FE:FD:D5:88:9B:CD + X509v3 Authority Key Identifier: + keyid:54:64:15:7E:93:8A:19:C8:F9:B7:EF:60:A0:DF:5C:C8:15:56:C0:EE + + Signature Algorithm: sha1WithRSAEncryption + 6e:da:66:d2:3b:00:d6:0b:5a:9f:21:28:de:e1:10:fe:fd:26: + db:a6:75:86:74:47:e4:b0:b7:c4:c1:dc:43:82:51:71:00:8f: + bf:71:9a:23:db:2d:79:27:a2:80:2e:12:a4:5f:13:0c:73:53: + 1e:5c:33:6a:e9:31:be:e2:ae:4f:55:b0:e8:0a:0f:54:f0:3a: + 7e:14:41:d7:34:18:58:90:26:63:7d:2c:1a:ab:93:7f:4a:3d: + 5e:cf:f1:9d:c3:76:ee:a4:76:1c:d8:f9:d0:ac:53:3c:1a:4d: + c7:fa:b6:23:54:4b:04:a1:e2:76:a5:e3:0d:b8:db:8e:d3:39: + c2:65 +-----BEGIN CERTIFICATE----- +MIIC5jCCAk+gAwIBAgICEAAwDQYJKoZIhvcNAQEFBQAwaDELMAkGA1UEBhMCREUx +EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD +VQQLEwtEZXZlbG9wbWVudDEYMBYGA1UEAxMPU3ViIENBIDEgUm9vdCA3MB4XDTA5 +MTEyMDEzMTkwNFoXDTM0MTExNDEzMTkwNFowbzELMAkGA1UEBhMCREUxEDAOBgNV +BAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtE +ZXZlbG9wbWVudDEfMB0GA1UEAxMWVXNlciAxIFN1YiBDQSAxIFJvb3QgNzCBnzAN +BgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAziOYGawNfPBgopRyw6uloWvTr4zLucnu +Cz6kLg4IpalMCS8aoP6HiUFKqrastLzTDvnDEh+xkLNtcqY4W50Ffpf/9OExK7QI +3rFD/h1+MlTO29UUIfOtnybzxgt3UeQRiK2G4TDRr4cpwHuS22gGdMonrAthOqy6 +AzXnjggoWH0CAwEAAaOBlzCBlDBFBgNVHR8EPjA8MDqgOKA2hjRodHRwOi8vbG9j +YWxob3N0Ojg5MDIvZGVtb0NBL2NybC9TdWJfQ0FfMV9Sb290XzcuY3JsMAsGA1Ud +DwQEAwIF4DAdBgNVHQ4EFgQU3maE5Ju/cAC9YD00RZb+/dWIm80wHwYDVR0jBBgw +FoAUVGQVfpOKGcj5t+9goN9cyBVWwO4wDQYJKoZIhvcNAQEFBQADgYEAbtpm0jsA +1gtanyEo3uEQ/v0m26Z1hnRH5LC3xMHcQ4JRcQCPv3GaI9steSeigC4SpF8TDHNT +HlwzaukxvuKuT1Ww6AoPVPA6fhRB1zQYWJAmY30sGquTf0o9Xs/xncN27qR2HNj5 +0KxTPBpNx/q2I1RLBKHidqXjDbjbjtM5wmU= +-----END CERTIFICATE----- diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_7/demoCA/newcerts/1001.pem b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_7/demoCA/newcerts/1001.pem new file mode 100755 index 000000000000..ddc504d77c26 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_7/demoCA/newcerts/1001.pem @@ -0,0 +1,62 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 4097 (0x1001) + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Sub CA 1 Root 7 + Validity + Not Before: Nov 20 13:26:48 2009 GMT + Not After : Nov 14 13:26:48 2034 GMT + Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=User 2 Sub CA 1 Root 7 + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public Key: (1024 bit) + Modulus (1024 bit): + 00:b3:58:b2:22:45:b9:37:83:e5:a4:6f:5d:4e:59: + 60:60:4e:46:26:27:9a:70:4d:34:89:cf:cb:4f:4f: + 0b:22:6e:e4:21:e6:ab:c9:0a:4a:c4:cd:6f:3c:db: + e8:a3:52:55:2d:26:1d:13:9a:8b:cf:38:25:4e:4f: + 4a:e3:39:01:fa:5b:10:a5:3e:e1:93:65:19:ca:8b: + 5c:9f:e8:19:ed:0a:ef:47:e9:11:73:28:ce:b0:95: + 10:3a:ce:b5:46:89:79:a3:90:ea:d5:ca:ac:c9:af: + ee:55:0d:6c:32:5f:d2:f1:76:1c:b9:e7:d2:ac:07: + 61:83:82:c5:95:5a:62:ff:67 + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 CRL Distribution Points: + URI:http://localhost:8902/demoCA/crl/Sub_CA_1_Root_7.crl + + X509v3 Key Usage: + Digital Signature, Non Repudiation, Key Encipherment + X509v3 Subject Key Identifier: + 12:7A:7A:69:C5:FE:E0:23:FD:8E:51:25:55:94:9F:C8:44:D8:F2:29 + X509v3 Authority Key Identifier: + keyid:54:64:15:7E:93:8A:19:C8:F9:B7:EF:60:A0:DF:5C:C8:15:56:C0:EE + + Signature Algorithm: sha1WithRSAEncryption + 4a:57:08:6a:66:af:b4:05:4f:b3:4c:39:23:2b:5d:c9:88:7b: + 6f:b5:28:a3:5a:72:e6:0b:e2:9e:64:65:ce:8f:b5:31:0f:5f: + c7:b7:56:96:4f:d3:34:65:1a:ea:84:60:2b:fe:27:1f:75:fd: + 0f:53:e5:eb:25:d3:f6:2c:21:72:59:40:32:ba:ec:72:cc:64: + d6:1d:db:cf:ca:ec:91:0a:81:ef:f5:e4:56:31:a3:c2:9a:1d: + e9:5c:48:b0:7c:7b:e2:51:35:33:ad:a8:5c:79:ac:ee:bf:42: + fa:0b:a0:02:72:cc:5e:07:c0:d4:d3:96:26:16:3e:8c:32:8d: + b4:09 +-----BEGIN CERTIFICATE----- +MIIC5jCCAk+gAwIBAgICEAEwDQYJKoZIhvcNAQEFBQAwaDELMAkGA1UEBhMCREUx +EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD +VQQLEwtEZXZlbG9wbWVudDEYMBYGA1UEAxMPU3ViIENBIDEgUm9vdCA3MB4XDTA5 +MTEyMDEzMjY0OFoXDTM0MTExNDEzMjY0OFowbzELMAkGA1UEBhMCREUxEDAOBgNV +BAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtE +ZXZlbG9wbWVudDEfMB0GA1UEAxMWVXNlciAyIFN1YiBDQSAxIFJvb3QgNzCBnzAN +BgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAs1iyIkW5N4PlpG9dTllgYE5GJieacE00 +ic/LT08LIm7kIearyQpKxM1vPNvoo1JVLSYdE5qLzzglTk9K4zkB+lsQpT7hk2UZ +yotcn+gZ7QrvR+kRcyjOsJUQOs61Rol5o5Dq1cqsya/uVQ1sMl/S8XYcuefSrAdh +g4LFlVpi/2cCAwEAAaOBlzCBlDBFBgNVHR8EPjA8MDqgOKA2hjRodHRwOi8vbG9j +YWxob3N0Ojg5MDIvZGVtb0NBL2NybC9TdWJfQ0FfMV9Sb290XzcuY3JsMAsGA1Ud +DwQEAwIF4DAdBgNVHQ4EFgQUEnp6acX+4CP9jlElVZSfyETY8ikwHwYDVR0jBBgw +FoAUVGQVfpOKGcj5t+9goN9cyBVWwO4wDQYJKoZIhvcNAQEFBQADgYEASlcIamav +tAVPs0w5IytdyYh7b7Uoo1py5gvinmRlzo+1MQ9fx7dWlk/TNGUa6oRgK/4nH3X9 +D1Pl6yXT9iwhcllAMrrscsxk1h3bz8rskQqB7/XkVjGjwpod6VxIsHx74lE1M62o +XHms7r9C+gugAnLMXgfA1NOWJhY+jDKNtAk= +-----END CERTIFICATE----- diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_7/demoCA/private/cakey.pem b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_7/demoCA/private/cakey.pem new file mode 100755 index 000000000000..c107913a2fc1 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_7/demoCA/private/cakey.pem @@ -0,0 +1,18 @@ +-----BEGIN RSA PRIVATE KEY----- +Proc-Type: 4,ENCRYPTED +DEK-Info: DES-EDE3-CBC,D710D797627524D4 + +SC46mzOOSpNMZ9t2F3syLy0MmYOk3zBJnY/qcm/ggD4ETOse6zGpqhXVSeZdn3OG +Uwj+b9tCjVC/7GMWanH4DmshCv89IRljMyy5DShsOVmgAr0hqLZNlkKqQRRRHC4d +y9ozYq1J9Zcj16jTmCbpPJW8Ul7kblelNbD0nVgJABc6m6Di/syCFEC0KVGmoJZv +5QjxyNiulh0UNmmP+X6iEGPWw4s5JJdcAg5DFXjPiCvvGazvjCGTT38Hcnya4GkB +9aHo7KbjFU4P98zQKUAV0fSVU7+tzJrLxH0aefenbkIKI45xegOTJmcv8NEZ3YgQ +64r+OlmqOONmvcWrtUdhADvsl8oJ8Lz+1UYcyPpbYLUvMhj8Potf6C6rCz1GuQPS +EmGPltUAOcaylpnP/neyuErAMHGQI9Mn2dhLc/NGK6gxqZi1SawGbrit7Uv5il/n +O3zc7D+d1Jmdkcqm/BZKsMW5hwM3KF4gzb6zMe/8ZCmtqT4iH4eDqjFQfaWeBXNK +kTM8vMUNCU8yQjMYoWL8iL4NNJxRheD0l2FABcGTbWI159eXy8laenk5eBfYKIwl +YGnoylDD2F4W0mdMl2MJIYNYTRP7pAQhLnMbVNSgGDgk5Z0kUF2Kl2rNz+3w1c36 +L3VC/CGFp5/spnQHhYMH2oUAkliS0iev7bNJyhvycVQkMlwYu8KZKMtqyn9bnpU4 +Kd6XlXPwF3BHGrVVdcb6RQo65GrwT6j+hWRwUKgEvcxC7BjtsY1ZV3xRfsRQpA/b +1sTQ/W0ev09+OJAHWEedIg2sTTp5WSiF2whCz6yviFxEAeYIUEGVHw== +-----END RSA PRIVATE KEY----- diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_7/demoCA/serial b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_7/demoCA/serial new file mode 100755 index 000000000000..7d802a3e7104 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_7/demoCA/serial @@ -0,0 +1 @@ +1002 diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_7/openssl.cfg b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_7/openssl.cfg new file mode 100755 index 000000000000..16b905bdcb5a --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_7/openssl.cfg @@ -0,0 +1,292 @@ +# +# OpenSSL example configuration file. +# This is mostly being used for generation of certificate requests. +# + +# This definition stops the following lines choking if HOME isn't +# defined. +HOME = . +RANDFILE = $ENV::HOME/.rnd + +# Extra OBJECT IDENTIFIER info: +#oid_file = $ENV::HOME/.oid +oid_section = new_oids + +# To use this configuration file with the "-extfile" option of the +# "openssl x509" utility, name here the section containing the +# X.509v3 extensions to use: +# extensions = +# (Alternatively, use a configuration file that has only +# X.509v3 extensions in its main [= default] section.) + +[ new_oids ] + +# We can add new OIDs in here for use by 'ca' and 'req'. +# Add a simple OID like this: +# testoid1=1.2.3.4 +# Or use config file substitution like this: +# testoid2=${testoid1}.5.6 + +#################################################################### +[ ca ] +default_ca = CA_default # The default ca section + +#################################################################### +[ CA_default ] + +dir = ./demoCA # Where everything is kept +certs = $dir/certs # Where the issued certs are kept +crl_dir = $dir/crl # Where the issued crl are kept +database = $dir/index.txt # database index file. +#unique_subject = no # Set to 'no' to allow creation of + # several ctificates with same subject. +new_certs_dir = $dir/newcerts # default place for new certs. + +certificate = $dir/cacert.pem # The CA certificate +serial = $dir/serial # The current serial number +crlnumber = $dir/crlnumber # the current crl number + # must be commented out to leave a V1 CRL +crl = $dir/crl.pem # The current CRL +private_key = $dir/private/cakey.pem # The private key +RANDFILE = $dir/private/.rand # private random number file + +x509_extensions = usr_cert # The extentions to add to the cert + +# Comment out the following two lines for the "traditional" +# (and highly broken) format. +name_opt = ca_default # Subject Name options +cert_opt = ca_default # Certificate field options + +# Extension copying option: use with caution. +# copy_extensions = copy + +# Extensions to add to a CRL. Note: Netscape communicator chokes on V2 CRLs +# so this is commented out by default to leave a V1 CRL. +# crlnumber must also be commented out to leave a V1 CRL. +# crl_extensions = crl_ext + +default_days = 365 # how long to certify for +default_crl_days= 30 # how long before next CRL +default_md = sha1 # which md to use. +preserve = no # keep passed DN ordering + +# A few difference way of specifying how similar the request should look +# For type CA, the listed attributes must be the same, and the optional +# and supplied fields are just that :-) +policy = policy_match + +# For the CA policy +[ policy_match ] +countryName = match +stateOrProvinceName = match +organizationName = match +organizationalUnitName = optional +commonName = supplied +emailAddress = optional + +# For the 'anything' policy +# At this point in time, you must list all acceptable 'object' +# types. +[ policy_anything ] +countryName = optional +stateOrProvinceName = optional +localityName = optional +organizationName = optional +organizationalUnitName = optional +commonName = supplied +emailAddress = optional + +#################################################################### +[ req ] +default_bits = 1024 +default_keyfile = privkey.pem +distinguished_name = req_distinguished_name +attributes = req_attributes +x509_extensions = v3_ca # The extentions to add to the self signed cert + +# Passwords for private keys if not present they will be prompted for +# input_password = secret +# output_password = secret + +# This sets a mask for permitted string types. There are several options. +# default: PrintableString, T61String, BMPString. +# pkix : PrintableString, BMPString. +# utf8only: only UTF8Strings. +# nombstr : PrintableString, T61String (no BMPStrings or UTF8Strings). +# MASK:XXXX a literal mask value. +# WARNING: current versions of Netscape crash on BMPStrings or UTF8Strings +# so use this option with caution! +string_mask = nombstr + +# req_extensions = v3_req # The extensions to add to a certificate request + +[ req_distinguished_name ] +countryName = Country Name (2 letter code) +countryName_default = DE +countryName_min = 2 +countryName_max = 2 + +stateOrProvinceName = State or Province Name (full name) +stateOrProvinceName_default = Hamburg + +localityName = Locality Name (eg, city) + +0.organizationName = Organization Name (eg, company) +0.organizationName_default = OpenOffice.org + +# we can do this but it is not needed normally :-) +#1.organizationName = Second Organization Name (eg, company) +#1.organizationName_default = World Wide Web Pty Ltd + +organizationalUnitName = Organizational Unit Name (eg, section) +organizationalUnitName_default = Development + +commonName = Common Name (eg, YOUR name) +commonName_max = 64 + +emailAddress = Email Address +emailAddress_max = 64 + +# SET-ex3 = SET extension number 3 + +[ req_attributes ] +challengePassword = A challenge password +challengePassword_min = 4 +challengePassword_max = 20 + +unstructuredName = An optional company name + +[ usr_cert ] + +# These extensions are added when 'ca' signs a request. +#authorityInfoAccess = OCSP;URI:http://localhost:8888/ +crlDistributionPoints=URI:http://localhost:8902/demoCA/crl/Sub_CA_1_Root_7.crl +# This is typical in keyUsage for a client certificate. +keyUsage = nonRepudiation, digitalSignature, keyEncipherment + +# This will be displayed in Netscape's comment listbox. +#nsComment = "OpenSSL Generated Certificate" + +# PKIX recommendations harmless if included in all certificates. +subjectKeyIdentifier=hash +authorityKeyIdentifier=keyid,issuer + +# This stuff is for subjectAltName and issuerAltname. +# Import the email address. +# subjectAltName=email:copy +# An alternative to produce certificates that aren't +# deprecated according to PKIX. +# subjectAltName=email:move + +# Copy subject details +# issuerAltName=issuer:copy + + + +[ v3_req ] + +# Extensions to add to a certificate request + +basicConstraints = CA:FALSE +keyUsage = nonRepudiation, digitalSignature, keyEncipherment +#authorityInfoAccess = OCSP;URI:http://localhost:8888/ + +[ v3_ca ] + + +# Extensions for a typical CA + + +# PKIX recommendation. + +subjectKeyIdentifier=hash + +authorityKeyIdentifier=keyid:always,issuer:always + +#authorityInfoAccess = OCSP;URI:http://localhost:8888 +#crlDistributionPoints=URI:http://localhost:8901/demoCA/crl/Test_CA_2009.2.crl +# This is what PKIX recommends but some broken software chokes on critical +# extensions. +#basicConstraints = critical,CA:true +# So we do this instead. +basicConstraints = critical, CA:true + +# Key usage: this is typical for a CA certificate. However since it will +# prevent it being used as an test self-signed certificate it is best +# left out by default. +# keyUsage = cRLSign, keyCertSign + +# Some might want this also +# nsCertType = sslCA, emailCA + +# Include email address in subject alt name: another PKIX recommendation +# subjectAltName=email:copy +# Copy issuer details +# issuerAltName=issuer:copy + +# DER hex encoding of an extension: beware experts only! +# obj=DER:02:03 +# Where 'obj' is a standard or added object +# You can even override a supported extension: +# basicConstraints= critical, DER:30:03:01:01:FF + +[ crl_ext ] + +# CRL extensions. +# Only issuerAltName and authorityKeyIdentifier make any sense in a CRL. + +# issuerAltName=issuer:copy +authorityKeyIdentifier=keyid:always,issuer:always + +[ proxy_cert_ext ] +# These extensions should be added when creating a proxy certificate + +# This goes against PKIX guidelines but some CAs do it and some software +# requires this to avoid interpreting an end user certificate as a CA. + +basicConstraints=CA:FALSE + +# Here are some examples of the usage of nsCertType. If it is omitted +# the certificate can be used for anything *except* object signing. + +# This is OK for an SSL server. +# nsCertType = server + +# For an object signing certificate this would be used. +# nsCertType = objsign + +# For normal client use this is typical +# nsCertType = client, email + +# and for everything including object signing: +# nsCertType = client, email, objsign + +# This is typical in keyUsage for a client certificate. +# keyUsage = nonRepudiation, digitalSignature, keyEncipherment + +# This will be displayed in Netscape's comment listbox. +nsComment = "OpenSSL Generated Certificate" + +# PKIX recommendations harmless if included in all certificates. +subjectKeyIdentifier=hash +authorityKeyIdentifier=keyid,issuer:always + +# This stuff is for subjectAltName and issuerAltname. +# Import the email address. +# subjectAltName=email:copy +# An alternative to produce certificates that aren't +# deprecated according to PKIX. +# subjectAltName=email:move + +# Copy subject details +# issuerAltName=issuer:copy + +#nsCaRevocationUrl = http://www.domain.dom/ca-crl.pem +#nsBaseUrl +#nsRevocationUrl +#nsRenewalUrl +#nsCaPolicyUrl +#nsSslServerName + +# This really needs to be in place for it to be a proxy certificate. +proxyCertInfo=critical,language:id-ppl-anyLanguage,pathlen:3,policy:foo diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_8/README.txt b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_8/README.txt new file mode 100755 index 000000000000..4d510fe39b27 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_8/README.txt @@ -0,0 +1,13 @@ +Revoked certificates: + +- User 2 Sub CA 1 Root 8 + + +Start the OCSP responder: +openssl ocsp -index demoCA/index.txt -port 8889 -rsigner demoCA/cacert.pem -rkey demoCA/private/cakey.pem -CA demoCA/cacert.pem -text + + + + + + diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_8/demoCA/cacert.pem b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_8/demoCA/cacert.pem new file mode 100755 index 000000000000..b2d1deb75960 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_8/demoCA/cacert.pem @@ -0,0 +1,66 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 4096 (0x1000) + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 8 + Validity + Not Before: Nov 20 15:33:21 2009 GMT + Not After : Nov 14 15:33:21 2034 GMT + Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Sub CA 1 Root 8 + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public Key: (1024 bit) + Modulus (1024 bit): + 00:96:79:01:9f:4f:68:c1:09:0d:44:3a:82:e4:eb: + ad:70:7a:cf:b9:71:e5:fb:e0:c8:0c:21:79:3e:cb: + 78:91:7f:4a:a0:de:3e:37:0f:a1:6b:73:10:12:9b: + 08:c4:96:dc:cb:a8:5b:87:9b:75:24:e4:00:5e:4a: + 6f:4c:13:79:1f:57:13:8c:3e:1b:38:31:e1:77:74: + 52:f9:94:47:36:57:33:bd:de:08:11:a3:01:e1:53: + 1c:bd:7b:39:9c:5e:96:5c:a9:61:6c:cc:2b:90:8d: + 5a:3c:9e:f4:4b:6e:e5:97:64:86:f3:8e:e8:72:20: + 5d:0d:50:bf:e9:cf:be:d4:13 + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Subject Key Identifier: + EF:BD:C8:8E:78:79:F9:76:4B:11:59:B6:C3:32:10:07:C0:BC:E3:8A + X509v3 Authority Key Identifier: + keyid:D6:66:76:C9:05:FF:A9:50:88:96:60:DD:FB:C7:30:18:72:67:41:19 + DirName:/C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=Root 8 + serial:B2:47:DE:6A:2A:4C:83:19 + + Authority Information Access: + OCSP - URI:http://localhost:8888 + + X509v3 Basic Constraints: critical + CA:TRUE + Signature Algorithm: sha1WithRSAEncryption + 4c:95:44:3b:57:08:ec:01:ec:f9:3e:7c:89:1c:30:b1:4e:26: + 32:b6:57:fa:25:bc:ed:eb:d4:a2:1c:67:ee:b9:8b:d0:4c:57: + 8a:0e:db:a0:9d:92:e7:de:c6:73:01:e7:de:61:1b:b5:0e:d0: + c5:c1:a7:a6:ab:e0:c6:0b:51:dd:e5:a2:32:1f:c6:52:ea:d3: + 03:68:3a:f5:92:bd:8b:b8:03:bb:50:70:63:cc:ec:ed:3c:11: + 76:ca:ac:72:47:ad:99:6b:8e:07:9e:38:f2:63:e1:ba:d4:df: + a9:73:54:1d:74:89:94:01:2e:68:dd:97:e7:53:f9:cf:b6:7d: + fc:87 +-----BEGIN CERTIFICATE----- +MIIDOTCCAqKgAwIBAgICEAAwDQYJKoZIhvcNAQEFBQAwXzELMAkGA1UEBhMCREUx +EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD +VQQLEwtEZXZlbG9wbWVudDEPMA0GA1UEAxMGUm9vdCA4MB4XDTA5MTEyMDE1MzMy +MVoXDTM0MTExNDE1MzMyMVowaDELMAkGA1UEBhMCREUxEDAOBgNVBAgTB0hhbWJ1 +cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtEZXZlbG9wbWVu +dDEYMBYGA1UEAxMPU3ViIENBIDEgUm9vdCA4MIGfMA0GCSqGSIb3DQEBAQUAA4GN +ADCBiQKBgQCWeQGfT2jBCQ1EOoLk661wes+5ceX74MgMIXk+y3iRf0qg3j43D6Fr +cxASmwjEltzLqFuHm3Uk5ABeSm9ME3kfVxOMPhs4MeF3dFL5lEc2VzO93ggRowHh +Uxy9ezmcXpZcqWFszCuQjVo8nvRLbuWXZIbzjuhyIF0NUL/pz77UEwIDAQABo4H6 +MIH3MB0GA1UdDgQWBBTvvciOeHn5dksRWbbDMhAHwLzjijCBkQYDVR0jBIGJMIGG +gBTWZnbJBf+pUIiWYN37xzAYcmdBGaFjpGEwXzELMAkGA1UEBhMCREUxEDAOBgNV +BAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtE +ZXZlbG9wbWVudDEPMA0GA1UEAxMGUm9vdCA4ggkAskfeaipMgxkwMQYIKwYBBQUH +AQEEJTAjMCEGCCsGAQUFBzABhhVodHRwOi8vbG9jYWxob3N0Ojg4ODgwDwYDVR0T +AQH/BAUwAwEB/zANBgkqhkiG9w0BAQUFAAOBgQBMlUQ7VwjsAez5PnyJHDCxTiYy +tlf6Jbzt69SiHGfuuYvQTFeKDtugnZLn3sZzAefeYRu1DtDFwaemq+DGC1Hd5aIy +H8ZS6tMDaDr1kr2LuAO7UHBjzOztPBF2yqxyR62Za44HnjjyY+G61N+pc1QddImU +AS5o3ZfnU/nPtn38hw== +-----END CERTIFICATE----- diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_8/demoCA/crl/DO_NOT_INSTALL_THIS_CRL b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_8/demoCA/crl/DO_NOT_INSTALL_THIS_CRL new file mode 100755 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_8/demoCA/crl/DO_NOT_INSTALL_THIS_CRL diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_8/demoCA/crl/Sub_CA_1_Root_8.crl b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_8/demoCA/crl/Sub_CA_1_Root_8.crl Binary files differnew file mode 100755 index 000000000000..7a9ee345ea8f --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_8/demoCA/crl/Sub_CA_1_Root_8.crl diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_8/demoCA/crlnumber b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_8/demoCA/crlnumber new file mode 100755 index 000000000000..dd11724042e2 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_8/demoCA/crlnumber @@ -0,0 +1 @@ +1001 diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_8/demoCA/index.txt b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_8/demoCA/index.txt new file mode 100755 index 000000000000..ff1b3fe19486 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_8/demoCA/index.txt @@ -0,0 +1,2 @@ +V 341114154212Z 1000 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=User 1 Sub CA 1 Root 8 +R 341114154716Z 091120155036Z,superseded 1001 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=User 2 Sub CA 1 Root 8 diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_8/demoCA/index.txt.attr b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_8/demoCA/index.txt.attr new file mode 100755 index 000000000000..8f7e63a3475c --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_8/demoCA/index.txt.attr @@ -0,0 +1 @@ +unique_subject = yes diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_8/demoCA/newcerts/1000.pem b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_8/demoCA/newcerts/1000.pem new file mode 100755 index 000000000000..71456d01b1a0 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_8/demoCA/newcerts/1000.pem @@ -0,0 +1,62 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 4096 (0x1000) + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Sub CA 1 Root 8 + Validity + Not Before: Nov 20 15:42:12 2009 GMT + Not After : Nov 14 15:42:12 2034 GMT + Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=User 1 Sub CA 1 Root 8 + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public Key: (1024 bit) + Modulus (1024 bit): + 00:b6:aa:34:ec:31:e5:9a:aa:fe:90:31:1f:e5:83: + 90:cb:9a:9e:15:cd:bb:35:1b:fc:3c:8b:d9:3d:29: + de:f4:07:3f:4c:06:9b:4f:db:21:a2:4b:87:8b:fd: + b4:61:31:de:34:6c:14:10:f9:a7:7a:e0:0a:e9:bf: + b3:83:a3:35:44:f4:ad:c3:d0:60:e8:71:8e:6d:c0: + 70:9a:16:85:65:7a:82:68:7c:67:ee:57:31:6b:e8: + fd:f2:3f:5f:c7:ec:4e:db:e7:8a:98:d6:15:45:13: + 14:03:bc:4e:8a:03:48:c2:e4:aa:c5:32:cf:80:82: + 45:16:8b:63:37:4b:d5:7a:97 + Exponent: 65537 (0x10001) + X509v3 extensions: + Authority Information Access: + OCSP - URI:http://localhost:8889 + + X509v3 Key Usage: + Digital Signature, Non Repudiation, Key Encipherment + X509v3 Subject Key Identifier: + 4E:0B:28:05:B5:07:8F:77:1E:A6:37:CB:CC:F0:CB:09:A4:8C:4A:1E + X509v3 Authority Key Identifier: + keyid:EF:BD:C8:8E:78:79:F9:76:4B:11:59:B6:C3:32:10:07:C0:BC:E3:8A + + Signature Algorithm: sha1WithRSAEncryption + 3e:f7:c5:94:58:2f:18:c9:11:29:29:28:33:bb:e7:6c:70:7c: + f8:c7:60:4a:e5:37:f2:bb:78:d9:52:1e:c2:a3:dd:b1:7f:da: + e1:8a:8b:9c:7e:d6:ee:ec:ef:94:37:b5:b8:97:26:92:01:56: + 78:15:44:4b:95:4d:d9:59:12:b0:89:86:e4:b5:7d:b4:73:0f: + f1:0d:a8:04:69:e4:3f:2a:6a:65:b9:0e:9a:06:f7:16:29:94: + 4d:ac:64:ab:e9:0f:06:3c:74:fe:4c:e1:71:98:bd:9f:bb:c1: + 2d:47:70:6a:3c:b3:76:0b:fc:c8:05:d6:4e:bf:33:9f:dd:58: + 74:9c +-----BEGIN CERTIFICATE----- +MIIC0jCCAjugAwIBAgICEAAwDQYJKoZIhvcNAQEFBQAwaDELMAkGA1UEBhMCREUx +EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD +VQQLEwtEZXZlbG9wbWVudDEYMBYGA1UEAxMPU3ViIENBIDEgUm9vdCA4MB4XDTA5 +MTEyMDE1NDIxMloXDTM0MTExNDE1NDIxMlowbzELMAkGA1UEBhMCREUxEDAOBgNV +BAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtE +ZXZlbG9wbWVudDEfMB0GA1UEAxMWVXNlciAxIFN1YiBDQSAxIFJvb3QgODCBnzAN +BgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAtqo07DHlmqr+kDEf5YOQy5qeFc27NRv8 +PIvZPSne9Ac/TAabT9shokuHi/20YTHeNGwUEPmneuAK6b+zg6M1RPStw9Bg6HGO +bcBwmhaFZXqCaHxn7lcxa+j98j9fx+xO2+eKmNYVRRMUA7xOigNIwuSqxTLPgIJF +FotjN0vVepcCAwEAAaOBgzCBgDAxBggrBgEFBQcBAQQlMCMwIQYIKwYBBQUHMAGG +FWh0dHA6Ly9sb2NhbGhvc3Q6ODg4OTALBgNVHQ8EBAMCBeAwHQYDVR0OBBYEFE4L +KAW1B493HqY3y8zwywmkjEoeMB8GA1UdIwQYMBaAFO+9yI54efl2SxFZtsMyEAfA +vOOKMA0GCSqGSIb3DQEBBQUAA4GBAD73xZRYLxjJESkpKDO752xwfPjHYErlN/K7 +eNlSHsKj3bF/2uGKi5x+1u7s75Q3tbiXJpIBVngVREuVTdlZErCJhuS1fbRzD/EN +qARp5D8qamW5DpoG9xYplE2sZKvpDwY8dP5M4XGYvZ+7wS1HcGo8s3YL/MgF1k6/ +M5/dWHSc +-----END CERTIFICATE----- diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_8/demoCA/newcerts/1001.pem b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_8/demoCA/newcerts/1001.pem new file mode 100755 index 000000000000..51102e24a554 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_8/demoCA/newcerts/1001.pem @@ -0,0 +1,62 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 4097 (0x1001) + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Sub CA 1 Root 8 + Validity + Not Before: Nov 20 15:47:16 2009 GMT + Not After : Nov 14 15:47:16 2034 GMT + Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=User 2 Sub CA 1 Root 8 + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public Key: (1024 bit) + Modulus (1024 bit): + 00:a1:55:67:7e:e5:7a:62:eb:2b:36:45:fa:1d:4d: + c7:0e:6d:db:f6:54:65:4d:55:39:14:ea:c1:ad:75: + 1b:2f:2f:3c:6e:67:e0:6d:c6:76:66:0c:11:a2:89: + fe:70:3b:24:3e:0d:2a:13:9f:86:b4:8a:a3:27:50: + 52:77:1f:b8:7b:85:4e:36:94:68:4f:23:2c:f6:a1: + 0f:01:bc:6d:d4:e9:a4:54:12:15:37:bd:6c:ba:ad: + ed:78:ed:00:cc:be:a9:20:99:f5:a5:db:96:ba:cb: + 89:6b:ff:30:36:5c:84:77:a8:0d:28:d3:f8:20:99: + 01:4d:0f:8e:b3:8e:de:8d:09 + Exponent: 65537 (0x10001) + X509v3 extensions: + Authority Information Access: + OCSP - URI:http://localhost:8889 + + X509v3 Key Usage: + Digital Signature, Non Repudiation, Key Encipherment + X509v3 Subject Key Identifier: + FC:DC:A7:1C:CE:D2:A9:DA:9A:76:9D:AE:8F:C8:1E:56:BA:D2:D5:D5 + X509v3 Authority Key Identifier: + keyid:EF:BD:C8:8E:78:79:F9:76:4B:11:59:B6:C3:32:10:07:C0:BC:E3:8A + + Signature Algorithm: sha1WithRSAEncryption + 87:30:ed:08:e6:03:fa:cf:65:5a:ed:9e:83:db:64:5f:bb:6b: + 5c:f3:db:8d:b7:d0:95:35:8c:f6:c1:1c:2c:d9:0c:0a:41:27: + f9:1f:e4:aa:25:95:59:3c:45:85:ac:0f:02:42:92:67:e2:09: + 45:d3:c1:7b:6e:db:42:84:7b:0d:57:47:f5:07:38:dd:cf:38: + ac:29:b9:14:79:2e:04:a5:a0:d6:71:be:fa:6d:9e:b5:cd:89: + 99:d1:47:58:56:81:8c:d4:b0:96:c6:dc:a7:1b:b0:ef:6b:0c: + 25:5f:92:b8:01:b7:74:f0:e3:49:eb:30:29:9f:f3:b5:bd:ae: + 45:99 +-----BEGIN CERTIFICATE----- +MIIC0jCCAjugAwIBAgICEAEwDQYJKoZIhvcNAQEFBQAwaDELMAkGA1UEBhMCREUx +EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD +VQQLEwtEZXZlbG9wbWVudDEYMBYGA1UEAxMPU3ViIENBIDEgUm9vdCA4MB4XDTA5 +MTEyMDE1NDcxNloXDTM0MTExNDE1NDcxNlowbzELMAkGA1UEBhMCREUxEDAOBgNV +BAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtE +ZXZlbG9wbWVudDEfMB0GA1UEAxMWVXNlciAyIFN1YiBDQSAxIFJvb3QgODCBnzAN +BgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAoVVnfuV6YusrNkX6HU3HDm3b9lRlTVU5 +FOrBrXUbLy88bmfgbcZ2ZgwRoon+cDskPg0qE5+GtIqjJ1BSdx+4e4VONpRoTyMs +9qEPAbxt1OmkVBIVN71suq3teO0AzL6pIJn1pduWusuJa/8wNlyEd6gNKNP4IJkB +TQ+Os47ejQkCAwEAAaOBgzCBgDAxBggrBgEFBQcBAQQlMCMwIQYIKwYBBQUHMAGG +FWh0dHA6Ly9sb2NhbGhvc3Q6ODg4OTALBgNVHQ8EBAMCBeAwHQYDVR0OBBYEFPzc +pxzO0qnamnadro/IHla60tXVMB8GA1UdIwQYMBaAFO+9yI54efl2SxFZtsMyEAfA +vOOKMA0GCSqGSIb3DQEBBQUAA4GBAIcw7QjmA/rPZVrtnoPbZF+7a1zz24230JU1 +jPbBHCzZDApBJ/kf5KollVk8RYWsDwJCkmfiCUXTwXtu20KEew1XR/UHON3POKwp +uRR5LgSloNZxvvptnrXNiZnRR1hWgYzUsJbG3KcbsO9rDCVfkrgBt3Tw40nrMCmf +87W9rkWZ +-----END CERTIFICATE----- diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_8/demoCA/private/cakey.pem b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_8/demoCA/private/cakey.pem new file mode 100755 index 000000000000..6c934e3ec83f --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_8/demoCA/private/cakey.pem @@ -0,0 +1,18 @@ +-----BEGIN RSA PRIVATE KEY----- +Proc-Type: 4,ENCRYPTED +DEK-Info: DES-EDE3-CBC,D40C0B2149B20A3E + +u5VzDci4c2i/pIElAbIAVT81F72A2V3fpvZv8yUpQRai5ZPzciSc4oYgavdu3tLV +p8bS+60akNpr3/ti7sB4tQBcql/3FMdKLFCgflJgCH9ivr2UrUSIJOyu9UNoG2ym +UcJrvCSAqtksL11VLMb3SJO7TRYxJ/xOl69Auf0R+aRwdof9nSBO4jDPTqvR/X8L +j/plBnw7ENO0ravRnEEEAEiSgx/z0LkhzAsPTkrrkNN5eZ+kR2Sk/Uo5aTx3FTpB +RU+iZQxmbNTrxCErfYvSnMJ4w6soT+Bzezwfn2tVGLwbur/3gtuNMEHJpL0Y2st9 +aRBHHF6+DlJ30rqNWCVV5ZY+2wMUEPBtcRftLdmh3caw/9aN/NqVUGuvqmhWyTt7 +TJmnKLJhE9NSztQM2PuV7ka9jWp5D6KLv0g+cbedpEOw6VjYL5e1EKt0AOu4Pp2r +HerL1ouRmpzIQLpskFTwkccjVDQm/H2fnB/nVrjdWxi/U4QJ0EPHL8iCyyox5np+ +3HilWBkpyBSvMOhyGfPkUucsMZA6O7/XhDcciBSsCJ4SSMa5gQmfYfixQHKRwixS +O5sJADUnJkbo4hyvrptAolM/JJU+HN8IYnq541mJ72dXbyodheedRPIOpTCiLQam +1Y04wfuIFMN4w98O0oMpCbqcDsOHysxN1XYg2kMzlxYbwooFC5cud5+cEW6d9FWQ +kpZ8Wkigno3ytjpUXWb9TmsRcMNiQdgxlpkvN/eYhk4xsUpwzhA/M/HTkLkn8WtC +52EwCv9KcxF31AA0lOeI+oNfcyMruwNXwEkFn3eD36axZQ8QjPHfhw== +-----END RSA PRIVATE KEY----- diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_8/demoCA/serial b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_8/demoCA/serial new file mode 100755 index 000000000000..7d802a3e7104 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_8/demoCA/serial @@ -0,0 +1 @@ +1002 diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_8/openssl.cfg b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_8/openssl.cfg new file mode 100755 index 000000000000..177888124500 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_8/openssl.cfg @@ -0,0 +1,292 @@ +# +# OpenSSL example configuration file. +# This is mostly being used for generation of certificate requests. +# + +# This definition stops the following lines choking if HOME isn't +# defined. +HOME = . +RANDFILE = $ENV::HOME/.rnd + +# Extra OBJECT IDENTIFIER info: +#oid_file = $ENV::HOME/.oid +oid_section = new_oids + +# To use this configuration file with the "-extfile" option of the +# "openssl x509" utility, name here the section containing the +# X.509v3 extensions to use: +# extensions = +# (Alternatively, use a configuration file that has only +# X.509v3 extensions in its main [= default] section.) + +[ new_oids ] + +# We can add new OIDs in here for use by 'ca' and 'req'. +# Add a simple OID like this: +# testoid1=1.2.3.4 +# Or use config file substitution like this: +# testoid2=${testoid1}.5.6 + +#################################################################### +[ ca ] +default_ca = CA_default # The default ca section + +#################################################################### +[ CA_default ] + +dir = ./demoCA # Where everything is kept +certs = $dir/certs # Where the issued certs are kept +crl_dir = $dir/crl # Where the issued crl are kept +database = $dir/index.txt # database index file. +#unique_subject = no # Set to 'no' to allow creation of + # several ctificates with same subject. +new_certs_dir = $dir/newcerts # default place for new certs. + +certificate = $dir/cacert.pem # The CA certificate +serial = $dir/serial # The current serial number +crlnumber = $dir/crlnumber # the current crl number + # must be commented out to leave a V1 CRL +crl = $dir/crl.pem # The current CRL +private_key = $dir/private/cakey.pem # The private key +RANDFILE = $dir/private/.rand # private random number file + +x509_extensions = usr_cert # The extentions to add to the cert + +# Comment out the following two lines for the "traditional" +# (and highly broken) format. +name_opt = ca_default # Subject Name options +cert_opt = ca_default # Certificate field options + +# Extension copying option: use with caution. +# copy_extensions = copy + +# Extensions to add to a CRL. Note: Netscape communicator chokes on V2 CRLs +# so this is commented out by default to leave a V1 CRL. +# crlnumber must also be commented out to leave a V1 CRL. +# crl_extensions = crl_ext + +default_days = 365 # how long to certify for +default_crl_days= 30 # how long before next CRL +default_md = sha1 # which md to use. +preserve = no # keep passed DN ordering + +# A few difference way of specifying how similar the request should look +# For type CA, the listed attributes must be the same, and the optional +# and supplied fields are just that :-) +policy = policy_match + +# For the CA policy +[ policy_match ] +countryName = match +stateOrProvinceName = match +organizationName = match +organizationalUnitName = optional +commonName = supplied +emailAddress = optional + +# For the 'anything' policy +# At this point in time, you must list all acceptable 'object' +# types. +[ policy_anything ] +countryName = optional +stateOrProvinceName = optional +localityName = optional +organizationName = optional +organizationalUnitName = optional +commonName = supplied +emailAddress = optional + +#################################################################### +[ req ] +default_bits = 1024 +default_keyfile = privkey.pem +distinguished_name = req_distinguished_name +attributes = req_attributes +x509_extensions = v3_ca # The extentions to add to the self signed cert + +# Passwords for private keys if not present they will be prompted for +# input_password = secret +# output_password = secret + +# This sets a mask for permitted string types. There are several options. +# default: PrintableString, T61String, BMPString. +# pkix : PrintableString, BMPString. +# utf8only: only UTF8Strings. +# nombstr : PrintableString, T61String (no BMPStrings or UTF8Strings). +# MASK:XXXX a literal mask value. +# WARNING: current versions of Netscape crash on BMPStrings or UTF8Strings +# so use this option with caution! +string_mask = nombstr + +# req_extensions = v3_req # The extensions to add to a certificate request + +[ req_distinguished_name ] +countryName = Country Name (2 letter code) +countryName_default = DE +countryName_min = 2 +countryName_max = 2 + +stateOrProvinceName = State or Province Name (full name) +stateOrProvinceName_default = Hamburg + +localityName = Locality Name (eg, city) + +0.organizationName = Organization Name (eg, company) +0.organizationName_default = OpenOffice.org + +# we can do this but it is not needed normally :-) +#1.organizationName = Second Organization Name (eg, company) +#1.organizationName_default = World Wide Web Pty Ltd + +organizationalUnitName = Organizational Unit Name (eg, section) +organizationalUnitName_default = Development + +commonName = Common Name (eg, YOUR name) +commonName_max = 64 + +emailAddress = Email Address +emailAddress_max = 64 + +# SET-ex3 = SET extension number 3 + +[ req_attributes ] +challengePassword = A challenge password +challengePassword_min = 4 +challengePassword_max = 20 + +unstructuredName = An optional company name + +[ usr_cert ] + +# These extensions are added when 'ca' signs a request. +authorityInfoAccess = OCSP;URI:http://localhost:8889 +#crlDistributionPoints=URI:http://localhost:8902/demoCA/crl/Sub_CA_2_Root_7.crl +# This is typical in keyUsage for a client certificate. +keyUsage = nonRepudiation, digitalSignature, keyEncipherment + +# This will be displayed in Netscape's comment listbox. +#nsComment = "OpenSSL Generated Certificate" + +# PKIX recommendations harmless if included in all certificates. +subjectKeyIdentifier=hash +authorityKeyIdentifier=keyid,issuer + +# This stuff is for subjectAltName and issuerAltname. +# Import the email address. +# subjectAltName=email:copy +# An alternative to produce certificates that aren't +# deprecated according to PKIX. +# subjectAltName=email:move + +# Copy subject details +# issuerAltName=issuer:copy + + + +[ v3_req ] + +# Extensions to add to a certificate request + +basicConstraints = CA:FALSE +keyUsage = nonRepudiation, digitalSignature, keyEncipherment +#authorityInfoAccess = OCSP;URI:http://localhost:8888/ + +[ v3_ca ] + + +# Extensions for a typical CA + + +# PKIX recommendation. + +subjectKeyIdentifier=hash + +authorityKeyIdentifier=keyid:always,issuer:always + +#authorityInfoAccess = OCSP;URI:http://localhost:8888 +#crlDistributionPoints=URI:http://localhost:8901/demoCA/crl/Test_CA_2009.2.crl +# This is what PKIX recommends but some broken software chokes on critical +# extensions. +#basicConstraints = critical,CA:true +# So we do this instead. +basicConstraints = critical, CA:true + +# Key usage: this is typical for a CA certificate. However since it will +# prevent it being used as an test self-signed certificate it is best +# left out by default. +# keyUsage = cRLSign, keyCertSign + +# Some might want this also +# nsCertType = sslCA, emailCA + +# Include email address in subject alt name: another PKIX recommendation +# subjectAltName=email:copy +# Copy issuer details +# issuerAltName=issuer:copy + +# DER hex encoding of an extension: beware experts only! +# obj=DER:02:03 +# Where 'obj' is a standard or added object +# You can even override a supported extension: +# basicConstraints= critical, DER:30:03:01:01:FF + +[ crl_ext ] + +# CRL extensions. +# Only issuerAltName and authorityKeyIdentifier make any sense in a CRL. + +# issuerAltName=issuer:copy +authorityKeyIdentifier=keyid:always,issuer:always + +[ proxy_cert_ext ] +# These extensions should be added when creating a proxy certificate + +# This goes against PKIX guidelines but some CAs do it and some software +# requires this to avoid interpreting an end user certificate as a CA. + +basicConstraints=CA:FALSE + +# Here are some examples of the usage of nsCertType. If it is omitted +# the certificate can be used for anything *except* object signing. + +# This is OK for an SSL server. +# nsCertType = server + +# For an object signing certificate this would be used. +# nsCertType = objsign + +# For normal client use this is typical +# nsCertType = client, email + +# and for everything including object signing: +# nsCertType = client, email, objsign + +# This is typical in keyUsage for a client certificate. +# keyUsage = nonRepudiation, digitalSignature, keyEncipherment + +# This will be displayed in Netscape's comment listbox. +nsComment = "OpenSSL Generated Certificate" + +# PKIX recommendations harmless if included in all certificates. +subjectKeyIdentifier=hash +authorityKeyIdentifier=keyid,issuer:always + +# This stuff is for subjectAltName and issuerAltname. +# Import the email address. +# subjectAltName=email:copy +# An alternative to produce certificates that aren't +# deprecated according to PKIX. +# subjectAltName=email:move + +# Copy subject details +# issuerAltName=issuer:copy + +#nsCaRevocationUrl = http://www.domain.dom/ca-crl.pem +#nsBaseUrl +#nsRevocationUrl +#nsRenewalUrl +#nsCaPolicyUrl +#nsSslServerName + +# This really needs to be in place for it to be a proxy certificate. +proxyCertInfo=critical,language:id-ppl-anyLanguage,pathlen:3,policy:foo diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_9/demoCA/cacert.pem b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_9/demoCA/cacert.pem new file mode 100755 index 000000000000..0b38d4db4c7a --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_9/demoCA/cacert.pem @@ -0,0 +1,62 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 4096 (0x1000) + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 9 + Validity + Not Before: Nov 23 13:59:19 2009 GMT + Not After : Nov 17 13:59:19 2034 GMT + Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Sub CA 1 Root 9 + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public Key: (1024 bit) + Modulus (1024 bit): + 00:a9:6d:7f:6a:08:fb:e2:3a:5e:83:3f:ff:58:ba: + 92:a1:79:9d:ce:d2:0c:16:15:f2:7e:b3:e4:45:9c: + 02:32:65:9b:02:90:78:05:95:e4:04:1d:4a:05:bb: + ea:f6:ac:ab:15:74:c2:bc:ee:2a:c1:80:55:3e:93: + 1f:5c:94:eb:cf:cf:8f:15:eb:b8:22:fe:69:61:51: + a9:08:b8:80:bd:48:99:da:85:10:1c:75:97:fd:d3: + c3:c4:0b:dd:eb:01:12:5d:ee:62:62:c3:0c:18:ea: + ed:76:ff:9b:1c:1f:c7:81:f9:9a:cd:e5:25:89:b2: + 13:57:56:f3:27:53:72:76:69 + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Subject Key Identifier: + 7B:D3:57:BF:6A:CB:6C:10:81:91:DA:95:DC:88:4F:A5:D0:DB:D1:46 + X509v3 Authority Key Identifier: + keyid:CD:33:5E:AB:73:23:51:80:B8:03:AD:12:01:0B:C5:5E:8E:55:CA:64 + DirName:/C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=Root 9 + serial:A4:DB:16:0D:4B:8C:D4:A6 + + X509v3 Basic Constraints: critical + CA:TRUE + Signature Algorithm: sha1WithRSAEncryption + 17:67:b0:21:da:0d:a1:fe:09:62:d0:cf:1d:c0:c8:bd:d4:22: + dd:75:ec:04:e2:23:ae:ea:8c:15:fa:73:2e:83:f4:16:eb:c1: + e1:87:36:bd:58:d0:64:e0:6e:2c:bc:27:cb:dc:4b:58:01:80: + 48:27:53:bb:75:85:a7:19:b8:e2:c0:1f:9f:a2:18:27:82:3f: + 25:bf:17:d1:34:32:de:c4:81:9d:8a:39:6f:6b:1f:b6:12:61: + 74:78:96:6d:6e:52:23:4a:67:30:78:03:91:b7:89:bf:3c:4a: + 36:e3:95:21:38:35:af:05:55:81:05:25:91:78:ca:2f:5d:79: + d2:05 +-----BEGIN CERTIFICATE----- +MIIDBjCCAm+gAwIBAgICEAAwDQYJKoZIhvcNAQEFBQAwXzELMAkGA1UEBhMCREUx +EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD +VQQLEwtEZXZlbG9wbWVudDEPMA0GA1UEAxMGUm9vdCA5MB4XDTA5MTEyMzEzNTkx +OVoXDTM0MTExNzEzNTkxOVowaDELMAkGA1UEBhMCREUxEDAOBgNVBAgTB0hhbWJ1 +cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtEZXZlbG9wbWVu +dDEYMBYGA1UEAxMPU3ViIENBIDEgUm9vdCA5MIGfMA0GCSqGSIb3DQEBAQUAA4GN +ADCBiQKBgQCpbX9qCPviOl6DP/9YupKheZ3O0gwWFfJ+s+RFnAIyZZsCkHgFleQE +HUoFu+r2rKsVdMK87irBgFU+kx9clOvPz48V67gi/mlhUakIuIC9SJnahRAcdZf9 +08PEC93rARJd7mJiwwwY6u12/5scH8eB+ZrN5SWJshNXVvMnU3J2aQIDAQABo4HH +MIHEMB0GA1UdDgQWBBR701e/astsEIGR2pXciE+l0NvRRjCBkQYDVR0jBIGJMIGG +gBTNM16rcyNRgLgDrRIBC8VejlXKZKFjpGEwXzELMAkGA1UEBhMCREUxEDAOBgNV +BAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtE +ZXZlbG9wbWVudDEPMA0GA1UEAxMGUm9vdCA5ggkApNsWDUuM1KYwDwYDVR0TAQH/ +BAUwAwEB/zANBgkqhkiG9w0BAQUFAAOBgQAXZ7Ah2g2h/gli0M8dwMi91CLddewE +4iOu6owV+nMug/QW68Hhhza9WNBk4G4svCfL3EtYAYBIJ1O7dYWnGbjiwB+fohgn +gj8lvxfRNDLexIGdijlvax+2EmF0eJZtblIjSmcweAORt4m/PEo245UhODWvBVWB +BSWReMovXXnSBQ== +-----END CERTIFICATE----- diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_9/demoCA/crlnumber b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_9/demoCA/crlnumber new file mode 100755 index 000000000000..dd11724042e2 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_9/demoCA/crlnumber @@ -0,0 +1 @@ +1001 diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_9/demoCA/index.txt b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_9/demoCA/index.txt new file mode 100755 index 000000000000..8c466eaffd80 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_9/demoCA/index.txt @@ -0,0 +1 @@ +V 341117140202Z 1000 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=User 1 Sub CA 1 Root 9 diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_9/demoCA/index.txt.attr b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_9/demoCA/index.txt.attr new file mode 100755 index 000000000000..8f7e63a3475c --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_9/demoCA/index.txt.attr @@ -0,0 +1 @@ +unique_subject = yes diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_9/demoCA/newcerts/1000.pem b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_9/demoCA/newcerts/1000.pem new file mode 100755 index 000000000000..e3ca26a8a386 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_9/demoCA/newcerts/1000.pem @@ -0,0 +1,58 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 4096 (0x1000) + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Sub CA 1 Root 9 + Validity + Not Before: Nov 23 14:02:02 2009 GMT + Not After : Nov 17 14:02:02 2034 GMT + Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=User 1 Sub CA 1 Root 9 + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public Key: (1024 bit) + Modulus (1024 bit): + 00:f2:d3:15:3c:73:42:ce:22:e4:40:3a:6b:02:f6: + 59:bd:66:0d:87:91:f4:c0:be:a9:ce:33:21:09:d9: + 4e:4b:03:51:87:c3:e9:75:91:e9:80:5e:fc:a1:f7: + 43:9b:c6:32:af:6d:77:4b:b6:dc:b1:08:a3:1f:a0: + 6d:ec:81:12:23:48:36:2d:7a:5a:d0:88:88:49:7c: + ce:ae:98:45:d8:ff:9f:15:72:ab:b4:85:f6:a5:23: + af:43:e4:64:45:da:20:e1:e0:3e:f2:87:ea:67:ea: + 0e:08:8a:c8:1c:ef:85:a5:e6:f3:54:68:02:fd:de: + bc:4d:a2:eb:7d:0d:7d:80:59 + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Key Usage: + Digital Signature, Non Repudiation, Key Encipherment + X509v3 Subject Key Identifier: + 1B:56:DD:11:CE:38:A0:97:FF:BE:39:9C:AF:F4:60:82:3A:CA:5D:51 + X509v3 Authority Key Identifier: + keyid:7B:D3:57:BF:6A:CB:6C:10:81:91:DA:95:DC:88:4F:A5:D0:DB:D1:46 + + Signature Algorithm: sha1WithRSAEncryption + 54:5e:40:1d:83:35:67:23:01:28:35:e3:02:7f:9e:9f:ce:83: + fb:45:dd:5c:96:62:f5:28:45:c8:90:2a:7e:84:88:e9:e9:b7: + 21:17:e0:3b:ea:de:6d:a1:d5:37:90:ae:15:86:30:7f:82:81: + d1:bb:ca:d2:6c:7c:39:2e:e9:65:57:2b:74:47:04:49:99:74: + 63:c7:03:cc:7d:f4:b0:6e:92:75:bb:aa:28:dc:71:d3:95:73: + 15:f4:4f:38:43:9e:4f:9f:e3:97:5c:8d:dc:1e:ad:ad:1e:b7: + c2:b2:ca:87:ee:8e:a2:93:12:60:95:1a:fb:bf:42:c8:31:48: + 8a:43 +-----BEGIN CERTIFICATE----- +MIICnTCCAgagAwIBAgICEAAwDQYJKoZIhvcNAQEFBQAwaDELMAkGA1UEBhMCREUx +EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD +VQQLEwtEZXZlbG9wbWVudDEYMBYGA1UEAxMPU3ViIENBIDEgUm9vdCA5MB4XDTA5 +MTEyMzE0MDIwMloXDTM0MTExNzE0MDIwMlowbzELMAkGA1UEBhMCREUxEDAOBgNV +BAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtE +ZXZlbG9wbWVudDEfMB0GA1UEAxMWVXNlciAxIFN1YiBDQSAxIFJvb3QgOTCBnzAN +BgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA8tMVPHNCziLkQDprAvZZvWYNh5H0wL6p +zjMhCdlOSwNRh8PpdZHpgF78ofdDm8Yyr213S7bcsQijH6Bt7IESI0g2LXpa0IiI +SXzOrphF2P+fFXKrtIX2pSOvQ+RkRdog4eA+8ofqZ+oOCIrIHO+FpebzVGgC/d68 +TaLrfQ19gFkCAwEAAaNPME0wCwYDVR0PBAQDAgXgMB0GA1UdDgQWBBQbVt0Rzjig +l/++OZyv9GCCOspdUTAfBgNVHSMEGDAWgBR701e/astsEIGR2pXciE+l0NvRRjAN +BgkqhkiG9w0BAQUFAAOBgQBUXkAdgzVnIwEoNeMCf56fzoP7Rd1clmL1KEXIkCp+ +hIjp6bchF+A76t5todU3kK4VhjB/goHRu8rSbHw5LullVyt0RwRJmXRjxwPMffSw +bpJ1u6oo3HHTlXMV9E84Q55Pn+OXXI3cHq2tHrfCssqH7o6ikxJglRr7v0LIMUiK +Qw== +-----END CERTIFICATE----- diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_9/demoCA/private/cakey.pem b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_9/demoCA/private/cakey.pem new file mode 100755 index 000000000000..be54b542a4b8 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_9/demoCA/private/cakey.pem @@ -0,0 +1,18 @@ +-----BEGIN RSA PRIVATE KEY----- +Proc-Type: 4,ENCRYPTED +DEK-Info: DES-EDE3-CBC,6D4A43A204C02659 + +ZPB/XY3gNrLz1f2DqTRkoZiL64CjVUEPw6ujRi/cAaMfAB+p32O/obtFbMyZWfpv +aLaoPmQH5hagNgsQqOW6OrSguxQ9i64Wv795TzRBrSYRHJ1as73AfDcS9aeI61AM +kiweFkVFAOPfgKOczYO152uXxtdRm4kpVr/CMsYuViE7966dzFvjDlY4vTDAD32+ +KJemzfjwsyErT/nYJaaabEkxxn+O3nwhgVqueoYWI8VeLYotFU41wO1NrOQvshs0 +tyrs5meiuSNPVuKagTltWfHv9PlMyVne7XYiRv1k7CIPmEansBge9/lY5KoPLHGQ +CHjuuwPykf6jnW7QG9IAGKRNPSdlMBpOT97EvKgNZ9I0FB4lSumhrxkjPHrRKz/J +usV+mEcGGYrfAb2OT0B/YSddOk1rCtKXpRVUMF8dzD7AyVxnU0Sdub6lwjNojAGh +Nb8exIFnVBM0/ka19xvlcdY0q9du7e0MuVvy8NhE0vkoqqDrUUnCP8iqg+uRBVts +0P7yk1lucsrNw8JQveLuiHm6zxN91iUAsBguwoOHG6szp3X9GLvvGhpQWPxTIOyo +obPMw6lY0y9MHY6eW9ekXVWGMZL2GDpIKLq9kqzLTqhY9kDw9OXYio4UYLl9vQG4 +Akr4ogzm8SKNQkPnGHprCdQV5J4V7fOa4HTNJb6NlTvMFuC99Sst+PYdE4RAn3sT +Jn+Lj2g0fDDSjvLNohmrT08DAYAAinbNt/+6gI975syPxuqxggrgfis4cliI7pf8 +ecmKIoSlbsJVCSfgd5a/d7e+9KwNuqBqopLu2vfgUN1YiFlEwAEQaQ== +-----END RSA PRIVATE KEY----- diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_9/demoCA/serial b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_9/demoCA/serial new file mode 100755 index 000000000000..dd11724042e2 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_9/demoCA/serial @@ -0,0 +1 @@ +1001 diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_9/openssl.cfg b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_9/openssl.cfg new file mode 100755 index 000000000000..a9628b957b3a --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_1_Root_9/openssl.cfg @@ -0,0 +1,292 @@ +# +# OpenSSL example configuration file. +# This is mostly being used for generation of certificate requests. +# + +# This definition stops the following lines choking if HOME isn't +# defined. +HOME = . +RANDFILE = $ENV::HOME/.rnd + +# Extra OBJECT IDENTIFIER info: +#oid_file = $ENV::HOME/.oid +oid_section = new_oids + +# To use this configuration file with the "-extfile" option of the +# "openssl x509" utility, name here the section containing the +# X.509v3 extensions to use: +# extensions = +# (Alternatively, use a configuration file that has only +# X.509v3 extensions in its main [= default] section.) + +[ new_oids ] + +# We can add new OIDs in here for use by 'ca' and 'req'. +# Add a simple OID like this: +# testoid1=1.2.3.4 +# Or use config file substitution like this: +# testoid2=${testoid1}.5.6 + +#################################################################### +[ ca ] +default_ca = CA_default # The default ca section + +#################################################################### +[ CA_default ] + +dir = ./demoCA # Where everything is kept +certs = $dir/certs # Where the issued certs are kept +crl_dir = $dir/crl # Where the issued crl are kept +database = $dir/index.txt # database index file. +#unique_subject = no # Set to 'no' to allow creation of + # several ctificates with same subject. +new_certs_dir = $dir/newcerts # default place for new certs. + +certificate = $dir/cacert.pem # The CA certificate +serial = $dir/serial # The current serial number +crlnumber = $dir/crlnumber # the current crl number + # must be commented out to leave a V1 CRL +crl = $dir/crl.pem # The current CRL +private_key = $dir/private/cakey.pem # The private key +RANDFILE = $dir/private/.rand # private random number file + +x509_extensions = usr_cert # The extentions to add to the cert + +# Comment out the following two lines for the "traditional" +# (and highly broken) format. +name_opt = ca_default # Subject Name options +cert_opt = ca_default # Certificate field options + +# Extension copying option: use with caution. +# copy_extensions = copy + +# Extensions to add to a CRL. Note: Netscape communicator chokes on V2 CRLs +# so this is commented out by default to leave a V1 CRL. +# crlnumber must also be commented out to leave a V1 CRL. +# crl_extensions = crl_ext + +default_days = 365 # how long to certify for +default_crl_days= 30 # how long before next CRL +default_md = sha1 # which md to use. +preserve = no # keep passed DN ordering + +# A few difference way of specifying how similar the request should look +# For type CA, the listed attributes must be the same, and the optional +# and supplied fields are just that :-) +policy = policy_match + +# For the CA policy +[ policy_match ] +countryName = match +stateOrProvinceName = match +organizationName = match +organizationalUnitName = optional +commonName = supplied +emailAddress = optional + +# For the 'anything' policy +# At this point in time, you must list all acceptable 'object' +# types. +[ policy_anything ] +countryName = optional +stateOrProvinceName = optional +localityName = optional +organizationName = optional +organizationalUnitName = optional +commonName = supplied +emailAddress = optional + +#################################################################### +[ req ] +default_bits = 1024 +default_keyfile = privkey.pem +distinguished_name = req_distinguished_name +attributes = req_attributes +x509_extensions = v3_ca # The extentions to add to the self signed cert + +# Passwords for private keys if not present they will be prompted for +# input_password = secret +# output_password = secret + +# This sets a mask for permitted string types. There are several options. +# default: PrintableString, T61String, BMPString. +# pkix : PrintableString, BMPString. +# utf8only: only UTF8Strings. +# nombstr : PrintableString, T61String (no BMPStrings or UTF8Strings). +# MASK:XXXX a literal mask value. +# WARNING: current versions of Netscape crash on BMPStrings or UTF8Strings +# so use this option with caution! +string_mask = nombstr + +# req_extensions = v3_req # The extensions to add to a certificate request + +[ req_distinguished_name ] +countryName = Country Name (2 letter code) +countryName_default = DE +countryName_min = 2 +countryName_max = 2 + +stateOrProvinceName = State or Province Name (full name) +stateOrProvinceName_default = Hamburg + +localityName = Locality Name (eg, city) + +0.organizationName = Organization Name (eg, company) +0.organizationName_default = OpenOffice.org + +# we can do this but it is not needed normally :-) +#1.organizationName = Second Organization Name (eg, company) +#1.organizationName_default = World Wide Web Pty Ltd + +organizationalUnitName = Organizational Unit Name (eg, section) +organizationalUnitName_default = Development + +commonName = Common Name (eg, YOUR name) +commonName_max = 64 + +emailAddress = Email Address +emailAddress_max = 64 + +# SET-ex3 = SET extension number 3 + +[ req_attributes ] +challengePassword = A challenge password +challengePassword_min = 4 +challengePassword_max = 20 + +unstructuredName = An optional company name + +[ usr_cert ] + +# These extensions are added when 'ca' signs a request. +#authorityInfoAccess = OCSP;URI:http://localhost:8889 +#crlDistributionPoints=URI:http://localhost:8902/demoCA/crl/Sub_CA_2_Root_7.crl +# This is typical in keyUsage for a client certificate. +keyUsage = nonRepudiation, digitalSignature, keyEncipherment + +# This will be displayed in Netscape's comment listbox. +#nsComment = "OpenSSL Generated Certificate" + +# PKIX recommendations harmless if included in all certificates. +subjectKeyIdentifier=hash +authorityKeyIdentifier=keyid,issuer + +# This stuff is for subjectAltName and issuerAltname. +# Import the email address. +# subjectAltName=email:copy +# An alternative to produce certificates that aren't +# deprecated according to PKIX. +# subjectAltName=email:move + +# Copy subject details +# issuerAltName=issuer:copy + + + +[ v3_req ] + +# Extensions to add to a certificate request + +basicConstraints = CA:FALSE +keyUsage = nonRepudiation, digitalSignature, keyEncipherment +#authorityInfoAccess = OCSP;URI:http://localhost:8888/ + +[ v3_ca ] + + +# Extensions for a typical CA + + +# PKIX recommendation. + +subjectKeyIdentifier=hash + +authorityKeyIdentifier=keyid:always,issuer:always + +#authorityInfoAccess = OCSP;URI:http://localhost:8888 +#crlDistributionPoints=URI:http://localhost:8901/demoCA/crl/Test_CA_2009.2.crl +# This is what PKIX recommends but some broken software chokes on critical +# extensions. +#basicConstraints = critical,CA:true +# So we do this instead. +basicConstraints = critical, CA:true + +# Key usage: this is typical for a CA certificate. However since it will +# prevent it being used as an test self-signed certificate it is best +# left out by default. +# keyUsage = cRLSign, keyCertSign + +# Some might want this also +# nsCertType = sslCA, emailCA + +# Include email address in subject alt name: another PKIX recommendation +# subjectAltName=email:copy +# Copy issuer details +# issuerAltName=issuer:copy + +# DER hex encoding of an extension: beware experts only! +# obj=DER:02:03 +# Where 'obj' is a standard or added object +# You can even override a supported extension: +# basicConstraints= critical, DER:30:03:01:01:FF + +[ crl_ext ] + +# CRL extensions. +# Only issuerAltName and authorityKeyIdentifier make any sense in a CRL. + +# issuerAltName=issuer:copy +authorityKeyIdentifier=keyid:always,issuer:always + +[ proxy_cert_ext ] +# These extensions should be added when creating a proxy certificate + +# This goes against PKIX guidelines but some CAs do it and some software +# requires this to avoid interpreting an end user certificate as a CA. + +basicConstraints=CA:FALSE + +# Here are some examples of the usage of nsCertType. If it is omitted +# the certificate can be used for anything *except* object signing. + +# This is OK for an SSL server. +# nsCertType = server + +# For an object signing certificate this would be used. +# nsCertType = objsign + +# For normal client use this is typical +# nsCertType = client, email + +# and for everything including object signing: +# nsCertType = client, email, objsign + +# This is typical in keyUsage for a client certificate. +# keyUsage = nonRepudiation, digitalSignature, keyEncipherment + +# This will be displayed in Netscape's comment listbox. +nsComment = "OpenSSL Generated Certificate" + +# PKIX recommendations harmless if included in all certificates. +subjectKeyIdentifier=hash +authorityKeyIdentifier=keyid,issuer:always + +# This stuff is for subjectAltName and issuerAltname. +# Import the email address. +# subjectAltName=email:copy +# An alternative to produce certificates that aren't +# deprecated according to PKIX. +# subjectAltName=email:move + +# Copy subject details +# issuerAltName=issuer:copy + +#nsCaRevocationUrl = http://www.domain.dom/ca-crl.pem +#nsBaseUrl +#nsRevocationUrl +#nsRenewalUrl +#nsCaPolicyUrl +#nsSslServerName + +# This really needs to be in place for it to be a proxy certificate. +proxyCertInfo=critical,language:id-ppl-anyLanguage,pathlen:3,policy:foo diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_4/README.txt b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_4/README.txt new file mode 100755 index 000000000000..e020f03a5477 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_4/README.txt @@ -0,0 +1,4 @@ +Revoked certificates: + +- User 2 Sub CA 2 Root 4 + diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_4/demoCA/cacert.pem b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_4/demoCA/cacert.pem new file mode 100755 index 000000000000..9d951ee26728 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_4/demoCA/cacert.pem @@ -0,0 +1,62 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 4097 (0x1001) + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 4 + Validity + Not Before: Nov 20 09:22:27 2009 GMT + Not After : Nov 14 09:22:27 2034 GMT + Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Sub CA 2 Root 4 + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public Key: (1024 bit) + Modulus (1024 bit): + 00:e5:8d:27:4e:09:53:08:61:c6:23:25:9e:dd:9c: + 07:bf:81:38:5c:5c:10:8f:e4:12:2f:4e:2e:b1:a1: + cf:21:46:53:bf:e8:5e:de:17:3a:9d:f7:e8:ef:3e: + 9c:b4:29:37:4c:31:35:15:dc:98:e0:93:9c:ce:6a: + d6:e1:35:19:6b:d4:1d:3b:81:86:b1:e7:ff:1f:b8: + 34:a9:f9:de:4d:b8:62:ac:3b:d4:58:8e:5c:76:b5: + 07:7f:32:8a:3a:90:73:71:d5:da:f1:79:39:14:ed: + 1b:f1:8a:3e:be:48:bc:07:ec:f9:7c:03:14:fc:e7: + 55:a3:65:81:c7:6c:70:0b:ff + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Subject Key Identifier: + 69:DE:B6:99:C4:95:F7:5A:FA:41:6B:4C:F6:C3:6D:89:AA:37:31:9D + X509v3 Authority Key Identifier: + keyid:BA:8D:A1:97:DC:C4:39:1F:90:B5:51:6B:10:19:F2:46:0D:A9:65:8E + DirName:/C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=Root 4 + serial:A2:93:46:74:3B:A6:E3:AD + + X509v3 Basic Constraints: critical + CA:TRUE + Signature Algorithm: sha1WithRSAEncryption + bc:cf:43:eb:72:b1:71:a7:94:8e:cd:5b:fc:d8:21:31:83:db: + a9:de:c7:5b:14:e5:7b:90:43:e6:05:df:db:6e:95:5f:24:ac: + 0c:a1:8a:ac:c6:cf:f2:03:cd:a0:30:ae:d3:a9:41:07:c9:b1: + be:4b:e0:fc:a2:76:09:07:75:6a:fa:e4:2f:a3:3a:cd:81:68: + ab:f6:06:c4:32:08:25:6e:e8:e7:36:9c:1a:f7:42:73:f8:b0: + d8:42:3e:85:c2:11:23:10:d6:6a:e4:8f:53:cb:8b:8b:1b:5a: + 4d:6d:9d:34:45:26:52:d2:ee:6d:8f:23:ff:00:92:f5:99:62: + 4c:41 +-----BEGIN CERTIFICATE----- +MIIDBjCCAm+gAwIBAgICEAEwDQYJKoZIhvcNAQEFBQAwXzELMAkGA1UEBhMCREUx +EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD +VQQLEwtEZXZlbG9wbWVudDEPMA0GA1UEAxMGUm9vdCA0MB4XDTA5MTEyMDA5MjIy +N1oXDTM0MTExNDA5MjIyN1owaDELMAkGA1UEBhMCREUxEDAOBgNVBAgTB0hhbWJ1 +cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtEZXZlbG9wbWVu +dDEYMBYGA1UEAxMPU3ViIENBIDIgUm9vdCA0MIGfMA0GCSqGSIb3DQEBAQUAA4GN +ADCBiQKBgQDljSdOCVMIYcYjJZ7dnAe/gThcXBCP5BIvTi6xoc8hRlO/6F7eFzqd +9+jvPpy0KTdMMTUV3Jjgk5zOatbhNRlr1B07gYax5/8fuDSp+d5NuGKsO9RYjlx2 +tQd/Moo6kHNx1drxeTkU7Rvxij6+SLwH7Pl8AxT851WjZYHHbHAL/wIDAQABo4HH +MIHEMB0GA1UdDgQWBBRp3raZxJX3WvpBa0z2w22JqjcxnTCBkQYDVR0jBIGJMIGG +gBS6jaGX3MQ5H5C1UWsQGfJGDalljqFjpGEwXzELMAkGA1UEBhMCREUxEDAOBgNV +BAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtE +ZXZlbG9wbWVudDEPMA0GA1UEAxMGUm9vdCA0ggkAopNGdDum460wDwYDVR0TAQH/ +BAUwAwEB/zANBgkqhkiG9w0BAQUFAAOBgQC8z0PrcrFxp5SOzVv82CExg9up3sdb +FOV7kEPmBd/bbpVfJKwMoYqsxs/yA82gMK7TqUEHybG+S+D8onYJB3Vq+uQvozrN +gWir9gbEMgglbujnNpwa90Jz+LDYQj6FwhEjENZq5I9Ty4uLG1pNbZ00RSZS0u5t +jyP/AJL1mWJMQQ== +-----END CERTIFICATE----- diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_4/demoCA/crlnumber b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_4/demoCA/crlnumber new file mode 100755 index 000000000000..dd11724042e2 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_4/demoCA/crlnumber @@ -0,0 +1 @@ +1001 diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_4/demoCA/index.txt b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_4/demoCA/index.txt new file mode 100755 index 000000000000..554a773b4a6d --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_4/demoCA/index.txt @@ -0,0 +1,2 @@ +V 341114093339Z 1001 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=User 1 Sub CA 2 Root 4 +R 341114095105Z 091120095246Z,keyCompromise 1002 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=User 2 Sub CA 2 Root 4 diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_4/demoCA/index.txt.attr b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_4/demoCA/index.txt.attr new file mode 100755 index 000000000000..8f7e63a3475c --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_4/demoCA/index.txt.attr @@ -0,0 +1 @@ +unique_subject = yes diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_4/demoCA/newcerts/1001.pem b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_4/demoCA/newcerts/1001.pem new file mode 100755 index 000000000000..3fbf2133fb9c --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_4/demoCA/newcerts/1001.pem @@ -0,0 +1,60 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 4097 (0x1001) + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Sub CA 2 Root 4 + Validity + Not Before: Nov 20 09:33:39 2009 GMT + Not After : Nov 14 09:33:39 2034 GMT + Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=User 1 Sub CA 2 Root 4 + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public Key: (1024 bit) + Modulus (1024 bit): + 00:c6:b2:8e:e4:f1:67:0b:07:3c:8c:b8:78:d9:79: + b1:2e:d5:10:c5:e8:76:9a:25:3f:dd:a3:0b:e0:3f: + 9f:50:87:e9:f1:15:74:86:ce:a0:01:07:b2:37:d0: + 74:dc:96:69:b4:f1:0e:cd:15:37:ca:ba:ed:ea:a3: + 99:ec:43:d4:ac:1c:8b:9b:18:d0:cd:80:78:49:80: + ca:e3:85:c6:2d:9a:15:02:73:d3:97:08:1d:4b:68: + 95:52:e6:92:57:c7:f6:76:0c:f1:a7:3d:90:10:0c: + 35:a8:9c:d3:e4:10:30:20:04:7f:ea:ad:ef:39:0c: + 65:05:43:f4:b6:51:3a:e7:95 + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Key Usage: + Digital Signature, Non Repudiation, Key Encipherment + Netscape Comment: + OpenSSL Generated Certificate + X509v3 Subject Key Identifier: + 79:C2:63:88:76:DF:C6:6F:BD:1D:AF:57:6E:87:08:AC:55:5D:AD:D1 + X509v3 Authority Key Identifier: + keyid:69:DE:B6:99:C4:95:F7:5A:FA:41:6B:4C:F6:C3:6D:89:AA:37:31:9D + + Signature Algorithm: sha1WithRSAEncryption + 07:68:5f:e9:01:bc:e4:d7:78:16:2b:19:7f:c2:9d:15:74:91: + ea:6d:fb:c9:ee:29:07:ff:62:e2:6a:85:5e:85:7d:5f:b4:bc: + 48:e1:89:24:3e:03:21:42:c1:10:3f:c6:41:7e:04:30:86:db: + c5:7e:7e:9f:04:49:a0:1e:fc:93:8e:b3:d1:cf:39:e3:41:89: + c3:06:51:3f:15:d5:02:49:2a:0b:15:d1:25:30:12:b6:2a:f9: + 03:06:f1:03:84:ae:4e:86:e1:dc:e6:a3:36:a4:27:24:2b:db: + 3a:3c:15:48:6f:c7:9f:ce:38:34:06:94:e3:d3:64:f7:4d:9e: + b6:c0 +-----BEGIN CERTIFICATE----- +MIICyzCCAjSgAwIBAgICEAEwDQYJKoZIhvcNAQEFBQAwaDELMAkGA1UEBhMCREUx +EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD +VQQLEwtEZXZlbG9wbWVudDEYMBYGA1UEAxMPU3ViIENBIDIgUm9vdCA0MB4XDTA5 +MTEyMDA5MzMzOVoXDTM0MTExNDA5MzMzOVowbzELMAkGA1UEBhMCREUxEDAOBgNV +BAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtE +ZXZlbG9wbWVudDEfMB0GA1UEAxMWVXNlciAxIFN1YiBDQSAyIFJvb3QgNDCBnzAN +BgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAxrKO5PFnCwc8jLh42XmxLtUQxeh2miU/ +3aML4D+fUIfp8RV0hs6gAQeyN9B03JZptPEOzRU3yrrt6qOZ7EPUrByLmxjQzYB4 +SYDK44XGLZoVAnPTlwgdS2iVUuaSV8f2dgzxpz2QEAw1qJzT5BAwIAR/6q3vOQxl +BUP0tlE655UCAwEAAaN9MHswCwYDVR0PBAQDAgXgMCwGCWCGSAGG+EIBDQQfFh1P +cGVuU1NMIEdlbmVyYXRlZCBDZXJ0aWZpY2F0ZTAdBgNVHQ4EFgQUecJjiHbfxm+9 +Ha9XbocIrFVdrdEwHwYDVR0jBBgwFoAUad62mcSV91r6QWtM9sNtiao3MZ0wDQYJ +KoZIhvcNAQEFBQADgYEAB2hf6QG85Nd4FisZf8KdFXSR6m37ye4pB/9i4mqFXoV9 +X7S8SOGJJD4DIULBED/GQX4EMIbbxX5+nwRJoB78k46z0c8540GJwwZRPxXVAkkq +CxXRJTAStir5AwbxA4SuTobh3OajNqQnJCvbOjwVSG/Hn844NAaU49Nk902etsA= +-----END CERTIFICATE----- diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_4/demoCA/newcerts/1002.pem b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_4/demoCA/newcerts/1002.pem new file mode 100755 index 000000000000..595fbbfafb1e --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_4/demoCA/newcerts/1002.pem @@ -0,0 +1,60 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 4098 (0x1002) + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Sub CA 2 Root 4 + Validity + Not Before: Nov 20 09:51:05 2009 GMT + Not After : Nov 14 09:51:05 2034 GMT + Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=User 2 Sub CA 2 Root 4 + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public Key: (1024 bit) + Modulus (1024 bit): + 00:f5:2d:4a:b8:5d:39:da:58:5c:3c:a5:7d:4c:98: + b8:32:db:43:a0:13:cb:25:f8:5b:0b:6a:f2:e0:8d: + de:8f:c6:ea:c5:1c:03:bf:e0:b1:c9:14:a4:85:4b: + ed:95:87:f7:88:88:86:9e:65:3d:6e:e8:c5:be:17: + e6:9b:09:8e:44:c1:0a:20:00:ae:b4:3d:ba:68:9f: + 3e:ea:76:3c:96:64:ee:a7:91:65:31:03:f5:fd:01: + e5:60:a0:5e:62:a0:37:7b:db:cf:71:78:58:cc:dd: + 74:fc:b3:b1:2e:6b:f3:ec:ad:ac:75:ae:d8:d6:42: + 28:0a:20:68:8d:20:4a:30:61 + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Key Usage: + Digital Signature, Non Repudiation, Key Encipherment + Netscape Comment: + OpenSSL Generated Certificate + X509v3 Subject Key Identifier: + 32:E4:11:DF:CD:54:D6:80:67:68:85:36:A0:C5:14:88:D6:85:DB:C9 + X509v3 Authority Key Identifier: + keyid:69:DE:B6:99:C4:95:F7:5A:FA:41:6B:4C:F6:C3:6D:89:AA:37:31:9D + + Signature Algorithm: sha1WithRSAEncryption + e1:c2:5d:63:42:27:f4:df:a2:f0:f5:61:c3:e3:ac:f7:b6:29: + a9:dd:34:63:0c:cc:c9:7b:5c:1b:ac:77:8f:1a:e1:f4:3b:c8: + 96:8a:89:f6:c0:f0:c4:3b:bd:6e:b7:e7:84:5c:38:4f:d3:66: + 55:d6:d3:f8:70:1f:14:ce:9f:d3:04:68:be:6b:81:fc:6c:b6: + 2f:31:3d:de:2a:4e:6c:66:c0:c2:09:c8:ef:be:c4:88:39:28: + e8:62:da:44:63:f4:5c:f4:bb:cf:4b:54:c9:c0:ce:b4:27:7b: + 1e:9c:2f:90:9e:18:da:8a:27:af:e5:37:ea:3f:99:86:f8:5d: + d1:cb +-----BEGIN CERTIFICATE----- +MIICyzCCAjSgAwIBAgICEAIwDQYJKoZIhvcNAQEFBQAwaDELMAkGA1UEBhMCREUx +EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD +VQQLEwtEZXZlbG9wbWVudDEYMBYGA1UEAxMPU3ViIENBIDIgUm9vdCA0MB4XDTA5 +MTEyMDA5NTEwNVoXDTM0MTExNDA5NTEwNVowbzELMAkGA1UEBhMCREUxEDAOBgNV +BAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtE +ZXZlbG9wbWVudDEfMB0GA1UEAxMWVXNlciAyIFN1YiBDQSAyIFJvb3QgNDCBnzAN +BgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA9S1KuF052lhcPKV9TJi4MttDoBPLJfhb +C2ry4I3ej8bqxRwDv+CxyRSkhUvtlYf3iIiGnmU9bujFvhfmmwmORMEKIACutD26 +aJ8+6nY8lmTup5FlMQP1/QHlYKBeYqA3e9vPcXhYzN10/LOxLmvz7K2sda7Y1kIo +CiBojSBKMGECAwEAAaN9MHswCwYDVR0PBAQDAgXgMCwGCWCGSAGG+EIBDQQfFh1P +cGVuU1NMIEdlbmVyYXRlZCBDZXJ0aWZpY2F0ZTAdBgNVHQ4EFgQUMuQR381U1oBn +aIU2oMUUiNaF28kwHwYDVR0jBBgwFoAUad62mcSV91r6QWtM9sNtiao3MZ0wDQYJ +KoZIhvcNAQEFBQADgYEA4cJdY0In9N+i8PVhw+Os97Ypqd00YwzMyXtcG6x3jxrh +9DvIloqJ9sDwxDu9brfnhFw4T9NmVdbT+HAfFM6f0wRovmuB/Gy2LzE93ipObGbA +wgnI777EiDko6GLaRGP0XPS7z0tUycDOtCd7HpwvkJ4Y2oonr+U36j+Zhvhd0cs= +-----END CERTIFICATE----- diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_4/demoCA/private/cakey.pem b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_4/demoCA/private/cakey.pem new file mode 100755 index 000000000000..a8f9640c8a3d --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_4/demoCA/private/cakey.pem @@ -0,0 +1,18 @@ +-----BEGIN RSA PRIVATE KEY----- +Proc-Type: 4,ENCRYPTED +DEK-Info: DES-EDE3-CBC,1BD121CFCC6764E4 + +k3SMhf7UEWvpfhEyvd7Zc6kJFmiZ1JTg7KAawQhFhoRbGIVA1rSmRbuBdJm4XdQ5 +OxEAC5bVx5o3yxyhGmEkZr1dkGXkzQ1tc2a4Exf2p0O5zjlHUaxd2A4/mRYVAT0e +LAIQ+D+yqSd2wmLkLaz3EGGlfIPS8amTpnhSOvai40NjbLlRpw5DqDP/2KVWp7jH +T4JNzU33Xd6QuBsTSWyXuhIEeuzyrDbou0LceHIZSaa8Jqvp3yKX6OBTUdCNakwR +QtLLag63ie87qEhqeHg2VvZuVVEyhNCjPf2zRfxsCx742wI4TyY28JpxjYlFzJxX +Zd9toqIGFwritEOcr6wAqVX7NlE8/dDFFdEK9fPuv/jLoOYCCwDRvIMgDTE76c1k +foRMDMmqe0KcMdp+fbcfNDnV/U8gle2902AbEOXJLhdDEVUG/LCwrnIeUrfMOKiY +LwPysGwVndUb3uTFJ2e+PqV9i96G+ewpN9/hI9fThE12t8rhkpIsozEMl7WsBMgD +tdKrA5l7eibshCpk+zkIwGhkdMYXhj7hmioWWBJeMdJ93Ba8f91kt1IvI+J2Mn2K +1/5D0ZKEGPoTSAlEgMZ888sYWkT6WMk0UXH2Nq8BqdrrSTUypY2Uz0nDbWvhLrCf +zac6RZu9TtFsKAY6CQnXHFUJ+dvRmcSNQMhrIKS2VZ2UkL2oXASzXW2c9Hx6LO7T +WHuR7bXZiJhI63gUGI9pMRCs5NoRuXdg3KutzSTy8EWKJDXDKcvTemiomUZFB6i5 +zduXL73Wf/VjMcs7iOAijd7czGre0LBwyvgeNUAK2gj7SaGkR3bPZg== +-----END RSA PRIVATE KEY----- diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_4/demoCA/serial b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_4/demoCA/serial new file mode 100755 index 000000000000..baccd0398f98 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_4/demoCA/serial @@ -0,0 +1 @@ +1003 diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_4/openssl.cfg b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_4/openssl.cfg new file mode 100755 index 000000000000..5f9493f47e9b --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_4/openssl.cfg @@ -0,0 +1,292 @@ +# +# OpenSSL example configuration file. +# This is mostly being used for generation of certificate requests. +# + +# This definition stops the following lines choking if HOME isn't +# defined. +HOME = . +RANDFILE = $ENV::HOME/.rnd + +# Extra OBJECT IDENTIFIER info: +#oid_file = $ENV::HOME/.oid +oid_section = new_oids + +# To use this configuration file with the "-extfile" option of the +# "openssl x509" utility, name here the section containing the +# X.509v3 extensions to use: +# extensions = +# (Alternatively, use a configuration file that has only +# X.509v3 extensions in its main [= default] section.) + +[ new_oids ] + +# We can add new OIDs in here for use by 'ca' and 'req'. +# Add a simple OID like this: +# testoid1=1.2.3.4 +# Or use config file substitution like this: +# testoid2=${testoid1}.5.6 + +#################################################################### +[ ca ] +default_ca = CA_default # The default ca section + +#################################################################### +[ CA_default ] + +dir = ./demoCA # Where everything is kept +certs = $dir/certs # Where the issued certs are kept +crl_dir = $dir/crl # Where the issued crl are kept +database = $dir/index.txt # database index file. +#unique_subject = no # Set to 'no' to allow creation of + # several ctificates with same subject. +new_certs_dir = $dir/newcerts # default place for new certs. + +certificate = $dir/cacert.pem # The CA certificate +serial = $dir/serial # The current serial number +crlnumber = $dir/crlnumber # the current crl number + # must be commented out to leave a V1 CRL +crl = $dir/crl.pem # The current CRL +private_key = $dir/private/cakey.pem # The private key +RANDFILE = $dir/private/.rand # private random number file + +x509_extensions = usr_cert # The extentions to add to the cert + +# Comment out the following two lines for the "traditional" +# (and highly broken) format. +name_opt = ca_default # Subject Name options +cert_opt = ca_default # Certificate field options + +# Extension copying option: use with caution. +# copy_extensions = copy + +# Extensions to add to a CRL. Note: Netscape communicator chokes on V2 CRLs +# so this is commented out by default to leave a V1 CRL. +# crlnumber must also be commented out to leave a V1 CRL. +# crl_extensions = crl_ext + +default_days = 365 # how long to certify for +default_crl_days= 30 # how long before next CRL +default_md = sha1 # which md to use. +preserve = no # keep passed DN ordering + +# A few difference way of specifying how similar the request should look +# For type CA, the listed attributes must be the same, and the optional +# and supplied fields are just that :-) +policy = policy_match + +# For the CA policy +[ policy_match ] +countryName = match +stateOrProvinceName = match +organizationName = match +organizationalUnitName = optional +commonName = supplied +emailAddress = optional + +# For the 'anything' policy +# At this point in time, you must list all acceptable 'object' +# types. +[ policy_anything ] +countryName = optional +stateOrProvinceName = optional +localityName = optional +organizationName = optional +organizationalUnitName = optional +commonName = supplied +emailAddress = optional + +#################################################################### +[ req ] +default_bits = 1024 +default_keyfile = privkey.pem +distinguished_name = req_distinguished_name +attributes = req_attributes +x509_extensions = v3_ca # The extentions to add to the self signed cert + +# Passwords for private keys if not present they will be prompted for +# input_password = secret +# output_password = secret + +# This sets a mask for permitted string types. There are several options. +# default: PrintableString, T61String, BMPString. +# pkix : PrintableString, BMPString. +# utf8only: only UTF8Strings. +# nombstr : PrintableString, T61String (no BMPStrings or UTF8Strings). +# MASK:XXXX a literal mask value. +# WARNING: current versions of Netscape crash on BMPStrings or UTF8Strings +# so use this option with caution! +string_mask = nombstr + +# req_extensions = v3_req # The extensions to add to a certificate request + +[ req_distinguished_name ] +countryName = Country Name (2 letter code) +countryName_default = DE +countryName_min = 2 +countryName_max = 2 + +stateOrProvinceName = State or Province Name (full name) +stateOrProvinceName_default = Hamburg + +localityName = Locality Name (eg, city) + +0.organizationName = Organization Name (eg, company) +0.organizationName_default = OpenOffice.org + +# we can do this but it is not needed normally :-) +#1.organizationName = Second Organization Name (eg, company) +#1.organizationName_default = World Wide Web Pty Ltd + +organizationalUnitName = Organizational Unit Name (eg, section) +organizationalUnitName_default = Development + +commonName = Common Name (eg, YOUR name) +commonName_max = 64 + +emailAddress = Email Address +emailAddress_max = 64 + +# SET-ex3 = SET extension number 3 + +[ req_attributes ] +challengePassword = A challenge password +challengePassword_min = 4 +challengePassword_max = 20 + +unstructuredName = An optional company name + +[ usr_cert ] + +# These extensions are added when 'ca' signs a request. +#authorityInfoAccess = OCSP;URI:http://localhost:8888/ + +# This is typical in keyUsage for a client certificate. +keyUsage = nonRepudiation, digitalSignature, keyEncipherment + +# This will be displayed in Netscape's comment listbox. +nsComment = "OpenSSL Generated Certificate" + +# PKIX recommendations harmless if included in all certificates. +subjectKeyIdentifier=hash +authorityKeyIdentifier=keyid,issuer + +# This stuff is for subjectAltName and issuerAltname. +# Import the email address. +# subjectAltName=email:copy +# An alternative to produce certificates that aren't +# deprecated according to PKIX. +# subjectAltName=email:move + +# Copy subject details +# issuerAltName=issuer:copy + + + +[ v3_req ] + +# Extensions to add to a certificate request + +basicConstraints = CA:FALSE +keyUsage = nonRepudiation, digitalSignature, keyEncipherment +#authorityInfoAccess = OCSP;URI:http://localhost:8888/ + +[ v3_ca ] + + +# Extensions for a typical CA + + +# PKIX recommendation. + +subjectKeyIdentifier=hash + +authorityKeyIdentifier=keyid:always,issuer:always + +#authorityInfoAccess = OCSP;URI:http://localhost:8888 +#crlDistributionPoints=URI:http://localhost:8901/demoCA/crl/Test_CA_2009.2.crl +# This is what PKIX recommends but some broken software chokes on critical +# extensions. +#basicConstraints = critical,CA:true +# So we do this instead. +basicConstraints = critical, CA:true + +# Key usage: this is typical for a CA certificate. However since it will +# prevent it being used as an test self-signed certificate it is best +# left out by default. +# keyUsage = cRLSign, keyCertSign + +# Some might want this also +# nsCertType = sslCA, emailCA + +# Include email address in subject alt name: another PKIX recommendation +# subjectAltName=email:copy +# Copy issuer details +# issuerAltName=issuer:copy + +# DER hex encoding of an extension: beware experts only! +# obj=DER:02:03 +# Where 'obj' is a standard or added object +# You can even override a supported extension: +# basicConstraints= critical, DER:30:03:01:01:FF + +[ crl_ext ] + +# CRL extensions. +# Only issuerAltName and authorityKeyIdentifier make any sense in a CRL. + +# issuerAltName=issuer:copy +authorityKeyIdentifier=keyid:always,issuer:always + +[ proxy_cert_ext ] +# These extensions should be added when creating a proxy certificate + +# This goes against PKIX guidelines but some CAs do it and some software +# requires this to avoid interpreting an end user certificate as a CA. + +basicConstraints=CA:FALSE + +# Here are some examples of the usage of nsCertType. If it is omitted +# the certificate can be used for anything *except* object signing. + +# This is OK for an SSL server. +# nsCertType = server + +# For an object signing certificate this would be used. +# nsCertType = objsign + +# For normal client use this is typical +# nsCertType = client, email + +# and for everything including object signing: +# nsCertType = client, email, objsign + +# This is typical in keyUsage for a client certificate. +# keyUsage = nonRepudiation, digitalSignature, keyEncipherment + +# This will be displayed in Netscape's comment listbox. +nsComment = "OpenSSL Generated Certificate" + +# PKIX recommendations harmless if included in all certificates. +subjectKeyIdentifier=hash +authorityKeyIdentifier=keyid,issuer:always + +# This stuff is for subjectAltName and issuerAltname. +# Import the email address. +# subjectAltName=email:copy +# An alternative to produce certificates that aren't +# deprecated according to PKIX. +# subjectAltName=email:move + +# Copy subject details +# issuerAltName=issuer:copy + +#nsCaRevocationUrl = http://www.domain.dom/ca-crl.pem +#nsBaseUrl +#nsRevocationUrl +#nsRenewalUrl +#nsCaPolicyUrl +#nsSslServerName + +# This really needs to be in place for it to be a proxy certificate. +proxyCertInfo=critical,language:id-ppl-anyLanguage,pathlen:3,policy:foo diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_7/README.txt b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_7/README.txt new file mode 100755 index 000000000000..e04f69532d14 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_7/README.txt @@ -0,0 +1,12 @@ +Revoked certificates: + +- User 2 Sub 2 Root 7 + + +To provide the CRL via HTTP run + +java -jar ../../tools/httpserv/dist/httpserv.jar -a 8902 + + + + diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_7/demoCA/cacert.pem b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_7/demoCA/cacert.pem new file mode 100755 index 000000000000..0d2a0f02a3eb --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_7/demoCA/cacert.pem @@ -0,0 +1,66 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 4097 (0x1001) + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 7 + Validity + Not Before: Nov 20 13:35:06 2009 GMT + Not After : Nov 14 13:35:06 2034 GMT + Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Sub CA 2 Root 7 + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public Key: (1024 bit) + Modulus (1024 bit): + 00:f9:3f:5e:76:52:9a:ce:5d:98:b0:00:d8:e0:65: + e7:78:11:4c:7b:c7:e2:d3:44:bf:8e:60:42:69:3e: + 75:67:65:24:ab:f7:07:d8:9d:be:0f:23:b5:c1:26: + 00:6b:c3:22:84:72:a9:96:dc:5f:63:fc:f5:e0:e3: + cc:da:0c:74:e9:31:51:91:89:27:8f:e5:17:41:6e: + 3d:5e:2a:13:cd:08:f7:f3:61:34:a1:f7:79:c6:bd: + 5d:2c:34:01:ea:5a:8c:48:97:36:d6:57:e0:80:03: + 2e:7a:03:83:4c:bd:b4:af:a2:fd:d7:4b:1a:f7:ab: + 9f:5a:22:2b:d1:25:73:dd:6f + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Subject Key Identifier: + 3B:50:26:45:6C:E2:FE:28:B1:71:0A:A8:95:2D:78:63:8E:2C:48:92 + X509v3 Authority Key Identifier: + keyid:80:C6:F8:0B:5F:7C:49:E4:86:FD:C8:92:C6:80:70:D9:C0:6F:7B:DE + DirName:/C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=Root 7 + serial:D5:E6:63:5F:18:09:82:89 + + X509v3 CRL Distribution Points: + URI:http://localhost:8901/demoCA/crl/Root_7.crl + + X509v3 Basic Constraints: critical + CA:TRUE + Signature Algorithm: sha1WithRSAEncryption + 5f:b4:70:11:4f:d9:df:6a:6a:5a:4a:97:fe:8b:5d:9e:46:84: + e2:27:67:41:7c:a9:2e:9d:77:cc:e4:8c:d6:16:3c:39:7d:51: + 29:60:80:32:4f:a1:d0:b4:7f:2a:e5:60:f4:b8:d3:3b:94:f8: + a5:fb:15:99:cf:a9:c5:a7:59:c1:11:89:67:11:9c:ff:a9:ac: + dd:ca:a9:92:a8:60:26:c3:ab:74:41:86:b9:4d:1e:4a:c5:de: + 63:e6:da:2a:36:39:7b:6c:66:f3:20:57:d1:f1:36:4b:69:c5: + 04:a3:1f:cf:de:0c:10:d0:3f:07:e2:8e:0f:cd:41:26:c9:2e: + e9:1b +-----BEGIN CERTIFICATE----- +MIIDRjCCAq+gAwIBAgICEAEwDQYJKoZIhvcNAQEFBQAwXzELMAkGA1UEBhMCREUx +EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD +VQQLEwtEZXZlbG9wbWVudDEPMA0GA1UEAxMGUm9vdCA3MB4XDTA5MTEyMDEzMzUw +NloXDTM0MTExNDEzMzUwNlowaDELMAkGA1UEBhMCREUxEDAOBgNVBAgTB0hhbWJ1 +cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtEZXZlbG9wbWVu +dDEYMBYGA1UEAxMPU3ViIENBIDIgUm9vdCA3MIGfMA0GCSqGSIb3DQEBAQUAA4GN +ADCBiQKBgQD5P152UprOXZiwANjgZed4EUx7x+LTRL+OYEJpPnVnZSSr9wfYnb4P +I7XBJgBrwyKEcqmW3F9j/PXg48zaDHTpMVGRiSeP5RdBbj1eKhPNCPfzYTSh93nG +vV0sNAHqWoxIlzbWV+CAAy56A4NMvbSvov3XSxr3q59aIivRJXPdbwIDAQABo4IB +BjCCAQIwHQYDVR0OBBYEFDtQJkVs4v4osXEKqJUteGOOLEiSMIGRBgNVHSMEgYkw +gYaAFIDG+AtffEnkhv3IksaAcNnAb3veoWOkYTBfMQswCQYDVQQGEwJERTEQMA4G +A1UECBMHSGFtYnVyZzEXMBUGA1UEChMOT3Blbk9mZmljZS5vcmcxFDASBgNVBAsT +C0RldmVsb3BtZW50MQ8wDQYDVQQDEwZSb290IDeCCQDV5mNfGAmCiTA8BgNVHR8E +NTAzMDGgL6AthitodHRwOi8vbG9jYWxob3N0Ojg5MDEvZGVtb0NBL2NybC9Sb290 +XzcuY3JsMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEFBQADgYEAX7RwEU/Z +32pqWkqX/otdnkaE4idnQXypLp13zOSM1hY8OX1RKWCAMk+h0LR/KuVg9LjTO5T4 +pfsVmc+pxadZwRGJZxGc/6ms3cqpkqhgJsOrdEGGuU0eSsXeY+baKjY5e2xm8yBX +0fE2S2nFBKMfz94MENA/B+KOD81BJsku6Rs= +-----END CERTIFICATE----- diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_7/demoCA/crl/DO_NOT_INSTALL_THIS_CRL b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_7/demoCA/crl/DO_NOT_INSTALL_THIS_CRL new file mode 100755 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_7/demoCA/crl/DO_NOT_INSTALL_THIS_CRL diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_7/demoCA/crl/Sub_CA_2_Root_7.crl b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_7/demoCA/crl/Sub_CA_2_Root_7.crl Binary files differnew file mode 100755 index 000000000000..c4dd13d8390d --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_7/demoCA/crl/Sub_CA_2_Root_7.crl diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_7/demoCA/crlnumber b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_7/demoCA/crlnumber new file mode 100755 index 000000000000..dd11724042e2 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_7/demoCA/crlnumber @@ -0,0 +1 @@ +1001 diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_7/demoCA/index.txt b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_7/demoCA/index.txt new file mode 100755 index 000000000000..a5e282ddd15e --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_7/demoCA/index.txt @@ -0,0 +1,2 @@ +V 341114134608Z 1000 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=User 1 Sub CA 2 Root 7 +R 341114135230Z 091120135413Z,CACompromise 1001 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=User 2 Sub CA 2 Root 7 diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_7/demoCA/index.txt.attr b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_7/demoCA/index.txt.attr new file mode 100755 index 000000000000..8f7e63a3475c --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_7/demoCA/index.txt.attr @@ -0,0 +1 @@ +unique_subject = yes diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_7/demoCA/newcerts/1000.pem b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_7/demoCA/newcerts/1000.pem new file mode 100755 index 000000000000..ff1f1fa667a8 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_7/demoCA/newcerts/1000.pem @@ -0,0 +1,62 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 4096 (0x1000) + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Sub CA 2 Root 7 + Validity + Not Before: Nov 20 13:46:08 2009 GMT + Not After : Nov 14 13:46:08 2034 GMT + Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=User 1 Sub CA 2 Root 7 + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public Key: (1024 bit) + Modulus (1024 bit): + 00:a7:6b:af:a2:6e:61:33:2e:71:7b:e2:38:44:d9: + 4c:da:6e:86:bb:c6:f5:64:8e:2e:8b:e8:71:c8:46: + ad:c5:46:05:d2:06:a6:89:e2:ce:1f:1c:a7:4c:94: + a4:24:56:93:07:b1:c4:52:44:69:27:0b:34:eb:31: + 20:71:63:5c:0a:33:aa:0c:39:71:ac:08:49:c3:66: + ac:cb:e3:a8:66:ab:5c:a2:00:7a:bb:24:e6:93:91: + 1e:0e:7c:83:9e:f2:10:87:3f:0e:c0:f6:e5:bf:2c: + d3:cc:17:4c:d5:9a:96:35:4b:4e:ca:72:3a:9b:90: + c8:4c:24:04:2f:51:99:20:95 + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 CRL Distribution Points: + URI:http://localhost:8902/demoCA/crl/Sub_CA_2_Root_7.crl + + X509v3 Key Usage: + Digital Signature, Non Repudiation, Key Encipherment + X509v3 Subject Key Identifier: + 27:98:7E:F6:AD:82:6D:F4:7A:32:AE:F1:54:D1:07:AE:08:0E:0E:2B + X509v3 Authority Key Identifier: + keyid:3B:50:26:45:6C:E2:FE:28:B1:71:0A:A8:95:2D:78:63:8E:2C:48:92 + + Signature Algorithm: sha1WithRSAEncryption + 06:7d:0a:e8:fa:8b:87:1d:75:61:2b:c7:d1:6d:56:5f:26:e3: + 29:b4:c3:27:05:35:0f:b7:c1:20:42:95:0b:9d:34:16:5d:9b: + c2:48:c8:67:e1:e7:43:eb:10:9e:45:3e:44:da:7c:4b:19:05: + 00:66:91:83:ea:82:86:48:e8:87:ea:a0:9f:c9:1d:f8:af:13: + fd:2e:4e:50:7e:a0:d2:b0:5e:a4:6f:dd:e6:c8:11:60:bc:41: + e5:b6:01:4c:7a:af:32:f6:cc:5b:57:e6:e4:87:21:ec:17:98: + 67:eb:4d:2f:07:db:8f:70:e2:f3:77:8f:c7:ff:60:d6:d9:f7: + 82:e3 +-----BEGIN CERTIFICATE----- +MIIC5jCCAk+gAwIBAgICEAAwDQYJKoZIhvcNAQEFBQAwaDELMAkGA1UEBhMCREUx +EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD +VQQLEwtEZXZlbG9wbWVudDEYMBYGA1UEAxMPU3ViIENBIDIgUm9vdCA3MB4XDTA5 +MTEyMDEzNDYwOFoXDTM0MTExNDEzNDYwOFowbzELMAkGA1UEBhMCREUxEDAOBgNV +BAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtE +ZXZlbG9wbWVudDEfMB0GA1UEAxMWVXNlciAxIFN1YiBDQSAyIFJvb3QgNzCBnzAN +BgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAp2uvom5hMy5xe+I4RNlM2m6Gu8b1ZI4u +i+hxyEatxUYF0gamieLOHxynTJSkJFaTB7HEUkRpJws06zEgcWNcCjOqDDlxrAhJ +w2asy+OoZqtcogB6uyTmk5EeDnyDnvIQhz8OwPblvyzTzBdM1ZqWNUtOynI6m5DI +TCQEL1GZIJUCAwEAAaOBlzCBlDBFBgNVHR8EPjA8MDqgOKA2hjRodHRwOi8vbG9j +YWxob3N0Ojg5MDIvZGVtb0NBL2NybC9TdWJfQ0FfMl9Sb290XzcuY3JsMAsGA1Ud +DwQEAwIF4DAdBgNVHQ4EFgQUJ5h+9q2CbfR6Mq7xVNEHrggODiswHwYDVR0jBBgw +FoAUO1AmRWzi/iixcQqolS14Y44sSJIwDQYJKoZIhvcNAQEFBQADgYEABn0K6PqL +hx11YSvH0W1WXybjKbTDJwU1D7fBIEKVC500Fl2bwkjIZ+HnQ+sQnkU+RNp8SxkF +AGaRg+qChkjoh+qgn8kd+K8T/S5OUH6g0rBepG/d5sgRYLxB5bYBTHqvMvbMW1fm +5Ich7BeYZ+tNLwfbj3Di83ePx/9g1tn3guM= +-----END CERTIFICATE----- diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_7/demoCA/newcerts/1001.pem b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_7/demoCA/newcerts/1001.pem new file mode 100755 index 000000000000..f16cdf4aab53 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_7/demoCA/newcerts/1001.pem @@ -0,0 +1,62 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 4097 (0x1001) + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Sub CA 2 Root 7 + Validity + Not Before: Nov 20 13:52:30 2009 GMT + Not After : Nov 14 13:52:30 2034 GMT + Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=User 2 Sub CA 2 Root 7 + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public Key: (1024 bit) + Modulus (1024 bit): + 00:d3:1f:7e:28:b6:fd:f0:bb:01:21:88:04:c4:da: + 3d:6a:ce:09:8e:04:29:a5:0f:38:db:74:d0:ee:ad: + 5c:95:79:16:11:c0:b1:51:69:95:bb:a8:8f:8b:1c: + 7b:8c:82:27:16:21:82:82:d7:36:6f:b3:bb:36:a8: + ad:69:e2:e3:cd:6f:ef:81:ac:fa:e3:a9:ac:86:b7: + 31:1d:75:11:a3:2e:1d:89:0b:9c:5e:03:45:7a:b0: + a9:9d:ee:31:f1:15:c1:c5:f6:26:8e:d4:89:72:8f: + f4:86:94:d1:49:37:24:56:84:10:db:cc:f2:1d:3e: + 58:66:97:b2:17:6f:15:cb:81 + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 CRL Distribution Points: + URI:http://localhost:8902/demoCA/crl/Sub_CA_2_Root_7.crl + + X509v3 Key Usage: + Digital Signature, Non Repudiation, Key Encipherment + X509v3 Subject Key Identifier: + CD:A2:AE:51:D0:CF:A2:89:3A:53:23:74:1D:69:10:EE:2A:40:3A:22 + X509v3 Authority Key Identifier: + keyid:3B:50:26:45:6C:E2:FE:28:B1:71:0A:A8:95:2D:78:63:8E:2C:48:92 + + Signature Algorithm: sha1WithRSAEncryption + 40:8a:be:55:1f:d9:0f:96:fd:54:dd:9f:6b:1d:b1:34:ed:b7: + 11:6d:72:a9:65:9a:39:bd:79:3b:d3:4e:0c:22:60:39:e8:c0: + 2c:34:64:09:2c:0c:aa:f7:f9:9d:f1:d9:b9:04:d6:e2:c4:cb: + d5:05:33:75:5e:87:c0:2c:80:06:8b:6e:9c:ad:0c:7f:03:c0: + f5:91:e4:3a:64:b9:52:3b:5a:e0:e5:79:32:89:fb:4a:54:68: + 9a:e6:72:3e:61:93:a3:2a:67:aa:95:d0:3d:37:33:5c:da:6e: + a6:ac:3d:b6:b1:ac:68:f0:8c:8b:6b:96:a5:f7:ed:2d:6e:64: + c7:11 +-----BEGIN CERTIFICATE----- +MIIC5jCCAk+gAwIBAgICEAEwDQYJKoZIhvcNAQEFBQAwaDELMAkGA1UEBhMCREUx +EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD +VQQLEwtEZXZlbG9wbWVudDEYMBYGA1UEAxMPU3ViIENBIDIgUm9vdCA3MB4XDTA5 +MTEyMDEzNTIzMFoXDTM0MTExNDEzNTIzMFowbzELMAkGA1UEBhMCREUxEDAOBgNV +BAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtE +ZXZlbG9wbWVudDEfMB0GA1UEAxMWVXNlciAyIFN1YiBDQSAyIFJvb3QgNzCBnzAN +BgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA0x9+KLb98LsBIYgExNo9as4JjgQppQ84 +23TQ7q1clXkWEcCxUWmVu6iPixx7jIInFiGCgtc2b7O7NqitaeLjzW/vgaz646ms +hrcxHXURoy4diQucXgNFerCpne4x8RXBxfYmjtSJco/0hpTRSTckVoQQ28zyHT5Y +ZpeyF28Vy4ECAwEAAaOBlzCBlDBFBgNVHR8EPjA8MDqgOKA2hjRodHRwOi8vbG9j +YWxob3N0Ojg5MDIvZGVtb0NBL2NybC9TdWJfQ0FfMl9Sb290XzcuY3JsMAsGA1Ud +DwQEAwIF4DAdBgNVHQ4EFgQUzaKuUdDPook6UyN0HWkQ7ipAOiIwHwYDVR0jBBgw +FoAUO1AmRWzi/iixcQqolS14Y44sSJIwDQYJKoZIhvcNAQEFBQADgYEAQIq+VR/Z +D5b9VN2fax2xNO23EW1yqWWaOb15O9NODCJgOejALDRkCSwMqvf5nfHZuQTW4sTL +1QUzdV6HwCyABotunK0MfwPA9ZHkOmS5Ujta4OV5Mon7SlRomuZyPmGToypnqpXQ +PTczXNpupqw9trGsaPCMi2uWpfftLW5kxxE= +-----END CERTIFICATE----- diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_7/demoCA/private/cakey.pem b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_7/demoCA/private/cakey.pem new file mode 100755 index 000000000000..1f95ffa3c3f3 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_7/demoCA/private/cakey.pem @@ -0,0 +1,18 @@ +-----BEGIN RSA PRIVATE KEY----- +Proc-Type: 4,ENCRYPTED +DEK-Info: DES-EDE3-CBC,70BBA561902B1296 + ++Pbay3A7tcxOMNFXIlyQ6Hpl4QxJJmzZzXT5UOfGZYYRYrFKv1489pqvzLNgp06z +nWvyILc3AUd4dWnzfkWvPN3fjJazGWXoZaYLfGgdccA0LdXh+TmqVHHxFjOZVFeO +lYlKqK6dUsybaciOhkYBKPs1ZFAaNtQLZc1/GVAA9jVYnfwNVmW14d5Q8gurZTp8 +qYwQmT9Sjm2j9USIFcD9MDH94gW77PI+XD1hu6PJTF8m7n8eSY9KcWfVmd/Qj9Ly +nzLRaS6SOKETWL4+fUaN6aDtddKGwFgagyDwlRRuizX18ZSue2qoK73AhLtZ8Gx/ +vgFLTsvcniZus9kzVrRm2dsWvzaVAmOwqN04IqD6bEr+kXq1obP/T+deGsRwR54K +wEy7NrkkMSGw4AOuxVNSO7NYgU2kXueAfvGU8SQiXuU1S7fdZpWci8T5Dm7FuP9B +iKsHqUH9GYgAVl+Y3dwa9n+mDaFkn4wxeVHDdL40XJT0LYCMz9PGKRy3JSTiHF// +j9BHDpIC+E8L9N01cJ74+p0bzLLOhZ7vyjx8umVJbNIAAlDbCrEi4ZFqwGvmdjHF +2dti2S0ALixAFQybub4s9Cp3QxfaWnYQOvV7A0SGhtHkjycaJwO0cSonQ8yEjJJJ +PQkIW9SK+xz/yDYMHqa/Yo5t53GkpCTKBo2STSdnXjnABNk3FAusf72POkIPcH99 +5uyje8bo+lS2VB/O/pm8tbf9mW9YEh/xd3VAglWiAMzYSfO1x0rSTpdqJMSDfOhK +ogim9NdrVwASi0JrE8nCovwO3auOPu+5sRvYstnt18IVNisZZoW/Qg== +-----END RSA PRIVATE KEY----- diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_7/demoCA/serial b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_7/demoCA/serial new file mode 100755 index 000000000000..7d802a3e7104 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_7/demoCA/serial @@ -0,0 +1 @@ +1002 diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_7/openssl.cfg b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_7/openssl.cfg new file mode 100755 index 000000000000..a0556456eaf7 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_7/openssl.cfg @@ -0,0 +1,292 @@ +# +# OpenSSL example configuration file. +# This is mostly being used for generation of certificate requests. +# + +# This definition stops the following lines choking if HOME isn't +# defined. +HOME = . +RANDFILE = $ENV::HOME/.rnd + +# Extra OBJECT IDENTIFIER info: +#oid_file = $ENV::HOME/.oid +oid_section = new_oids + +# To use this configuration file with the "-extfile" option of the +# "openssl x509" utility, name here the section containing the +# X.509v3 extensions to use: +# extensions = +# (Alternatively, use a configuration file that has only +# X.509v3 extensions in its main [= default] section.) + +[ new_oids ] + +# We can add new OIDs in here for use by 'ca' and 'req'. +# Add a simple OID like this: +# testoid1=1.2.3.4 +# Or use config file substitution like this: +# testoid2=${testoid1}.5.6 + +#################################################################### +[ ca ] +default_ca = CA_default # The default ca section + +#################################################################### +[ CA_default ] + +dir = ./demoCA # Where everything is kept +certs = $dir/certs # Where the issued certs are kept +crl_dir = $dir/crl # Where the issued crl are kept +database = $dir/index.txt # database index file. +#unique_subject = no # Set to 'no' to allow creation of + # several ctificates with same subject. +new_certs_dir = $dir/newcerts # default place for new certs. + +certificate = $dir/cacert.pem # The CA certificate +serial = $dir/serial # The current serial number +crlnumber = $dir/crlnumber # the current crl number + # must be commented out to leave a V1 CRL +crl = $dir/crl.pem # The current CRL +private_key = $dir/private/cakey.pem # The private key +RANDFILE = $dir/private/.rand # private random number file + +x509_extensions = usr_cert # The extentions to add to the cert + +# Comment out the following two lines for the "traditional" +# (and highly broken) format. +name_opt = ca_default # Subject Name options +cert_opt = ca_default # Certificate field options + +# Extension copying option: use with caution. +# copy_extensions = copy + +# Extensions to add to a CRL. Note: Netscape communicator chokes on V2 CRLs +# so this is commented out by default to leave a V1 CRL. +# crlnumber must also be commented out to leave a V1 CRL. +# crl_extensions = crl_ext + +default_days = 365 # how long to certify for +default_crl_days= 30 # how long before next CRL +default_md = sha1 # which md to use. +preserve = no # keep passed DN ordering + +# A few difference way of specifying how similar the request should look +# For type CA, the listed attributes must be the same, and the optional +# and supplied fields are just that :-) +policy = policy_match + +# For the CA policy +[ policy_match ] +countryName = match +stateOrProvinceName = match +organizationName = match +organizationalUnitName = optional +commonName = supplied +emailAddress = optional + +# For the 'anything' policy +# At this point in time, you must list all acceptable 'object' +# types. +[ policy_anything ] +countryName = optional +stateOrProvinceName = optional +localityName = optional +organizationName = optional +organizationalUnitName = optional +commonName = supplied +emailAddress = optional + +#################################################################### +[ req ] +default_bits = 1024 +default_keyfile = privkey.pem +distinguished_name = req_distinguished_name +attributes = req_attributes +x509_extensions = v3_ca # The extentions to add to the self signed cert + +# Passwords for private keys if not present they will be prompted for +# input_password = secret +# output_password = secret + +# This sets a mask for permitted string types. There are several options. +# default: PrintableString, T61String, BMPString. +# pkix : PrintableString, BMPString. +# utf8only: only UTF8Strings. +# nombstr : PrintableString, T61String (no BMPStrings or UTF8Strings). +# MASK:XXXX a literal mask value. +# WARNING: current versions of Netscape crash on BMPStrings or UTF8Strings +# so use this option with caution! +string_mask = nombstr + +# req_extensions = v3_req # The extensions to add to a certificate request + +[ req_distinguished_name ] +countryName = Country Name (2 letter code) +countryName_default = DE +countryName_min = 2 +countryName_max = 2 + +stateOrProvinceName = State or Province Name (full name) +stateOrProvinceName_default = Hamburg + +localityName = Locality Name (eg, city) + +0.organizationName = Organization Name (eg, company) +0.organizationName_default = OpenOffice.org + +# we can do this but it is not needed normally :-) +#1.organizationName = Second Organization Name (eg, company) +#1.organizationName_default = World Wide Web Pty Ltd + +organizationalUnitName = Organizational Unit Name (eg, section) +organizationalUnitName_default = Development + +commonName = Common Name (eg, YOUR name) +commonName_max = 64 + +emailAddress = Email Address +emailAddress_max = 64 + +# SET-ex3 = SET extension number 3 + +[ req_attributes ] +challengePassword = A challenge password +challengePassword_min = 4 +challengePassword_max = 20 + +unstructuredName = An optional company name + +[ usr_cert ] + +# These extensions are added when 'ca' signs a request. +#authorityInfoAccess = OCSP;URI:http://localhost:8888/ +crlDistributionPoints=URI:http://localhost:8902/demoCA/crl/Sub_CA_2_Root_7.crl +# This is typical in keyUsage for a client certificate. +keyUsage = nonRepudiation, digitalSignature, keyEncipherment + +# This will be displayed in Netscape's comment listbox. +#nsComment = "OpenSSL Generated Certificate" + +# PKIX recommendations harmless if included in all certificates. +subjectKeyIdentifier=hash +authorityKeyIdentifier=keyid,issuer + +# This stuff is for subjectAltName and issuerAltname. +# Import the email address. +# subjectAltName=email:copy +# An alternative to produce certificates that aren't +# deprecated according to PKIX. +# subjectAltName=email:move + +# Copy subject details +# issuerAltName=issuer:copy + + + +[ v3_req ] + +# Extensions to add to a certificate request + +basicConstraints = CA:FALSE +keyUsage = nonRepudiation, digitalSignature, keyEncipherment +#authorityInfoAccess = OCSP;URI:http://localhost:8888/ + +[ v3_ca ] + + +# Extensions for a typical CA + + +# PKIX recommendation. + +subjectKeyIdentifier=hash + +authorityKeyIdentifier=keyid:always,issuer:always + +#authorityInfoAccess = OCSP;URI:http://localhost:8888 +#crlDistributionPoints=URI:http://localhost:8901/demoCA/crl/Test_CA_2009.2.crl +# This is what PKIX recommends but some broken software chokes on critical +# extensions. +#basicConstraints = critical,CA:true +# So we do this instead. +basicConstraints = critical, CA:true + +# Key usage: this is typical for a CA certificate. However since it will +# prevent it being used as an test self-signed certificate it is best +# left out by default. +# keyUsage = cRLSign, keyCertSign + +# Some might want this also +# nsCertType = sslCA, emailCA + +# Include email address in subject alt name: another PKIX recommendation +# subjectAltName=email:copy +# Copy issuer details +# issuerAltName=issuer:copy + +# DER hex encoding of an extension: beware experts only! +# obj=DER:02:03 +# Where 'obj' is a standard or added object +# You can even override a supported extension: +# basicConstraints= critical, DER:30:03:01:01:FF + +[ crl_ext ] + +# CRL extensions. +# Only issuerAltName and authorityKeyIdentifier make any sense in a CRL. + +# issuerAltName=issuer:copy +authorityKeyIdentifier=keyid:always,issuer:always + +[ proxy_cert_ext ] +# These extensions should be added when creating a proxy certificate + +# This goes against PKIX guidelines but some CAs do it and some software +# requires this to avoid interpreting an end user certificate as a CA. + +basicConstraints=CA:FALSE + +# Here are some examples of the usage of nsCertType. If it is omitted +# the certificate can be used for anything *except* object signing. + +# This is OK for an SSL server. +# nsCertType = server + +# For an object signing certificate this would be used. +# nsCertType = objsign + +# For normal client use this is typical +# nsCertType = client, email + +# and for everything including object signing: +# nsCertType = client, email, objsign + +# This is typical in keyUsage for a client certificate. +# keyUsage = nonRepudiation, digitalSignature, keyEncipherment + +# This will be displayed in Netscape's comment listbox. +nsComment = "OpenSSL Generated Certificate" + +# PKIX recommendations harmless if included in all certificates. +subjectKeyIdentifier=hash +authorityKeyIdentifier=keyid,issuer:always + +# This stuff is for subjectAltName and issuerAltname. +# Import the email address. +# subjectAltName=email:copy +# An alternative to produce certificates that aren't +# deprecated according to PKIX. +# subjectAltName=email:move + +# Copy subject details +# issuerAltName=issuer:copy + +#nsCaRevocationUrl = http://www.domain.dom/ca-crl.pem +#nsBaseUrl +#nsRevocationUrl +#nsRenewalUrl +#nsCaPolicyUrl +#nsSslServerName + +# This really needs to be in place for it to be a proxy certificate. +proxyCertInfo=critical,language:id-ppl-anyLanguage,pathlen:3,policy:foo diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_8/README.txt b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_8/README.txt new file mode 100755 index 000000000000..645ae6037dea --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_8/README.txt @@ -0,0 +1,13 @@ +Revoked certificates: + +- User 2 Sub CA 2 Root 8 + + +Start the OCSP responder: +openssl ocsp -index demoCA/index.txt -port 8889 -rsigner demoCA/cacert.pem -rkey demoCA/private/cakey.pem -CA demoCA/cacert.pem -text + + + + + + diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_8/demoCA/cacert.pem b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_8/demoCA/cacert.pem new file mode 100755 index 000000000000..26368962e8d0 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_8/demoCA/cacert.pem @@ -0,0 +1,66 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 4097 (0x1001) + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Root 8 + Validity + Not Before: Nov 20 15:55:33 2009 GMT + Not After : Nov 14 15:55:33 2034 GMT + Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Sub CA 2 Root 8 + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public Key: (1024 bit) + Modulus (1024 bit): + 00:e9:91:38:d8:c1:36:e5:c1:d0:32:e8:ae:02:11: + 97:e5:c5:07:8f:5b:46:3a:3c:d9:49:5e:9a:4b:51: + 4c:b7:7d:e9:d1:4f:a7:15:8c:c6:10:f6:fa:5f:a9: + 0b:1b:bc:de:56:f5:ad:a3:a0:40:f1:75:10:58:74: + 37:f9:b7:9f:76:ca:46:96:4c:1a:81:f4:a2:ce:88: + 8b:9e:00:6d:42:b3:d6:68:d1:67:d6:9f:b8:9c:3f: + 43:c7:36:bf:41:88:1b:e8:74:26:a0:51:5c:e2:ee: + 6d:9d:73:bb:0d:36:e1:5c:68:9f:21:3b:b2:aa:ed: + 39:1d:ae:fc:b4:ca:38:c2:fb + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Subject Key Identifier: + 1B:AB:6B:0F:42:91:DC:1E:D4:7A:95:87:30:2D:CC:11:4F:35:B7:73 + X509v3 Authority Key Identifier: + keyid:D6:66:76:C9:05:FF:A9:50:88:96:60:DD:FB:C7:30:18:72:67:41:19 + DirName:/C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=Root 8 + serial:B2:47:DE:6A:2A:4C:83:19 + + Authority Information Access: + OCSP - URI:http://localhost:8888 + + X509v3 Basic Constraints: critical + CA:TRUE + Signature Algorithm: sha1WithRSAEncryption + 89:f8:8d:a8:e5:0b:2a:fb:f3:6a:80:2c:26:a1:a7:36:7e:a0: + c5:61:65:9d:7e:d6:47:60:b4:f6:72:e9:6e:2c:d9:f8:7f:c8: + 7a:5d:75:98:ad:88:de:e7:1b:44:a3:96:37:84:c0:b3:20:98: + 3b:b5:f6:ee:70:9c:04:7a:6c:88:05:75:7f:12:cf:b9:76:e8: + c0:17:0c:5e:eb:10:38:1e:54:41:58:56:f6:3c:ec:07:a5:c0: + 74:24:34:af:b3:c7:b2:58:85:47:0f:6c:e4:a0:9f:c8:7b:5c: + 95:77:17:e5:ad:eb:c3:86:44:f7:81:ef:cb:58:12:1a:6a:c7: + 19:95 +-----BEGIN CERTIFICATE----- +MIIDOTCCAqKgAwIBAgICEAEwDQYJKoZIhvcNAQEFBQAwXzELMAkGA1UEBhMCREUx +EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD +VQQLEwtEZXZlbG9wbWVudDEPMA0GA1UEAxMGUm9vdCA4MB4XDTA5MTEyMDE1NTUz +M1oXDTM0MTExNDE1NTUzM1owaDELMAkGA1UEBhMCREUxEDAOBgNVBAgTB0hhbWJ1 +cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtEZXZlbG9wbWVu +dDEYMBYGA1UEAxMPU3ViIENBIDIgUm9vdCA4MIGfMA0GCSqGSIb3DQEBAQUAA4GN +ADCBiQKBgQDpkTjYwTblwdAy6K4CEZflxQePW0Y6PNlJXppLUUy3fenRT6cVjMYQ +9vpfqQsbvN5W9a2joEDxdRBYdDf5t592ykaWTBqB9KLOiIueAG1Cs9Zo0WfWn7ic +P0PHNr9BiBvodCagUVzi7m2dc7sNNuFcaJ8hO7Kq7Tkdrvy0yjjC+wIDAQABo4H6 +MIH3MB0GA1UdDgQWBBQbq2sPQpHcHtR6lYcwLcwRTzW3czCBkQYDVR0jBIGJMIGG +gBTWZnbJBf+pUIiWYN37xzAYcmdBGaFjpGEwXzELMAkGA1UEBhMCREUxEDAOBgNV +BAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtE +ZXZlbG9wbWVudDEPMA0GA1UEAxMGUm9vdCA4ggkAskfeaipMgxkwMQYIKwYBBQUH +AQEEJTAjMCEGCCsGAQUFBzABhhVodHRwOi8vbG9jYWxob3N0Ojg4ODgwDwYDVR0T +AQH/BAUwAwEB/zANBgkqhkiG9w0BAQUFAAOBgQCJ+I2o5Qsq+/NqgCwmoac2fqDF +YWWdftZHYLT2culuLNn4f8h6XXWYrYje5xtEo5Y3hMCzIJg7tfbucJwEemyIBXV/ +Es+5dujAFwxe6xA4HlRBWFb2POwHpcB0JDSvs8eyWIVHD2zkoJ/Ie1yVdxflrevD +hkT3ge/LWBIaascZlQ== +-----END CERTIFICATE----- diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_8/demoCA/crl/DO_NOT_INSTALL_THIS_CRL b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_8/demoCA/crl/DO_NOT_INSTALL_THIS_CRL new file mode 100755 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_8/demoCA/crl/DO_NOT_INSTALL_THIS_CRL diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_8/demoCA/crl/Sub_CA_2_Root_8.crl b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_8/demoCA/crl/Sub_CA_2_Root_8.crl Binary files differnew file mode 100755 index 000000000000..f4e88754b5e0 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_8/demoCA/crl/Sub_CA_2_Root_8.crl diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_8/demoCA/crlnumber b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_8/demoCA/crlnumber new file mode 100755 index 000000000000..dd11724042e2 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_8/demoCA/crlnumber @@ -0,0 +1 @@ +1001 diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_8/demoCA/index.txt b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_8/demoCA/index.txt new file mode 100755 index 000000000000..cdace00f7e8a --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_8/demoCA/index.txt @@ -0,0 +1,2 @@ +V 341114161332Z 1002 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=User 1 Sub CA 2 Root 8 +R 341114161602Z 091120161700Z,superseded 1003 unknown /C=DE/ST=Hamburg/O=OpenOffice.org/OU=Development/CN=User 2 Sub CA 2 Root 8 diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_8/demoCA/index.txt.attr b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_8/demoCA/index.txt.attr new file mode 100755 index 000000000000..8f7e63a3475c --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_8/demoCA/index.txt.attr @@ -0,0 +1 @@ +unique_subject = yes diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_8/demoCA/newcerts/1002.pem b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_8/demoCA/newcerts/1002.pem new file mode 100755 index 000000000000..1107a4327fc1 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_8/demoCA/newcerts/1002.pem @@ -0,0 +1,62 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 4098 (0x1002) + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Sub CA 2 Root 8 + Validity + Not Before: Nov 20 16:13:32 2009 GMT + Not After : Nov 14 16:13:32 2034 GMT + Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=User 1 Sub CA 2 Root 8 + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public Key: (1024 bit) + Modulus (1024 bit): + 00:d2:f6:25:c0:95:4b:07:1e:a0:57:67:52:36:b3: + 3e:5d:32:7f:61:25:e9:dd:31:a1:67:6e:02:9f:4f: + ca:ff:82:50:64:2e:ed:4e:8d:09:73:48:91:e1:90: + ca:df:06:ab:f4:c3:3d:8b:7d:d1:6b:5f:f8:f8:d6: + c0:f4:81:59:7c:0e:53:32:a9:cd:e4:34:3c:20:a9: + 08:b6:c2:b3:b7:91:d2:db:46:06:09:55:ff:f9:f4: + 4e:2a:28:36:46:0e:04:f1:78:7d:a3:ff:ac:08:1b: + 21:99:f5:b4:5b:f6:be:fd:1a:89:26:4b:eb:b9:58: + fc:c2:5f:44:42:a9:00:76:ff + Exponent: 65537 (0x10001) + X509v3 extensions: + Authority Information Access: + OCSP - URI:http://localhost:8889 + + X509v3 Key Usage: + Digital Signature, Non Repudiation, Key Encipherment + X509v3 Subject Key Identifier: + 9D:91:CD:7F:70:3B:00:C1:2A:FD:2F:5D:64:C4:8F:EB:0E:37:25:1B + X509v3 Authority Key Identifier: + keyid:1B:AB:6B:0F:42:91:DC:1E:D4:7A:95:87:30:2D:CC:11:4F:35:B7:73 + + Signature Algorithm: sha1WithRSAEncryption + 2c:68:5e:5b:2e:d7:48:ca:2a:01:b4:a0:99:0e:06:2d:e8:23: + b3:66:31:97:cd:9e:73:61:35:af:9d:d9:2f:7c:e6:87:7f:2a: + ae:3e:b0:99:c9:20:10:30:e3:a0:5b:28:8b:57:f2:12:3a:87: + c1:7a:5e:c8:21:b9:ae:49:c1:aa:4f:1c:9e:a8:ae:0f:ad:a2: + 3e:aa:61:94:64:41:f8:d7:19:8d:a1:be:c0:15:04:25:2c:35: + 29:af:00:1e:40:7c:e7:d7:41:89:a7:ab:2d:dd:78:dd:c7:ba: + d0:1b:7b:68:fa:7e:a4:0f:4c:ab:02:6e:d2:ff:b8:5b:05:f6: + 47:29 +-----BEGIN CERTIFICATE----- +MIIC0jCCAjugAwIBAgICEAIwDQYJKoZIhvcNAQEFBQAwaDELMAkGA1UEBhMCREUx +EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD +VQQLEwtEZXZlbG9wbWVudDEYMBYGA1UEAxMPU3ViIENBIDIgUm9vdCA4MB4XDTA5 +MTEyMDE2MTMzMloXDTM0MTExNDE2MTMzMlowbzELMAkGA1UEBhMCREUxEDAOBgNV +BAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtE +ZXZlbG9wbWVudDEfMB0GA1UEAxMWVXNlciAxIFN1YiBDQSAyIFJvb3QgODCBnzAN +BgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA0vYlwJVLBx6gV2dSNrM+XTJ/YSXp3TGh +Z24Cn0/K/4JQZC7tTo0Jc0iR4ZDK3war9MM9i33Ra1/4+NbA9IFZfA5TMqnN5DQ8 +IKkItsKzt5HS20YGCVX/+fROKig2Rg4E8Xh9o/+sCBshmfW0W/a+/RqJJkvruVj8 +wl9EQqkAdv8CAwEAAaOBgzCBgDAxBggrBgEFBQcBAQQlMCMwIQYIKwYBBQUHMAGG +FWh0dHA6Ly9sb2NhbGhvc3Q6ODg4OTALBgNVHQ8EBAMCBeAwHQYDVR0OBBYEFJ2R +zX9wOwDBKv0vXWTEj+sONyUbMB8GA1UdIwQYMBaAFBuraw9Ckdwe1HqVhzAtzBFP +NbdzMA0GCSqGSIb3DQEBBQUAA4GBACxoXlsu10jKKgG0oJkOBi3oI7NmMZfNnnNh +Na+d2S985od/Kq4+sJnJIBAw46BbKItX8hI6h8F6Xsghua5JwapPHJ6org+toj6q +YZRkQfjXGY2hvsAVBCUsNSmvAB5AfOfXQYmnqy3deN3HutAbe2j6fqQPTKsCbtL/ +uFsF9kcp +-----END CERTIFICATE----- diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_8/demoCA/newcerts/1003.pem b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_8/demoCA/newcerts/1003.pem new file mode 100755 index 000000000000..53268ff52df7 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_8/demoCA/newcerts/1003.pem @@ -0,0 +1,62 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 4099 (0x1003) + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=Sub CA 2 Root 8 + Validity + Not Before: Nov 20 16:16:02 2009 GMT + Not After : Nov 14 16:16:02 2034 GMT + Subject: C=DE, ST=Hamburg, O=OpenOffice.org, OU=Development, CN=User 2 Sub CA 2 Root 8 + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public Key: (1024 bit) + Modulus (1024 bit): + 00:b4:58:05:7c:f5:f2:48:af:35:03:82:62:af:d3: + ef:50:f0:0b:b1:a9:a1:9b:14:1c:54:a9:71:b4:f6: + e0:7d:8a:25:b3:21:e2:53:ab:a5:08:9e:ed:5a:ef: + 8b:4f:be:75:40:b0:10:05:eb:08:3b:94:c2:57:37: + 51:41:08:57:b9:1c:a5:2f:e9:cc:3c:a8:70:2b:eb: + 00:92:43:64:44:18:23:9f:85:5f:7f:a5:c9:30:b3: + 14:c0:2b:fc:94:a5:a6:ad:46:a8:37:12:20:ab:cf: + e0:02:74:5d:1f:2e:ec:1c:9f:27:1f:83:fc:c4:62: + d2:0b:6b:f4:65:21:1d:94:ff + Exponent: 65537 (0x10001) + X509v3 extensions: + Authority Information Access: + OCSP - URI:http://localhost:8889 + + X509v3 Key Usage: + Digital Signature, Non Repudiation, Key Encipherment + X509v3 Subject Key Identifier: + 1E:C7:A3:43:33:6B:EC:90:B5:66:81:64:D6:43:72:45:DB:D9:E4:57 + X509v3 Authority Key Identifier: + keyid:1B:AB:6B:0F:42:91:DC:1E:D4:7A:95:87:30:2D:CC:11:4F:35:B7:73 + + Signature Algorithm: sha1WithRSAEncryption + a8:66:0d:4b:6a:00:fc:31:e3:f5:8f:49:44:3d:60:26:76:2e: + 51:f8:41:35:3b:5b:7f:87:e3:00:d7:ae:85:bb:d9:81:a5:30: + db:6a:0a:a0:d2:e8:69:f5:47:d8:19:e5:2a:bd:c5:8e:99:f9: + 57:fc:b0:64:f5:43:bc:37:4a:8e:28:70:a4:6d:7d:da:2c:9e: + c1:55:8d:00:89:fe:f7:ef:c9:d9:8d:fe:01:3e:83:23:58:c3: + 3e:41:09:ab:5c:60:0e:9e:18:69:9e:99:7f:a2:cd:b7:95:5c: + ea:31:02:79:32:eb:1a:07:dc:75:98:80:8e:56:f2:0a:8f:0e: + cf:4f +-----BEGIN CERTIFICATE----- +MIIC0jCCAjugAwIBAgICEAMwDQYJKoZIhvcNAQEFBQAwaDELMAkGA1UEBhMCREUx +EDAOBgNVBAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYD +VQQLEwtEZXZlbG9wbWVudDEYMBYGA1UEAxMPU3ViIENBIDIgUm9vdCA4MB4XDTA5 +MTEyMDE2MTYwMloXDTM0MTExNDE2MTYwMlowbzELMAkGA1UEBhMCREUxEDAOBgNV +BAgTB0hhbWJ1cmcxFzAVBgNVBAoTDk9wZW5PZmZpY2Uub3JnMRQwEgYDVQQLEwtE +ZXZlbG9wbWVudDEfMB0GA1UEAxMWVXNlciAyIFN1YiBDQSAyIFJvb3QgODCBnzAN +BgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAtFgFfPXySK81A4Jir9PvUPALsamhmxQc +VKlxtPbgfYolsyHiU6ulCJ7tWu+LT751QLAQBesIO5TCVzdRQQhXuRylL+nMPKhw +K+sAkkNkRBgjn4Vff6XJMLMUwCv8lKWmrUaoNxIgq8/gAnRdHy7sHJ8nH4P8xGLS +C2v0ZSEdlP8CAwEAAaOBgzCBgDAxBggrBgEFBQcBAQQlMCMwIQYIKwYBBQUHMAGG +FWh0dHA6Ly9sb2NhbGhvc3Q6ODg4OTALBgNVHQ8EBAMCBeAwHQYDVR0OBBYEFB7H +o0Mza+yQtWaBZNZDckXb2eRXMB8GA1UdIwQYMBaAFBuraw9Ckdwe1HqVhzAtzBFP +NbdzMA0GCSqGSIb3DQEBBQUAA4GBAKhmDUtqAPwx4/WPSUQ9YCZ2LlH4QTU7W3+H +4wDXroW72YGlMNtqCqDS6Gn1R9gZ5Sq9xY6Z+Vf8sGT1Q7w3So4ocKRtfdosnsFV +jQCJ/vfvydmN/gE+gyNYwz5BCatcYA6eGGmemX+izbeVXOoxAnky6xoH3HWYgI5W +8gqPDs9P +-----END CERTIFICATE----- diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_8/demoCA/private/cakey.pem b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_8/demoCA/private/cakey.pem new file mode 100755 index 000000000000..e063b97262fe --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_8/demoCA/private/cakey.pem @@ -0,0 +1,18 @@ +-----BEGIN RSA PRIVATE KEY----- +Proc-Type: 4,ENCRYPTED +DEK-Info: DES-EDE3-CBC,B84323C471CC815A + +UrT9eGAJB4+hzdjcS7YBCJi6jCL9n9/vZC0fC6mjZRK/dw4CxLka0KapKUVd+pj/ +I+XG6JOqa5tmsHcp9OWaWpzyu9W5DJqjodTum6pNlig68GVVSs21u7q0mF5mA6OR +PmRu+iOe2oZO6kVaRnpdGBnbsUsvlsbayiY3nHjXeDPxyc+XGnIMjT7mBOO360iR +h6IEOyapRho8klyuOXLy8hHZuUyspm66Nq+czorGdv3nlEdSI4t4LPTcqJGUMiHb +hLYsCK9Zwu7RQWne3OmGjAspU37TB3F1YrWjnHFIKE6YSvtdYMwXosMbybdUZFwQ +w4dGUhIxCxWLDF99Qfnygi8HJOC1FiFcJslVem0Xi3M654sshGLCiA4jMjdUAEmL +R+rzjUNZEHqvO/bGm7zsEoLWQFWEYqQZguwxDScam9Sii/fcnEBcSERbEi3yjvlX +7L3q4j/7/PlpYuRVB+f21ZuoI8R6M+omwF1ZzuSQNMSvUMyhAgQ+yB/pFJbArU68 +4l7ks0wNcSlLyGzjsexrzU9UB8Y8avFOMGuRiWGt4Kh54hNxgaCRGp9ugoyEq5H5 ++QNB1x8tBJSe1YC4T06olH2xZTYCd5e9qTyjQrbnqTK4SEBDrOL+XSASkleH3vVH +SO1paXDjh9fSSTxPo1T8DnAadIcouVlUNdvO4WrtqO4Kbf0rDHbqzZDtrNYG3Hwd +w86nEo6J1AKrTKyXysOLdhuAhNr+hGx4ITT5HfV/H5BE3ba0/fmLxvenqTxBXrJc +wkEeORwtu1XWW1hxYKRi3lRgfi4OH/ciMwxU530mKZzIJTOdvsKPgw== +-----END RSA PRIVATE KEY----- diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_8/demoCA/serial b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_8/demoCA/serial new file mode 100755 index 000000000000..59c11226623e --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_8/demoCA/serial @@ -0,0 +1 @@ +1004 diff --git a/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_8/openssl.cfg b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_8/openssl.cfg new file mode 100755 index 000000000000..177888124500 --- /dev/null +++ b/xmlsecurity/test_docs/CAs/Sub_CA_2_Root_8/openssl.cfg @@ -0,0 +1,292 @@ +# +# OpenSSL example configuration file. +# This is mostly being used for generation of certificate requests. +# + +# This definition stops the following lines choking if HOME isn't +# defined. +HOME = . +RANDFILE = $ENV::HOME/.rnd + +# Extra OBJECT IDENTIFIER info: +#oid_file = $ENV::HOME/.oid +oid_section = new_oids + +# To use this configuration file with the "-extfile" option of the +# "openssl x509" utility, name here the section containing the +# X.509v3 extensions to use: +# extensions = +# (Alternatively, use a configuration file that has only +# X.509v3 extensions in its main [= default] section.) + +[ new_oids ] + +# We can add new OIDs in here for use by 'ca' and 'req'. +# Add a simple OID like this: +# testoid1=1.2.3.4 +# Or use config file substitution like this: +# testoid2=${testoid1}.5.6 + +#################################################################### +[ ca ] +default_ca = CA_default # The default ca section + +#################################################################### +[ CA_default ] + +dir = ./demoCA # Where everything is kept +certs = $dir/certs # Where the issued certs are kept +crl_dir = $dir/crl # Where the issued crl are kept +database = $dir/index.txt # database index file. +#unique_subject = no # Set to 'no' to allow creation of + # several ctificates with same subject. +new_certs_dir = $dir/newcerts # default place for new certs. + +certificate = $dir/cacert.pem # The CA certificate +serial = $dir/serial # The current serial number +crlnumber = $dir/crlnumber # the current crl number + # must be commented out to leave a V1 CRL +crl = $dir/crl.pem # The current CRL +private_key = $dir/private/cakey.pem # The private key +RANDFILE = $dir/private/.rand # private random number file + +x509_extensions = usr_cert # The extentions to add to the cert + +# Comment out the following two lines for the "traditional" +# (and highly broken) format. +name_opt = ca_default # Subject Name options +cert_opt = ca_default # Certificate field options + +# Extension copying option: use with caution. +# copy_extensions = copy + +# Extensions to add to a CRL. Note: Netscape communicator chokes on V2 CRLs +# so this is commented out by default to leave a V1 CRL. +# crlnumber must also be commented out to leave a V1 CRL. +# crl_extensions = crl_ext + +default_days = 365 # how long to certify for +default_crl_days= 30 # how long before next CRL +default_md = sha1 # which md to use. +preserve = no # keep passed DN ordering + +# A few difference way of specifying how similar the request should look +# For type CA, the listed attributes must be the same, and the optional +# and supplied fields are just that :-) +policy = policy_match + +# For the CA policy +[ policy_match ] +countryName = match +stateOrProvinceName = match +organizationName = match +organizationalUnitName = optional +commonName = supplied +emailAddress = optional + +# For the 'anything' policy +# At this point in time, you must list all acceptable 'object' +# types. +[ policy_anything ] +countryName = optional +stateOrProvinceName = optional +localityName = optional +organizationName = optional +organizationalUnitName = optional +commonName = supplied +emailAddress = optional + +#################################################################### +[ req ] +default_bits = 1024 +default_keyfile = privkey.pem +distinguished_name = req_distinguished_name +attributes = req_attributes +x509_extensions = v3_ca # The extentions to add to the self signed cert + +# Passwords for private keys if not present they will be prompted for +# input_password = secret +# output_password = secret + +# This sets a mask for permitted string types. There are several options. +# default: PrintableString, T61String, BMPString. +# pkix : PrintableString, BMPString. +# utf8only: only UTF8Strings. +# nombstr : PrintableString, T61String (no BMPStrings or UTF8Strings). +# MASK:XXXX a literal mask value. +# WARNING: current versions of Netscape crash on BMPStrings or UTF8Strings +# so use this option with caution! +string_mask = nombstr + +# req_extensions = v3_req # The extensions to add to a certificate request + +[ req_distinguished_name ] +countryName = Country Name (2 letter code) +countryName_default = DE +countryName_min = 2 +countryName_max = 2 + +stateOrProvinceName = State or Province Name (full name) +stateOrProvinceName_default = Hamburg + +localityName = Locality Name (eg, city) + +0.organizationName = Organization Name (eg, company) +0.organizationName_default = OpenOffice.org + +# we can do this but it is not needed normally :-) +#1.organizationName = Second Organization Name (eg, company) +#1.organizationName_default = World Wide Web Pty Ltd + +organizationalUnitName = Organizational Unit Name (eg, section) +organizationalUnitName_default = Development + +commonName = Common Name (eg, YOUR name) +commonName_max = 64 + +emailAddress = Email Address +emailAddress_max = 64 + +# SET-ex3 = SET extension number 3 + +[ req_attributes ] +challengePassword = A challenge password +challengePassword_min = 4 +challengePassword_max = 20 + +unstructuredName = An optional company name + +[ usr_cert ] + +# These extensions are added when 'ca' signs a request. +authorityInfoAccess = OCSP;URI:http://localhost:8889 +#crlDistributionPoints=URI:http://localhost:8902/demoCA/crl/Sub_CA_2_Root_7.crl +# This is typical in keyUsage for a client certificate. +keyUsage = nonRepudiation, digitalSignature, keyEncipherment + +# This will be displayed in Netscape's comment listbox. +#nsComment = "OpenSSL Generated Certificate" + +# PKIX recommendations harmless if included in all certificates. +subjectKeyIdentifier=hash +authorityKeyIdentifier=keyid,issuer + +# This stuff is for subjectAltName and issuerAltname. +# Import the email address. +# subjectAltName=email:copy +# An alternative to produce certificates that aren't +# deprecated according to PKIX. +# subjectAltName=email:move + +# Copy subject details +# issuerAltName=issuer:copy + + + +[ v3_req ] + +# Extensions to add to a certificate request + +basicConstraints = CA:FALSE +keyUsage = nonRepudiation, digitalSignature, keyEncipherment +#authorityInfoAccess = OCSP;URI:http://localhost:8888/ + +[ v3_ca ] + + +# Extensions for a typical CA + + +# PKIX recommendation. + +subjectKeyIdentifier=hash + +authorityKeyIdentifier=keyid:always,issuer:always + +#authorityInfoAccess = OCSP;URI:http://localhost:8888 +#crlDistributionPoints=URI:http://localhost:8901/demoCA/crl/Test_CA_2009.2.crl +# This is what PKIX recommends but some broken software chokes on critical +# extensions. +#basicConstraints = critical,CA:true +# So we do this instead. +basicConstraints = critical, CA:true + +# Key usage: this is typical for a CA certificate. However since it will +# prevent it being used as an test self-signed certificate it is best +# left out by default. +# keyUsage = cRLSign, keyCertSign + +# Some might want this also +# nsCertType = sslCA, emailCA + +# Include email address in subject alt name: another PKIX recommendation +# subjectAltName=email:copy +# Copy issuer details +# issuerAltName=issuer:copy + +# DER hex encoding of an extension: beware experts only! +# obj=DER:02:03 +# Where 'obj' is a standard or added object +# You can even override a supported extension: +# basicConstraints= critical, DER:30:03:01:01:FF + +[ crl_ext ] + +# CRL extensions. +# Only issuerAltName and authorityKeyIdentifier make any sense in a CRL. + +# issuerAltName=issuer:copy +authorityKeyIdentifier=keyid:always,issuer:always + +[ proxy_cert_ext ] +# These extensions should be added when creating a proxy certificate + +# This goes against PKIX guidelines but some CAs do it and some software +# requires this to avoid interpreting an end user certificate as a CA. + +basicConstraints=CA:FALSE + +# Here are some examples of the usage of nsCertType. If it is omitted +# the certificate can be used for anything *except* object signing. + +# This is OK for an SSL server. +# nsCertType = server + +# For an object signing certificate this would be used. +# nsCertType = objsign + +# For normal client use this is typical +# nsCertType = client, email + +# and for everything including object signing: +# nsCertType = client, email, objsign + +# This is typical in keyUsage for a client certificate. +# keyUsage = nonRepudiation, digitalSignature, keyEncipherment + +# This will be displayed in Netscape's comment listbox. +nsComment = "OpenSSL Generated Certificate" + +# PKIX recommendations harmless if included in all certificates. +subjectKeyIdentifier=hash +authorityKeyIdentifier=keyid,issuer:always + +# This stuff is for subjectAltName and issuerAltname. +# Import the email address. +# subjectAltName=email:copy +# An alternative to produce certificates that aren't +# deprecated according to PKIX. +# subjectAltName=email:move + +# Copy subject details +# issuerAltName=issuer:copy + +#nsCaRevocationUrl = http://www.domain.dom/ca-crl.pem +#nsBaseUrl +#nsRevocationUrl +#nsRenewalUrl +#nsCaPolicyUrl +#nsSslServerName + +# This really needs to be in place for it to be a proxy certificate. +proxyCertInfo=critical,language:id-ppl-anyLanguage,pathlen:3,policy:foo diff --git a/xmlsecurity/test_docs/certs/ca_certs/Root_1.crt b/xmlsecurity/test_docs/certs/ca_certs/Root_1.crt Binary files differnew file mode 100755 index 000000000000..ff4f23a90fde --- /dev/null +++ b/xmlsecurity/test_docs/certs/ca_certs/Root_1.crt diff --git a/xmlsecurity/test_docs/certs/ca_certs/Root_10.crt b/xmlsecurity/test_docs/certs/ca_certs/Root_10.crt Binary files differnew file mode 100755 index 000000000000..64f80334b12b --- /dev/null +++ b/xmlsecurity/test_docs/certs/ca_certs/Root_10.crt diff --git a/xmlsecurity/test_docs/certs/ca_certs/Root_11.crt b/xmlsecurity/test_docs/certs/ca_certs/Root_11.crt Binary files differnew file mode 100755 index 000000000000..bbf0819dd5c2 --- /dev/null +++ b/xmlsecurity/test_docs/certs/ca_certs/Root_11.crt diff --git a/xmlsecurity/test_docs/certs/ca_certs/Root_2.crt b/xmlsecurity/test_docs/certs/ca_certs/Root_2.crt Binary files differnew file mode 100755 index 000000000000..5f4bd15cd870 --- /dev/null +++ b/xmlsecurity/test_docs/certs/ca_certs/Root_2.crt diff --git a/xmlsecurity/test_docs/certs/ca_certs/Root_3.crt b/xmlsecurity/test_docs/certs/ca_certs/Root_3.crt Binary files differnew file mode 100755 index 000000000000..306aa56491f9 --- /dev/null +++ b/xmlsecurity/test_docs/certs/ca_certs/Root_3.crt diff --git a/xmlsecurity/test_docs/certs/ca_certs/Root_4.crt b/xmlsecurity/test_docs/certs/ca_certs/Root_4.crt Binary files differnew file mode 100755 index 000000000000..a4c1dd84dbc8 --- /dev/null +++ b/xmlsecurity/test_docs/certs/ca_certs/Root_4.crt diff --git a/xmlsecurity/test_docs/certs/ca_certs/Root_5.crt b/xmlsecurity/test_docs/certs/ca_certs/Root_5.crt Binary files differnew file mode 100755 index 000000000000..e9af2c33032c --- /dev/null +++ b/xmlsecurity/test_docs/certs/ca_certs/Root_5.crt diff --git a/xmlsecurity/test_docs/certs/ca_certs/Root_6.crt b/xmlsecurity/test_docs/certs/ca_certs/Root_6.crt Binary files differnew file mode 100755 index 000000000000..03f2ff0b3169 --- /dev/null +++ b/xmlsecurity/test_docs/certs/ca_certs/Root_6.crt diff --git a/xmlsecurity/test_docs/certs/ca_certs/Root_7.crt b/xmlsecurity/test_docs/certs/ca_certs/Root_7.crt Binary files differnew file mode 100755 index 000000000000..96eb50459531 --- /dev/null +++ b/xmlsecurity/test_docs/certs/ca_certs/Root_7.crt diff --git a/xmlsecurity/test_docs/certs/ca_certs/Root_8.crt b/xmlsecurity/test_docs/certs/ca_certs/Root_8.crt Binary files differnew file mode 100755 index 000000000000..c714844ad96f --- /dev/null +++ b/xmlsecurity/test_docs/certs/ca_certs/Root_8.crt diff --git a/xmlsecurity/test_docs/certs/ca_certs/Sub_CA_1_Root_1.crt b/xmlsecurity/test_docs/certs/ca_certs/Sub_CA_1_Root_1.crt Binary files differnew file mode 100755 index 000000000000..d83ce86deaf5 --- /dev/null +++ b/xmlsecurity/test_docs/certs/ca_certs/Sub_CA_1_Root_1.crt diff --git a/xmlsecurity/test_docs/certs/ca_certs/Sub_CA_1_Root_2.crt b/xmlsecurity/test_docs/certs/ca_certs/Sub_CA_1_Root_2.crt Binary files differnew file mode 100755 index 000000000000..c4857c541a52 --- /dev/null +++ b/xmlsecurity/test_docs/certs/ca_certs/Sub_CA_1_Root_2.crt diff --git a/xmlsecurity/test_docs/certs/ca_certs/Sub_CA_1_Root_3.crt b/xmlsecurity/test_docs/certs/ca_certs/Sub_CA_1_Root_3.crt Binary files differnew file mode 100755 index 000000000000..d39b18b5725a --- /dev/null +++ b/xmlsecurity/test_docs/certs/ca_certs/Sub_CA_1_Root_3.crt diff --git a/xmlsecurity/test_docs/certs/ca_certs/Sub_CA_1_Root_4.crt b/xmlsecurity/test_docs/certs/ca_certs/Sub_CA_1_Root_4.crt Binary files differnew file mode 100755 index 000000000000..b881f8a12e23 --- /dev/null +++ b/xmlsecurity/test_docs/certs/ca_certs/Sub_CA_1_Root_4.crt diff --git a/xmlsecurity/test_docs/certs/ca_certs/Sub_CA_1_Root_5.crt b/xmlsecurity/test_docs/certs/ca_certs/Sub_CA_1_Root_5.crt Binary files differnew file mode 100755 index 000000000000..61391a8c257f --- /dev/null +++ b/xmlsecurity/test_docs/certs/ca_certs/Sub_CA_1_Root_5.crt diff --git a/xmlsecurity/test_docs/certs/ca_certs/Sub_CA_1_Root_6.crt b/xmlsecurity/test_docs/certs/ca_certs/Sub_CA_1_Root_6.crt Binary files differnew file mode 100755 index 000000000000..223d047ca977 --- /dev/null +++ b/xmlsecurity/test_docs/certs/ca_certs/Sub_CA_1_Root_6.crt diff --git a/xmlsecurity/test_docs/certs/ca_certs/Sub_CA_1_Root_7.crt b/xmlsecurity/test_docs/certs/ca_certs/Sub_CA_1_Root_7.crt Binary files differnew file mode 100755 index 000000000000..af6a36003324 --- /dev/null +++ b/xmlsecurity/test_docs/certs/ca_certs/Sub_CA_1_Root_7.crt diff --git a/xmlsecurity/test_docs/certs/ca_certs/Sub_CA_1_Root_8.crt b/xmlsecurity/test_docs/certs/ca_certs/Sub_CA_1_Root_8.crt Binary files differnew file mode 100755 index 000000000000..05297a327748 --- /dev/null +++ b/xmlsecurity/test_docs/certs/ca_certs/Sub_CA_1_Root_8.crt diff --git a/xmlsecurity/test_docs/certs/ca_certs/Sub_CA_1_Root_9.crt b/xmlsecurity/test_docs/certs/ca_certs/Sub_CA_1_Root_9.crt Binary files differnew file mode 100755 index 000000000000..209059facde4 --- /dev/null +++ b/xmlsecurity/test_docs/certs/ca_certs/Sub_CA_1_Root_9.crt diff --git a/xmlsecurity/test_docs/certs/ca_certs/Sub_CA_2_Root_4.crt b/xmlsecurity/test_docs/certs/ca_certs/Sub_CA_2_Root_4.crt Binary files differnew file mode 100755 index 000000000000..a981a091cc4c --- /dev/null +++ b/xmlsecurity/test_docs/certs/ca_certs/Sub_CA_2_Root_4.crt diff --git a/xmlsecurity/test_docs/certs/ca_certs/Sub_CA_2_Root_7.crt b/xmlsecurity/test_docs/certs/ca_certs/Sub_CA_2_Root_7.crt Binary files differnew file mode 100755 index 000000000000..d73827e10366 --- /dev/null +++ b/xmlsecurity/test_docs/certs/ca_certs/Sub_CA_2_Root_7.crt diff --git a/xmlsecurity/test_docs/certs/ca_certs/Sub_CA_2_Root_8.crt b/xmlsecurity/test_docs/certs/ca_certs/Sub_CA_2_Root_8.crt Binary files differnew file mode 100755 index 000000000000..69da1318b025 --- /dev/null +++ b/xmlsecurity/test_docs/certs/ca_certs/Sub_CA_2_Root_8.crt diff --git a/xmlsecurity/test_docs/certs/crl/Root_10.crl b/xmlsecurity/test_docs/certs/crl/Root_10.crl Binary files differnew file mode 100755 index 000000000000..e7fee3ade801 --- /dev/null +++ b/xmlsecurity/test_docs/certs/crl/Root_10.crl diff --git a/xmlsecurity/test_docs/certs/crl/Root_11.crl b/xmlsecurity/test_docs/certs/crl/Root_11.crl Binary files differnew file mode 100755 index 000000000000..95e18ae6aff2 --- /dev/null +++ b/xmlsecurity/test_docs/certs/crl/Root_11.crl diff --git a/xmlsecurity/test_docs/certs/crl/Root_3.crl b/xmlsecurity/test_docs/certs/crl/Root_3.crl Binary files differnew file mode 100755 index 000000000000..5978b2613d00 --- /dev/null +++ b/xmlsecurity/test_docs/certs/crl/Root_3.crl diff --git a/xmlsecurity/test_docs/certs/crl/Root_4.crl b/xmlsecurity/test_docs/certs/crl/Root_4.crl Binary files differnew file mode 100755 index 000000000000..10b370c14933 --- /dev/null +++ b/xmlsecurity/test_docs/certs/crl/Root_4.crl diff --git a/xmlsecurity/test_docs/certs/crl/Root_9.crl b/xmlsecurity/test_docs/certs/crl/Root_9.crl Binary files differnew file mode 100755 index 000000000000..90bf8eba4a12 --- /dev/null +++ b/xmlsecurity/test_docs/certs/crl/Root_9.crl diff --git a/xmlsecurity/test_docs/certs/crl/Sub_CA_1_Root_2.crl b/xmlsecurity/test_docs/certs/crl/Sub_CA_1_Root_2.crl Binary files differnew file mode 100755 index 000000000000..c9f542029371 --- /dev/null +++ b/xmlsecurity/test_docs/certs/crl/Sub_CA_1_Root_2.crl diff --git a/xmlsecurity/test_docs/certs/crl/Sub_CA_1_Root_4.crl b/xmlsecurity/test_docs/certs/crl/Sub_CA_1_Root_4.crl Binary files differnew file mode 100755 index 000000000000..7fc03f255ec4 --- /dev/null +++ b/xmlsecurity/test_docs/certs/crl/Sub_CA_1_Root_4.crl diff --git a/xmlsecurity/test_docs/certs/crl/Sub_CA_1_Root_9.crl b/xmlsecurity/test_docs/certs/crl/Sub_CA_1_Root_9.crl Binary files differnew file mode 100755 index 000000000000..567b8b5d11b9 --- /dev/null +++ b/xmlsecurity/test_docs/certs/crl/Sub_CA_1_Root_9.crl diff --git a/xmlsecurity/test_docs/certs/crl/Sub_CA_2_Root_4.crl b/xmlsecurity/test_docs/certs/crl/Sub_CA_2_Root_4.crl Binary files differnew file mode 100755 index 000000000000..a2ce79b3a0f5 --- /dev/null +++ b/xmlsecurity/test_docs/certs/crl/Sub_CA_2_Root_4.crl diff --git a/xmlsecurity/test_docs/certs/end_certs/User_10_Root_11.crt b/xmlsecurity/test_docs/certs/end_certs/User_10_Root_11.crt Binary files differnew file mode 100755 index 000000000000..16abebe51148 --- /dev/null +++ b/xmlsecurity/test_docs/certs/end_certs/User_10_Root_11.crt diff --git a/xmlsecurity/test_docs/certs/end_certs/User_11_Root_11.crt b/xmlsecurity/test_docs/certs/end_certs/User_11_Root_11.crt Binary files differnew file mode 100755 index 000000000000..08f5040ced1c --- /dev/null +++ b/xmlsecurity/test_docs/certs/end_certs/User_11_Root_11.crt diff --git a/xmlsecurity/test_docs/certs/end_certs/User_12_Root_11.crt b/xmlsecurity/test_docs/certs/end_certs/User_12_Root_11.crt Binary files differnew file mode 100755 index 000000000000..18bd2475cdba --- /dev/null +++ b/xmlsecurity/test_docs/certs/end_certs/User_12_Root_11.crt diff --git a/xmlsecurity/test_docs/certs/end_certs/User_13_Root_11.crt b/xmlsecurity/test_docs/certs/end_certs/User_13_Root_11.crt Binary files differnew file mode 100755 index 000000000000..c7c83cf19a32 --- /dev/null +++ b/xmlsecurity/test_docs/certs/end_certs/User_13_Root_11.crt diff --git a/xmlsecurity/test_docs/certs/end_certs/User_14_Root_11.crt b/xmlsecurity/test_docs/certs/end_certs/User_14_Root_11.crt Binary files differnew file mode 100755 index 000000000000..3ff2118d286e --- /dev/null +++ b/xmlsecurity/test_docs/certs/end_certs/User_14_Root_11.crt diff --git a/xmlsecurity/test_docs/certs/end_certs/User_15_Root_11.crt b/xmlsecurity/test_docs/certs/end_certs/User_15_Root_11.crt Binary files differnew file mode 100755 index 000000000000..0fcd6393ac57 --- /dev/null +++ b/xmlsecurity/test_docs/certs/end_certs/User_15_Root_11.crt diff --git a/xmlsecurity/test_docs/certs/end_certs/User_16_Root_11.crt b/xmlsecurity/test_docs/certs/end_certs/User_16_Root_11.crt Binary files differnew file mode 100755 index 000000000000..9f28740601cb --- /dev/null +++ b/xmlsecurity/test_docs/certs/end_certs/User_16_Root_11.crt diff --git a/xmlsecurity/test_docs/certs/end_certs/User_17_Root_11.crt b/xmlsecurity/test_docs/certs/end_certs/User_17_Root_11.crt Binary files differnew file mode 100755 index 000000000000..49442c6df7b9 --- /dev/null +++ b/xmlsecurity/test_docs/certs/end_certs/User_17_Root_11.crt diff --git a/xmlsecurity/test_docs/certs/end_certs/User_18_Root_11.crt b/xmlsecurity/test_docs/certs/end_certs/User_18_Root_11.crt Binary files differnew file mode 100755 index 000000000000..27109c5bb04e --- /dev/null +++ b/xmlsecurity/test_docs/certs/end_certs/User_18_Root_11.crt diff --git a/xmlsecurity/test_docs/certs/end_certs/User_19_Root_11.crt b/xmlsecurity/test_docs/certs/end_certs/User_19_Root_11.crt Binary files differnew file mode 100755 index 000000000000..5cce769b44dc --- /dev/null +++ b/xmlsecurity/test_docs/certs/end_certs/User_19_Root_11.crt diff --git a/xmlsecurity/test_docs/certs/end_certs/User_1_Root_11.crt b/xmlsecurity/test_docs/certs/end_certs/User_1_Root_11.crt Binary files differnew file mode 100755 index 000000000000..09f2a54f4463 --- /dev/null +++ b/xmlsecurity/test_docs/certs/end_certs/User_1_Root_11.crt diff --git a/xmlsecurity/test_docs/certs/end_certs/User_1_Sub_CA_1_Root_1.crt b/xmlsecurity/test_docs/certs/end_certs/User_1_Sub_CA_1_Root_1.crt Binary files differnew file mode 100755 index 000000000000..c3810ab508b1 --- /dev/null +++ b/xmlsecurity/test_docs/certs/end_certs/User_1_Sub_CA_1_Root_1.crt diff --git a/xmlsecurity/test_docs/certs/end_certs/User_1_Sub_CA_1_Root_10.crt b/xmlsecurity/test_docs/certs/end_certs/User_1_Sub_CA_1_Root_10.crt Binary files differnew file mode 100755 index 000000000000..1531d1e8d350 --- /dev/null +++ b/xmlsecurity/test_docs/certs/end_certs/User_1_Sub_CA_1_Root_10.crt diff --git a/xmlsecurity/test_docs/certs/end_certs/User_1_Sub_CA_1_Root_2.crt b/xmlsecurity/test_docs/certs/end_certs/User_1_Sub_CA_1_Root_2.crt Binary files differnew file mode 100755 index 000000000000..3dab25877854 --- /dev/null +++ b/xmlsecurity/test_docs/certs/end_certs/User_1_Sub_CA_1_Root_2.crt diff --git a/xmlsecurity/test_docs/certs/end_certs/User_1_Sub_CA_1_Root_3.crt b/xmlsecurity/test_docs/certs/end_certs/User_1_Sub_CA_1_Root_3.crt Binary files differnew file mode 100755 index 000000000000..278b11b77ecb --- /dev/null +++ b/xmlsecurity/test_docs/certs/end_certs/User_1_Sub_CA_1_Root_3.crt diff --git a/xmlsecurity/test_docs/certs/end_certs/User_1_Sub_CA_1_Root_4.crt b/xmlsecurity/test_docs/certs/end_certs/User_1_Sub_CA_1_Root_4.crt Binary files differnew file mode 100755 index 000000000000..fa6e84547fc6 --- /dev/null +++ b/xmlsecurity/test_docs/certs/end_certs/User_1_Sub_CA_1_Root_4.crt diff --git a/xmlsecurity/test_docs/certs/end_certs/User_1_Sub_CA_1_Root_5.crt b/xmlsecurity/test_docs/certs/end_certs/User_1_Sub_CA_1_Root_5.crt Binary files differnew file mode 100755 index 000000000000..863f6f613eea --- /dev/null +++ b/xmlsecurity/test_docs/certs/end_certs/User_1_Sub_CA_1_Root_5.crt diff --git a/xmlsecurity/test_docs/certs/end_certs/User_1_Sub_CA_1_Root_6.crt b/xmlsecurity/test_docs/certs/end_certs/User_1_Sub_CA_1_Root_6.crt Binary files differnew file mode 100755 index 000000000000..cae3959d17c3 --- /dev/null +++ b/xmlsecurity/test_docs/certs/end_certs/User_1_Sub_CA_1_Root_6.crt diff --git a/xmlsecurity/test_docs/certs/end_certs/User_1_Sub_CA_1_Root_7.crt b/xmlsecurity/test_docs/certs/end_certs/User_1_Sub_CA_1_Root_7.crt Binary files differnew file mode 100755 index 000000000000..e5786dc6c030 --- /dev/null +++ b/xmlsecurity/test_docs/certs/end_certs/User_1_Sub_CA_1_Root_7.crt diff --git a/xmlsecurity/test_docs/certs/end_certs/User_1_Sub_CA_1_Root_8.crt b/xmlsecurity/test_docs/certs/end_certs/User_1_Sub_CA_1_Root_8.crt Binary files differnew file mode 100755 index 000000000000..a63a9f8c95e4 --- /dev/null +++ b/xmlsecurity/test_docs/certs/end_certs/User_1_Sub_CA_1_Root_8.crt diff --git a/xmlsecurity/test_docs/certs/end_certs/User_1_Sub_CA_1_Root_9.crt b/xmlsecurity/test_docs/certs/end_certs/User_1_Sub_CA_1_Root_9.crt Binary files differnew file mode 100755 index 000000000000..59a77df71e19 --- /dev/null +++ b/xmlsecurity/test_docs/certs/end_certs/User_1_Sub_CA_1_Root_9.crt diff --git a/xmlsecurity/test_docs/certs/end_certs/User_1_Sub_CA_2_Root_4.crt b/xmlsecurity/test_docs/certs/end_certs/User_1_Sub_CA_2_Root_4.crt Binary files differnew file mode 100755 index 000000000000..3b12b29c16e9 --- /dev/null +++ b/xmlsecurity/test_docs/certs/end_certs/User_1_Sub_CA_2_Root_4.crt diff --git a/xmlsecurity/test_docs/certs/end_certs/User_1_Sub_CA_2_Root_7.crt b/xmlsecurity/test_docs/certs/end_certs/User_1_Sub_CA_2_Root_7.crt Binary files differnew file mode 100755 index 000000000000..c11e716d7c32 --- /dev/null +++ b/xmlsecurity/test_docs/certs/end_certs/User_1_Sub_CA_2_Root_7.crt diff --git a/xmlsecurity/test_docs/certs/end_certs/User_1_Sub_CA_2_Root_8.crt b/xmlsecurity/test_docs/certs/end_certs/User_1_Sub_CA_2_Root_8.crt Binary files differnew file mode 100755 index 000000000000..026274f632a1 --- /dev/null +++ b/xmlsecurity/test_docs/certs/end_certs/User_1_Sub_CA_2_Root_8.crt diff --git a/xmlsecurity/test_docs/certs/end_certs/User_20_Root_11.crt b/xmlsecurity/test_docs/certs/end_certs/User_20_Root_11.crt Binary files differnew file mode 100755 index 000000000000..4a026790e723 --- /dev/null +++ b/xmlsecurity/test_docs/certs/end_certs/User_20_Root_11.crt diff --git a/xmlsecurity/test_docs/certs/end_certs/User_21_Root_11.crt b/xmlsecurity/test_docs/certs/end_certs/User_21_Root_11.crt Binary files differnew file mode 100755 index 000000000000..46b008eebf17 --- /dev/null +++ b/xmlsecurity/test_docs/certs/end_certs/User_21_Root_11.crt diff --git a/xmlsecurity/test_docs/certs/end_certs/User_22_Root_11.crt b/xmlsecurity/test_docs/certs/end_certs/User_22_Root_11.crt Binary files differnew file mode 100755 index 000000000000..7c1c2cb29f0a --- /dev/null +++ b/xmlsecurity/test_docs/certs/end_certs/User_22_Root_11.crt diff --git a/xmlsecurity/test_docs/certs/end_certs/User_23_Root_11.crt b/xmlsecurity/test_docs/certs/end_certs/User_23_Root_11.crt Binary files differnew file mode 100755 index 000000000000..cc6185cc93b4 --- /dev/null +++ b/xmlsecurity/test_docs/certs/end_certs/User_23_Root_11.crt diff --git a/xmlsecurity/test_docs/certs/end_certs/User_24_Root_11.crt b/xmlsecurity/test_docs/certs/end_certs/User_24_Root_11.crt Binary files differnew file mode 100755 index 000000000000..fa646e4029da --- /dev/null +++ b/xmlsecurity/test_docs/certs/end_certs/User_24_Root_11.crt diff --git a/xmlsecurity/test_docs/certs/end_certs/User_25_Root_11.crt b/xmlsecurity/test_docs/certs/end_certs/User_25_Root_11.crt Binary files differnew file mode 100755 index 000000000000..673db6cc9291 --- /dev/null +++ b/xmlsecurity/test_docs/certs/end_certs/User_25_Root_11.crt diff --git a/xmlsecurity/test_docs/certs/end_certs/User_26_Root_11.crt b/xmlsecurity/test_docs/certs/end_certs/User_26_Root_11.crt Binary files differnew file mode 100755 index 000000000000..e284dca9b558 --- /dev/null +++ b/xmlsecurity/test_docs/certs/end_certs/User_26_Root_11.crt diff --git a/xmlsecurity/test_docs/certs/end_certs/User_27_Root_11.crt b/xmlsecurity/test_docs/certs/end_certs/User_27_Root_11.crt Binary files differnew file mode 100755 index 000000000000..5b2cda4613af --- /dev/null +++ b/xmlsecurity/test_docs/certs/end_certs/User_27_Root_11.crt diff --git a/xmlsecurity/test_docs/certs/end_certs/User_28_Root_11.crt b/xmlsecurity/test_docs/certs/end_certs/User_28_Root_11.crt Binary files differnew file mode 100755 index 000000000000..532010b18c37 --- /dev/null +++ b/xmlsecurity/test_docs/certs/end_certs/User_28_Root_11.crt diff --git a/xmlsecurity/test_docs/certs/end_certs/User_29_Root_11.crt b/xmlsecurity/test_docs/certs/end_certs/User_29_Root_11.crt Binary files differnew file mode 100755 index 000000000000..282aa47af342 --- /dev/null +++ b/xmlsecurity/test_docs/certs/end_certs/User_29_Root_11.crt diff --git a/xmlsecurity/test_docs/certs/end_certs/User_2_Root_11.crt b/xmlsecurity/test_docs/certs/end_certs/User_2_Root_11.crt Binary files differnew file mode 100755 index 000000000000..26a51418fdfa --- /dev/null +++ b/xmlsecurity/test_docs/certs/end_certs/User_2_Root_11.crt diff --git a/xmlsecurity/test_docs/certs/end_certs/User_2_Sub_CA_1_Root_4.crt b/xmlsecurity/test_docs/certs/end_certs/User_2_Sub_CA_1_Root_4.crt Binary files differnew file mode 100755 index 000000000000..8a00d300802e --- /dev/null +++ b/xmlsecurity/test_docs/certs/end_certs/User_2_Sub_CA_1_Root_4.crt diff --git a/xmlsecurity/test_docs/certs/end_certs/User_2_Sub_CA_1_Root_7.crt b/xmlsecurity/test_docs/certs/end_certs/User_2_Sub_CA_1_Root_7.crt Binary files differnew file mode 100755 index 000000000000..935da38c2390 --- /dev/null +++ b/xmlsecurity/test_docs/certs/end_certs/User_2_Sub_CA_1_Root_7.crt diff --git a/xmlsecurity/test_docs/certs/end_certs/User_2_Sub_CA_1_Root_8.crt b/xmlsecurity/test_docs/certs/end_certs/User_2_Sub_CA_1_Root_8.crt Binary files differnew file mode 100755 index 000000000000..79ea4fbcfe83 --- /dev/null +++ b/xmlsecurity/test_docs/certs/end_certs/User_2_Sub_CA_1_Root_8.crt diff --git a/xmlsecurity/test_docs/certs/end_certs/User_2_Sub_CA_2_Root_4.crt b/xmlsecurity/test_docs/certs/end_certs/User_2_Sub_CA_2_Root_4.crt Binary files differnew file mode 100755 index 000000000000..011c4ae2a88a --- /dev/null +++ b/xmlsecurity/test_docs/certs/end_certs/User_2_Sub_CA_2_Root_4.crt diff --git a/xmlsecurity/test_docs/certs/end_certs/User_2_Sub_CA_2_Root_7.crt b/xmlsecurity/test_docs/certs/end_certs/User_2_Sub_CA_2_Root_7.crt Binary files differnew file mode 100755 index 000000000000..b1425442888c --- /dev/null +++ b/xmlsecurity/test_docs/certs/end_certs/User_2_Sub_CA_2_Root_7.crt diff --git a/xmlsecurity/test_docs/certs/end_certs/User_2_Sub_CA_2_Root_8.crt b/xmlsecurity/test_docs/certs/end_certs/User_2_Sub_CA_2_Root_8.crt Binary files differnew file mode 100755 index 000000000000..8c8689e10eaa --- /dev/null +++ b/xmlsecurity/test_docs/certs/end_certs/User_2_Sub_CA_2_Root_8.crt diff --git a/xmlsecurity/test_docs/certs/end_certs/User_30_Root_11.crt b/xmlsecurity/test_docs/certs/end_certs/User_30_Root_11.crt Binary files differnew file mode 100755 index 000000000000..ed39bea1ec7b --- /dev/null +++ b/xmlsecurity/test_docs/certs/end_certs/User_30_Root_11.crt diff --git a/xmlsecurity/test_docs/certs/end_certs/User_31_Root_11.crt b/xmlsecurity/test_docs/certs/end_certs/User_31_Root_11.crt Binary files differnew file mode 100755 index 000000000000..7f9e13698681 --- /dev/null +++ b/xmlsecurity/test_docs/certs/end_certs/User_31_Root_11.crt diff --git a/xmlsecurity/test_docs/certs/end_certs/User_32_Root_11.crt b/xmlsecurity/test_docs/certs/end_certs/User_32_Root_11.crt Binary files differnew file mode 100755 index 000000000000..dc28470c8b47 --- /dev/null +++ b/xmlsecurity/test_docs/certs/end_certs/User_32_Root_11.crt diff --git a/xmlsecurity/test_docs/certs/end_certs/User_33_Root_11.crt b/xmlsecurity/test_docs/certs/end_certs/User_33_Root_11.crt Binary files differnew file mode 100755 index 000000000000..df9d81d8d1a8 --- /dev/null +++ b/xmlsecurity/test_docs/certs/end_certs/User_33_Root_11.crt diff --git a/xmlsecurity/test_docs/certs/end_certs/User_34_Root_11.crt b/xmlsecurity/test_docs/certs/end_certs/User_34_Root_11.crt Binary files differnew file mode 100755 index 000000000000..018da383d7fa --- /dev/null +++ b/xmlsecurity/test_docs/certs/end_certs/User_34_Root_11.crt diff --git a/xmlsecurity/test_docs/certs/end_certs/User_3_Root_11.crt b/xmlsecurity/test_docs/certs/end_certs/User_3_Root_11.crt Binary files differnew file mode 100755 index 000000000000..879f4578c091 --- /dev/null +++ b/xmlsecurity/test_docs/certs/end_certs/User_3_Root_11.crt diff --git a/xmlsecurity/test_docs/certs/end_certs/User_4_Root_11.crt b/xmlsecurity/test_docs/certs/end_certs/User_4_Root_11.crt Binary files differnew file mode 100755 index 000000000000..75a9c7c843da --- /dev/null +++ b/xmlsecurity/test_docs/certs/end_certs/User_4_Root_11.crt diff --git a/xmlsecurity/test_docs/certs/end_certs/User_5_Root_11.crt b/xmlsecurity/test_docs/certs/end_certs/User_5_Root_11.crt Binary files differnew file mode 100755 index 000000000000..cf07f4aa2ce6 --- /dev/null +++ b/xmlsecurity/test_docs/certs/end_certs/User_5_Root_11.crt diff --git a/xmlsecurity/test_docs/certs/end_certs/User_6_Root_11.crt b/xmlsecurity/test_docs/certs/end_certs/User_6_Root_11.crt Binary files differnew file mode 100755 index 000000000000..993a09f957f7 --- /dev/null +++ b/xmlsecurity/test_docs/certs/end_certs/User_6_Root_11.crt diff --git a/xmlsecurity/test_docs/certs/end_certs/User_7_Root_11.crt b/xmlsecurity/test_docs/certs/end_certs/User_7_Root_11.crt Binary files differnew file mode 100755 index 000000000000..a1cebacb3b25 --- /dev/null +++ b/xmlsecurity/test_docs/certs/end_certs/User_7_Root_11.crt diff --git a/xmlsecurity/test_docs/certs/end_certs/User_8_Root_11.crt b/xmlsecurity/test_docs/certs/end_certs/User_8_Root_11.crt Binary files differnew file mode 100755 index 000000000000..12410ebc81a9 --- /dev/null +++ b/xmlsecurity/test_docs/certs/end_certs/User_8_Root_11.crt diff --git a/xmlsecurity/test_docs/certs/end_certs/User_9_Root_11.crt b/xmlsecurity/test_docs/certs/end_certs/User_9_Root_11.crt Binary files differnew file mode 100755 index 000000000000..f7372d09f33a --- /dev/null +++ b/xmlsecurity/test_docs/certs/end_certs/User_9_Root_11.crt diff --git a/xmlsecurity/test_docs/certs/p12/Root_11.p12 b/xmlsecurity/test_docs/certs/p12/Root_11.p12 Binary files differnew file mode 100644 index 000000000000..7df592643ef7 --- /dev/null +++ b/xmlsecurity/test_docs/certs/p12/Root_11.p12 diff --git a/xmlsecurity/test_docs/certs/p12/User_10_Root_11.p12 b/xmlsecurity/test_docs/certs/p12/User_10_Root_11.p12 Binary files differnew file mode 100755 index 000000000000..048ca8e8f509 --- /dev/null +++ b/xmlsecurity/test_docs/certs/p12/User_10_Root_11.p12 diff --git a/xmlsecurity/test_docs/certs/p12/User_11_Root_11.p12 b/xmlsecurity/test_docs/certs/p12/User_11_Root_11.p12 Binary files differnew file mode 100755 index 000000000000..4498cdb76ec9 --- /dev/null +++ b/xmlsecurity/test_docs/certs/p12/User_11_Root_11.p12 diff --git a/xmlsecurity/test_docs/certs/p12/User_12_Root_11.p12 b/xmlsecurity/test_docs/certs/p12/User_12_Root_11.p12 Binary files differnew file mode 100755 index 000000000000..d85e0b7d47e2 --- /dev/null +++ b/xmlsecurity/test_docs/certs/p12/User_12_Root_11.p12 diff --git a/xmlsecurity/test_docs/certs/p12/User_13_Root_11.p12 b/xmlsecurity/test_docs/certs/p12/User_13_Root_11.p12 Binary files differnew file mode 100755 index 000000000000..ff666ff1e5b6 --- /dev/null +++ b/xmlsecurity/test_docs/certs/p12/User_13_Root_11.p12 diff --git a/xmlsecurity/test_docs/certs/p12/User_14_Root_11.p12 b/xmlsecurity/test_docs/certs/p12/User_14_Root_11.p12 Binary files differnew file mode 100755 index 000000000000..55e0d6233e33 --- /dev/null +++ b/xmlsecurity/test_docs/certs/p12/User_14_Root_11.p12 diff --git a/xmlsecurity/test_docs/certs/p12/User_15_Root_11.p12 b/xmlsecurity/test_docs/certs/p12/User_15_Root_11.p12 Binary files differnew file mode 100755 index 000000000000..baa32f26b729 --- /dev/null +++ b/xmlsecurity/test_docs/certs/p12/User_15_Root_11.p12 diff --git a/xmlsecurity/test_docs/certs/p12/User_16_Root_11.p12 b/xmlsecurity/test_docs/certs/p12/User_16_Root_11.p12 Binary files differnew file mode 100755 index 000000000000..7b20ff98cf55 --- /dev/null +++ b/xmlsecurity/test_docs/certs/p12/User_16_Root_11.p12 diff --git a/xmlsecurity/test_docs/certs/p12/User_17_Root_11.p12 b/xmlsecurity/test_docs/certs/p12/User_17_Root_11.p12 Binary files differnew file mode 100755 index 000000000000..6e980df49e4e --- /dev/null +++ b/xmlsecurity/test_docs/certs/p12/User_17_Root_11.p12 diff --git a/xmlsecurity/test_docs/certs/p12/User_18_Root_11.p12 b/xmlsecurity/test_docs/certs/p12/User_18_Root_11.p12 Binary files differnew file mode 100755 index 000000000000..4d343d6e7672 --- /dev/null +++ b/xmlsecurity/test_docs/certs/p12/User_18_Root_11.p12 diff --git a/xmlsecurity/test_docs/certs/p12/User_19_Root_11.p12 b/xmlsecurity/test_docs/certs/p12/User_19_Root_11.p12 Binary files differnew file mode 100755 index 000000000000..aa5f27d2d945 --- /dev/null +++ b/xmlsecurity/test_docs/certs/p12/User_19_Root_11.p12 diff --git a/xmlsecurity/test_docs/certs/p12/User_1_Root_11.p12 b/xmlsecurity/test_docs/certs/p12/User_1_Root_11.p12 Binary files differnew file mode 100755 index 000000000000..80e5bf47c030 --- /dev/null +++ b/xmlsecurity/test_docs/certs/p12/User_1_Root_11.p12 diff --git a/xmlsecurity/test_docs/certs/p12/User_1_Sub_CA_1_Root_1.p12 b/xmlsecurity/test_docs/certs/p12/User_1_Sub_CA_1_Root_1.p12 Binary files differnew file mode 100755 index 000000000000..1e9a14cb8af5 --- /dev/null +++ b/xmlsecurity/test_docs/certs/p12/User_1_Sub_CA_1_Root_1.p12 diff --git a/xmlsecurity/test_docs/certs/p12/User_1_Sub_CA_1_Root_10.p12 b/xmlsecurity/test_docs/certs/p12/User_1_Sub_CA_1_Root_10.p12 Binary files differnew file mode 100755 index 000000000000..d7096919be7c --- /dev/null +++ b/xmlsecurity/test_docs/certs/p12/User_1_Sub_CA_1_Root_10.p12 diff --git a/xmlsecurity/test_docs/certs/p12/User_1_Sub_CA_1_Root_2.p12 b/xmlsecurity/test_docs/certs/p12/User_1_Sub_CA_1_Root_2.p12 Binary files differnew file mode 100755 index 000000000000..adc61fff40d6 --- /dev/null +++ b/xmlsecurity/test_docs/certs/p12/User_1_Sub_CA_1_Root_2.p12 diff --git a/xmlsecurity/test_docs/certs/p12/User_1_Sub_CA_1_Root_3.p12 b/xmlsecurity/test_docs/certs/p12/User_1_Sub_CA_1_Root_3.p12 Binary files differnew file mode 100755 index 000000000000..9213427a16b9 --- /dev/null +++ b/xmlsecurity/test_docs/certs/p12/User_1_Sub_CA_1_Root_3.p12 diff --git a/xmlsecurity/test_docs/certs/p12/User_1_Sub_CA_1_Root_4.p12 b/xmlsecurity/test_docs/certs/p12/User_1_Sub_CA_1_Root_4.p12 Binary files differnew file mode 100755 index 000000000000..005191d1646e --- /dev/null +++ b/xmlsecurity/test_docs/certs/p12/User_1_Sub_CA_1_Root_4.p12 diff --git a/xmlsecurity/test_docs/certs/p12/User_1_Sub_CA_1_Root_5.p12 b/xmlsecurity/test_docs/certs/p12/User_1_Sub_CA_1_Root_5.p12 Binary files differnew file mode 100755 index 000000000000..e4599b113a9b --- /dev/null +++ b/xmlsecurity/test_docs/certs/p12/User_1_Sub_CA_1_Root_5.p12 diff --git a/xmlsecurity/test_docs/certs/p12/User_1_Sub_CA_1_Root_6.p12 b/xmlsecurity/test_docs/certs/p12/User_1_Sub_CA_1_Root_6.p12 Binary files differnew file mode 100755 index 000000000000..32b4926ad74d --- /dev/null +++ b/xmlsecurity/test_docs/certs/p12/User_1_Sub_CA_1_Root_6.p12 diff --git a/xmlsecurity/test_docs/certs/p12/User_1_Sub_CA_1_Root_7.p12 b/xmlsecurity/test_docs/certs/p12/User_1_Sub_CA_1_Root_7.p12 Binary files differnew file mode 100755 index 000000000000..2c0ea4acbfa7 --- /dev/null +++ b/xmlsecurity/test_docs/certs/p12/User_1_Sub_CA_1_Root_7.p12 diff --git a/xmlsecurity/test_docs/certs/p12/User_1_Sub_CA_1_Root_8.p12 b/xmlsecurity/test_docs/certs/p12/User_1_Sub_CA_1_Root_8.p12 Binary files differnew file mode 100755 index 000000000000..b69a19e4e1b4 --- /dev/null +++ b/xmlsecurity/test_docs/certs/p12/User_1_Sub_CA_1_Root_8.p12 diff --git a/xmlsecurity/test_docs/certs/p12/User_1_Sub_CA_1_Root_9.p12 b/xmlsecurity/test_docs/certs/p12/User_1_Sub_CA_1_Root_9.p12 Binary files differnew file mode 100755 index 000000000000..7897733c4ea5 --- /dev/null +++ b/xmlsecurity/test_docs/certs/p12/User_1_Sub_CA_1_Root_9.p12 diff --git a/xmlsecurity/test_docs/certs/p12/User_1_Sub_CA_2_Root_4.p12 b/xmlsecurity/test_docs/certs/p12/User_1_Sub_CA_2_Root_4.p12 Binary files differnew file mode 100755 index 000000000000..99eb944528c8 --- /dev/null +++ b/xmlsecurity/test_docs/certs/p12/User_1_Sub_CA_2_Root_4.p12 diff --git a/xmlsecurity/test_docs/certs/p12/User_1_Sub_CA_2_Root_7.p12 b/xmlsecurity/test_docs/certs/p12/User_1_Sub_CA_2_Root_7.p12 Binary files differnew file mode 100755 index 000000000000..1aefff504ea3 --- /dev/null +++ b/xmlsecurity/test_docs/certs/p12/User_1_Sub_CA_2_Root_7.p12 diff --git a/xmlsecurity/test_docs/certs/p12/User_1_Sub_CA_2_Root_8.p12 b/xmlsecurity/test_docs/certs/p12/User_1_Sub_CA_2_Root_8.p12 Binary files differnew file mode 100755 index 000000000000..6b6d5fd4e703 --- /dev/null +++ b/xmlsecurity/test_docs/certs/p12/User_1_Sub_CA_2_Root_8.p12 diff --git a/xmlsecurity/test_docs/certs/p12/User_20_Root_11.p12 b/xmlsecurity/test_docs/certs/p12/User_20_Root_11.p12 Binary files differnew file mode 100755 index 000000000000..bebfdc88a66a --- /dev/null +++ b/xmlsecurity/test_docs/certs/p12/User_20_Root_11.p12 diff --git a/xmlsecurity/test_docs/certs/p12/User_21_Root_11.p12 b/xmlsecurity/test_docs/certs/p12/User_21_Root_11.p12 Binary files differnew file mode 100755 index 000000000000..cbd6730a8488 --- /dev/null +++ b/xmlsecurity/test_docs/certs/p12/User_21_Root_11.p12 diff --git a/xmlsecurity/test_docs/certs/p12/User_22_Root_11.p12 b/xmlsecurity/test_docs/certs/p12/User_22_Root_11.p12 Binary files differnew file mode 100755 index 000000000000..ab2b651c1f6a --- /dev/null +++ b/xmlsecurity/test_docs/certs/p12/User_22_Root_11.p12 diff --git a/xmlsecurity/test_docs/certs/p12/User_23_Root_11.p12 b/xmlsecurity/test_docs/certs/p12/User_23_Root_11.p12 Binary files differnew file mode 100755 index 000000000000..518388c5b4a4 --- /dev/null +++ b/xmlsecurity/test_docs/certs/p12/User_23_Root_11.p12 diff --git a/xmlsecurity/test_docs/certs/p12/User_24_Root_11.p12 b/xmlsecurity/test_docs/certs/p12/User_24_Root_11.p12 Binary files differnew file mode 100755 index 000000000000..775b1359dc39 --- /dev/null +++ b/xmlsecurity/test_docs/certs/p12/User_24_Root_11.p12 diff --git a/xmlsecurity/test_docs/certs/p12/User_25_Root_11.p12 b/xmlsecurity/test_docs/certs/p12/User_25_Root_11.p12 Binary files differnew file mode 100755 index 000000000000..f76a61869cb2 --- /dev/null +++ b/xmlsecurity/test_docs/certs/p12/User_25_Root_11.p12 diff --git a/xmlsecurity/test_docs/certs/p12/User_26_Root_11.p12 b/xmlsecurity/test_docs/certs/p12/User_26_Root_11.p12 Binary files differnew file mode 100755 index 000000000000..ef1273c72415 --- /dev/null +++ b/xmlsecurity/test_docs/certs/p12/User_26_Root_11.p12 diff --git a/xmlsecurity/test_docs/certs/p12/User_27_Root_11.p12 b/xmlsecurity/test_docs/certs/p12/User_27_Root_11.p12 Binary files differnew file mode 100755 index 000000000000..4208dc4316f0 --- /dev/null +++ b/xmlsecurity/test_docs/certs/p12/User_27_Root_11.p12 diff --git a/xmlsecurity/test_docs/certs/p12/User_28_Root_11.p12 b/xmlsecurity/test_docs/certs/p12/User_28_Root_11.p12 Binary files differnew file mode 100755 index 000000000000..4826f2d04584 --- /dev/null +++ b/xmlsecurity/test_docs/certs/p12/User_28_Root_11.p12 diff --git a/xmlsecurity/test_docs/certs/p12/User_29_Root_11.p12 b/xmlsecurity/test_docs/certs/p12/User_29_Root_11.p12 Binary files differnew file mode 100755 index 000000000000..bc211718a5f3 --- /dev/null +++ b/xmlsecurity/test_docs/certs/p12/User_29_Root_11.p12 diff --git a/xmlsecurity/test_docs/certs/p12/User_2_Root_11.p12 b/xmlsecurity/test_docs/certs/p12/User_2_Root_11.p12 Binary files differnew file mode 100755 index 000000000000..876151de3fbd --- /dev/null +++ b/xmlsecurity/test_docs/certs/p12/User_2_Root_11.p12 diff --git a/xmlsecurity/test_docs/certs/p12/User_2_Sub_CA_1_Root_4.p12 b/xmlsecurity/test_docs/certs/p12/User_2_Sub_CA_1_Root_4.p12 Binary files differnew file mode 100755 index 000000000000..268eeb938732 --- /dev/null +++ b/xmlsecurity/test_docs/certs/p12/User_2_Sub_CA_1_Root_4.p12 diff --git a/xmlsecurity/test_docs/certs/p12/User_2_Sub_CA_1_Root_7.p12 b/xmlsecurity/test_docs/certs/p12/User_2_Sub_CA_1_Root_7.p12 Binary files differnew file mode 100755 index 000000000000..2fc86b9afdf1 --- /dev/null +++ b/xmlsecurity/test_docs/certs/p12/User_2_Sub_CA_1_Root_7.p12 diff --git a/xmlsecurity/test_docs/certs/p12/User_2_Sub_CA_1_Root_8.p12 b/xmlsecurity/test_docs/certs/p12/User_2_Sub_CA_1_Root_8.p12 Binary files differnew file mode 100755 index 000000000000..80dd6a8b08f8 --- /dev/null +++ b/xmlsecurity/test_docs/certs/p12/User_2_Sub_CA_1_Root_8.p12 diff --git a/xmlsecurity/test_docs/certs/p12/User_2_Sub_CA_2_Root_4.p12 b/xmlsecurity/test_docs/certs/p12/User_2_Sub_CA_2_Root_4.p12 Binary files differnew file mode 100755 index 000000000000..821bb8ea50c9 --- /dev/null +++ b/xmlsecurity/test_docs/certs/p12/User_2_Sub_CA_2_Root_4.p12 diff --git a/xmlsecurity/test_docs/certs/p12/User_2_Sub_CA_2_Root_7.p12 b/xmlsecurity/test_docs/certs/p12/User_2_Sub_CA_2_Root_7.p12 Binary files differnew file mode 100755 index 000000000000..3671d176d9ce --- /dev/null +++ b/xmlsecurity/test_docs/certs/p12/User_2_Sub_CA_2_Root_7.p12 diff --git a/xmlsecurity/test_docs/certs/p12/User_2_Sub_CA_2_Root_8.p12 b/xmlsecurity/test_docs/certs/p12/User_2_Sub_CA_2_Root_8.p12 Binary files differnew file mode 100755 index 000000000000..a4c63b7f23eb --- /dev/null +++ b/xmlsecurity/test_docs/certs/p12/User_2_Sub_CA_2_Root_8.p12 diff --git a/xmlsecurity/test_docs/certs/p12/User_30_Root_11.p12 b/xmlsecurity/test_docs/certs/p12/User_30_Root_11.p12 Binary files differnew file mode 100755 index 000000000000..99b0be699aea --- /dev/null +++ b/xmlsecurity/test_docs/certs/p12/User_30_Root_11.p12 diff --git a/xmlsecurity/test_docs/certs/p12/User_31_Root_11.p12 b/xmlsecurity/test_docs/certs/p12/User_31_Root_11.p12 Binary files differnew file mode 100755 index 000000000000..5dbaf524c3b8 --- /dev/null +++ b/xmlsecurity/test_docs/certs/p12/User_31_Root_11.p12 diff --git a/xmlsecurity/test_docs/certs/p12/User_32_Root_11.p12 b/xmlsecurity/test_docs/certs/p12/User_32_Root_11.p12 Binary files differnew file mode 100644 index 000000000000..17e22f7a5bec --- /dev/null +++ b/xmlsecurity/test_docs/certs/p12/User_32_Root_11.p12 diff --git a/xmlsecurity/test_docs/certs/p12/User_33_Root_11.p12 b/xmlsecurity/test_docs/certs/p12/User_33_Root_11.p12 Binary files differnew file mode 100644 index 000000000000..5982532a97d9 --- /dev/null +++ b/xmlsecurity/test_docs/certs/p12/User_33_Root_11.p12 diff --git a/xmlsecurity/test_docs/certs/p12/User_34_Root_11.p12 b/xmlsecurity/test_docs/certs/p12/User_34_Root_11.p12 Binary files differnew file mode 100644 index 000000000000..4c00b21d457e --- /dev/null +++ b/xmlsecurity/test_docs/certs/p12/User_34_Root_11.p12 diff --git a/xmlsecurity/test_docs/certs/p12/User_3_Root_11.p12 b/xmlsecurity/test_docs/certs/p12/User_3_Root_11.p12 Binary files differnew file mode 100755 index 000000000000..bc476b2572a0 --- /dev/null +++ b/xmlsecurity/test_docs/certs/p12/User_3_Root_11.p12 diff --git a/xmlsecurity/test_docs/certs/p12/User_4_Root_11.p12 b/xmlsecurity/test_docs/certs/p12/User_4_Root_11.p12 Binary files differnew file mode 100755 index 000000000000..0b9bd319b5a2 --- /dev/null +++ b/xmlsecurity/test_docs/certs/p12/User_4_Root_11.p12 diff --git a/xmlsecurity/test_docs/certs/p12/User_5_Root_11.p12 b/xmlsecurity/test_docs/certs/p12/User_5_Root_11.p12 Binary files differnew file mode 100755 index 000000000000..99de803de356 --- /dev/null +++ b/xmlsecurity/test_docs/certs/p12/User_5_Root_11.p12 diff --git a/xmlsecurity/test_docs/certs/p12/User_6_Root_11.p12 b/xmlsecurity/test_docs/certs/p12/User_6_Root_11.p12 Binary files differnew file mode 100755 index 000000000000..a663a92d9bfe --- /dev/null +++ b/xmlsecurity/test_docs/certs/p12/User_6_Root_11.p12 diff --git a/xmlsecurity/test_docs/certs/p12/User_7_Root_11.p12 b/xmlsecurity/test_docs/certs/p12/User_7_Root_11.p12 Binary files differnew file mode 100755 index 000000000000..c3d4e7532f10 --- /dev/null +++ b/xmlsecurity/test_docs/certs/p12/User_7_Root_11.p12 diff --git a/xmlsecurity/test_docs/certs/p12/User_8_Root_11.p12 b/xmlsecurity/test_docs/certs/p12/User_8_Root_11.p12 Binary files differnew file mode 100755 index 000000000000..9db9c0ad4a07 --- /dev/null +++ b/xmlsecurity/test_docs/certs/p12/User_8_Root_11.p12 diff --git a/xmlsecurity/test_docs/certs/p12/User_9_Root_11.p12 b/xmlsecurity/test_docs/certs/p12/User_9_Root_11.p12 Binary files differnew file mode 100755 index 000000000000..ccb03b327d2b --- /dev/null +++ b/xmlsecurity/test_docs/certs/p12/User_9_Root_11.p12 diff --git a/xmlsecurity/test_docs/documents/aia_ca_issuers.odt b/xmlsecurity/test_docs/documents/aia_ca_issuers.odt Binary files differnew file mode 100755 index 000000000000..8c34889df75d --- /dev/null +++ b/xmlsecurity/test_docs/documents/aia_ca_issuers.odt diff --git a/xmlsecurity/test_docs/documents/aia_ocsp.odt b/xmlsecurity/test_docs/documents/aia_ocsp.odt Binary files differnew file mode 100755 index 000000000000..6a1b48c6ae44 --- /dev/null +++ b/xmlsecurity/test_docs/documents/aia_ocsp.odt diff --git a/xmlsecurity/test_docs/documents/aia_ocsp_revoked_chain.odt b/xmlsecurity/test_docs/documents/aia_ocsp_revoked_chain.odt Binary files differnew file mode 100755 index 000000000000..248fcceddc43 --- /dev/null +++ b/xmlsecurity/test_docs/documents/aia_ocsp_revoked_chain.odt diff --git a/xmlsecurity/test_docs/documents/aia_ocsp_revoked_leaf.odt b/xmlsecurity/test_docs/documents/aia_ocsp_revoked_leaf.odt Binary files differnew file mode 100755 index 000000000000..2e0dbd6f7af3 --- /dev/null +++ b/xmlsecurity/test_docs/documents/aia_ocsp_revoked_leaf.odt diff --git a/xmlsecurity/test_docs/documents/aia_ocsp_revoked_leaf_chain.odt b/xmlsecurity/test_docs/documents/aia_ocsp_revoked_leaf_chain.odt Binary files differnew file mode 100755 index 000000000000..3519e4a818e6 --- /dev/null +++ b/xmlsecurity/test_docs/documents/aia_ocsp_revoked_leaf_chain.odt diff --git a/xmlsecurity/test_docs/documents/crl.odt b/xmlsecurity/test_docs/documents/crl.odt Binary files differnew file mode 100755 index 000000000000..06e412fa3ca4 --- /dev/null +++ b/xmlsecurity/test_docs/documents/crl.odt diff --git a/xmlsecurity/test_docs/documents/crl_revoked_chain.odt b/xmlsecurity/test_docs/documents/crl_revoked_chain.odt Binary files differnew file mode 100755 index 000000000000..851fc87e7693 --- /dev/null +++ b/xmlsecurity/test_docs/documents/crl_revoked_chain.odt diff --git a/xmlsecurity/test_docs/documents/crl_revoked_leaf.odt b/xmlsecurity/test_docs/documents/crl_revoked_leaf.odt Binary files differnew file mode 100755 index 000000000000..a97598d554bd --- /dev/null +++ b/xmlsecurity/test_docs/documents/crl_revoked_leaf.odt diff --git a/xmlsecurity/test_docs/documents/crl_revoked_leaf_chain.odt b/xmlsecurity/test_docs/documents/crl_revoked_leaf_chain.odt Binary files differnew file mode 100755 index 000000000000..f82a02a4545c --- /dev/null +++ b/xmlsecurity/test_docs/documents/crl_revoked_leaf_chain.odt diff --git a/xmlsecurity/test_docs/documents/crldp.odt b/xmlsecurity/test_docs/documents/crldp.odt Binary files differnew file mode 100755 index 000000000000..5cbf289de34f --- /dev/null +++ b/xmlsecurity/test_docs/documents/crldp.odt diff --git a/xmlsecurity/test_docs/documents/crldp_no_intermediate_ca_revocation_info.odt b/xmlsecurity/test_docs/documents/crldp_no_intermediate_ca_revocation_info.odt Binary files differnew file mode 100755 index 000000000000..20c28d9252e7 --- /dev/null +++ b/xmlsecurity/test_docs/documents/crldp_no_intermediate_ca_revocation_info.odt diff --git a/xmlsecurity/test_docs/documents/crldp_no_root_revocation_info.odt b/xmlsecurity/test_docs/documents/crldp_no_root_revocation_info.odt Binary files differnew file mode 100755 index 000000000000..d3f59e6015a1 --- /dev/null +++ b/xmlsecurity/test_docs/documents/crldp_no_root_revocation_info.odt diff --git a/xmlsecurity/test_docs/documents/crldp_revoked_chain.odt b/xmlsecurity/test_docs/documents/crldp_revoked_chain.odt Binary files differnew file mode 100755 index 000000000000..8c6416b808ba --- /dev/null +++ b/xmlsecurity/test_docs/documents/crldp_revoked_chain.odt diff --git a/xmlsecurity/test_docs/documents/crldp_revoked_leaf.odt b/xmlsecurity/test_docs/documents/crldp_revoked_leaf.odt Binary files differnew file mode 100755 index 000000000000..fce479cc66b2 --- /dev/null +++ b/xmlsecurity/test_docs/documents/crldp_revoked_leaf.odt diff --git a/xmlsecurity/test_docs/documents/crldp_revoked_leaf_chain.odt b/xmlsecurity/test_docs/documents/crldp_revoked_leaf_chain.odt Binary files differnew file mode 100755 index 000000000000..53d1e01e7ae3 --- /dev/null +++ b/xmlsecurity/test_docs/documents/crldp_revoked_leaf_chain.odt diff --git a/xmlsecurity/test_docs/documents/dn_cyrillic_bmpstring.odt b/xmlsecurity/test_docs/documents/dn_cyrillic_bmpstring.odt Binary files differnew file mode 100755 index 000000000000..1f69a324823b --- /dev/null +++ b/xmlsecurity/test_docs/documents/dn_cyrillic_bmpstring.odt diff --git a/xmlsecurity/test_docs/documents/dn_latin_ext_greak_bmpstring.odt b/xmlsecurity/test_docs/documents/dn_latin_ext_greak_bmpstring.odt Binary files differnew file mode 100755 index 000000000000..53a29310e9f2 --- /dev/null +++ b/xmlsecurity/test_docs/documents/dn_latin_ext_greak_bmpstring.odt diff --git a/xmlsecurity/test_docs/documents/dn_multivalue_rdn.odt b/xmlsecurity/test_docs/documents/dn_multivalue_rdn.odt Binary files differnew file mode 100755 index 000000000000..4d34bc0f580a --- /dev/null +++ b/xmlsecurity/test_docs/documents/dn_multivalue_rdn.odt diff --git a/xmlsecurity/test_docs/documents/dn_quoting.odt b/xmlsecurity/test_docs/documents/dn_quoting.odt Binary files differnew file mode 100755 index 000000000000..ca17f6aab62e --- /dev/null +++ b/xmlsecurity/test_docs/documents/dn_quoting.odt diff --git a/xmlsecurity/test_docs/documents/dn_single_multivalue_rdn.odt b/xmlsecurity/test_docs/documents/dn_single_multivalue_rdn.odt Binary files differnew file mode 100755 index 000000000000..798f25a35312 --- /dev/null +++ b/xmlsecurity/test_docs/documents/dn_single_multivalue_rdn.odt diff --git a/xmlsecurity/test_docs/documents/dn_single_multivalue_rdn_with_quoting.odt b/xmlsecurity/test_docs/documents/dn_single_multivalue_rdn_with_quoting.odt Binary files differnew file mode 100755 index 000000000000..591f9aa4d63d --- /dev/null +++ b/xmlsecurity/test_docs/documents/dn_single_multivalue_rdn_with_quoting.odt diff --git a/xmlsecurity/test_docs/documents/incomplete_path.odt b/xmlsecurity/test_docs/documents/incomplete_path.odt Binary files differnew file mode 100755 index 000000000000..cb0763b0a124 --- /dev/null +++ b/xmlsecurity/test_docs/documents/incomplete_path.odt diff --git a/xmlsecurity/test_docs/documents/invalid_ooo2_x_doc1.odt b/xmlsecurity/test_docs/documents/invalid_ooo2_x_doc1.odt Binary files differnew file mode 100755 index 000000000000..f0555b1a2da4 --- /dev/null +++ b/xmlsecurity/test_docs/documents/invalid_ooo2_x_doc1.odt diff --git a/xmlsecurity/test_docs/documents/invalid_ooo2_x_doc2.odt b/xmlsecurity/test_docs/documents/invalid_ooo2_x_doc2.odt Binary files differnew file mode 100755 index 000000000000..b2e24fc6177c --- /dev/null +++ b/xmlsecurity/test_docs/documents/invalid_ooo2_x_doc2.odt diff --git a/xmlsecurity/test_docs/documents/invalid_ooo2_x_macro1.odt b/xmlsecurity/test_docs/documents/invalid_ooo2_x_macro1.odt Binary files differnew file mode 100755 index 000000000000..640a80dced51 --- /dev/null +++ b/xmlsecurity/test_docs/documents/invalid_ooo2_x_macro1.odt diff --git a/xmlsecurity/test_docs/documents/invalid_ooo2_x_macro2.odt b/xmlsecurity/test_docs/documents/invalid_ooo2_x_macro2.odt Binary files differnew file mode 100755 index 000000000000..35847216be74 --- /dev/null +++ b/xmlsecurity/test_docs/documents/invalid_ooo2_x_macro2.odt diff --git a/xmlsecurity/test_docs/documents/invalid_ooo2_x_macro3.odt b/xmlsecurity/test_docs/documents/invalid_ooo2_x_macro3.odt Binary files differnew file mode 100755 index 000000000000..575f3a12d084 --- /dev/null +++ b/xmlsecurity/test_docs/documents/invalid_ooo2_x_macro3.odt diff --git a/xmlsecurity/test_docs/documents/invalid_ooo2_x_macro4.odt b/xmlsecurity/test_docs/documents/invalid_ooo2_x_macro4.odt Binary files differnew file mode 100755 index 000000000000..75a417cab6f7 --- /dev/null +++ b/xmlsecurity/test_docs/documents/invalid_ooo2_x_macro4.odt diff --git a/xmlsecurity/test_docs/documents/invalid_ooo2_x_macro5.odt b/xmlsecurity/test_docs/documents/invalid_ooo2_x_macro5.odt Binary files differnew file mode 100755 index 000000000000..f7d71762fd88 --- /dev/null +++ b/xmlsecurity/test_docs/documents/invalid_ooo2_x_macro5.odt diff --git a/xmlsecurity/test_docs/documents/invalid_ooo3_2_doc1.odt b/xmlsecurity/test_docs/documents/invalid_ooo3_2_doc1.odt Binary files differnew file mode 100755 index 000000000000..9984aa1bbb27 --- /dev/null +++ b/xmlsecurity/test_docs/documents/invalid_ooo3_2_doc1.odt diff --git a/xmlsecurity/test_docs/documents/invalid_ooo3_2_doc3.odt b/xmlsecurity/test_docs/documents/invalid_ooo3_2_doc3.odt Binary files differnew file mode 100755 index 000000000000..5ad7b68abbbb --- /dev/null +++ b/xmlsecurity/test_docs/documents/invalid_ooo3_2_doc3.odt diff --git a/xmlsecurity/test_docs/documents/invalid_ooo3_2_doc4.odt b/xmlsecurity/test_docs/documents/invalid_ooo3_2_doc4.odt Binary files differnew file mode 100755 index 000000000000..d126a8dff529 --- /dev/null +++ b/xmlsecurity/test_docs/documents/invalid_ooo3_2_doc4.odt diff --git a/xmlsecurity/test_docs/documents/invalid_ooo_3_2_doc2.odt b/xmlsecurity/test_docs/documents/invalid_ooo_3_2_doc2.odt Binary files differnew file mode 100755 index 000000000000..dd475c354957 --- /dev/null +++ b/xmlsecurity/test_docs/documents/invalid_ooo_3_2_doc2.odt diff --git a/xmlsecurity/test_docs/documents/ocsp_crl.odt b/xmlsecurity/test_docs/documents/ocsp_crl.odt Binary files differnew file mode 100755 index 000000000000..f8ab95c046de --- /dev/null +++ b/xmlsecurity/test_docs/documents/ocsp_crl.odt diff --git a/xmlsecurity/test_docs/documents/ocsp_crl_revoked_leaf.odt b/xmlsecurity/test_docs/documents/ocsp_crl_revoked_leaf.odt Binary files differnew file mode 100755 index 000000000000..4d7c5cd8094d --- /dev/null +++ b/xmlsecurity/test_docs/documents/ocsp_crl_revoked_leaf.odt diff --git a/xmlsecurity/test_docs/documents/stateOrProvinceName.odt b/xmlsecurity/test_docs/documents/stateOrProvinceName.odt Binary files differnew file mode 100755 index 000000000000..0979ae5a9d86 --- /dev/null +++ b/xmlsecurity/test_docs/documents/stateOrProvinceName.odt diff --git a/xmlsecurity/test_docs/documents/valid_no_revocation.odt b/xmlsecurity/test_docs/documents/valid_no_revocation.odt Binary files differnew file mode 100755 index 000000000000..f7c9bbf5ed40 --- /dev/null +++ b/xmlsecurity/test_docs/documents/valid_no_revocation.odt diff --git a/xmlsecurity/test_docs/documents/valid_no_root_revocation_info.odt b/xmlsecurity/test_docs/documents/valid_no_root_revocation_info.odt Binary files differnew file mode 100755 index 000000000000..d26eb58f025c --- /dev/null +++ b/xmlsecurity/test_docs/documents/valid_no_root_revocation_info.odt diff --git a/xmlsecurity/test_docs/documents/valid_no_sub_ca_revocation_info.odt b/xmlsecurity/test_docs/documents/valid_no_sub_ca_revocation_info.odt Binary files differnew file mode 100755 index 000000000000..5d6c053c2b7c --- /dev/null +++ b/xmlsecurity/test_docs/documents/valid_no_sub_ca_revocation_info.odt diff --git a/xmlsecurity/test_docs/documents/valid_ooo2_x_doc1.odt b/xmlsecurity/test_docs/documents/valid_ooo2_x_doc1.odt Binary files differnew file mode 100755 index 000000000000..cb6401c1641f --- /dev/null +++ b/xmlsecurity/test_docs/documents/valid_ooo2_x_doc1.odt diff --git a/xmlsecurity/test_docs/documents/valid_ooo2_x_doc_macro.odt b/xmlsecurity/test_docs/documents/valid_ooo2_x_doc_macro.odt Binary files differnew file mode 100755 index 000000000000..09b63b40a3e0 --- /dev/null +++ b/xmlsecurity/test_docs/documents/valid_ooo2_x_doc_macro.odt diff --git a/xmlsecurity/test_docs/documents/valid_ooo2_x_doc_unsigned_macro.odt b/xmlsecurity/test_docs/documents/valid_ooo2_x_doc_unsigned_macro.odt Binary files differnew file mode 100755 index 000000000000..e810d785d1b1 --- /dev/null +++ b/xmlsecurity/test_docs/documents/valid_ooo2_x_doc_unsigned_macro.odt diff --git a/xmlsecurity/test_docs/documents/valid_ooo3_0_doc1.odt b/xmlsecurity/test_docs/documents/valid_ooo3_0_doc1.odt Binary files differnew file mode 100755 index 000000000000..6c2bbd045a0e --- /dev/null +++ b/xmlsecurity/test_docs/documents/valid_ooo3_0_doc1.odt diff --git a/xmlsecurity/test_docs/documents/valid_ooo3_0_doc_macro.odt b/xmlsecurity/test_docs/documents/valid_ooo3_0_doc_macro.odt Binary files differnew file mode 100755 index 000000000000..b8b036cc8fa7 --- /dev/null +++ b/xmlsecurity/test_docs/documents/valid_ooo3_0_doc_macro.odt diff --git a/xmlsecurity/test_docs/documents/valid_ooo3_0_doc_unsigned_macro.odt b/xmlsecurity/test_docs/documents/valid_ooo3_0_doc_unsigned_macro.odt Binary files differnew file mode 100755 index 000000000000..6ba0ec52a9b7 --- /dev/null +++ b/xmlsecurity/test_docs/documents/valid_ooo3_0_doc_unsigned_macro.odt diff --git a/xmlsecurity/test_docs/documents/valid_ooo3_2_doc1.odt b/xmlsecurity/test_docs/documents/valid_ooo3_2_doc1.odt Binary files differnew file mode 100755 index 000000000000..de1c635c198b --- /dev/null +++ b/xmlsecurity/test_docs/documents/valid_ooo3_2_doc1.odt diff --git a/xmlsecurity/test_docs/documents/valid_ooo3_2_doc_macro.odt b/xmlsecurity/test_docs/documents/valid_ooo3_2_doc_macro.odt Binary files differnew file mode 100755 index 000000000000..f6575ec88578 --- /dev/null +++ b/xmlsecurity/test_docs/documents/valid_ooo3_2_doc_macro.odt diff --git a/xmlsecurity/test_docs/documents/valid_ooo3_2_doc_unsigned_macro.odt b/xmlsecurity/test_docs/documents/valid_ooo3_2_doc_unsigned_macro.odt Binary files differnew file mode 100755 index 000000000000..41f676f6376e --- /dev/null +++ b/xmlsecurity/test_docs/documents/valid_ooo3_2_doc_unsigned_macro.odt diff --git a/xmlsecurity/test_docs/test_description.odt b/xmlsecurity/test_docs/test_description.odt Binary files differnew file mode 100644 index 000000000000..45bbb5b0d4b6 --- /dev/null +++ b/xmlsecurity/test_docs/test_description.odt diff --git a/xmlsecurity/test_docs/tools/README.txt b/xmlsecurity/test_docs/tools/README.txt new file mode 100755 index 000000000000..dd1431b7cf64 --- /dev/null +++ b/xmlsecurity/test_docs/tools/README.txt @@ -0,0 +1,23 @@ +httpserv +============ +Simple http server for testing of Certificate Revocation Lists (CRL). + +Netbeans 6.7.1 project. httpserv.jar requires java 6. + +Run with + +java -jar httpserv/dist/httpserv.jar --accept portnumber + +portnumber: an arbitrary port number to which the server should listen. + +httpserv looks for the requested file relativ to the current directory. For +example, you are in a directory which contains the index.html. From there +you run httpserv.jar: + +java -jar <path_to_wherever_it_is>/httpserv.jar --accept 8000 + +now enter in the Browser: + +localhost:8000/index.html + + diff --git a/xmlsecurity/test_docs/tools/httpserv/build.xml b/xmlsecurity/test_docs/tools/httpserv/build.xml new file mode 100755 index 000000000000..831e963bce65 --- /dev/null +++ b/xmlsecurity/test_docs/tools/httpserv/build.xml @@ -0,0 +1,74 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- You may freely edit this file. See commented blocks below for --> +<!-- some examples of how to customize the build. --> +<!-- (If you delete it and reopen the project it will be recreated.) --> +<!-- By default, only the Clean and Build commands use this build script. --> +<!-- Commands such as Run, Debug, and Test only use this build script if --> +<!-- the Compile on Save feature is turned off for the project. --> +<!-- You can turn off the Compile on Save (or Deploy on Save) setting --> +<!-- in the project's Project Properties dialog box.--> +<project name="httpserv" default="default" basedir="."> + <description>Builds, tests, and runs the project httpserv.</description> + <import file="nbproject/build-impl.xml"/> + <!-- + + There exist several targets which are by default empty and which can be + used for execution of your tasks. These targets are usually executed + before and after some main targets. They are: + + -pre-init: called before initialization of project properties + -post-init: called after initialization of project properties + -pre-compile: called before javac compilation + -post-compile: called after javac compilation + -pre-compile-single: called before javac compilation of single file + -post-compile-single: called after javac compilation of single file + -pre-compile-test: called before javac compilation of JUnit tests + -post-compile-test: called after javac compilation of JUnit tests + -pre-compile-test-single: called before javac compilation of single JUnit test + -post-compile-test-single: called after javac compilation of single JUunit test + -pre-jar: called before JAR building + -post-jar: called after JAR building + -post-clean: called after cleaning build products + + (Targets beginning with '-' are not intended to be called on their own.) + + Example of inserting an obfuscator after compilation could look like this: + + <target name="-post-compile"> + <obfuscate> + <fileset dir="${build.classes.dir}"/> + </obfuscate> + </target> + + For list of available properties check the imported + nbproject/build-impl.xml file. + + + Another way to customize the build is by overriding existing main targets. + The targets of interest are: + + -init-macrodef-javac: defines macro for javac compilation + -init-macrodef-junit: defines macro for junit execution + -init-macrodef-debug: defines macro for class debugging + -init-macrodef-java: defines macro for class execution + -do-jar-with-manifest: JAR building (if you are using a manifest) + -do-jar-without-manifest: JAR building (if you are not using a manifest) + run: execution of project + -javadoc-build: Javadoc generation + test-report: JUnit report generation + + An example of overriding the target for project execution could look like this: + + <target name="run" depends="httpserv-impl.jar"> + <exec dir="bin" executable="launcher.exe"> + <arg file="${dist.jar}"/> + </exec> + </target> + + Notice that the overridden target depends on the jar target and not only on + the compile target as the regular run target does. Again, for a list of available + properties which you can use, check the target you are overriding in the + nbproject/build-impl.xml file. + + --> +</project> diff --git a/xmlsecurity/test_docs/tools/httpserv/dist/README.TXT b/xmlsecurity/test_docs/tools/httpserv/dist/README.TXT new file mode 100755 index 000000000000..28db189bb94d --- /dev/null +++ b/xmlsecurity/test_docs/tools/httpserv/dist/README.TXT @@ -0,0 +1,33 @@ +======================== +BUILD OUTPUT DESCRIPTION +======================== + +When you build an Java application project that has a main class, the IDE +automatically copies all of the JAR +files on the projects classpath to your projects dist/lib folder. The IDE +also adds each of the JAR files to the Class-Path element in the application +JAR files manifest file (MANIFEST.MF). + +To run the project from the command line, go to the dist folder and +type the following: + +java -jar "httpserv.jar" + +To distribute this project, zip up the dist folder (including the lib folder) +and distribute the ZIP file. + +Notes: + +* If two JAR files on the project classpath have the same name, only the first +JAR file is copied to the lib folder. +* Only JAR files are copied to the lib folder. +If the classpath contains other types of files or folders, none of the +classpath elements are copied to the lib folder. In such a case, +you need to copy the classpath elements to the lib folder manually after the build. +* If a library on the projects classpath also has a Class-Path element +specified in the manifest,the content of the Class-Path element has to be on +the projects runtime path. +* To set a main class in a standard Java project, right-click the project node +in the Projects window and choose Properties. Then click Run and enter the +class name in the Main Class field. Alternatively, you can manually type the +class name in the manifest Main-Class element. diff --git a/xmlsecurity/test_docs/tools/httpserv/dist/httpserv.jar b/xmlsecurity/test_docs/tools/httpserv/dist/httpserv.jar Binary files differnew file mode 100755 index 000000000000..b80b60978dc0 --- /dev/null +++ b/xmlsecurity/test_docs/tools/httpserv/dist/httpserv.jar diff --git a/xmlsecurity/test_docs/tools/httpserv/manifest.mf b/xmlsecurity/test_docs/tools/httpserv/manifest.mf new file mode 100755 index 000000000000..328e8e5bc3b7 --- /dev/null +++ b/xmlsecurity/test_docs/tools/httpserv/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/xmlsecurity/test_docs/tools/httpserv/nbproject/build-impl.xml b/xmlsecurity/test_docs/tools/httpserv/nbproject/build-impl.xml new file mode 100755 index 000000000000..9064a3305e2d --- /dev/null +++ b/xmlsecurity/test_docs/tools/httpserv/nbproject/build-impl.xml @@ -0,0 +1,700 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- +*** GENERATED FROM project.xml - DO NOT EDIT *** +*** EDIT ../build.xml INSTEAD *** + +For the purpose of easier reading the script +is divided into following sections: + + - initialization + - compilation + - jar + - execution + - debugging + - javadoc + - junit compilation + - junit execution + - junit debugging + - applet + - cleanup + + --> +<project xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1" xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3" xmlns:jaxrpc="http://www.netbeans.org/ns/j2se-project/jax-rpc" basedir=".." default="default" name="httpserv-impl"> + <fail message="Please build using Ant 1.7.1 or higher."> + <condition> + <not> + <antversion atleast="1.7.1"/> + </not> + </condition> + </fail> + <target depends="test,jar,javadoc" description="Build and test whole project." name="default"/> + <!-- + ====================== + INITIALIZATION SECTION + ====================== + --> + <target name="-pre-init"> + <!-- Empty placeholder for easier customization. --> + <!-- You can override this target in the ../build.xml file. --> + </target> + <target depends="-pre-init" name="-init-private"> + <property file="nbproject/private/config.properties"/> + <property file="nbproject/private/configs/${config}.properties"/> + <property file="nbproject/private/private.properties"/> + </target> + <target depends="-pre-init,-init-private" name="-init-user"> + <property file="${user.properties.file}"/> + <!-- The two properties below are usually overridden --> + <!-- by the active platform. Just a fallback. --> + <property name="default.javac.source" value="1.4"/> + <property name="default.javac.target" value="1.4"/> + </target> + <target depends="-pre-init,-init-private,-init-user" name="-init-project"> + <property file="nbproject/configs/${config}.properties"/> + <property file="nbproject/project.properties"/> + </target> + <target depends="-pre-init,-init-private,-init-user,-init-project,-init-macrodef-property" name="-do-init"> + <available file="${manifest.file}" property="manifest.available"/> + <condition property="manifest.available+main.class"> + <and> + <isset property="manifest.available"/> + <isset property="main.class"/> + <not> + <equals arg1="${main.class}" arg2="" trim="true"/> + </not> + </and> + </condition> + <condition property="manifest.available+main.class+mkdist.available"> + <and> + <istrue value="${manifest.available+main.class}"/> + <isset property="libs.CopyLibs.classpath"/> + </and> + </condition> + <condition property="have.tests"> + <or> + <available file="${test.src.dir}"/> + </or> + </condition> + <condition property="have.sources"> + <or> + <available file="${src.dir}"/> + </or> + </condition> + <condition property="netbeans.home+have.tests"> + <and> + <isset property="netbeans.home"/> + <isset property="have.tests"/> + </and> + </condition> + <condition property="no.javadoc.preview"> + <and> + <isset property="javadoc.preview"/> + <isfalse value="${javadoc.preview}"/> + </and> + </condition> + <property name="run.jvmargs" value=""/> + <property name="javac.compilerargs" value=""/> + <property name="work.dir" value="${basedir}"/> + <condition property="no.deps"> + <and> + <istrue value="${no.dependencies}"/> + </and> + </condition> + <property name="javac.debug" value="true"/> + <property name="javadoc.preview" value="true"/> + <property name="application.args" value=""/> + <property name="source.encoding" value="${file.encoding}"/> + <condition property="javadoc.encoding.used" value="${javadoc.encoding}"> + <and> + <isset property="javadoc.encoding"/> + <not> + <equals arg1="${javadoc.encoding}" arg2=""/> + </not> + </and> + </condition> + <property name="javadoc.encoding.used" value="${source.encoding}"/> + <property name="includes" value="**"/> + <property name="excludes" value=""/> + <property name="do.depend" value="false"/> + <condition property="do.depend.true"> + <istrue value="${do.depend}"/> + </condition> + <condition else="" property="javac.compilerargs.jaxws" value="-Djava.endorsed.dirs='${jaxws.endorsed.dir}'"> + <and> + <isset property="jaxws.endorsed.dir"/> + <available file="nbproject/jaxws-build.xml"/> + </and> + </condition> + </target> + <target name="-post-init"> + <!-- Empty placeholder for easier customization. --> + <!-- You can override this target in the ../build.xml file. --> + </target> + <target depends="-pre-init,-init-private,-init-user,-init-project,-do-init" name="-init-check"> + <fail unless="src.dir">Must set src.dir</fail> + <fail unless="test.src.dir">Must set test.src.dir</fail> + <fail unless="build.dir">Must set build.dir</fail> + <fail unless="dist.dir">Must set dist.dir</fail> + <fail unless="build.classes.dir">Must set build.classes.dir</fail> + <fail unless="dist.javadoc.dir">Must set dist.javadoc.dir</fail> + <fail unless="build.test.classes.dir">Must set build.test.classes.dir</fail> + <fail unless="build.test.results.dir">Must set build.test.results.dir</fail> + <fail unless="build.classes.excludes">Must set build.classes.excludes</fail> + <fail unless="dist.jar">Must set dist.jar</fail> + </target> + <target name="-init-macrodef-property"> + <macrodef name="property" uri="http://www.netbeans.org/ns/j2se-project/1"> + <attribute name="name"/> + <attribute name="value"/> + <sequential> + <property name="@{name}" value="${@{value}}"/> + </sequential> + </macrodef> + </target> + <target name="-init-macrodef-javac"> + <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3"> + <attribute default="${src.dir}" name="srcdir"/> + <attribute default="${build.classes.dir}" name="destdir"/> + <attribute default="${javac.classpath}" name="classpath"/> + <attribute default="${includes}" name="includes"/> + <attribute default="${excludes}" name="excludes"/> + <attribute default="${javac.debug}" name="debug"/> + <attribute default="${empty.dir}" name="sourcepath"/> + <attribute default="${empty.dir}" name="gensrcdir"/> + <element name="customize" optional="true"/> + <sequential> + <property location="${build.dir}/empty" name="empty.dir"/> + <mkdir dir="${empty.dir}"/> + <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}"> + <src> + <dirset dir="@{gensrcdir}" erroronmissingdir="false"> + <include name="*"/> + </dirset> + </src> + <classpath> + <path path="@{classpath}"/> + </classpath> + <compilerarg line="${javac.compilerargs} ${javac.compilerargs.jaxws}"/> + <customize/> + </javac> + </sequential> + </macrodef> + <macrodef name="depend" uri="http://www.netbeans.org/ns/j2se-project/3"> + <attribute default="${src.dir}" name="srcdir"/> + <attribute default="${build.classes.dir}" name="destdir"/> + <attribute default="${javac.classpath}" name="classpath"/> + <sequential> + <depend cache="${build.dir}/depcache" destdir="@{destdir}" excludes="${excludes}" includes="${includes}" srcdir="@{srcdir}"> + <classpath> + <path path="@{classpath}"/> + </classpath> + </depend> + </sequential> + </macrodef> + <macrodef name="force-recompile" uri="http://www.netbeans.org/ns/j2se-project/3"> + <attribute default="${build.classes.dir}" name="destdir"/> + <sequential> + <fail unless="javac.includes">Must set javac.includes</fail> + <pathconvert pathsep="," property="javac.includes.binary"> + <path> + <filelist dir="@{destdir}" files="${javac.includes}"/> + </path> + <globmapper from="*.java" to="*.class"/> + </pathconvert> + <delete> + <files includes="${javac.includes.binary}"/> + </delete> + </sequential> + </macrodef> + </target> + <target name="-init-macrodef-junit"> + <macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3"> + <attribute default="${includes}" name="includes"/> + <attribute default="${excludes}" name="excludes"/> + <attribute default="**" name="testincludes"/> + <sequential> + <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" showoutput="true"> + <batchtest todir="${build.test.results.dir}"> + <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}"> + <filename name="@{testincludes}"/> + </fileset> + </batchtest> + <classpath> + <path path="${run.test.classpath}"/> + </classpath> + <syspropertyset> + <propertyref prefix="test-sys-prop."/> + <mapper from="test-sys-prop.*" to="*" type="glob"/> + </syspropertyset> + <formatter type="brief" usefile="false"/> + <formatter type="xml"/> + <jvmarg line="${run.jvmargs}"/> + </junit> + </sequential> + </macrodef> + </target> + <target depends="-init-debug-args" name="-init-macrodef-nbjpda"> + <macrodef name="nbjpdastart" uri="http://www.netbeans.org/ns/j2se-project/1"> + <attribute default="${main.class}" name="name"/> + <attribute default="${debug.classpath}" name="classpath"/> + <attribute default="" name="stopclassname"/> + <sequential> + <nbjpdastart addressproperty="jpda.address" name="@{name}" stopclassname="@{stopclassname}" transport="${debug-transport}"> + <classpath> + <path path="@{classpath}"/> + </classpath> + </nbjpdastart> + </sequential> + </macrodef> + <macrodef name="nbjpdareload" uri="http://www.netbeans.org/ns/j2se-project/1"> + <attribute default="${build.classes.dir}" name="dir"/> + <sequential> + <nbjpdareload> + <fileset dir="@{dir}" includes="${fix.classes}"> + <include name="${fix.includes}*.class"/> + </fileset> + </nbjpdareload> + </sequential> + </macrodef> + </target> + <target name="-init-debug-args"> + <property name="version-output" value="java version "${ant.java.version}"/> + <condition property="have-jdk-older-than-1.4"> + <or> + <contains string="${version-output}" substring="java version "1.0"/> + <contains string="${version-output}" substring="java version "1.1"/> + <contains string="${version-output}" substring="java version "1.2"/> + <contains string="${version-output}" substring="java version "1.3"/> + </or> + </condition> + <condition else="-Xdebug" property="debug-args-line" value="-Xdebug -Xnoagent -Djava.compiler=none"> + <istrue value="${have-jdk-older-than-1.4}"/> + </condition> + <condition else="dt_socket" property="debug-transport-by-os" value="dt_shmem"> + <os family="windows"/> + </condition> + <condition else="${debug-transport-by-os}" property="debug-transport" value="${debug.transport}"> + <isset property="debug.transport"/> + </condition> + </target> + <target depends="-init-debug-args" name="-init-macrodef-debug"> + <macrodef name="debug" uri="http://www.netbeans.org/ns/j2se-project/3"> + <attribute default="${main.class}" name="classname"/> + <attribute default="${debug.classpath}" name="classpath"/> + <element name="customize" optional="true"/> + <sequential> + <java classname="@{classname}" dir="${work.dir}" fork="true"> + <jvmarg line="${debug-args-line}"/> + <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/> + <jvmarg value="-Dfile.encoding=${source.encoding}"/> + <redirector errorencoding="${source.encoding}" inputencoding="${source.encoding}" outputencoding="${source.encoding}"/> + <jvmarg line="${run.jvmargs}"/> + <classpath> + <path path="@{classpath}"/> + </classpath> + <syspropertyset> + <propertyref prefix="run-sys-prop."/> + <mapper from="run-sys-prop.*" to="*" type="glob"/> + </syspropertyset> + <customize/> + </java> + </sequential> + </macrodef> + </target> + <target name="-init-macrodef-java"> + <macrodef name="java" uri="http://www.netbeans.org/ns/j2se-project/1"> + <attribute default="${main.class}" name="classname"/> + <attribute default="${run.classpath}" name="classpath"/> + <element name="customize" optional="true"/> + <sequential> + <java classname="@{classname}" dir="${work.dir}" fork="true"> + <jvmarg value="-Dfile.encoding=${source.encoding}"/> + <redirector errorencoding="${source.encoding}" inputencoding="${source.encoding}" outputencoding="${source.encoding}"/> + <jvmarg line="${run.jvmargs}"/> + <classpath> + <path path="@{classpath}"/> + </classpath> + <syspropertyset> + <propertyref prefix="run-sys-prop."/> + <mapper from="run-sys-prop.*" to="*" type="glob"/> + </syspropertyset> + <customize/> + </java> + </sequential> + </macrodef> + </target> + <target name="-init-presetdef-jar"> + <presetdef name="jar" uri="http://www.netbeans.org/ns/j2se-project/1"> + <jar compress="${jar.compress}" jarfile="${dist.jar}"> + <j2seproject1:fileset dir="${build.classes.dir}"/> + </jar> + </presetdef> + </target> + <target depends="-pre-init,-init-private,-init-user,-init-project,-do-init,-post-init,-init-check,-init-macrodef-property,-init-macrodef-javac,-init-macrodef-junit,-init-macrodef-nbjpda,-init-macrodef-debug,-init-macrodef-java,-init-presetdef-jar" name="init"/> + <!-- + =================== + COMPILATION SECTION + =================== + --> + <target depends="init" name="deps-jar" unless="no.deps"/> + <target depends="init,-check-automatic-build,-clean-after-automatic-build" name="-verify-automatic-build"/> + <target depends="init" name="-check-automatic-build"> + <available file="${build.classes.dir}/.netbeans_automatic_build" property="netbeans.automatic.build"/> + </target> + <target depends="init" if="netbeans.automatic.build" name="-clean-after-automatic-build"> + <antcall target="clean"/> + </target> + <target depends="init,deps-jar" name="-pre-pre-compile"> + <mkdir dir="${build.classes.dir}"/> + </target> + <target name="-pre-compile"> + <!-- Empty placeholder for easier customization. --> + <!-- You can override this target in the ../build.xml file. --> + </target> + <target if="do.depend.true" name="-compile-depend"> + <pathconvert property="build.generated.subdirs"> + <dirset dir="${build.generated.sources.dir}" erroronmissingdir="false"> + <include name="*"/> + </dirset> + </pathconvert> + <j2seproject3:depend srcdir="${src.dir}:${build.generated.subdirs}"/> + </target> + <target depends="init,deps-jar,-pre-pre-compile,-pre-compile,-compile-depend" if="have.sources" name="-do-compile"> + <j2seproject3:javac gensrcdir="${build.generated.sources.dir}"/> + <copy todir="${build.classes.dir}"> + <fileset dir="${src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/> + </copy> + </target> + <target name="-post-compile"> + <!-- Empty placeholder for easier customization. --> + <!-- You can override this target in the ../build.xml file. --> + </target> + <target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile,-do-compile,-post-compile" description="Compile project." name="compile"/> + <target name="-pre-compile-single"> + <!-- Empty placeholder for easier customization. --> + <!-- You can override this target in the ../build.xml file. --> + </target> + <target depends="init,deps-jar,-pre-pre-compile" name="-do-compile-single"> + <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail> + <j2seproject3:force-recompile/> + <j2seproject3:javac excludes="" gensrcdir="${build.generated.sources.dir}" includes="${javac.includes}" sourcepath="${src.dir}"/> + </target> + <target name="-post-compile-single"> + <!-- Empty placeholder for easier customization. --> + <!-- You can override this target in the ../build.xml file. --> + </target> + <target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile-single,-do-compile-single,-post-compile-single" name="compile-single"/> + <!-- + ==================== + JAR BUILDING SECTION + ==================== + --> + <target depends="init" name="-pre-pre-jar"> + <dirname file="${dist.jar}" property="dist.jar.dir"/> + <mkdir dir="${dist.jar.dir}"/> + </target> + <target name="-pre-jar"> + <!-- Empty placeholder for easier customization. --> + <!-- You can override this target in the ../build.xml file. --> + </target> + <target depends="init,compile,-pre-pre-jar,-pre-jar" name="-do-jar-without-manifest" unless="manifest.available"> + <j2seproject1:jar/> + </target> + <target depends="init,compile,-pre-pre-jar,-pre-jar" if="manifest.available" name="-do-jar-with-manifest" unless="manifest.available+main.class"> + <j2seproject1:jar manifest="${manifest.file}"/> + </target> + <target depends="init,compile,-pre-pre-jar,-pre-jar" if="manifest.available+main.class" name="-do-jar-with-mainclass" unless="manifest.available+main.class+mkdist.available"> + <j2seproject1:jar manifest="${manifest.file}"> + <j2seproject1:manifest> + <j2seproject1:attribute name="Main-Class" value="${main.class}"/> + </j2seproject1:manifest> + </j2seproject1:jar> + <echo>To run this application from the command line without Ant, try:</echo> + <property location="${build.classes.dir}" name="build.classes.dir.resolved"/> + <property location="${dist.jar}" name="dist.jar.resolved"/> + <pathconvert property="run.classpath.with.dist.jar"> + <path path="${run.classpath}"/> + <map from="${build.classes.dir.resolved}" to="${dist.jar.resolved}"/> + </pathconvert> + <echo>java -cp "${run.classpath.with.dist.jar}" ${main.class}</echo> + </target> + <target depends="init,compile,-pre-pre-jar,-pre-jar" if="manifest.available+main.class+mkdist.available" name="-do-jar-with-libraries"> + <property location="${build.classes.dir}" name="build.classes.dir.resolved"/> + <pathconvert property="run.classpath.without.build.classes.dir"> + <path path="${run.classpath}"/> + <map from="${build.classes.dir.resolved}" to=""/> + </pathconvert> + <pathconvert pathsep=" " property="jar.classpath"> + <path path="${run.classpath.without.build.classes.dir}"/> + <chainedmapper> + <flattenmapper/> + <globmapper from="*" to="lib/*"/> + </chainedmapper> + </pathconvert> + <taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/> + <copylibs compress="${jar.compress}" jarfile="${dist.jar}" manifest="${manifest.file}" runtimeclasspath="${run.classpath.without.build.classes.dir}"> + <fileset dir="${build.classes.dir}"/> + <manifest> + <attribute name="Main-Class" value="${main.class}"/> + <attribute name="Class-Path" value="${jar.classpath}"/> + </manifest> + </copylibs> + <echo>To run this application from the command line without Ant, try:</echo> + <property location="${dist.jar}" name="dist.jar.resolved"/> + <echo>java -jar "${dist.jar.resolved}"</echo> + </target> + <target depends="init,compile,-pre-pre-jar,-pre-jar" if="libs.CopyLibs.classpath" name="-do-jar-with-libraries-without-manifest" unless="manifest.available+main.class"> + <property location="${build.classes.dir}" name="build.classes.dir.resolved"/> + <pathconvert property="run.classpath.without.build.classes.dir"> + <path path="${run.classpath}"/> + <map from="${build.classes.dir.resolved}" to=""/> + </pathconvert> + <pathconvert pathsep=" " property="jar.classpath"> + <path path="${run.classpath.without.build.classes.dir}"/> + <chainedmapper> + <flattenmapper/> + <globmapper from="*" to="lib/*"/> + </chainedmapper> + </pathconvert> + <taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/> + <copylibs compress="${jar.compress}" jarfile="${dist.jar}" runtimeclasspath="${run.classpath.without.build.classes.dir}"> + <fileset dir="${build.classes.dir}"/> + </copylibs> + </target> + <target name="-post-jar"> + <!-- Empty placeholder for easier customization. --> + <!-- You can override this target in the ../build.xml file. --> + </target> + <target depends="init,compile,-pre-jar,-do-jar-with-manifest,-do-jar-without-manifest,-do-jar-with-mainclass,-do-jar-with-libraries,-do-jar-with-libraries-without-manifest,-post-jar" description="Build JAR." name="jar"/> + <!-- + ================= + EXECUTION SECTION + ================= + --> + <target depends="init,compile" description="Run a main class." name="run"> + <j2seproject1:java> + <customize> + <arg line="${application.args}"/> + </customize> + </j2seproject1:java> + </target> + <target name="-do-not-recompile"> + <property name="javac.includes.binary" value=""/> + </target> + <target depends="init,-do-not-recompile,compile-single" name="run-single"> + <fail unless="run.class">Must select one file in the IDE or set run.class</fail> + <j2seproject1:java classname="${run.class}"/> + </target> + <target depends="init,-do-not-recompile,compile-test-single" name="run-test-with-main"> + <fail unless="run.class">Must select one file in the IDE or set run.class</fail> + <j2seproject1:java classname="${run.class}" classpath="${run.test.classpath}"/> + </target> + <!-- + ================= + DEBUGGING SECTION + ================= + --> + <target depends="init" if="netbeans.home" name="-debug-start-debugger"> + <j2seproject1:nbjpdastart name="${debug.class}"/> + </target> + <target depends="init" if="netbeans.home" name="-debug-start-debugger-main-test"> + <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${debug.class}"/> + </target> + <target depends="init,compile" name="-debug-start-debuggee"> + <j2seproject3:debug> + <customize> + <arg line="${application.args}"/> + </customize> + </j2seproject3:debug> + </target> + <target depends="init,compile,-debug-start-debugger,-debug-start-debuggee" description="Debug project in IDE." if="netbeans.home" name="debug"/> + <target depends="init" if="netbeans.home" name="-debug-start-debugger-stepinto"> + <j2seproject1:nbjpdastart stopclassname="${main.class}"/> + </target> + <target depends="init,compile,-debug-start-debugger-stepinto,-debug-start-debuggee" if="netbeans.home" name="debug-stepinto"/> + <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-single"> + <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail> + <j2seproject3:debug classname="${debug.class}"/> + </target> + <target depends="init,-do-not-recompile,compile-single,-debug-start-debugger,-debug-start-debuggee-single" if="netbeans.home" name="debug-single"/> + <target depends="init,compile-test-single" if="netbeans.home" name="-debug-start-debuggee-main-test"> + <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail> + <j2seproject3:debug classname="${debug.class}" classpath="${debug.test.classpath}"/> + </target> + <target depends="init,-do-not-recompile,compile-test-single,-debug-start-debugger-main-test,-debug-start-debuggee-main-test" if="netbeans.home" name="debug-test-with-main"/> + <target depends="init" name="-pre-debug-fix"> + <fail unless="fix.includes">Must set fix.includes</fail> + <property name="javac.includes" value="${fix.includes}.java"/> + </target> + <target depends="init,-pre-debug-fix,compile-single" if="netbeans.home" name="-do-debug-fix"> + <j2seproject1:nbjpdareload/> + </target> + <target depends="init,-pre-debug-fix,-do-debug-fix" if="netbeans.home" name="debug-fix"/> + <!-- + =============== + JAVADOC SECTION + =============== + --> + <target depends="init" name="-javadoc-build"> + <mkdir dir="${dist.javadoc.dir}"/> + <javadoc additionalparam="${javadoc.additionalparam}" author="${javadoc.author}" charset="UTF-8" destdir="${dist.javadoc.dir}" docencoding="UTF-8" encoding="${javadoc.encoding.used}" failonerror="true" noindex="${javadoc.noindex}" nonavbar="${javadoc.nonavbar}" notree="${javadoc.notree}" private="${javadoc.private}" source="${javac.source}" splitindex="${javadoc.splitindex}" use="${javadoc.use}" useexternalfile="true" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}"> + <classpath> + <path path="${javac.classpath}"/> + </classpath> + <fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}"> + <filename name="**/*.java"/> + </fileset> + <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false"> + <include name="**/*.java"/> + </fileset> + </javadoc> + </target> + <target depends="init,-javadoc-build" if="netbeans.home" name="-javadoc-browse" unless="no.javadoc.preview"> + <nbbrowse file="${dist.javadoc.dir}/index.html"/> + </target> + <target depends="init,-javadoc-build,-javadoc-browse" description="Build Javadoc." name="javadoc"/> + <!-- + ========================= + JUNIT COMPILATION SECTION + ========================= + --> + <target depends="init,compile" if="have.tests" name="-pre-pre-compile-test"> + <mkdir dir="${build.test.classes.dir}"/> + </target> + <target name="-pre-compile-test"> + <!-- Empty placeholder for easier customization. --> + <!-- You can override this target in the ../build.xml file. --> + </target> + <target if="do.depend.true" name="-compile-test-depend"> + <j2seproject3:depend classpath="${javac.test.classpath}" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/> + </target> + <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-compile-test-depend" if="have.tests" name="-do-compile-test"> + <j2seproject3:javac classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/> + <copy todir="${build.test.classes.dir}"> + <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/> + </copy> + </target> + <target name="-post-compile-test"> + <!-- Empty placeholder for easier customization. --> + <!-- You can override this target in the ../build.xml file. --> + </target> + <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-do-compile-test,-post-compile-test" name="compile-test"/> + <target name="-pre-compile-test-single"> + <!-- Empty placeholder for easier customization. --> + <!-- You can override this target in the ../build.xml file. --> + </target> + <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single" if="have.tests" name="-do-compile-test-single"> + <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail> + <j2seproject3:force-recompile destdir="${build.test.classes.dir}"/> + <j2seproject3:javac classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" excludes="" includes="${javac.includes}" sourcepath="${test.src.dir}" srcdir="${test.src.dir}"/> + <copy todir="${build.test.classes.dir}"> + <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/> + </copy> + </target> + <target name="-post-compile-test-single"> + <!-- Empty placeholder for easier customization. --> + <!-- You can override this target in the ../build.xml file. --> + </target> + <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single,-do-compile-test-single,-post-compile-test-single" name="compile-test-single"/> + <!-- + ======================= + JUNIT EXECUTION SECTION + ======================= + --> + <target depends="init" if="have.tests" name="-pre-test-run"> + <mkdir dir="${build.test.results.dir}"/> + </target> + <target depends="init,compile-test,-pre-test-run" if="have.tests" name="-do-test-run"> + <j2seproject3:junit testincludes="**/*Test.java"/> + </target> + <target depends="init,compile-test,-pre-test-run,-do-test-run" if="have.tests" name="-post-test-run"> + <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail> + </target> + <target depends="init" if="have.tests" name="test-report"/> + <target depends="init" if="netbeans.home+have.tests" name="-test-browse"/> + <target depends="init,compile-test,-pre-test-run,-do-test-run,test-report,-post-test-run,-test-browse" description="Run unit tests." name="test"/> + <target depends="init" if="have.tests" name="-pre-test-run-single"> + <mkdir dir="${build.test.results.dir}"/> + </target> + <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single"> + <fail unless="test.includes">Must select some files in the IDE or set test.includes</fail> + <j2seproject3:junit excludes="" includes="${test.includes}"/> + </target> + <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single" if="have.tests" name="-post-test-run-single"> + <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail> + </target> + <target depends="init,-do-not-recompile,compile-test-single,-pre-test-run-single,-do-test-run-single,-post-test-run-single" description="Run single unit test." name="test-single"/> + <!-- + ======================= + JUNIT DEBUGGING SECTION + ======================= + --> + <target depends="init,compile-test" if="have.tests" name="-debug-start-debuggee-test"> + <fail unless="test.class">Must select one file in the IDE or set test.class</fail> + <property location="${build.test.results.dir}/TEST-${test.class}.xml" name="test.report.file"/> + <delete file="${test.report.file}"/> + <mkdir dir="${build.test.results.dir}"/> + <j2seproject3:debug classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner" classpath="${ant.home}/lib/ant.jar:${ant.home}/lib/ant-junit.jar:${debug.test.classpath}"> + <customize> + <syspropertyset> + <propertyref prefix="test-sys-prop."/> + <mapper from="test-sys-prop.*" to="*" type="glob"/> + </syspropertyset> + <arg value="${test.class}"/> + <arg value="showoutput=true"/> + <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.BriefJUnitResultFormatter"/> + <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,${test.report.file}"/> + </customize> + </j2seproject3:debug> + </target> + <target depends="init,compile-test" if="netbeans.home+have.tests" name="-debug-start-debugger-test"> + <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${test.class}"/> + </target> + <target depends="init,-do-not-recompile,compile-test-single,-debug-start-debugger-test,-debug-start-debuggee-test" name="debug-test"/> + <target depends="init,-pre-debug-fix,compile-test-single" if="netbeans.home" name="-do-debug-fix-test"> + <j2seproject1:nbjpdareload dir="${build.test.classes.dir}"/> + </target> + <target depends="init,-pre-debug-fix,-do-debug-fix-test" if="netbeans.home" name="debug-fix-test"/> + <!-- + ========================= + APPLET EXECUTION SECTION + ========================= + --> + <target depends="init,compile-single" name="run-applet"> + <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail> + <j2seproject1:java classname="sun.applet.AppletViewer"> + <customize> + <arg value="${applet.url}"/> + </customize> + </j2seproject1:java> + </target> + <!-- + ========================= + APPLET DEBUGGING SECTION + ========================= + --> + <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-applet"> + <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail> + <j2seproject3:debug classname="sun.applet.AppletViewer"> + <customize> + <arg value="${applet.url}"/> + </customize> + </j2seproject3:debug> + </target> + <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-applet" if="netbeans.home" name="debug-applet"/> + <!-- + =============== + CLEANUP SECTION + =============== + --> + <target depends="init" name="deps-clean" unless="no.deps"/> + <target depends="init" name="-do-clean"> + <delete dir="${build.dir}"/> + <delete dir="${dist.dir}"/> + </target> + <target name="-post-clean"> + <!-- Empty placeholder for easier customization. --> + <!-- You can override this target in the ../build.xml file. --> + </target> + <target depends="init,deps-clean,-do-clean,-post-clean" description="Clean build products." name="clean"/> +</project> diff --git a/xmlsecurity/test_docs/tools/httpserv/nbproject/genfiles.properties b/xmlsecurity/test_docs/tools/httpserv/nbproject/genfiles.properties new file mode 100644 index 000000000000..d8139c888981 --- /dev/null +++ b/xmlsecurity/test_docs/tools/httpserv/nbproject/genfiles.properties @@ -0,0 +1,9 @@ +# x-no-translate +build.xml.data.CRC32=8071b819 +build.xml.script.CRC32=deb21e95 +build.xml.stylesheet.CRC32=958a1d3e@1.26.2.45 +# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. +# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. +nbproject/build-impl.xml.data.CRC32=8071b819 +nbproject/build-impl.xml.script.CRC32=21d1be7e +nbproject/build-impl.xml.stylesheet.CRC32=5c621a33@1.26.2.45 diff --git a/xmlsecurity/test_docs/tools/httpserv/nbproject/project.properties b/xmlsecurity/test_docs/tools/httpserv/nbproject/project.properties new file mode 100644 index 000000000000..049b5539fda3 --- /dev/null +++ b/xmlsecurity/test_docs/tools/httpserv/nbproject/project.properties @@ -0,0 +1,65 @@ +# x-no-translate +application.title=httpserv +application.vendor=jochen +build.classes.dir=${build.dir}/classes +build.classes.excludes=**/*.java,**/*.form +# This directory is removed when the project is cleaned: +build.dir=build +build.generated.dir=${build.dir}/generated +build.generated.sources.dir=${build.dir}/generated-sources +# Only compile against the classpath explicitly listed here: +build.sysclasspath=ignore +build.test.classes.dir=${build.dir}/test/classes +build.test.results.dir=${build.dir}/test/results +# Uncomment to specify the preferred debugger connection transport: +#debug.transport=dt_socket +debug.classpath=\ + ${run.classpath} +debug.test.classpath=\ + ${run.test.classpath} +# This directory is removed when the project is cleaned: +dist.dir=dist +dist.jar=${dist.dir}/httpserv.jar +dist.javadoc.dir=${dist.dir}/javadoc +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.source=1.5 +javac.target=1.5 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir}:\ + ${libs.junit.classpath}:\ + ${libs.junit_4.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +main.class=httpserv.Main +manifest.file=manifest.mf +meta.inf.dir=${src.dir}/META-INF +platform.active=default_platform +run.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +# Space-separated list of JVM arguments used when running the project +# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value +# or test-sys-prop.name=value to set system properties for unit tests): +run.jvmargs= +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +source.encoding=UTF-8 +src.dir=src +test.src.dir=test diff --git a/xmlsecurity/test_docs/tools/httpserv/nbproject/project.xml b/xmlsecurity/test_docs/tools/httpserv/nbproject/project.xml new file mode 100755 index 000000000000..6fc771ca7669 --- /dev/null +++ b/xmlsecurity/test_docs/tools/httpserv/nbproject/project.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project xmlns="http://www.netbeans.org/ns/project/1"> + <type>org.netbeans.modules.java.j2seproject</type> + <configuration> + <data xmlns="http://www.netbeans.org/ns/j2se-project/3"> + <name>httpserv</name> + <source-roots> + <root id="src.dir"/> + </source-roots> + <test-roots> + <root id="test.src.dir"/> + </test-roots> + </data> + </configuration> +</project> diff --git a/xmlsecurity/test_docs/tools/httpserv/src/httpserv/Main.java b/xmlsecurity/test_docs/tools/httpserv/src/httpserv/Main.java new file mode 100755 index 000000000000..c67e41549c5f --- /dev/null +++ b/xmlsecurity/test_docs/tools/httpserv/src/httpserv/Main.java @@ -0,0 +1,213 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: WeakReference.java,v $ + * $Revision: 1.3 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +package httpserv; + +import com.sun.net.httpserver.Headers; +import com.sun.net.httpserver.HttpExchange; +import com.sun.net.httpserver.HttpHandler; +import com.sun.net.httpserver.HttpServer; +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.OutputStream; +import java.net.InetSocketAddress; + +/** + * + * @author jochen + */ +public class Main { + + /** + * @param args the command line arguments + */ + public static void main(String[] args) { + try { + + Option[] opts = new Option[2]; + opts[0] = new Option("--help", "-h", false); + opts[1] = new Option("--accept", "-a", true); + if (!parseOptions(args, opts)) { + return; + } + HttpServer server = HttpServer.create( + new InetSocketAddress((Integer) opts[1].value), 0); + server.createContext("/", new MyHandler()); + server.setExecutor(null); + server.start(); + } catch (Exception e) { + e.printStackTrace(); + } + } // TODO code application logic here + + static boolean parseOptions(String[] args, Option[] inout_options) { + if (args.length == 0) { + printUsage(); + return false; + } + + boolean bWrongArgs = true; + Option currentOpt = null; + + for (String s : args) { + // get the value for an option + if (currentOpt != null && currentOpt.bHasValue) { + //now we expect the value for the option + //check the type + try { + if (currentOpt.sLong.equals("--accept")) { + currentOpt.value = Integer.decode(s); + } + } catch (Exception e ) { + printUsage(); + return false; + } + currentOpt = null; + continue; + } else { + currentOpt = null; + } + + + // get the option + for (Option o : inout_options) { + if (s.equals(o.sLong) || s.equals(o.sShort)) { + bWrongArgs = false; + //special handling for --help + if (o.sLong.equals("--help")) { + printUsage(); + return false; + } + else + { + currentOpt = o; + if (!o.bHasValue) { + o.bSet = true; + } + break; + } + } + } + } + + if (bWrongArgs) { + printUsage(); + return false; + } + return true; + } + + static void printUsage() { + String usage = new String( + "Usage: \n" + + "java -jar httpserv [options] \n" + + "\n" + + "Options are: \n" + + "-h --help \t this help \n" + + "-a --accept port \t the port number to which this server listens \n"); + System.out.println(usage); + } +} + +class MyHandler implements HttpHandler { + + public void handle(HttpExchange xchange) throws IOException { + try { + //First get the path to the file + File fileCurrent = new File("."); + String sRequestPath = xchange.getRequestURI().getPath(); + System.out.println("requested: " + sRequestPath); + File fileRequest = new File(new File(".").getCanonicalPath(), sRequestPath); + if (!fileRequest.exists()) { + throw new Exception("The file " + fileRequest.toString() + " does not exist!\n"); + } + else if (fileRequest.isDirectory()) { + throw new Exception(fileRequest.toString() + " is a directory!\n"); + } + + + //Read the file into a byte array + byte[] data = new byte[(int) fileRequest.length()]; + FileInputStream fr = new FileInputStream(fileRequest); + int count = fr.read(data); + + //set the Content-type header + Headers h = xchange.getResponseHeaders(); + String canonicalPath = fileRequest.getCanonicalPath(); + int lastIndex = canonicalPath.lastIndexOf("."); + String fileExtension = canonicalPath.substring(lastIndex + 1); + + if (fileExtension.equalsIgnoreCase("crl")) + { + //h.set("Content-Type","application/x-pkcs7-crl"); + h.set("Content-Type","application/pkix-crl"); + } + else if (fileExtension.equalsIgnoreCase("crt") + || fileExtension.equalsIgnoreCase("cer") + || fileExtension.equalsIgnoreCase("der")) + { + h.set("Content-Type", "application/x-x509-ca-cert"); + } + + //write out the requested file + xchange.sendResponseHeaders(200, data.length); + OutputStream os = xchange.getResponseBody(); + os.write(data); + os.close(); + System.out.println("delivered: " + fileRequest.toString()); + + } catch (Exception e) { + xchange.sendResponseHeaders(404, e.getMessage().length()); + OutputStream os = xchange.getResponseBody(); + os.write(e.getMessage().getBytes()); + os.close(); + System.out.println("Error: " + e.getMessage()); + } + } +} + +class Option { + + Option(String _sLong, String _sShort, boolean _bHasValue) { + sLong = _sLong; + sShort = _sShort; + bHasValue = _bHasValue; + } + String sLong; + String sShort; + boolean bHasValue; + Object value; + //indicates if this option was set if it does not need a value. Otherwise value + //is set. + boolean bSet; +} + + diff --git a/xmlsecurity/tools/demo/JavaFlatFilter.java b/xmlsecurity/tools/demo/JavaFlatFilter.java new file mode 100644 index 000000000000..331ace804072 --- /dev/null +++ b/xmlsecurity/tools/demo/JavaFlatFilter.java @@ -0,0 +1,225 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +package com.sun.star.xml.security.eval; + +import com.sun.star.registry.XRegistryKey; +import com.sun.star.comp.loader.FactoryHelper; +import com.sun.star.uno.UnoRuntime; +import com.sun.star.xml.sax.InputSource; +import com.sun.star.xml.sax.XDocumentHandler; +import com.sun.star.xml.sax.XParser; +import com.sun.star.xml.sax.XDTDHandler; +import com.sun.star.xml.sax.XEntityResolver; +import com.sun.star.xml.sax.XErrorHandler; +import com.sun.star.xml.sax.XAttributeList; +import com.sun.star.lang.XSingleServiceFactory; +import com.sun.star.lang.XMultiServiceFactory; +import com.sun.star.lang.XTypeProvider; +import com.sun.star.lang.XServiceInfo; +import com.sun.star.lang.Locale; + +/* + * the JavaFlatFilter class is a pure java filter, which does nothing + * but forwarding the SAX events to the next document handler. + * The purpose of this class is to calculate the time consumed by + * the UNO C++/Java bridge during exporting/importing. + */ +public class JavaFlatFilter extends Object + implements XDocumentHandler, XParser, XTypeProvider, XServiceInfo +{ + XDocumentHandler m_xDocumentHandler; + + /* XDocumentHandler */ + public void startDocument() + throws com.sun.star.xml.sax.SAXException + { + m_xDocumentHandler.startDocument(); + } + + public void endDocument() + throws com.sun.star.xml.sax.SAXException + { + m_xDocumentHandler.endDocument(); + } + + public void startElement (String aName, com.sun.star.xml.sax.XAttributeList xAttribs ) + throws com.sun.star.xml.sax.SAXException + { + m_xDocumentHandler.startElement(aName, xAttribs); + } + + public void endElement ( String aName ) + throws com.sun.star.xml.sax.SAXException + { + m_xDocumentHandler.endElement(aName); + } + + public void characters ( String aChars ) + throws com.sun.star.xml.sax.SAXException + { + m_xDocumentHandler.characters(aChars); + } + + public void ignorableWhitespace ( String aWhitespaces ) + throws com.sun.star.xml.sax.SAXException + { + m_xDocumentHandler.ignorableWhitespace(aWhitespaces); + } + + public void processingInstruction ( String aTarget, String aData ) + throws com.sun.star.xml.sax.SAXException + { + m_xDocumentHandler.processingInstruction(aTarget, aData); + } + + public void setDocumentLocator (com.sun.star.xml.sax.XLocator xLocator ) + throws com.sun.star.xml.sax.SAXException + { + m_xDocumentHandler.setDocumentLocator(xLocator); + } + + /* XParser */ + public void parseStream(InputSource strucInputSource) + { + } + + public void setDocumentHandler(XDocumentHandler xDocumentHandler) + { + m_xDocumentHandler = xDocumentHandler; + } + + public void setDTDHandler(XDTDHandler xHandler) + { + } + + public void setEntityResolver(XEntityResolver xResolver) + { + } + + public void setErrorHandler(XErrorHandler xHandler) + { + } + + public void setLocale(Locale locale) + { + } + + /* + * XTypeProvider implementation + * maintain a static implementation id for all instances of JavaFlatFilter + * initialized by the first call to getImplementationId() + */ + protected static byte[] _implementationId; + public com.sun.star.uno.Type[] getTypes() + { + com.sun.star.uno.Type[] retValue = new com.sun.star.uno.Type[4]; + + /* + * instantiate Type instances for each interface you support and add them to Type[] array + * this object implements XServiceInfo, XTypeProvider and XSignFilter + */ + retValue[0]= new com.sun.star.uno.Type( XServiceInfo.class); + retValue[1]= new com.sun.star.uno.Type( XTypeProvider.class); + retValue[2]= new com.sun.star.uno.Type( XDocumentHandler.class); + retValue[3]= new com.sun.star.uno.Type( XParser.class); + + /* + * XInterface is not needed for Java components, the UnoRuntime does its job + */ + + return retValue; + } + + synchronized public byte[] getImplementationId() + { + if (_implementationId == null) { + _implementationId= new byte[16]; + int hash = hashCode(); // hashDode of this object + _implementationId[0] = (byte)(hash & 0xff); + _implementationId[1] = (byte)((hash >>> 8) & 0xff); + _implementationId[2] = (byte)((hash >>> 16) & 0xff); + _implementationId[3] = (byte)((hash >>>24) & 0xff); + } + return _implementationId; + } + + + /* + * XServiceInfo implementation + * hold the service name in a private static member variable of the class + */ + protected static final String __serviceName = "com.sun.star.xml.crypto.eval.JavaFlatFilter"; + public String getImplementationName( ) + { + return getClass().getName(); + } + + public boolean supportsService(String serviceName) + { + boolean rc = false; + + if ( serviceName.equals( __serviceName)) + { + rc = true; + } + + return rc; + } + + public String[] getSupportedServiceNames( ) + { + String[] retValue= new String[0]; + retValue[0]= __serviceName; + return retValue; + } + + /* static __getServiceFactory() implementation */ + public static XSingleServiceFactory __getServiceFactory(String implName, + XMultiServiceFactory multiFactory, + com.sun.star.registry.XRegistryKey regKey) + { + com.sun.star.lang.XSingleServiceFactory xSingleServiceFactory = null; + if (implName.equals( JavaFlatFilter.class.getName()) ) + { + xSingleServiceFactory = FactoryHelper.getServiceFactory( JavaFlatFilter.class, + JavaFlatFilter.__serviceName, + multiFactory, + regKey); + } + + return xSingleServiceFactory; + } + + /* static __writeRegistryServiceInfo implementation */ + public static boolean __writeRegistryServiceInfo(XRegistryKey regKey) + { + return FactoryHelper.writeRegistryServiceInfo( JavaFlatFilter.class.getName(), + __serviceName, + regKey); + } +} diff --git a/xmlsecurity/tools/demo/makefile.mk b/xmlsecurity/tools/demo/makefile.mk new file mode 100644 index 000000000000..5dba00d23f40 --- /dev/null +++ b/xmlsecurity/tools/demo/makefile.mk @@ -0,0 +1,157 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2000, 2010 Oracle and/or its affiliates. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# This file is part of OpenOffice.org. +# +# OpenOffice.org is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License version 3 +# only, as published by the Free Software Foundation. +# +# OpenOffice.org is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License version 3 for more details +# (a copy is included in the LICENSE file that accompanied this code). +# +# You should have received a copy of the GNU Lesser General Public License +# version 3 along with OpenOffice.org. If not, see +# <http://www.openoffice.org/license.html> +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +PRJ=..$/.. + +PRJNAME=xmlsecurity +TARGET=demo +ENABLE_EXCEPTIONS=TRUE +NO_BSYMBOLIC=TRUE +LIBTARGET=NO + +# --- Settings ----------------------------------------------------- + +.INCLUDE : settings.mk +.INCLUDE : $(PRJ)$/util$/target.pmk + +CDEFS += -DXMLSEC_CRYPTO_NSS -DXMLSEC_NO_XSLT + +# --- Files -------------------------------------------------------- + +SHARE_LIBS = \ + $(CPPULIB) \ + $(CPPUHELPERLIB) \ + $(SALLIB) \ + $(UCBHELPERLIB) \ + $(UNOTOOLSLIB) \ + $(TOOLSLIB) \ + $(XMLOFFLIB) \ + $(LIBXML2LIB) \ + $(NSS3LIB) \ + $(NSPR4LIB) \ + $(XMLSECLIB) \ + $(COMPHELPERLIB) + +.IF "$(CRYPTO_ENGINE)" == "mscrypto" +SHARE_LIBS+= $(XMLSECLIB-MS) +.ELSE +SHARE_LIBS+= $(XMLSECLIB-NSS) +.ENDIF + + + +# HACK: Use SLO for demo directly... +SHARE_OBJS = \ + $(OBJ)$/util.obj \ + $(OBJ)$/util2.obj \ + $(SLO)$/biginteger.obj \ + $(SLO)$/baseencoding.obj \ + $(SLO)/xmlsignaturehelper.obj \ + $(SLO)/xmlsignaturehelper2.obj \ + $(SLO)/xsecctl.obj \ + $(SLO)/xsecparser.obj \ + $(SLO)/xsecsign.obj \ + $(SLO)/xsecverify.obj + +# +# ---------- signdemo ---------- +# +APP1TARGET=signdemo +APP1DEPN=makefile.mk +APP1STDLIBS+=$(SHARE_LIBS) +APP1OBJS= $(SHARE_OBJS) $(OBJ)$/signdemo.obj + +# +# ---------- verifydemo ---------- +# +APP2TARGET=verifydemo +APP2DEPN=makefile.mk +APP2STDLIBS+=$(SHARE_LIBS) +APP2OBJS= $(SHARE_OBJS) $(OBJ)$/verifydemo.obj + +# +# ---------- multisigdemo ---------- +# +APP3TARGET=multisigdemo +APP3DEPN=makefile.mk +APP3STDLIBS+=$(SHARE_LIBS) +APP3OBJS= $(SHARE_OBJS) $(OBJ)$/multisigdemo.obj + +# +# ---------- mozprofile ---------- +# +APP4TARGET=mozprofile +APP4DEPN=makefile.mk +APP4STDLIBS+=$(SHARE_LIBS) +APP4OBJS= $(SHARE_OBJS) $(OBJ)$/mozprofile.obj + +# +# ---------- performance ---------- +# +APP5TARGET=performance +APP5DEPN=makefile.mk +APP5STDLIBS+=$(SHARE_LIBS) +APP5OBJS= $(OBJ)$/util.obj $(OBJ)$/performance.obj + +# +# ---------- jflatfilter ---------- +# +PACKAGE= com$/sun$/star$/xml$/security$/eval +JARFILES= ridl.jar jurt.jar unoil.jar juh.jar +JAVAFILES:= $(shell @ls *.java) +JAVACLASSFILES= $(CLASSDIR)$/$(PACKAGE)$/JavaFlatFilter.class +JARCLASSDIRS= $(PACKAGE) +JARTARGET= jflatfilter.jar +JARCOMPRESS= TRUE + + +# --- Targets ------------------------------------------------------ + +.INCLUDE : target.mk + +ALLTAR : $(BIN)$/demo.rdb + +$(JAVACLASSFILES) : $(JAVAFILES) + +REGISTERLIBS= \ + dynamicloader.uno$(DLLPOST) \ + namingservice.uno$(DLLPOST) \ + bootstrap.uno$(DLLPOST) \ + sax.uno$(DLLPOST) \ + $(DLLPRE)mozab2$(DLLPOST) + +$(BIN)$/demo.rdb: \ + makefile.mk \ + $(foreach,i,$(REGISTERLIBS) $(SOLARSHAREDBIN)$/$(i)) + -rm -f $@ $(BIN)$/regcomp.rdb $(BIN)$/demo.tmp + $(REGCOMP) -register -r $(BIN)$/demo.tmp -c "$(strip $(REGISTERLIBS))" + $(REGCOMP) -register -r $(BIN)$/demo.tmp -c $(DLLPRE)xsec_fw$(DLLPOST) + $(REGCOMP) -register -r $(BIN)$/demo.tmp -c $(DLLPRE)xsec_xmlsec$(DLLPOST) + $(REGMERGE) $(BIN)$/demo.tmp / $(SOLARBINDIR)/types.rdb + mv $(BIN)$/demo.tmp $@ + + diff --git a/xmlsecurity/tools/demo/manifest b/xmlsecurity/tools/demo/manifest new file mode 100644 index 000000000000..93cb7d908467 --- /dev/null +++ b/xmlsecurity/tools/demo/manifest @@ -0,0 +1 @@ +RegistrationClassName: com.sun.star.xml.security.eval.JavaFlatFilter diff --git a/xmlsecurity/tools/demo/mozprofile.cxx b/xmlsecurity/tools/demo/mozprofile.cxx new file mode 100644 index 000000000000..928e84fd61bb --- /dev/null +++ b/xmlsecurity/tools/demo/mozprofile.cxx @@ -0,0 +1,108 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_xmlsecurity.hxx" + +#include "util.hxx" + +#include <stdio.h> +#include <tools/date.hxx> +#include <tools/time.hxx> +#include <cppuhelper/servicefactory.hxx> + +#include <xmlsecurity/biginteger.hxx> +#include <xmlsecurity/xmlsignaturehelper.hxx> +#include <com/sun/star/mozilla/XMozillaBootstrap.hpp> + +using namespace ::com::sun::star; + +int SAL_CALL main( int argc, char **argv ) +{ + fprintf( stdout, "\nTesting Mozilla Profile Detection...\n\nOpenOffice.org will use the first detected profile.\nResults might be different when started in OOo program folder!\n" ) ; + + uno::Reference< lang::XMultiServiceFactory > xMSF = CreateDemoServiceFactory(); + if ( !xMSF.is() ) + { + fprintf( stdout, "\n\nERROR: Can't create Service Factory\n" ); + exit (-1); + } + + uno::Reference<mozilla::XMozillaBootstrap> xMozillaBootstrap( xMSF->createInstance(::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.mozilla.MozillaBootstrap" ) ) ), uno::UNO_QUERY ); + if ( !xMozillaBootstrap.is() ) + { + fprintf( stdout, "\n\nERROR: Can't create Mozilla Bootstrap Service\n" ); + exit (-1); + } + + int nProducts = 4; + mozilla::MozillaProductType productTypes[4] = { mozilla::MozillaProductType_Thunderbird, mozilla::MozillaProductType_Mozilla, mozilla::MozillaProductType_Firefox, mozilla::MozillaProductType_Default }; + for ( int i = 0; i < nProducts; i++) + { + if ( i == 0 ) + fprintf( stdout, "\nThunderbird: " ); + else if ( i == 1 ) + fprintf( stdout, "\nMozilla: " ); + else if ( i == 2 ) + fprintf( stdout, "\nFireFox: " ); + else + fprintf( stdout, "\nDefault: " ); + + ::rtl::OUString profile = xMozillaBootstrap->getDefaultProfile(productTypes[i]); + if ( profile.getLength() ) + { + ::rtl::OUString profilepath = xMozillaBootstrap->getProfilePath(productTypes[i],profile); + fprintf( stdout, "Name=%s, Path=%s", rtl::OUStringToOString( profile , RTL_TEXTENCODING_ASCII_US ).getStr(), rtl::OUStringToOString( profilepath , RTL_TEXTENCODING_ASCII_US ).getStr() ); + } + else + { + fprintf( stdout, "NOT FOUND" ); + } + } + + /* + * creates a signature helper + */ + XMLSignatureHelper aSignatureHelper( xMSF ); + + /* + * creates a security context. + */ + rtl::OUString aCryptoToken; + bool bInit = aSignatureHelper.Init( aCryptoToken ); + if ( !bInit ) + { + fprintf( stdout, "\n\nERROR: Unable to initialize security environment.\n\n" ); + } + else + { + fprintf( stdout, "\n\nSecurity environment can be initialized successfully.\n\n" ); + } + + return 0; +} + diff --git a/xmlsecurity/tools/demo/multisigdemo.cxx b/xmlsecurity/tools/demo/multisigdemo.cxx new file mode 100644 index 000000000000..ff8142f9252d --- /dev/null +++ b/xmlsecurity/tools/demo/multisigdemo.cxx @@ -0,0 +1,236 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_xmlsecurity.hxx" + +#include <stdio.h> +#include "util.hxx" + +#include <rtl/ustring.hxx> +#include <cppuhelper/servicefactory.hxx> + +#include <xmlsecurity/biginteger.hxx> +#include <xmlsecurity/xmlsignaturehelper.hxx> +#include "xmlsecurity/baseencoding.hxx" +#include <tools/date.hxx> +#include <tools/time.hxx> + +using namespace ::com::sun::star; + +long denyVerifyHandler( void *, void * ) +{ + return 0; +} + +long startVerifyHandler( void *, void * ) +{ + return QueryVerifySignature(); +} + +int SAL_CALL main( int argc, char **argv ) +{ + if( argc < 5 ) + { + fprintf( stderr, "Usage: %s <signature file 1> <signature file 2> <xml stream file> <binary stream file> [<cryptoken>]\n" , argv[0] ) ; + return -1 ; + } + + uno::Reference< lang::XMultiServiceFactory > xMSF = CreateDemoServiceFactory(); + + rtl::OUString aSIGFileName = rtl::OUString::createFromAscii(argv[1]); + rtl::OUString aSIGFileName2 = rtl::OUString::createFromAscii(argv[2]); + rtl::OUString aXMLFileName = rtl::OUString::createFromAscii(argv[3]); + rtl::OUString aBINFileName = rtl::OUString::createFromAscii(argv[4]); + rtl::OUString aCryptoToken; + if ( argc >= 7 ) + aCryptoToken = rtl::OUString::createFromAscii(argv[6]); + + sal_Int32 nSecurityId; + uno::Reference< io::XOutputStream > xOutputStream; + uno::Reference< io::XInputStream > xInputStream; + bool bDone; + SignatureInformations signatureInformations; + uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler> xDocumentHandler; + + // -------- START ------- + + XMLSignatureHelper aSignatureHelper( xMSF ); + + bool bInit = aSignatureHelper.Init( aCryptoToken ); + if ( !bInit ) + { + fprintf( stderr, "Error initializing security context!\n" ); + return -1; + } + + fprintf( stdout, "\n\nTEST MISSION 1: Create the first signature file\n"); + + aSignatureHelper.StartMission(); + + /* + * select a private key certificate + */ + uno::Reference< xml::crypto::XSecurityEnvironment > xSecurityEnvironment = aSignatureHelper.GetSecurityEnvironment(); + uno::Sequence< uno::Reference< ::com::sun::star::security::XCertificate > > xPersonalCerts = xSecurityEnvironment->getPersonalCertificates() ; + + fprintf( stdout, "\nPlease select two certificates:\n" ); + + for ( int nSig = 0; nSig < 2; nSig++ ) + { + // New security ID for signature... + nSecurityId = aSignatureHelper.GetNewSecurityId(); + + // Select certificate... + uno::Reference< ::com::sun::star::security::XCertificate > xPersonalCert = getCertificateFromEnvironment( xSecurityEnvironment, true ); + aSignatureHelper.SetX509Certificate( + nSecurityId, xPersonalCert->getIssuerName(), + bigIntegerToNumericString( xPersonalCert->getSerialNumber()), + baseEncode(xPersonalCert->getEncoded(), BASE64)); + aSignatureHelper.AddForSigning( nSecurityId, aXMLFileName, aXMLFileName, sal_False ); + aSignatureHelper.AddForSigning( nSecurityId, aBINFileName, aBINFileName, sal_True ); + aSignatureHelper.SetDateTime( nSecurityId, Date(), Time() ); + } + /* + * creates signature + */ + xOutputStream = OpenOutputStream( aSIGFileName ); + bDone = aSignatureHelper.CreateAndWriteSignature( xOutputStream ); + if ( !bDone ) + fprintf( stderr, "\nSTATUS MISSION 1: Error creating Signature!\n" ); + else + fprintf( stdout, "\nSTATUS MISSION 1: Signature successfully created!\n" ); + + aSignatureHelper.EndMission(); + + + fprintf( stdout, "\n\nTEST MISSION 2: Transfer the second signature to a new signature file\n"); + + /* + * You can use an uninitialized SignatureHelper to perform this mission. + */ + + /* + * configures the start-verify handler. Don't need to verify for transfering... + */ + aSignatureHelper.SetStartVerifySignatureHdl( Link( NULL, denyVerifyHandler ) ); + aSignatureHelper.StartMission(); + + xInputStream = OpenInputStream( aSIGFileName ); + bDone = aSignatureHelper.ReadAndVerifySignature( xInputStream ); + xInputStream->closeInput(); + + if ( !bDone ) + fprintf( stderr, "\nSTATUS MISSION 2: Error in reading Signature!\n" ); + else + fprintf( stdout, "\nSTATUS MISSION 2: Signature successfully transfered!\n" ); + + /* + * get all signature information + */ + signatureInformations = aSignatureHelper.GetSignatureInformations(); + + /* + * write the first signature into the second signature file. + */ + + xOutputStream = OpenOutputStream( aSIGFileName2 ); + xDocumentHandler = aSignatureHelper.CreateDocumentHandlerWithHeader( xOutputStream); + aSignatureHelper.ExportSignature( xDocumentHandler, signatureInformations[1]); + aSignatureHelper.CloseDocumentHandler( xDocumentHandler); + aSignatureHelper.EndMission(); + + fprintf( stdout, "\n\nTEST MISSION 3: Insert a new signature to the first signature file\n"); + + aSignatureHelper.StartMission(); + + nSecurityId = aSignatureHelper.GetNewSecurityId(); + + // Select certificate... + uno::Reference< ::com::sun::star::security::XCertificate > xPersonalCert = getCertificateFromEnvironment( xSecurityEnvironment, true ); + aSignatureHelper.SetX509Certificate( + nSecurityId, xPersonalCert->getIssuerName(), + bigIntegerToNumericString( xPersonalCert->getSerialNumber()), + baseEncode(xPersonalCert->getEncoded(), BASE64)); + aSignatureHelper.AddForSigning( nSecurityId, aXMLFileName, aXMLFileName, sal_False ); + aSignatureHelper.AddForSigning( nSecurityId, aBINFileName, aBINFileName, sal_True ); + aSignatureHelper.SetDateTime( nSecurityId, Date(), Time() ); + + + xOutputStream = OpenOutputStream( aSIGFileName ); + xDocumentHandler = aSignatureHelper.CreateDocumentHandlerWithHeader( xOutputStream); + + aSignatureHelper.ExportSignature( xDocumentHandler, signatureInformations[0]); + bDone = aSignatureHelper.CreateAndWriteSignature( xDocumentHandler ); + aSignatureHelper.ExportSignature( xDocumentHandler, signatureInformations[1]); + aSignatureHelper.CloseDocumentHandler( xDocumentHandler); + + if ( !bDone ) + fprintf( stderr, "\nSTATUS MISSION 3: Error creating Signature!\n" ); + else + fprintf( stdout, "\nSTATUS MISSION 3: Signature successfully created!\n" ); + + aSignatureHelper.EndMission(); + + fprintf( stdout, "\n\nTEST MISSION 4 : Verify the first signature file\n"); + + aSignatureHelper.SetStartVerifySignatureHdl( Link( NULL, startVerifyHandler ) ); + + aSignatureHelper.StartMission(); + + xInputStream = OpenInputStream( aSIGFileName ); + bDone = aSignatureHelper.ReadAndVerifySignature( xInputStream ); + xInputStream->closeInput(); + + if ( !bDone ) + fprintf( stderr, "\nSTATUS MISSION 4: Error verifying Signatures!\n" ); + else + fprintf( stdout, "\nSTATUS MISSION 4: All choosen Signatures veryfied successfully!\n" ); + + aSignatureHelper.EndMission(); + + QueryPrintSignatureDetails( aSignatureHelper.GetSignatureInformations(), aSignatureHelper.GetSecurityEnvironment() ); + + fprintf( stdout, "\n\nTEST MISSION 5: Verify the second signature file\n"); + + aSignatureHelper.StartMission(); + + xInputStream = OpenInputStream( aSIGFileName2 ); + bDone = aSignatureHelper.ReadAndVerifySignature( xInputStream ); + xInputStream->closeInput(); + + if ( !bDone ) + fprintf( stderr, "\nSTATUS MISSION 5: Error verifying Signatures!\n" ); + else + fprintf( stdout, "\nSTATUS MISSION 5: All choosen Signatures veryfied successfully!\n" ); + + aSignatureHelper.EndMission(); + + QueryPrintSignatureDetails( aSignatureHelper.GetSignatureInformations(), aSignatureHelper.GetSecurityEnvironment() ); + + return 0; +} diff --git a/xmlsecurity/tools/demo/performance.cxx b/xmlsecurity/tools/demo/performance.cxx new file mode 100644 index 000000000000..061091611de7 --- /dev/null +++ b/xmlsecurity/tools/demo/performance.cxx @@ -0,0 +1,1880 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_xmlsecurity.hxx" + +#include <stdio.h> +#include <string.h> + +#include <rtl/ustring.hxx> +#include <cppuhelper/bootstrap.hxx> +#include <cppuhelper/servicefactory.hxx> +#include <com/sun/star/bridge/XUnoUrlResolver.hpp> +#include <com/sun/star/registry/XImplementationRegistration.hpp> +#include <com/sun/star/beans/XPropertySet.hpp> +#include <com/sun/star/lang/XMultiComponentFactory.hpp> + +#include <comphelper/processfactory.hxx> + +#include <iostream> +#include <fstream> + +#include <util.hxx> + +#include <com/sun/star/lang/XMultiServiceFactory.hpp> +#include <com/sun/star/io/XOutputStream.hpp> +#include <com/sun/star/io/XInputStream.hpp> +#include <com/sun/star/xml/sax/XParser.hpp> +#include <com/sun/star/xml/sax/XDocumentHandler.hpp> +#include <com/sun/star/xml/sax/XAttributeList.hpp> +#include <cppuhelper/implbase4.hxx> + +#include <com/sun/star/xml/crypto/sax/XSignatureCreationResultListener.hpp> +#include <com/sun/star/xml/crypto/sax/XSignatureVerifyResultListener.hpp> +#include <com/sun/star/xml/crypto/sax/XSAXEventKeeperStatusChangeListener.hpp> +#include <com/sun/star/xml/crypto/sax/XSecuritySAXEventKeeper.hpp> +#include <com/sun/star/xml/crypto/sax/XReferenceResolvedListener.hpp> +#include <com/sun/star/xml/crypto/XXMLSignature.hpp> +#include <com/sun/star/xml/wrapper/XXMLDocumentWrapper.hpp> +#include <com/sun/star/xml/csax/XMLAttribute.hpp> +#include <com/sun/star/xml/crypto/XSEInitializer.hpp> +#include <com/sun/star/xml/crypto/SecurityOperationStatus.hpp> +#include <com/sun/star/io/XActiveDataSource.hpp> +#include <com/sun/star/lang/XInitialization.hpp> +#include <com/sun/star/xml/crypto/sax/XKeyCollector.hpp> +#include <com/sun/star/xml/crypto/sax/ElementMarkPriority.hpp> +#include <com/sun/star/xml/crypto/sax/XReferenceResolvedBroadcaster.hpp> +#include <com/sun/star/xml/crypto/sax/XMissionTaker.hpp> +#include <com/sun/star/xml/crypto/sax/XBlockerMonitor.hpp> +#include <com/sun/star/xml/crypto/sax/XSignatureCreationResultBroadcaster.hpp> +#include <com/sun/star/xml/crypto/sax/XSignatureVerifyResultBroadcaster.hpp> +#include <com/sun/star/xml/crypto/sax/XReferenceCollector.hpp> +#include <com/sun/star/xml/crypto/sax/XSAXEventKeeperStatusChangeBroadcaster.hpp> +#include <com/sun/star/xml/wrapper/XXMLDocumentWrapper.hpp> + +#include <xmloff/attrlist.hxx> + +//#include <malloc.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +/* + * Can not build under solaris. + * Delete the memory.h including by AF +#include <memory.h> +*/ + +#include <sys/types.h> +#include <sys/stat.h> +#include <osl/time.h> + + + +#ifndef INCLUDED_VECTOR +#include <vector> +#define INCLUDED_VECTOR +#endif + +#ifndef INCLUDED_STACK +#include <stack> +#define INCLUDED_STACK +#endif + +/* xml security framework components */ +#define SIGNATURECREATOR_COMPONENT "com.sun.star.xml.crypto.sax.SignatureCreator" +#define SIGNATUREVERIFIER_COMPONENT "com.sun.star.xml.crypto.sax.SignatureVerifier" +#define JAVAFLATFILTER_COMPONENT "com.sun.star.xml.crypto.eval.JavaFlatFilter" +#define SAXEVENTKEEPER_COMPONENT "com.sun.star.xml.crypto.sax.SAXEventKeeper" + +/* java based bridge components */ +#define SEINITIALIZER_JAVA_COMPONENT "com.sun.star.xml.security.bridge.jxsec.SEInitializer_JxsecImpl" +#define XMLSIGNATURE_JAVA_COMPONENT "com.sun.star.xml.security.bridge.jxsec.XMLSignature_JxsecImpl" +#define XMLDOCUMENTWRAPPER_JAVA_COMPONENT "com.sun.star.xml.security.bridge.jxsec.XMLDocumentWrapper_JxsecImpl" + +/* c based bridge components */ +#define SEINITIALIZER_C_COMPONENT "com.sun.star.xml.crypto.SEInitializer" +#define XMLSIGNATURE_C_COMPONENT "com.sun.star.xml.crypto.XMLSignature" +#define XMLDOCUMENT_C_COMPONENT "com.sun.star.xml.wrapper.XMLDocumentWrapper" + +/* security related elements and attributes */ +#define SIGNATURE_STR "Signature" +#define REFERENCE_STR "Reference" +#define SIGNEDINFO_STR "SignedInfo" +#define KEYINFO_STR "KeyInfo" +#define KEYVALUE_STR "KeyValue" +#define KEYNAME_STR "KeyName" +#define X509DATA_STR "X509Data" +#define ENCRYPTEDKEY_STR "EncryptedKey" +#define RETRIEVALMETHOD_STR "RetrievalMethod" +#define OTHER_ELEMENT_STR "OTHER_ELEMENT_STR" +#define REFNUM_ATTR_STR "refNum" +#define URI_ATTR_STR "URI" + + +#define RTL_ASCII_USTRINGPARAM( asciiStr ) asciiStr, strlen( asciiStr ), RTL_TEXTENCODING_ASCII_US + +namespace cssu = com::sun::star::uno; +namespace cssl = com::sun::star::lang; +namespace cssb = com::sun::star::beans; +namespace cssi = com::sun::star::io; +namespace cssxc = com::sun::star::xml::crypto; +namespace cssxs = com::sun::star::xml::sax; +namespace cssxw = com::sun::star::xml::wrapper; +namespace cssxcsax = com::sun::star::xml::csax; + + +using namespace ::com::sun::star; + + +class XSecTester; + +/* + * The XSecTester class is a C++ version of SecurityFramworkController.java + * + */ + +class SecurityEntity +{ +private: + static int m_nNextSecurityId; + rtl::OUString m_ouKeyURI; + +protected: + com::sun::star::uno::Reference< + com::sun::star::lang::XMultiServiceFactory > mxMSF; + + com::sun::star::uno::Reference< + com::sun::star::xml::crypto::sax::XReferenceResolvedListener > + m_xReferenceListener; + + com::sun::star::uno::Reference< + com::sun::star::xml::crypto::sax::XSecuritySAXEventKeeper > + m_xSAXEventKeeper; + + com::sun::star::uno::Reference< + com::sun::star::xml::crypto::XXMLSecurityContext > + m_xXMLSecurityContext; + + com::sun::star::uno::Reference< + com::sun::star::xml::crypto::XXMLSignature > + m_xXMLSignature; + + int m_nSecurityId; + +private: + int getNextSecurityId() const; + +protected: + SecurityEntity( + const com::sun::star::uno::Reference< + com::sun::star::xml::crypto::sax::XSecuritySAXEventKeeper >& + xSAXEventKeeper, + const com::sun::star::uno::Reference< + com::sun::star::xml::crypto::XXMLSecurityContext >& + xXMLSecurityContext, + const com::sun::star::uno::Reference< + com::sun::star::xml::crypto::XXMLSignature >& + xXMLSignature, + const com::sun::star::uno::Reference< + com::sun::star::lang::XMultiServiceFactory >& + rsMSF); + +public: + void setKeyId(int nId); + + int getSecurityId() const; + + com::sun::star::uno::Reference< + com::sun::star::xml::crypto::sax::XReferenceResolvedListener > + getReferenceListener() const; + + bool setKey( const rtl::OUString& ouUri, bool bIsExporting ); + + void setKeyURI(const rtl::OUString& ouUri); + + bool endMission(); +}; + + +class SignatureEntity : public SecurityEntity +{ +private: + std::vector< rtl::OUString > m_vReferenceIds; + int m_nSignatureElementCollectorId; + + bool hasReference(const rtl::OUString& ouUri) const; + +public: + SignatureEntity( + const com::sun::star::uno::Reference< + com::sun::star::xml::crypto::sax::XSecuritySAXEventKeeper >& + xSAXEventKeeper, + bool bIsExporting, + XSecTester* pListener, + const com::sun::star::uno::Reference< + com::sun::star::xml::crypto::XXMLSecurityContext >& + xXMLSecurityContext, + const com::sun::star::uno::Reference< + com::sun::star::xml::crypto::XXMLSignature >& + xXMLSignature, + const com::sun::star::uno::Reference< + com::sun::star::lang::XMultiServiceFactory >& + rsMSF); + ~SignatureEntity(){}; + + void setReferenceNumber() const; + bool setReference( const rtl::OUString& ouUri, bool bIsExporting ) const; + void addReferenceURI( const rtl::OUString& ouUri ); +}; + +struct AncestorEvent +{ + AncestorEvent( sal_Int32 nAttrNum ):aAttributeList(nAttrNum){}; + + bool bIsStartElement; + rtl::OUString ouName; + + com::sun::star::uno::Sequence< + com::sun::star::xml::csax::XMLAttribute > + aAttributeList; +}; + +class XSecTester : public cppu::WeakImplHelper4 +< + com::sun::star::xml::crypto::sax::XSignatureCreationResultListener, + com::sun::star::xml::crypto::sax::XSignatureVerifyResultListener, + com::sun::star::xml::crypto::sax::XSAXEventKeeperStatusChangeListener, + com::sun::star::xml::sax::XDocumentHandler +> +{ +private: + com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > mxMSF; + + sal_Int32 m_nTotalSignatureNumber; + sal_Int32 m_nSuccessfulSignatureNumber; + + com::sun::star::uno::Reference< + com::sun::star::xml::sax::XDocumentHandler > + m_xExportHandler; + + com::sun::star::uno::Reference< + com::sun::star::xml::crypto::sax::XSecuritySAXEventKeeper > + m_xSAXEventKeeper; + + com::sun::star::uno::Reference< + com::sun::star::xml::wrapper::XXMLDocumentWrapper > + m_xXMLDocumentWrapper; + + com::sun::star::uno::Reference< + com::sun::star::xml::sax::XDocumentHandler > + m_xOutputHandler; + + com::sun::star::uno::Reference< + com::sun::star::xml::sax::XParser > + m_xSaxParser; + + std::stack< void* > m_stCurrentPath; + std::stack< bool > m_stCurrentPathType; + + std::vector< AncestorEvent* > m_vAncestorEvents; + std::vector< SignatureEntity* > m_vSignatureList; + + std::vector< rtl::OUString > m_vUnsolvedReferenceURIs; + std::vector< int > m_vUnsolvedReferenceKeeperIds; + std::vector< int > m_vUnsolvedReferenceRefNums; + + bool m_bIsExporting; + bool m_bIsBlocking; + + bool m_bIsInsideCollectedElement; + bool m_bIsSAXEventKeeperOnTheSAXChain; + + com::sun::star::uno::Reference< + com::sun::star::xml::crypto::XXMLSecurityContext > + m_xXMLSecurityContext; + + com::sun::star::uno::Reference< + com::sun::star::xml::crypto::XXMLSignature > + m_xXMLSignature; + + rtl::OUString m_ouJavaCryptokenDir; + rtl::OUString m_ouCCryptokenDir; + rtl::OUString m_ouXMLDocumentWrapperComponentName; + +private: + com::sun::star::uno::Reference< + com::sun::star::io::XOutputStream > + createOutputStream( const rtl::OUString& ouFile ); + + rtl::OUString parseFile( + const rtl::OUString& ouInputFileName, + const rtl::OUString& ouOutputFileName, + bool bIsExporting, + bool bIsJavaBased); + + void changeOutput(); + + bool foundSecurityRelated(); + + void findKeyOrReference(SecurityEntity* pSecurityEntity, const rtl::OUString& ouUri, bool bIsFindKey); + + bool checkSecurityElement( + const rtl::OUString& ouLocalName, + const com::sun::star::uno::Reference< + com::sun::star::xml::sax::XAttributeList>& xAttribs); + + void checkReference( + const rtl::OUString& ouLocalName, + const com::sun::star::uno::Reference< + com::sun::star::xml::sax::XAttributeList>& xAttribs, + const rtl::OUString& ouId); + + void endMission(); + + void addStartAncestorEvent( + const rtl::OUString& ouName, + const com::sun::star::uno::Reference< + com::sun::star::xml::sax::XAttributeList>& xAttribs); + + void addEndAncestorEvent( const rtl::OUString& ouName ); + + void flushAncestorEvents( + const com::sun::star::uno::Reference< + com::sun::star::xml::sax::XDocumentHandler >& xDocumentHandler); + + void XSecTester::sendAncestorStartElementEvent( + const rtl::OUString& ouName, + const com::sun::star::uno::Sequence< + com::sun::star::xml::csax::XMLAttribute >& xAttrList, + const com::sun::star::uno::Reference< + com::sun::star::xml::sax::XDocumentHandler >& xDocumentHandler) const; + + void XSecTester::sendAncestorEndElementEvent( + const rtl::OUString& ouName, + const com::sun::star::uno::Reference< + com::sun::star::xml::sax::XDocumentHandler >& xDocumentHandler) const; + + std::vector< AncestorEvent* >::const_iterator XSecTester::checkAncestorStartElementEvent( + const std::vector< AncestorEvent* >::const_iterator& ii, + const com::sun::star::uno::Reference< + com::sun::star::xml::sax::XDocumentHandler >& xDocumentHandler) const; + +public: + XSecTester(const com::sun::star::uno::Reference< + com::sun::star::lang::XMultiServiceFactory >& rxMSF) + :mxMSF( rxMSF ){}; + virtual ~XSecTester(){}; + + /* XSignatureCreationResultListener */ + virtual void SAL_CALL signatureCreated( + sal_Int32 securityId, + com::sun::star::xml::crypto::SecurityOperationStatus creationResult ) + throw (com::sun::star::uno::RuntimeException); + + /* XSignatureVerifyResultListener */ + virtual void SAL_CALL signatureVerified( + sal_Int32 securityId, + com::sun::star::xml::crypto::SecurityOperationStatus verifyResult ) + throw (com::sun::star::uno::RuntimeException); + + /* XSAXEventKeeperStatusChangeListener */ + virtual void SAL_CALL blockingStatusChanged( sal_Bool isBlocking ) + throw (com::sun::star::uno::RuntimeException); + virtual void SAL_CALL collectionStatusChanged( + sal_Bool isInsideCollectedElement ) + throw (com::sun::star::uno::RuntimeException); + virtual void SAL_CALL bufferStatusChanged( sal_Bool isBufferEmpty ) + throw (com::sun::star::uno::RuntimeException); + + /* XXMLSecTester */ + virtual rtl::OUString SAL_CALL transfer_without_sec( + const rtl::OUString& inputFileName, + const rtl::OUString& outputFileName, + sal_Bool isBridgeInvolved) + throw (com::sun::star::uno::RuntimeException); + virtual rtl::OUString SAL_CALL export_xml( + const rtl::OUString& inputFileName, + const rtl::OUString& outputFileName, + sal_Bool isJavaBased) + throw (com::sun::star::uno::RuntimeException); + virtual rtl::OUString SAL_CALL import_xml( + const rtl::OUString& inputFileName, + const rtl::OUString& outputFileName, + sal_Bool isJavaBased) + throw (com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL setCryptoDir( + const rtl::OUString & javaDirName, + const rtl::OUString & cDirName) + throw (com::sun::star::uno::RuntimeException); + + /* XDocumentHandler */ + virtual void SAL_CALL endDocument() + throw (com::sun::star::uno::RuntimeException); + virtual void SAL_CALL startDocument() + throw (com::sun::star::uno::RuntimeException); + virtual void SAL_CALL characters(const class rtl::OUString&) + throw (com::sun::star::uno::RuntimeException); + virtual void SAL_CALL processingInstruction(const rtl::OUString&, const rtl::OUString&) + throw (com::sun::star::uno::RuntimeException); + virtual void SAL_CALL ignorableWhitespace(const rtl::OUString&) + throw (com::sun::star::uno::RuntimeException); + virtual void SAL_CALL startElement( + const rtl::OUString&, + const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >&) + throw (com::sun::star::uno::RuntimeException); + virtual void SAL_CALL endElement(const rtl::OUString&) + throw (com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setDocumentLocator( + const com::sun::star::uno::Reference< com::sun::star::xml::sax::XLocator >&) + throw (com::sun::star::uno::RuntimeException); +}; + +rtl::OUString XSecTester::parseFile( + const rtl::OUString& ouInputFileName, + const rtl::OUString& ouOutputFileName, + bool bIsExporting, + bool bIsJavaBased) +{ + rtl::OUString ouMessage; + + cssu::Reference<cssi::XInputStream> xInputStream = OpenInputStream(ouInputFileName); + + if (xInputStream != NULL ) + { + /* initialization */ + rtl::OUString SEInitializer_comp; + rtl::OUString XMLSignature_comp; + rtl::OUString tokenPath; + cssu::Reference < cssxc::XSEInitializer > xSEInitializer; + + if (bIsJavaBased) + { + SEInitializer_comp = rtl::OUString::createFromAscii( SEINITIALIZER_JAVA_COMPONENT ); + XMLSignature_comp = rtl::OUString::createFromAscii( XMLSIGNATURE_JAVA_COMPONENT); + m_ouXMLDocumentWrapperComponentName = rtl::OUString::createFromAscii( XMLDOCUMENTWRAPPER_JAVA_COMPONENT ); + tokenPath = m_ouJavaCryptokenDir; + } + else + { + SEInitializer_comp = rtl::OUString::createFromAscii( SEINITIALIZER_C_COMPONENT ); + XMLSignature_comp = rtl::OUString::createFromAscii( XMLSIGNATURE_C_COMPONENT); + m_ouXMLDocumentWrapperComponentName = rtl::OUString::createFromAscii( XMLDOCUMENT_C_COMPONENT ); + tokenPath = m_ouCCryptokenDir; + } + + xSEInitializer = cssu::Reference < cssxc::XSEInitializer > ( + mxMSF->createInstance( SEInitializer_comp ), + cssu::UNO_QUERY ); + + m_xXMLSignature = cssu::Reference<cssxc::XXMLSignature> ( + mxMSF->createInstance( XMLSignature_comp ), + cssu::UNO_QUERY ); + + if ( xSEInitializer.is() && m_xXMLSignature.is()) + { + /* create SAX Parser */ + const rtl::OUString sSaxParser ( + RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.xml.sax.Parser") ); + m_xSaxParser = cssu::Reference < cssxs::XParser > ( mxMSF->createInstance( sSaxParser ), cssu::UNO_QUERY ); + + /* create SAX Writer */ + const rtl::OUString sSaxWriter ( + RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.xml.sax.Writer") ); + cssu::Reference < cssi::XActiveDataSource > xSaxWriter + ( mxMSF->createInstance( sSaxWriter ), cssu::UNO_QUERY ); + + cssu::Reference< cssi::XOutputStream > xOutputStream = OpenOutputStream(ouOutputFileName); + xSaxWriter->setOutputStream( xOutputStream ); + + cssxs::InputSource aInput; + aInput.sSystemId = ouInputFileName; + aInput.aInputStream = xInputStream; + + cssu::Reference < cssxs::XDocumentHandler > xSaxWriterHandler( xSaxWriter, cssu::UNO_QUERY); + + m_xXMLSecurityContext = + xSEInitializer->createSecurityContext(tokenPath); + + m_bIsExporting = bIsExporting; + m_xExportHandler = xSaxWriterHandler; + m_xOutputHandler = xSaxWriterHandler; + + m_xXMLDocumentWrapper = NULL; + m_xSAXEventKeeper = NULL; + m_bIsSAXEventKeeperOnTheSAXChain = false; + + m_bIsBlocking = false; + m_bIsInsideCollectedElement = false; + + OSL_ASSERT(m_vSignatureList.size() == 0); + OSL_ASSERT(m_vUnsolvedReferenceURIs.size() == 0); + OSL_ASSERT(m_vUnsolvedReferenceKeeperIds.size() == 0); + OSL_ASSERT(m_vUnsolvedReferenceRefNums.size() == 0); + OSL_ASSERT(m_stCurrentPath.empty()); + OSL_ASSERT(m_stCurrentPathType.empty()); + OSL_ASSERT(m_vAncestorEvents.empty()); + + changeOutput(); + + /* foundSecurityRelated(); */ + + /* Begin to parse */ + TimeValue startTime, endTime; + osl_getSystemTime( &startTime ); + + xSaxWriterHandler->startDocument(); + + if (m_bIsExporting) + { + m_xSaxParser->setDocumentHandler(this); + m_xSaxParser->parseStream(aInput); + } + else + { + m_xSaxParser->setDocumentHandler(this); + m_xSaxParser->parseStream(aInput); + } + + endMission(); + xSaxWriterHandler->endDocument(); + + osl_getSystemTime( &endTime ); + + flushAncestorEvents( NULL ); + + // Bug in SAXWriter, done in endDocument() + // xOutputStream->closeOutput(); + xInputStream->closeInput(); + + + /* + * Free the security context + */ + xSEInitializer->freeSecurityContext(m_xXMLSecurityContext); + m_xXMLSecurityContext = NULL; + + /* Calculate the time */ + double diff = ((double)((endTime.Nanosec + endTime.Seconds*1000000000.0) + - (startTime.Nanosec + startTime.Seconds*1000000000.0))) / + ((double)1000000000.0); + + char buf[32]; + sprintf(buf, "%.2f", diff); + ouMessage += rtl::OUString(RTL_ASCII_USTRINGPARAM(buf)); + } + else + { + ouMessage += rtl::OUString::createFromAscii( "N/A" ); + } + + } + else + { + ouMessage += rtl::OUString::createFromAscii( "-" ); + } + + return ouMessage; +} + +/* XSignatureCreationResultListener */ +void SAL_CALL XSecTester::signatureCreated( + sal_Int32 securityId, + cssxc::SecurityOperationStatus creationResult ) + throw (cssu::RuntimeException) +{ + m_nTotalSignatureNumber++; + if (creationResult == cssxc::SecurityOperationStatus_OPERATION_SUCCEEDED) + { + m_nSuccessfulSignatureNumber++; + } +} + +/* XSignatureVerifyResultListener */ +void SAL_CALL XSecTester::signatureVerified( + sal_Int32 securityId, + cssxc::SecurityOperationStatus verifyResult ) + throw (cssu::RuntimeException) +{ + m_nTotalSignatureNumber++; + if (verifyResult == cssxc::SecurityOperationStatus_OPERATION_SUCCEEDED) + { + m_nSuccessfulSignatureNumber++; + } +} + +/* XSAXEventKeeperStatusChangeListener */ +void SAL_CALL XSecTester::blockingStatusChanged( sal_Bool isBlocking ) + throw (cssu::RuntimeException) +{ + this->m_bIsBlocking = isBlocking; +} + +void SAL_CALL XSecTester::collectionStatusChanged( sal_Bool isInsideCollectedElement ) + throw (cssu::RuntimeException) +{ + this->m_bIsInsideCollectedElement = isInsideCollectedElement; + + if ( !m_bIsInsideCollectedElement && !m_bIsBlocking) + { + m_bIsSAXEventKeeperOnTheSAXChain = false; + } + else + { + m_bIsSAXEventKeeperOnTheSAXChain = true; + } + changeOutput(); +} + +void SAL_CALL XSecTester::bufferStatusChanged( sal_Bool isBufferEmpty ) + throw (cssu::RuntimeException) +{ + if (isBufferEmpty) + { + m_xXMLDocumentWrapper = NULL; + + m_xSAXEventKeeper = NULL; + m_bIsSAXEventKeeperOnTheSAXChain = false; + changeOutput(); + } +} + +/* XXMLSecTester */ +rtl::OUString SAL_CALL XSecTester::export_xml( const rtl::OUString& inputFileName, const rtl::OUString& outputFileName, sal_Bool isJavaBased) + throw (cssu::RuntimeException) +{ + rtl::OUString ouMessage; + + m_nTotalSignatureNumber = 0; + m_nSuccessfulSignatureNumber = 0; + + ouMessage += parseFile(inputFileName, outputFileName, sal_True, isJavaBased); + + rtl::OUString ouRemark = rtl::OUString::valueOf(m_nSuccessfulSignatureNumber) + + rtl::OUString(RTL_ASCII_USTRINGPARAM( "/" )) + + rtl::OUString::valueOf(m_nTotalSignatureNumber); + ouMessage += rtl::OUString(RTL_ASCII_USTRINGPARAM("\t")) + ouRemark; + + return ouMessage; +} + +rtl::OUString SAL_CALL XSecTester::import_xml( const rtl::OUString& inputFileName, const rtl::OUString& outputFileName, sal_Bool isJavaBased) + throw (cssu::RuntimeException) +{ + rtl::OUString ouMessage; + + m_nTotalSignatureNumber = 0; + m_nSuccessfulSignatureNumber = 0; + + ouMessage += parseFile(inputFileName, outputFileName, sal_False, isJavaBased); + + rtl::OUString ouRemark = rtl::OUString::valueOf(m_nSuccessfulSignatureNumber) + + rtl::OUString(RTL_ASCII_USTRINGPARAM( "/" )) + + rtl::OUString::valueOf(m_nTotalSignatureNumber); + ouMessage += rtl::OUString(RTL_ASCII_USTRINGPARAM("\t")) + ouRemark; + + return ouMessage; +} + +rtl::OUString SAL_CALL XSecTester::transfer_without_sec( + const rtl::OUString& inputFileName, + const rtl::OUString& outputFileName, + sal_Bool isBridgeInvolved) + throw (cssu::RuntimeException) +{ + rtl::OUString ouMessage; + + cssu::Reference< cssi::XInputStream > xInputStream = OpenInputStream(inputFileName); + + if (xInputStream != NULL ) + { + /* create SAX Parser */ + const rtl::OUString sSaxParser ( + RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.xml.sax.Parser") ); + m_xSaxParser = cssu::Reference < cssxs::XParser > ( mxMSF->createInstance( sSaxParser ), cssu::UNO_QUERY ); + + /* create SAX Writer */ + const rtl::OUString sSaxWriter ( + RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.xml.sax.Writer") ); + cssu::Reference < cssi::XActiveDataSource > xSaxWriter + ( mxMSF->createInstance( sSaxWriter ), cssu::UNO_QUERY ); + cssu::Reference < cssxs::XDocumentHandler > xSaxWriterHandler( + xSaxWriter, cssu::UNO_QUERY); + + if (!isBridgeInvolved) + { + /* connect the SAX Parser and the SAX Writer */ + m_xSaxParser->setDocumentHandler ( xSaxWriterHandler ); + } + else + { + /* create Java Flat Filter */ + const rtl::OUString sJavaFlatFilter( + RTL_CONSTASCII_USTRINGPARAM( JAVAFLATFILTER_COMPONENT ) ); + cssu::Reference < cssxs::XParser > xJavaFilterParser + ( mxMSF->createInstance( sJavaFlatFilter ), cssu::UNO_QUERY ); + cssu::Reference < cssxs::XDocumentHandler > xJavaFilterHandler( + xJavaFilterParser, cssu::UNO_QUERY ); + + if ( !xJavaFilterParser.is() ) + return rtl::OUString::createFromAscii( "NO JAVA" ); + + /* connect the SAX Parser, the Java Flat Filter and the SAX Writer */ + xJavaFilterParser->setDocumentHandler( xSaxWriterHandler ); + m_xSaxParser->setDocumentHandler ( xJavaFilterHandler ); + } + + + /* set output stream */ + cssu::Reference< cssi::XOutputStream > xOutputStream = + OpenOutputStream(outputFileName); + xSaxWriter->setOutputStream( xOutputStream ); + + /* prepare input stream */ + cssxs::InputSource aInput; + aInput.sSystemId = inputFileName; + aInput.aInputStream = xInputStream; + + TimeValue startTime, endTime; + osl_getSystemTime( &startTime ); + + m_xSaxParser->parseStream ( aInput ); + + // xOutputStream->closeOutput(); + xInputStream->closeInput(); + + osl_getSystemTime( &endTime ); + + double diff = ((double)((endTime.Nanosec + endTime.Seconds*1000000000.0) + - (startTime.Nanosec + startTime.Seconds*1000000000.0)))/((double)1000000000.0); + char buf[32]; + sprintf(buf, "%.2f", diff); + ouMessage += rtl::OUString(RTL_ASCII_USTRINGPARAM(buf)); + } + + return ouMessage; +} + +void SAL_CALL XSecTester::setCryptoDir(const rtl::OUString & javaDirName, const rtl::OUString & cDirName) + throw (cssu::RuntimeException) +{ + m_ouJavaCryptokenDir = javaDirName; + m_ouCCryptokenDir = cDirName; +} + + +cssu::Reference< cssu::XInterface > SAL_CALL XSecTester_createInstance( + const cssu::Reference< cssl::XMultiServiceFactory > & rSMgr) + throw( cssu::Exception ) +{ + return (cppu::OWeakObject*) new XSecTester( rSMgr ); +} + +int SecurityEntity::m_nNextSecurityId = 1; + +SecurityEntity::SecurityEntity( + const cssu::Reference<cssxc::sax::XSecuritySAXEventKeeper>& xSAXEventKeeper, + const cssu::Reference<cssxc::XXMLSecurityContext>& xXMLSecurityContext, + const cssu::Reference<cssxc::XXMLSignature>& xXMLSignature, + const cssu::Reference< cssl::XMultiServiceFactory > &rsMSF) + :m_xSAXEventKeeper(xSAXEventKeeper), + m_xXMLSecurityContext(xXMLSecurityContext), + m_xXMLSignature(xXMLSignature), + mxMSF(rsMSF), + m_ouKeyURI(RTL_ASCII_USTRINGPARAM("")) +{ + m_nSecurityId = getNextSecurityId(); +} + +int SecurityEntity::getNextSecurityId() const +{ + int nId = m_nNextSecurityId++; + return nId; +} + +void SecurityEntity::setKeyId(int nId) +{ + cssu::Reference<cssxc::sax::XKeyCollector> keyCollector (m_xReferenceListener, cssu::UNO_QUERY); + keyCollector->setKeyId(nId); +} + + +void SecurityEntity::setKeyURI(const rtl::OUString& ouUri) +{ + m_ouKeyURI = ouUri; +} + +cssu::Reference<cssxc::sax::XReferenceResolvedListener> SecurityEntity::getReferenceListener() const +{ + return m_xReferenceListener; +} + +int SecurityEntity::getSecurityId() const +{ + return m_nSecurityId; +} + +bool SecurityEntity::setKey(const rtl::OUString& ouUri, bool bIsExporting) +{ + bool rc = false; + + if (m_ouKeyURI != rtl::OUString(RTL_ASCII_USTRINGPARAM("")) && + m_ouKeyURI == ouUri) + { + int nKeeperId = m_xSAXEventKeeper->addSecurityElementCollector( + bIsExporting ? + (cssxc::sax::ElementMarkPriority_BEFOREMODIFY): + (cssxc::sax::ElementMarkPriority_AFTERMODIFY), + true); + + setKeyId(nKeeperId); + m_xSAXEventKeeper->setSecurityId(nKeeperId, m_nSecurityId); + + cssu::Reference<cssxc::sax::XReferenceResolvedBroadcaster> xReferenceResolvedBroadcaster + (m_xSAXEventKeeper, cssu::UNO_QUERY); + xReferenceResolvedBroadcaster->addReferenceResolvedListener(nKeeperId, + m_xReferenceListener); + + rc = true; + } + + return rc; +} + +bool SecurityEntity::endMission() +{ + cssu::Reference<cssxc::sax::XMissionTaker> xMissionTaker + (m_xReferenceListener, cssu::UNO_QUERY); + + return xMissionTaker->endMission(); +} + +SignatureEntity::SignatureEntity( + const cssu::Reference<cssxc::sax::XSecuritySAXEventKeeper>& xSAXEventKeeper, + bool bIsExporting, + XSecTester* pListener, + const cssu::Reference<cssxc::XXMLSecurityContext>& xXMLSecurityContext, + const cssu::Reference<cssxc::XXMLSignature>& xXMLSignature, + const cssu::Reference< cssl::XMultiServiceFactory >& rsMSF) + :SecurityEntity(xSAXEventKeeper, + xXMLSecurityContext, + xXMLSignature, + rsMSF) +{ + if (bIsExporting) + { + m_nSignatureElementCollectorId = + m_xSAXEventKeeper->addSecurityElementCollector( + cssxc::sax::ElementMarkPriority_AFTERMODIFY, + true); + + m_xSAXEventKeeper->setSecurityId(m_nSignatureElementCollectorId, m_nSecurityId); + + m_xReferenceListener = cssu::Reference< cssxc::sax::XReferenceResolvedListener >( + mxMSF->createInstance( rtl::OUString::createFromAscii( SIGNATURECREATOR_COMPONENT )), + cssu::UNO_QUERY); + + cssu::Reference<cssl::XInitialization> xInitialization(m_xReferenceListener, cssu::UNO_QUERY); + + cssu::Sequence<cssu::Any> args(5); + char buf[16]; + + sprintf(buf, "%d", m_nSecurityId); + args[0] = cssu::makeAny(rtl::OUString(RTL_ASCII_USTRINGPARAM(buf))); + args[1] = cssu::makeAny(m_xSAXEventKeeper); + + sprintf(buf, "%d", m_nSignatureElementCollectorId); + args[2] = cssu::makeAny(rtl::OUString(RTL_ASCII_USTRINGPARAM(buf))); + args[3] = cssu::makeAny(m_xXMLSecurityContext->getSecurityEnvironment()); + args[4] = cssu::makeAny(m_xXMLSignature); + + xInitialization->initialize(args); + + int nBlockerId = m_xSAXEventKeeper->addBlocker(); + m_xSAXEventKeeper->setSecurityId(nBlockerId, m_nSecurityId); + + cssu::Reference<cssxc::sax::XBlockerMonitor> xBlockerMonitor(m_xReferenceListener, cssu::UNO_QUERY); + xBlockerMonitor->setBlockerId(nBlockerId); + + cssu::Reference< cssxc::sax::XSignatureCreationResultBroadcaster > xSignatureCreationResultBroadcaster + (m_xReferenceListener, cssu::UNO_QUERY); + xSignatureCreationResultBroadcaster->addSignatureCreationResultListener(pListener); + } + else + { + m_nSignatureElementCollectorId = + m_xSAXEventKeeper->addSecurityElementCollector( + cssxc::sax::ElementMarkPriority_BEFOREMODIFY, + false); + + m_xSAXEventKeeper->setSecurityId(m_nSignatureElementCollectorId, m_nSecurityId); + + m_xReferenceListener = cssu::Reference< cssxc::sax::XReferenceResolvedListener >( + mxMSF->createInstance( rtl::OUString::createFromAscii( SIGNATUREVERIFIER_COMPONENT )), + cssu::UNO_QUERY); + + cssu::Reference<cssl::XInitialization> xInitialization(m_xReferenceListener, cssu::UNO_QUERY); + + cssu::Sequence<cssu::Any> args(5); + char buf[16]; + + sprintf(buf, "%d", m_nSecurityId); + args[0] = cssu::makeAny(rtl::OUString(RTL_ASCII_USTRINGPARAM(buf))); + args[1] = cssu::makeAny(m_xSAXEventKeeper); + + sprintf(buf, "%d", m_nSignatureElementCollectorId); + args[2] = cssu::makeAny(rtl::OUString(RTL_ASCII_USTRINGPARAM(buf))); + args[3] = cssu::makeAny(m_xXMLSecurityContext); + args[4] = cssu::makeAny(m_xXMLSignature); + xInitialization->initialize(args); + + cssu::Reference< cssxc::sax::XSignatureVerifyResultBroadcaster > xSignatureVerifyResultBroadcaster + (m_xReferenceListener, cssu::UNO_QUERY); + xSignatureVerifyResultBroadcaster->addSignatureVerifyResultListener(pListener); + } + + cssu::Reference<cssxc::sax::XReferenceResolvedBroadcaster> xReferenceResolvedBroadcaster + (m_xSAXEventKeeper, cssu::UNO_QUERY); + xReferenceResolvedBroadcaster->addReferenceResolvedListener( + m_nSignatureElementCollectorId, m_xReferenceListener); +} + +void SignatureEntity::addReferenceURI(const rtl::OUString& ouUri) +{ + m_vReferenceIds.push_back(ouUri); +} + +void SignatureEntity::setReferenceNumber() const +{ + cssu::Reference<cssxc::sax::XReferenceCollector> xReferenceCollector + (m_xReferenceListener, cssu::UNO_QUERY); + xReferenceCollector->setReferenceCount(m_vReferenceIds.size()); +} + +bool SignatureEntity::hasReference(const rtl::OUString& ouUri) const +{ + bool rc = false; + + std::vector<const rtl::OUString>::const_iterator ii; + for (ii = m_vReferenceIds.begin(); ii != m_vReferenceIds.end(); ++ii) + { + if (ouUri == *ii) + { + rc = true; + break; + } + } + + return rc; +} + +bool SignatureEntity::setReference(const rtl::OUString& ouUri, bool bIsExporting) const +{ + bool rc = false; + + if (hasReference(ouUri)) + { + int nKeeperId = m_xSAXEventKeeper->addSecurityElementCollector( + bIsExporting ? + (cssxc::sax::ElementMarkPriority_AFTERMODIFY): + (cssxc::sax::ElementMarkPriority_BEFOREMODIFY), + false); + + m_xSAXEventKeeper->setSecurityId(nKeeperId, m_nSecurityId); + + cssu::Reference<cssxc::sax::XReferenceResolvedBroadcaster> xReferenceResolvedBroadcaster + (m_xSAXEventKeeper, cssu::UNO_QUERY); + xReferenceResolvedBroadcaster->addReferenceResolvedListener(nKeeperId, m_xReferenceListener); + + cssu::Reference<cssxc::sax::XReferenceCollector> xReferenceCollector + (m_xReferenceListener, cssu::UNO_QUERY); + xReferenceCollector->setReferenceId(nKeeperId); + + rc = true; + } + + return rc; +} + +/* XDocumentHandler */ +void SAL_CALL XSecTester::startDocument() + throw (cssu::RuntimeException) +{ +} + +void SAL_CALL XSecTester::endDocument() + throw (cssu::RuntimeException) +{ +} + +void SAL_CALL XSecTester::characters(const class rtl::OUString & chars) + throw (cssu::RuntimeException) +{ + m_xExportHandler->characters(chars); +} + +void SAL_CALL XSecTester::processingInstruction(const rtl::OUString & target, const rtl::OUString &data) + throw (cssu::RuntimeException) +{ + m_xExportHandler->processingInstruction(target, data); +} + +void SAL_CALL XSecTester::ignorableWhitespace(const rtl::OUString &) + throw (cssu::RuntimeException) +{ + +} + +void SAL_CALL XSecTester::startElement(const rtl::OUString & name, const cssu::Reference<cssxs::XAttributeList> &xAttribs) + throw (cssu::RuntimeException) +{ + rtl::OUString ouIdAttr = xAttribs->getValueByName( + rtl::OUString(RTL_ASCII_USTRINGPARAM("id"))); + + if (ouIdAttr == NULL) + { + ouIdAttr = xAttribs->getValueByName( + rtl::OUString(RTL_ASCII_USTRINGPARAM("Id"))); + } + + bool bHasIdAttr = (ouIdAttr != NULL && ouIdAttr.getLength() > 0 ); + bool needResend = false; + + if (bHasIdAttr || name.equalsAscii( SIGNATURE_STR )) + { + if (foundSecurityRelated() && ! m_bIsExporting) + { + needResend = true; + } + } + + if ( !m_bIsSAXEventKeeperOnTheSAXChain ) + { + addStartAncestorEvent(name, xAttribs); + } + + bool bSuppressingForwarding = checkSecurityElement(name, xAttribs); + + checkReference(name, xAttribs, ouIdAttr); + + if (needResend) + { + m_xSAXEventKeeper->setNextHandler(NULL); + + cssu::Reference<cssxs::XDocumentHandler> xSAXEventKeeperHandler + (m_xSAXEventKeeper, cssu::UNO_QUERY); + + xSAXEventKeeperHandler->startElement(name, xAttribs); + m_xSAXEventKeeper->setNextHandler(this); + } + + if (!bSuppressingForwarding) + { + m_xExportHandler->startElement(name, xAttribs); + } +} + +void SAL_CALL XSecTester::endElement(const rtl::OUString& name) + throw (cssu::RuntimeException) +{ + if (!m_stCurrentPath.empty()) + { + void* pSignedInfo = m_stCurrentPath.top(); + bool bIsStringType = m_stCurrentPathType.top(); + + m_stCurrentPath.pop(); + m_stCurrentPathType.pop(); + + if (bIsStringType && !strcmp((const char *)pSignedInfo, SIGNEDINFO_STR)) + { + if (!m_stCurrentPath.empty()) + { + void* pSignature = m_stCurrentPath.top(); + bIsStringType = m_stCurrentPathType.top(); + + if (!bIsStringType && pSignature != NULL) + { + ((SignatureEntity *) pSignature)->setReferenceNumber(); + } + } + } + } + + if ( !m_bIsSAXEventKeeperOnTheSAXChain ) + { + addEndAncestorEvent(name); + } + + m_xExportHandler->endElement(name); +} + +void SAL_CALL XSecTester::setDocumentLocator( const cssu::Reference<cssxs::XLocator>& ) + throw (cssu::RuntimeException) +{ +} + +void XSecTester::changeOutput() +{ + if (m_bIsExporting) + { + if (m_bIsSAXEventKeeperOnTheSAXChain) + { + m_xExportHandler = cssu::Reference<cssxs::XDocumentHandler> + (m_xSAXEventKeeper, cssu::UNO_QUERY); + + m_xSAXEventKeeper->setNextHandler(NULL); + + flushAncestorEvents(m_xExportHandler); + + m_xSAXEventKeeper->setNextHandler(m_xOutputHandler); + } + else + { + m_xExportHandler = m_xOutputHandler; + } + } + else + { + if (m_bIsSAXEventKeeperOnTheSAXChain) + { + cssu::Reference<cssxs::XDocumentHandler> xSAXEventKeeperHandler + (m_xSAXEventKeeper, cssu::UNO_QUERY); + + m_xSAXEventKeeper->setNextHandler(NULL); + + flushAncestorEvents(xSAXEventKeeperHandler); + + m_xSaxParser->setDocumentHandler(xSAXEventKeeperHandler); + m_xSAXEventKeeper->setNextHandler(this); + } + else + { + m_xSaxParser->setDocumentHandler(this); + } + + } +} + +bool XSecTester::foundSecurityRelated() +{ + if (m_xSAXEventKeeper == NULL) + { + m_bIsBlocking = false; + m_bIsInsideCollectedElement = false; + + m_xXMLDocumentWrapper = cssu::Reference<cssxw::XXMLDocumentWrapper> + (mxMSF->createInstance( m_ouXMLDocumentWrapperComponentName ), + cssu::UNO_QUERY); + + m_xSAXEventKeeper = cssu::Reference< cssxc::sax::XSecuritySAXEventKeeper > + (mxMSF->createInstance( rtl::OUString::createFromAscii( SAXEVENTKEEPER_COMPONENT )), + cssu::UNO_QUERY); + + cssu::Reference<cssl::XInitialization> xInitialization(m_xSAXEventKeeper, cssu::UNO_QUERY); + + cssu::Sequence <cssu::Any> arg(1); + arg[0] = cssu::makeAny(m_xXMLDocumentWrapper); + xInitialization->initialize(arg); + + cssu::Reference<cssxc::sax::XSAXEventKeeperStatusChangeBroadcaster> + xSAXEventKeeperStatusChangeBroadcaster(m_xSAXEventKeeper, cssu::UNO_QUERY); + xSAXEventKeeperStatusChangeBroadcaster->addSAXEventKeeperStatusChangeListener(this); + } + + bool rc = false; + + if (!m_bIsSAXEventKeeperOnTheSAXChain) + { + rc = true; + } + + m_bIsSAXEventKeeperOnTheSAXChain=true; + changeOutput(); + + return rc; +} + +void XSecTester::findKeyOrReference(SecurityEntity* pSecurityEntity, const rtl::OUString& ouUri, bool bIsFindingKey) +{ + std::vector<rtl::OUString>::iterator ii_referenceURIs; + std::vector<int>::iterator ii_referenceKeeperIds; + std::vector<int>::iterator ii_referenceRefNums; + + for (ii_referenceURIs = m_vUnsolvedReferenceURIs.begin(), + ii_referenceKeeperIds = m_vUnsolvedReferenceKeeperIds.begin(), + ii_referenceRefNums = m_vUnsolvedReferenceRefNums.begin(); + ii_referenceURIs != m_vUnsolvedReferenceURIs.end(); ) + { + rtl::OUString ouReferenceUri = *ii_referenceURIs; + + if (ouReferenceUri == ouUri) + { + int nKeeperId = *ii_referenceKeeperIds; + int nRefNum = *ii_referenceRefNums; + + if ( bIsFindingKey ) + { + int nClonedKeeperId = m_xSAXEventKeeper->cloneElementCollector( + nKeeperId, + m_bIsExporting? + (cssxc::sax::ElementMarkPriority_BEFOREMODIFY): + (cssxc::sax::ElementMarkPriority_AFTERMODIFY)); + + pSecurityEntity->setKeyId(nClonedKeeperId); + + m_xSAXEventKeeper->setSecurityId(nClonedKeeperId, pSecurityEntity->getSecurityId()); + + cssu::Reference<cssxc::sax::XReferenceResolvedBroadcaster> + xReferenceResolvedBroadcaster(m_xSAXEventKeeper, cssu::UNO_QUERY); + xReferenceResolvedBroadcaster->addReferenceResolvedListener( + nClonedKeeperId, + pSecurityEntity->getReferenceListener()); + } + else + { + int nClonedKeeperId = m_xSAXEventKeeper->cloneElementCollector( + nKeeperId, + m_bIsExporting? + (cssxc::sax::ElementMarkPriority_AFTERMODIFY): + (cssxc::sax::ElementMarkPriority_BEFOREMODIFY)); + + m_xSAXEventKeeper->setSecurityId(nClonedKeeperId, pSecurityEntity->getSecurityId()); + + cssu::Reference<cssxc::sax::XReferenceResolvedBroadcaster> + xReferenceResolvedBroadcaster + (m_xSAXEventKeeper, cssu::UNO_QUERY); + xReferenceResolvedBroadcaster->addReferenceResolvedListener( + nClonedKeeperId, + pSecurityEntity->getReferenceListener()); + + cssu::Reference<cssxc::sax::XReferenceCollector> xReferenceCollector + (pSecurityEntity->getReferenceListener(), cssu::UNO_QUERY); + xReferenceCollector->setReferenceId(nClonedKeeperId); + } + + nRefNum--; + if (nRefNum == 0) + { + m_xSAXEventKeeper->removeElementCollector(nKeeperId); + + ii_referenceURIs = m_vUnsolvedReferenceURIs.erase(ii_referenceURIs); + ii_referenceKeeperIds = m_vUnsolvedReferenceKeeperIds.erase(ii_referenceKeeperIds); + ii_referenceRefNums = m_vUnsolvedReferenceRefNums.erase(ii_referenceRefNums); + } + else + { + (*ii_referenceRefNums) = nRefNum; + + ii_referenceURIs++; + ii_referenceKeeperIds++; + ii_referenceRefNums++; + } + + if (bIsFindingKey) + { + break; + } + } + else + { + ii_referenceURIs++; + ii_referenceKeeperIds++; + ii_referenceRefNums++; + } + } +} + +bool XSecTester::checkSecurityElement( + const rtl::OUString& ouLocalName, + const cssu::Reference<cssxs::XAttributeList>& xAttribs) +{ + bool rc = false; + + if (ouLocalName.equalsAscii(SIGNATURE_STR)) + { + SignatureEntity* pSignatureEntity = new SignatureEntity( + m_xSAXEventKeeper, + m_bIsExporting, + this, + m_xXMLSecurityContext, + m_xXMLSignature, + mxMSF); + + m_vSignatureList.push_back(pSignatureEntity); + + m_stCurrentPath.push(pSignatureEntity); + m_stCurrentPathType.push(false); + } + else if (ouLocalName.equalsAscii(REFERENCE_STR)) + { + if (!m_stCurrentPath.empty()) + { + void* pSignedInfo = m_stCurrentPath.top(); + bool bIsStringType = m_stCurrentPathType.top(); + + m_stCurrentPath.pop(); + m_stCurrentPathType.pop(); + + if (bIsStringType && !m_stCurrentPath.empty()) + { + void* pSignature = m_stCurrentPath.top(); + bool bIsStringType2 = m_stCurrentPathType.top(); + + if (!strcmp((const char*)pSignedInfo, SIGNEDINFO_STR) && !bIsStringType2) + { + rtl::OUString ouUri = xAttribs->getValueByName + (rtl::OUString(RTL_ASCII_USTRINGPARAM( URI_ATTR_STR ))); + + if (ouUri.matchAsciiL("#", 1, 0)) + { + rtl::OUString uri = ouUri.copy(1); + SignatureEntity* pSignatureEntity = (SignatureEntity *)pSignature; + + if (uri != NULL && uri.getLength()>0) + { + pSignatureEntity->addReferenceURI(uri); + findKeyOrReference(pSignatureEntity, uri, true); + } + } + } + } + m_stCurrentPath.push(pSignedInfo); + m_stCurrentPathType.push(bIsStringType); + } + m_stCurrentPath.push( (void *)REFERENCE_STR); + m_stCurrentPathType.push(true); + } + else if(ouLocalName.equalsAscii(KEYVALUE_STR) || + ouLocalName.equalsAscii(KEYNAME_STR) || + ouLocalName.equalsAscii(X509DATA_STR) || + ouLocalName.equalsAscii(ENCRYPTEDKEY_STR)) + { + if (!m_stCurrentPath.empty()) + { + void* pKeyInfo = m_stCurrentPath.top(); + bool bIsStringType = m_stCurrentPathType.top(); + + m_stCurrentPath.pop(); + m_stCurrentPathType.pop(); + + if (bIsStringType && !m_stCurrentPath.empty()) + { + bool bIsStringType2 = m_stCurrentPathType.top(); + + if (!bIsStringType2) + { + SecurityEntity *pSecurityEntity = + (SecurityEntity *) (m_stCurrentPath.top()); + pSecurityEntity->setKeyId(0); + } + } + + m_stCurrentPath.push(pKeyInfo); + m_stCurrentPathType.push(bIsStringType); + } + + m_stCurrentPath.push((void *)KEYVALUE_STR); + m_stCurrentPathType.push(true); + } + else if(ouLocalName.equalsAscii(RETRIEVALMETHOD_STR)) + { + if (!m_stCurrentPath.empty()) + { + void* pKeyInfo = m_stCurrentPath.top(); + bool bIsStringType = m_stCurrentPathType.top(); + + m_stCurrentPath.pop(); + m_stCurrentPathType.pop(); + + if (bIsStringType && !m_stCurrentPath.empty()) + { + bool bIsStringType2 = m_stCurrentPathType.top(); + + if (!bIsStringType2) + { + SecurityEntity *pSecurityEntity = + (SecurityEntity *) m_stCurrentPath.top(); + rtl::OUString ouUri = xAttribs->getValueByName( + rtl::OUString(RTL_ASCII_USTRINGPARAM( URI_ATTR_STR ))); + + if (!strcmp((const char *)pKeyInfo, KEYINFO_STR) && + ouUri != NULL && ouUri.getLength()>0) + { + pSecurityEntity->setKeyURI(ouUri); + findKeyOrReference(pSecurityEntity, ouUri, true); + } + } + + } + + m_stCurrentPath.push(pKeyInfo); + m_stCurrentPathType.push(bIsStringType); + } + + m_stCurrentPath.push((void *)RETRIEVALMETHOD_STR); + m_stCurrentPathType.push(true); + } + else if(ouLocalName.equalsAscii(KEYINFO_STR)) + { + m_stCurrentPath.push((void *)KEYINFO_STR); + m_stCurrentPathType.push(true); + } + else if(ouLocalName.equalsAscii(SIGNEDINFO_STR)) + { + m_stCurrentPath.push((void *)SIGNEDINFO_STR); + m_stCurrentPathType.push(true); + } + else + { + m_stCurrentPath.push((void *)OTHER_ELEMENT_STR); + m_stCurrentPathType.push(true); + } + + return rc; +} + +void XSecTester::checkReference( + const rtl::OUString& ouLocalName, + const cssu::Reference<cssxs::XAttributeList>& xAttribs, + const rtl::OUString& ouId) +{ + rtl::OUString refNumStr = + xAttribs->getValueByName(rtl::OUString(RTL_ASCII_USTRINGPARAM(REFNUM_ATTR_STR))); + + if (ouId != NULL && ouId.getLength()>0 ) + { + int nRefNum = 999; + if (refNumStr != NULL && refNumStr.getLength()>0 ) + { + nRefNum = refNumStr.toInt32(); + } + + int nLength = m_vSignatureList.size(); + for (int i = 0; i<nLength; ++i) + { + SignatureEntity* pSignatureEntity = m_vSignatureList.at(i); + + if (pSignatureEntity->setReference(ouId, m_bIsExporting)) + { + nRefNum--; + } + + if (pSignatureEntity->setKey(ouId, m_bIsExporting)) + { + nRefNum--; + } + } + + if (nRefNum>0) + { + int nKeeperId; + + if (ouLocalName.equalsAscii(ENCRYPTEDKEY_STR)) + { + nKeeperId = m_xSAXEventKeeper->addSecurityElementCollector( + m_bIsExporting ? + (cssxc::sax::ElementMarkPriority_BEFOREMODIFY): + (cssxc::sax::ElementMarkPriority_AFTERMODIFY), + true); + } + else + { + nKeeperId = m_xSAXEventKeeper->addSecurityElementCollector( + m_bIsExporting? + (cssxc::sax::ElementMarkPriority_AFTERMODIFY): + (cssxc::sax::ElementMarkPriority_BEFOREMODIFY), + false); + } + + m_vUnsolvedReferenceURIs.push_back(ouId); + m_vUnsolvedReferenceKeeperIds.push_back(nKeeperId); + m_vUnsolvedReferenceRefNums.push_back(nRefNum); + } + } +} + +void XSecTester::endMission() +{ + while (m_vSignatureList.size() > 0) + { + if (m_vSignatureList.size()>0) + { + SignatureEntity * pSignatureEntity = m_vSignatureList.at(0); + m_vSignatureList.erase(m_vSignatureList.begin()); + pSignatureEntity->endMission(); + delete pSignatureEntity; + } + } + + while (m_vUnsolvedReferenceURIs.size()>0) + { + int nKeeperId = m_vUnsolvedReferenceKeeperIds.at(0); + m_xSAXEventKeeper->removeElementCollector(nKeeperId); + m_vUnsolvedReferenceURIs.erase(m_vUnsolvedReferenceURIs.begin()); + m_vUnsolvedReferenceKeeperIds.erase(m_vUnsolvedReferenceKeeperIds.begin()); + m_vUnsolvedReferenceRefNums.erase(m_vUnsolvedReferenceRefNums.begin()); + } +} + +void XSecTester::addStartAncestorEvent( + const rtl::OUString& ouName, + const cssu::Reference< cssxs::XAttributeList >& xAttribs) +{ + sal_Int32 nLength = xAttribs->getLength(); + AncestorEvent* ancestorEvent = new AncestorEvent( nLength ); + + ancestorEvent->bIsStartElement = true; + ancestorEvent->ouName = ouName; + + for (int i = 0; i<nLength; ++i) + { + (ancestorEvent->aAttributeList[i]).sName = xAttribs->getNameByIndex((short)i); + (ancestorEvent->aAttributeList[i]).sValue =xAttribs->getValueByIndex((short)i); + } + + m_vAncestorEvents.push_back(ancestorEvent); +} + +void XSecTester::addEndAncestorEvent(const rtl::OUString& ouName) +{ + AncestorEvent* ancestorEvent = new AncestorEvent(0); + + ancestorEvent->bIsStartElement = false; + ancestorEvent->ouName = ouName; + + m_vAncestorEvents.push_back(ancestorEvent); +} + +void XSecTester::sendAncestorStartElementEvent( + const rtl::OUString& ouName, + const cssu::Sequence< cssxcsax::XMLAttribute >& attrList, + const cssu::Reference< cssxs::XDocumentHandler >& xDocumentHandler) const +{ + SvXMLAttributeList* pAttributeList = new SvXMLAttributeList(); + cssu::Reference < cssxs::XAttributeList > xAttrList + = cssu::Reference< cssxs::XAttributeList > (pAttributeList); + + sal_Int32 nLength = attrList.getLength(); + + for (int i = 0; i<nLength; ++i) + { + pAttributeList->AddAttribute( attrList[i].sName, attrList[i].sValue); + } + + xDocumentHandler->startElement(ouName, xAttrList); +} + +void XSecTester::sendAncestorEndElementEvent( + const rtl::OUString& ouName, + const cssu::Reference< cssxs::XDocumentHandler >& xDocumentHandler) const +{ + xDocumentHandler->endElement(ouName); +} + +std::vector< AncestorEvent* >::const_iterator XSecTester::checkAncestorStartElementEvent( + const std::vector< AncestorEvent* >::const_iterator& ii, + const cssu::Reference< cssxs::XDocumentHandler >& xDocumentHandler) const +{ + std::vector< AncestorEvent* >::const_iterator next = ii+1; + + if (next == m_vAncestorEvents.end()) + { + sendAncestorStartElementEvent( + (*ii)->ouName, (*ii)->aAttributeList, xDocumentHandler); + } + else + { + while ((next != m_vAncestorEvents.end()) && ((*next)->bIsStartElement)) + { + next = checkAncestorStartElementEvent(next, xDocumentHandler); + } + + if (next != m_vAncestorEvents.end()) + { + next++; + } + } + + return next; +} + +void XSecTester::flushAncestorEvents( + const cssu::Reference< cssxs::XDocumentHandler >& xDocumentHandler) +{ + std::vector< AncestorEvent* >::const_iterator ii; + + if (xDocumentHandler != NULL) + { + ii = m_vAncestorEvents.begin(); + + while (ii != m_vAncestorEvents.end()) + { + AncestorEvent* ancestorEvent = *ii; + + if (ancestorEvent->bIsStartElement) + { + ii = checkAncestorStartElementEvent(ii, xDocumentHandler); + } + else + { + sendAncestorEndElementEvent((*ii)->ouName, xDocumentHandler); + ii++; + } + } + } + + /* free the ancestor events list */ + std::vector< AncestorEvent* >::iterator jj; + + while (m_vAncestorEvents.size()>0) + { + jj = m_vAncestorEvents.begin(); + delete *jj; + m_vAncestorEvents.erase(jj); + } +} + +/* + * Get the length of a file in a platform independant fashion + */ +int getLength(const char *pInputFileName) +{ + int nSize = 0; + std::ifstream data(pInputFileName); + + data.seekg(0, std::ios_base::end); + nSize = data.tellg(); + + return nSize; +} + +void outputHeader() +{ + fprintf(stderr, "%16s%4s%8s%12s%12s%12s%12s\n", "File Name", "E/I", "Size", "-C++", "-Java", "Forw-O", "No S/E"); + fprintf(stderr, "===============================================================================\n"); +} + +/* + * print the output on the screen as well as in the GNUPlot data file + */ +void output(const rtl::OUString& ouInputFileName, + const rtl::OUString& ouTime_C, + const rtl::OUString& ouTime_Java, + const rtl::OUString& ouTime_NoSecurity, + const rtl::OUString& ouTime_JavaForwardOnly, + const rtl::OUString& ouRemark_C, + const rtl::OUString& ouRemark_Java, + bool bIsExporting) +{ + int nSize = getLength(rtl::OString(ouInputFileName, ouInputFileName.getLength(), RTL_TEXTENCODING_ASCII_US).getStr()); + std::ofstream data; + + /* print screen */ + int nPosition = ouInputFileName.lastIndexOf('\\'); + rtl::OUString fileName = ouInputFileName.copy(nPosition + 1); + + fprintf(stderr, "%16s", rtl::OString(fileName, fileName.getLength(), RTL_TEXTENCODING_ASCII_US).getStr()); + + fprintf(stderr, "%4s", bIsExporting?"E":"I"); + fprintf(stderr, "%7dK", nSize/1024); + fprintf(stderr, "%8s %3s", + rtl::OString(ouTime_C, ouTime_C.getLength(), RTL_TEXTENCODING_ASCII_US).getStr(), + rtl::OString(ouRemark_C, ouRemark_C.getLength(), RTL_TEXTENCODING_ASCII_US).getStr()); + fprintf(stderr, "%8s %3s", + rtl::OString(ouTime_Java, ouTime_Java.getLength(), RTL_TEXTENCODING_ASCII_US).getStr(), + rtl::OString(ouRemark_Java, ouRemark_Java.getLength(), RTL_TEXTENCODING_ASCII_US).getStr()); + fprintf(stderr, "%12s", rtl::OString(ouTime_JavaForwardOnly, ouTime_JavaForwardOnly.getLength(), RTL_TEXTENCODING_ASCII_US).getStr()); + fprintf(stderr, "%12s", rtl::OString(ouTime_NoSecurity, ouTime_NoSecurity.getLength(), RTL_TEXTENCODING_ASCII_US).getStr()); + fprintf(stderr, "\n"); + + /* output the data as GNUPlot data file */ + /* + char str[32]; + sprintf(str, "%d %s", nSize, rtl::OString(ouTime_C, ouTime_C.getLength(), RTL_TEXTENCODING_ASCII_US).getStr()); + data.open("d:\\time_vs_size.txt", std::ios::app); + data << str << std::endl; + data.close(); + + sprintf(str, "%d %s", nSize, rtl::OString(ouTime_Java, ouTime_Java.getLength(), RTL_TEXTENCODING_ASCII_US).getStr()); + data.open("d:\\time_vs_size_without_sec.txt", std::ios::app); + data << str << std::endl; + data.close(); + */ +} + +int main( int argc, char **argv ) +{ + if (argc < 3) + { + fprintf(stderr, "Usage: testtool <exportbatchfile> <importbatchfile> [<cppcryptotoken>] [<javacryptotoken>]\n"); + exit (-1); + } + + rtl::OUString aExportBatchFile = rtl::OUString::createFromAscii(argv[1]); + rtl::OUString aImportBatchFile = rtl::OUString::createFromAscii(argv[2]); + rtl::OUString aCPPCryptoToken; + if ( argc > 3 ) + aCPPCryptoToken = rtl::OUString::createFromAscii(argv[3]); + rtl::OUString aJavaCryptoToken; + if ( argc > 4 ) + aJavaCryptoToken = rtl::OUString::createFromAscii(argv[4]); + + try + { + uno::Reference< lang::XMultiServiceFactory > xMSF = CreateDemoServiceFactory(); + + XSecTester* pTester = new XSecTester( xMSF ); + uno::Reference< xml::sax::XDocumentHandler > xKeepARef = pTester; + + pTester->setCryptoDir( aJavaCryptoToken, aCPPCryptoToken ); + + rtl::OUString ouTime_C, ouTime_Java, ouTime_NoSecurity, ouTime_JavaForwardOnly; + rtl::OUString ouInputFileName; + rtl::OUString outputFileName1; + rtl::OUString outputFileName2; + rtl::OUString ouRemark_C, ouRemark_Java; + + outputHeader(); + + std::ifstream batch_export, batch_import; + + batch_export.open(OUStringToOString( aExportBatchFile, RTL_TEXTENCODING_ASCII_US ).getStr()); + + const int MAX_LINE = 80; + char line[MAX_LINE + 1]; + + while (batch_export.getline(line, MAX_LINE)) + { + ouInputFileName = rtl::OUString::createFromAscii(line); + int nPosition = ouInputFileName.lastIndexOf('.'); + int nPosition1; + + /* + * export the file with signautre/encryption (C++) + */ + outputFileName1 = ouInputFileName.copy(0, nPosition) + + rtl::OUString::createFromAscii("-ex.xml"); + ouTime_C = pTester->export_xml(ouInputFileName, outputFileName1, sal_False); + nPosition1 = ouTime_C.lastIndexOf('\t'); + ouRemark_C = ouTime_C.copy(nPosition1 + 1); + ouTime_C = ouTime_C.copy(0, nPosition1); + + /* + * export the file with signautre/encryption (Java) + */ + outputFileName1 = ouInputFileName.copy(0, nPosition) + + rtl::OUString::createFromAscii("-ex2.xml"); + ouTime_Java = pTester->export_xml(ouInputFileName, outputFileName1, sal_True); + nPosition1 = ouTime_Java.lastIndexOf('\t'); + ouRemark_Java = ouTime_Java.copy(nPosition1 + 1); + ouTime_Java = ouTime_Java.copy(0, nPosition1); + + /* + * export the file without signautre/encryption + */ + outputFileName2 = ouInputFileName.copy(0, nPosition) + + rtl::OUString::createFromAscii("-ex-no.xml"); + ouTime_NoSecurity = pTester->transfer_without_sec(ouInputFileName, outputFileName2, sal_False); + + /* + * export the file with Java Flat Filter + */ + outputFileName2 = ouInputFileName.copy(0, nPosition) + + rtl::OUString::createFromAscii("-ex-jf.xml"); + ouTime_JavaForwardOnly = pTester->transfer_without_sec(ouInputFileName, outputFileName2, sal_True); + + /* + * print output + */ + output(ouInputFileName, ouTime_C, ouTime_Java, ouTime_NoSecurity, ouTime_JavaForwardOnly, ouRemark_C, ouRemark_Java, true); + } + + batch_export.close(); + + batch_import.open(OUStringToOString( aImportBatchFile, RTL_TEXTENCODING_ASCII_US ).getStr()); + + while (batch_import.getline(line, MAX_LINE)) + { + ouInputFileName = rtl::OUString::createFromAscii(line); + int nPosition = ouInputFileName.lastIndexOf('.'); + int nPosition1; + + /* + * import the file with signautre/encryption (C++) + */ + outputFileName1 = ouInputFileName.copy(0, nPosition) + + rtl::OUString::createFromAscii("-im.xml"); + ouTime_C = pTester->import_xml(ouInputFileName, outputFileName1, sal_False); + nPosition1 = ouTime_C.lastIndexOf('\t'); + ouRemark_C = ouTime_C.copy(nPosition1 + 1); + ouTime_C = ouTime_C.copy(0, nPosition1); + + /* + * import the file with signautre/encryption (Java) + */ + outputFileName1 = ouInputFileName.copy(0, nPosition) + + rtl::OUString::createFromAscii("-im2.xml"); + ouTime_Java = pTester->import_xml(ouInputFileName, outputFileName1, sal_True); + nPosition1 = ouTime_Java.lastIndexOf('\t'); + ouRemark_Java = ouTime_Java.copy(nPosition1 + 1); + ouTime_Java = ouTime_Java.copy(0, nPosition1); + + /* + * import the file without signautre/encryption + */ + outputFileName2 = ouInputFileName.copy(0, nPosition) + + rtl::OUString::createFromAscii("-im-no.xml"); + ouTime_NoSecurity = pTester->transfer_without_sec(ouInputFileName, outputFileName2, sal_False); + + /* + * import the file without signautre/encryption + */ + + outputFileName2 = ouInputFileName.copy(0, nPosition) + + rtl::OUString::createFromAscii("-im-jf.xml"); + ouTime_JavaForwardOnly = pTester->transfer_without_sec(ouInputFileName, outputFileName2, sal_True); + + /* + * print output + */ + output(ouInputFileName, ouTime_C, ouTime_Java, ouTime_NoSecurity, ouTime_JavaForwardOnly, ouRemark_C, ouRemark_Java, false); + } + + batch_import.close(); + + fprintf(stderr, "\n"); + } + catch( cssu::Exception& e ) + { + fprintf( stderr , "\nEXCEPTION! Error Message: %s\n" , + rtl::OUStringToOString( e.Message, RTL_TEXTENCODING_ASCII_US ).getStr() ) ; + } + + return 0; +} diff --git a/xmlsecurity/tools/demo/readme.txt b/xmlsecurity/tools/demo/readme.txt new file mode 100644 index 000000000000..33b5e56ccecb --- /dev/null +++ b/xmlsecurity/tools/demo/readme.txt @@ -0,0 +1,22 @@ +How to use the demo programs +================================= + + +PERFORMANCE +------------------------------- + +This program is for evaluating the performance of the XML Security framework. + +You can use the sample files from tools/examples: + +run "performance eval_export.txt eval_import.txt" + +The export file list includes all files need to be signed, and the import file list include all files need to be verified. + +JavaFlatFilter: +Used to test performance with Java. +Currently it doesn't work, seems to be because of JavaFramework doesn't work in stand alone program. + +In case you want to try it: +- set CLASSPATH=e:\Solar\r\j2sdk1.4.1_03\jre\lib;d:\x\juh.jar;d:\x\jurt.jar;d:\x\ridl.jar;d:\x\unoil.jar;d:\x\java_uno.jar +- regcomp -register -r demo.rdb -c file://d/x/jflatfilter.jar -br demo.rdb
\ No newline at end of file diff --git a/xmlsecurity/tools/demo/signdemo.cxx b/xmlsecurity/tools/demo/signdemo.cxx new file mode 100644 index 000000000000..3cfad147beb3 --- /dev/null +++ b/xmlsecurity/tools/demo/signdemo.cxx @@ -0,0 +1,157 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_xmlsecurity.hxx" + +#include "util.hxx" + +#include <stdio.h> +#include <tools/date.hxx> +#include <tools/time.hxx> +#include <cppuhelper/servicefactory.hxx> + +#include <xmlsecurity/biginteger.hxx> +#include <xmlsecurity/xmlsignaturehelper.hxx> +#include "xmlsecurity/baseencoding.hxx" + +using namespace ::com::sun::star; + +int SAL_CALL main( int argc, char **argv ) +{ + if( argc < 4 ) + { + fprintf( stderr, "Usage: %s <signature file> <xml stream file> <binary stream file> [<cryptoken>]\n" , argv[0] ) ; + return -1 ; + } + + rtl::OUString aSIGFileName = rtl::OUString::createFromAscii(argv[1]); + rtl::OUString aXMLFileName = rtl::OUString::createFromAscii(argv[2]); + rtl::OUString aBINFileName = rtl::OUString::createFromAscii(argv[3]); + rtl::OUString aCryptoToken; + if ( argc >= 5 ) + aCryptoToken = rtl::OUString::createFromAscii(argv[4]); + + uno::Reference< lang::XMultiServiceFactory > xMSF = CreateDemoServiceFactory(); + + /* + * creates a signature helper + */ + XMLSignatureHelper aSignatureHelper( xMSF ); + + /* + * creates a security context. + */ + bool bInit = aSignatureHelper.Init( aCryptoToken ); + if ( !bInit ) + { + fprintf( stderr, "Error initializing security context!\n" ); + return -1; + } + + aSignatureHelper.StartMission(); + + /* + * select a private key certificate + */ + sal_Int32 i; + sal_Int32 nEnvCount = aSignatureHelper.GetSecurityEnvironmentNumber(); + if( nEnvCount == 0 ) + { + fprintf( stdout, "\nNo SecurityEnvironment found!\n" ) ; + return -1; + } + + uno::Sequence< uno::Reference< xml::crypto::XSecurityEnvironment > > xSecurityEnvironments(nEnvCount) ; + for( i=0; i < nEnvCount; i++ ) + xSecurityEnvironments[i] = aSignatureHelper.GetSecurityEnvironmentByIndex(i); + + fprintf( stdout, "\nSelect a SecurityEnvironment:\n" ) ; + for( i = 0; i < nEnvCount; i ++ ) + fprintf( stdout, "\n[%d] %s", i+1, rtl::OUStringToOString( xSecurityEnvironments[i]->getSecurityEnvironmentInformation() ,RTL_TEXTENCODING_ASCII_US ).getStr()); + + sal_Int32 nEnvIndex = QuerySelectNumber( 1, nEnvCount ) -1; + + uno::Reference< ::com::sun::star::security::XCertificate > xPersonalCert = getCertificateFromEnvironment(xSecurityEnvironments[nEnvIndex], true); + + if ( !xPersonalCert.is() ) + { + fprintf( stdout, "No certificate choosen - exit.\n" ); + return (-2); + } + + /* + * creates a new signature id + */ + sal_Int32 nSecurityId = aSignatureHelper.GetNewSecurityId(); + + /* + * configures the X509 certificate + */ + aSignatureHelper.SetX509Certificate( + nSecurityId, nEnvIndex, + xPersonalCert->getIssuerName(), + bigIntegerToNumericString( xPersonalCert->getSerialNumber()), + baseEncode(xPersonalCert->getEncoded(), BASE64)); + + /* + * configures date/time + */ + aSignatureHelper.SetDateTime( nSecurityId, Date(), Time()); + + /* + * signs the xml stream + */ + aSignatureHelper.AddForSigning( nSecurityId, aXMLFileName, aXMLFileName, sal_False ); + + /* + * signs the binary stream + */ + aSignatureHelper.AddForSigning( nSecurityId, aBINFileName, aBINFileName, sal_True ); + + /* + * creates signature + */ + uno::Reference< io::XOutputStream > xOutputStream = OpenOutputStream( aSIGFileName ); + bool bDone = aSignatureHelper.CreateAndWriteSignature( xOutputStream ); + + if ( !bDone ) + { + fprintf( stderr, "\nSTATUS: Error creating Signature!\n" ); + } + else + { + fprintf( stdout, "\nSTATUS: Signature successfully created!\n" ); + } + + aSignatureHelper.EndMission(); + + QueryPrintSignatureDetails( aSignatureHelper.GetSignatureInformations(), aSignatureHelper.GetSecurityEnvironment() ); + + return 0; +} + diff --git a/xmlsecurity/tools/demo/util.cxx b/xmlsecurity/tools/demo/util.cxx new file mode 100644 index 000000000000..5f9fccb9f7d9 --- /dev/null +++ b/xmlsecurity/tools/demo/util.cxx @@ -0,0 +1,111 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_xmlsecurity.hxx" + +#include "util.hxx" + +#include <stdio.h> + +#include <com/sun/star/registry/XImplementationRegistration.hpp> +#include <cppuhelper/bootstrap.hxx> +#include <comphelper/processfactory.hxx> +#include <unotools/streamhelper.hxx> +#include <tools/string.hxx> + +namespace cssu = com::sun::star::uno; +namespace cssl = com::sun::star::lang; +namespace cssxc = com::sun::star::xml::crypto; +namespace cssi = com::sun::star::io; + +using namespace ::com::sun::star; + +cssu::Reference< cssl::XMultiServiceFactory > CreateDemoServiceFactory() +{ + cssu::Reference< cssl::XMultiServiceFactory > xMSF; + + try + { + cssu::Reference< cssl::XMultiComponentFactory > xLocalServiceManager = NULL ; + cssu::Reference< cssu::XComponentContext > xLocalComponentContext = NULL ; + + cssu::Reference< ::com::sun::star::registry::XSimpleRegistry > xSimpleRegistry + = ::cppu::createSimpleRegistry(); + OSL_ENSURE( xSimpleRegistry.is(), + "serviceManager - " + "Cannot create simple registry" ) ; + + xSimpleRegistry->open(rtl::OUString::createFromAscii( "demo.rdb" ), sal_True, sal_False); + OSL_ENSURE( xSimpleRegistry->isValid() , + "serviceManager - " + "Cannot open xml security registry rdb" ) ; + + xLocalComponentContext = ::cppu::bootstrap_InitialComponentContext( xSimpleRegistry ) ; + OSL_ENSURE( xLocalComponentContext.is() , + "serviceManager - " + "Cannot create intial component context" ) ; + + xLocalServiceManager = xLocalComponentContext->getServiceManager() ; + OSL_ENSURE( xLocalServiceManager.is() , + "serviceManager - " + "Cannot create intial service manager" ) ; + + xMSF = cssu::Reference< cssl::XMultiServiceFactory >(xLocalServiceManager, cssu::UNO_QUERY) ; + + ::comphelper::setProcessServiceFactory( xMSF ); + } + catch( cssu::Exception& e ) + { + fprintf( stderr , "Error creating ServiceManager, Exception is %s\n" , rtl::OUStringToOString( e.Message , RTL_TEXTENCODING_ASCII_US ).getStr() ) ; + exit (-1); + } + + return xMSF; +} + +::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > OpenInputStream( const ::rtl::OUString& rStreamName ) +{ + SvFileStream* pStream = new SvFileStream( rStreamName, STREAM_READ ); + pStream->Seek( STREAM_SEEK_TO_END ); + sal_uLong nBytes = pStream->Tell(); + pStream->Seek( STREAM_SEEK_TO_BEGIN ); + SvLockBytesRef xLockBytes = new SvLockBytes( pStream, sal_True ); + uno::Reference< io::XInputStream > xInputStream = new utl::OInputStreamHelper( xLockBytes, nBytes ); + + return xInputStream; + +} + +::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream > OpenOutputStream( const ::rtl::OUString& rStreamName ) +{ + SvFileStream* pStream = new SvFileStream( rStreamName, STREAM_WRITE ); + SvLockBytesRef xLockBytes = new SvLockBytes( pStream, sal_True ); + uno::Reference< io::XOutputStream > xOutputStream = new utl::OOutputStreamHelper( xLockBytes ); + + return xOutputStream; +} diff --git a/xmlsecurity/tools/demo/util.hxx b/xmlsecurity/tools/demo/util.hxx new file mode 100644 index 000000000000..7ac5bb69a21a --- /dev/null +++ b/xmlsecurity/tools/demo/util.hxx @@ -0,0 +1,50 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include <rtl/ustring.hxx> + +#include <cppuhelper/servicefactory.hxx> +#include <xmlsecurity/xmlsignaturehelper.hxx> + +// Get the demo.rdb servcie manager... +::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > CreateDemoServiceFactory(); + +// Ask user to show more signature details... +void QueryPrintSignatureDetails( const SignatureInformations& SignatureInformations, ::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XSecurityEnvironment > ); + +// Query value from user. +int QuerySelectNumber( int nMin, int nMax ); + +// Ask to verify the signature +long QueryVerifySignature(); + +// Open In/Output Stream +::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > OpenInputStream( const ::rtl::OUString& rStreamName ); +::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream > OpenOutputStream( const ::rtl::OUString& rStreamName ); + +::rtl::OUString getSignatureInformations( const SignatureInformations& SignatureInformations, ::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XSecurityEnvironment > xSecurityEnvironment ); +::com::sun::star::uno::Reference< ::com::sun::star::security::XCertificate > getCertificateFromEnvironment( ::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XSecurityEnvironment > xSecurityEnvironment, sal_Bool nType); diff --git a/xmlsecurity/tools/demo/util2.cxx b/xmlsecurity/tools/demo/util2.cxx new file mode 100644 index 000000000000..f0115c419aa8 --- /dev/null +++ b/xmlsecurity/tools/demo/util2.cxx @@ -0,0 +1,426 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_xmlsecurity.hxx" + +#include <rtl/locale.h> +#include <osl/nlsupport.h> +#include <osl/process.h> + +#include <util.hxx> + +#include <stdio.h> + +#include <com/sun/star/registry/XImplementationRegistration.hpp> +#include <com/sun/star/security/KeyUsage.hpp> +#include <cppuhelper/bootstrap.hxx> +#include <xmlsecurity/biginteger.hxx> +#include <comphelper/processfactory.hxx> +#include <unotools/streamhelper.hxx> + +#include <rtl/ustrbuf.hxx> +#include <tools/string.hxx> + +namespace cssu = com::sun::star::uno; +namespace cssl = com::sun::star::lang; +namespace cssxc = com::sun::star::xml::crypto; +namespace cssi = com::sun::star::io; + +using namespace ::com::sun::star; + +/** convert util::DateTime to ISO Date String */ +void convertDateTime( ::rtl::OUStringBuffer& rBuffer, + const com::sun::star::util::DateTime& rDateTime ) +{ + String aString( String::CreateFromInt32( rDateTime.Year ) ); + aString += '-'; + if( rDateTime.Month < 10 ) + aString += '0'; + aString += String::CreateFromInt32( rDateTime.Month ); + aString += '-'; + if( rDateTime.Day < 10 ) + aString += '0'; + aString += String::CreateFromInt32( rDateTime.Day ); + + if( rDateTime.Seconds != 0 || + rDateTime.Minutes != 0 || + rDateTime.Hours != 0 ) + { + aString += 'T'; + if( rDateTime.Hours < 10 ) + aString += '0'; + aString += String::CreateFromInt32( rDateTime.Hours ); + aString += ':'; + if( rDateTime.Minutes < 10 ) + aString += '0'; + aString += String::CreateFromInt32( rDateTime.Minutes ); + aString += ':'; + if( rDateTime.Seconds < 10 ) + aString += '0'; + aString += String::CreateFromInt32( rDateTime.Seconds ); + if ( rDateTime.HundredthSeconds > 0) + { + aString += ','; + if (rDateTime.HundredthSeconds < 10) + aString += '0'; + aString += String::CreateFromInt32( rDateTime.HundredthSeconds ); + } + } + + rBuffer.append( aString ); +} + +::rtl::OUString printHexString(cssu::Sequence< sal_Int8 > data) +{ + int length = data.getLength(); + ::rtl::OUString result; + + char number[4]; + for (int j=0; j<length; j++) + { + sprintf(number, "%02X ", (unsigned char)data[j]); + result += rtl::OUString::createFromAscii( number ); + } + + return result; +} + + +::rtl::OUString getSignatureInformation( + const SignatureInformation& infor, + cssu::Reference< ::com::sun::star::xml::crypto::XSecurityEnvironment >& xSecurityEnvironment ) +{ + char* status[50] = { + "STATUS_UNKNOWN", + "OPERATION_SUCCEEDED", + "RUNTIMEERROR_FAILED", + "ENGINE_FAILED", + "MALLOC_FAILED", + "STRDUP_FAILED", + "CRYPTO_FAILED", + "XML_FAILED", + "XSLT_FAILED", + "IO_FAILED", + "DISABLED", + "NOT_IMPLEMENTED", + "INVALID_SIZE", + "INVALID_DATA", + "INVALID_RESULT", + "INVALID_TYPE", + "INVALID_OPERATION", + "INVALID_STATUS", + "INVALID_FORMAT", + "DATA_NOT_MATCH", + "INVALID_NODE", + "INVALID_NODE_CONTENT", + "INVALID_NODE_ATTRIBUTE", + "MISSING_NODE_ATTRIBUTE", + "NODE_ALREADY_PRESENT", + "UNEXPECTED_NODE", + "NODE_NOT_FOUND", + "INVALID_TRANSFORM", + "INVALID_TRANSFORM_KEY", + "INVALID_URI_TYPE", + "TRANSFORM_SAME_DOCUMENT_REQUIRED", + "TRANSFORM_DISABLED", + "INVALID_KEY_DATA", + "KEY_DATA_NOT_FOUND", + "KEY_DATA_ALREADY_EXIST", + "INVALID_KEY_DATA_SIZE", + "KEY_NOT_FOUND", + "KEYDATA_DISABLED", + "MAX_RETRIEVALS_LEVEL", + "MAX_RETRIEVAL_TYPE_MISMATCH", + "MAX_ENCKEY_LEVEL", + "CERT_VERIFY_FAILED", + "CERT_NOT_FOUND", + "CERT_REVOKED", + "CERT_ISSUER_FAILED", + "CERT_NOT_YET_VALID", + "CERT_HAS_EXPIRED", + "DSIG_NO_REFERENCES", + "DSIG_INVALID_REFERENCE", + "ASSERTION"}; + + rtl::OUString result; + + result += rtl::OUString::createFromAscii( "Security Id : " ) + +rtl::OUString::valueOf(infor.nSecurityId) + +rtl::OUString::createFromAscii( "\n" ); + result += rtl::OUString::createFromAscii( "Status : [" ) + +rtl::OUString::valueOf((sal_Int32)(infor.nStatus)) + +rtl::OUString::createFromAscii( "] " ) + +rtl::OUString::createFromAscii(status[infor.nStatus]) + +rtl::OUString::createFromAscii( "\n" ); + + const SignatureReferenceInformations& rInfors = infor.vSignatureReferenceInfors; + int i; + int size = rInfors.size(); + + result += rtl::OUString::createFromAscii( "--References :\n" ); + for (i=0; i<size; i++) + { + result += rtl::OUString::createFromAscii( "---URI : " ); + result += rInfors[i].ouURI; + result += rtl::OUString::createFromAscii( "\n" ); + result += rtl::OUString::createFromAscii( "---DigestValue : " ); + result += rInfors[i].ouDigestValue; + result += rtl::OUString::createFromAscii( "\n" ); + } + + if (infor.ouX509IssuerName.getLength()>0) + { + result += rtl::OUString::createFromAscii( "--X509IssuerName :\n" ); + result += infor.ouX509IssuerName; + result += rtl::OUString::createFromAscii( "\n" ); + } + + if (infor.ouX509SerialNumber.getLength()>0) + { + result += rtl::OUString::createFromAscii( "--X509SerialNumber :\n" ); + result += infor.ouX509SerialNumber; + result += rtl::OUString::createFromAscii( "\n" ); + } + + if (infor.ouX509Certificate.getLength()>0) + { + result += rtl::OUString::createFromAscii( "--X509Certificate :\n" ); + result += infor.ouX509Certificate; + result += rtl::OUString::createFromAscii( "\n" ); + } + + if (infor.ouSignatureValue.getLength()>0) + { + result += rtl::OUString::createFromAscii( "--SignatureValue :\n" ); + result += infor.ouSignatureValue; + result += rtl::OUString::createFromAscii( "\n" ); + } + + result += rtl::OUString::createFromAscii( "--Date :\n" ); + + ::rtl::OUStringBuffer buffer; + convertDateTime( buffer, infor.stDateTime ); + result += buffer.makeStringAndClear(); + result += rtl::OUString::createFromAscii( "\n" ); + + if (infor.ouX509IssuerName.getLength()>0 && infor.ouX509SerialNumber.getLength()>0 && xSecurityEnvironment.is()) + { + result += rtl::OUString::createFromAscii( "--Certificate Path :\n" ); + cssu::Reference< ::com::sun::star::security::XCertificate > xCert = xSecurityEnvironment->getCertificate( infor.ouX509IssuerName, numericStringToBigInteger(infor.ouX509SerialNumber) ); + cssu::Sequence < cssu::Reference< ::com::sun::star::security::XCertificate > > xCertPath; + if(! xCert.is() ) + { + fprintf(stdout , " xCert is NULL , so can not buildCertificatePath\n"); + return result ; + } + else + { + xCertPath = xSecurityEnvironment->buildCertificatePath( xCert ) ; + } + + for( int i = 0; i < xCertPath.getLength(); i++ ) + { + result += xCertPath[i]->getSubjectName(); + result += rtl::OUString::createFromAscii( "\n Subject public key algorithm : " ); + result += xCertPath[i]->getSubjectPublicKeyAlgorithm(); + result += rtl::OUString::createFromAscii( "\n Signature algorithm : " ); + result += xCertPath[i]->getSignatureAlgorithm(); + + result += rtl::OUString::createFromAscii( "\n Subject public key value : " ); + cssu::Sequence< sal_Int8 > keyValue = xCertPath[i]->getSubjectPublicKeyValue(); + result += printHexString(keyValue); + + result += rtl::OUString::createFromAscii( "\n Thumbprint (SHA1) : " ); + cssu::Sequence< sal_Int8 > SHA1Thumbprint = xCertPath[i]->getSHA1Thumbprint(); + result += printHexString(SHA1Thumbprint); + + result += rtl::OUString::createFromAscii( "\n Thumbprint (MD5) : " ); + cssu::Sequence< sal_Int8 > MD5Thumbprint = xCertPath[i]->getMD5Thumbprint(); + result += printHexString(MD5Thumbprint); + + result += rtl::OUString::createFromAscii( "\n <<\n" ); + } + + result += rtl::OUString::createFromAscii( "\n Key Usage : " ); + sal_Int32 usage = xCert->getCertificateUsage(); + + if (usage & ::com::sun::star::security::KeyUsage::DIGITAL_SIGNATURE) + { + result += rtl::OUString::createFromAscii( "DIGITAL_SIGNATURE " ); + } + + if (usage & ::com::sun::star::security::KeyUsage::NON_REPUDIATION) + { + result += rtl::OUString::createFromAscii( "NON_REPUDIATION " ); + } + + if (usage & ::com::sun::star::security::KeyUsage::KEY_ENCIPHERMENT) + { + result += rtl::OUString::createFromAscii( "KEY_ENCIPHERMENT " ); + } + + if (usage & ::com::sun::star::security::KeyUsage::DATA_ENCIPHERMENT) + { + result += rtl::OUString::createFromAscii( "DATA_ENCIPHERMENT " ); + } + + if (usage & ::com::sun::star::security::KeyUsage::KEY_AGREEMENT) + { + result += rtl::OUString::createFromAscii( "KEY_AGREEMENT " ); + } + + if (usage & ::com::sun::star::security::KeyUsage::KEY_CERT_SIGN) + { + result += rtl::OUString::createFromAscii( "KEY_CERT_SIGN " ); + } + + if (usage & ::com::sun::star::security::KeyUsage::CRL_SIGN) + { + result += rtl::OUString::createFromAscii( "CRL_SIGN " ); + } + + result += rtl::OUString::createFromAscii( "\n" ); + } + + result += rtl::OUString::createFromAscii( "\n" ); + return result; +} + +::rtl::OUString getSignatureInformations( + const SignatureInformations& SignatureInformations, + cssu::Reference< ::com::sun::star::xml::crypto::XSecurityEnvironment > xSecurityEnvironment ) +{ + rtl::OUString result; + int i; + int size = SignatureInformations.size(); + + for (i=0; i<size; i++) + { + const SignatureInformation& infor = SignatureInformations[i]; + result += getSignatureInformation( infor, xSecurityEnvironment ); + } + + result += rtl::OUString::createFromAscii( "\n" ); + + return result; +} + +::com::sun::star::uno::Reference< ::com::sun::star::security::XCertificate > + getCertificateFromEnvironment( ::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XSecurityEnvironment > xSecurityEnvironment , sal_Bool nType) +{ + cssu::Sequence< cssu::Reference< ::com::sun::star::security::XCertificate > > xPersonalCerts ; + int length = 0; + int i; + + // add By CP + sal_uInt16 encoding ; + rtl_Locale *pLocale = NULL ; + osl_getProcessLocale( &pLocale ) ; + encoding = osl_getTextEncodingFromLocale( pLocale ) ; + // CP end + + if( nType != sal_False ) + xPersonalCerts = xSecurityEnvironment->getPersonalCertificates() ; + else + return NULL; // not support then; + + length = xPersonalCerts.getLength(); + if(length == 0) + { + fprintf( stdout, "\nNo certificate found!\n" ) ; + return NULL; + } + + fprintf( stdout, "\nSelect a certificate:\n" ) ; + for( i = 0; i < length; i ++ ) + { + rtl::OUString xxxIssuer; + rtl::OUString xxxSubject; + rtl::OString yyyIssuer; + rtl::OString yyySubject; + + xxxIssuer=xPersonalCerts[i]->getIssuerName(); + yyyIssuer=rtl::OUStringToOString( xxxIssuer, encoding ); + + xxxSubject=xPersonalCerts[i]->getSubjectName(); + yyySubject=rtl::OUStringToOString( xxxSubject, encoding ); + + fprintf( stdout, "\n%d:\nsubject=[%s]\nissuer=[%s]\n", + i+1, + yyySubject.getStr(), + yyyIssuer.getStr()); + } + + int sel = QuerySelectNumber( 1, length ) -1; + return xPersonalCerts[sel] ; +} + +void QueryPrintSignatureDetails( const SignatureInformations& SignatureInformations, ::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XSecurityEnvironment > rSecEnv ) +{ + char cShowDetails; + fprintf( stdout, "\nDisplay details (y/n) [y]?" ); + fflush( stdout ); + fscanf( stdin, "%c", &cShowDetails); + if ( cShowDetails == 'y' ) + { + rtl_Locale *pLocale = NULL ; + osl_getProcessLocale( &pLocale ) ; + sal_uInt16 encoding = osl_getTextEncodingFromLocale( pLocale ) ; + + fprintf( stdout, "------------- Signature details START -------------\n" ); + fprintf( stdout, "%s", + rtl::OUStringToOString( + getSignatureInformations( SignatureInformations, rSecEnv), + encoding).getStr()); + + fprintf( stdout, "------------- Signature details END -------------\n" ); + } +} + +int QuerySelectNumber( int nMin, int nMax ) +{ + fprintf( stdout, "\n" ) ; + int sel = 0; + do + { + fprintf( stdout, "\nSelect <%d-%d>:", nMin, nMax ) ; + fflush( stdout ); + fscanf( stdin, "%d", &sel ) ; + } while( ( sel < nMin ) || ( sel > nMax ) ); + + return sel; +} + +long QueryVerifySignature() +{ + char answer; + fprintf( stdout, "\nFound a signature - verify this one (y/n) [y]?" ); + fflush( stdout ); + fscanf( stdin, "%c", &answer); + return (answer == 'n')?0:1; +} diff --git a/xmlsecurity/tools/demo/verifydemo.cxx b/xmlsecurity/tools/demo/verifydemo.cxx new file mode 100644 index 000000000000..2ea9c8d94a94 --- /dev/null +++ b/xmlsecurity/tools/demo/verifydemo.cxx @@ -0,0 +1,109 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_xmlsecurity.hxx" + +#include "util.hxx" + +#include <stdio.h> +#include <cppuhelper/servicefactory.hxx> + +#include <xmlsecurity/xmlsignaturehelper.hxx> + +using namespace ::com::sun::star; + +long startVerifyHandler( void *, void * ) +{ + return QueryVerifySignature(); +} + +int SAL_CALL main( int argc, char **argv ) +{ + if( argc < 2 ) + { + fprintf( stderr, "Usage: %s <signature file> [<cryptoken>]\n" , argv[0] ) ; + return -1 ; + } + + rtl::OUString aSIGFileName = rtl::OUString::createFromAscii(argv[1]); + rtl::OUString aCryptoToken; + if ( argc >= 3 ) + aCryptoToken = rtl::OUString::createFromAscii(argv[2]); + + uno::Reference< lang::XMultiServiceFactory > xMSF = CreateDemoServiceFactory(); + + + /* + * creates a signature helper + */ + XMLSignatureHelper aSignatureHelper( xMSF ); + + /* + * creates a security context. + */ + bool bInit = aSignatureHelper.Init( aCryptoToken ); + if ( !bInit ) + { + fprintf( stderr, "Error initializing security context!" ); + return -1; + } + + /* + * configures the start-verify handler + */ + aSignatureHelper.SetStartVerifySignatureHdl( Link( NULL, startVerifyHandler ) ); + + aSignatureHelper.StartMission(); + + /* + * verifies the signature + */ + uno::Reference< io::XInputStream > xInputStream = OpenInputStream( aSIGFileName ); + bool bDone = aSignatureHelper.ReadAndVerifySignature( xInputStream ); + + /* + * closes the signature stream + */ + xInputStream->closeInput(); + + if ( !bDone ) + { + fprintf( stderr, "\nSTATUS: Error verifying Signature!\n" ); + } + else + { + fprintf( stdout, "\nSTATUS: All choosen Signatures veryfied successfully!\n" ); + } + + aSignatureHelper.EndMission(); + + QueryPrintSignatureDetails( aSignatureHelper.GetSignatureInformations(), aSignatureHelper.GetSecurityEnvironment() ); + + return 0; +} + diff --git a/xmlsecurity/tools/examples/demo-sample.gif b/xmlsecurity/tools/examples/demo-sample.gif Binary files differnew file mode 100644 index 000000000000..92b2a025f05e --- /dev/null +++ b/xmlsecurity/tools/examples/demo-sample.gif diff --git a/xmlsecurity/tools/examples/demo-sample.sxw b/xmlsecurity/tools/examples/demo-sample.sxw Binary files differnew file mode 100644 index 000000000000..dc1472129b71 --- /dev/null +++ b/xmlsecurity/tools/examples/demo-sample.sxw diff --git a/xmlsecurity/tools/examples/demo-sample.xml b/xmlsecurity/tools/examples/demo-sample.xml new file mode 100644 index 000000000000..c4c1cd00b7b3 --- /dev/null +++ b/xmlsecurity/tools/examples/demo-sample.xml @@ -0,0 +1,3 @@ +<?xml version="1.0" encoding="UTF-8"?> +<signtest> +<document id="target">abc</document></signtest>
\ No newline at end of file diff --git a/xmlsecurity/tools/examples/enc-1.xml b/xmlsecurity/tools/examples/enc-1.xml new file mode 100644 index 000000000000..bfd2f11195e8 --- /dev/null +++ b/xmlsecurity/tools/examples/enc-1.xml @@ -0,0 +1,31 @@ +<?xml version="1.0"?> +<!-- +XML Security Library example: Simple encryption template file for encrypt1 example. +--> +<Envelope xmlns="urn:envelope"> + The encrypted data is <Data>Hello, World!</Data> + <EncryptedData xmlns="http://www.w3.org/2001/04/xmlenc#" Type="http://www.w3.org/2001/04/xmlenc#Element"> + <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#tripledes-cbc"></EncryptionMethod> + <KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#"> + <EncryptedKey xmlns="http://www.w3.org/2001/04/xmlenc#"> + <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-1_5"/> + <KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#"> + <X509Data> + <X509IssuerSerial> + <X509IssuerName>CN=Test Issuer</X509IssuerName> + <X509SerialNumber>123450001</X509SerialNumber> + </X509IssuerSerial> + </X509Data> + </KeyInfo> + <CipherData> + <CipherValue/> + </CipherData> + </EncryptedKey> + </KeyInfo> + <CipherData> + <CipherValue></CipherValue> + </CipherData> + </EncryptedData> + <Data> Hello, World! </Data> +</Envelope> + diff --git a/xmlsecurity/tools/examples/enc-2.xml b/xmlsecurity/tools/examples/enc-2.xml new file mode 100644 index 000000000000..98fc553c0c08 --- /dev/null +++ b/xmlsecurity/tools/examples/enc-2.xml @@ -0,0 +1,58 @@ +<?xml version="1.0"?> +<!-- +XML Security Library example: Simple encryption template file for encrypt1 example. +--> +<Envelope xmlns="urn:envelope"> + The encrypted data is <Data>Hello, World!</Data> + <EncryptedData xmlns="http://www.w3.org/2001/04/xmlenc#" Type="http://www.w3.org/2001/04/xmlenc#Element"> + <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#tripledes-cbc"></EncryptionMethod> + <KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#"> + <EncryptedKey xmlns="http://www.w3.org/2001/04/xmlenc#"> + <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-1_5"/> + <KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#"> + <X509Data> + <X509IssuerSerial> + <X509IssuerName>CN=Test Issuer</X509IssuerName> + <X509SerialNumber>123450001</X509SerialNumber> + </X509IssuerSerial> + </X509Data> + </KeyInfo> + <CipherData> + <CipherValue/> + </CipherData> + </EncryptedKey> + </KeyInfo> + <CipherData> + <CipherValue/> + </CipherData> + </EncryptedData> + <Data> + Hello, World! + <EncryptedData xmlns="http://www.w3.org/2001/04/xmlenc#" Type="http://www.w3.org/2001/04/xmlenc#Element"> + <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#tripledes-cbc"></EncryptionMethod> + <KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#"> + <EncryptedKey xmlns="http://www.w3.org/2001/04/xmlenc#"> + <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-1_5"/> + <KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#"> + <X509Data> + <X509IssuerSerial> + <X509IssuerName>CN=Test Issuer</X509IssuerName> + <X509SerialNumber>123450001</X509SerialNumber> + </X509IssuerSerial> + </X509Data> + </KeyInfo> + <CipherData> + <CipherValue/> + </CipherData> + </EncryptedKey> + </KeyInfo> + <CipherData> + <CipherValue></CipherValue> + </CipherData> + </EncryptedData> + <Data> + This is an embeded encryption! + </Data> + </Data> +</Envelope> + diff --git a/xmlsecurity/tools/examples/eval_export.txt b/xmlsecurity/tools/examples/eval_export.txt new file mode 100644 index 000000000000..cec4a2225dc4 --- /dev/null +++ b/xmlsecurity/tools/examples/eval_export.txt @@ -0,0 +1,7 @@ +warmup.xml +sign-0.xml +sign-1.xml +sign-2.xml +sign-3.xml +sign-4.xml +sign-5.xml
\ No newline at end of file diff --git a/xmlsecurity/tools/examples/eval_import.txt b/xmlsecurity/tools/examples/eval_import.txt new file mode 100644 index 000000000000..e789fe3cd123 --- /dev/null +++ b/xmlsecurity/tools/examples/eval_import.txt @@ -0,0 +1,14 @@ +warmup-ex.xml +sign-0-ex.xml +sign-1-ex.xml +sign-2-ex.xml +sign-3-ex.xml +sign-4-ex.xml +sign-5-ex.xml +warmup-ex2.xml +sign-0-ex2.xml +sign-1-ex2.xml +sign-2-ex2.xml +sign-3-ex2.xml +sign-4-ex2.xml +sign-5-ex2.xml
\ No newline at end of file diff --git a/xmlsecurity/tools/examples/evaluate_win.bat b/xmlsecurity/tools/examples/evaluate_win.bat new file mode 100644 index 000000000000..9567e9a2d2a4 --- /dev/null +++ b/xmlsecurity/tools/examples/evaluate_win.bat @@ -0,0 +1,138 @@ +call env_win.bat + +@echo off +echo ============================================= +echo step - 1 create a temporary folder +echo ============================================= +@echo on +%TEMP_DRIVE% +cd / +mkdir %TEMP_FOLDER% + +@echo off +echo ============================================= +echo step - 2 copy the xsecsim.rdb +echo ============================================= +@echo on + +cp %WS_PATH%/xmlsecurity/wntmsci8.pro/bin/xsecsim.rdb %TEMP_DRIVE%/%TEMP_FOLDER%/. + +@echo off +echo ============================================= +echo step - 3 copy services.rdb and types.rdb +echo ============================================= +@echo on + +cp %SO_DRIVE%/%SO_PATH%/program/services.rdb %TEMP_DRIVE%/%TEMP_FOLDER%/. +cp %SO_DRIVE%/%SO_PATH%/program/types.rdb %TEMP_DRIVE%/%TEMP_FOLDER%/. + +@echo off +echo ============================================= +echo step - 4 add types.rdb, xsecsim.rdb to services.rdb +echo ============================================= +@echo on + +cd %TEMP_FOLDER% +regmerge services.rdb / types.rdb +regmerge services.rdb / xsecsim.rdb + +@echo off +echo ============================================= +echo step - 5 register new component +echo ============================================= +@echo on + +mkdir windows.plt +cp %WS_PATH%/xmlsecurity/wntmsci8.pro/bin/xsec_sim.dll windows.plt/. +cp %WS_PATH%/xmlsecurity/wntmsci8.pro/bin/xsecsim.rdb windows.plt/. +cp %WS_PATH%/xmlsecurity/wntmsci8.pro/class/jflatfilter.jar windows.plt/. +zip xsec_sim.zip windows.plt\*.* +rm -R windows.plt + +%SO_DRIVE% +cd %SO_DRIVE%/%SO_PATH%/program +pkgchk -s %TEMP_DRIVE%/%TEMP_FOLDER%/xsec_sim.zip + +%TEMP_DRIVE% + +@echo off +echo ============================================= +echo step - 6 copy dynamic libraries +echo ============================================= +@echo on + +cp %SO_DRIVE%/%SO_PATH%/program/*.dll ./. + +@echo off +echo ============================================= +echo step - 7 copy testtool program +echo ============================================= +@echo on + +cp %WS_PATH%/xmlsecurity/wntmsci8.pro/bin/testtool.exe ./. + +@echo off +echo ============================================= +echo step - 8 start OpenOffice +echo ============================================= +@echo on + +@echo off +echo please start up OpenOffice with "-accept=socket,host=0,port=2002;urp;" +pause Press Enter when finished... +@echo on + +@echo off +echo ============================================= +echo step - 9 run the testtool program +echo ============================================= +@echo on + +mkdir examples +cd examples +cp %WS_PATH%/xmlsecurity/tools/examples/warmup.xml ./. +cp %WS_PATH%/xmlsecurity/tools/examples/sign-0.xml ./. +cp %WS_PATH%/xmlsecurity/tools/examples/sign-1.xml ./. +cp %WS_PATH%/xmlsecurity/tools/examples/sign-2.xml ./. +cp %WS_PATH%/xmlsecurity/tools/examples/sign-3.xml ./. +cp %WS_PATH%/xmlsecurity/tools/examples/sign-4.xml ./. +cp %WS_PATH%/xmlsecurity/tools/examples/sign-5.xml ./. +cd .. +cp %WS_PATH%/xmlsecurity/tools/examples/eval_import.txt ./. +cp %WS_PATH%/xmlsecurity/tools/examples/eval_export.txt ./. + +testtool %WS_PATH%/xmlsecurity/tools/cryptoken/jks/testToken.jks %WS_PATH%/xmlsecurity/tools/cryptoken/nss %TEMP_DRIVE%/%TEMP_FOLDER%/eval_export.txt %TEMP_DRIVE%/%TEMP_FOLDER%/eval_import.txt + +@echo off +echo ============================================= +echo step - 10 stop OpenOffice +echo ============================================= +@echo on + +@echo off +echo please stop the OpenOffice application +pause Press Enter when finished... +@echo on + +@echo off +echo ============================================= +echo step - 11 remove new component +echo ============================================= +@echo on + +rm %SO_DRIVE%/%SO_PATH%/user/uno_packages/xsec_sim.zip +%SO_DRIVE% +cd %SO_DRIVE%/%SO_PATH%/program + +pkgchk -s -d xsec_sim.zip + +%TEMP_DRIVE% + +@echo off +echo ============================================= +echo step - 12 remove the temporary folder +echo ============================================= +@echo on + +cd .. +rm -R %TEMP_FOLDER% diff --git a/xmlsecurity/tools/examples/readme.txt b/xmlsecurity/tools/examples/readme.txt new file mode 100644 index 000000000000..1a0c16882824 --- /dev/null +++ b/xmlsecurity/tools/examples/readme.txt @@ -0,0 +1,7 @@ + + +How to use the uno tools + +The /xmlsecurity/tools/examples/uno_win.bat provide the portrait of this procedure under 4NT in windows platform. +If you want to use it, you need to configure all marcos to your local setting. + diff --git a/xmlsecurity/tools/examples/s-in-e-1.xml b/xmlsecurity/tools/examples/s-in-e-1.xml new file mode 100644 index 000000000000..d4c0c0eba80c --- /dev/null +++ b/xmlsecurity/tools/examples/s-in-e-1.xml @@ -0,0 +1,53 @@ +<?xml version="1.0"?> +<!-- +XML Security Library example: Simple encryption template file for encrypt1 example. +--> +<Envelope xmlns="urn:envelope"> + a signature in an encryption. + <EncryptedData xmlns="http://www.w3.org/2001/04/xmlenc#" Type="http://www.w3.org/2001/04/xmlenc#Element"> + <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#tripledes-cbc"></EncryptionMethod> + <KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#"> + <EncryptedKey xmlns="http://www.w3.org/2001/04/xmlenc#"> + <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-1_5"/> + <KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#"> + <X509Data> + <X509IssuerSerial> + <X509IssuerName>CN=Test Issuer</X509IssuerName> + <X509SerialNumber>123450001</X509SerialNumber> + </X509IssuerSerial> + </X509Data> + </KeyInfo> + <CipherData> + <CipherValue/> + </CipherData> + </EncryptedKey> + </KeyInfo> + <CipherData> + <CipherValue/> + </CipherData> + </EncryptedData> + <Data> + Hello, World! the Following is a Signature + <Signature xmlns="http://www.w3.org/2000/09/xmldsig#"> + <SignedInfo> + <CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" /> + <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" /> + <Reference URI="#target"> + <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" /> + <DigestValue> </DigestValue> + </Reference> + </SignedInfo> + <SignatureValue> </SignatureValue> + <KeyInfo> + <X509Data> + <X509IssuerSerial> + <X509IssuerName>CN=Test Issuer</X509IssuerName> + <X509SerialNumber>123450005</X509SerialNumber> + </X509IssuerSerial> + </X509Data> + </KeyInfo> + </Signature> + <Data id="target" refNum="1">Signed Data</Data> + </Data> +</Envelope> + diff --git a/xmlsecurity/tools/examples/s-in-e-2.xml b/xmlsecurity/tools/examples/s-in-e-2.xml new file mode 100644 index 000000000000..fd3ba0cb5f9c --- /dev/null +++ b/xmlsecurity/tools/examples/s-in-e-2.xml @@ -0,0 +1,53 @@ +<?xml version="1.0"?> +<!-- +XML Security Library example: Simple encryption template file for encrypt1 example. +--> +<Envelope xmlns="urn:envelope"> + a signature in an encryption. + <EncryptedData xmlns="http://www.w3.org/2001/04/xmlenc#" Type="http://www.w3.org/2001/04/xmlenc#Element"> + <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#tripledes-cbc"></EncryptionMethod> + <KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#"> + <EncryptedKey xmlns="http://www.w3.org/2001/04/xmlenc#"> + <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-1_5"/> + <KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#"> + <X509Data> + <X509IssuerSerial> + <X509IssuerName>CN=Test Issuer</X509IssuerName> + <X509SerialNumber>123450001</X509SerialNumber> + </X509IssuerSerial> + </X509Data> + </KeyInfo> + <CipherData> + <CipherValue/> + </CipherData> + </EncryptedKey> + </KeyInfo> + <CipherData> + <CipherValue/> + </CipherData> + </EncryptedData> + <Data> + Hello, World! the Following is a Signature + <Signature xmlns="http://www.w3.org/2000/09/xmldsig#"> + <SignedInfo> + <CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" /> + <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" /> + <Reference URI="#target"> + <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" /> + <DigestValue> </DigestValue> + </Reference> + </SignedInfo> + <SignatureValue> </SignatureValue> + <KeyInfo> + <X509Data> + <X509IssuerSerial> + <X509IssuerName>CN=Test Issuer</X509IssuerName> + <X509SerialNumber>123450005</X509SerialNumber> + </X509IssuerSerial> + </X509Data> + </KeyInfo> + </Signature> + </Data> + <SignData id="target" refNum="1">Signed Data</SignData> +</Envelope> + diff --git a/xmlsecurity/tools/examples/sign-0.xml b/xmlsecurity/tools/examples/sign-0.xml new file mode 100644 index 000000000000..7fc834f8fd40 --- /dev/null +++ b/xmlsecurity/tools/examples/sign-0.xml @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="UTF-8"?> +<signtest> +<Signature xmlns="http://www.w3.org/2000/09/xmldsig#"> + <SignedInfo> + <CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" /> + <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" /> + <Reference URI="#target"> + <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" /> + <DigestValue> </DigestValue> + </Reference> + </SignedInfo> + <SignatureValue> </SignatureValue> + <KeyInfo> + <X509Data> + <X509IssuerSerial> + <X509IssuerName>CN=Test Issuer</X509IssuerName> + <X509SerialNumber>123450005</X509SerialNumber> + </X509IssuerSerial> + </X509Data> + </KeyInfo> +</Signature> +<office:document id="target" xmlns:office="http://openoffice.org/2000/office" xmlns:style="http://openoffice.org/2000/style" xmlns:text="http://openoffice.org/2000/text" xmlns:table="http://openoffice.org/2000/table" xmlns:draw="http://openoffice.org/2000/drawing" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:meta="http://openoffice.org/2000/meta" xmlns:number="http://openoffice.org/2000/datastyle" xmlns:svg="http://www.w3.org/2000/svg" xmlns:chart="http://openoffice.org/2000/chart" xmlns:dr3d="http://openoffice.org/2000/dr3d" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="http://openoffice.org/2000/form" xmlns:script="http://openoffice.org/2000/script" xmlns:config="http://openoffice.org/2001/config" office:class="text" office:version="1.0" > + +<office:body ><text:sequence-decls ><text:sequence-decl text:display-outline-level="0" text:name="Illustration" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Table" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Text" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Drawing" ></text:sequence-decl></text:sequence-decls><text:p text:style-name="P1" >Programmer's Manual</text:p><text:p text:style-name="P2" >Planned Outline</text:p><text:p text:style-name="P2" ></text:p><text:h text:style-name="Head 1" text:level="1" >Preface (3 Pages)</text:h><text:h text:style-name="Head 1" text:level="1" >First Steps (24 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Programming with UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Fields of Application for UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Getting Started</text:h><text:h text:style-name="Head 3" text:level="3" >Required Files</text:h><text:h text:style-name="Head 3" text:level="3" >Configuration</text:h><text:h text:style-name="Head 3" text:level="3" >First Connection</text:h><text:h text:style-name="Head 2" text:level="2" >How to get Objects in [PRODUCTNAME]</text:h><text:h text:style-name="Head 2" text:level="2" >How to work with Objects</text:h><text:p text:style-name="Paragraph" >Example</text:p><text:h text:style-name="Head 3" text:level="3" >Services</text:h><text:h text:style-name="Head 3" text:level="3" >Querying Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >ElementAccess</text:h><text:h text:style-name="Head 3" text:level="3" >Simple Types</text:h><text:h text:style-name="Head 3" text:level="3" >Strings</text:h><text:h text:style-name="Head 3" text:level="3" >Enums and Constant Groups</text:h><text:h text:style-name="Head 3" text:level="3" >Structs</text:h><text:h text:style-name="Head 3" text:level="3" >Any</text:h><text:h text:style-name="Head 3" text:level="3" >Sequence</text:h><text:h text:style-name="Head 2" text:level="2" >How to find the solution for a problem</text:h><text:h text:style-name="Head 2" text:level="2" >Finding your Way through the API Reference</text:h><text:h text:style-name="Head 2" text:level="2" >Common Mechanisms</text:h><text:h text:style-name="Head 3" text:level="3" >Text</text:h><text:h text:style-name="Head 3" text:level="3" >Table</text:h><text:h text:style-name="Head 3" text:level="3" >Drawing</text:h><text:h text:style-name="Head 1" text:level="1" >UNO in Professional Projects (<text:span text:style-name="T1" >145</text:span>)</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:p text:style-name="Paragraph" >UNO/API constituents: How UNOIDL/API, ServiceManager, Bridges, CoreReflection work together</text:p><text:h text:style-name="Head 2" text:level="2" >API Concepts</text:h><text:p text:style-name="Paragraph" >API is a language independent, abstract specification for UNO objects which are used in <text:s ></text:s>[PRODUCTNAME]</text:p><text:h text:style-name="Head 3" text:level="3" >Types in the API Reference</text:h><text:h text:style-name="Head 4" text:level="4" >Simple Types</text:h><text:h text:style-name="Head 4" text:level="4" >The Any Type</text:h><text:h text:style-name="Head 4" text:level="4" >Interfaces</text:h><text:h text:style-name="Head 4" text:level="4" >Services</text:h><text:h text:style-name="Head 4" text:level="4" >Modules</text:h><text:h text:style-name="Head 4" text:level="4" >Structs</text:h><text:h text:style-name="Head 4" text:level="4" >Constant Groups and Enums</text:h><text:h text:style-name="Head 4" text:level="4" >Sequences</text:h><text:h text:style-name="Head 4" text:level="4" >Exceptions</text:h><text:h text:style-name="Head 3" text:level="3" >API Principles</text:h><text:h text:style-name="Head 4" text:level="4" >Relationship between Specification, Implementation and Instances</text:h><text:h text:style-name="Head 4" text:level="4" >Object Composition</text:h><text:h text:style-name="Head 2" text:level="2" >UNO Concepts</text:h><text:p text:style-name="Paragraph" >UNO is an environment for networked object communication</text:p><text:h text:style-name="Head 3" text:level="3" >Interprocess Connections</text:h><text:h text:style-name="Head 3" text:level="3" >ServiceManager and ComponentContext</text:h><text:h text:style-name="Head 3" text:level="3" >Using UNO Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >Using Collections and Containers</text:h><text:h text:style-name="Head 3" text:level="3" >Event Model</text:h><text:h text:style-name="Head 3" text:level="3" >Exception Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Lifetime Control</text:h><text:h text:style-name="Head 3" text:level="3" >Object Identity</text:h><text:h text:style-name="Head 2" text:level="2" >Language Bindings</text:h><text:h text:style-name="Head 3" text:level="3" >Introduction for language binding</text:h><text:h text:style-name="Head 3" text:level="3" >Java Language Binding</text:h><text:h text:style-name="Head 3" text:level="3" >C++ Binding</text:h><text:h text:style-name="Head 3" text:level="3" >Access for [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 3" text:level="3" >Automation</text:h><text:h text:style-name="Head 1" text:level="1" >Writing UNO components</text:h><text:h text:style-name="Head 2" text:level="2" >Specifying a new Component</text:h><text:h text:style-name="Head 3" text:level="3" >UNOIDL language specification</text:h><text:h text:style-name="Head 2" text:level="2" >Implementing a Component</text:h><text:h text:style-name="Head 3" text:level="3" >Component Development Basics</text:h><text:unordered-list text:style-name="L1" ><text:list-item ><text:p text:style-name="P3" >Introduction</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >Mandatory interfaces: XInterface, XServiceInfo ((from UseInterfaces.CoreInterfaces))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >"Should be implemented" interfaces: XTypeProvider ((from UseInterfaces.CoreInterfaces ))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >optional interface: XMain for standalone execution</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Simple Component in Java</text:h><text:unordered-list text:style-name="L2" ><text:list-item ><text:p text:style-name="P4" >Getting the service manager ((Chapter Java components from unoBindingJava))</text:p></text:list-item><text:list-item ><text:p text:style-name="P4" >simple component chapter</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >C++ Component</text:h><text:h text:style-name="Head 3" text:level="3" >((Automation Component?))</text:h><text:h text:style-name="Head 2" text:level="2" >Deployment Options for Components</text:h><text:h text:style-name="Head 3" text:level="3" >Component Registration</text:h><text:h text:style-name="Head 3" text:level="3" >Service Manager Configuration</text:h><text:unordered-list text:style-name="L3" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P5" >XSet Interface</text:p><text:p text:style-name="P5" >Adding components during runtime, particularly interesting during development</text:p></text:list-item><text:list-item ><text:p text:style-name="P5" >ServiceManager Content</text:p><text:p text:style-name="P5" >Dynamically modifying the ServiceManager</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Bootstrapping the Service Manager ((from CppBind chapter))</text:h><text:unordered-list text:style-name="L4" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P6" >Simple Test Application</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >Configuring Your Application with Bootstrap Parameters</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >The UNO Executable</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Standalone Runtime Environment</text:h><text:p text:style-name="Paragraph" ><text:tab-stop ></text:tab-stop>The UNO executable and XMain</text:p><text:h text:style-name="Head 3" text:level="3" >Configuring the Java Runtime Environment</text:h><text:unordered-list text:style-name="L5" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P7" >The office and Java ((from UnoBindingJava))</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 1" text:level="1" >Advanced UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Design Patterns</text:h><text:h text:style-name="Head 2" text:level="2" >Bridging concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Requirements for Language Bindings and Bridges</text:h><text:h text:style-name="Head 3" text:level="3" >New Scripting Engines</text:h><text:h text:style-name="Head 2" text:level="2" >ServiceManager and loader</text:h><text:h text:style-name="Head 2" text:level="2" >Special Interfaces for internal use</text:h><text:p text:style-name="Paragraph" >XUNOTunnel</text:p><text:p text:style-name="Paragraph" >XAggregation</text:p><text:h text:style-name="Head 2" text:level="2" >UNO Reflection API</text:h><text:h text:style-name="Head 2" text:level="2" >TypeLibrary and TypeProviders</text:h><text:h text:style-name="Head 2" text:level="2" >Differences from Corba</text:h><text:h text:style-name="Head 1" text:level="1" >Office Development</text:h><text:h text:style-name="Head 2" text:level="2" >Global Object Structure</text:h><text:h text:style-name="Head 3" text:level="3" >Desktop Environment</text:h><text:h text:style-name="Head 3" text:level="3" >Frames and Frame Hierarchies</text:h><text:h text:style-name="Head 3" text:level="3" >Frame-Controller-Model Paradigm</text:h><text:h text:style-name="Head 3" text:level="3" >Loading and Saving Office Components</text:h><text:h text:style-name="Head 3" text:level="3" >Dispatch Framework</text:h><text:h text:style-name="Head 2" text:level="2" >Common Features</text:h><text:h text:style-name="Head 3" text:level="3" >Common Dialogs</text:h><text:h text:style-name="Head 3" text:level="3" >DocumentInfo</text:h><text:h text:style-name="Head 3" text:level="3" >Styles</text:h><text:h text:style-name="Head 3" text:level="3" >Search and Replace</text:h><text:h text:style-name="Head 3" text:level="3" >Number Formats</text:h><text:h text:style-name="Head 3" text:level="3" >Package File Formats</text:h><text:h text:style-name="Head 2" text:level="2" >Internationalization</text:h><text:h text:style-name="Head 2" text:level="2" >Linguistic</text:h><text:h text:style-name="Head 2" text:level="2" >System Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Clipboard</text:h><text:h text:style-name="Head 3" text:level="3" >File Picker</text:h><text:h text:style-name="Head 3" text:level="3" >Bridging to the Window System</text:h><text:p text:style-name="Paragraph" ></text:p><text:h text:style-name="Head 1" text:level="1" >Text Documents (51,5 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Text Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Text Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Using Text</text:h><text:h text:style-name="Head 3" text:level="3" >Tables</text:h><text:h text:style-name="Head 3" text:level="3" >Text Fields</text:h><text:h text:style-name="Head 3" text:level="3" >Bookmarks</text:h><text:h text:style-name="Head 3" text:level="3" >Indexes and Index Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Reference Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Footnotes and Endnotes</text:h><text:h text:style-name="Head 3" text:level="3" >Shape Objects in Text</text:h><text:h text:style-name="Head 3" text:level="3" >Redline</text:h><text:h text:style-name="Head 3" text:level="3" >Ruby</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Text Document</text:h><text:h text:style-name="Head 1" text:level="1" >Spreadsheet Documents</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Spreadsheet Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Spreadsheet Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Editing Spreadsheets</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Spreadsheet Document</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Spreadsheet Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Drawings and Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Draw/Impress Files</text:h><text:h text:style-name="Head 3" text:level="3" >Saving</text:h><text:h text:style-name="Head 3" text:level="3" >Printing</text:h><text:h text:style-name="Head 3" text:level="3" >Running Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Working with a Draw/Impress Document</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Draw/Impress Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Draw/Impress Document</text:h><text:h text:style-name="Head 1" text:level="1" >Charts</text:h><text:h text:style-name="Head 2" text:level="2" >Chart Basics</text:h><text:h text:style-name="Head 2" text:level="2" >Creating a Chart Document</text:h><text:h text:style-name="Head 2" text:level="2" >Editing a Chart Document</text:h><text:h text:style-name="Head 3" text:level="3" >Common Diagram API</text:h><text:h text:style-name="Head 3" text:level="3" >Different Chart Types</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Chart Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Basic and Dialogs</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:h text:style-name="Head 2" text:level="2" >Library Organization</text:h><text:h text:style-name="Head 2" text:level="2" >IDE with Dialogs and Events</text:h><text:h text:style-name="Head 2" text:level="2" >Using [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 2" text:level="2" >Toolkit Controls and their Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating Dialogs at Runtime</text:h><text:h text:style-name="Head 1" text:level="1" >Database Access</text:h><text:h text:style-name="Head 2" text:level="2" >Features of the [PRODUCTNAME] Database Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Capabilities</text:h><text:h text:style-name="Head 3" text:level="3" >SDBC, SDBCX, SDB Architecture</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Datasources with [PRODUCTNAME]</text:h><text:h text:style-name="Head 3" text:level="3" >DataSources</text:h><text:h text:style-name="Head 3" text:level="3" >Adding and Editing Datasources </text:h><text:h text:style-name="Head 3" text:level="3" >Establishing a Connection</text:h><text:h text:style-name="Head 4" text:level="4" >Getting Connections</text:h><text:h text:style-name="Head 4" text:level="4" >Driver specifics</text:h><text:h text:style-name="Head 3" text:level="3" >Connection Pooling</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Saved Queries</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Data</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Statements</text:h><text:h text:style-name="Head 3" text:level="3" >Resultsets</text:h><text:h text:style-name="Head 3" text:level="3" >Metadata</text:h><text:h text:style-name="Head 3" text:level="3" >Rowsets</text:h><text:h text:style-name="Head 2" text:level="2" >Working with the Database Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using DDL to change the DB Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using SDBCX to access the DB Design</text:h><text:h text:style-name="Head 2" text:level="2" >Using DBMS Features</text:h><text:h text:style-name="Head 3" text:level="3" >Stored Procedures</text:h><text:h text:style-name="Head 3" text:level="3" >Transaction Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Prepared Statements</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Database Drivers</text:h><text:h text:style-name="Head 1" text:level="1" >Forms</text:h><text:h text:style-name="Head 2" text:level="2" >Concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Models and Views</text:h><text:h text:style-name="Head 3" text:level="3" >Form Elements in the Document Model</text:h><text:h text:style-name="Head 3" text:level="3" >Special Form Components</text:h><text:h text:style-name="Head 3" text:level="3" >Events</text:h><text:h text:style-name="Head 3" text:level="3" >Data Awareness</text:h><text:h text:style-name="Head 2" text:level="2" >Recipes</text:h><text:h text:style-name="Head 3" text:level="3" >Making it easier to work with a Form</text:h><text:h text:style-name="Head 3" text:level="3" >Controlling the Data Input</text:h><text:h text:style-name="Head 3" text:level="3" >Collecting Data automatically</text:h><text:h text:style-name="Head 3" text:level="3" >Taking Advantage of Database Server Features</text:h><text:h text:style-name="Head 3" text:level="3" >Adding new Functionality</text:h><text:h text:style-name="Head 3" text:level="3" >Handling Errors</text:h><text:h text:style-name="Head 1" text:level="1" >UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Purpose of UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Document Contents as Streams</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Content Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating, Moving and Copying Document and Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Additional Commands</text:h><text:h text:style-name="Head 2" text:level="2" >Writing a Content Provider</text:h><text:h text:style-name="Head 1" text:level="1" >[PRODUCTNAME] Configuration</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing configuration data</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Configuration Data</text:h><text:h text:style-name="Head 1" text:level="1" >Appendix</text:h></office:body> + +</office:document> +</signtest>
\ No newline at end of file diff --git a/xmlsecurity/tools/examples/sign-1.xml b/xmlsecurity/tools/examples/sign-1.xml new file mode 100644 index 000000000000..c6e1a40dc987 --- /dev/null +++ b/xmlsecurity/tools/examples/sign-1.xml @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="UTF-8"?> +<signtest> +<Signature xmlns="http://www.w3.org/2000/09/xmldsig#"> + <SignedInfo> + <CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" /> + <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" /> + <Reference URI="#target"> + <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" /> + <DigestValue> </DigestValue> + </Reference> + </SignedInfo> + <SignatureValue> </SignatureValue> + <KeyInfo> + <X509Data> + <X509IssuerSerial> + <X509IssuerName>CN=Test Issuer</X509IssuerName> + <X509SerialNumber>123450005</X509SerialNumber> + </X509IssuerSerial> + </X509Data> + </KeyInfo> +</Signature> +<office:document id="target" xmlns:office="http://openoffice.org/2000/office" xmlns:style="http://openoffice.org/2000/style" xmlns:text="http://openoffice.org/2000/text" xmlns:table="http://openoffice.org/2000/table" xmlns:draw="http://openoffice.org/2000/drawing" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:meta="http://openoffice.org/2000/meta" xmlns:number="http://openoffice.org/2000/datastyle" xmlns:svg="http://www.w3.org/2000/svg" xmlns:chart="http://openoffice.org/2000/chart" xmlns:dr3d="http://openoffice.org/2000/dr3d" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="http://openoffice.org/2000/form" xmlns:script="http://openoffice.org/2000/script" xmlns:config="http://openoffice.org/2001/config" office:class="text" office:version="1.0" > + +<office:body ><text:sequence-decls ><text:sequence-decl text:display-outline-level="0" text:name="Illustration" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Table" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Text" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Drawing" ></text:sequence-decl></text:sequence-decls><text:p text:style-name="P1" >Programmer's Manual</text:p><text:p text:style-name="P2" >Planned Outline</text:p><text:p text:style-name="P2" ></text:p><text:h text:style-name="Head 1" text:level="1" >Preface (3 Pages)</text:h><text:h text:style-name="Head 1" text:level="1" >First Steps (24 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Programming with UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Fields of Application for UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Getting Started</text:h><text:h text:style-name="Head 3" text:level="3" >Required Files</text:h><text:h text:style-name="Head 3" text:level="3" >Configuration</text:h><text:h text:style-name="Head 3" text:level="3" >First Connection</text:h><text:h text:style-name="Head 2" text:level="2" >How to get Objects in [PRODUCTNAME]</text:h><text:h text:style-name="Head 2" text:level="2" >How to work with Objects</text:h><text:p text:style-name="Paragraph" >Example</text:p><text:h text:style-name="Head 3" text:level="3" >Services</text:h><text:h text:style-name="Head 3" text:level="3" >Querying Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >ElementAccess</text:h><text:h text:style-name="Head 3" text:level="3" >Simple Types</text:h><text:h text:style-name="Head 3" text:level="3" >Strings</text:h><text:h text:style-name="Head 3" text:level="3" >Enums and Constant Groups</text:h><text:h text:style-name="Head 3" text:level="3" >Structs</text:h><text:h text:style-name="Head 3" text:level="3" >Any</text:h><text:h text:style-name="Head 3" text:level="3" >Sequence</text:h><text:h text:style-name="Head 2" text:level="2" >How to find the solution for a problem</text:h><text:h text:style-name="Head 2" text:level="2" >Finding your Way through the API Reference</text:h><text:h text:style-name="Head 2" text:level="2" >Common Mechanisms</text:h><text:h text:style-name="Head 3" text:level="3" >Text</text:h><text:h text:style-name="Head 3" text:level="3" >Table</text:h><text:h text:style-name="Head 3" text:level="3" >Drawing</text:h><text:h text:style-name="Head 1" text:level="1" >UNO in Professional Projects (<text:span text:style-name="T1" >145</text:span>)</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:p text:style-name="Paragraph" >UNO/API constituents: How UNOIDL/API, ServiceManager, Bridges, CoreReflection work together</text:p><text:h text:style-name="Head 2" text:level="2" >API Concepts</text:h><text:p text:style-name="Paragraph" >API is a language independent, abstract specification for UNO objects which are used in <text:s ></text:s>[PRODUCTNAME]</text:p><text:h text:style-name="Head 3" text:level="3" >Types in the API Reference</text:h><text:h text:style-name="Head 4" text:level="4" >Simple Types</text:h><text:h text:style-name="Head 4" text:level="4" >The Any Type</text:h><text:h text:style-name="Head 4" text:level="4" >Interfaces</text:h><text:h text:style-name="Head 4" text:level="4" >Services</text:h><text:h text:style-name="Head 4" text:level="4" >Modules</text:h><text:h text:style-name="Head 4" text:level="4" >Structs</text:h><text:h text:style-name="Head 4" text:level="4" >Constant Groups and Enums</text:h><text:h text:style-name="Head 4" text:level="4" >Sequences</text:h><text:h text:style-name="Head 4" text:level="4" >Exceptions</text:h><text:h text:style-name="Head 3" text:level="3" >API Principles</text:h><text:h text:style-name="Head 4" text:level="4" >Relationship between Specification, Implementation and Instances</text:h><text:h text:style-name="Head 4" text:level="4" >Object Composition</text:h><text:h text:style-name="Head 2" text:level="2" >UNO Concepts</text:h><text:p text:style-name="Paragraph" >UNO is an environment for networked object communication</text:p><text:h text:style-name="Head 3" text:level="3" >Interprocess Connections</text:h><text:h text:style-name="Head 3" text:level="3" >ServiceManager and ComponentContext</text:h><text:h text:style-name="Head 3" text:level="3" >Using UNO Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >Using Collections and Containers</text:h><text:h text:style-name="Head 3" text:level="3" >Event Model</text:h><text:h text:style-name="Head 3" text:level="3" >Exception Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Lifetime Control</text:h><text:h text:style-name="Head 3" text:level="3" >Object Identity</text:h><text:h text:style-name="Head 2" text:level="2" >Language Bindings</text:h><text:h text:style-name="Head 3" text:level="3" >Introduction for language binding</text:h><text:h text:style-name="Head 3" text:level="3" >Java Language Binding</text:h><text:h text:style-name="Head 3" text:level="3" >C++ Binding</text:h><text:h text:style-name="Head 3" text:level="3" >Access for [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 3" text:level="3" >Automation</text:h><text:h text:style-name="Head 1" text:level="1" >Writing UNO components</text:h><text:h text:style-name="Head 2" text:level="2" >Specifying a new Component</text:h><text:h text:style-name="Head 3" text:level="3" >UNOIDL language specification</text:h><text:h text:style-name="Head 2" text:level="2" >Implementing a Component</text:h><text:h text:style-name="Head 3" text:level="3" >Component Development Basics</text:h><text:unordered-list text:style-name="L1" ><text:list-item ><text:p text:style-name="P3" >Introduction</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >Mandatory interfaces: XInterface, XServiceInfo ((from UseInterfaces.CoreInterfaces))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >"Should be implemented" interfaces: XTypeProvider ((from UseInterfaces.CoreInterfaces ))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >optional interface: XMain for standalone execution</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Simple Component in Java</text:h><text:unordered-list text:style-name="L2" ><text:list-item ><text:p text:style-name="P4" >Getting the service manager ((Chapter Java components from unoBindingJava))</text:p></text:list-item><text:list-item ><text:p text:style-name="P4" >simple component chapter</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >C++ Component</text:h><text:h text:style-name="Head 3" text:level="3" >((Automation Component?))</text:h><text:h text:style-name="Head 2" text:level="2" >Deployment Options for Components</text:h><text:h text:style-name="Head 3" text:level="3" >Component Registration</text:h><text:h text:style-name="Head 3" text:level="3" >Service Manager Configuration</text:h><text:unordered-list text:style-name="L3" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P5" >XSet Interface</text:p><text:p text:style-name="P5" >Adding components during runtime, particularly interesting during development</text:p></text:list-item><text:list-item ><text:p text:style-name="P5" >ServiceManager Content</text:p><text:p text:style-name="P5" >Dynamically modifying the ServiceManager</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Bootstrapping the Service Manager ((from CppBind chapter))</text:h><text:unordered-list text:style-name="L4" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P6" >Simple Test Application</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >Configuring Your Application with Bootstrap Parameters</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >The UNO Executable</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Standalone Runtime Environment</text:h><text:p text:style-name="Paragraph" ><text:tab-stop ></text:tab-stop>The UNO executable and XMain</text:p><text:h text:style-name="Head 3" text:level="3" >Configuring the Java Runtime Environment</text:h><text:unordered-list text:style-name="L5" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P7" >The office and Java ((from UnoBindingJava))</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 1" text:level="1" >Advanced UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Design Patterns</text:h><text:h text:style-name="Head 2" text:level="2" >Bridging concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Requirements for Language Bindings and Bridges</text:h><text:h text:style-name="Head 3" text:level="3" >New Scripting Engines</text:h><text:h text:style-name="Head 2" text:level="2" >ServiceManager and loader</text:h><text:h text:style-name="Head 2" text:level="2" >Special Interfaces for internal use</text:h><text:p text:style-name="Paragraph" >XUNOTunnel</text:p><text:p text:style-name="Paragraph" >XAggregation</text:p><text:h text:style-name="Head 2" text:level="2" >UNO Reflection API</text:h><text:h text:style-name="Head 2" text:level="2" >TypeLibrary and TypeProviders</text:h><text:h text:style-name="Head 2" text:level="2" >Differences from Corba</text:h><text:h text:style-name="Head 1" text:level="1" >Office Development</text:h><text:h text:style-name="Head 2" text:level="2" >Global Object Structure</text:h><text:h text:style-name="Head 3" text:level="3" >Desktop Environment</text:h><text:h text:style-name="Head 3" text:level="3" >Frames and Frame Hierarchies</text:h><text:h text:style-name="Head 3" text:level="3" >Frame-Controller-Model Paradigm</text:h><text:h text:style-name="Head 3" text:level="3" >Loading and Saving Office Components</text:h><text:h text:style-name="Head 3" text:level="3" >Dispatch Framework</text:h><text:h text:style-name="Head 2" text:level="2" >Common Features</text:h><text:h text:style-name="Head 3" text:level="3" >Common Dialogs</text:h><text:h text:style-name="Head 3" text:level="3" >DocumentInfo</text:h><text:h text:style-name="Head 3" text:level="3" >Styles</text:h><text:h text:style-name="Head 3" text:level="3" >Search and Replace</text:h><text:h text:style-name="Head 3" text:level="3" >Number Formats</text:h><text:h text:style-name="Head 3" text:level="3" >Package File Formats</text:h><text:h text:style-name="Head 2" text:level="2" >Internationalization</text:h><text:h text:style-name="Head 2" text:level="2" >Linguistic</text:h><text:h text:style-name="Head 2" text:level="2" >System Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Clipboard</text:h><text:h text:style-name="Head 3" text:level="3" >File Picker</text:h><text:h text:style-name="Head 3" text:level="3" >Bridging to the Window System</text:h><text:p text:style-name="Paragraph" ></text:p><text:h text:style-name="Head 1" text:level="1" >Text Documents (51,5 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Text Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Text Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Using Text</text:h><text:h text:style-name="Head 3" text:level="3" >Tables</text:h><text:h text:style-name="Head 3" text:level="3" >Text Fields</text:h><text:h text:style-name="Head 3" text:level="3" >Bookmarks</text:h><text:h text:style-name="Head 3" text:level="3" >Indexes and Index Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Reference Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Footnotes and Endnotes</text:h><text:h text:style-name="Head 3" text:level="3" >Shape Objects in Text</text:h><text:h text:style-name="Head 3" text:level="3" >Redline</text:h><text:h text:style-name="Head 3" text:level="3" >Ruby</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Text Document</text:h><text:h text:style-name="Head 1" text:level="1" >Spreadsheet Documents</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Spreadsheet Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Spreadsheet Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Editing Spreadsheets</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Spreadsheet Document</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Spreadsheet Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Drawings and Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Draw/Impress Files</text:h><text:h text:style-name="Head 3" text:level="3" >Saving</text:h><text:h text:style-name="Head 3" text:level="3" >Printing</text:h><text:h text:style-name="Head 3" text:level="3" >Running Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Working with a Draw/Impress Document</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Draw/Impress Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Draw/Impress Document</text:h><text:h text:style-name="Head 1" text:level="1" >Charts</text:h><text:h text:style-name="Head 2" text:level="2" >Chart Basics</text:h><text:h text:style-name="Head 2" text:level="2" >Creating a Chart Document</text:h><text:h text:style-name="Head 2" text:level="2" >Editing a Chart Document</text:h><text:h text:style-name="Head 3" text:level="3" >Common Diagram API</text:h><text:h text:style-name="Head 3" text:level="3" >Different Chart Types</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Chart Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Basic and Dialogs</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:h text:style-name="Head 2" text:level="2" >Library Organization</text:h><text:h text:style-name="Head 2" text:level="2" >IDE with Dialogs and Events</text:h><text:h text:style-name="Head 2" text:level="2" >Using [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 2" text:level="2" >Toolkit Controls and their Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating Dialogs at Runtime</text:h><text:h text:style-name="Head 1" text:level="1" >Database Access</text:h><text:h text:style-name="Head 2" text:level="2" >Features of the [PRODUCTNAME] Database Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Capabilities</text:h><text:h text:style-name="Head 3" text:level="3" >SDBC, SDBCX, SDB Architecture</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Datasources with [PRODUCTNAME]</text:h><text:h text:style-name="Head 3" text:level="3" >DataSources</text:h><text:h text:style-name="Head 3" text:level="3" >Adding and Editing Datasources </text:h><text:h text:style-name="Head 3" text:level="3" >Establishing a Connection</text:h><text:h text:style-name="Head 4" text:level="4" >Getting Connections</text:h><text:h text:style-name="Head 4" text:level="4" >Driver specifics</text:h><text:h text:style-name="Head 3" text:level="3" >Connection Pooling</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Saved Queries</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Data</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Statements</text:h><text:h text:style-name="Head 3" text:level="3" >Resultsets</text:h><text:h text:style-name="Head 3" text:level="3" >Metadata</text:h><text:h text:style-name="Head 3" text:level="3" >Rowsets</text:h><text:h text:style-name="Head 2" text:level="2" >Working with the Database Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using DDL to change the DB Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using SDBCX to access the DB Design</text:h><text:h text:style-name="Head 2" text:level="2" >Using DBMS Features</text:h><text:h text:style-name="Head 3" text:level="3" >Stored Procedures</text:h><text:h text:style-name="Head 3" text:level="3" >Transaction Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Prepared Statements</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Database Drivers</text:h><text:h text:style-name="Head 1" text:level="1" >Forms</text:h><text:h text:style-name="Head 2" text:level="2" >Concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Models and Views</text:h><text:h text:style-name="Head 3" text:level="3" >Form Elements in the Document Model</text:h><text:h text:style-name="Head 3" text:level="3" >Special Form Components</text:h><text:h text:style-name="Head 3" text:level="3" >Events</text:h><text:h text:style-name="Head 3" text:level="3" >Data Awareness</text:h><text:h text:style-name="Head 2" text:level="2" >Recipes</text:h><text:h text:style-name="Head 3" text:level="3" >Making it easier to work with a Form</text:h><text:h text:style-name="Head 3" text:level="3" >Controlling the Data Input</text:h><text:h text:style-name="Head 3" text:level="3" >Collecting Data automatically</text:h><text:h text:style-name="Head 3" text:level="3" >Taking Advantage of Database Server Features</text:h><text:h text:style-name="Head 3" text:level="3" >Adding new Functionality</text:h><text:h text:style-name="Head 3" text:level="3" >Handling Errors</text:h><text:h text:style-name="Head 1" text:level="1" >UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Purpose of UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Document Contents as Streams</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Content Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating, Moving and Copying Document and Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Additional Commands</text:h><text:h text:style-name="Head 2" text:level="2" >Writing a Content Provider</text:h><text:h text:style-name="Head 1" text:level="1" >[PRODUCTNAME] Configuration</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing configuration data</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Configuration Data</text:h><text:h text:style-name="Head 1" text:level="1" >Appendix</text:h></office:body> + +<office:body ><text:sequence-decls ><text:sequence-decl text:display-outline-level="0" text:name="Illustration" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Table" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Text" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Drawing" ></text:sequence-decl></text:sequence-decls><text:p text:style-name="P1" >Programmer's Manual</text:p><text:p text:style-name="P2" >Planned Outline</text:p><text:p text:style-name="P2" ></text:p><text:h text:style-name="Head 1" text:level="1" >Preface (3 Pages)</text:h><text:h text:style-name="Head 1" text:level="1" >First Steps (24 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Programming with UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Fields of Application for UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Getting Started</text:h><text:h text:style-name="Head 3" text:level="3" >Required Files</text:h><text:h text:style-name="Head 3" text:level="3" >Configuration</text:h><text:h text:style-name="Head 3" text:level="3" >First Connection</text:h><text:h text:style-name="Head 2" text:level="2" >How to get Objects in [PRODUCTNAME]</text:h><text:h text:style-name="Head 2" text:level="2" >How to work with Objects</text:h><text:p text:style-name="Paragraph" >Example</text:p><text:h text:style-name="Head 3" text:level="3" >Services</text:h><text:h text:style-name="Head 3" text:level="3" >Querying Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >ElementAccess</text:h><text:h text:style-name="Head 3" text:level="3" >Simple Types</text:h><text:h text:style-name="Head 3" text:level="3" >Strings</text:h><text:h text:style-name="Head 3" text:level="3" >Enums and Constant Groups</text:h><text:h text:style-name="Head 3" text:level="3" >Structs</text:h><text:h text:style-name="Head 3" text:level="3" >Any</text:h><text:h text:style-name="Head 3" text:level="3" >Sequence</text:h><text:h text:style-name="Head 2" text:level="2" >How to find the solution for a problem</text:h><text:h text:style-name="Head 2" text:level="2" >Finding your Way through the API Reference</text:h><text:h text:style-name="Head 2" text:level="2" >Common Mechanisms</text:h><text:h text:style-name="Head 3" text:level="3" >Text</text:h><text:h text:style-name="Head 3" text:level="3" >Table</text:h><text:h text:style-name="Head 3" text:level="3" >Drawing</text:h><text:h text:style-name="Head 1" text:level="1" >UNO in Professional Projects (<text:span text:style-name="T1" >145</text:span>)</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:p text:style-name="Paragraph" >UNO/API constituents: How UNOIDL/API, ServiceManager, Bridges, CoreReflection work together</text:p><text:h text:style-name="Head 2" text:level="2" >API Concepts</text:h><text:p text:style-name="Paragraph" >API is a language independent, abstract specification for UNO objects which are used in <text:s ></text:s>[PRODUCTNAME]</text:p><text:h text:style-name="Head 3" text:level="3" >Types in the API Reference</text:h><text:h text:style-name="Head 4" text:level="4" >Simple Types</text:h><text:h text:style-name="Head 4" text:level="4" >The Any Type</text:h><text:h text:style-name="Head 4" text:level="4" >Interfaces</text:h><text:h text:style-name="Head 4" text:level="4" >Services</text:h><text:h text:style-name="Head 4" text:level="4" >Modules</text:h><text:h text:style-name="Head 4" text:level="4" >Structs</text:h><text:h text:style-name="Head 4" text:level="4" >Constant Groups and Enums</text:h><text:h text:style-name="Head 4" text:level="4" >Sequences</text:h><text:h text:style-name="Head 4" text:level="4" >Exceptions</text:h><text:h text:style-name="Head 3" text:level="3" >API Principles</text:h><text:h text:style-name="Head 4" text:level="4" >Relationship between Specification, Implementation and Instances</text:h><text:h text:style-name="Head 4" text:level="4" >Object Composition</text:h><text:h text:style-name="Head 2" text:level="2" >UNO Concepts</text:h><text:p text:style-name="Paragraph" >UNO is an environment for networked object communication</text:p><text:h text:style-name="Head 3" text:level="3" >Interprocess Connections</text:h><text:h text:style-name="Head 3" text:level="3" >ServiceManager and ComponentContext</text:h><text:h text:style-name="Head 3" text:level="3" >Using UNO Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >Using Collections and Containers</text:h><text:h text:style-name="Head 3" text:level="3" >Event Model</text:h><text:h text:style-name="Head 3" text:level="3" >Exception Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Lifetime Control</text:h><text:h text:style-name="Head 3" text:level="3" >Object Identity</text:h><text:h text:style-name="Head 2" text:level="2" >Language Bindings</text:h><text:h text:style-name="Head 3" text:level="3" >Introduction for language binding</text:h><text:h text:style-name="Head 3" text:level="3" >Java Language Binding</text:h><text:h text:style-name="Head 3" text:level="3" >C++ Binding</text:h><text:h text:style-name="Head 3" text:level="3" >Access for [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 3" text:level="3" >Automation</text:h><text:h text:style-name="Head 1" text:level="1" >Writing UNO components</text:h><text:h text:style-name="Head 2" text:level="2" >Specifying a new Component</text:h><text:h text:style-name="Head 3" text:level="3" >UNOIDL language specification</text:h><text:h text:style-name="Head 2" text:level="2" >Implementing a Component</text:h><text:h text:style-name="Head 3" text:level="3" >Component Development Basics</text:h><text:unordered-list text:style-name="L1" ><text:list-item ><text:p text:style-name="P3" >Introduction</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >Mandatory interfaces: XInterface, XServiceInfo ((from UseInterfaces.CoreInterfaces))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >"Should be implemented" interfaces: XTypeProvider ((from UseInterfaces.CoreInterfaces ))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >optional interface: XMain for standalone execution</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Simple Component in Java</text:h><text:unordered-list text:style-name="L2" ><text:list-item ><text:p text:style-name="P4" >Getting the service manager ((Chapter Java components from unoBindingJava))</text:p></text:list-item><text:list-item ><text:p text:style-name="P4" >simple component chapter</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >C++ Component</text:h><text:h text:style-name="Head 3" text:level="3" >((Automation Component?))</text:h><text:h text:style-name="Head 2" text:level="2" >Deployment Options for Components</text:h><text:h text:style-name="Head 3" text:level="3" >Component Registration</text:h><text:h text:style-name="Head 3" text:level="3" >Service Manager Configuration</text:h><text:unordered-list text:style-name="L3" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P5" >XSet Interface</text:p><text:p text:style-name="P5" >Adding components during runtime, particularly interesting during development</text:p></text:list-item><text:list-item ><text:p text:style-name="P5" >ServiceManager Content</text:p><text:p text:style-name="P5" >Dynamically modifying the ServiceManager</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Bootstrapping the Service Manager ((from CppBind chapter))</text:h><text:unordered-list text:style-name="L4" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P6" >Simple Test Application</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >Configuring Your Application with Bootstrap Parameters</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >The UNO Executable</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Standalone Runtime Environment</text:h><text:p text:style-name="Paragraph" ><text:tab-stop ></text:tab-stop>The UNO executable and XMain</text:p><text:h text:style-name="Head 3" text:level="3" >Configuring the Java Runtime Environment</text:h><text:unordered-list text:style-name="L5" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P7" >The office and Java ((from UnoBindingJava))</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 1" text:level="1" >Advanced UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Design Patterns</text:h><text:h text:style-name="Head 2" text:level="2" >Bridging concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Requirements for Language Bindings and Bridges</text:h><text:h text:style-name="Head 3" text:level="3" >New Scripting Engines</text:h><text:h text:style-name="Head 2" text:level="2" >ServiceManager and loader</text:h><text:h text:style-name="Head 2" text:level="2" >Special Interfaces for internal use</text:h><text:p text:style-name="Paragraph" >XUNOTunnel</text:p><text:p text:style-name="Paragraph" >XAggregation</text:p><text:h text:style-name="Head 2" text:level="2" >UNO Reflection API</text:h><text:h text:style-name="Head 2" text:level="2" >TypeLibrary and TypeProviders</text:h><text:h text:style-name="Head 2" text:level="2" >Differences from Corba</text:h><text:h text:style-name="Head 1" text:level="1" >Office Development</text:h><text:h text:style-name="Head 2" text:level="2" >Global Object Structure</text:h><text:h text:style-name="Head 3" text:level="3" >Desktop Environment</text:h><text:h text:style-name="Head 3" text:level="3" >Frames and Frame Hierarchies</text:h><text:h text:style-name="Head 3" text:level="3" >Frame-Controller-Model Paradigm</text:h><text:h text:style-name="Head 3" text:level="3" >Loading and Saving Office Components</text:h><text:h text:style-name="Head 3" text:level="3" >Dispatch Framework</text:h><text:h text:style-name="Head 2" text:level="2" >Common Features</text:h><text:h text:style-name="Head 3" text:level="3" >Common Dialogs</text:h><text:h text:style-name="Head 3" text:level="3" >DocumentInfo</text:h><text:h text:style-name="Head 3" text:level="3" >Styles</text:h><text:h text:style-name="Head 3" text:level="3" >Search and Replace</text:h><text:h text:style-name="Head 3" text:level="3" >Number Formats</text:h><text:h text:style-name="Head 3" text:level="3" >Package File Formats</text:h><text:h text:style-name="Head 2" text:level="2" >Internationalization</text:h><text:h text:style-name="Head 2" text:level="2" >Linguistic</text:h><text:h text:style-name="Head 2" text:level="2" >System Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Clipboard</text:h><text:h text:style-name="Head 3" text:level="3" >File Picker</text:h><text:h text:style-name="Head 3" text:level="3" >Bridging to the Window System</text:h><text:p text:style-name="Paragraph" ></text:p><text:h text:style-name="Head 1" text:level="1" >Text Documents (51,5 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Text Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Text Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Using Text</text:h><text:h text:style-name="Head 3" text:level="3" >Tables</text:h><text:h text:style-name="Head 3" text:level="3" >Text Fields</text:h><text:h text:style-name="Head 3" text:level="3" >Bookmarks</text:h><text:h text:style-name="Head 3" text:level="3" >Indexes and Index Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Reference Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Footnotes and Endnotes</text:h><text:h text:style-name="Head 3" text:level="3" >Shape Objects in Text</text:h><text:h text:style-name="Head 3" text:level="3" >Redline</text:h><text:h text:style-name="Head 3" text:level="3" >Ruby</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Text Document</text:h><text:h text:style-name="Head 1" text:level="1" >Spreadsheet Documents</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Spreadsheet Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Spreadsheet Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Editing Spreadsheets</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Spreadsheet Document</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Spreadsheet Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Drawings and Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Draw/Impress Files</text:h><text:h text:style-name="Head 3" text:level="3" >Saving</text:h><text:h text:style-name="Head 3" text:level="3" >Printing</text:h><text:h text:style-name="Head 3" text:level="3" >Running Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Working with a Draw/Impress Document</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Draw/Impress Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Draw/Impress Document</text:h><text:h text:style-name="Head 1" text:level="1" >Charts</text:h><text:h text:style-name="Head 2" text:level="2" >Chart Basics</text:h><text:h text:style-name="Head 2" text:level="2" >Creating a Chart Document</text:h><text:h text:style-name="Head 2" text:level="2" >Editing a Chart Document</text:h><text:h text:style-name="Head 3" text:level="3" >Common Diagram API</text:h><text:h text:style-name="Head 3" text:level="3" >Different Chart Types</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Chart Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Basic and Dialogs</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:h text:style-name="Head 2" text:level="2" >Library Organization</text:h><text:h text:style-name="Head 2" text:level="2" >IDE with Dialogs and Events</text:h><text:h text:style-name="Head 2" text:level="2" >Using [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 2" text:level="2" >Toolkit Controls and their Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating Dialogs at Runtime</text:h><text:h text:style-name="Head 1" text:level="1" >Database Access</text:h><text:h text:style-name="Head 2" text:level="2" >Features of the [PRODUCTNAME] Database Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Capabilities</text:h><text:h text:style-name="Head 3" text:level="3" >SDBC, SDBCX, SDB Architecture</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Datasources with [PRODUCTNAME]</text:h><text:h text:style-name="Head 3" text:level="3" >DataSources</text:h><text:h text:style-name="Head 3" text:level="3" >Adding and Editing Datasources </text:h><text:h text:style-name="Head 3" text:level="3" >Establishing a Connection</text:h><text:h text:style-name="Head 4" text:level="4" >Getting Connections</text:h><text:h text:style-name="Head 4" text:level="4" >Driver specifics</text:h><text:h text:style-name="Head 3" text:level="3" >Connection Pooling</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Saved Queries</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Data</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Statements</text:h><text:h text:style-name="Head 3" text:level="3" >Resultsets</text:h><text:h text:style-name="Head 3" text:level="3" >Metadata</text:h><text:h text:style-name="Head 3" text:level="3" >Rowsets</text:h><text:h text:style-name="Head 2" text:level="2" >Working with the Database Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using DDL to change the DB Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using SDBCX to access the DB Design</text:h><text:h text:style-name="Head 2" text:level="2" >Using DBMS Features</text:h><text:h text:style-name="Head 3" text:level="3" >Stored Procedures</text:h><text:h text:style-name="Head 3" text:level="3" >Transaction Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Prepared Statements</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Database Drivers</text:h><text:h text:style-name="Head 1" text:level="1" >Forms</text:h><text:h text:style-name="Head 2" text:level="2" >Concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Models and Views</text:h><text:h text:style-name="Head 3" text:level="3" >Form Elements in the Document Model</text:h><text:h text:style-name="Head 3" text:level="3" >Special Form Components</text:h><text:h text:style-name="Head 3" text:level="3" >Events</text:h><text:h text:style-name="Head 3" text:level="3" >Data Awareness</text:h><text:h text:style-name="Head 2" text:level="2" >Recipes</text:h><text:h text:style-name="Head 3" text:level="3" >Making it easier to work with a Form</text:h><text:h text:style-name="Head 3" text:level="3" >Controlling the Data Input</text:h><text:h text:style-name="Head 3" text:level="3" >Collecting Data automatically</text:h><text:h text:style-name="Head 3" text:level="3" >Taking Advantage of Database Server Features</text:h><text:h text:style-name="Head 3" text:level="3" >Adding new Functionality</text:h><text:h text:style-name="Head 3" text:level="3" >Handling Errors</text:h><text:h text:style-name="Head 1" text:level="1" >UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Purpose of UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Document Contents as Streams</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Content Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating, Moving and Copying Document and Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Additional Commands</text:h><text:h text:style-name="Head 2" text:level="2" >Writing a Content Provider</text:h><text:h text:style-name="Head 1" text:level="1" >[PRODUCTNAME] Configuration</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing configuration data</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Configuration Data</text:h><text:h text:style-name="Head 1" text:level="1" >Appendix</text:h></office:body> + +</office:document> +</signtest>
\ No newline at end of file diff --git a/xmlsecurity/tools/examples/sign-2.xml b/xmlsecurity/tools/examples/sign-2.xml new file mode 100644 index 000000000000..e3da49f22d3f --- /dev/null +++ b/xmlsecurity/tools/examples/sign-2.xml @@ -0,0 +1,33 @@ +<?xml version="1.0" encoding="UTF-8"?> +<signtest> +<Signature xmlns="http://www.w3.org/2000/09/xmldsig#"> + <SignedInfo> + <CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" /> + <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" /> + <Reference URI="#target"> + <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" /> + <DigestValue> </DigestValue> + </Reference> + </SignedInfo> + <SignatureValue> </SignatureValue> + <KeyInfo> + <X509Data> + <X509IssuerSerial> + <X509IssuerName>CN=Test Issuer</X509IssuerName> + <X509SerialNumber>123450005</X509SerialNumber> + </X509IssuerSerial> + </X509Data> + </KeyInfo> +</Signature> +<office:document id="target" xmlns:office="http://openoffice.org/2000/office" xmlns:style="http://openoffice.org/2000/style" xmlns:text="http://openoffice.org/2000/text" xmlns:table="http://openoffice.org/2000/table" xmlns:draw="http://openoffice.org/2000/drawing" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:meta="http://openoffice.org/2000/meta" xmlns:number="http://openoffice.org/2000/datastyle" xmlns:svg="http://www.w3.org/2000/svg" xmlns:chart="http://openoffice.org/2000/chart" xmlns:dr3d="http://openoffice.org/2000/dr3d" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="http://openoffice.org/2000/form" xmlns:script="http://openoffice.org/2000/script" xmlns:config="http://openoffice.org/2001/config" office:class="text" office:version="1.0" > + +<office:body ><text:sequence-decls ><text:sequence-decl text:display-outline-level="0" text:name="Illustration" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Table" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Text" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Drawing" ></text:sequence-decl></text:sequence-decls><text:p text:style-name="P1" >Programmer's Manual</text:p><text:p text:style-name="P2" >Planned Outline</text:p><text:p text:style-name="P2" ></text:p><text:h text:style-name="Head 1" text:level="1" >Preface (3 Pages)</text:h><text:h text:style-name="Head 1" text:level="1" >First Steps (24 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Programming with UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Fields of Application for UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Getting Started</text:h><text:h text:style-name="Head 3" text:level="3" >Required Files</text:h><text:h text:style-name="Head 3" text:level="3" >Configuration</text:h><text:h text:style-name="Head 3" text:level="3" >First Connection</text:h><text:h text:style-name="Head 2" text:level="2" >How to get Objects in [PRODUCTNAME]</text:h><text:h text:style-name="Head 2" text:level="2" >How to work with Objects</text:h><text:p text:style-name="Paragraph" >Example</text:p><text:h text:style-name="Head 3" text:level="3" >Services</text:h><text:h text:style-name="Head 3" text:level="3" >Querying Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >ElementAccess</text:h><text:h text:style-name="Head 3" text:level="3" >Simple Types</text:h><text:h text:style-name="Head 3" text:level="3" >Strings</text:h><text:h text:style-name="Head 3" text:level="3" >Enums and Constant Groups</text:h><text:h text:style-name="Head 3" text:level="3" >Structs</text:h><text:h text:style-name="Head 3" text:level="3" >Any</text:h><text:h text:style-name="Head 3" text:level="3" >Sequence</text:h><text:h text:style-name="Head 2" text:level="2" >How to find the solution for a problem</text:h><text:h text:style-name="Head 2" text:level="2" >Finding your Way through the API Reference</text:h><text:h text:style-name="Head 2" text:level="2" >Common Mechanisms</text:h><text:h text:style-name="Head 3" text:level="3" >Text</text:h><text:h text:style-name="Head 3" text:level="3" >Table</text:h><text:h text:style-name="Head 3" text:level="3" >Drawing</text:h><text:h text:style-name="Head 1" text:level="1" >UNO in Professional Projects (<text:span text:style-name="T1" >145</text:span>)</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:p text:style-name="Paragraph" >UNO/API constituents: How UNOIDL/API, ServiceManager, Bridges, CoreReflection work together</text:p><text:h text:style-name="Head 2" text:level="2" >API Concepts</text:h><text:p text:style-name="Paragraph" >API is a language independent, abstract specification for UNO objects which are used in <text:s ></text:s>[PRODUCTNAME]</text:p><text:h text:style-name="Head 3" text:level="3" >Types in the API Reference</text:h><text:h text:style-name="Head 4" text:level="4" >Simple Types</text:h><text:h text:style-name="Head 4" text:level="4" >The Any Type</text:h><text:h text:style-name="Head 4" text:level="4" >Interfaces</text:h><text:h text:style-name="Head 4" text:level="4" >Services</text:h><text:h text:style-name="Head 4" text:level="4" >Modules</text:h><text:h text:style-name="Head 4" text:level="4" >Structs</text:h><text:h text:style-name="Head 4" text:level="4" >Constant Groups and Enums</text:h><text:h text:style-name="Head 4" text:level="4" >Sequences</text:h><text:h text:style-name="Head 4" text:level="4" >Exceptions</text:h><text:h text:style-name="Head 3" text:level="3" >API Principles</text:h><text:h text:style-name="Head 4" text:level="4" >Relationship between Specification, Implementation and Instances</text:h><text:h text:style-name="Head 4" text:level="4" >Object Composition</text:h><text:h text:style-name="Head 2" text:level="2" >UNO Concepts</text:h><text:p text:style-name="Paragraph" >UNO is an environment for networked object communication</text:p><text:h text:style-name="Head 3" text:level="3" >Interprocess Connections</text:h><text:h text:style-name="Head 3" text:level="3" >ServiceManager and ComponentContext</text:h><text:h text:style-name="Head 3" text:level="3" >Using UNO Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >Using Collections and Containers</text:h><text:h text:style-name="Head 3" text:level="3" >Event Model</text:h><text:h text:style-name="Head 3" text:level="3" >Exception Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Lifetime Control</text:h><text:h text:style-name="Head 3" text:level="3" >Object Identity</text:h><text:h text:style-name="Head 2" text:level="2" >Language Bindings</text:h><text:h text:style-name="Head 3" text:level="3" >Introduction for language binding</text:h><text:h text:style-name="Head 3" text:level="3" >Java Language Binding</text:h><text:h text:style-name="Head 3" text:level="3" >C++ Binding</text:h><text:h text:style-name="Head 3" text:level="3" >Access for [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 3" text:level="3" >Automation</text:h><text:h text:style-name="Head 1" text:level="1" >Writing UNO components</text:h><text:h text:style-name="Head 2" text:level="2" >Specifying a new Component</text:h><text:h text:style-name="Head 3" text:level="3" >UNOIDL language specification</text:h><text:h text:style-name="Head 2" text:level="2" >Implementing a Component</text:h><text:h text:style-name="Head 3" text:level="3" >Component Development Basics</text:h><text:unordered-list text:style-name="L1" ><text:list-item ><text:p text:style-name="P3" >Introduction</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >Mandatory interfaces: XInterface, XServiceInfo ((from UseInterfaces.CoreInterfaces))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >"Should be implemented" interfaces: XTypeProvider ((from UseInterfaces.CoreInterfaces ))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >optional interface: XMain for standalone execution</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Simple Component in Java</text:h><text:unordered-list text:style-name="L2" ><text:list-item ><text:p text:style-name="P4" >Getting the service manager ((Chapter Java components from unoBindingJava))</text:p></text:list-item><text:list-item ><text:p text:style-name="P4" >simple component chapter</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >C++ Component</text:h><text:h text:style-name="Head 3" text:level="3" >((Automation Component?))</text:h><text:h text:style-name="Head 2" text:level="2" >Deployment Options for Components</text:h><text:h text:style-name="Head 3" text:level="3" >Component Registration</text:h><text:h text:style-name="Head 3" text:level="3" >Service Manager Configuration</text:h><text:unordered-list text:style-name="L3" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P5" >XSet Interface</text:p><text:p text:style-name="P5" >Adding components during runtime, particularly interesting during development</text:p></text:list-item><text:list-item ><text:p text:style-name="P5" >ServiceManager Content</text:p><text:p text:style-name="P5" >Dynamically modifying the ServiceManager</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Bootstrapping the Service Manager ((from CppBind chapter))</text:h><text:unordered-list text:style-name="L4" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P6" >Simple Test Application</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >Configuring Your Application with Bootstrap Parameters</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >The UNO Executable</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Standalone Runtime Environment</text:h><text:p text:style-name="Paragraph" ><text:tab-stop ></text:tab-stop>The UNO executable and XMain</text:p><text:h text:style-name="Head 3" text:level="3" >Configuring the Java Runtime Environment</text:h><text:unordered-list text:style-name="L5" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P7" >The office and Java ((from UnoBindingJava))</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 1" text:level="1" >Advanced UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Design Patterns</text:h><text:h text:style-name="Head 2" text:level="2" >Bridging concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Requirements for Language Bindings and Bridges</text:h><text:h text:style-name="Head 3" text:level="3" >New Scripting Engines</text:h><text:h text:style-name="Head 2" text:level="2" >ServiceManager and loader</text:h><text:h text:style-name="Head 2" text:level="2" >Special Interfaces for internal use</text:h><text:p text:style-name="Paragraph" >XUNOTunnel</text:p><text:p text:style-name="Paragraph" >XAggregation</text:p><text:h text:style-name="Head 2" text:level="2" >UNO Reflection API</text:h><text:h text:style-name="Head 2" text:level="2" >TypeLibrary and TypeProviders</text:h><text:h text:style-name="Head 2" text:level="2" >Differences from Corba</text:h><text:h text:style-name="Head 1" text:level="1" >Office Development</text:h><text:h text:style-name="Head 2" text:level="2" >Global Object Structure</text:h><text:h text:style-name="Head 3" text:level="3" >Desktop Environment</text:h><text:h text:style-name="Head 3" text:level="3" >Frames and Frame Hierarchies</text:h><text:h text:style-name="Head 3" text:level="3" >Frame-Controller-Model Paradigm</text:h><text:h text:style-name="Head 3" text:level="3" >Loading and Saving Office Components</text:h><text:h text:style-name="Head 3" text:level="3" >Dispatch Framework</text:h><text:h text:style-name="Head 2" text:level="2" >Common Features</text:h><text:h text:style-name="Head 3" text:level="3" >Common Dialogs</text:h><text:h text:style-name="Head 3" text:level="3" >DocumentInfo</text:h><text:h text:style-name="Head 3" text:level="3" >Styles</text:h><text:h text:style-name="Head 3" text:level="3" >Search and Replace</text:h><text:h text:style-name="Head 3" text:level="3" >Number Formats</text:h><text:h text:style-name="Head 3" text:level="3" >Package File Formats</text:h><text:h text:style-name="Head 2" text:level="2" >Internationalization</text:h><text:h text:style-name="Head 2" text:level="2" >Linguistic</text:h><text:h text:style-name="Head 2" text:level="2" >System Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Clipboard</text:h><text:h text:style-name="Head 3" text:level="3" >File Picker</text:h><text:h text:style-name="Head 3" text:level="3" >Bridging to the Window System</text:h><text:p text:style-name="Paragraph" ></text:p><text:h text:style-name="Head 1" text:level="1" >Text Documents (51,5 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Text Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Text Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Using Text</text:h><text:h text:style-name="Head 3" text:level="3" >Tables</text:h><text:h text:style-name="Head 3" text:level="3" >Text Fields</text:h><text:h text:style-name="Head 3" text:level="3" >Bookmarks</text:h><text:h text:style-name="Head 3" text:level="3" >Indexes and Index Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Reference Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Footnotes and Endnotes</text:h><text:h text:style-name="Head 3" text:level="3" >Shape Objects in Text</text:h><text:h text:style-name="Head 3" text:level="3" >Redline</text:h><text:h text:style-name="Head 3" text:level="3" >Ruby</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Text Document</text:h><text:h text:style-name="Head 1" text:level="1" >Spreadsheet Documents</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Spreadsheet Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Spreadsheet Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Editing Spreadsheets</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Spreadsheet Document</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Spreadsheet Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Drawings and Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Draw/Impress Files</text:h><text:h text:style-name="Head 3" text:level="3" >Saving</text:h><text:h text:style-name="Head 3" text:level="3" >Printing</text:h><text:h text:style-name="Head 3" text:level="3" >Running Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Working with a Draw/Impress Document</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Draw/Impress Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Draw/Impress Document</text:h><text:h text:style-name="Head 1" text:level="1" >Charts</text:h><text:h text:style-name="Head 2" text:level="2" >Chart Basics</text:h><text:h text:style-name="Head 2" text:level="2" >Creating a Chart Document</text:h><text:h text:style-name="Head 2" text:level="2" >Editing a Chart Document</text:h><text:h text:style-name="Head 3" text:level="3" >Common Diagram API</text:h><text:h text:style-name="Head 3" text:level="3" >Different Chart Types</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Chart Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Basic and Dialogs</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:h text:style-name="Head 2" text:level="2" >Library Organization</text:h><text:h text:style-name="Head 2" text:level="2" >IDE with Dialogs and Events</text:h><text:h text:style-name="Head 2" text:level="2" >Using [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 2" text:level="2" >Toolkit Controls and their Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating Dialogs at Runtime</text:h><text:h text:style-name="Head 1" text:level="1" >Database Access</text:h><text:h text:style-name="Head 2" text:level="2" >Features of the [PRODUCTNAME] Database Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Capabilities</text:h><text:h text:style-name="Head 3" text:level="3" >SDBC, SDBCX, SDB Architecture</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Datasources with [PRODUCTNAME]</text:h><text:h text:style-name="Head 3" text:level="3" >DataSources</text:h><text:h text:style-name="Head 3" text:level="3" >Adding and Editing Datasources </text:h><text:h text:style-name="Head 3" text:level="3" >Establishing a Connection</text:h><text:h text:style-name="Head 4" text:level="4" >Getting Connections</text:h><text:h text:style-name="Head 4" text:level="4" >Driver specifics</text:h><text:h text:style-name="Head 3" text:level="3" >Connection Pooling</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Saved Queries</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Data</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Statements</text:h><text:h text:style-name="Head 3" text:level="3" >Resultsets</text:h><text:h text:style-name="Head 3" text:level="3" >Metadata</text:h><text:h text:style-name="Head 3" text:level="3" >Rowsets</text:h><text:h text:style-name="Head 2" text:level="2" >Working with the Database Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using DDL to change the DB Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using SDBCX to access the DB Design</text:h><text:h text:style-name="Head 2" text:level="2" >Using DBMS Features</text:h><text:h text:style-name="Head 3" text:level="3" >Stored Procedures</text:h><text:h text:style-name="Head 3" text:level="3" >Transaction Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Prepared Statements</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Database Drivers</text:h><text:h text:style-name="Head 1" text:level="1" >Forms</text:h><text:h text:style-name="Head 2" text:level="2" >Concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Models and Views</text:h><text:h text:style-name="Head 3" text:level="3" >Form Elements in the Document Model</text:h><text:h text:style-name="Head 3" text:level="3" >Special Form Components</text:h><text:h text:style-name="Head 3" text:level="3" >Events</text:h><text:h text:style-name="Head 3" text:level="3" >Data Awareness</text:h><text:h text:style-name="Head 2" text:level="2" >Recipes</text:h><text:h text:style-name="Head 3" text:level="3" >Making it easier to work with a Form</text:h><text:h text:style-name="Head 3" text:level="3" >Controlling the Data Input</text:h><text:h text:style-name="Head 3" text:level="3" >Collecting Data automatically</text:h><text:h text:style-name="Head 3" text:level="3" >Taking Advantage of Database Server Features</text:h><text:h text:style-name="Head 3" text:level="3" >Adding new Functionality</text:h><text:h text:style-name="Head 3" text:level="3" >Handling Errors</text:h><text:h text:style-name="Head 1" text:level="1" >UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Purpose of UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Document Contents as Streams</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Content Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating, Moving and Copying Document and Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Additional Commands</text:h><text:h text:style-name="Head 2" text:level="2" >Writing a Content Provider</text:h><text:h text:style-name="Head 1" text:level="1" >[PRODUCTNAME] Configuration</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing configuration data</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Configuration Data</text:h><text:h text:style-name="Head 1" text:level="1" >Appendix</text:h></office:body> + +<office:body ><text:sequence-decls ><text:sequence-decl text:display-outline-level="0" text:name="Illustration" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Table" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Text" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Drawing" ></text:sequence-decl></text:sequence-decls><text:p text:style-name="P1" >Programmer's Manual</text:p><text:p text:style-name="P2" >Planned Outline</text:p><text:p text:style-name="P2" ></text:p><text:h text:style-name="Head 1" text:level="1" >Preface (3 Pages)</text:h><text:h text:style-name="Head 1" text:level="1" >First Steps (24 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Programming with UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Fields of Application for UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Getting Started</text:h><text:h text:style-name="Head 3" text:level="3" >Required Files</text:h><text:h text:style-name="Head 3" text:level="3" >Configuration</text:h><text:h text:style-name="Head 3" text:level="3" >First Connection</text:h><text:h text:style-name="Head 2" text:level="2" >How to get Objects in [PRODUCTNAME]</text:h><text:h text:style-name="Head 2" text:level="2" >How to work with Objects</text:h><text:p text:style-name="Paragraph" >Example</text:p><text:h text:style-name="Head 3" text:level="3" >Services</text:h><text:h text:style-name="Head 3" text:level="3" >Querying Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >ElementAccess</text:h><text:h text:style-name="Head 3" text:level="3" >Simple Types</text:h><text:h text:style-name="Head 3" text:level="3" >Strings</text:h><text:h text:style-name="Head 3" text:level="3" >Enums and Constant Groups</text:h><text:h text:style-name="Head 3" text:level="3" >Structs</text:h><text:h text:style-name="Head 3" text:level="3" >Any</text:h><text:h text:style-name="Head 3" text:level="3" >Sequence</text:h><text:h text:style-name="Head 2" text:level="2" >How to find the solution for a problem</text:h><text:h text:style-name="Head 2" text:level="2" >Finding your Way through the API Reference</text:h><text:h text:style-name="Head 2" text:level="2" >Common Mechanisms</text:h><text:h text:style-name="Head 3" text:level="3" >Text</text:h><text:h text:style-name="Head 3" text:level="3" >Table</text:h><text:h text:style-name="Head 3" text:level="3" >Drawing</text:h><text:h text:style-name="Head 1" text:level="1" >UNO in Professional Projects (<text:span text:style-name="T1" >145</text:span>)</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:p text:style-name="Paragraph" >UNO/API constituents: How UNOIDL/API, ServiceManager, Bridges, CoreReflection work together</text:p><text:h text:style-name="Head 2" text:level="2" >API Concepts</text:h><text:p text:style-name="Paragraph" >API is a language independent, abstract specification for UNO objects which are used in <text:s ></text:s>[PRODUCTNAME]</text:p><text:h text:style-name="Head 3" text:level="3" >Types in the API Reference</text:h><text:h text:style-name="Head 4" text:level="4" >Simple Types</text:h><text:h text:style-name="Head 4" text:level="4" >The Any Type</text:h><text:h text:style-name="Head 4" text:level="4" >Interfaces</text:h><text:h text:style-name="Head 4" text:level="4" >Services</text:h><text:h text:style-name="Head 4" text:level="4" >Modules</text:h><text:h text:style-name="Head 4" text:level="4" >Structs</text:h><text:h text:style-name="Head 4" text:level="4" >Constant Groups and Enums</text:h><text:h text:style-name="Head 4" text:level="4" >Sequences</text:h><text:h text:style-name="Head 4" text:level="4" >Exceptions</text:h><text:h text:style-name="Head 3" text:level="3" >API Principles</text:h><text:h text:style-name="Head 4" text:level="4" >Relationship between Specification, Implementation and Instances</text:h><text:h text:style-name="Head 4" text:level="4" >Object Composition</text:h><text:h text:style-name="Head 2" text:level="2" >UNO Concepts</text:h><text:p text:style-name="Paragraph" >UNO is an environment for networked object communication</text:p><text:h text:style-name="Head 3" text:level="3" >Interprocess Connections</text:h><text:h text:style-name="Head 3" text:level="3" >ServiceManager and ComponentContext</text:h><text:h text:style-name="Head 3" text:level="3" >Using UNO Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >Using Collections and Containers</text:h><text:h text:style-name="Head 3" text:level="3" >Event Model</text:h><text:h text:style-name="Head 3" text:level="3" >Exception Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Lifetime Control</text:h><text:h text:style-name="Head 3" text:level="3" >Object Identity</text:h><text:h text:style-name="Head 2" text:level="2" >Language Bindings</text:h><text:h text:style-name="Head 3" text:level="3" >Introduction for language binding</text:h><text:h text:style-name="Head 3" text:level="3" >Java Language Binding</text:h><text:h text:style-name="Head 3" text:level="3" >C++ Binding</text:h><text:h text:style-name="Head 3" text:level="3" >Access for [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 3" text:level="3" >Automation</text:h><text:h text:style-name="Head 1" text:level="1" >Writing UNO components</text:h><text:h text:style-name="Head 2" text:level="2" >Specifying a new Component</text:h><text:h text:style-name="Head 3" text:level="3" >UNOIDL language specification</text:h><text:h text:style-name="Head 2" text:level="2" >Implementing a Component</text:h><text:h text:style-name="Head 3" text:level="3" >Component Development Basics</text:h><text:unordered-list text:style-name="L1" ><text:list-item ><text:p text:style-name="P3" >Introduction</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >Mandatory interfaces: XInterface, XServiceInfo ((from UseInterfaces.CoreInterfaces))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >"Should be implemented" interfaces: XTypeProvider ((from UseInterfaces.CoreInterfaces ))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >optional interface: XMain for standalone execution</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Simple Component in Java</text:h><text:unordered-list text:style-name="L2" ><text:list-item ><text:p text:style-name="P4" >Getting the service manager ((Chapter Java components from unoBindingJava))</text:p></text:list-item><text:list-item ><text:p text:style-name="P4" >simple component chapter</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >C++ Component</text:h><text:h text:style-name="Head 3" text:level="3" >((Automation Component?))</text:h><text:h text:style-name="Head 2" text:level="2" >Deployment Options for Components</text:h><text:h text:style-name="Head 3" text:level="3" >Component Registration</text:h><text:h text:style-name="Head 3" text:level="3" >Service Manager Configuration</text:h><text:unordered-list text:style-name="L3" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P5" >XSet Interface</text:p><text:p text:style-name="P5" >Adding components during runtime, particularly interesting during development</text:p></text:list-item><text:list-item ><text:p text:style-name="P5" >ServiceManager Content</text:p><text:p text:style-name="P5" >Dynamically modifying the ServiceManager</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Bootstrapping the Service Manager ((from CppBind chapter))</text:h><text:unordered-list text:style-name="L4" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P6" >Simple Test Application</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >Configuring Your Application with Bootstrap Parameters</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >The UNO Executable</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Standalone Runtime Environment</text:h><text:p text:style-name="Paragraph" ><text:tab-stop ></text:tab-stop>The UNO executable and XMain</text:p><text:h text:style-name="Head 3" text:level="3" >Configuring the Java Runtime Environment</text:h><text:unordered-list text:style-name="L5" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P7" >The office and Java ((from UnoBindingJava))</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 1" text:level="1" >Advanced UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Design Patterns</text:h><text:h text:style-name="Head 2" text:level="2" >Bridging concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Requirements for Language Bindings and Bridges</text:h><text:h text:style-name="Head 3" text:level="3" >New Scripting Engines</text:h><text:h text:style-name="Head 2" text:level="2" >ServiceManager and loader</text:h><text:h text:style-name="Head 2" text:level="2" >Special Interfaces for internal use</text:h><text:p text:style-name="Paragraph" >XUNOTunnel</text:p><text:p text:style-name="Paragraph" >XAggregation</text:p><text:h text:style-name="Head 2" text:level="2" >UNO Reflection API</text:h><text:h text:style-name="Head 2" text:level="2" >TypeLibrary and TypeProviders</text:h><text:h text:style-name="Head 2" text:level="2" >Differences from Corba</text:h><text:h text:style-name="Head 1" text:level="1" >Office Development</text:h><text:h text:style-name="Head 2" text:level="2" >Global Object Structure</text:h><text:h text:style-name="Head 3" text:level="3" >Desktop Environment</text:h><text:h text:style-name="Head 3" text:level="3" >Frames and Frame Hierarchies</text:h><text:h text:style-name="Head 3" text:level="3" >Frame-Controller-Model Paradigm</text:h><text:h text:style-name="Head 3" text:level="3" >Loading and Saving Office Components</text:h><text:h text:style-name="Head 3" text:level="3" >Dispatch Framework</text:h><text:h text:style-name="Head 2" text:level="2" >Common Features</text:h><text:h text:style-name="Head 3" text:level="3" >Common Dialogs</text:h><text:h text:style-name="Head 3" text:level="3" >DocumentInfo</text:h><text:h text:style-name="Head 3" text:level="3" >Styles</text:h><text:h text:style-name="Head 3" text:level="3" >Search and Replace</text:h><text:h text:style-name="Head 3" text:level="3" >Number Formats</text:h><text:h text:style-name="Head 3" text:level="3" >Package File Formats</text:h><text:h text:style-name="Head 2" text:level="2" >Internationalization</text:h><text:h text:style-name="Head 2" text:level="2" >Linguistic</text:h><text:h text:style-name="Head 2" text:level="2" >System Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Clipboard</text:h><text:h text:style-name="Head 3" text:level="3" >File Picker</text:h><text:h text:style-name="Head 3" text:level="3" >Bridging to the Window System</text:h><text:p text:style-name="Paragraph" ></text:p><text:h text:style-name="Head 1" text:level="1" >Text Documents (51,5 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Text Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Text Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Using Text</text:h><text:h text:style-name="Head 3" text:level="3" >Tables</text:h><text:h text:style-name="Head 3" text:level="3" >Text Fields</text:h><text:h text:style-name="Head 3" text:level="3" >Bookmarks</text:h><text:h text:style-name="Head 3" text:level="3" >Indexes and Index Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Reference Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Footnotes and Endnotes</text:h><text:h text:style-name="Head 3" text:level="3" >Shape Objects in Text</text:h><text:h text:style-name="Head 3" text:level="3" >Redline</text:h><text:h text:style-name="Head 3" text:level="3" >Ruby</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Text Document</text:h><text:h text:style-name="Head 1" text:level="1" >Spreadsheet Documents</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Spreadsheet Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Spreadsheet Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Editing Spreadsheets</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Spreadsheet Document</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Spreadsheet Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Drawings and Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Draw/Impress Files</text:h><text:h text:style-name="Head 3" text:level="3" >Saving</text:h><text:h text:style-name="Head 3" text:level="3" >Printing</text:h><text:h text:style-name="Head 3" text:level="3" >Running Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Working with a Draw/Impress Document</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Draw/Impress Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Draw/Impress Document</text:h><text:h text:style-name="Head 1" text:level="1" >Charts</text:h><text:h text:style-name="Head 2" text:level="2" >Chart Basics</text:h><text:h text:style-name="Head 2" text:level="2" >Creating a Chart Document</text:h><text:h text:style-name="Head 2" text:level="2" >Editing a Chart Document</text:h><text:h text:style-name="Head 3" text:level="3" >Common Diagram API</text:h><text:h text:style-name="Head 3" text:level="3" >Different Chart Types</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Chart Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Basic and Dialogs</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:h text:style-name="Head 2" text:level="2" >Library Organization</text:h><text:h text:style-name="Head 2" text:level="2" >IDE with Dialogs and Events</text:h><text:h text:style-name="Head 2" text:level="2" >Using [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 2" text:level="2" >Toolkit Controls and their Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating Dialogs at Runtime</text:h><text:h text:style-name="Head 1" text:level="1" >Database Access</text:h><text:h text:style-name="Head 2" text:level="2" >Features of the [PRODUCTNAME] Database Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Capabilities</text:h><text:h text:style-name="Head 3" text:level="3" >SDBC, SDBCX, SDB Architecture</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Datasources with [PRODUCTNAME]</text:h><text:h text:style-name="Head 3" text:level="3" >DataSources</text:h><text:h text:style-name="Head 3" text:level="3" >Adding and Editing Datasources </text:h><text:h text:style-name="Head 3" text:level="3" >Establishing a Connection</text:h><text:h text:style-name="Head 4" text:level="4" >Getting Connections</text:h><text:h text:style-name="Head 4" text:level="4" >Driver specifics</text:h><text:h text:style-name="Head 3" text:level="3" >Connection Pooling</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Saved Queries</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Data</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Statements</text:h><text:h text:style-name="Head 3" text:level="3" >Resultsets</text:h><text:h text:style-name="Head 3" text:level="3" >Metadata</text:h><text:h text:style-name="Head 3" text:level="3" >Rowsets</text:h><text:h text:style-name="Head 2" text:level="2" >Working with the Database Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using DDL to change the DB Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using SDBCX to access the DB Design</text:h><text:h text:style-name="Head 2" text:level="2" >Using DBMS Features</text:h><text:h text:style-name="Head 3" text:level="3" >Stored Procedures</text:h><text:h text:style-name="Head 3" text:level="3" >Transaction Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Prepared Statements</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Database Drivers</text:h><text:h text:style-name="Head 1" text:level="1" >Forms</text:h><text:h text:style-name="Head 2" text:level="2" >Concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Models and Views</text:h><text:h text:style-name="Head 3" text:level="3" >Form Elements in the Document Model</text:h><text:h text:style-name="Head 3" text:level="3" >Special Form Components</text:h><text:h text:style-name="Head 3" text:level="3" >Events</text:h><text:h text:style-name="Head 3" text:level="3" >Data Awareness</text:h><text:h text:style-name="Head 2" text:level="2" >Recipes</text:h><text:h text:style-name="Head 3" text:level="3" >Making it easier to work with a Form</text:h><text:h text:style-name="Head 3" text:level="3" >Controlling the Data Input</text:h><text:h text:style-name="Head 3" text:level="3" >Collecting Data automatically</text:h><text:h text:style-name="Head 3" text:level="3" >Taking Advantage of Database Server Features</text:h><text:h text:style-name="Head 3" text:level="3" >Adding new Functionality</text:h><text:h text:style-name="Head 3" text:level="3" >Handling Errors</text:h><text:h text:style-name="Head 1" text:level="1" >UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Purpose of UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Document Contents as Streams</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Content Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating, Moving and Copying Document and Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Additional Commands</text:h><text:h text:style-name="Head 2" text:level="2" >Writing a Content Provider</text:h><text:h text:style-name="Head 1" text:level="1" >[PRODUCTNAME] Configuration</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing configuration data</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Configuration Data</text:h><text:h text:style-name="Head 1" text:level="1" >Appendix</text:h></office:body> + +<office:body ><text:sequence-decls ><text:sequence-decl text:display-outline-level="0" text:name="Illustration" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Table" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Text" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Drawing" ></text:sequence-decl></text:sequence-decls><text:p text:style-name="P1" >Programmer's Manual</text:p><text:p text:style-name="P2" >Planned Outline</text:p><text:p text:style-name="P2" ></text:p><text:h text:style-name="Head 1" text:level="1" >Preface (3 Pages)</text:h><text:h text:style-name="Head 1" text:level="1" >First Steps (24 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Programming with UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Fields of Application for UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Getting Started</text:h><text:h text:style-name="Head 3" text:level="3" >Required Files</text:h><text:h text:style-name="Head 3" text:level="3" >Configuration</text:h><text:h text:style-name="Head 3" text:level="3" >First Connection</text:h><text:h text:style-name="Head 2" text:level="2" >How to get Objects in [PRODUCTNAME]</text:h><text:h text:style-name="Head 2" text:level="2" >How to work with Objects</text:h><text:p text:style-name="Paragraph" >Example</text:p><text:h text:style-name="Head 3" text:level="3" >Services</text:h><text:h text:style-name="Head 3" text:level="3" >Querying Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >ElementAccess</text:h><text:h text:style-name="Head 3" text:level="3" >Simple Types</text:h><text:h text:style-name="Head 3" text:level="3" >Strings</text:h><text:h text:style-name="Head 3" text:level="3" >Enums and Constant Groups</text:h><text:h text:style-name="Head 3" text:level="3" >Structs</text:h><text:h text:style-name="Head 3" text:level="3" >Any</text:h><text:h text:style-name="Head 3" text:level="3" >Sequence</text:h><text:h text:style-name="Head 2" text:level="2" >How to find the solution for a problem</text:h><text:h text:style-name="Head 2" text:level="2" >Finding your Way through the API Reference</text:h><text:h text:style-name="Head 2" text:level="2" >Common Mechanisms</text:h><text:h text:style-name="Head 3" text:level="3" >Text</text:h><text:h text:style-name="Head 3" text:level="3" >Table</text:h><text:h text:style-name="Head 3" text:level="3" >Drawing</text:h><text:h text:style-name="Head 1" text:level="1" >UNO in Professional Projects (<text:span text:style-name="T1" >145</text:span>)</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:p text:style-name="Paragraph" >UNO/API constituents: How UNOIDL/API, ServiceManager, Bridges, CoreReflection work together</text:p><text:h text:style-name="Head 2" text:level="2" >API Concepts</text:h><text:p text:style-name="Paragraph" >API is a language independent, abstract specification for UNO objects which are used in <text:s ></text:s>[PRODUCTNAME]</text:p><text:h text:style-name="Head 3" text:level="3" >Types in the API Reference</text:h><text:h text:style-name="Head 4" text:level="4" >Simple Types</text:h><text:h text:style-name="Head 4" text:level="4" >The Any Type</text:h><text:h text:style-name="Head 4" text:level="4" >Interfaces</text:h><text:h text:style-name="Head 4" text:level="4" >Services</text:h><text:h text:style-name="Head 4" text:level="4" >Modules</text:h><text:h text:style-name="Head 4" text:level="4" >Structs</text:h><text:h text:style-name="Head 4" text:level="4" >Constant Groups and Enums</text:h><text:h text:style-name="Head 4" text:level="4" >Sequences</text:h><text:h text:style-name="Head 4" text:level="4" >Exceptions</text:h><text:h text:style-name="Head 3" text:level="3" >API Principles</text:h><text:h text:style-name="Head 4" text:level="4" >Relationship between Specification, Implementation and Instances</text:h><text:h text:style-name="Head 4" text:level="4" >Object Composition</text:h><text:h text:style-name="Head 2" text:level="2" >UNO Concepts</text:h><text:p text:style-name="Paragraph" >UNO is an environment for networked object communication</text:p><text:h text:style-name="Head 3" text:level="3" >Interprocess Connections</text:h><text:h text:style-name="Head 3" text:level="3" >ServiceManager and ComponentContext</text:h><text:h text:style-name="Head 3" text:level="3" >Using UNO Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >Using Collections and Containers</text:h><text:h text:style-name="Head 3" text:level="3" >Event Model</text:h><text:h text:style-name="Head 3" text:level="3" >Exception Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Lifetime Control</text:h><text:h text:style-name="Head 3" text:level="3" >Object Identity</text:h><text:h text:style-name="Head 2" text:level="2" >Language Bindings</text:h><text:h text:style-name="Head 3" text:level="3" >Introduction for language binding</text:h><text:h text:style-name="Head 3" text:level="3" >Java Language Binding</text:h><text:h text:style-name="Head 3" text:level="3" >C++ Binding</text:h><text:h text:style-name="Head 3" text:level="3" >Access for [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 3" text:level="3" >Automation</text:h><text:h text:style-name="Head 1" text:level="1" >Writing UNO components</text:h><text:h text:style-name="Head 2" text:level="2" >Specifying a new Component</text:h><text:h text:style-name="Head 3" text:level="3" >UNOIDL language specification</text:h><text:h text:style-name="Head 2" text:level="2" >Implementing a Component</text:h><text:h text:style-name="Head 3" text:level="3" >Component Development Basics</text:h><text:unordered-list text:style-name="L1" ><text:list-item ><text:p text:style-name="P3" >Introduction</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >Mandatory interfaces: XInterface, XServiceInfo ((from UseInterfaces.CoreInterfaces))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >"Should be implemented" interfaces: XTypeProvider ((from UseInterfaces.CoreInterfaces ))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >optional interface: XMain for standalone execution</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Simple Component in Java</text:h><text:unordered-list text:style-name="L2" ><text:list-item ><text:p text:style-name="P4" >Getting the service manager ((Chapter Java components from unoBindingJava))</text:p></text:list-item><text:list-item ><text:p text:style-name="P4" >simple component chapter</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >C++ Component</text:h><text:h text:style-name="Head 3" text:level="3" >((Automation Component?))</text:h><text:h text:style-name="Head 2" text:level="2" >Deployment Options for Components</text:h><text:h text:style-name="Head 3" text:level="3" >Component Registration</text:h><text:h text:style-name="Head 3" text:level="3" >Service Manager Configuration</text:h><text:unordered-list text:style-name="L3" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P5" >XSet Interface</text:p><text:p text:style-name="P5" >Adding components during runtime, particularly interesting during development</text:p></text:list-item><text:list-item ><text:p text:style-name="P5" >ServiceManager Content</text:p><text:p text:style-name="P5" >Dynamically modifying the ServiceManager</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Bootstrapping the Service Manager ((from CppBind chapter))</text:h><text:unordered-list text:style-name="L4" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P6" >Simple Test Application</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >Configuring Your Application with Bootstrap Parameters</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >The UNO Executable</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Standalone Runtime Environment</text:h><text:p text:style-name="Paragraph" ><text:tab-stop ></text:tab-stop>The UNO executable and XMain</text:p><text:h text:style-name="Head 3" text:level="3" >Configuring the Java Runtime Environment</text:h><text:unordered-list text:style-name="L5" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P7" >The office and Java ((from UnoBindingJava))</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 1" text:level="1" >Advanced UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Design Patterns</text:h><text:h text:style-name="Head 2" text:level="2" >Bridging concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Requirements for Language Bindings and Bridges</text:h><text:h text:style-name="Head 3" text:level="3" >New Scripting Engines</text:h><text:h text:style-name="Head 2" text:level="2" >ServiceManager and loader</text:h><text:h text:style-name="Head 2" text:level="2" >Special Interfaces for internal use</text:h><text:p text:style-name="Paragraph" >XUNOTunnel</text:p><text:p text:style-name="Paragraph" >XAggregation</text:p><text:h text:style-name="Head 2" text:level="2" >UNO Reflection API</text:h><text:h text:style-name="Head 2" text:level="2" >TypeLibrary and TypeProviders</text:h><text:h text:style-name="Head 2" text:level="2" >Differences from Corba</text:h><text:h text:style-name="Head 1" text:level="1" >Office Development</text:h><text:h text:style-name="Head 2" text:level="2" >Global Object Structure</text:h><text:h text:style-name="Head 3" text:level="3" >Desktop Environment</text:h><text:h text:style-name="Head 3" text:level="3" >Frames and Frame Hierarchies</text:h><text:h text:style-name="Head 3" text:level="3" >Frame-Controller-Model Paradigm</text:h><text:h text:style-name="Head 3" text:level="3" >Loading and Saving Office Components</text:h><text:h text:style-name="Head 3" text:level="3" >Dispatch Framework</text:h><text:h text:style-name="Head 2" text:level="2" >Common Features</text:h><text:h text:style-name="Head 3" text:level="3" >Common Dialogs</text:h><text:h text:style-name="Head 3" text:level="3" >DocumentInfo</text:h><text:h text:style-name="Head 3" text:level="3" >Styles</text:h><text:h text:style-name="Head 3" text:level="3" >Search and Replace</text:h><text:h text:style-name="Head 3" text:level="3" >Number Formats</text:h><text:h text:style-name="Head 3" text:level="3" >Package File Formats</text:h><text:h text:style-name="Head 2" text:level="2" >Internationalization</text:h><text:h text:style-name="Head 2" text:level="2" >Linguistic</text:h><text:h text:style-name="Head 2" text:level="2" >System Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Clipboard</text:h><text:h text:style-name="Head 3" text:level="3" >File Picker</text:h><text:h text:style-name="Head 3" text:level="3" >Bridging to the Window System</text:h><text:p text:style-name="Paragraph" ></text:p><text:h text:style-name="Head 1" text:level="1" >Text Documents (51,5 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Text Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Text Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Using Text</text:h><text:h text:style-name="Head 3" text:level="3" >Tables</text:h><text:h text:style-name="Head 3" text:level="3" >Text Fields</text:h><text:h text:style-name="Head 3" text:level="3" >Bookmarks</text:h><text:h text:style-name="Head 3" text:level="3" >Indexes and Index Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Reference Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Footnotes and Endnotes</text:h><text:h text:style-name="Head 3" text:level="3" >Shape Objects in Text</text:h><text:h text:style-name="Head 3" text:level="3" >Redline</text:h><text:h text:style-name="Head 3" text:level="3" >Ruby</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Text Document</text:h><text:h text:style-name="Head 1" text:level="1" >Spreadsheet Documents</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Spreadsheet Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Spreadsheet Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Editing Spreadsheets</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Spreadsheet Document</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Spreadsheet Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Drawings and Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Draw/Impress Files</text:h><text:h text:style-name="Head 3" text:level="3" >Saving</text:h><text:h text:style-name="Head 3" text:level="3" >Printing</text:h><text:h text:style-name="Head 3" text:level="3" >Running Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Working with a Draw/Impress Document</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Draw/Impress Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Draw/Impress Document</text:h><text:h text:style-name="Head 1" text:level="1" >Charts</text:h><text:h text:style-name="Head 2" text:level="2" >Chart Basics</text:h><text:h text:style-name="Head 2" text:level="2" >Creating a Chart Document</text:h><text:h text:style-name="Head 2" text:level="2" >Editing a Chart Document</text:h><text:h text:style-name="Head 3" text:level="3" >Common Diagram API</text:h><text:h text:style-name="Head 3" text:level="3" >Different Chart Types</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Chart Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Basic and Dialogs</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:h text:style-name="Head 2" text:level="2" >Library Organization</text:h><text:h text:style-name="Head 2" text:level="2" >IDE with Dialogs and Events</text:h><text:h text:style-name="Head 2" text:level="2" >Using [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 2" text:level="2" >Toolkit Controls and their Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating Dialogs at Runtime</text:h><text:h text:style-name="Head 1" text:level="1" >Database Access</text:h><text:h text:style-name="Head 2" text:level="2" >Features of the [PRODUCTNAME] Database Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Capabilities</text:h><text:h text:style-name="Head 3" text:level="3" >SDBC, SDBCX, SDB Architecture</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Datasources with [PRODUCTNAME]</text:h><text:h text:style-name="Head 3" text:level="3" >DataSources</text:h><text:h text:style-name="Head 3" text:level="3" >Adding and Editing Datasources </text:h><text:h text:style-name="Head 3" text:level="3" >Establishing a Connection</text:h><text:h text:style-name="Head 4" text:level="4" >Getting Connections</text:h><text:h text:style-name="Head 4" text:level="4" >Driver specifics</text:h><text:h text:style-name="Head 3" text:level="3" >Connection Pooling</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Saved Queries</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Data</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Statements</text:h><text:h text:style-name="Head 3" text:level="3" >Resultsets</text:h><text:h text:style-name="Head 3" text:level="3" >Metadata</text:h><text:h text:style-name="Head 3" text:level="3" >Rowsets</text:h><text:h text:style-name="Head 2" text:level="2" >Working with the Database Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using DDL to change the DB Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using SDBCX to access the DB Design</text:h><text:h text:style-name="Head 2" text:level="2" >Using DBMS Features</text:h><text:h text:style-name="Head 3" text:level="3" >Stored Procedures</text:h><text:h text:style-name="Head 3" text:level="3" >Transaction Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Prepared Statements</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Database Drivers</text:h><text:h text:style-name="Head 1" text:level="1" >Forms</text:h><text:h text:style-name="Head 2" text:level="2" >Concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Models and Views</text:h><text:h text:style-name="Head 3" text:level="3" >Form Elements in the Document Model</text:h><text:h text:style-name="Head 3" text:level="3" >Special Form Components</text:h><text:h text:style-name="Head 3" text:level="3" >Events</text:h><text:h text:style-name="Head 3" text:level="3" >Data Awareness</text:h><text:h text:style-name="Head 2" text:level="2" >Recipes</text:h><text:h text:style-name="Head 3" text:level="3" >Making it easier to work with a Form</text:h><text:h text:style-name="Head 3" text:level="3" >Controlling the Data Input</text:h><text:h text:style-name="Head 3" text:level="3" >Collecting Data automatically</text:h><text:h text:style-name="Head 3" text:level="3" >Taking Advantage of Database Server Features</text:h><text:h text:style-name="Head 3" text:level="3" >Adding new Functionality</text:h><text:h text:style-name="Head 3" text:level="3" >Handling Errors</text:h><text:h text:style-name="Head 1" text:level="1" >UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Purpose of UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Document Contents as Streams</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Content Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating, Moving and Copying Document and Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Additional Commands</text:h><text:h text:style-name="Head 2" text:level="2" >Writing a Content Provider</text:h><text:h text:style-name="Head 1" text:level="1" >[PRODUCTNAME] Configuration</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing configuration data</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Configuration Data</text:h><text:h text:style-name="Head 1" text:level="1" >Appendix</text:h></office:body> + +<office:body ><text:sequence-decls ><text:sequence-decl text:display-outline-level="0" text:name="Illustration" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Table" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Text" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Drawing" ></text:sequence-decl></text:sequence-decls><text:p text:style-name="P1" >Programmer's Manual</text:p><text:p text:style-name="P2" >Planned Outline</text:p><text:p text:style-name="P2" ></text:p><text:h text:style-name="Head 1" text:level="1" >Preface (3 Pages)</text:h><text:h text:style-name="Head 1" text:level="1" >First Steps (24 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Programming with UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Fields of Application for UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Getting Started</text:h><text:h text:style-name="Head 3" text:level="3" >Required Files</text:h><text:h text:style-name="Head 3" text:level="3" >Configuration</text:h><text:h text:style-name="Head 3" text:level="3" >First Connection</text:h><text:h text:style-name="Head 2" text:level="2" >How to get Objects in [PRODUCTNAME]</text:h><text:h text:style-name="Head 2" text:level="2" >How to work with Objects</text:h><text:p text:style-name="Paragraph" >Example</text:p><text:h text:style-name="Head 3" text:level="3" >Services</text:h><text:h text:style-name="Head 3" text:level="3" >Querying Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >ElementAccess</text:h><text:h text:style-name="Head 3" text:level="3" >Simple Types</text:h><text:h text:style-name="Head 3" text:level="3" >Strings</text:h><text:h text:style-name="Head 3" text:level="3" >Enums and Constant Groups</text:h><text:h text:style-name="Head 3" text:level="3" >Structs</text:h><text:h text:style-name="Head 3" text:level="3" >Any</text:h><text:h text:style-name="Head 3" text:level="3" >Sequence</text:h><text:h text:style-name="Head 2" text:level="2" >How to find the solution for a problem</text:h><text:h text:style-name="Head 2" text:level="2" >Finding your Way through the API Reference</text:h><text:h text:style-name="Head 2" text:level="2" >Common Mechanisms</text:h><text:h text:style-name="Head 3" text:level="3" >Text</text:h><text:h text:style-name="Head 3" text:level="3" >Table</text:h><text:h text:style-name="Head 3" text:level="3" >Drawing</text:h><text:h text:style-name="Head 1" text:level="1" >UNO in Professional Projects (<text:span text:style-name="T1" >145</text:span>)</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:p text:style-name="Paragraph" >UNO/API constituents: How UNOIDL/API, ServiceManager, Bridges, CoreReflection work together</text:p><text:h text:style-name="Head 2" text:level="2" >API Concepts</text:h><text:p text:style-name="Paragraph" >API is a language independent, abstract specification for UNO objects which are used in <text:s ></text:s>[PRODUCTNAME]</text:p><text:h text:style-name="Head 3" text:level="3" >Types in the API Reference</text:h><text:h text:style-name="Head 4" text:level="4" >Simple Types</text:h><text:h text:style-name="Head 4" text:level="4" >The Any Type</text:h><text:h text:style-name="Head 4" text:level="4" >Interfaces</text:h><text:h text:style-name="Head 4" text:level="4" >Services</text:h><text:h text:style-name="Head 4" text:level="4" >Modules</text:h><text:h text:style-name="Head 4" text:level="4" >Structs</text:h><text:h text:style-name="Head 4" text:level="4" >Constant Groups and Enums</text:h><text:h text:style-name="Head 4" text:level="4" >Sequences</text:h><text:h text:style-name="Head 4" text:level="4" >Exceptions</text:h><text:h text:style-name="Head 3" text:level="3" >API Principles</text:h><text:h text:style-name="Head 4" text:level="4" >Relationship between Specification, Implementation and Instances</text:h><text:h text:style-name="Head 4" text:level="4" >Object Composition</text:h><text:h text:style-name="Head 2" text:level="2" >UNO Concepts</text:h><text:p text:style-name="Paragraph" >UNO is an environment for networked object communication</text:p><text:h text:style-name="Head 3" text:level="3" >Interprocess Connections</text:h><text:h text:style-name="Head 3" text:level="3" >ServiceManager and ComponentContext</text:h><text:h text:style-name="Head 3" text:level="3" >Using UNO Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >Using Collections and Containers</text:h><text:h text:style-name="Head 3" text:level="3" >Event Model</text:h><text:h text:style-name="Head 3" text:level="3" >Exception Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Lifetime Control</text:h><text:h text:style-name="Head 3" text:level="3" >Object Identity</text:h><text:h text:style-name="Head 2" text:level="2" >Language Bindings</text:h><text:h text:style-name="Head 3" text:level="3" >Introduction for language binding</text:h><text:h text:style-name="Head 3" text:level="3" >Java Language Binding</text:h><text:h text:style-name="Head 3" text:level="3" >C++ Binding</text:h><text:h text:style-name="Head 3" text:level="3" >Access for [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 3" text:level="3" >Automation</text:h><text:h text:style-name="Head 1" text:level="1" >Writing UNO components</text:h><text:h text:style-name="Head 2" text:level="2" >Specifying a new Component</text:h><text:h text:style-name="Head 3" text:level="3" >UNOIDL language specification</text:h><text:h text:style-name="Head 2" text:level="2" >Implementing a Component</text:h><text:h text:style-name="Head 3" text:level="3" >Component Development Basics</text:h><text:unordered-list text:style-name="L1" ><text:list-item ><text:p text:style-name="P3" >Introduction</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >Mandatory interfaces: XInterface, XServiceInfo ((from UseInterfaces.CoreInterfaces))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >"Should be implemented" interfaces: XTypeProvider ((from UseInterfaces.CoreInterfaces ))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >optional interface: XMain for standalone execution</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Simple Component in Java</text:h><text:unordered-list text:style-name="L2" ><text:list-item ><text:p text:style-name="P4" >Getting the service manager ((Chapter Java components from unoBindingJava))</text:p></text:list-item><text:list-item ><text:p text:style-name="P4" >simple component chapter</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >C++ Component</text:h><text:h text:style-name="Head 3" text:level="3" >((Automation Component?))</text:h><text:h text:style-name="Head 2" text:level="2" >Deployment Options for Components</text:h><text:h text:style-name="Head 3" text:level="3" >Component Registration</text:h><text:h text:style-name="Head 3" text:level="3" >Service Manager Configuration</text:h><text:unordered-list text:style-name="L3" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P5" >XSet Interface</text:p><text:p text:style-name="P5" >Adding components during runtime, particularly interesting during development</text:p></text:list-item><text:list-item ><text:p text:style-name="P5" >ServiceManager Content</text:p><text:p text:style-name="P5" >Dynamically modifying the ServiceManager</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Bootstrapping the Service Manager ((from CppBind chapter))</text:h><text:unordered-list text:style-name="L4" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P6" >Simple Test Application</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >Configuring Your Application with Bootstrap Parameters</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >The UNO Executable</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Standalone Runtime Environment</text:h><text:p text:style-name="Paragraph" ><text:tab-stop ></text:tab-stop>The UNO executable and XMain</text:p><text:h text:style-name="Head 3" text:level="3" >Configuring the Java Runtime Environment</text:h><text:unordered-list text:style-name="L5" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P7" >The office and Java ((from UnoBindingJava))</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 1" text:level="1" >Advanced UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Design Patterns</text:h><text:h text:style-name="Head 2" text:level="2" >Bridging concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Requirements for Language Bindings and Bridges</text:h><text:h text:style-name="Head 3" text:level="3" >New Scripting Engines</text:h><text:h text:style-name="Head 2" text:level="2" >ServiceManager and loader</text:h><text:h text:style-name="Head 2" text:level="2" >Special Interfaces for internal use</text:h><text:p text:style-name="Paragraph" >XUNOTunnel</text:p><text:p text:style-name="Paragraph" >XAggregation</text:p><text:h text:style-name="Head 2" text:level="2" >UNO Reflection API</text:h><text:h text:style-name="Head 2" text:level="2" >TypeLibrary and TypeProviders</text:h><text:h text:style-name="Head 2" text:level="2" >Differences from Corba</text:h><text:h text:style-name="Head 1" text:level="1" >Office Development</text:h><text:h text:style-name="Head 2" text:level="2" >Global Object Structure</text:h><text:h text:style-name="Head 3" text:level="3" >Desktop Environment</text:h><text:h text:style-name="Head 3" text:level="3" >Frames and Frame Hierarchies</text:h><text:h text:style-name="Head 3" text:level="3" >Frame-Controller-Model Paradigm</text:h><text:h text:style-name="Head 3" text:level="3" >Loading and Saving Office Components</text:h><text:h text:style-name="Head 3" text:level="3" >Dispatch Framework</text:h><text:h text:style-name="Head 2" text:level="2" >Common Features</text:h><text:h text:style-name="Head 3" text:level="3" >Common Dialogs</text:h><text:h text:style-name="Head 3" text:level="3" >DocumentInfo</text:h><text:h text:style-name="Head 3" text:level="3" >Styles</text:h><text:h text:style-name="Head 3" text:level="3" >Search and Replace</text:h><text:h text:style-name="Head 3" text:level="3" >Number Formats</text:h><text:h text:style-name="Head 3" text:level="3" >Package File Formats</text:h><text:h text:style-name="Head 2" text:level="2" >Internationalization</text:h><text:h text:style-name="Head 2" text:level="2" >Linguistic</text:h><text:h text:style-name="Head 2" text:level="2" >System Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Clipboard</text:h><text:h text:style-name="Head 3" text:level="3" >File Picker</text:h><text:h text:style-name="Head 3" text:level="3" >Bridging to the Window System</text:h><text:p text:style-name="Paragraph" ></text:p><text:h text:style-name="Head 1" text:level="1" >Text Documents (51,5 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Text Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Text Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Using Text</text:h><text:h text:style-name="Head 3" text:level="3" >Tables</text:h><text:h text:style-name="Head 3" text:level="3" >Text Fields</text:h><text:h text:style-name="Head 3" text:level="3" >Bookmarks</text:h><text:h text:style-name="Head 3" text:level="3" >Indexes and Index Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Reference Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Footnotes and Endnotes</text:h><text:h text:style-name="Head 3" text:level="3" >Shape Objects in Text</text:h><text:h text:style-name="Head 3" text:level="3" >Redline</text:h><text:h text:style-name="Head 3" text:level="3" >Ruby</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Text Document</text:h><text:h text:style-name="Head 1" text:level="1" >Spreadsheet Documents</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Spreadsheet Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Spreadsheet Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Editing Spreadsheets</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Spreadsheet Document</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Spreadsheet Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Drawings and Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Draw/Impress Files</text:h><text:h text:style-name="Head 3" text:level="3" >Saving</text:h><text:h text:style-name="Head 3" text:level="3" >Printing</text:h><text:h text:style-name="Head 3" text:level="3" >Running Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Working with a Draw/Impress Document</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Draw/Impress Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Draw/Impress Document</text:h><text:h text:style-name="Head 1" text:level="1" >Charts</text:h><text:h text:style-name="Head 2" text:level="2" >Chart Basics</text:h><text:h text:style-name="Head 2" text:level="2" >Creating a Chart Document</text:h><text:h text:style-name="Head 2" text:level="2" >Editing a Chart Document</text:h><text:h text:style-name="Head 3" text:level="3" >Common Diagram API</text:h><text:h text:style-name="Head 3" text:level="3" >Different Chart Types</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Chart Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Basic and Dialogs</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:h text:style-name="Head 2" text:level="2" >Library Organization</text:h><text:h text:style-name="Head 2" text:level="2" >IDE with Dialogs and Events</text:h><text:h text:style-name="Head 2" text:level="2" >Using [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 2" text:level="2" >Toolkit Controls and their Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating Dialogs at Runtime</text:h><text:h text:style-name="Head 1" text:level="1" >Database Access</text:h><text:h text:style-name="Head 2" text:level="2" >Features of the [PRODUCTNAME] Database Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Capabilities</text:h><text:h text:style-name="Head 3" text:level="3" >SDBC, SDBCX, SDB Architecture</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Datasources with [PRODUCTNAME]</text:h><text:h text:style-name="Head 3" text:level="3" >DataSources</text:h><text:h text:style-name="Head 3" text:level="3" >Adding and Editing Datasources </text:h><text:h text:style-name="Head 3" text:level="3" >Establishing a Connection</text:h><text:h text:style-name="Head 4" text:level="4" >Getting Connections</text:h><text:h text:style-name="Head 4" text:level="4" >Driver specifics</text:h><text:h text:style-name="Head 3" text:level="3" >Connection Pooling</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Saved Queries</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Data</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Statements</text:h><text:h text:style-name="Head 3" text:level="3" >Resultsets</text:h><text:h text:style-name="Head 3" text:level="3" >Metadata</text:h><text:h text:style-name="Head 3" text:level="3" >Rowsets</text:h><text:h text:style-name="Head 2" text:level="2" >Working with the Database Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using DDL to change the DB Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using SDBCX to access the DB Design</text:h><text:h text:style-name="Head 2" text:level="2" >Using DBMS Features</text:h><text:h text:style-name="Head 3" text:level="3" >Stored Procedures</text:h><text:h text:style-name="Head 3" text:level="3" >Transaction Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Prepared Statements</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Database Drivers</text:h><text:h text:style-name="Head 1" text:level="1" >Forms</text:h><text:h text:style-name="Head 2" text:level="2" >Concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Models and Views</text:h><text:h text:style-name="Head 3" text:level="3" >Form Elements in the Document Model</text:h><text:h text:style-name="Head 3" text:level="3" >Special Form Components</text:h><text:h text:style-name="Head 3" text:level="3" >Events</text:h><text:h text:style-name="Head 3" text:level="3" >Data Awareness</text:h><text:h text:style-name="Head 2" text:level="2" >Recipes</text:h><text:h text:style-name="Head 3" text:level="3" >Making it easier to work with a Form</text:h><text:h text:style-name="Head 3" text:level="3" >Controlling the Data Input</text:h><text:h text:style-name="Head 3" text:level="3" >Collecting Data automatically</text:h><text:h text:style-name="Head 3" text:level="3" >Taking Advantage of Database Server Features</text:h><text:h text:style-name="Head 3" text:level="3" >Adding new Functionality</text:h><text:h text:style-name="Head 3" text:level="3" >Handling Errors</text:h><text:h text:style-name="Head 1" text:level="1" >UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Purpose of UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Document Contents as Streams</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Content Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating, Moving and Copying Document and Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Additional Commands</text:h><text:h text:style-name="Head 2" text:level="2" >Writing a Content Provider</text:h><text:h text:style-name="Head 1" text:level="1" >[PRODUCTNAME] Configuration</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing configuration data</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Configuration Data</text:h><text:h text:style-name="Head 1" text:level="1" >Appendix</text:h></office:body> + +</office:document> +</signtest>
\ No newline at end of file diff --git a/xmlsecurity/tools/examples/sign-3.xml b/xmlsecurity/tools/examples/sign-3.xml new file mode 100644 index 000000000000..61a9f3cf378f --- /dev/null +++ b/xmlsecurity/tools/examples/sign-3.xml @@ -0,0 +1,41 @@ +<?xml version="1.0" encoding="UTF-8"?> +<signtest> +<Signature xmlns="http://www.w3.org/2000/09/xmldsig#"> + <SignedInfo> + <CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" /> + <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" /> + <Reference URI="#target"> + <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" /> + <DigestValue> </DigestValue> + </Reference> + </SignedInfo> + <SignatureValue> </SignatureValue> + <KeyInfo> + <X509Data> + <X509IssuerSerial> + <X509IssuerName>CN=Test Issuer</X509IssuerName> + <X509SerialNumber>123450005</X509SerialNumber> + </X509IssuerSerial> + </X509Data> + </KeyInfo> +</Signature> +<office:document id="target" xmlns:office="http://openoffice.org/2000/office" xmlns:style="http://openoffice.org/2000/style" xmlns:text="http://openoffice.org/2000/text" xmlns:table="http://openoffice.org/2000/table" xmlns:draw="http://openoffice.org/2000/drawing" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:meta="http://openoffice.org/2000/meta" xmlns:number="http://openoffice.org/2000/datastyle" xmlns:svg="http://www.w3.org/2000/svg" xmlns:chart="http://openoffice.org/2000/chart" xmlns:dr3d="http://openoffice.org/2000/dr3d" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="http://openoffice.org/2000/form" xmlns:script="http://openoffice.org/2000/script" xmlns:config="http://openoffice.org/2001/config" office:class="text" office:version="1.0" > + +<office:body ><text:sequence-decls ><text:sequence-decl text:display-outline-level="0" text:name="Illustration" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Table" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Text" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Drawing" ></text:sequence-decl></text:sequence-decls><text:p text:style-name="P1" >Programmer's Manual</text:p><text:p text:style-name="P2" >Planned Outline</text:p><text:p text:style-name="P2" ></text:p><text:h text:style-name="Head 1" text:level="1" >Preface (3 Pages)</text:h><text:h text:style-name="Head 1" text:level="1" >First Steps (24 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Programming with UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Fields of Application for UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Getting Started</text:h><text:h text:style-name="Head 3" text:level="3" >Required Files</text:h><text:h text:style-name="Head 3" text:level="3" >Configuration</text:h><text:h text:style-name="Head 3" text:level="3" >First Connection</text:h><text:h text:style-name="Head 2" text:level="2" >How to get Objects in [PRODUCTNAME]</text:h><text:h text:style-name="Head 2" text:level="2" >How to work with Objects</text:h><text:p text:style-name="Paragraph" >Example</text:p><text:h text:style-name="Head 3" text:level="3" >Services</text:h><text:h text:style-name="Head 3" text:level="3" >Querying Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >ElementAccess</text:h><text:h text:style-name="Head 3" text:level="3" >Simple Types</text:h><text:h text:style-name="Head 3" text:level="3" >Strings</text:h><text:h text:style-name="Head 3" text:level="3" >Enums and Constant Groups</text:h><text:h text:style-name="Head 3" text:level="3" >Structs</text:h><text:h text:style-name="Head 3" text:level="3" >Any</text:h><text:h text:style-name="Head 3" text:level="3" >Sequence</text:h><text:h text:style-name="Head 2" text:level="2" >How to find the solution for a problem</text:h><text:h text:style-name="Head 2" text:level="2" >Finding your Way through the API Reference</text:h><text:h text:style-name="Head 2" text:level="2" >Common Mechanisms</text:h><text:h text:style-name="Head 3" text:level="3" >Text</text:h><text:h text:style-name="Head 3" text:level="3" >Table</text:h><text:h text:style-name="Head 3" text:level="3" >Drawing</text:h><text:h text:style-name="Head 1" text:level="1" >UNO in Professional Projects (<text:span text:style-name="T1" >145</text:span>)</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:p text:style-name="Paragraph" >UNO/API constituents: How UNOIDL/API, ServiceManager, Bridges, CoreReflection work together</text:p><text:h text:style-name="Head 2" text:level="2" >API Concepts</text:h><text:p text:style-name="Paragraph" >API is a language independent, abstract specification for UNO objects which are used in <text:s ></text:s>[PRODUCTNAME]</text:p><text:h text:style-name="Head 3" text:level="3" >Types in the API Reference</text:h><text:h text:style-name="Head 4" text:level="4" >Simple Types</text:h><text:h text:style-name="Head 4" text:level="4" >The Any Type</text:h><text:h text:style-name="Head 4" text:level="4" >Interfaces</text:h><text:h text:style-name="Head 4" text:level="4" >Services</text:h><text:h text:style-name="Head 4" text:level="4" >Modules</text:h><text:h text:style-name="Head 4" text:level="4" >Structs</text:h><text:h text:style-name="Head 4" text:level="4" >Constant Groups and Enums</text:h><text:h text:style-name="Head 4" text:level="4" >Sequences</text:h><text:h text:style-name="Head 4" text:level="4" >Exceptions</text:h><text:h text:style-name="Head 3" text:level="3" >API Principles</text:h><text:h text:style-name="Head 4" text:level="4" >Relationship between Specification, Implementation and Instances</text:h><text:h text:style-name="Head 4" text:level="4" >Object Composition</text:h><text:h text:style-name="Head 2" text:level="2" >UNO Concepts</text:h><text:p text:style-name="Paragraph" >UNO is an environment for networked object communication</text:p><text:h text:style-name="Head 3" text:level="3" >Interprocess Connections</text:h><text:h text:style-name="Head 3" text:level="3" >ServiceManager and ComponentContext</text:h><text:h text:style-name="Head 3" text:level="3" >Using UNO Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >Using Collections and Containers</text:h><text:h text:style-name="Head 3" text:level="3" >Event Model</text:h><text:h text:style-name="Head 3" text:level="3" >Exception Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Lifetime Control</text:h><text:h text:style-name="Head 3" text:level="3" >Object Identity</text:h><text:h text:style-name="Head 2" text:level="2" >Language Bindings</text:h><text:h text:style-name="Head 3" text:level="3" >Introduction for language binding</text:h><text:h text:style-name="Head 3" text:level="3" >Java Language Binding</text:h><text:h text:style-name="Head 3" text:level="3" >C++ Binding</text:h><text:h text:style-name="Head 3" text:level="3" >Access for [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 3" text:level="3" >Automation</text:h><text:h text:style-name="Head 1" text:level="1" >Writing UNO components</text:h><text:h text:style-name="Head 2" text:level="2" >Specifying a new Component</text:h><text:h text:style-name="Head 3" text:level="3" >UNOIDL language specification</text:h><text:h text:style-name="Head 2" text:level="2" >Implementing a Component</text:h><text:h text:style-name="Head 3" text:level="3" >Component Development Basics</text:h><text:unordered-list text:style-name="L1" ><text:list-item ><text:p text:style-name="P3" >Introduction</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >Mandatory interfaces: XInterface, XServiceInfo ((from UseInterfaces.CoreInterfaces))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >"Should be implemented" interfaces: XTypeProvider ((from UseInterfaces.CoreInterfaces ))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >optional interface: XMain for standalone execution</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Simple Component in Java</text:h><text:unordered-list text:style-name="L2" ><text:list-item ><text:p text:style-name="P4" >Getting the service manager ((Chapter Java components from unoBindingJava))</text:p></text:list-item><text:list-item ><text:p text:style-name="P4" >simple component chapter</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >C++ Component</text:h><text:h text:style-name="Head 3" text:level="3" >((Automation Component?))</text:h><text:h text:style-name="Head 2" text:level="2" >Deployment Options for Components</text:h><text:h text:style-name="Head 3" text:level="3" >Component Registration</text:h><text:h text:style-name="Head 3" text:level="3" >Service Manager Configuration</text:h><text:unordered-list text:style-name="L3" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P5" >XSet Interface</text:p><text:p text:style-name="P5" >Adding components during runtime, particularly interesting during development</text:p></text:list-item><text:list-item ><text:p text:style-name="P5" >ServiceManager Content</text:p><text:p text:style-name="P5" >Dynamically modifying the ServiceManager</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Bootstrapping the Service Manager ((from CppBind chapter))</text:h><text:unordered-list text:style-name="L4" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P6" >Simple Test Application</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >Configuring Your Application with Bootstrap Parameters</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >The UNO Executable</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Standalone Runtime Environment</text:h><text:p text:style-name="Paragraph" ><text:tab-stop ></text:tab-stop>The UNO executable and XMain</text:p><text:h text:style-name="Head 3" text:level="3" >Configuring the Java Runtime Environment</text:h><text:unordered-list text:style-name="L5" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P7" >The office and Java ((from UnoBindingJava))</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 1" text:level="1" >Advanced UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Design Patterns</text:h><text:h text:style-name="Head 2" text:level="2" >Bridging concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Requirements for Language Bindings and Bridges</text:h><text:h text:style-name="Head 3" text:level="3" >New Scripting Engines</text:h><text:h text:style-name="Head 2" text:level="2" >ServiceManager and loader</text:h><text:h text:style-name="Head 2" text:level="2" >Special Interfaces for internal use</text:h><text:p text:style-name="Paragraph" >XUNOTunnel</text:p><text:p text:style-name="Paragraph" >XAggregation</text:p><text:h text:style-name="Head 2" text:level="2" >UNO Reflection API</text:h><text:h text:style-name="Head 2" text:level="2" >TypeLibrary and TypeProviders</text:h><text:h text:style-name="Head 2" text:level="2" >Differences from Corba</text:h><text:h text:style-name="Head 1" text:level="1" >Office Development</text:h><text:h text:style-name="Head 2" text:level="2" >Global Object Structure</text:h><text:h text:style-name="Head 3" text:level="3" >Desktop Environment</text:h><text:h text:style-name="Head 3" text:level="3" >Frames and Frame Hierarchies</text:h><text:h text:style-name="Head 3" text:level="3" >Frame-Controller-Model Paradigm</text:h><text:h text:style-name="Head 3" text:level="3" >Loading and Saving Office Components</text:h><text:h text:style-name="Head 3" text:level="3" >Dispatch Framework</text:h><text:h text:style-name="Head 2" text:level="2" >Common Features</text:h><text:h text:style-name="Head 3" text:level="3" >Common Dialogs</text:h><text:h text:style-name="Head 3" text:level="3" >DocumentInfo</text:h><text:h text:style-name="Head 3" text:level="3" >Styles</text:h><text:h text:style-name="Head 3" text:level="3" >Search and Replace</text:h><text:h text:style-name="Head 3" text:level="3" >Number Formats</text:h><text:h text:style-name="Head 3" text:level="3" >Package File Formats</text:h><text:h text:style-name="Head 2" text:level="2" >Internationalization</text:h><text:h text:style-name="Head 2" text:level="2" >Linguistic</text:h><text:h text:style-name="Head 2" text:level="2" >System Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Clipboard</text:h><text:h text:style-name="Head 3" text:level="3" >File Picker</text:h><text:h text:style-name="Head 3" text:level="3" >Bridging to the Window System</text:h><text:p text:style-name="Paragraph" ></text:p><text:h text:style-name="Head 1" text:level="1" >Text Documents (51,5 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Text Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Text Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Using Text</text:h><text:h text:style-name="Head 3" text:level="3" >Tables</text:h><text:h text:style-name="Head 3" text:level="3" >Text Fields</text:h><text:h text:style-name="Head 3" text:level="3" >Bookmarks</text:h><text:h text:style-name="Head 3" text:level="3" >Indexes and Index Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Reference Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Footnotes and Endnotes</text:h><text:h text:style-name="Head 3" text:level="3" >Shape Objects in Text</text:h><text:h text:style-name="Head 3" text:level="3" >Redline</text:h><text:h text:style-name="Head 3" text:level="3" >Ruby</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Text Document</text:h><text:h text:style-name="Head 1" text:level="1" >Spreadsheet Documents</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Spreadsheet Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Spreadsheet Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Editing Spreadsheets</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Spreadsheet Document</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Spreadsheet Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Drawings and Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Draw/Impress Files</text:h><text:h text:style-name="Head 3" text:level="3" >Saving</text:h><text:h text:style-name="Head 3" text:level="3" >Printing</text:h><text:h text:style-name="Head 3" text:level="3" >Running Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Working with a Draw/Impress Document</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Draw/Impress Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Draw/Impress Document</text:h><text:h text:style-name="Head 1" text:level="1" >Charts</text:h><text:h text:style-name="Head 2" text:level="2" >Chart Basics</text:h><text:h text:style-name="Head 2" text:level="2" >Creating a Chart Document</text:h><text:h text:style-name="Head 2" text:level="2" >Editing a Chart Document</text:h><text:h text:style-name="Head 3" text:level="3" >Common Diagram API</text:h><text:h text:style-name="Head 3" text:level="3" >Different Chart Types</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Chart Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Basic and Dialogs</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:h text:style-name="Head 2" text:level="2" >Library Organization</text:h><text:h text:style-name="Head 2" text:level="2" >IDE with Dialogs and Events</text:h><text:h text:style-name="Head 2" text:level="2" >Using [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 2" text:level="2" >Toolkit Controls and their Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating Dialogs at Runtime</text:h><text:h text:style-name="Head 1" text:level="1" >Database Access</text:h><text:h text:style-name="Head 2" text:level="2" >Features of the [PRODUCTNAME] Database Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Capabilities</text:h><text:h text:style-name="Head 3" text:level="3" >SDBC, SDBCX, SDB Architecture</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Datasources with [PRODUCTNAME]</text:h><text:h text:style-name="Head 3" text:level="3" >DataSources</text:h><text:h text:style-name="Head 3" text:level="3" >Adding and Editing Datasources </text:h><text:h text:style-name="Head 3" text:level="3" >Establishing a Connection</text:h><text:h text:style-name="Head 4" text:level="4" >Getting Connections</text:h><text:h text:style-name="Head 4" text:level="4" >Driver specifics</text:h><text:h text:style-name="Head 3" text:level="3" >Connection Pooling</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Saved Queries</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Data</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Statements</text:h><text:h text:style-name="Head 3" text:level="3" >Resultsets</text:h><text:h text:style-name="Head 3" text:level="3" >Metadata</text:h><text:h text:style-name="Head 3" text:level="3" >Rowsets</text:h><text:h text:style-name="Head 2" text:level="2" >Working with the Database Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using DDL to change the DB Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using SDBCX to access the DB Design</text:h><text:h text:style-name="Head 2" text:level="2" >Using DBMS Features</text:h><text:h text:style-name="Head 3" text:level="3" >Stored Procedures</text:h><text:h text:style-name="Head 3" text:level="3" >Transaction Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Prepared Statements</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Database Drivers</text:h><text:h text:style-name="Head 1" text:level="1" >Forms</text:h><text:h text:style-name="Head 2" text:level="2" >Concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Models and Views</text:h><text:h text:style-name="Head 3" text:level="3" >Form Elements in the Document Model</text:h><text:h text:style-name="Head 3" text:level="3" >Special Form Components</text:h><text:h text:style-name="Head 3" text:level="3" >Events</text:h><text:h text:style-name="Head 3" text:level="3" >Data Awareness</text:h><text:h text:style-name="Head 2" text:level="2" >Recipes</text:h><text:h text:style-name="Head 3" text:level="3" >Making it easier to work with a Form</text:h><text:h text:style-name="Head 3" text:level="3" >Controlling the Data Input</text:h><text:h text:style-name="Head 3" text:level="3" >Collecting Data automatically</text:h><text:h text:style-name="Head 3" text:level="3" >Taking Advantage of Database Server Features</text:h><text:h text:style-name="Head 3" text:level="3" >Adding new Functionality</text:h><text:h text:style-name="Head 3" text:level="3" >Handling Errors</text:h><text:h text:style-name="Head 1" text:level="1" >UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Purpose of UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Document Contents as Streams</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Content Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating, Moving and Copying Document and Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Additional Commands</text:h><text:h text:style-name="Head 2" text:level="2" >Writing a Content Provider</text:h><text:h text:style-name="Head 1" text:level="1" >[PRODUCTNAME] Configuration</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing configuration data</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Configuration Data</text:h><text:h text:style-name="Head 1" text:level="1" >Appendix</text:h></office:body> + +<office:body ><text:sequence-decls ><text:sequence-decl text:display-outline-level="0" text:name="Illustration" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Table" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Text" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Drawing" ></text:sequence-decl></text:sequence-decls><text:p text:style-name="P1" >Programmer's Manual</text:p><text:p text:style-name="P2" >Planned Outline</text:p><text:p text:style-name="P2" ></text:p><text:h text:style-name="Head 1" text:level="1" >Preface (3 Pages)</text:h><text:h text:style-name="Head 1" text:level="1" >First Steps (24 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Programming with UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Fields of Application for UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Getting Started</text:h><text:h text:style-name="Head 3" text:level="3" >Required Files</text:h><text:h text:style-name="Head 3" text:level="3" >Configuration</text:h><text:h text:style-name="Head 3" text:level="3" >First Connection</text:h><text:h text:style-name="Head 2" text:level="2" >How to get Objects in [PRODUCTNAME]</text:h><text:h text:style-name="Head 2" text:level="2" >How to work with Objects</text:h><text:p text:style-name="Paragraph" >Example</text:p><text:h text:style-name="Head 3" text:level="3" >Services</text:h><text:h text:style-name="Head 3" text:level="3" >Querying Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >ElementAccess</text:h><text:h text:style-name="Head 3" text:level="3" >Simple Types</text:h><text:h text:style-name="Head 3" text:level="3" >Strings</text:h><text:h text:style-name="Head 3" text:level="3" >Enums and Constant Groups</text:h><text:h text:style-name="Head 3" text:level="3" >Structs</text:h><text:h text:style-name="Head 3" text:level="3" >Any</text:h><text:h text:style-name="Head 3" text:level="3" >Sequence</text:h><text:h text:style-name="Head 2" text:level="2" >How to find the solution for a problem</text:h><text:h text:style-name="Head 2" text:level="2" >Finding your Way through the API Reference</text:h><text:h text:style-name="Head 2" text:level="2" >Common Mechanisms</text:h><text:h text:style-name="Head 3" text:level="3" >Text</text:h><text:h text:style-name="Head 3" text:level="3" >Table</text:h><text:h text:style-name="Head 3" text:level="3" >Drawing</text:h><text:h text:style-name="Head 1" text:level="1" >UNO in Professional Projects (<text:span text:style-name="T1" >145</text:span>)</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:p text:style-name="Paragraph" >UNO/API constituents: How UNOIDL/API, ServiceManager, Bridges, CoreReflection work together</text:p><text:h text:style-name="Head 2" text:level="2" >API Concepts</text:h><text:p text:style-name="Paragraph" >API is a language independent, abstract specification for UNO objects which are used in <text:s ></text:s>[PRODUCTNAME]</text:p><text:h text:style-name="Head 3" text:level="3" >Types in the API Reference</text:h><text:h text:style-name="Head 4" text:level="4" >Simple Types</text:h><text:h text:style-name="Head 4" text:level="4" >The Any Type</text:h><text:h text:style-name="Head 4" text:level="4" >Interfaces</text:h><text:h text:style-name="Head 4" text:level="4" >Services</text:h><text:h text:style-name="Head 4" text:level="4" >Modules</text:h><text:h text:style-name="Head 4" text:level="4" >Structs</text:h><text:h text:style-name="Head 4" text:level="4" >Constant Groups and Enums</text:h><text:h text:style-name="Head 4" text:level="4" >Sequences</text:h><text:h text:style-name="Head 4" text:level="4" >Exceptions</text:h><text:h text:style-name="Head 3" text:level="3" >API Principles</text:h><text:h text:style-name="Head 4" text:level="4" >Relationship between Specification, Implementation and Instances</text:h><text:h text:style-name="Head 4" text:level="4" >Object Composition</text:h><text:h text:style-name="Head 2" text:level="2" >UNO Concepts</text:h><text:p text:style-name="Paragraph" >UNO is an environment for networked object communication</text:p><text:h text:style-name="Head 3" text:level="3" >Interprocess Connections</text:h><text:h text:style-name="Head 3" text:level="3" >ServiceManager and ComponentContext</text:h><text:h text:style-name="Head 3" text:level="3" >Using UNO Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >Using Collections and Containers</text:h><text:h text:style-name="Head 3" text:level="3" >Event Model</text:h><text:h text:style-name="Head 3" text:level="3" >Exception Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Lifetime Control</text:h><text:h text:style-name="Head 3" text:level="3" >Object Identity</text:h><text:h text:style-name="Head 2" text:level="2" >Language Bindings</text:h><text:h text:style-name="Head 3" text:level="3" >Introduction for language binding</text:h><text:h text:style-name="Head 3" text:level="3" >Java Language Binding</text:h><text:h text:style-name="Head 3" text:level="3" >C++ Binding</text:h><text:h text:style-name="Head 3" text:level="3" >Access for [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 3" text:level="3" >Automation</text:h><text:h text:style-name="Head 1" text:level="1" >Writing UNO components</text:h><text:h text:style-name="Head 2" text:level="2" >Specifying a new Component</text:h><text:h text:style-name="Head 3" text:level="3" >UNOIDL language specification</text:h><text:h text:style-name="Head 2" text:level="2" >Implementing a Component</text:h><text:h text:style-name="Head 3" text:level="3" >Component Development Basics</text:h><text:unordered-list text:style-name="L1" ><text:list-item ><text:p text:style-name="P3" >Introduction</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >Mandatory interfaces: XInterface, XServiceInfo ((from UseInterfaces.CoreInterfaces))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >"Should be implemented" interfaces: XTypeProvider ((from UseInterfaces.CoreInterfaces ))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >optional interface: XMain for standalone execution</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Simple Component in Java</text:h><text:unordered-list text:style-name="L2" ><text:list-item ><text:p text:style-name="P4" >Getting the service manager ((Chapter Java components from unoBindingJava))</text:p></text:list-item><text:list-item ><text:p text:style-name="P4" >simple component chapter</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >C++ Component</text:h><text:h text:style-name="Head 3" text:level="3" >((Automation Component?))</text:h><text:h text:style-name="Head 2" text:level="2" >Deployment Options for Components</text:h><text:h text:style-name="Head 3" text:level="3" >Component Registration</text:h><text:h text:style-name="Head 3" text:level="3" >Service Manager Configuration</text:h><text:unordered-list text:style-name="L3" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P5" >XSet Interface</text:p><text:p text:style-name="P5" >Adding components during runtime, particularly interesting during development</text:p></text:list-item><text:list-item ><text:p text:style-name="P5" >ServiceManager Content</text:p><text:p text:style-name="P5" >Dynamically modifying the ServiceManager</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Bootstrapping the Service Manager ((from CppBind chapter))</text:h><text:unordered-list text:style-name="L4" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P6" >Simple Test Application</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >Configuring Your Application with Bootstrap Parameters</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >The UNO Executable</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Standalone Runtime Environment</text:h><text:p text:style-name="Paragraph" ><text:tab-stop ></text:tab-stop>The UNO executable and XMain</text:p><text:h text:style-name="Head 3" text:level="3" >Configuring the Java Runtime Environment</text:h><text:unordered-list text:style-name="L5" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P7" >The office and Java ((from UnoBindingJava))</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 1" text:level="1" >Advanced UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Design Patterns</text:h><text:h text:style-name="Head 2" text:level="2" >Bridging concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Requirements for Language Bindings and Bridges</text:h><text:h text:style-name="Head 3" text:level="3" >New Scripting Engines</text:h><text:h text:style-name="Head 2" text:level="2" >ServiceManager and loader</text:h><text:h text:style-name="Head 2" text:level="2" >Special Interfaces for internal use</text:h><text:p text:style-name="Paragraph" >XUNOTunnel</text:p><text:p text:style-name="Paragraph" >XAggregation</text:p><text:h text:style-name="Head 2" text:level="2" >UNO Reflection API</text:h><text:h text:style-name="Head 2" text:level="2" >TypeLibrary and TypeProviders</text:h><text:h text:style-name="Head 2" text:level="2" >Differences from Corba</text:h><text:h text:style-name="Head 1" text:level="1" >Office Development</text:h><text:h text:style-name="Head 2" text:level="2" >Global Object Structure</text:h><text:h text:style-name="Head 3" text:level="3" >Desktop Environment</text:h><text:h text:style-name="Head 3" text:level="3" >Frames and Frame Hierarchies</text:h><text:h text:style-name="Head 3" text:level="3" >Frame-Controller-Model Paradigm</text:h><text:h text:style-name="Head 3" text:level="3" >Loading and Saving Office Components</text:h><text:h text:style-name="Head 3" text:level="3" >Dispatch Framework</text:h><text:h text:style-name="Head 2" text:level="2" >Common Features</text:h><text:h text:style-name="Head 3" text:level="3" >Common Dialogs</text:h><text:h text:style-name="Head 3" text:level="3" >DocumentInfo</text:h><text:h text:style-name="Head 3" text:level="3" >Styles</text:h><text:h text:style-name="Head 3" text:level="3" >Search and Replace</text:h><text:h text:style-name="Head 3" text:level="3" >Number Formats</text:h><text:h text:style-name="Head 3" text:level="3" >Package File Formats</text:h><text:h text:style-name="Head 2" text:level="2" >Internationalization</text:h><text:h text:style-name="Head 2" text:level="2" >Linguistic</text:h><text:h text:style-name="Head 2" text:level="2" >System Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Clipboard</text:h><text:h text:style-name="Head 3" text:level="3" >File Picker</text:h><text:h text:style-name="Head 3" text:level="3" >Bridging to the Window System</text:h><text:p text:style-name="Paragraph" ></text:p><text:h text:style-name="Head 1" text:level="1" >Text Documents (51,5 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Text Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Text Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Using Text</text:h><text:h text:style-name="Head 3" text:level="3" >Tables</text:h><text:h text:style-name="Head 3" text:level="3" >Text Fields</text:h><text:h text:style-name="Head 3" text:level="3" >Bookmarks</text:h><text:h text:style-name="Head 3" text:level="3" >Indexes and Index Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Reference Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Footnotes and Endnotes</text:h><text:h text:style-name="Head 3" text:level="3" >Shape Objects in Text</text:h><text:h text:style-name="Head 3" text:level="3" >Redline</text:h><text:h text:style-name="Head 3" text:level="3" >Ruby</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Text Document</text:h><text:h text:style-name="Head 1" text:level="1" >Spreadsheet Documents</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Spreadsheet Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Spreadsheet Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Editing Spreadsheets</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Spreadsheet Document</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Spreadsheet Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Drawings and Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Draw/Impress Files</text:h><text:h text:style-name="Head 3" text:level="3" >Saving</text:h><text:h text:style-name="Head 3" text:level="3" >Printing</text:h><text:h text:style-name="Head 3" text:level="3" >Running Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Working with a Draw/Impress Document</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Draw/Impress Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Draw/Impress Document</text:h><text:h text:style-name="Head 1" text:level="1" >Charts</text:h><text:h text:style-name="Head 2" text:level="2" >Chart Basics</text:h><text:h text:style-name="Head 2" text:level="2" >Creating a Chart Document</text:h><text:h text:style-name="Head 2" text:level="2" >Editing a Chart Document</text:h><text:h text:style-name="Head 3" text:level="3" >Common Diagram API</text:h><text:h text:style-name="Head 3" text:level="3" >Different Chart Types</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Chart Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Basic and Dialogs</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:h text:style-name="Head 2" text:level="2" >Library Organization</text:h><text:h text:style-name="Head 2" text:level="2" >IDE with Dialogs and Events</text:h><text:h text:style-name="Head 2" text:level="2" >Using [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 2" text:level="2" >Toolkit Controls and their Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating Dialogs at Runtime</text:h><text:h text:style-name="Head 1" text:level="1" >Database Access</text:h><text:h text:style-name="Head 2" text:level="2" >Features of the [PRODUCTNAME] Database Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Capabilities</text:h><text:h text:style-name="Head 3" text:level="3" >SDBC, SDBCX, SDB Architecture</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Datasources with [PRODUCTNAME]</text:h><text:h text:style-name="Head 3" text:level="3" >DataSources</text:h><text:h text:style-name="Head 3" text:level="3" >Adding and Editing Datasources </text:h><text:h text:style-name="Head 3" text:level="3" >Establishing a Connection</text:h><text:h text:style-name="Head 4" text:level="4" >Getting Connections</text:h><text:h text:style-name="Head 4" text:level="4" >Driver specifics</text:h><text:h text:style-name="Head 3" text:level="3" >Connection Pooling</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Saved Queries</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Data</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Statements</text:h><text:h text:style-name="Head 3" text:level="3" >Resultsets</text:h><text:h text:style-name="Head 3" text:level="3" >Metadata</text:h><text:h text:style-name="Head 3" text:level="3" >Rowsets</text:h><text:h text:style-name="Head 2" text:level="2" >Working with the Database Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using DDL to change the DB Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using SDBCX to access the DB Design</text:h><text:h text:style-name="Head 2" text:level="2" >Using DBMS Features</text:h><text:h text:style-name="Head 3" text:level="3" >Stored Procedures</text:h><text:h text:style-name="Head 3" text:level="3" >Transaction Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Prepared Statements</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Database Drivers</text:h><text:h text:style-name="Head 1" text:level="1" >Forms</text:h><text:h text:style-name="Head 2" text:level="2" >Concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Models and Views</text:h><text:h text:style-name="Head 3" text:level="3" >Form Elements in the Document Model</text:h><text:h text:style-name="Head 3" text:level="3" >Special Form Components</text:h><text:h text:style-name="Head 3" text:level="3" >Events</text:h><text:h text:style-name="Head 3" text:level="3" >Data Awareness</text:h><text:h text:style-name="Head 2" text:level="2" >Recipes</text:h><text:h text:style-name="Head 3" text:level="3" >Making it easier to work with a Form</text:h><text:h text:style-name="Head 3" text:level="3" >Controlling the Data Input</text:h><text:h text:style-name="Head 3" text:level="3" >Collecting Data automatically</text:h><text:h text:style-name="Head 3" text:level="3" >Taking Advantage of Database Server Features</text:h><text:h text:style-name="Head 3" text:level="3" >Adding new Functionality</text:h><text:h text:style-name="Head 3" text:level="3" >Handling Errors</text:h><text:h text:style-name="Head 1" text:level="1" >UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Purpose of UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Document Contents as Streams</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Content Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating, Moving and Copying Document and Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Additional Commands</text:h><text:h text:style-name="Head 2" text:level="2" >Writing a Content Provider</text:h><text:h text:style-name="Head 1" text:level="1" >[PRODUCTNAME] Configuration</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing configuration data</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Configuration Data</text:h><text:h text:style-name="Head 1" text:level="1" >Appendix</text:h></office:body> + +<office:body ><text:sequence-decls ><text:sequence-decl text:display-outline-level="0" text:name="Illustration" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Table" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Text" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Drawing" ></text:sequence-decl></text:sequence-decls><text:p text:style-name="P1" >Programmer's Manual</text:p><text:p text:style-name="P2" >Planned Outline</text:p><text:p text:style-name="P2" ></text:p><text:h text:style-name="Head 1" text:level="1" >Preface (3 Pages)</text:h><text:h text:style-name="Head 1" text:level="1" >First Steps (24 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Programming with UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Fields of Application for UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Getting Started</text:h><text:h text:style-name="Head 3" text:level="3" >Required Files</text:h><text:h text:style-name="Head 3" text:level="3" >Configuration</text:h><text:h text:style-name="Head 3" text:level="3" >First Connection</text:h><text:h text:style-name="Head 2" text:level="2" >How to get Objects in [PRODUCTNAME]</text:h><text:h text:style-name="Head 2" text:level="2" >How to work with Objects</text:h><text:p text:style-name="Paragraph" >Example</text:p><text:h text:style-name="Head 3" text:level="3" >Services</text:h><text:h text:style-name="Head 3" text:level="3" >Querying Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >ElementAccess</text:h><text:h text:style-name="Head 3" text:level="3" >Simple Types</text:h><text:h text:style-name="Head 3" text:level="3" >Strings</text:h><text:h text:style-name="Head 3" text:level="3" >Enums and Constant Groups</text:h><text:h text:style-name="Head 3" text:level="3" >Structs</text:h><text:h text:style-name="Head 3" text:level="3" >Any</text:h><text:h text:style-name="Head 3" text:level="3" >Sequence</text:h><text:h text:style-name="Head 2" text:level="2" >How to find the solution for a problem</text:h><text:h text:style-name="Head 2" text:level="2" >Finding your Way through the API Reference</text:h><text:h text:style-name="Head 2" text:level="2" >Common Mechanisms</text:h><text:h text:style-name="Head 3" text:level="3" >Text</text:h><text:h text:style-name="Head 3" text:level="3" >Table</text:h><text:h text:style-name="Head 3" text:level="3" >Drawing</text:h><text:h text:style-name="Head 1" text:level="1" >UNO in Professional Projects (<text:span text:style-name="T1" >145</text:span>)</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:p text:style-name="Paragraph" >UNO/API constituents: How UNOIDL/API, ServiceManager, Bridges, CoreReflection work together</text:p><text:h text:style-name="Head 2" text:level="2" >API Concepts</text:h><text:p text:style-name="Paragraph" >API is a language independent, abstract specification for UNO objects which are used in <text:s ></text:s>[PRODUCTNAME]</text:p><text:h text:style-name="Head 3" text:level="3" >Types in the API Reference</text:h><text:h text:style-name="Head 4" text:level="4" >Simple Types</text:h><text:h text:style-name="Head 4" text:level="4" >The Any Type</text:h><text:h text:style-name="Head 4" text:level="4" >Interfaces</text:h><text:h text:style-name="Head 4" text:level="4" >Services</text:h><text:h text:style-name="Head 4" text:level="4" >Modules</text:h><text:h text:style-name="Head 4" text:level="4" >Structs</text:h><text:h text:style-name="Head 4" text:level="4" >Constant Groups and Enums</text:h><text:h text:style-name="Head 4" text:level="4" >Sequences</text:h><text:h text:style-name="Head 4" text:level="4" >Exceptions</text:h><text:h text:style-name="Head 3" text:level="3" >API Principles</text:h><text:h text:style-name="Head 4" text:level="4" >Relationship between Specification, Implementation and Instances</text:h><text:h text:style-name="Head 4" text:level="4" >Object Composition</text:h><text:h text:style-name="Head 2" text:level="2" >UNO Concepts</text:h><text:p text:style-name="Paragraph" >UNO is an environment for networked object communication</text:p><text:h text:style-name="Head 3" text:level="3" >Interprocess Connections</text:h><text:h text:style-name="Head 3" text:level="3" >ServiceManager and ComponentContext</text:h><text:h text:style-name="Head 3" text:level="3" >Using UNO Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >Using Collections and Containers</text:h><text:h text:style-name="Head 3" text:level="3" >Event Model</text:h><text:h text:style-name="Head 3" text:level="3" >Exception Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Lifetime Control</text:h><text:h text:style-name="Head 3" text:level="3" >Object Identity</text:h><text:h text:style-name="Head 2" text:level="2" >Language Bindings</text:h><text:h text:style-name="Head 3" text:level="3" >Introduction for language binding</text:h><text:h text:style-name="Head 3" text:level="3" >Java Language Binding</text:h><text:h text:style-name="Head 3" text:level="3" >C++ Binding</text:h><text:h text:style-name="Head 3" text:level="3" >Access for [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 3" text:level="3" >Automation</text:h><text:h text:style-name="Head 1" text:level="1" >Writing UNO components</text:h><text:h text:style-name="Head 2" text:level="2" >Specifying a new Component</text:h><text:h text:style-name="Head 3" text:level="3" >UNOIDL language specification</text:h><text:h text:style-name="Head 2" text:level="2" >Implementing a Component</text:h><text:h text:style-name="Head 3" text:level="3" >Component Development Basics</text:h><text:unordered-list text:style-name="L1" ><text:list-item ><text:p text:style-name="P3" >Introduction</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >Mandatory interfaces: XInterface, XServiceInfo ((from UseInterfaces.CoreInterfaces))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >"Should be implemented" interfaces: XTypeProvider ((from UseInterfaces.CoreInterfaces ))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >optional interface: XMain for standalone execution</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Simple Component in Java</text:h><text:unordered-list text:style-name="L2" ><text:list-item ><text:p text:style-name="P4" >Getting the service manager ((Chapter Java components from unoBindingJava))</text:p></text:list-item><text:list-item ><text:p text:style-name="P4" >simple component chapter</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >C++ Component</text:h><text:h text:style-name="Head 3" text:level="3" >((Automation Component?))</text:h><text:h text:style-name="Head 2" text:level="2" >Deployment Options for Components</text:h><text:h text:style-name="Head 3" text:level="3" >Component Registration</text:h><text:h text:style-name="Head 3" text:level="3" >Service Manager Configuration</text:h><text:unordered-list text:style-name="L3" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P5" >XSet Interface</text:p><text:p text:style-name="P5" >Adding components during runtime, particularly interesting during development</text:p></text:list-item><text:list-item ><text:p text:style-name="P5" >ServiceManager Content</text:p><text:p text:style-name="P5" >Dynamically modifying the ServiceManager</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Bootstrapping the Service Manager ((from CppBind chapter))</text:h><text:unordered-list text:style-name="L4" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P6" >Simple Test Application</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >Configuring Your Application with Bootstrap Parameters</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >The UNO Executable</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Standalone Runtime Environment</text:h><text:p text:style-name="Paragraph" ><text:tab-stop ></text:tab-stop>The UNO executable and XMain</text:p><text:h text:style-name="Head 3" text:level="3" >Configuring the Java Runtime Environment</text:h><text:unordered-list text:style-name="L5" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P7" >The office and Java ((from UnoBindingJava))</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 1" text:level="1" >Advanced UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Design Patterns</text:h><text:h text:style-name="Head 2" text:level="2" >Bridging concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Requirements for Language Bindings and Bridges</text:h><text:h text:style-name="Head 3" text:level="3" >New Scripting Engines</text:h><text:h text:style-name="Head 2" text:level="2" >ServiceManager and loader</text:h><text:h text:style-name="Head 2" text:level="2" >Special Interfaces for internal use</text:h><text:p text:style-name="Paragraph" >XUNOTunnel</text:p><text:p text:style-name="Paragraph" >XAggregation</text:p><text:h text:style-name="Head 2" text:level="2" >UNO Reflection API</text:h><text:h text:style-name="Head 2" text:level="2" >TypeLibrary and TypeProviders</text:h><text:h text:style-name="Head 2" text:level="2" >Differences from Corba</text:h><text:h text:style-name="Head 1" text:level="1" >Office Development</text:h><text:h text:style-name="Head 2" text:level="2" >Global Object Structure</text:h><text:h text:style-name="Head 3" text:level="3" >Desktop Environment</text:h><text:h text:style-name="Head 3" text:level="3" >Frames and Frame Hierarchies</text:h><text:h text:style-name="Head 3" text:level="3" >Frame-Controller-Model Paradigm</text:h><text:h text:style-name="Head 3" text:level="3" >Loading and Saving Office Components</text:h><text:h text:style-name="Head 3" text:level="3" >Dispatch Framework</text:h><text:h text:style-name="Head 2" text:level="2" >Common Features</text:h><text:h text:style-name="Head 3" text:level="3" >Common Dialogs</text:h><text:h text:style-name="Head 3" text:level="3" >DocumentInfo</text:h><text:h text:style-name="Head 3" text:level="3" >Styles</text:h><text:h text:style-name="Head 3" text:level="3" >Search and Replace</text:h><text:h text:style-name="Head 3" text:level="3" >Number Formats</text:h><text:h text:style-name="Head 3" text:level="3" >Package File Formats</text:h><text:h text:style-name="Head 2" text:level="2" >Internationalization</text:h><text:h text:style-name="Head 2" text:level="2" >Linguistic</text:h><text:h text:style-name="Head 2" text:level="2" >System Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Clipboard</text:h><text:h text:style-name="Head 3" text:level="3" >File Picker</text:h><text:h text:style-name="Head 3" text:level="3" >Bridging to the Window System</text:h><text:p text:style-name="Paragraph" ></text:p><text:h text:style-name="Head 1" text:level="1" >Text Documents (51,5 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Text Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Text Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Using Text</text:h><text:h text:style-name="Head 3" text:level="3" >Tables</text:h><text:h text:style-name="Head 3" text:level="3" >Text Fields</text:h><text:h text:style-name="Head 3" text:level="3" >Bookmarks</text:h><text:h text:style-name="Head 3" text:level="3" >Indexes and Index Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Reference Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Footnotes and Endnotes</text:h><text:h text:style-name="Head 3" text:level="3" >Shape Objects in Text</text:h><text:h text:style-name="Head 3" text:level="3" >Redline</text:h><text:h text:style-name="Head 3" text:level="3" >Ruby</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Text Document</text:h><text:h text:style-name="Head 1" text:level="1" >Spreadsheet Documents</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Spreadsheet Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Spreadsheet Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Editing Spreadsheets</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Spreadsheet Document</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Spreadsheet Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Drawings and Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Draw/Impress Files</text:h><text:h text:style-name="Head 3" text:level="3" >Saving</text:h><text:h text:style-name="Head 3" text:level="3" >Printing</text:h><text:h text:style-name="Head 3" text:level="3" >Running Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Working with a Draw/Impress Document</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Draw/Impress Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Draw/Impress Document</text:h><text:h text:style-name="Head 1" text:level="1" >Charts</text:h><text:h text:style-name="Head 2" text:level="2" >Chart Basics</text:h><text:h text:style-name="Head 2" text:level="2" >Creating a Chart Document</text:h><text:h text:style-name="Head 2" text:level="2" >Editing a Chart Document</text:h><text:h text:style-name="Head 3" text:level="3" >Common Diagram API</text:h><text:h text:style-name="Head 3" text:level="3" >Different Chart Types</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Chart Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Basic and Dialogs</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:h text:style-name="Head 2" text:level="2" >Library Organization</text:h><text:h text:style-name="Head 2" text:level="2" >IDE with Dialogs and Events</text:h><text:h text:style-name="Head 2" text:level="2" >Using [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 2" text:level="2" >Toolkit Controls and their Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating Dialogs at Runtime</text:h><text:h text:style-name="Head 1" text:level="1" >Database Access</text:h><text:h text:style-name="Head 2" text:level="2" >Features of the [PRODUCTNAME] Database Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Capabilities</text:h><text:h text:style-name="Head 3" text:level="3" >SDBC, SDBCX, SDB Architecture</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Datasources with [PRODUCTNAME]</text:h><text:h text:style-name="Head 3" text:level="3" >DataSources</text:h><text:h text:style-name="Head 3" text:level="3" >Adding and Editing Datasources </text:h><text:h text:style-name="Head 3" text:level="3" >Establishing a Connection</text:h><text:h text:style-name="Head 4" text:level="4" >Getting Connections</text:h><text:h text:style-name="Head 4" text:level="4" >Driver specifics</text:h><text:h text:style-name="Head 3" text:level="3" >Connection Pooling</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Saved Queries</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Data</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Statements</text:h><text:h text:style-name="Head 3" text:level="3" >Resultsets</text:h><text:h text:style-name="Head 3" text:level="3" >Metadata</text:h><text:h text:style-name="Head 3" text:level="3" >Rowsets</text:h><text:h text:style-name="Head 2" text:level="2" >Working with the Database Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using DDL to change the DB Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using SDBCX to access the DB Design</text:h><text:h text:style-name="Head 2" text:level="2" >Using DBMS Features</text:h><text:h text:style-name="Head 3" text:level="3" >Stored Procedures</text:h><text:h text:style-name="Head 3" text:level="3" >Transaction Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Prepared Statements</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Database Drivers</text:h><text:h text:style-name="Head 1" text:level="1" >Forms</text:h><text:h text:style-name="Head 2" text:level="2" >Concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Models and Views</text:h><text:h text:style-name="Head 3" text:level="3" >Form Elements in the Document Model</text:h><text:h text:style-name="Head 3" text:level="3" >Special Form Components</text:h><text:h text:style-name="Head 3" text:level="3" >Events</text:h><text:h text:style-name="Head 3" text:level="3" >Data Awareness</text:h><text:h text:style-name="Head 2" text:level="2" >Recipes</text:h><text:h text:style-name="Head 3" text:level="3" >Making it easier to work with a Form</text:h><text:h text:style-name="Head 3" text:level="3" >Controlling the Data Input</text:h><text:h text:style-name="Head 3" text:level="3" >Collecting Data automatically</text:h><text:h text:style-name="Head 3" text:level="3" >Taking Advantage of Database Server Features</text:h><text:h text:style-name="Head 3" text:level="3" >Adding new Functionality</text:h><text:h text:style-name="Head 3" text:level="3" >Handling Errors</text:h><text:h text:style-name="Head 1" text:level="1" >UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Purpose of UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Document Contents as Streams</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Content Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating, Moving and Copying Document and Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Additional Commands</text:h><text:h text:style-name="Head 2" text:level="2" >Writing a Content Provider</text:h><text:h text:style-name="Head 1" text:level="1" >[PRODUCTNAME] Configuration</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing configuration data</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Configuration Data</text:h><text:h text:style-name="Head 1" text:level="1" >Appendix</text:h></office:body> + +<office:body ><text:sequence-decls ><text:sequence-decl text:display-outline-level="0" text:name="Illustration" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Table" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Text" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Drawing" ></text:sequence-decl></text:sequence-decls><text:p text:style-name="P1" >Programmer's Manual</text:p><text:p text:style-name="P2" >Planned Outline</text:p><text:p text:style-name="P2" ></text:p><text:h text:style-name="Head 1" text:level="1" >Preface (3 Pages)</text:h><text:h text:style-name="Head 1" text:level="1" >First Steps (24 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Programming with UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Fields of Application for UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Getting Started</text:h><text:h text:style-name="Head 3" text:level="3" >Required Files</text:h><text:h text:style-name="Head 3" text:level="3" >Configuration</text:h><text:h text:style-name="Head 3" text:level="3" >First Connection</text:h><text:h text:style-name="Head 2" text:level="2" >How to get Objects in [PRODUCTNAME]</text:h><text:h text:style-name="Head 2" text:level="2" >How to work with Objects</text:h><text:p text:style-name="Paragraph" >Example</text:p><text:h text:style-name="Head 3" text:level="3" >Services</text:h><text:h text:style-name="Head 3" text:level="3" >Querying Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >ElementAccess</text:h><text:h text:style-name="Head 3" text:level="3" >Simple Types</text:h><text:h text:style-name="Head 3" text:level="3" >Strings</text:h><text:h text:style-name="Head 3" text:level="3" >Enums and Constant Groups</text:h><text:h text:style-name="Head 3" text:level="3" >Structs</text:h><text:h text:style-name="Head 3" text:level="3" >Any</text:h><text:h text:style-name="Head 3" text:level="3" >Sequence</text:h><text:h text:style-name="Head 2" text:level="2" >How to find the solution for a problem</text:h><text:h text:style-name="Head 2" text:level="2" >Finding your Way through the API Reference</text:h><text:h text:style-name="Head 2" text:level="2" >Common Mechanisms</text:h><text:h text:style-name="Head 3" text:level="3" >Text</text:h><text:h text:style-name="Head 3" text:level="3" >Table</text:h><text:h text:style-name="Head 3" text:level="3" >Drawing</text:h><text:h text:style-name="Head 1" text:level="1" >UNO in Professional Projects (<text:span text:style-name="T1" >145</text:span>)</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:p text:style-name="Paragraph" >UNO/API constituents: How UNOIDL/API, ServiceManager, Bridges, CoreReflection work together</text:p><text:h text:style-name="Head 2" text:level="2" >API Concepts</text:h><text:p text:style-name="Paragraph" >API is a language independent, abstract specification for UNO objects which are used in <text:s ></text:s>[PRODUCTNAME]</text:p><text:h text:style-name="Head 3" text:level="3" >Types in the API Reference</text:h><text:h text:style-name="Head 4" text:level="4" >Simple Types</text:h><text:h text:style-name="Head 4" text:level="4" >The Any Type</text:h><text:h text:style-name="Head 4" text:level="4" >Interfaces</text:h><text:h text:style-name="Head 4" text:level="4" >Services</text:h><text:h text:style-name="Head 4" text:level="4" >Modules</text:h><text:h text:style-name="Head 4" text:level="4" >Structs</text:h><text:h text:style-name="Head 4" text:level="4" >Constant Groups and Enums</text:h><text:h text:style-name="Head 4" text:level="4" >Sequences</text:h><text:h text:style-name="Head 4" text:level="4" >Exceptions</text:h><text:h text:style-name="Head 3" text:level="3" >API Principles</text:h><text:h text:style-name="Head 4" text:level="4" >Relationship between Specification, Implementation and Instances</text:h><text:h text:style-name="Head 4" text:level="4" >Object Composition</text:h><text:h text:style-name="Head 2" text:level="2" >UNO Concepts</text:h><text:p text:style-name="Paragraph" >UNO is an environment for networked object communication</text:p><text:h text:style-name="Head 3" text:level="3" >Interprocess Connections</text:h><text:h text:style-name="Head 3" text:level="3" >ServiceManager and ComponentContext</text:h><text:h text:style-name="Head 3" text:level="3" >Using UNO Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >Using Collections and Containers</text:h><text:h text:style-name="Head 3" text:level="3" >Event Model</text:h><text:h text:style-name="Head 3" text:level="3" >Exception Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Lifetime Control</text:h><text:h text:style-name="Head 3" text:level="3" >Object Identity</text:h><text:h text:style-name="Head 2" text:level="2" >Language Bindings</text:h><text:h text:style-name="Head 3" text:level="3" >Introduction for language binding</text:h><text:h text:style-name="Head 3" text:level="3" >Java Language Binding</text:h><text:h text:style-name="Head 3" text:level="3" >C++ Binding</text:h><text:h text:style-name="Head 3" text:level="3" >Access for [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 3" text:level="3" >Automation</text:h><text:h text:style-name="Head 1" text:level="1" >Writing UNO components</text:h><text:h text:style-name="Head 2" text:level="2" >Specifying a new Component</text:h><text:h text:style-name="Head 3" text:level="3" >UNOIDL language specification</text:h><text:h text:style-name="Head 2" text:level="2" >Implementing a Component</text:h><text:h text:style-name="Head 3" text:level="3" >Component Development Basics</text:h><text:unordered-list text:style-name="L1" ><text:list-item ><text:p text:style-name="P3" >Introduction</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >Mandatory interfaces: XInterface, XServiceInfo ((from UseInterfaces.CoreInterfaces))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >"Should be implemented" interfaces: XTypeProvider ((from UseInterfaces.CoreInterfaces ))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >optional interface: XMain for standalone execution</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Simple Component in Java</text:h><text:unordered-list text:style-name="L2" ><text:list-item ><text:p text:style-name="P4" >Getting the service manager ((Chapter Java components from unoBindingJava))</text:p></text:list-item><text:list-item ><text:p text:style-name="P4" >simple component chapter</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >C++ Component</text:h><text:h text:style-name="Head 3" text:level="3" >((Automation Component?))</text:h><text:h text:style-name="Head 2" text:level="2" >Deployment Options for Components</text:h><text:h text:style-name="Head 3" text:level="3" >Component Registration</text:h><text:h text:style-name="Head 3" text:level="3" >Service Manager Configuration</text:h><text:unordered-list text:style-name="L3" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P5" >XSet Interface</text:p><text:p text:style-name="P5" >Adding components during runtime, particularly interesting during development</text:p></text:list-item><text:list-item ><text:p text:style-name="P5" >ServiceManager Content</text:p><text:p text:style-name="P5" >Dynamically modifying the ServiceManager</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Bootstrapping the Service Manager ((from CppBind chapter))</text:h><text:unordered-list text:style-name="L4" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P6" >Simple Test Application</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >Configuring Your Application with Bootstrap Parameters</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >The UNO Executable</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Standalone Runtime Environment</text:h><text:p text:style-name="Paragraph" ><text:tab-stop ></text:tab-stop>The UNO executable and XMain</text:p><text:h text:style-name="Head 3" text:level="3" >Configuring the Java Runtime Environment</text:h><text:unordered-list text:style-name="L5" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P7" >The office and Java ((from UnoBindingJava))</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 1" text:level="1" >Advanced UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Design Patterns</text:h><text:h text:style-name="Head 2" text:level="2" >Bridging concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Requirements for Language Bindings and Bridges</text:h><text:h text:style-name="Head 3" text:level="3" >New Scripting Engines</text:h><text:h text:style-name="Head 2" text:level="2" >ServiceManager and loader</text:h><text:h text:style-name="Head 2" text:level="2" >Special Interfaces for internal use</text:h><text:p text:style-name="Paragraph" >XUNOTunnel</text:p><text:p text:style-name="Paragraph" >XAggregation</text:p><text:h text:style-name="Head 2" text:level="2" >UNO Reflection API</text:h><text:h text:style-name="Head 2" text:level="2" >TypeLibrary and TypeProviders</text:h><text:h text:style-name="Head 2" text:level="2" >Differences from Corba</text:h><text:h text:style-name="Head 1" text:level="1" >Office Development</text:h><text:h text:style-name="Head 2" text:level="2" >Global Object Structure</text:h><text:h text:style-name="Head 3" text:level="3" >Desktop Environment</text:h><text:h text:style-name="Head 3" text:level="3" >Frames and Frame Hierarchies</text:h><text:h text:style-name="Head 3" text:level="3" >Frame-Controller-Model Paradigm</text:h><text:h text:style-name="Head 3" text:level="3" >Loading and Saving Office Components</text:h><text:h text:style-name="Head 3" text:level="3" >Dispatch Framework</text:h><text:h text:style-name="Head 2" text:level="2" >Common Features</text:h><text:h text:style-name="Head 3" text:level="3" >Common Dialogs</text:h><text:h text:style-name="Head 3" text:level="3" >DocumentInfo</text:h><text:h text:style-name="Head 3" text:level="3" >Styles</text:h><text:h text:style-name="Head 3" text:level="3" >Search and Replace</text:h><text:h text:style-name="Head 3" text:level="3" >Number Formats</text:h><text:h text:style-name="Head 3" text:level="3" >Package File Formats</text:h><text:h text:style-name="Head 2" text:level="2" >Internationalization</text:h><text:h text:style-name="Head 2" text:level="2" >Linguistic</text:h><text:h text:style-name="Head 2" text:level="2" >System Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Clipboard</text:h><text:h text:style-name="Head 3" text:level="3" >File Picker</text:h><text:h text:style-name="Head 3" text:level="3" >Bridging to the Window System</text:h><text:p text:style-name="Paragraph" ></text:p><text:h text:style-name="Head 1" text:level="1" >Text Documents (51,5 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Text Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Text Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Using Text</text:h><text:h text:style-name="Head 3" text:level="3" >Tables</text:h><text:h text:style-name="Head 3" text:level="3" >Text Fields</text:h><text:h text:style-name="Head 3" text:level="3" >Bookmarks</text:h><text:h text:style-name="Head 3" text:level="3" >Indexes and Index Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Reference Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Footnotes and Endnotes</text:h><text:h text:style-name="Head 3" text:level="3" >Shape Objects in Text</text:h><text:h text:style-name="Head 3" text:level="3" >Redline</text:h><text:h text:style-name="Head 3" text:level="3" >Ruby</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Text Document</text:h><text:h text:style-name="Head 1" text:level="1" >Spreadsheet Documents</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Spreadsheet Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Spreadsheet Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Editing Spreadsheets</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Spreadsheet Document</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Spreadsheet Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Drawings and Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Draw/Impress Files</text:h><text:h text:style-name="Head 3" text:level="3" >Saving</text:h><text:h text:style-name="Head 3" text:level="3" >Printing</text:h><text:h text:style-name="Head 3" text:level="3" >Running Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Working with a Draw/Impress Document</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Draw/Impress Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Draw/Impress Document</text:h><text:h text:style-name="Head 1" text:level="1" >Charts</text:h><text:h text:style-name="Head 2" text:level="2" >Chart Basics</text:h><text:h text:style-name="Head 2" text:level="2" >Creating a Chart Document</text:h><text:h text:style-name="Head 2" text:level="2" >Editing a Chart Document</text:h><text:h text:style-name="Head 3" text:level="3" >Common Diagram API</text:h><text:h text:style-name="Head 3" text:level="3" >Different Chart Types</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Chart Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Basic and Dialogs</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:h text:style-name="Head 2" text:level="2" >Library Organization</text:h><text:h text:style-name="Head 2" text:level="2" >IDE with Dialogs and Events</text:h><text:h text:style-name="Head 2" text:level="2" >Using [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 2" text:level="2" >Toolkit Controls and their Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating Dialogs at Runtime</text:h><text:h text:style-name="Head 1" text:level="1" >Database Access</text:h><text:h text:style-name="Head 2" text:level="2" >Features of the [PRODUCTNAME] Database Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Capabilities</text:h><text:h text:style-name="Head 3" text:level="3" >SDBC, SDBCX, SDB Architecture</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Datasources with [PRODUCTNAME]</text:h><text:h text:style-name="Head 3" text:level="3" >DataSources</text:h><text:h text:style-name="Head 3" text:level="3" >Adding and Editing Datasources </text:h><text:h text:style-name="Head 3" text:level="3" >Establishing a Connection</text:h><text:h text:style-name="Head 4" text:level="4" >Getting Connections</text:h><text:h text:style-name="Head 4" text:level="4" >Driver specifics</text:h><text:h text:style-name="Head 3" text:level="3" >Connection Pooling</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Saved Queries</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Data</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Statements</text:h><text:h text:style-name="Head 3" text:level="3" >Resultsets</text:h><text:h text:style-name="Head 3" text:level="3" >Metadata</text:h><text:h text:style-name="Head 3" text:level="3" >Rowsets</text:h><text:h text:style-name="Head 2" text:level="2" >Working with the Database Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using DDL to change the DB Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using SDBCX to access the DB Design</text:h><text:h text:style-name="Head 2" text:level="2" >Using DBMS Features</text:h><text:h text:style-name="Head 3" text:level="3" >Stored Procedures</text:h><text:h text:style-name="Head 3" text:level="3" >Transaction Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Prepared Statements</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Database Drivers</text:h><text:h text:style-name="Head 1" text:level="1" >Forms</text:h><text:h text:style-name="Head 2" text:level="2" >Concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Models and Views</text:h><text:h text:style-name="Head 3" text:level="3" >Form Elements in the Document Model</text:h><text:h text:style-name="Head 3" text:level="3" >Special Form Components</text:h><text:h text:style-name="Head 3" text:level="3" >Events</text:h><text:h text:style-name="Head 3" text:level="3" >Data Awareness</text:h><text:h text:style-name="Head 2" text:level="2" >Recipes</text:h><text:h text:style-name="Head 3" text:level="3" >Making it easier to work with a Form</text:h><text:h text:style-name="Head 3" text:level="3" >Controlling the Data Input</text:h><text:h text:style-name="Head 3" text:level="3" >Collecting Data automatically</text:h><text:h text:style-name="Head 3" text:level="3" >Taking Advantage of Database Server Features</text:h><text:h text:style-name="Head 3" text:level="3" >Adding new Functionality</text:h><text:h text:style-name="Head 3" text:level="3" >Handling Errors</text:h><text:h text:style-name="Head 1" text:level="1" >UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Purpose of UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Document Contents as Streams</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Content Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating, Moving and Copying Document and Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Additional Commands</text:h><text:h text:style-name="Head 2" text:level="2" >Writing a Content Provider</text:h><text:h text:style-name="Head 1" text:level="1" >[PRODUCTNAME] Configuration</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing configuration data</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Configuration Data</text:h><text:h text:style-name="Head 1" text:level="1" >Appendix</text:h></office:body> + +<office:body ><text:sequence-decls ><text:sequence-decl text:display-outline-level="0" text:name="Illustration" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Table" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Text" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Drawing" ></text:sequence-decl></text:sequence-decls><text:p text:style-name="P1" >Programmer's Manual</text:p><text:p text:style-name="P2" >Planned Outline</text:p><text:p text:style-name="P2" ></text:p><text:h text:style-name="Head 1" text:level="1" >Preface (3 Pages)</text:h><text:h text:style-name="Head 1" text:level="1" >First Steps (24 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Programming with UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Fields of Application for UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Getting Started</text:h><text:h text:style-name="Head 3" text:level="3" >Required Files</text:h><text:h text:style-name="Head 3" text:level="3" >Configuration</text:h><text:h text:style-name="Head 3" text:level="3" >First Connection</text:h><text:h text:style-name="Head 2" text:level="2" >How to get Objects in [PRODUCTNAME]</text:h><text:h text:style-name="Head 2" text:level="2" >How to work with Objects</text:h><text:p text:style-name="Paragraph" >Example</text:p><text:h text:style-name="Head 3" text:level="3" >Services</text:h><text:h text:style-name="Head 3" text:level="3" >Querying Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >ElementAccess</text:h><text:h text:style-name="Head 3" text:level="3" >Simple Types</text:h><text:h text:style-name="Head 3" text:level="3" >Strings</text:h><text:h text:style-name="Head 3" text:level="3" >Enums and Constant Groups</text:h><text:h text:style-name="Head 3" text:level="3" >Structs</text:h><text:h text:style-name="Head 3" text:level="3" >Any</text:h><text:h text:style-name="Head 3" text:level="3" >Sequence</text:h><text:h text:style-name="Head 2" text:level="2" >How to find the solution for a problem</text:h><text:h text:style-name="Head 2" text:level="2" >Finding your Way through the API Reference</text:h><text:h text:style-name="Head 2" text:level="2" >Common Mechanisms</text:h><text:h text:style-name="Head 3" text:level="3" >Text</text:h><text:h text:style-name="Head 3" text:level="3" >Table</text:h><text:h text:style-name="Head 3" text:level="3" >Drawing</text:h><text:h text:style-name="Head 1" text:level="1" >UNO in Professional Projects (<text:span text:style-name="T1" >145</text:span>)</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:p text:style-name="Paragraph" >UNO/API constituents: How UNOIDL/API, ServiceManager, Bridges, CoreReflection work together</text:p><text:h text:style-name="Head 2" text:level="2" >API Concepts</text:h><text:p text:style-name="Paragraph" >API is a language independent, abstract specification for UNO objects which are used in <text:s ></text:s>[PRODUCTNAME]</text:p><text:h text:style-name="Head 3" text:level="3" >Types in the API Reference</text:h><text:h text:style-name="Head 4" text:level="4" >Simple Types</text:h><text:h text:style-name="Head 4" text:level="4" >The Any Type</text:h><text:h text:style-name="Head 4" text:level="4" >Interfaces</text:h><text:h text:style-name="Head 4" text:level="4" >Services</text:h><text:h text:style-name="Head 4" text:level="4" >Modules</text:h><text:h text:style-name="Head 4" text:level="4" >Structs</text:h><text:h text:style-name="Head 4" text:level="4" >Constant Groups and Enums</text:h><text:h text:style-name="Head 4" text:level="4" >Sequences</text:h><text:h text:style-name="Head 4" text:level="4" >Exceptions</text:h><text:h text:style-name="Head 3" text:level="3" >API Principles</text:h><text:h text:style-name="Head 4" text:level="4" >Relationship between Specification, Implementation and Instances</text:h><text:h text:style-name="Head 4" text:level="4" >Object Composition</text:h><text:h text:style-name="Head 2" text:level="2" >UNO Concepts</text:h><text:p text:style-name="Paragraph" >UNO is an environment for networked object communication</text:p><text:h text:style-name="Head 3" text:level="3" >Interprocess Connections</text:h><text:h text:style-name="Head 3" text:level="3" >ServiceManager and ComponentContext</text:h><text:h text:style-name="Head 3" text:level="3" >Using UNO Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >Using Collections and Containers</text:h><text:h text:style-name="Head 3" text:level="3" >Event Model</text:h><text:h text:style-name="Head 3" text:level="3" >Exception Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Lifetime Control</text:h><text:h text:style-name="Head 3" text:level="3" >Object Identity</text:h><text:h text:style-name="Head 2" text:level="2" >Language Bindings</text:h><text:h text:style-name="Head 3" text:level="3" >Introduction for language binding</text:h><text:h text:style-name="Head 3" text:level="3" >Java Language Binding</text:h><text:h text:style-name="Head 3" text:level="3" >C++ Binding</text:h><text:h text:style-name="Head 3" text:level="3" >Access for [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 3" text:level="3" >Automation</text:h><text:h text:style-name="Head 1" text:level="1" >Writing UNO components</text:h><text:h text:style-name="Head 2" text:level="2" >Specifying a new Component</text:h><text:h text:style-name="Head 3" text:level="3" >UNOIDL language specification</text:h><text:h text:style-name="Head 2" text:level="2" >Implementing a Component</text:h><text:h text:style-name="Head 3" text:level="3" >Component Development Basics</text:h><text:unordered-list text:style-name="L1" ><text:list-item ><text:p text:style-name="P3" >Introduction</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >Mandatory interfaces: XInterface, XServiceInfo ((from UseInterfaces.CoreInterfaces))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >"Should be implemented" interfaces: XTypeProvider ((from UseInterfaces.CoreInterfaces ))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >optional interface: XMain for standalone execution</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Simple Component in Java</text:h><text:unordered-list text:style-name="L2" ><text:list-item ><text:p text:style-name="P4" >Getting the service manager ((Chapter Java components from unoBindingJava))</text:p></text:list-item><text:list-item ><text:p text:style-name="P4" >simple component chapter</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >C++ Component</text:h><text:h text:style-name="Head 3" text:level="3" >((Automation Component?))</text:h><text:h text:style-name="Head 2" text:level="2" >Deployment Options for Components</text:h><text:h text:style-name="Head 3" text:level="3" >Component Registration</text:h><text:h text:style-name="Head 3" text:level="3" >Service Manager Configuration</text:h><text:unordered-list text:style-name="L3" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P5" >XSet Interface</text:p><text:p text:style-name="P5" >Adding components during runtime, particularly interesting during development</text:p></text:list-item><text:list-item ><text:p text:style-name="P5" >ServiceManager Content</text:p><text:p text:style-name="P5" >Dynamically modifying the ServiceManager</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Bootstrapping the Service Manager ((from CppBind chapter))</text:h><text:unordered-list text:style-name="L4" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P6" >Simple Test Application</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >Configuring Your Application with Bootstrap Parameters</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >The UNO Executable</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Standalone Runtime Environment</text:h><text:p text:style-name="Paragraph" ><text:tab-stop ></text:tab-stop>The UNO executable and XMain</text:p><text:h text:style-name="Head 3" text:level="3" >Configuring the Java Runtime Environment</text:h><text:unordered-list text:style-name="L5" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P7" >The office and Java ((from UnoBindingJava))</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 1" text:level="1" >Advanced UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Design Patterns</text:h><text:h text:style-name="Head 2" text:level="2" >Bridging concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Requirements for Language Bindings and Bridges</text:h><text:h text:style-name="Head 3" text:level="3" >New Scripting Engines</text:h><text:h text:style-name="Head 2" text:level="2" >ServiceManager and loader</text:h><text:h text:style-name="Head 2" text:level="2" >Special Interfaces for internal use</text:h><text:p text:style-name="Paragraph" >XUNOTunnel</text:p><text:p text:style-name="Paragraph" >XAggregation</text:p><text:h text:style-name="Head 2" text:level="2" >UNO Reflection API</text:h><text:h text:style-name="Head 2" text:level="2" >TypeLibrary and TypeProviders</text:h><text:h text:style-name="Head 2" text:level="2" >Differences from Corba</text:h><text:h text:style-name="Head 1" text:level="1" >Office Development</text:h><text:h text:style-name="Head 2" text:level="2" >Global Object Structure</text:h><text:h text:style-name="Head 3" text:level="3" >Desktop Environment</text:h><text:h text:style-name="Head 3" text:level="3" >Frames and Frame Hierarchies</text:h><text:h text:style-name="Head 3" text:level="3" >Frame-Controller-Model Paradigm</text:h><text:h text:style-name="Head 3" text:level="3" >Loading and Saving Office Components</text:h><text:h text:style-name="Head 3" text:level="3" >Dispatch Framework</text:h><text:h text:style-name="Head 2" text:level="2" >Common Features</text:h><text:h text:style-name="Head 3" text:level="3" >Common Dialogs</text:h><text:h text:style-name="Head 3" text:level="3" >DocumentInfo</text:h><text:h text:style-name="Head 3" text:level="3" >Styles</text:h><text:h text:style-name="Head 3" text:level="3" >Search and Replace</text:h><text:h text:style-name="Head 3" text:level="3" >Number Formats</text:h><text:h text:style-name="Head 3" text:level="3" >Package File Formats</text:h><text:h text:style-name="Head 2" text:level="2" >Internationalization</text:h><text:h text:style-name="Head 2" text:level="2" >Linguistic</text:h><text:h text:style-name="Head 2" text:level="2" >System Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Clipboard</text:h><text:h text:style-name="Head 3" text:level="3" >File Picker</text:h><text:h text:style-name="Head 3" text:level="3" >Bridging to the Window System</text:h><text:p text:style-name="Paragraph" ></text:p><text:h text:style-name="Head 1" text:level="1" >Text Documents (51,5 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Text Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Text Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Using Text</text:h><text:h text:style-name="Head 3" text:level="3" >Tables</text:h><text:h text:style-name="Head 3" text:level="3" >Text Fields</text:h><text:h text:style-name="Head 3" text:level="3" >Bookmarks</text:h><text:h text:style-name="Head 3" text:level="3" >Indexes and Index Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Reference Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Footnotes and Endnotes</text:h><text:h text:style-name="Head 3" text:level="3" >Shape Objects in Text</text:h><text:h text:style-name="Head 3" text:level="3" >Redline</text:h><text:h text:style-name="Head 3" text:level="3" >Ruby</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Text Document</text:h><text:h text:style-name="Head 1" text:level="1" >Spreadsheet Documents</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Spreadsheet Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Spreadsheet Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Editing Spreadsheets</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Spreadsheet Document</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Spreadsheet Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Drawings and Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Draw/Impress Files</text:h><text:h text:style-name="Head 3" text:level="3" >Saving</text:h><text:h text:style-name="Head 3" text:level="3" >Printing</text:h><text:h text:style-name="Head 3" text:level="3" >Running Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Working with a Draw/Impress Document</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Draw/Impress Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Draw/Impress Document</text:h><text:h text:style-name="Head 1" text:level="1" >Charts</text:h><text:h text:style-name="Head 2" text:level="2" >Chart Basics</text:h><text:h text:style-name="Head 2" text:level="2" >Creating a Chart Document</text:h><text:h text:style-name="Head 2" text:level="2" >Editing a Chart Document</text:h><text:h text:style-name="Head 3" text:level="3" >Common Diagram API</text:h><text:h text:style-name="Head 3" text:level="3" >Different Chart Types</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Chart Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Basic and Dialogs</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:h text:style-name="Head 2" text:level="2" >Library Organization</text:h><text:h text:style-name="Head 2" text:level="2" >IDE with Dialogs and Events</text:h><text:h text:style-name="Head 2" text:level="2" >Using [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 2" text:level="2" >Toolkit Controls and their Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating Dialogs at Runtime</text:h><text:h text:style-name="Head 1" text:level="1" >Database Access</text:h><text:h text:style-name="Head 2" text:level="2" >Features of the [PRODUCTNAME] Database Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Capabilities</text:h><text:h text:style-name="Head 3" text:level="3" >SDBC, SDBCX, SDB Architecture</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Datasources with [PRODUCTNAME]</text:h><text:h text:style-name="Head 3" text:level="3" >DataSources</text:h><text:h text:style-name="Head 3" text:level="3" >Adding and Editing Datasources </text:h><text:h text:style-name="Head 3" text:level="3" >Establishing a Connection</text:h><text:h text:style-name="Head 4" text:level="4" >Getting Connections</text:h><text:h text:style-name="Head 4" text:level="4" >Driver specifics</text:h><text:h text:style-name="Head 3" text:level="3" >Connection Pooling</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Saved Queries</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Data</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Statements</text:h><text:h text:style-name="Head 3" text:level="3" >Resultsets</text:h><text:h text:style-name="Head 3" text:level="3" >Metadata</text:h><text:h text:style-name="Head 3" text:level="3" >Rowsets</text:h><text:h text:style-name="Head 2" text:level="2" >Working with the Database Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using DDL to change the DB Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using SDBCX to access the DB Design</text:h><text:h text:style-name="Head 2" text:level="2" >Using DBMS Features</text:h><text:h text:style-name="Head 3" text:level="3" >Stored Procedures</text:h><text:h text:style-name="Head 3" text:level="3" >Transaction Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Prepared Statements</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Database Drivers</text:h><text:h text:style-name="Head 1" text:level="1" >Forms</text:h><text:h text:style-name="Head 2" text:level="2" >Concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Models and Views</text:h><text:h text:style-name="Head 3" text:level="3" >Form Elements in the Document Model</text:h><text:h text:style-name="Head 3" text:level="3" >Special Form Components</text:h><text:h text:style-name="Head 3" text:level="3" >Events</text:h><text:h text:style-name="Head 3" text:level="3" >Data Awareness</text:h><text:h text:style-name="Head 2" text:level="2" >Recipes</text:h><text:h text:style-name="Head 3" text:level="3" >Making it easier to work with a Form</text:h><text:h text:style-name="Head 3" text:level="3" >Controlling the Data Input</text:h><text:h text:style-name="Head 3" text:level="3" >Collecting Data automatically</text:h><text:h text:style-name="Head 3" text:level="3" >Taking Advantage of Database Server Features</text:h><text:h text:style-name="Head 3" text:level="3" >Adding new Functionality</text:h><text:h text:style-name="Head 3" text:level="3" >Handling Errors</text:h><text:h text:style-name="Head 1" text:level="1" >UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Purpose of UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Document Contents as Streams</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Content Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating, Moving and Copying Document and Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Additional Commands</text:h><text:h text:style-name="Head 2" text:level="2" >Writing a Content Provider</text:h><text:h text:style-name="Head 1" text:level="1" >[PRODUCTNAME] Configuration</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing configuration data</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Configuration Data</text:h><text:h text:style-name="Head 1" text:level="1" >Appendix</text:h></office:body> + +<office:body ><text:sequence-decls ><text:sequence-decl text:display-outline-level="0" text:name="Illustration" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Table" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Text" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Drawing" ></text:sequence-decl></text:sequence-decls><text:p text:style-name="P1" >Programmer's Manual</text:p><text:p text:style-name="P2" >Planned Outline</text:p><text:p text:style-name="P2" ></text:p><text:h text:style-name="Head 1" text:level="1" >Preface (3 Pages)</text:h><text:h text:style-name="Head 1" text:level="1" >First Steps (24 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Programming with UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Fields of Application for UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Getting Started</text:h><text:h text:style-name="Head 3" text:level="3" >Required Files</text:h><text:h text:style-name="Head 3" text:level="3" >Configuration</text:h><text:h text:style-name="Head 3" text:level="3" >First Connection</text:h><text:h text:style-name="Head 2" text:level="2" >How to get Objects in [PRODUCTNAME]</text:h><text:h text:style-name="Head 2" text:level="2" >How to work with Objects</text:h><text:p text:style-name="Paragraph" >Example</text:p><text:h text:style-name="Head 3" text:level="3" >Services</text:h><text:h text:style-name="Head 3" text:level="3" >Querying Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >ElementAccess</text:h><text:h text:style-name="Head 3" text:level="3" >Simple Types</text:h><text:h text:style-name="Head 3" text:level="3" >Strings</text:h><text:h text:style-name="Head 3" text:level="3" >Enums and Constant Groups</text:h><text:h text:style-name="Head 3" text:level="3" >Structs</text:h><text:h text:style-name="Head 3" text:level="3" >Any</text:h><text:h text:style-name="Head 3" text:level="3" >Sequence</text:h><text:h text:style-name="Head 2" text:level="2" >How to find the solution for a problem</text:h><text:h text:style-name="Head 2" text:level="2" >Finding your Way through the API Reference</text:h><text:h text:style-name="Head 2" text:level="2" >Common Mechanisms</text:h><text:h text:style-name="Head 3" text:level="3" >Text</text:h><text:h text:style-name="Head 3" text:level="3" >Table</text:h><text:h text:style-name="Head 3" text:level="3" >Drawing</text:h><text:h text:style-name="Head 1" text:level="1" >UNO in Professional Projects (<text:span text:style-name="T1" >145</text:span>)</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:p text:style-name="Paragraph" >UNO/API constituents: How UNOIDL/API, ServiceManager, Bridges, CoreReflection work together</text:p><text:h text:style-name="Head 2" text:level="2" >API Concepts</text:h><text:p text:style-name="Paragraph" >API is a language independent, abstract specification for UNO objects which are used in <text:s ></text:s>[PRODUCTNAME]</text:p><text:h text:style-name="Head 3" text:level="3" >Types in the API Reference</text:h><text:h text:style-name="Head 4" text:level="4" >Simple Types</text:h><text:h text:style-name="Head 4" text:level="4" >The Any Type</text:h><text:h text:style-name="Head 4" text:level="4" >Interfaces</text:h><text:h text:style-name="Head 4" text:level="4" >Services</text:h><text:h text:style-name="Head 4" text:level="4" >Modules</text:h><text:h text:style-name="Head 4" text:level="4" >Structs</text:h><text:h text:style-name="Head 4" text:level="4" >Constant Groups and Enums</text:h><text:h text:style-name="Head 4" text:level="4" >Sequences</text:h><text:h text:style-name="Head 4" text:level="4" >Exceptions</text:h><text:h text:style-name="Head 3" text:level="3" >API Principles</text:h><text:h text:style-name="Head 4" text:level="4" >Relationship between Specification, Implementation and Instances</text:h><text:h text:style-name="Head 4" text:level="4" >Object Composition</text:h><text:h text:style-name="Head 2" text:level="2" >UNO Concepts</text:h><text:p text:style-name="Paragraph" >UNO is an environment for networked object communication</text:p><text:h text:style-name="Head 3" text:level="3" >Interprocess Connections</text:h><text:h text:style-name="Head 3" text:level="3" >ServiceManager and ComponentContext</text:h><text:h text:style-name="Head 3" text:level="3" >Using UNO Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >Using Collections and Containers</text:h><text:h text:style-name="Head 3" text:level="3" >Event Model</text:h><text:h text:style-name="Head 3" text:level="3" >Exception Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Lifetime Control</text:h><text:h text:style-name="Head 3" text:level="3" >Object Identity</text:h><text:h text:style-name="Head 2" text:level="2" >Language Bindings</text:h><text:h text:style-name="Head 3" text:level="3" >Introduction for language binding</text:h><text:h text:style-name="Head 3" text:level="3" >Java Language Binding</text:h><text:h text:style-name="Head 3" text:level="3" >C++ Binding</text:h><text:h text:style-name="Head 3" text:level="3" >Access for [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 3" text:level="3" >Automation</text:h><text:h text:style-name="Head 1" text:level="1" >Writing UNO components</text:h><text:h text:style-name="Head 2" text:level="2" >Specifying a new Component</text:h><text:h text:style-name="Head 3" text:level="3" >UNOIDL language specification</text:h><text:h text:style-name="Head 2" text:level="2" >Implementing a Component</text:h><text:h text:style-name="Head 3" text:level="3" >Component Development Basics</text:h><text:unordered-list text:style-name="L1" ><text:list-item ><text:p text:style-name="P3" >Introduction</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >Mandatory interfaces: XInterface, XServiceInfo ((from UseInterfaces.CoreInterfaces))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >"Should be implemented" interfaces: XTypeProvider ((from UseInterfaces.CoreInterfaces ))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >optional interface: XMain for standalone execution</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Simple Component in Java</text:h><text:unordered-list text:style-name="L2" ><text:list-item ><text:p text:style-name="P4" >Getting the service manager ((Chapter Java components from unoBindingJava))</text:p></text:list-item><text:list-item ><text:p text:style-name="P4" >simple component chapter</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >C++ Component</text:h><text:h text:style-name="Head 3" text:level="3" >((Automation Component?))</text:h><text:h text:style-name="Head 2" text:level="2" >Deployment Options for Components</text:h><text:h text:style-name="Head 3" text:level="3" >Component Registration</text:h><text:h text:style-name="Head 3" text:level="3" >Service Manager Configuration</text:h><text:unordered-list text:style-name="L3" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P5" >XSet Interface</text:p><text:p text:style-name="P5" >Adding components during runtime, particularly interesting during development</text:p></text:list-item><text:list-item ><text:p text:style-name="P5" >ServiceManager Content</text:p><text:p text:style-name="P5" >Dynamically modifying the ServiceManager</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Bootstrapping the Service Manager ((from CppBind chapter))</text:h><text:unordered-list text:style-name="L4" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P6" >Simple Test Application</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >Configuring Your Application with Bootstrap Parameters</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >The UNO Executable</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Standalone Runtime Environment</text:h><text:p text:style-name="Paragraph" ><text:tab-stop ></text:tab-stop>The UNO executable and XMain</text:p><text:h text:style-name="Head 3" text:level="3" >Configuring the Java Runtime Environment</text:h><text:unordered-list text:style-name="L5" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P7" >The office and Java ((from UnoBindingJava))</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 1" text:level="1" >Advanced UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Design Patterns</text:h><text:h text:style-name="Head 2" text:level="2" >Bridging concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Requirements for Language Bindings and Bridges</text:h><text:h text:style-name="Head 3" text:level="3" >New Scripting Engines</text:h><text:h text:style-name="Head 2" text:level="2" >ServiceManager and loader</text:h><text:h text:style-name="Head 2" text:level="2" >Special Interfaces for internal use</text:h><text:p text:style-name="Paragraph" >XUNOTunnel</text:p><text:p text:style-name="Paragraph" >XAggregation</text:p><text:h text:style-name="Head 2" text:level="2" >UNO Reflection API</text:h><text:h text:style-name="Head 2" text:level="2" >TypeLibrary and TypeProviders</text:h><text:h text:style-name="Head 2" text:level="2" >Differences from Corba</text:h><text:h text:style-name="Head 1" text:level="1" >Office Development</text:h><text:h text:style-name="Head 2" text:level="2" >Global Object Structure</text:h><text:h text:style-name="Head 3" text:level="3" >Desktop Environment</text:h><text:h text:style-name="Head 3" text:level="3" >Frames and Frame Hierarchies</text:h><text:h text:style-name="Head 3" text:level="3" >Frame-Controller-Model Paradigm</text:h><text:h text:style-name="Head 3" text:level="3" >Loading and Saving Office Components</text:h><text:h text:style-name="Head 3" text:level="3" >Dispatch Framework</text:h><text:h text:style-name="Head 2" text:level="2" >Common Features</text:h><text:h text:style-name="Head 3" text:level="3" >Common Dialogs</text:h><text:h text:style-name="Head 3" text:level="3" >DocumentInfo</text:h><text:h text:style-name="Head 3" text:level="3" >Styles</text:h><text:h text:style-name="Head 3" text:level="3" >Search and Replace</text:h><text:h text:style-name="Head 3" text:level="3" >Number Formats</text:h><text:h text:style-name="Head 3" text:level="3" >Package File Formats</text:h><text:h text:style-name="Head 2" text:level="2" >Internationalization</text:h><text:h text:style-name="Head 2" text:level="2" >Linguistic</text:h><text:h text:style-name="Head 2" text:level="2" >System Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Clipboard</text:h><text:h text:style-name="Head 3" text:level="3" >File Picker</text:h><text:h text:style-name="Head 3" text:level="3" >Bridging to the Window System</text:h><text:p text:style-name="Paragraph" ></text:p><text:h text:style-name="Head 1" text:level="1" >Text Documents (51,5 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Text Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Text Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Using Text</text:h><text:h text:style-name="Head 3" text:level="3" >Tables</text:h><text:h text:style-name="Head 3" text:level="3" >Text Fields</text:h><text:h text:style-name="Head 3" text:level="3" >Bookmarks</text:h><text:h text:style-name="Head 3" text:level="3" >Indexes and Index Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Reference Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Footnotes and Endnotes</text:h><text:h text:style-name="Head 3" text:level="3" >Shape Objects in Text</text:h><text:h text:style-name="Head 3" text:level="3" >Redline</text:h><text:h text:style-name="Head 3" text:level="3" >Ruby</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Text Document</text:h><text:h text:style-name="Head 1" text:level="1" >Spreadsheet Documents</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Spreadsheet Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Spreadsheet Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Editing Spreadsheets</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Spreadsheet Document</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Spreadsheet Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Drawings and Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Draw/Impress Files</text:h><text:h text:style-name="Head 3" text:level="3" >Saving</text:h><text:h text:style-name="Head 3" text:level="3" >Printing</text:h><text:h text:style-name="Head 3" text:level="3" >Running Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Working with a Draw/Impress Document</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Draw/Impress Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Draw/Impress Document</text:h><text:h text:style-name="Head 1" text:level="1" >Charts</text:h><text:h text:style-name="Head 2" text:level="2" >Chart Basics</text:h><text:h text:style-name="Head 2" text:level="2" >Creating a Chart Document</text:h><text:h text:style-name="Head 2" text:level="2" >Editing a Chart Document</text:h><text:h text:style-name="Head 3" text:level="3" >Common Diagram API</text:h><text:h text:style-name="Head 3" text:level="3" >Different Chart Types</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Chart Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Basic and Dialogs</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:h text:style-name="Head 2" text:level="2" >Library Organization</text:h><text:h text:style-name="Head 2" text:level="2" >IDE with Dialogs and Events</text:h><text:h text:style-name="Head 2" text:level="2" >Using [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 2" text:level="2" >Toolkit Controls and their Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating Dialogs at Runtime</text:h><text:h text:style-name="Head 1" text:level="1" >Database Access</text:h><text:h text:style-name="Head 2" text:level="2" >Features of the [PRODUCTNAME] Database Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Capabilities</text:h><text:h text:style-name="Head 3" text:level="3" >SDBC, SDBCX, SDB Architecture</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Datasources with [PRODUCTNAME]</text:h><text:h text:style-name="Head 3" text:level="3" >DataSources</text:h><text:h text:style-name="Head 3" text:level="3" >Adding and Editing Datasources </text:h><text:h text:style-name="Head 3" text:level="3" >Establishing a Connection</text:h><text:h text:style-name="Head 4" text:level="4" >Getting Connections</text:h><text:h text:style-name="Head 4" text:level="4" >Driver specifics</text:h><text:h text:style-name="Head 3" text:level="3" >Connection Pooling</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Saved Queries</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Data</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Statements</text:h><text:h text:style-name="Head 3" text:level="3" >Resultsets</text:h><text:h text:style-name="Head 3" text:level="3" >Metadata</text:h><text:h text:style-name="Head 3" text:level="3" >Rowsets</text:h><text:h text:style-name="Head 2" text:level="2" >Working with the Database Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using DDL to change the DB Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using SDBCX to access the DB Design</text:h><text:h text:style-name="Head 2" text:level="2" >Using DBMS Features</text:h><text:h text:style-name="Head 3" text:level="3" >Stored Procedures</text:h><text:h text:style-name="Head 3" text:level="3" >Transaction Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Prepared Statements</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Database Drivers</text:h><text:h text:style-name="Head 1" text:level="1" >Forms</text:h><text:h text:style-name="Head 2" text:level="2" >Concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Models and Views</text:h><text:h text:style-name="Head 3" text:level="3" >Form Elements in the Document Model</text:h><text:h text:style-name="Head 3" text:level="3" >Special Form Components</text:h><text:h text:style-name="Head 3" text:level="3" >Events</text:h><text:h text:style-name="Head 3" text:level="3" >Data Awareness</text:h><text:h text:style-name="Head 2" text:level="2" >Recipes</text:h><text:h text:style-name="Head 3" text:level="3" >Making it easier to work with a Form</text:h><text:h text:style-name="Head 3" text:level="3" >Controlling the Data Input</text:h><text:h text:style-name="Head 3" text:level="3" >Collecting Data automatically</text:h><text:h text:style-name="Head 3" text:level="3" >Taking Advantage of Database Server Features</text:h><text:h text:style-name="Head 3" text:level="3" >Adding new Functionality</text:h><text:h text:style-name="Head 3" text:level="3" >Handling Errors</text:h><text:h text:style-name="Head 1" text:level="1" >UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Purpose of UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Document Contents as Streams</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Content Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating, Moving and Copying Document and Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Additional Commands</text:h><text:h text:style-name="Head 2" text:level="2" >Writing a Content Provider</text:h><text:h text:style-name="Head 1" text:level="1" >[PRODUCTNAME] Configuration</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing configuration data</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Configuration Data</text:h><text:h text:style-name="Head 1" text:level="1" >Appendix</text:h></office:body> + +<office:body ><text:sequence-decls ><text:sequence-decl text:display-outline-level="0" text:name="Illustration" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Table" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Text" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Drawing" ></text:sequence-decl></text:sequence-decls><text:p text:style-name="P1" >Programmer's Manual</text:p><text:p text:style-name="P2" >Planned Outline</text:p><text:p text:style-name="P2" ></text:p><text:h text:style-name="Head 1" text:level="1" >Preface (3 Pages)</text:h><text:h text:style-name="Head 1" text:level="1" >First Steps (24 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Programming with UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Fields of Application for UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Getting Started</text:h><text:h text:style-name="Head 3" text:level="3" >Required Files</text:h><text:h text:style-name="Head 3" text:level="3" >Configuration</text:h><text:h text:style-name="Head 3" text:level="3" >First Connection</text:h><text:h text:style-name="Head 2" text:level="2" >How to get Objects in [PRODUCTNAME]</text:h><text:h text:style-name="Head 2" text:level="2" >How to work with Objects</text:h><text:p text:style-name="Paragraph" >Example</text:p><text:h text:style-name="Head 3" text:level="3" >Services</text:h><text:h text:style-name="Head 3" text:level="3" >Querying Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >ElementAccess</text:h><text:h text:style-name="Head 3" text:level="3" >Simple Types</text:h><text:h text:style-name="Head 3" text:level="3" >Strings</text:h><text:h text:style-name="Head 3" text:level="3" >Enums and Constant Groups</text:h><text:h text:style-name="Head 3" text:level="3" >Structs</text:h><text:h text:style-name="Head 3" text:level="3" >Any</text:h><text:h text:style-name="Head 3" text:level="3" >Sequence</text:h><text:h text:style-name="Head 2" text:level="2" >How to find the solution for a problem</text:h><text:h text:style-name="Head 2" text:level="2" >Finding your Way through the API Reference</text:h><text:h text:style-name="Head 2" text:level="2" >Common Mechanisms</text:h><text:h text:style-name="Head 3" text:level="3" >Text</text:h><text:h text:style-name="Head 3" text:level="3" >Table</text:h><text:h text:style-name="Head 3" text:level="3" >Drawing</text:h><text:h text:style-name="Head 1" text:level="1" >UNO in Professional Projects (<text:span text:style-name="T1" >145</text:span>)</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:p text:style-name="Paragraph" >UNO/API constituents: How UNOIDL/API, ServiceManager, Bridges, CoreReflection work together</text:p><text:h text:style-name="Head 2" text:level="2" >API Concepts</text:h><text:p text:style-name="Paragraph" >API is a language independent, abstract specification for UNO objects which are used in <text:s ></text:s>[PRODUCTNAME]</text:p><text:h text:style-name="Head 3" text:level="3" >Types in the API Reference</text:h><text:h text:style-name="Head 4" text:level="4" >Simple Types</text:h><text:h text:style-name="Head 4" text:level="4" >The Any Type</text:h><text:h text:style-name="Head 4" text:level="4" >Interfaces</text:h><text:h text:style-name="Head 4" text:level="4" >Services</text:h><text:h text:style-name="Head 4" text:level="4" >Modules</text:h><text:h text:style-name="Head 4" text:level="4" >Structs</text:h><text:h text:style-name="Head 4" text:level="4" >Constant Groups and Enums</text:h><text:h text:style-name="Head 4" text:level="4" >Sequences</text:h><text:h text:style-name="Head 4" text:level="4" >Exceptions</text:h><text:h text:style-name="Head 3" text:level="3" >API Principles</text:h><text:h text:style-name="Head 4" text:level="4" >Relationship between Specification, Implementation and Instances</text:h><text:h text:style-name="Head 4" text:level="4" >Object Composition</text:h><text:h text:style-name="Head 2" text:level="2" >UNO Concepts</text:h><text:p text:style-name="Paragraph" >UNO is an environment for networked object communication</text:p><text:h text:style-name="Head 3" text:level="3" >Interprocess Connections</text:h><text:h text:style-name="Head 3" text:level="3" >ServiceManager and ComponentContext</text:h><text:h text:style-name="Head 3" text:level="3" >Using UNO Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >Using Collections and Containers</text:h><text:h text:style-name="Head 3" text:level="3" >Event Model</text:h><text:h text:style-name="Head 3" text:level="3" >Exception Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Lifetime Control</text:h><text:h text:style-name="Head 3" text:level="3" >Object Identity</text:h><text:h text:style-name="Head 2" text:level="2" >Language Bindings</text:h><text:h text:style-name="Head 3" text:level="3" >Introduction for language binding</text:h><text:h text:style-name="Head 3" text:level="3" >Java Language Binding</text:h><text:h text:style-name="Head 3" text:level="3" >C++ Binding</text:h><text:h text:style-name="Head 3" text:level="3" >Access for [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 3" text:level="3" >Automation</text:h><text:h text:style-name="Head 1" text:level="1" >Writing UNO components</text:h><text:h text:style-name="Head 2" text:level="2" >Specifying a new Component</text:h><text:h text:style-name="Head 3" text:level="3" >UNOIDL language specification</text:h><text:h text:style-name="Head 2" text:level="2" >Implementing a Component</text:h><text:h text:style-name="Head 3" text:level="3" >Component Development Basics</text:h><text:unordered-list text:style-name="L1" ><text:list-item ><text:p text:style-name="P3" >Introduction</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >Mandatory interfaces: XInterface, XServiceInfo ((from UseInterfaces.CoreInterfaces))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >"Should be implemented" interfaces: XTypeProvider ((from UseInterfaces.CoreInterfaces ))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >optional interface: XMain for standalone execution</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Simple Component in Java</text:h><text:unordered-list text:style-name="L2" ><text:list-item ><text:p text:style-name="P4" >Getting the service manager ((Chapter Java components from unoBindingJava))</text:p></text:list-item><text:list-item ><text:p text:style-name="P4" >simple component chapter</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >C++ Component</text:h><text:h text:style-name="Head 3" text:level="3" >((Automation Component?))</text:h><text:h text:style-name="Head 2" text:level="2" >Deployment Options for Components</text:h><text:h text:style-name="Head 3" text:level="3" >Component Registration</text:h><text:h text:style-name="Head 3" text:level="3" >Service Manager Configuration</text:h><text:unordered-list text:style-name="L3" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P5" >XSet Interface</text:p><text:p text:style-name="P5" >Adding components during runtime, particularly interesting during development</text:p></text:list-item><text:list-item ><text:p text:style-name="P5" >ServiceManager Content</text:p><text:p text:style-name="P5" >Dynamically modifying the ServiceManager</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Bootstrapping the Service Manager ((from CppBind chapter))</text:h><text:unordered-list text:style-name="L4" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P6" >Simple Test Application</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >Configuring Your Application with Bootstrap Parameters</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >The UNO Executable</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Standalone Runtime Environment</text:h><text:p text:style-name="Paragraph" ><text:tab-stop ></text:tab-stop>The UNO executable and XMain</text:p><text:h text:style-name="Head 3" text:level="3" >Configuring the Java Runtime Environment</text:h><text:unordered-list text:style-name="L5" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P7" >The office and Java ((from UnoBindingJava))</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 1" text:level="1" >Advanced UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Design Patterns</text:h><text:h text:style-name="Head 2" text:level="2" >Bridging concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Requirements for Language Bindings and Bridges</text:h><text:h text:style-name="Head 3" text:level="3" >New Scripting Engines</text:h><text:h text:style-name="Head 2" text:level="2" >ServiceManager and loader</text:h><text:h text:style-name="Head 2" text:level="2" >Special Interfaces for internal use</text:h><text:p text:style-name="Paragraph" >XUNOTunnel</text:p><text:p text:style-name="Paragraph" >XAggregation</text:p><text:h text:style-name="Head 2" text:level="2" >UNO Reflection API</text:h><text:h text:style-name="Head 2" text:level="2" >TypeLibrary and TypeProviders</text:h><text:h text:style-name="Head 2" text:level="2" >Differences from Corba</text:h><text:h text:style-name="Head 1" text:level="1" >Office Development</text:h><text:h text:style-name="Head 2" text:level="2" >Global Object Structure</text:h><text:h text:style-name="Head 3" text:level="3" >Desktop Environment</text:h><text:h text:style-name="Head 3" text:level="3" >Frames and Frame Hierarchies</text:h><text:h text:style-name="Head 3" text:level="3" >Frame-Controller-Model Paradigm</text:h><text:h text:style-name="Head 3" text:level="3" >Loading and Saving Office Components</text:h><text:h text:style-name="Head 3" text:level="3" >Dispatch Framework</text:h><text:h text:style-name="Head 2" text:level="2" >Common Features</text:h><text:h text:style-name="Head 3" text:level="3" >Common Dialogs</text:h><text:h text:style-name="Head 3" text:level="3" >DocumentInfo</text:h><text:h text:style-name="Head 3" text:level="3" >Styles</text:h><text:h text:style-name="Head 3" text:level="3" >Search and Replace</text:h><text:h text:style-name="Head 3" text:level="3" >Number Formats</text:h><text:h text:style-name="Head 3" text:level="3" >Package File Formats</text:h><text:h text:style-name="Head 2" text:level="2" >Internationalization</text:h><text:h text:style-name="Head 2" text:level="2" >Linguistic</text:h><text:h text:style-name="Head 2" text:level="2" >System Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Clipboard</text:h><text:h text:style-name="Head 3" text:level="3" >File Picker</text:h><text:h text:style-name="Head 3" text:level="3" >Bridging to the Window System</text:h><text:p text:style-name="Paragraph" ></text:p><text:h text:style-name="Head 1" text:level="1" >Text Documents (51,5 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Text Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Text Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Using Text</text:h><text:h text:style-name="Head 3" text:level="3" >Tables</text:h><text:h text:style-name="Head 3" text:level="3" >Text Fields</text:h><text:h text:style-name="Head 3" text:level="3" >Bookmarks</text:h><text:h text:style-name="Head 3" text:level="3" >Indexes and Index Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Reference Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Footnotes and Endnotes</text:h><text:h text:style-name="Head 3" text:level="3" >Shape Objects in Text</text:h><text:h text:style-name="Head 3" text:level="3" >Redline</text:h><text:h text:style-name="Head 3" text:level="3" >Ruby</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Text Document</text:h><text:h text:style-name="Head 1" text:level="1" >Spreadsheet Documents</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Spreadsheet Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Spreadsheet Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Editing Spreadsheets</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Spreadsheet Document</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Spreadsheet Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Drawings and Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Draw/Impress Files</text:h><text:h text:style-name="Head 3" text:level="3" >Saving</text:h><text:h text:style-name="Head 3" text:level="3" >Printing</text:h><text:h text:style-name="Head 3" text:level="3" >Running Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Working with a Draw/Impress Document</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Draw/Impress Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Draw/Impress Document</text:h><text:h text:style-name="Head 1" text:level="1" >Charts</text:h><text:h text:style-name="Head 2" text:level="2" >Chart Basics</text:h><text:h text:style-name="Head 2" text:level="2" >Creating a Chart Document</text:h><text:h text:style-name="Head 2" text:level="2" >Editing a Chart Document</text:h><text:h text:style-name="Head 3" text:level="3" >Common Diagram API</text:h><text:h text:style-name="Head 3" text:level="3" >Different Chart Types</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Chart Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Basic and Dialogs</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:h text:style-name="Head 2" text:level="2" >Library Organization</text:h><text:h text:style-name="Head 2" text:level="2" >IDE with Dialogs and Events</text:h><text:h text:style-name="Head 2" text:level="2" >Using [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 2" text:level="2" >Toolkit Controls and their Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating Dialogs at Runtime</text:h><text:h text:style-name="Head 1" text:level="1" >Database Access</text:h><text:h text:style-name="Head 2" text:level="2" >Features of the [PRODUCTNAME] Database Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Capabilities</text:h><text:h text:style-name="Head 3" text:level="3" >SDBC, SDBCX, SDB Architecture</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Datasources with [PRODUCTNAME]</text:h><text:h text:style-name="Head 3" text:level="3" >DataSources</text:h><text:h text:style-name="Head 3" text:level="3" >Adding and Editing Datasources </text:h><text:h text:style-name="Head 3" text:level="3" >Establishing a Connection</text:h><text:h text:style-name="Head 4" text:level="4" >Getting Connections</text:h><text:h text:style-name="Head 4" text:level="4" >Driver specifics</text:h><text:h text:style-name="Head 3" text:level="3" >Connection Pooling</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Saved Queries</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Data</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Statements</text:h><text:h text:style-name="Head 3" text:level="3" >Resultsets</text:h><text:h text:style-name="Head 3" text:level="3" >Metadata</text:h><text:h text:style-name="Head 3" text:level="3" >Rowsets</text:h><text:h text:style-name="Head 2" text:level="2" >Working with the Database Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using DDL to change the DB Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using SDBCX to access the DB Design</text:h><text:h text:style-name="Head 2" text:level="2" >Using DBMS Features</text:h><text:h text:style-name="Head 3" text:level="3" >Stored Procedures</text:h><text:h text:style-name="Head 3" text:level="3" >Transaction Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Prepared Statements</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Database Drivers</text:h><text:h text:style-name="Head 1" text:level="1" >Forms</text:h><text:h text:style-name="Head 2" text:level="2" >Concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Models and Views</text:h><text:h text:style-name="Head 3" text:level="3" >Form Elements in the Document Model</text:h><text:h text:style-name="Head 3" text:level="3" >Special Form Components</text:h><text:h text:style-name="Head 3" text:level="3" >Events</text:h><text:h text:style-name="Head 3" text:level="3" >Data Awareness</text:h><text:h text:style-name="Head 2" text:level="2" >Recipes</text:h><text:h text:style-name="Head 3" text:level="3" >Making it easier to work with a Form</text:h><text:h text:style-name="Head 3" text:level="3" >Controlling the Data Input</text:h><text:h text:style-name="Head 3" text:level="3" >Collecting Data automatically</text:h><text:h text:style-name="Head 3" text:level="3" >Taking Advantage of Database Server Features</text:h><text:h text:style-name="Head 3" text:level="3" >Adding new Functionality</text:h><text:h text:style-name="Head 3" text:level="3" >Handling Errors</text:h><text:h text:style-name="Head 1" text:level="1" >UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Purpose of UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Document Contents as Streams</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Content Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating, Moving and Copying Document and Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Additional Commands</text:h><text:h text:style-name="Head 2" text:level="2" >Writing a Content Provider</text:h><text:h text:style-name="Head 1" text:level="1" >[PRODUCTNAME] Configuration</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing configuration data</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Configuration Data</text:h><text:h text:style-name="Head 1" text:level="1" >Appendix</text:h></office:body> + +<office:body ><text:sequence-decls ><text:sequence-decl text:display-outline-level="0" text:name="Illustration" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Table" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Text" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Drawing" ></text:sequence-decl></text:sequence-decls><text:p text:style-name="P1" >Programmer's Manual</text:p><text:p text:style-name="P2" >Planned Outline</text:p><text:p text:style-name="P2" ></text:p><text:h text:style-name="Head 1" text:level="1" >Preface (3 Pages)</text:h><text:h text:style-name="Head 1" text:level="1" >First Steps (24 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Programming with UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Fields of Application for UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Getting Started</text:h><text:h text:style-name="Head 3" text:level="3" >Required Files</text:h><text:h text:style-name="Head 3" text:level="3" >Configuration</text:h><text:h text:style-name="Head 3" text:level="3" >First Connection</text:h><text:h text:style-name="Head 2" text:level="2" >How to get Objects in [PRODUCTNAME]</text:h><text:h text:style-name="Head 2" text:level="2" >How to work with Objects</text:h><text:p text:style-name="Paragraph" >Example</text:p><text:h text:style-name="Head 3" text:level="3" >Services</text:h><text:h text:style-name="Head 3" text:level="3" >Querying Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >ElementAccess</text:h><text:h text:style-name="Head 3" text:level="3" >Simple Types</text:h><text:h text:style-name="Head 3" text:level="3" >Strings</text:h><text:h text:style-name="Head 3" text:level="3" >Enums and Constant Groups</text:h><text:h text:style-name="Head 3" text:level="3" >Structs</text:h><text:h text:style-name="Head 3" text:level="3" >Any</text:h><text:h text:style-name="Head 3" text:level="3" >Sequence</text:h><text:h text:style-name="Head 2" text:level="2" >How to find the solution for a problem</text:h><text:h text:style-name="Head 2" text:level="2" >Finding your Way through the API Reference</text:h><text:h text:style-name="Head 2" text:level="2" >Common Mechanisms</text:h><text:h text:style-name="Head 3" text:level="3" >Text</text:h><text:h text:style-name="Head 3" text:level="3" >Table</text:h><text:h text:style-name="Head 3" text:level="3" >Drawing</text:h><text:h text:style-name="Head 1" text:level="1" >UNO in Professional Projects (<text:span text:style-name="T1" >145</text:span>)</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:p text:style-name="Paragraph" >UNO/API constituents: How UNOIDL/API, ServiceManager, Bridges, CoreReflection work together</text:p><text:h text:style-name="Head 2" text:level="2" >API Concepts</text:h><text:p text:style-name="Paragraph" >API is a language independent, abstract specification for UNO objects which are used in <text:s ></text:s>[PRODUCTNAME]</text:p><text:h text:style-name="Head 3" text:level="3" >Types in the API Reference</text:h><text:h text:style-name="Head 4" text:level="4" >Simple Types</text:h><text:h text:style-name="Head 4" text:level="4" >The Any Type</text:h><text:h text:style-name="Head 4" text:level="4" >Interfaces</text:h><text:h text:style-name="Head 4" text:level="4" >Services</text:h><text:h text:style-name="Head 4" text:level="4" >Modules</text:h><text:h text:style-name="Head 4" text:level="4" >Structs</text:h><text:h text:style-name="Head 4" text:level="4" >Constant Groups and Enums</text:h><text:h text:style-name="Head 4" text:level="4" >Sequences</text:h><text:h text:style-name="Head 4" text:level="4" >Exceptions</text:h><text:h text:style-name="Head 3" text:level="3" >API Principles</text:h><text:h text:style-name="Head 4" text:level="4" >Relationship between Specification, Implementation and Instances</text:h><text:h text:style-name="Head 4" text:level="4" >Object Composition</text:h><text:h text:style-name="Head 2" text:level="2" >UNO Concepts</text:h><text:p text:style-name="Paragraph" >UNO is an environment for networked object communication</text:p><text:h text:style-name="Head 3" text:level="3" >Interprocess Connections</text:h><text:h text:style-name="Head 3" text:level="3" >ServiceManager and ComponentContext</text:h><text:h text:style-name="Head 3" text:level="3" >Using UNO Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >Using Collections and Containers</text:h><text:h text:style-name="Head 3" text:level="3" >Event Model</text:h><text:h text:style-name="Head 3" text:level="3" >Exception Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Lifetime Control</text:h><text:h text:style-name="Head 3" text:level="3" >Object Identity</text:h><text:h text:style-name="Head 2" text:level="2" >Language Bindings</text:h><text:h text:style-name="Head 3" text:level="3" >Introduction for language binding</text:h><text:h text:style-name="Head 3" text:level="3" >Java Language Binding</text:h><text:h text:style-name="Head 3" text:level="3" >C++ Binding</text:h><text:h text:style-name="Head 3" text:level="3" >Access for [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 3" text:level="3" >Automation</text:h><text:h text:style-name="Head 1" text:level="1" >Writing UNO components</text:h><text:h text:style-name="Head 2" text:level="2" >Specifying a new Component</text:h><text:h text:style-name="Head 3" text:level="3" >UNOIDL language specification</text:h><text:h text:style-name="Head 2" text:level="2" >Implementing a Component</text:h><text:h text:style-name="Head 3" text:level="3" >Component Development Basics</text:h><text:unordered-list text:style-name="L1" ><text:list-item ><text:p text:style-name="P3" >Introduction</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >Mandatory interfaces: XInterface, XServiceInfo ((from UseInterfaces.CoreInterfaces))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >"Should be implemented" interfaces: XTypeProvider ((from UseInterfaces.CoreInterfaces ))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >optional interface: XMain for standalone execution</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Simple Component in Java</text:h><text:unordered-list text:style-name="L2" ><text:list-item ><text:p text:style-name="P4" >Getting the service manager ((Chapter Java components from unoBindingJava))</text:p></text:list-item><text:list-item ><text:p text:style-name="P4" >simple component chapter</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >C++ Component</text:h><text:h text:style-name="Head 3" text:level="3" >((Automation Component?))</text:h><text:h text:style-name="Head 2" text:level="2" >Deployment Options for Components</text:h><text:h text:style-name="Head 3" text:level="3" >Component Registration</text:h><text:h text:style-name="Head 3" text:level="3" >Service Manager Configuration</text:h><text:unordered-list text:style-name="L3" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P5" >XSet Interface</text:p><text:p text:style-name="P5" >Adding components during runtime, particularly interesting during development</text:p></text:list-item><text:list-item ><text:p text:style-name="P5" >ServiceManager Content</text:p><text:p text:style-name="P5" >Dynamically modifying the ServiceManager</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Bootstrapping the Service Manager ((from CppBind chapter))</text:h><text:unordered-list text:style-name="L4" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P6" >Simple Test Application</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >Configuring Your Application with Bootstrap Parameters</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >The UNO Executable</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Standalone Runtime Environment</text:h><text:p text:style-name="Paragraph" ><text:tab-stop ></text:tab-stop>The UNO executable and XMain</text:p><text:h text:style-name="Head 3" text:level="3" >Configuring the Java Runtime Environment</text:h><text:unordered-list text:style-name="L5" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P7" >The office and Java ((from UnoBindingJava))</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 1" text:level="1" >Advanced UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Design Patterns</text:h><text:h text:style-name="Head 2" text:level="2" >Bridging concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Requirements for Language Bindings and Bridges</text:h><text:h text:style-name="Head 3" text:level="3" >New Scripting Engines</text:h><text:h text:style-name="Head 2" text:level="2" >ServiceManager and loader</text:h><text:h text:style-name="Head 2" text:level="2" >Special Interfaces for internal use</text:h><text:p text:style-name="Paragraph" >XUNOTunnel</text:p><text:p text:style-name="Paragraph" >XAggregation</text:p><text:h text:style-name="Head 2" text:level="2" >UNO Reflection API</text:h><text:h text:style-name="Head 2" text:level="2" >TypeLibrary and TypeProviders</text:h><text:h text:style-name="Head 2" text:level="2" >Differences from Corba</text:h><text:h text:style-name="Head 1" text:level="1" >Office Development</text:h><text:h text:style-name="Head 2" text:level="2" >Global Object Structure</text:h><text:h text:style-name="Head 3" text:level="3" >Desktop Environment</text:h><text:h text:style-name="Head 3" text:level="3" >Frames and Frame Hierarchies</text:h><text:h text:style-name="Head 3" text:level="3" >Frame-Controller-Model Paradigm</text:h><text:h text:style-name="Head 3" text:level="3" >Loading and Saving Office Components</text:h><text:h text:style-name="Head 3" text:level="3" >Dispatch Framework</text:h><text:h text:style-name="Head 2" text:level="2" >Common Features</text:h><text:h text:style-name="Head 3" text:level="3" >Common Dialogs</text:h><text:h text:style-name="Head 3" text:level="3" >DocumentInfo</text:h><text:h text:style-name="Head 3" text:level="3" >Styles</text:h><text:h text:style-name="Head 3" text:level="3" >Search and Replace</text:h><text:h text:style-name="Head 3" text:level="3" >Number Formats</text:h><text:h text:style-name="Head 3" text:level="3" >Package File Formats</text:h><text:h text:style-name="Head 2" text:level="2" >Internationalization</text:h><text:h text:style-name="Head 2" text:level="2" >Linguistic</text:h><text:h text:style-name="Head 2" text:level="2" >System Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Clipboard</text:h><text:h text:style-name="Head 3" text:level="3" >File Picker</text:h><text:h text:style-name="Head 3" text:level="3" >Bridging to the Window System</text:h><text:p text:style-name="Paragraph" ></text:p><text:h text:style-name="Head 1" text:level="1" >Text Documents (51,5 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Text Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Text Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Using Text</text:h><text:h text:style-name="Head 3" text:level="3" >Tables</text:h><text:h text:style-name="Head 3" text:level="3" >Text Fields</text:h><text:h text:style-name="Head 3" text:level="3" >Bookmarks</text:h><text:h text:style-name="Head 3" text:level="3" >Indexes and Index Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Reference Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Footnotes and Endnotes</text:h><text:h text:style-name="Head 3" text:level="3" >Shape Objects in Text</text:h><text:h text:style-name="Head 3" text:level="3" >Redline</text:h><text:h text:style-name="Head 3" text:level="3" >Ruby</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Text Document</text:h><text:h text:style-name="Head 1" text:level="1" >Spreadsheet Documents</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Spreadsheet Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Spreadsheet Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Editing Spreadsheets</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Spreadsheet Document</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Spreadsheet Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Drawings and Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Draw/Impress Files</text:h><text:h text:style-name="Head 3" text:level="3" >Saving</text:h><text:h text:style-name="Head 3" text:level="3" >Printing</text:h><text:h text:style-name="Head 3" text:level="3" >Running Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Working with a Draw/Impress Document</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Draw/Impress Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Draw/Impress Document</text:h><text:h text:style-name="Head 1" text:level="1" >Charts</text:h><text:h text:style-name="Head 2" text:level="2" >Chart Basics</text:h><text:h text:style-name="Head 2" text:level="2" >Creating a Chart Document</text:h><text:h text:style-name="Head 2" text:level="2" >Editing a Chart Document</text:h><text:h text:style-name="Head 3" text:level="3" >Common Diagram API</text:h><text:h text:style-name="Head 3" text:level="3" >Different Chart Types</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Chart Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Basic and Dialogs</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:h text:style-name="Head 2" text:level="2" >Library Organization</text:h><text:h text:style-name="Head 2" text:level="2" >IDE with Dialogs and Events</text:h><text:h text:style-name="Head 2" text:level="2" >Using [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 2" text:level="2" >Toolkit Controls and their Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating Dialogs at Runtime</text:h><text:h text:style-name="Head 1" text:level="1" >Database Access</text:h><text:h text:style-name="Head 2" text:level="2" >Features of the [PRODUCTNAME] Database Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Capabilities</text:h><text:h text:style-name="Head 3" text:level="3" >SDBC, SDBCX, SDB Architecture</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Datasources with [PRODUCTNAME]</text:h><text:h text:style-name="Head 3" text:level="3" >DataSources</text:h><text:h text:style-name="Head 3" text:level="3" >Adding and Editing Datasources </text:h><text:h text:style-name="Head 3" text:level="3" >Establishing a Connection</text:h><text:h text:style-name="Head 4" text:level="4" >Getting Connections</text:h><text:h text:style-name="Head 4" text:level="4" >Driver specifics</text:h><text:h text:style-name="Head 3" text:level="3" >Connection Pooling</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Saved Queries</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Data</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Statements</text:h><text:h text:style-name="Head 3" text:level="3" >Resultsets</text:h><text:h text:style-name="Head 3" text:level="3" >Metadata</text:h><text:h text:style-name="Head 3" text:level="3" >Rowsets</text:h><text:h text:style-name="Head 2" text:level="2" >Working with the Database Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using DDL to change the DB Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using SDBCX to access the DB Design</text:h><text:h text:style-name="Head 2" text:level="2" >Using DBMS Features</text:h><text:h text:style-name="Head 3" text:level="3" >Stored Procedures</text:h><text:h text:style-name="Head 3" text:level="3" >Transaction Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Prepared Statements</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Database Drivers</text:h><text:h text:style-name="Head 1" text:level="1" >Forms</text:h><text:h text:style-name="Head 2" text:level="2" >Concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Models and Views</text:h><text:h text:style-name="Head 3" text:level="3" >Form Elements in the Document Model</text:h><text:h text:style-name="Head 3" text:level="3" >Special Form Components</text:h><text:h text:style-name="Head 3" text:level="3" >Events</text:h><text:h text:style-name="Head 3" text:level="3" >Data Awareness</text:h><text:h text:style-name="Head 2" text:level="2" >Recipes</text:h><text:h text:style-name="Head 3" text:level="3" >Making it easier to work with a Form</text:h><text:h text:style-name="Head 3" text:level="3" >Controlling the Data Input</text:h><text:h text:style-name="Head 3" text:level="3" >Collecting Data automatically</text:h><text:h text:style-name="Head 3" text:level="3" >Taking Advantage of Database Server Features</text:h><text:h text:style-name="Head 3" text:level="3" >Adding new Functionality</text:h><text:h text:style-name="Head 3" text:level="3" >Handling Errors</text:h><text:h text:style-name="Head 1" text:level="1" >UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Purpose of UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Document Contents as Streams</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Content Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating, Moving and Copying Document and Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Additional Commands</text:h><text:h text:style-name="Head 2" text:level="2" >Writing a Content Provider</text:h><text:h text:style-name="Head 1" text:level="1" >[PRODUCTNAME] Configuration</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing configuration data</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Configuration Data</text:h><text:h text:style-name="Head 1" text:level="1" >Appendix</text:h></office:body> + +</office:document> +</signtest>
\ No newline at end of file diff --git a/xmlsecurity/tools/examples/sign-4.xml b/xmlsecurity/tools/examples/sign-4.xml new file mode 100644 index 000000000000..b8450045006c --- /dev/null +++ b/xmlsecurity/tools/examples/sign-4.xml @@ -0,0 +1,57 @@ +<?xml version="1.0" encoding="UTF-8"?> +<signtest> +<Signature xmlns="http://www.w3.org/2000/09/xmldsig#"> + <SignedInfo> + <CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" /> + <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" /> + <Reference URI="#target"> + <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" /> + <DigestValue> </DigestValue> + </Reference> + </SignedInfo> + <SignatureValue> </SignatureValue> + <KeyInfo> + <X509Data> + <X509IssuerSerial> + <X509IssuerName>CN=Test Issuer</X509IssuerName> + <X509SerialNumber>123450005</X509SerialNumber> + </X509IssuerSerial> + </X509Data> + </KeyInfo> +</Signature> +<office:document id="target" xmlns:office="http://openoffice.org/2000/office" xmlns:style="http://openoffice.org/2000/style" xmlns:text="http://openoffice.org/2000/text" xmlns:table="http://openoffice.org/2000/table" xmlns:draw="http://openoffice.org/2000/drawing" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:meta="http://openoffice.org/2000/meta" xmlns:number="http://openoffice.org/2000/datastyle" xmlns:svg="http://www.w3.org/2000/svg" xmlns:chart="http://openoffice.org/2000/chart" xmlns:dr3d="http://openoffice.org/2000/dr3d" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="http://openoffice.org/2000/form" xmlns:script="http://openoffice.org/2000/script" xmlns:config="http://openoffice.org/2001/config" office:class="text" office:version="1.0" > + +<office:body ><text:sequence-decls ><text:sequence-decl text:display-outline-level="0" text:name="Illustration" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Table" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Text" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Drawing" ></text:sequence-decl></text:sequence-decls><text:p text:style-name="P1" >Programmer's Manual</text:p><text:p text:style-name="P2" >Planned Outline</text:p><text:p text:style-name="P2" ></text:p><text:h text:style-name="Head 1" text:level="1" >Preface (3 Pages)</text:h><text:h text:style-name="Head 1" text:level="1" >First Steps (24 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Programming with UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Fields of Application for UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Getting Started</text:h><text:h text:style-name="Head 3" text:level="3" >Required Files</text:h><text:h text:style-name="Head 3" text:level="3" >Configuration</text:h><text:h text:style-name="Head 3" text:level="3" >First Connection</text:h><text:h text:style-name="Head 2" text:level="2" >How to get Objects in [PRODUCTNAME]</text:h><text:h text:style-name="Head 2" text:level="2" >How to work with Objects</text:h><text:p text:style-name="Paragraph" >Example</text:p><text:h text:style-name="Head 3" text:level="3" >Services</text:h><text:h text:style-name="Head 3" text:level="3" >Querying Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >ElementAccess</text:h><text:h text:style-name="Head 3" text:level="3" >Simple Types</text:h><text:h text:style-name="Head 3" text:level="3" >Strings</text:h><text:h text:style-name="Head 3" text:level="3" >Enums and Constant Groups</text:h><text:h text:style-name="Head 3" text:level="3" >Structs</text:h><text:h text:style-name="Head 3" text:level="3" >Any</text:h><text:h text:style-name="Head 3" text:level="3" >Sequence</text:h><text:h text:style-name="Head 2" text:level="2" >How to find the solution for a problem</text:h><text:h text:style-name="Head 2" text:level="2" >Finding your Way through the API Reference</text:h><text:h text:style-name="Head 2" text:level="2" >Common Mechanisms</text:h><text:h text:style-name="Head 3" text:level="3" >Text</text:h><text:h text:style-name="Head 3" text:level="3" >Table</text:h><text:h text:style-name="Head 3" text:level="3" >Drawing</text:h><text:h text:style-name="Head 1" text:level="1" >UNO in Professional Projects (<text:span text:style-name="T1" >145</text:span>)</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:p text:style-name="Paragraph" >UNO/API constituents: How UNOIDL/API, ServiceManager, Bridges, CoreReflection work together</text:p><text:h text:style-name="Head 2" text:level="2" >API Concepts</text:h><text:p text:style-name="Paragraph" >API is a language independent, abstract specification for UNO objects which are used in <text:s ></text:s>[PRODUCTNAME]</text:p><text:h text:style-name="Head 3" text:level="3" >Types in the API Reference</text:h><text:h text:style-name="Head 4" text:level="4" >Simple Types</text:h><text:h text:style-name="Head 4" text:level="4" >The Any Type</text:h><text:h text:style-name="Head 4" text:level="4" >Interfaces</text:h><text:h text:style-name="Head 4" text:level="4" >Services</text:h><text:h text:style-name="Head 4" text:level="4" >Modules</text:h><text:h text:style-name="Head 4" text:level="4" >Structs</text:h><text:h text:style-name="Head 4" text:level="4" >Constant Groups and Enums</text:h><text:h text:style-name="Head 4" text:level="4" >Sequences</text:h><text:h text:style-name="Head 4" text:level="4" >Exceptions</text:h><text:h text:style-name="Head 3" text:level="3" >API Principles</text:h><text:h text:style-name="Head 4" text:level="4" >Relationship between Specification, Implementation and Instances</text:h><text:h text:style-name="Head 4" text:level="4" >Object Composition</text:h><text:h text:style-name="Head 2" text:level="2" >UNO Concepts</text:h><text:p text:style-name="Paragraph" >UNO is an environment for networked object communication</text:p><text:h text:style-name="Head 3" text:level="3" >Interprocess Connections</text:h><text:h text:style-name="Head 3" text:level="3" >ServiceManager and ComponentContext</text:h><text:h text:style-name="Head 3" text:level="3" >Using UNO Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >Using Collections and Containers</text:h><text:h text:style-name="Head 3" text:level="3" >Event Model</text:h><text:h text:style-name="Head 3" text:level="3" >Exception Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Lifetime Control</text:h><text:h text:style-name="Head 3" text:level="3" >Object Identity</text:h><text:h text:style-name="Head 2" text:level="2" >Language Bindings</text:h><text:h text:style-name="Head 3" text:level="3" >Introduction for language binding</text:h><text:h text:style-name="Head 3" text:level="3" >Java Language Binding</text:h><text:h text:style-name="Head 3" text:level="3" >C++ Binding</text:h><text:h text:style-name="Head 3" text:level="3" >Access for [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 3" text:level="3" >Automation</text:h><text:h text:style-name="Head 1" text:level="1" >Writing UNO components</text:h><text:h text:style-name="Head 2" text:level="2" >Specifying a new Component</text:h><text:h text:style-name="Head 3" text:level="3" >UNOIDL language specification</text:h><text:h text:style-name="Head 2" text:level="2" >Implementing a Component</text:h><text:h text:style-name="Head 3" text:level="3" >Component Development Basics</text:h><text:unordered-list text:style-name="L1" ><text:list-item ><text:p text:style-name="P3" >Introduction</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >Mandatory interfaces: XInterface, XServiceInfo ((from UseInterfaces.CoreInterfaces))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >"Should be implemented" interfaces: XTypeProvider ((from UseInterfaces.CoreInterfaces ))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >optional interface: XMain for standalone execution</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Simple Component in Java</text:h><text:unordered-list text:style-name="L2" ><text:list-item ><text:p text:style-name="P4" >Getting the service manager ((Chapter Java components from unoBindingJava))</text:p></text:list-item><text:list-item ><text:p text:style-name="P4" >simple component chapter</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >C++ Component</text:h><text:h text:style-name="Head 3" text:level="3" >((Automation Component?))</text:h><text:h text:style-name="Head 2" text:level="2" >Deployment Options for Components</text:h><text:h text:style-name="Head 3" text:level="3" >Component Registration</text:h><text:h text:style-name="Head 3" text:level="3" >Service Manager Configuration</text:h><text:unordered-list text:style-name="L3" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P5" >XSet Interface</text:p><text:p text:style-name="P5" >Adding components during runtime, particularly interesting during development</text:p></text:list-item><text:list-item ><text:p text:style-name="P5" >ServiceManager Content</text:p><text:p text:style-name="P5" >Dynamically modifying the ServiceManager</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Bootstrapping the Service Manager ((from CppBind chapter))</text:h><text:unordered-list text:style-name="L4" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P6" >Simple Test Application</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >Configuring Your Application with Bootstrap Parameters</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >The UNO Executable</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Standalone Runtime Environment</text:h><text:p text:style-name="Paragraph" ><text:tab-stop ></text:tab-stop>The UNO executable and XMain</text:p><text:h text:style-name="Head 3" text:level="3" >Configuring the Java Runtime Environment</text:h><text:unordered-list text:style-name="L5" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P7" >The office and Java ((from UnoBindingJava))</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 1" text:level="1" >Advanced UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Design Patterns</text:h><text:h text:style-name="Head 2" text:level="2" >Bridging concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Requirements for Language Bindings and Bridges</text:h><text:h text:style-name="Head 3" text:level="3" >New Scripting Engines</text:h><text:h text:style-name="Head 2" text:level="2" >ServiceManager and loader</text:h><text:h text:style-name="Head 2" text:level="2" >Special Interfaces for internal use</text:h><text:p text:style-name="Paragraph" >XUNOTunnel</text:p><text:p text:style-name="Paragraph" >XAggregation</text:p><text:h text:style-name="Head 2" text:level="2" >UNO Reflection API</text:h><text:h text:style-name="Head 2" text:level="2" >TypeLibrary and TypeProviders</text:h><text:h text:style-name="Head 2" text:level="2" >Differences from Corba</text:h><text:h text:style-name="Head 1" text:level="1" >Office Development</text:h><text:h text:style-name="Head 2" text:level="2" >Global Object Structure</text:h><text:h text:style-name="Head 3" text:level="3" >Desktop Environment</text:h><text:h text:style-name="Head 3" text:level="3" >Frames and Frame Hierarchies</text:h><text:h text:style-name="Head 3" text:level="3" >Frame-Controller-Model Paradigm</text:h><text:h text:style-name="Head 3" text:level="3" >Loading and Saving Office Components</text:h><text:h text:style-name="Head 3" text:level="3" >Dispatch Framework</text:h><text:h text:style-name="Head 2" text:level="2" >Common Features</text:h><text:h text:style-name="Head 3" text:level="3" >Common Dialogs</text:h><text:h text:style-name="Head 3" text:level="3" >DocumentInfo</text:h><text:h text:style-name="Head 3" text:level="3" >Styles</text:h><text:h text:style-name="Head 3" text:level="3" >Search and Replace</text:h><text:h text:style-name="Head 3" text:level="3" >Number Formats</text:h><text:h text:style-name="Head 3" text:level="3" >Package File Formats</text:h><text:h text:style-name="Head 2" text:level="2" >Internationalization</text:h><text:h text:style-name="Head 2" text:level="2" >Linguistic</text:h><text:h text:style-name="Head 2" text:level="2" >System Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Clipboard</text:h><text:h text:style-name="Head 3" text:level="3" >File Picker</text:h><text:h text:style-name="Head 3" text:level="3" >Bridging to the Window System</text:h><text:p text:style-name="Paragraph" ></text:p><text:h text:style-name="Head 1" text:level="1" >Text Documents (51,5 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Text Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Text Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Using Text</text:h><text:h text:style-name="Head 3" text:level="3" >Tables</text:h><text:h text:style-name="Head 3" text:level="3" >Text Fields</text:h><text:h text:style-name="Head 3" text:level="3" >Bookmarks</text:h><text:h text:style-name="Head 3" text:level="3" >Indexes and Index Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Reference Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Footnotes and Endnotes</text:h><text:h text:style-name="Head 3" text:level="3" >Shape Objects in Text</text:h><text:h text:style-name="Head 3" text:level="3" >Redline</text:h><text:h text:style-name="Head 3" text:level="3" >Ruby</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Text Document</text:h><text:h text:style-name="Head 1" text:level="1" >Spreadsheet Documents</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Spreadsheet Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Spreadsheet Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Editing Spreadsheets</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Spreadsheet Document</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Spreadsheet Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Drawings and Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Draw/Impress Files</text:h><text:h text:style-name="Head 3" text:level="3" >Saving</text:h><text:h text:style-name="Head 3" text:level="3" >Printing</text:h><text:h text:style-name="Head 3" text:level="3" >Running Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Working with a Draw/Impress Document</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Draw/Impress Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Draw/Impress Document</text:h><text:h text:style-name="Head 1" text:level="1" >Charts</text:h><text:h text:style-name="Head 2" text:level="2" >Chart Basics</text:h><text:h text:style-name="Head 2" text:level="2" >Creating a Chart Document</text:h><text:h text:style-name="Head 2" text:level="2" >Editing a Chart Document</text:h><text:h text:style-name="Head 3" text:level="3" >Common Diagram API</text:h><text:h text:style-name="Head 3" text:level="3" >Different Chart Types</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Chart Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Basic and Dialogs</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:h text:style-name="Head 2" text:level="2" >Library Organization</text:h><text:h text:style-name="Head 2" text:level="2" >IDE with Dialogs and Events</text:h><text:h text:style-name="Head 2" text:level="2" >Using [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 2" text:level="2" >Toolkit Controls and their Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating Dialogs at Runtime</text:h><text:h text:style-name="Head 1" text:level="1" >Database Access</text:h><text:h text:style-name="Head 2" text:level="2" >Features of the [PRODUCTNAME] Database Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Capabilities</text:h><text:h text:style-name="Head 3" text:level="3" >SDBC, SDBCX, SDB Architecture</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Datasources with [PRODUCTNAME]</text:h><text:h text:style-name="Head 3" text:level="3" >DataSources</text:h><text:h text:style-name="Head 3" text:level="3" >Adding and Editing Datasources </text:h><text:h text:style-name="Head 3" text:level="3" >Establishing a Connection</text:h><text:h text:style-name="Head 4" text:level="4" >Getting Connections</text:h><text:h text:style-name="Head 4" text:level="4" >Driver specifics</text:h><text:h text:style-name="Head 3" text:level="3" >Connection Pooling</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Saved Queries</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Data</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Statements</text:h><text:h text:style-name="Head 3" text:level="3" >Resultsets</text:h><text:h text:style-name="Head 3" text:level="3" >Metadata</text:h><text:h text:style-name="Head 3" text:level="3" >Rowsets</text:h><text:h text:style-name="Head 2" text:level="2" >Working with the Database Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using DDL to change the DB Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using SDBCX to access the DB Design</text:h><text:h text:style-name="Head 2" text:level="2" >Using DBMS Features</text:h><text:h text:style-name="Head 3" text:level="3" >Stored Procedures</text:h><text:h text:style-name="Head 3" text:level="3" >Transaction Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Prepared Statements</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Database Drivers</text:h><text:h text:style-name="Head 1" text:level="1" >Forms</text:h><text:h text:style-name="Head 2" text:level="2" >Concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Models and Views</text:h><text:h text:style-name="Head 3" text:level="3" >Form Elements in the Document Model</text:h><text:h text:style-name="Head 3" text:level="3" >Special Form Components</text:h><text:h text:style-name="Head 3" text:level="3" >Events</text:h><text:h text:style-name="Head 3" text:level="3" >Data Awareness</text:h><text:h text:style-name="Head 2" text:level="2" >Recipes</text:h><text:h text:style-name="Head 3" text:level="3" >Making it easier to work with a Form</text:h><text:h text:style-name="Head 3" text:level="3" >Controlling the Data Input</text:h><text:h text:style-name="Head 3" text:level="3" >Collecting Data automatically</text:h><text:h text:style-name="Head 3" text:level="3" >Taking Advantage of Database Server Features</text:h><text:h text:style-name="Head 3" text:level="3" >Adding new Functionality</text:h><text:h text:style-name="Head 3" text:level="3" >Handling Errors</text:h><text:h text:style-name="Head 1" text:level="1" >UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Purpose of UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Document Contents as Streams</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Content Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating, Moving and Copying Document and Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Additional Commands</text:h><text:h text:style-name="Head 2" text:level="2" >Writing a Content Provider</text:h><text:h text:style-name="Head 1" text:level="1" >[PRODUCTNAME] Configuration</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing configuration data</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Configuration Data</text:h><text:h text:style-name="Head 1" text:level="1" >Appendix</text:h></office:body> + +<office:body ><text:sequence-decls ><text:sequence-decl text:display-outline-level="0" text:name="Illustration" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Table" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Text" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Drawing" ></text:sequence-decl></text:sequence-decls><text:p text:style-name="P1" >Programmer's Manual</text:p><text:p text:style-name="P2" >Planned Outline</text:p><text:p text:style-name="P2" ></text:p><text:h text:style-name="Head 1" text:level="1" >Preface (3 Pages)</text:h><text:h text:style-name="Head 1" text:level="1" >First Steps (24 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Programming with UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Fields of Application for UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Getting Started</text:h><text:h text:style-name="Head 3" text:level="3" >Required Files</text:h><text:h text:style-name="Head 3" text:level="3" >Configuration</text:h><text:h text:style-name="Head 3" text:level="3" >First Connection</text:h><text:h text:style-name="Head 2" text:level="2" >How to get Objects in [PRODUCTNAME]</text:h><text:h text:style-name="Head 2" text:level="2" >How to work with Objects</text:h><text:p text:style-name="Paragraph" >Example</text:p><text:h text:style-name="Head 3" text:level="3" >Services</text:h><text:h text:style-name="Head 3" text:level="3" >Querying Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >ElementAccess</text:h><text:h text:style-name="Head 3" text:level="3" >Simple Types</text:h><text:h text:style-name="Head 3" text:level="3" >Strings</text:h><text:h text:style-name="Head 3" text:level="3" >Enums and Constant Groups</text:h><text:h text:style-name="Head 3" text:level="3" >Structs</text:h><text:h text:style-name="Head 3" text:level="3" >Any</text:h><text:h text:style-name="Head 3" text:level="3" >Sequence</text:h><text:h text:style-name="Head 2" text:level="2" >How to find the solution for a problem</text:h><text:h text:style-name="Head 2" text:level="2" >Finding your Way through the API Reference</text:h><text:h text:style-name="Head 2" text:level="2" >Common Mechanisms</text:h><text:h text:style-name="Head 3" text:level="3" >Text</text:h><text:h text:style-name="Head 3" text:level="3" >Table</text:h><text:h text:style-name="Head 3" text:level="3" >Drawing</text:h><text:h text:style-name="Head 1" text:level="1" >UNO in Professional Projects (<text:span text:style-name="T1" >145</text:span>)</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:p text:style-name="Paragraph" >UNO/API constituents: How UNOIDL/API, ServiceManager, Bridges, CoreReflection work together</text:p><text:h text:style-name="Head 2" text:level="2" >API Concepts</text:h><text:p text:style-name="Paragraph" >API is a language independent, abstract specification for UNO objects which are used in <text:s ></text:s>[PRODUCTNAME]</text:p><text:h text:style-name="Head 3" text:level="3" >Types in the API Reference</text:h><text:h text:style-name="Head 4" text:level="4" >Simple Types</text:h><text:h text:style-name="Head 4" text:level="4" >The Any Type</text:h><text:h text:style-name="Head 4" text:level="4" >Interfaces</text:h><text:h text:style-name="Head 4" text:level="4" >Services</text:h><text:h text:style-name="Head 4" text:level="4" >Modules</text:h><text:h text:style-name="Head 4" text:level="4" >Structs</text:h><text:h text:style-name="Head 4" text:level="4" >Constant Groups and Enums</text:h><text:h text:style-name="Head 4" text:level="4" >Sequences</text:h><text:h text:style-name="Head 4" text:level="4" >Exceptions</text:h><text:h text:style-name="Head 3" text:level="3" >API Principles</text:h><text:h text:style-name="Head 4" text:level="4" >Relationship between Specification, Implementation and Instances</text:h><text:h text:style-name="Head 4" text:level="4" >Object Composition</text:h><text:h text:style-name="Head 2" text:level="2" >UNO Concepts</text:h><text:p text:style-name="Paragraph" >UNO is an environment for networked object communication</text:p><text:h text:style-name="Head 3" text:level="3" >Interprocess Connections</text:h><text:h text:style-name="Head 3" text:level="3" >ServiceManager and ComponentContext</text:h><text:h text:style-name="Head 3" text:level="3" >Using UNO Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >Using Collections and Containers</text:h><text:h text:style-name="Head 3" text:level="3" >Event Model</text:h><text:h text:style-name="Head 3" text:level="3" >Exception Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Lifetime Control</text:h><text:h text:style-name="Head 3" text:level="3" >Object Identity</text:h><text:h text:style-name="Head 2" text:level="2" >Language Bindings</text:h><text:h text:style-name="Head 3" text:level="3" >Introduction for language binding</text:h><text:h text:style-name="Head 3" text:level="3" >Java Language Binding</text:h><text:h text:style-name="Head 3" text:level="3" >C++ Binding</text:h><text:h text:style-name="Head 3" text:level="3" >Access for [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 3" text:level="3" >Automation</text:h><text:h text:style-name="Head 1" text:level="1" >Writing UNO components</text:h><text:h text:style-name="Head 2" text:level="2" >Specifying a new Component</text:h><text:h text:style-name="Head 3" text:level="3" >UNOIDL language specification</text:h><text:h text:style-name="Head 2" text:level="2" >Implementing a Component</text:h><text:h text:style-name="Head 3" text:level="3" >Component Development Basics</text:h><text:unordered-list text:style-name="L1" ><text:list-item ><text:p text:style-name="P3" >Introduction</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >Mandatory interfaces: XInterface, XServiceInfo ((from UseInterfaces.CoreInterfaces))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >"Should be implemented" interfaces: XTypeProvider ((from UseInterfaces.CoreInterfaces ))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >optional interface: XMain for standalone execution</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Simple Component in Java</text:h><text:unordered-list text:style-name="L2" ><text:list-item ><text:p text:style-name="P4" >Getting the service manager ((Chapter Java components from unoBindingJava))</text:p></text:list-item><text:list-item ><text:p text:style-name="P4" >simple component chapter</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >C++ Component</text:h><text:h text:style-name="Head 3" text:level="3" >((Automation Component?))</text:h><text:h text:style-name="Head 2" text:level="2" >Deployment Options for Components</text:h><text:h text:style-name="Head 3" text:level="3" >Component Registration</text:h><text:h text:style-name="Head 3" text:level="3" >Service Manager Configuration</text:h><text:unordered-list text:style-name="L3" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P5" >XSet Interface</text:p><text:p text:style-name="P5" >Adding components during runtime, particularly interesting during development</text:p></text:list-item><text:list-item ><text:p text:style-name="P5" >ServiceManager Content</text:p><text:p text:style-name="P5" >Dynamically modifying the ServiceManager</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Bootstrapping the Service Manager ((from CppBind chapter))</text:h><text:unordered-list text:style-name="L4" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P6" >Simple Test Application</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >Configuring Your Application with Bootstrap Parameters</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >The UNO Executable</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Standalone Runtime Environment</text:h><text:p text:style-name="Paragraph" ><text:tab-stop ></text:tab-stop>The UNO executable and XMain</text:p><text:h text:style-name="Head 3" text:level="3" >Configuring the Java Runtime Environment</text:h><text:unordered-list text:style-name="L5" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P7" >The office and Java ((from UnoBindingJava))</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 1" text:level="1" >Advanced UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Design Patterns</text:h><text:h text:style-name="Head 2" text:level="2" >Bridging concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Requirements for Language Bindings and Bridges</text:h><text:h text:style-name="Head 3" text:level="3" >New Scripting Engines</text:h><text:h text:style-name="Head 2" text:level="2" >ServiceManager and loader</text:h><text:h text:style-name="Head 2" text:level="2" >Special Interfaces for internal use</text:h><text:p text:style-name="Paragraph" >XUNOTunnel</text:p><text:p text:style-name="Paragraph" >XAggregation</text:p><text:h text:style-name="Head 2" text:level="2" >UNO Reflection API</text:h><text:h text:style-name="Head 2" text:level="2" >TypeLibrary and TypeProviders</text:h><text:h text:style-name="Head 2" text:level="2" >Differences from Corba</text:h><text:h text:style-name="Head 1" text:level="1" >Office Development</text:h><text:h text:style-name="Head 2" text:level="2" >Global Object Structure</text:h><text:h text:style-name="Head 3" text:level="3" >Desktop Environment</text:h><text:h text:style-name="Head 3" text:level="3" >Frames and Frame Hierarchies</text:h><text:h text:style-name="Head 3" text:level="3" >Frame-Controller-Model Paradigm</text:h><text:h text:style-name="Head 3" text:level="3" >Loading and Saving Office Components</text:h><text:h text:style-name="Head 3" text:level="3" >Dispatch Framework</text:h><text:h text:style-name="Head 2" text:level="2" >Common Features</text:h><text:h text:style-name="Head 3" text:level="3" >Common Dialogs</text:h><text:h text:style-name="Head 3" text:level="3" >DocumentInfo</text:h><text:h text:style-name="Head 3" text:level="3" >Styles</text:h><text:h text:style-name="Head 3" text:level="3" >Search and Replace</text:h><text:h text:style-name="Head 3" text:level="3" >Number Formats</text:h><text:h text:style-name="Head 3" text:level="3" >Package File Formats</text:h><text:h text:style-name="Head 2" text:level="2" >Internationalization</text:h><text:h text:style-name="Head 2" text:level="2" >Linguistic</text:h><text:h text:style-name="Head 2" text:level="2" >System Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Clipboard</text:h><text:h text:style-name="Head 3" text:level="3" >File Picker</text:h><text:h text:style-name="Head 3" text:level="3" >Bridging to the Window System</text:h><text:p text:style-name="Paragraph" ></text:p><text:h text:style-name="Head 1" text:level="1" >Text Documents (51,5 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Text Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Text Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Using Text</text:h><text:h text:style-name="Head 3" text:level="3" >Tables</text:h><text:h text:style-name="Head 3" text:level="3" >Text Fields</text:h><text:h text:style-name="Head 3" text:level="3" >Bookmarks</text:h><text:h text:style-name="Head 3" text:level="3" >Indexes and Index Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Reference Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Footnotes and Endnotes</text:h><text:h text:style-name="Head 3" text:level="3" >Shape Objects in Text</text:h><text:h text:style-name="Head 3" text:level="3" >Redline</text:h><text:h text:style-name="Head 3" text:level="3" >Ruby</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Text Document</text:h><text:h text:style-name="Head 1" text:level="1" >Spreadsheet Documents</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Spreadsheet Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Spreadsheet Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Editing Spreadsheets</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Spreadsheet Document</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Spreadsheet Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Drawings and Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Draw/Impress Files</text:h><text:h text:style-name="Head 3" text:level="3" >Saving</text:h><text:h text:style-name="Head 3" text:level="3" >Printing</text:h><text:h text:style-name="Head 3" text:level="3" >Running Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Working with a Draw/Impress Document</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Draw/Impress Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Draw/Impress Document</text:h><text:h text:style-name="Head 1" text:level="1" >Charts</text:h><text:h text:style-name="Head 2" text:level="2" >Chart Basics</text:h><text:h text:style-name="Head 2" text:level="2" >Creating a Chart Document</text:h><text:h text:style-name="Head 2" text:level="2" >Editing a Chart Document</text:h><text:h text:style-name="Head 3" text:level="3" >Common Diagram API</text:h><text:h text:style-name="Head 3" text:level="3" >Different Chart Types</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Chart Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Basic and Dialogs</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:h text:style-name="Head 2" text:level="2" >Library Organization</text:h><text:h text:style-name="Head 2" text:level="2" >IDE with Dialogs and Events</text:h><text:h text:style-name="Head 2" text:level="2" >Using [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 2" text:level="2" >Toolkit Controls and their Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating Dialogs at Runtime</text:h><text:h text:style-name="Head 1" text:level="1" >Database Access</text:h><text:h text:style-name="Head 2" text:level="2" >Features of the [PRODUCTNAME] Database Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Capabilities</text:h><text:h text:style-name="Head 3" text:level="3" >SDBC, SDBCX, SDB Architecture</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Datasources with [PRODUCTNAME]</text:h><text:h text:style-name="Head 3" text:level="3" >DataSources</text:h><text:h text:style-name="Head 3" text:level="3" >Adding and Editing Datasources </text:h><text:h text:style-name="Head 3" text:level="3" >Establishing a Connection</text:h><text:h text:style-name="Head 4" text:level="4" >Getting Connections</text:h><text:h text:style-name="Head 4" text:level="4" >Driver specifics</text:h><text:h text:style-name="Head 3" text:level="3" >Connection Pooling</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Saved Queries</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Data</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Statements</text:h><text:h text:style-name="Head 3" text:level="3" >Resultsets</text:h><text:h text:style-name="Head 3" text:level="3" >Metadata</text:h><text:h text:style-name="Head 3" text:level="3" >Rowsets</text:h><text:h text:style-name="Head 2" text:level="2" >Working with the Database Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using DDL to change the DB Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using SDBCX to access the DB Design</text:h><text:h text:style-name="Head 2" text:level="2" >Using DBMS Features</text:h><text:h text:style-name="Head 3" text:level="3" >Stored Procedures</text:h><text:h text:style-name="Head 3" text:level="3" >Transaction Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Prepared Statements</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Database Drivers</text:h><text:h text:style-name="Head 1" text:level="1" >Forms</text:h><text:h text:style-name="Head 2" text:level="2" >Concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Models and Views</text:h><text:h text:style-name="Head 3" text:level="3" >Form Elements in the Document Model</text:h><text:h text:style-name="Head 3" text:level="3" >Special Form Components</text:h><text:h text:style-name="Head 3" text:level="3" >Events</text:h><text:h text:style-name="Head 3" text:level="3" >Data Awareness</text:h><text:h text:style-name="Head 2" text:level="2" >Recipes</text:h><text:h text:style-name="Head 3" text:level="3" >Making it easier to work with a Form</text:h><text:h text:style-name="Head 3" text:level="3" >Controlling the Data Input</text:h><text:h text:style-name="Head 3" text:level="3" >Collecting Data automatically</text:h><text:h text:style-name="Head 3" text:level="3" >Taking Advantage of Database Server Features</text:h><text:h text:style-name="Head 3" text:level="3" >Adding new Functionality</text:h><text:h text:style-name="Head 3" text:level="3" >Handling Errors</text:h><text:h text:style-name="Head 1" text:level="1" >UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Purpose of UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Document Contents as Streams</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Content Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating, Moving and Copying Document and Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Additional Commands</text:h><text:h text:style-name="Head 2" text:level="2" >Writing a Content Provider</text:h><text:h text:style-name="Head 1" text:level="1" >[PRODUCTNAME] Configuration</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing configuration data</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Configuration Data</text:h><text:h text:style-name="Head 1" text:level="1" >Appendix</text:h></office:body> + +<office:body ><text:sequence-decls ><text:sequence-decl text:display-outline-level="0" text:name="Illustration" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Table" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Text" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Drawing" ></text:sequence-decl></text:sequence-decls><text:p text:style-name="P1" >Programmer's Manual</text:p><text:p text:style-name="P2" >Planned Outline</text:p><text:p text:style-name="P2" ></text:p><text:h text:style-name="Head 1" text:level="1" >Preface (3 Pages)</text:h><text:h text:style-name="Head 1" text:level="1" >First Steps (24 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Programming with UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Fields of Application for UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Getting Started</text:h><text:h text:style-name="Head 3" text:level="3" >Required Files</text:h><text:h text:style-name="Head 3" text:level="3" >Configuration</text:h><text:h text:style-name="Head 3" text:level="3" >First Connection</text:h><text:h text:style-name="Head 2" text:level="2" >How to get Objects in [PRODUCTNAME]</text:h><text:h text:style-name="Head 2" text:level="2" >How to work with Objects</text:h><text:p text:style-name="Paragraph" >Example</text:p><text:h text:style-name="Head 3" text:level="3" >Services</text:h><text:h text:style-name="Head 3" text:level="3" >Querying Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >ElementAccess</text:h><text:h text:style-name="Head 3" text:level="3" >Simple Types</text:h><text:h text:style-name="Head 3" text:level="3" >Strings</text:h><text:h text:style-name="Head 3" text:level="3" >Enums and Constant Groups</text:h><text:h text:style-name="Head 3" text:level="3" >Structs</text:h><text:h text:style-name="Head 3" text:level="3" >Any</text:h><text:h text:style-name="Head 3" text:level="3" >Sequence</text:h><text:h text:style-name="Head 2" text:level="2" >How to find the solution for a problem</text:h><text:h text:style-name="Head 2" text:level="2" >Finding your Way through the API Reference</text:h><text:h text:style-name="Head 2" text:level="2" >Common Mechanisms</text:h><text:h text:style-name="Head 3" text:level="3" >Text</text:h><text:h text:style-name="Head 3" text:level="3" >Table</text:h><text:h text:style-name="Head 3" text:level="3" >Drawing</text:h><text:h text:style-name="Head 1" text:level="1" >UNO in Professional Projects (<text:span text:style-name="T1" >145</text:span>)</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:p text:style-name="Paragraph" >UNO/API constituents: How UNOIDL/API, ServiceManager, Bridges, CoreReflection work together</text:p><text:h text:style-name="Head 2" text:level="2" >API Concepts</text:h><text:p text:style-name="Paragraph" >API is a language independent, abstract specification for UNO objects which are used in <text:s ></text:s>[PRODUCTNAME]</text:p><text:h text:style-name="Head 3" text:level="3" >Types in the API Reference</text:h><text:h text:style-name="Head 4" text:level="4" >Simple Types</text:h><text:h text:style-name="Head 4" text:level="4" >The Any Type</text:h><text:h text:style-name="Head 4" text:level="4" >Interfaces</text:h><text:h text:style-name="Head 4" text:level="4" >Services</text:h><text:h text:style-name="Head 4" text:level="4" >Modules</text:h><text:h text:style-name="Head 4" text:level="4" >Structs</text:h><text:h text:style-name="Head 4" text:level="4" >Constant Groups and Enums</text:h><text:h text:style-name="Head 4" text:level="4" >Sequences</text:h><text:h text:style-name="Head 4" text:level="4" >Exceptions</text:h><text:h text:style-name="Head 3" text:level="3" >API Principles</text:h><text:h text:style-name="Head 4" text:level="4" >Relationship between Specification, Implementation and Instances</text:h><text:h text:style-name="Head 4" text:level="4" >Object Composition</text:h><text:h text:style-name="Head 2" text:level="2" >UNO Concepts</text:h><text:p text:style-name="Paragraph" >UNO is an environment for networked object communication</text:p><text:h text:style-name="Head 3" text:level="3" >Interprocess Connections</text:h><text:h text:style-name="Head 3" text:level="3" >ServiceManager and ComponentContext</text:h><text:h text:style-name="Head 3" text:level="3" >Using UNO Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >Using Collections and Containers</text:h><text:h text:style-name="Head 3" text:level="3" >Event Model</text:h><text:h text:style-name="Head 3" text:level="3" >Exception Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Lifetime Control</text:h><text:h text:style-name="Head 3" text:level="3" >Object Identity</text:h><text:h text:style-name="Head 2" text:level="2" >Language Bindings</text:h><text:h text:style-name="Head 3" text:level="3" >Introduction for language binding</text:h><text:h text:style-name="Head 3" text:level="3" >Java Language Binding</text:h><text:h text:style-name="Head 3" text:level="3" >C++ Binding</text:h><text:h text:style-name="Head 3" text:level="3" >Access for [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 3" text:level="3" >Automation</text:h><text:h text:style-name="Head 1" text:level="1" >Writing UNO components</text:h><text:h text:style-name="Head 2" text:level="2" >Specifying a new Component</text:h><text:h text:style-name="Head 3" text:level="3" >UNOIDL language specification</text:h><text:h text:style-name="Head 2" text:level="2" >Implementing a Component</text:h><text:h text:style-name="Head 3" text:level="3" >Component Development Basics</text:h><text:unordered-list text:style-name="L1" ><text:list-item ><text:p text:style-name="P3" >Introduction</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >Mandatory interfaces: XInterface, XServiceInfo ((from UseInterfaces.CoreInterfaces))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >"Should be implemented" interfaces: XTypeProvider ((from UseInterfaces.CoreInterfaces ))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >optional interface: XMain for standalone execution</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Simple Component in Java</text:h><text:unordered-list text:style-name="L2" ><text:list-item ><text:p text:style-name="P4" >Getting the service manager ((Chapter Java components from unoBindingJava))</text:p></text:list-item><text:list-item ><text:p text:style-name="P4" >simple component chapter</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >C++ Component</text:h><text:h text:style-name="Head 3" text:level="3" >((Automation Component?))</text:h><text:h text:style-name="Head 2" text:level="2" >Deployment Options for Components</text:h><text:h text:style-name="Head 3" text:level="3" >Component Registration</text:h><text:h text:style-name="Head 3" text:level="3" >Service Manager Configuration</text:h><text:unordered-list text:style-name="L3" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P5" >XSet Interface</text:p><text:p text:style-name="P5" >Adding components during runtime, particularly interesting during development</text:p></text:list-item><text:list-item ><text:p text:style-name="P5" >ServiceManager Content</text:p><text:p text:style-name="P5" >Dynamically modifying the ServiceManager</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Bootstrapping the Service Manager ((from CppBind chapter))</text:h><text:unordered-list text:style-name="L4" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P6" >Simple Test Application</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >Configuring Your Application with Bootstrap Parameters</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >The UNO Executable</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Standalone Runtime Environment</text:h><text:p text:style-name="Paragraph" ><text:tab-stop ></text:tab-stop>The UNO executable and XMain</text:p><text:h text:style-name="Head 3" text:level="3" >Configuring the Java Runtime Environment</text:h><text:unordered-list text:style-name="L5" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P7" >The office and Java ((from UnoBindingJava))</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 1" text:level="1" >Advanced UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Design Patterns</text:h><text:h text:style-name="Head 2" text:level="2" >Bridging concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Requirements for Language Bindings and Bridges</text:h><text:h text:style-name="Head 3" text:level="3" >New Scripting Engines</text:h><text:h text:style-name="Head 2" text:level="2" >ServiceManager and loader</text:h><text:h text:style-name="Head 2" text:level="2" >Special Interfaces for internal use</text:h><text:p text:style-name="Paragraph" >XUNOTunnel</text:p><text:p text:style-name="Paragraph" >XAggregation</text:p><text:h text:style-name="Head 2" text:level="2" >UNO Reflection API</text:h><text:h text:style-name="Head 2" text:level="2" >TypeLibrary and TypeProviders</text:h><text:h text:style-name="Head 2" text:level="2" >Differences from Corba</text:h><text:h text:style-name="Head 1" text:level="1" >Office Development</text:h><text:h text:style-name="Head 2" text:level="2" >Global Object Structure</text:h><text:h text:style-name="Head 3" text:level="3" >Desktop Environment</text:h><text:h text:style-name="Head 3" text:level="3" >Frames and Frame Hierarchies</text:h><text:h text:style-name="Head 3" text:level="3" >Frame-Controller-Model Paradigm</text:h><text:h text:style-name="Head 3" text:level="3" >Loading and Saving Office Components</text:h><text:h text:style-name="Head 3" text:level="3" >Dispatch Framework</text:h><text:h text:style-name="Head 2" text:level="2" >Common Features</text:h><text:h text:style-name="Head 3" text:level="3" >Common Dialogs</text:h><text:h text:style-name="Head 3" text:level="3" >DocumentInfo</text:h><text:h text:style-name="Head 3" text:level="3" >Styles</text:h><text:h text:style-name="Head 3" text:level="3" >Search and Replace</text:h><text:h text:style-name="Head 3" text:level="3" >Number Formats</text:h><text:h text:style-name="Head 3" text:level="3" >Package File Formats</text:h><text:h text:style-name="Head 2" text:level="2" >Internationalization</text:h><text:h text:style-name="Head 2" text:level="2" >Linguistic</text:h><text:h text:style-name="Head 2" text:level="2" >System Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Clipboard</text:h><text:h text:style-name="Head 3" text:level="3" >File Picker</text:h><text:h text:style-name="Head 3" text:level="3" >Bridging to the Window System</text:h><text:p text:style-name="Paragraph" ></text:p><text:h text:style-name="Head 1" text:level="1" >Text Documents (51,5 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Text Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Text Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Using Text</text:h><text:h text:style-name="Head 3" text:level="3" >Tables</text:h><text:h text:style-name="Head 3" text:level="3" >Text Fields</text:h><text:h text:style-name="Head 3" text:level="3" >Bookmarks</text:h><text:h text:style-name="Head 3" text:level="3" >Indexes and Index Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Reference Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Footnotes and Endnotes</text:h><text:h text:style-name="Head 3" text:level="3" >Shape Objects in Text</text:h><text:h text:style-name="Head 3" text:level="3" >Redline</text:h><text:h text:style-name="Head 3" text:level="3" >Ruby</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Text Document</text:h><text:h text:style-name="Head 1" text:level="1" >Spreadsheet Documents</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Spreadsheet Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Spreadsheet Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Editing Spreadsheets</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Spreadsheet Document</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Spreadsheet Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Drawings and Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Draw/Impress Files</text:h><text:h text:style-name="Head 3" text:level="3" >Saving</text:h><text:h text:style-name="Head 3" text:level="3" >Printing</text:h><text:h text:style-name="Head 3" text:level="3" >Running Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Working with a Draw/Impress Document</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Draw/Impress Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Draw/Impress Document</text:h><text:h text:style-name="Head 1" text:level="1" >Charts</text:h><text:h text:style-name="Head 2" text:level="2" >Chart Basics</text:h><text:h text:style-name="Head 2" text:level="2" >Creating a Chart Document</text:h><text:h text:style-name="Head 2" text:level="2" >Editing a Chart Document</text:h><text:h text:style-name="Head 3" text:level="3" >Common Diagram API</text:h><text:h text:style-name="Head 3" text:level="3" >Different Chart Types</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Chart Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Basic and Dialogs</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:h text:style-name="Head 2" text:level="2" >Library Organization</text:h><text:h text:style-name="Head 2" text:level="2" >IDE with Dialogs and Events</text:h><text:h text:style-name="Head 2" text:level="2" >Using [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 2" text:level="2" >Toolkit Controls and their Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating Dialogs at Runtime</text:h><text:h text:style-name="Head 1" text:level="1" >Database Access</text:h><text:h text:style-name="Head 2" text:level="2" >Features of the [PRODUCTNAME] Database Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Capabilities</text:h><text:h text:style-name="Head 3" text:level="3" >SDBC, SDBCX, SDB Architecture</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Datasources with [PRODUCTNAME]</text:h><text:h text:style-name="Head 3" text:level="3" >DataSources</text:h><text:h text:style-name="Head 3" text:level="3" >Adding and Editing Datasources </text:h><text:h text:style-name="Head 3" text:level="3" >Establishing a Connection</text:h><text:h text:style-name="Head 4" text:level="4" >Getting Connections</text:h><text:h text:style-name="Head 4" text:level="4" >Driver specifics</text:h><text:h text:style-name="Head 3" text:level="3" >Connection Pooling</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Saved Queries</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Data</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Statements</text:h><text:h text:style-name="Head 3" text:level="3" >Resultsets</text:h><text:h text:style-name="Head 3" text:level="3" >Metadata</text:h><text:h text:style-name="Head 3" text:level="3" >Rowsets</text:h><text:h text:style-name="Head 2" text:level="2" >Working with the Database Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using DDL to change the DB Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using SDBCX to access the DB Design</text:h><text:h text:style-name="Head 2" text:level="2" >Using DBMS Features</text:h><text:h text:style-name="Head 3" text:level="3" >Stored Procedures</text:h><text:h text:style-name="Head 3" text:level="3" >Transaction Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Prepared Statements</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Database Drivers</text:h><text:h text:style-name="Head 1" text:level="1" >Forms</text:h><text:h text:style-name="Head 2" text:level="2" >Concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Models and Views</text:h><text:h text:style-name="Head 3" text:level="3" >Form Elements in the Document Model</text:h><text:h text:style-name="Head 3" text:level="3" >Special Form Components</text:h><text:h text:style-name="Head 3" text:level="3" >Events</text:h><text:h text:style-name="Head 3" text:level="3" >Data Awareness</text:h><text:h text:style-name="Head 2" text:level="2" >Recipes</text:h><text:h text:style-name="Head 3" text:level="3" >Making it easier to work with a Form</text:h><text:h text:style-name="Head 3" text:level="3" >Controlling the Data Input</text:h><text:h text:style-name="Head 3" text:level="3" >Collecting Data automatically</text:h><text:h text:style-name="Head 3" text:level="3" >Taking Advantage of Database Server Features</text:h><text:h text:style-name="Head 3" text:level="3" >Adding new Functionality</text:h><text:h text:style-name="Head 3" text:level="3" >Handling Errors</text:h><text:h text:style-name="Head 1" text:level="1" >UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Purpose of UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Document Contents as Streams</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Content Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating, Moving and Copying Document and Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Additional Commands</text:h><text:h text:style-name="Head 2" text:level="2" >Writing a Content Provider</text:h><text:h text:style-name="Head 1" text:level="1" >[PRODUCTNAME] Configuration</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing configuration data</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Configuration Data</text:h><text:h text:style-name="Head 1" text:level="1" >Appendix</text:h></office:body> + +<office:body ><text:sequence-decls ><text:sequence-decl text:display-outline-level="0" text:name="Illustration" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Table" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Text" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Drawing" ></text:sequence-decl></text:sequence-decls><text:p text:style-name="P1" >Programmer's Manual</text:p><text:p text:style-name="P2" >Planned Outline</text:p><text:p text:style-name="P2" ></text:p><text:h text:style-name="Head 1" text:level="1" >Preface (3 Pages)</text:h><text:h text:style-name="Head 1" text:level="1" >First Steps (24 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Programming with UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Fields of Application for UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Getting Started</text:h><text:h text:style-name="Head 3" text:level="3" >Required Files</text:h><text:h text:style-name="Head 3" text:level="3" >Configuration</text:h><text:h text:style-name="Head 3" text:level="3" >First Connection</text:h><text:h text:style-name="Head 2" text:level="2" >How to get Objects in [PRODUCTNAME]</text:h><text:h text:style-name="Head 2" text:level="2" >How to work with Objects</text:h><text:p text:style-name="Paragraph" >Example</text:p><text:h text:style-name="Head 3" text:level="3" >Services</text:h><text:h text:style-name="Head 3" text:level="3" >Querying Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >ElementAccess</text:h><text:h text:style-name="Head 3" text:level="3" >Simple Types</text:h><text:h text:style-name="Head 3" text:level="3" >Strings</text:h><text:h text:style-name="Head 3" text:level="3" >Enums and Constant Groups</text:h><text:h text:style-name="Head 3" text:level="3" >Structs</text:h><text:h text:style-name="Head 3" text:level="3" >Any</text:h><text:h text:style-name="Head 3" text:level="3" >Sequence</text:h><text:h text:style-name="Head 2" text:level="2" >How to find the solution for a problem</text:h><text:h text:style-name="Head 2" text:level="2" >Finding your Way through the API Reference</text:h><text:h text:style-name="Head 2" text:level="2" >Common Mechanisms</text:h><text:h text:style-name="Head 3" text:level="3" >Text</text:h><text:h text:style-name="Head 3" text:level="3" >Table</text:h><text:h text:style-name="Head 3" text:level="3" >Drawing</text:h><text:h text:style-name="Head 1" text:level="1" >UNO in Professional Projects (<text:span text:style-name="T1" >145</text:span>)</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:p text:style-name="Paragraph" >UNO/API constituents: How UNOIDL/API, ServiceManager, Bridges, CoreReflection work together</text:p><text:h text:style-name="Head 2" text:level="2" >API Concepts</text:h><text:p text:style-name="Paragraph" >API is a language independent, abstract specification for UNO objects which are used in <text:s ></text:s>[PRODUCTNAME]</text:p><text:h text:style-name="Head 3" text:level="3" >Types in the API Reference</text:h><text:h text:style-name="Head 4" text:level="4" >Simple Types</text:h><text:h text:style-name="Head 4" text:level="4" >The Any Type</text:h><text:h text:style-name="Head 4" text:level="4" >Interfaces</text:h><text:h text:style-name="Head 4" text:level="4" >Services</text:h><text:h text:style-name="Head 4" text:level="4" >Modules</text:h><text:h text:style-name="Head 4" text:level="4" >Structs</text:h><text:h text:style-name="Head 4" text:level="4" >Constant Groups and Enums</text:h><text:h text:style-name="Head 4" text:level="4" >Sequences</text:h><text:h text:style-name="Head 4" text:level="4" >Exceptions</text:h><text:h text:style-name="Head 3" text:level="3" >API Principles</text:h><text:h text:style-name="Head 4" text:level="4" >Relationship between Specification, Implementation and Instances</text:h><text:h text:style-name="Head 4" text:level="4" >Object Composition</text:h><text:h text:style-name="Head 2" text:level="2" >UNO Concepts</text:h><text:p text:style-name="Paragraph" >UNO is an environment for networked object communication</text:p><text:h text:style-name="Head 3" text:level="3" >Interprocess Connections</text:h><text:h text:style-name="Head 3" text:level="3" >ServiceManager and ComponentContext</text:h><text:h text:style-name="Head 3" text:level="3" >Using UNO Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >Using Collections and Containers</text:h><text:h text:style-name="Head 3" text:level="3" >Event Model</text:h><text:h text:style-name="Head 3" text:level="3" >Exception Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Lifetime Control</text:h><text:h text:style-name="Head 3" text:level="3" >Object Identity</text:h><text:h text:style-name="Head 2" text:level="2" >Language Bindings</text:h><text:h text:style-name="Head 3" text:level="3" >Introduction for language binding</text:h><text:h text:style-name="Head 3" text:level="3" >Java Language Binding</text:h><text:h text:style-name="Head 3" text:level="3" >C++ Binding</text:h><text:h text:style-name="Head 3" text:level="3" >Access for [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 3" text:level="3" >Automation</text:h><text:h text:style-name="Head 1" text:level="1" >Writing UNO components</text:h><text:h text:style-name="Head 2" text:level="2" >Specifying a new Component</text:h><text:h text:style-name="Head 3" text:level="3" >UNOIDL language specification</text:h><text:h text:style-name="Head 2" text:level="2" >Implementing a Component</text:h><text:h text:style-name="Head 3" text:level="3" >Component Development Basics</text:h><text:unordered-list text:style-name="L1" ><text:list-item ><text:p text:style-name="P3" >Introduction</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >Mandatory interfaces: XInterface, XServiceInfo ((from UseInterfaces.CoreInterfaces))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >"Should be implemented" interfaces: XTypeProvider ((from UseInterfaces.CoreInterfaces ))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >optional interface: XMain for standalone execution</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Simple Component in Java</text:h><text:unordered-list text:style-name="L2" ><text:list-item ><text:p text:style-name="P4" >Getting the service manager ((Chapter Java components from unoBindingJava))</text:p></text:list-item><text:list-item ><text:p text:style-name="P4" >simple component chapter</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >C++ Component</text:h><text:h text:style-name="Head 3" text:level="3" >((Automation Component?))</text:h><text:h text:style-name="Head 2" text:level="2" >Deployment Options for Components</text:h><text:h text:style-name="Head 3" text:level="3" >Component Registration</text:h><text:h text:style-name="Head 3" text:level="3" >Service Manager Configuration</text:h><text:unordered-list text:style-name="L3" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P5" >XSet Interface</text:p><text:p text:style-name="P5" >Adding components during runtime, particularly interesting during development</text:p></text:list-item><text:list-item ><text:p text:style-name="P5" >ServiceManager Content</text:p><text:p text:style-name="P5" >Dynamically modifying the ServiceManager</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Bootstrapping the Service Manager ((from CppBind chapter))</text:h><text:unordered-list text:style-name="L4" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P6" >Simple Test Application</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >Configuring Your Application with Bootstrap Parameters</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >The UNO Executable</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Standalone Runtime Environment</text:h><text:p text:style-name="Paragraph" ><text:tab-stop ></text:tab-stop>The UNO executable and XMain</text:p><text:h text:style-name="Head 3" text:level="3" >Configuring the Java Runtime Environment</text:h><text:unordered-list text:style-name="L5" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P7" >The office and Java ((from UnoBindingJava))</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 1" text:level="1" >Advanced UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Design Patterns</text:h><text:h text:style-name="Head 2" text:level="2" >Bridging concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Requirements for Language Bindings and Bridges</text:h><text:h text:style-name="Head 3" text:level="3" >New Scripting Engines</text:h><text:h text:style-name="Head 2" text:level="2" >ServiceManager and loader</text:h><text:h text:style-name="Head 2" text:level="2" >Special Interfaces for internal use</text:h><text:p text:style-name="Paragraph" >XUNOTunnel</text:p><text:p text:style-name="Paragraph" >XAggregation</text:p><text:h text:style-name="Head 2" text:level="2" >UNO Reflection API</text:h><text:h text:style-name="Head 2" text:level="2" >TypeLibrary and TypeProviders</text:h><text:h text:style-name="Head 2" text:level="2" >Differences from Corba</text:h><text:h text:style-name="Head 1" text:level="1" >Office Development</text:h><text:h text:style-name="Head 2" text:level="2" >Global Object Structure</text:h><text:h text:style-name="Head 3" text:level="3" >Desktop Environment</text:h><text:h text:style-name="Head 3" text:level="3" >Frames and Frame Hierarchies</text:h><text:h text:style-name="Head 3" text:level="3" >Frame-Controller-Model Paradigm</text:h><text:h text:style-name="Head 3" text:level="3" >Loading and Saving Office Components</text:h><text:h text:style-name="Head 3" text:level="3" >Dispatch Framework</text:h><text:h text:style-name="Head 2" text:level="2" >Common Features</text:h><text:h text:style-name="Head 3" text:level="3" >Common Dialogs</text:h><text:h text:style-name="Head 3" text:level="3" >DocumentInfo</text:h><text:h text:style-name="Head 3" text:level="3" >Styles</text:h><text:h text:style-name="Head 3" text:level="3" >Search and Replace</text:h><text:h text:style-name="Head 3" text:level="3" >Number Formats</text:h><text:h text:style-name="Head 3" text:level="3" >Package File Formats</text:h><text:h text:style-name="Head 2" text:level="2" >Internationalization</text:h><text:h text:style-name="Head 2" text:level="2" >Linguistic</text:h><text:h text:style-name="Head 2" text:level="2" >System Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Clipboard</text:h><text:h text:style-name="Head 3" text:level="3" >File Picker</text:h><text:h text:style-name="Head 3" text:level="3" >Bridging to the Window System</text:h><text:p text:style-name="Paragraph" ></text:p><text:h text:style-name="Head 1" text:level="1" >Text Documents (51,5 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Text Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Text Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Using Text</text:h><text:h text:style-name="Head 3" text:level="3" >Tables</text:h><text:h text:style-name="Head 3" text:level="3" >Text Fields</text:h><text:h text:style-name="Head 3" text:level="3" >Bookmarks</text:h><text:h text:style-name="Head 3" text:level="3" >Indexes and Index Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Reference Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Footnotes and Endnotes</text:h><text:h text:style-name="Head 3" text:level="3" >Shape Objects in Text</text:h><text:h text:style-name="Head 3" text:level="3" >Redline</text:h><text:h text:style-name="Head 3" text:level="3" >Ruby</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Text Document</text:h><text:h text:style-name="Head 1" text:level="1" >Spreadsheet Documents</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Spreadsheet Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Spreadsheet Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Editing Spreadsheets</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Spreadsheet Document</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Spreadsheet Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Drawings and Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Draw/Impress Files</text:h><text:h text:style-name="Head 3" text:level="3" >Saving</text:h><text:h text:style-name="Head 3" text:level="3" >Printing</text:h><text:h text:style-name="Head 3" text:level="3" >Running Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Working with a Draw/Impress Document</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Draw/Impress Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Draw/Impress Document</text:h><text:h text:style-name="Head 1" text:level="1" >Charts</text:h><text:h text:style-name="Head 2" text:level="2" >Chart Basics</text:h><text:h text:style-name="Head 2" text:level="2" >Creating a Chart Document</text:h><text:h text:style-name="Head 2" text:level="2" >Editing a Chart Document</text:h><text:h text:style-name="Head 3" text:level="3" >Common Diagram API</text:h><text:h text:style-name="Head 3" text:level="3" >Different Chart Types</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Chart Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Basic and Dialogs</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:h text:style-name="Head 2" text:level="2" >Library Organization</text:h><text:h text:style-name="Head 2" text:level="2" >IDE with Dialogs and Events</text:h><text:h text:style-name="Head 2" text:level="2" >Using [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 2" text:level="2" >Toolkit Controls and their Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating Dialogs at Runtime</text:h><text:h text:style-name="Head 1" text:level="1" >Database Access</text:h><text:h text:style-name="Head 2" text:level="2" >Features of the [PRODUCTNAME] Database Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Capabilities</text:h><text:h text:style-name="Head 3" text:level="3" >SDBC, SDBCX, SDB Architecture</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Datasources with [PRODUCTNAME]</text:h><text:h text:style-name="Head 3" text:level="3" >DataSources</text:h><text:h text:style-name="Head 3" text:level="3" >Adding and Editing Datasources </text:h><text:h text:style-name="Head 3" text:level="3" >Establishing a Connection</text:h><text:h text:style-name="Head 4" text:level="4" >Getting Connections</text:h><text:h text:style-name="Head 4" text:level="4" >Driver specifics</text:h><text:h text:style-name="Head 3" text:level="3" >Connection Pooling</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Saved Queries</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Data</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Statements</text:h><text:h text:style-name="Head 3" text:level="3" >Resultsets</text:h><text:h text:style-name="Head 3" text:level="3" >Metadata</text:h><text:h text:style-name="Head 3" text:level="3" >Rowsets</text:h><text:h text:style-name="Head 2" text:level="2" >Working with the Database Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using DDL to change the DB Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using SDBCX to access the DB Design</text:h><text:h text:style-name="Head 2" text:level="2" >Using DBMS Features</text:h><text:h text:style-name="Head 3" text:level="3" >Stored Procedures</text:h><text:h text:style-name="Head 3" text:level="3" >Transaction Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Prepared Statements</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Database Drivers</text:h><text:h text:style-name="Head 1" text:level="1" >Forms</text:h><text:h text:style-name="Head 2" text:level="2" >Concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Models and Views</text:h><text:h text:style-name="Head 3" text:level="3" >Form Elements in the Document Model</text:h><text:h text:style-name="Head 3" text:level="3" >Special Form Components</text:h><text:h text:style-name="Head 3" text:level="3" >Events</text:h><text:h text:style-name="Head 3" text:level="3" >Data Awareness</text:h><text:h text:style-name="Head 2" text:level="2" >Recipes</text:h><text:h text:style-name="Head 3" text:level="3" >Making it easier to work with a Form</text:h><text:h text:style-name="Head 3" text:level="3" >Controlling the Data Input</text:h><text:h text:style-name="Head 3" text:level="3" >Collecting Data automatically</text:h><text:h text:style-name="Head 3" text:level="3" >Taking Advantage of Database Server Features</text:h><text:h text:style-name="Head 3" text:level="3" >Adding new Functionality</text:h><text:h text:style-name="Head 3" text:level="3" >Handling Errors</text:h><text:h text:style-name="Head 1" text:level="1" >UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Purpose of UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Document Contents as Streams</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Content Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating, Moving and Copying Document and Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Additional Commands</text:h><text:h text:style-name="Head 2" text:level="2" >Writing a Content Provider</text:h><text:h text:style-name="Head 1" text:level="1" >[PRODUCTNAME] Configuration</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing configuration data</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Configuration Data</text:h><text:h text:style-name="Head 1" text:level="1" >Appendix</text:h></office:body> + +<office:body ><text:sequence-decls ><text:sequence-decl text:display-outline-level="0" text:name="Illustration" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Table" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Text" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Drawing" ></text:sequence-decl></text:sequence-decls><text:p text:style-name="P1" >Programmer's Manual</text:p><text:p text:style-name="P2" >Planned Outline</text:p><text:p text:style-name="P2" ></text:p><text:h text:style-name="Head 1" text:level="1" >Preface (3 Pages)</text:h><text:h text:style-name="Head 1" text:level="1" >First Steps (24 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Programming with UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Fields of Application for UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Getting Started</text:h><text:h text:style-name="Head 3" text:level="3" >Required Files</text:h><text:h text:style-name="Head 3" text:level="3" >Configuration</text:h><text:h text:style-name="Head 3" text:level="3" >First Connection</text:h><text:h text:style-name="Head 2" text:level="2" >How to get Objects in [PRODUCTNAME]</text:h><text:h text:style-name="Head 2" text:level="2" >How to work with Objects</text:h><text:p text:style-name="Paragraph" >Example</text:p><text:h text:style-name="Head 3" text:level="3" >Services</text:h><text:h text:style-name="Head 3" text:level="3" >Querying Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >ElementAccess</text:h><text:h text:style-name="Head 3" text:level="3" >Simple Types</text:h><text:h text:style-name="Head 3" text:level="3" >Strings</text:h><text:h text:style-name="Head 3" text:level="3" >Enums and Constant Groups</text:h><text:h text:style-name="Head 3" text:level="3" >Structs</text:h><text:h text:style-name="Head 3" text:level="3" >Any</text:h><text:h text:style-name="Head 3" text:level="3" >Sequence</text:h><text:h text:style-name="Head 2" text:level="2" >How to find the solution for a problem</text:h><text:h text:style-name="Head 2" text:level="2" >Finding your Way through the API Reference</text:h><text:h text:style-name="Head 2" text:level="2" >Common Mechanisms</text:h><text:h text:style-name="Head 3" text:level="3" >Text</text:h><text:h text:style-name="Head 3" text:level="3" >Table</text:h><text:h text:style-name="Head 3" text:level="3" >Drawing</text:h><text:h text:style-name="Head 1" text:level="1" >UNO in Professional Projects (<text:span text:style-name="T1" >145</text:span>)</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:p text:style-name="Paragraph" >UNO/API constituents: How UNOIDL/API, ServiceManager, Bridges, CoreReflection work together</text:p><text:h text:style-name="Head 2" text:level="2" >API Concepts</text:h><text:p text:style-name="Paragraph" >API is a language independent, abstract specification for UNO objects which are used in <text:s ></text:s>[PRODUCTNAME]</text:p><text:h text:style-name="Head 3" text:level="3" >Types in the API Reference</text:h><text:h text:style-name="Head 4" text:level="4" >Simple Types</text:h><text:h text:style-name="Head 4" text:level="4" >The Any Type</text:h><text:h text:style-name="Head 4" text:level="4" >Interfaces</text:h><text:h text:style-name="Head 4" text:level="4" >Services</text:h><text:h text:style-name="Head 4" text:level="4" >Modules</text:h><text:h text:style-name="Head 4" text:level="4" >Structs</text:h><text:h text:style-name="Head 4" text:level="4" >Constant Groups and Enums</text:h><text:h text:style-name="Head 4" text:level="4" >Sequences</text:h><text:h text:style-name="Head 4" text:level="4" >Exceptions</text:h><text:h text:style-name="Head 3" text:level="3" >API Principles</text:h><text:h text:style-name="Head 4" text:level="4" >Relationship between Specification, Implementation and Instances</text:h><text:h text:style-name="Head 4" text:level="4" >Object Composition</text:h><text:h text:style-name="Head 2" text:level="2" >UNO Concepts</text:h><text:p text:style-name="Paragraph" >UNO is an environment for networked object communication</text:p><text:h text:style-name="Head 3" text:level="3" >Interprocess Connections</text:h><text:h text:style-name="Head 3" text:level="3" >ServiceManager and ComponentContext</text:h><text:h text:style-name="Head 3" text:level="3" >Using UNO Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >Using Collections and Containers</text:h><text:h text:style-name="Head 3" text:level="3" >Event Model</text:h><text:h text:style-name="Head 3" text:level="3" >Exception Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Lifetime Control</text:h><text:h text:style-name="Head 3" text:level="3" >Object Identity</text:h><text:h text:style-name="Head 2" text:level="2" >Language Bindings</text:h><text:h text:style-name="Head 3" text:level="3" >Introduction for language binding</text:h><text:h text:style-name="Head 3" text:level="3" >Java Language Binding</text:h><text:h text:style-name="Head 3" text:level="3" >C++ Binding</text:h><text:h text:style-name="Head 3" text:level="3" >Access for [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 3" text:level="3" >Automation</text:h><text:h text:style-name="Head 1" text:level="1" >Writing UNO components</text:h><text:h text:style-name="Head 2" text:level="2" >Specifying a new Component</text:h><text:h text:style-name="Head 3" text:level="3" >UNOIDL language specification</text:h><text:h text:style-name="Head 2" text:level="2" >Implementing a Component</text:h><text:h text:style-name="Head 3" text:level="3" >Component Development Basics</text:h><text:unordered-list text:style-name="L1" ><text:list-item ><text:p text:style-name="P3" >Introduction</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >Mandatory interfaces: XInterface, XServiceInfo ((from UseInterfaces.CoreInterfaces))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >"Should be implemented" interfaces: XTypeProvider ((from UseInterfaces.CoreInterfaces ))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >optional interface: XMain for standalone execution</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Simple Component in Java</text:h><text:unordered-list text:style-name="L2" ><text:list-item ><text:p text:style-name="P4" >Getting the service manager ((Chapter Java components from unoBindingJava))</text:p></text:list-item><text:list-item ><text:p text:style-name="P4" >simple component chapter</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >C++ Component</text:h><text:h text:style-name="Head 3" text:level="3" >((Automation Component?))</text:h><text:h text:style-name="Head 2" text:level="2" >Deployment Options for Components</text:h><text:h text:style-name="Head 3" text:level="3" >Component Registration</text:h><text:h text:style-name="Head 3" text:level="3" >Service Manager Configuration</text:h><text:unordered-list text:style-name="L3" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P5" >XSet Interface</text:p><text:p text:style-name="P5" >Adding components during runtime, particularly interesting during development</text:p></text:list-item><text:list-item ><text:p text:style-name="P5" >ServiceManager Content</text:p><text:p text:style-name="P5" >Dynamically modifying the ServiceManager</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Bootstrapping the Service Manager ((from CppBind chapter))</text:h><text:unordered-list text:style-name="L4" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P6" >Simple Test Application</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >Configuring Your Application with Bootstrap Parameters</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >The UNO Executable</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Standalone Runtime Environment</text:h><text:p text:style-name="Paragraph" ><text:tab-stop ></text:tab-stop>The UNO executable and XMain</text:p><text:h text:style-name="Head 3" text:level="3" >Configuring the Java Runtime Environment</text:h><text:unordered-list text:style-name="L5" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P7" >The office and Java ((from UnoBindingJava))</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 1" text:level="1" >Advanced UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Design Patterns</text:h><text:h text:style-name="Head 2" text:level="2" >Bridging concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Requirements for Language Bindings and Bridges</text:h><text:h text:style-name="Head 3" text:level="3" >New Scripting Engines</text:h><text:h text:style-name="Head 2" text:level="2" >ServiceManager and loader</text:h><text:h text:style-name="Head 2" text:level="2" >Special Interfaces for internal use</text:h><text:p text:style-name="Paragraph" >XUNOTunnel</text:p><text:p text:style-name="Paragraph" >XAggregation</text:p><text:h text:style-name="Head 2" text:level="2" >UNO Reflection API</text:h><text:h text:style-name="Head 2" text:level="2" >TypeLibrary and TypeProviders</text:h><text:h text:style-name="Head 2" text:level="2" >Differences from Corba</text:h><text:h text:style-name="Head 1" text:level="1" >Office Development</text:h><text:h text:style-name="Head 2" text:level="2" >Global Object Structure</text:h><text:h text:style-name="Head 3" text:level="3" >Desktop Environment</text:h><text:h text:style-name="Head 3" text:level="3" >Frames and Frame Hierarchies</text:h><text:h text:style-name="Head 3" text:level="3" >Frame-Controller-Model Paradigm</text:h><text:h text:style-name="Head 3" text:level="3" >Loading and Saving Office Components</text:h><text:h text:style-name="Head 3" text:level="3" >Dispatch Framework</text:h><text:h text:style-name="Head 2" text:level="2" >Common Features</text:h><text:h text:style-name="Head 3" text:level="3" >Common Dialogs</text:h><text:h text:style-name="Head 3" text:level="3" >DocumentInfo</text:h><text:h text:style-name="Head 3" text:level="3" >Styles</text:h><text:h text:style-name="Head 3" text:level="3" >Search and Replace</text:h><text:h text:style-name="Head 3" text:level="3" >Number Formats</text:h><text:h text:style-name="Head 3" text:level="3" >Package File Formats</text:h><text:h text:style-name="Head 2" text:level="2" >Internationalization</text:h><text:h text:style-name="Head 2" text:level="2" >Linguistic</text:h><text:h text:style-name="Head 2" text:level="2" >System Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Clipboard</text:h><text:h text:style-name="Head 3" text:level="3" >File Picker</text:h><text:h text:style-name="Head 3" text:level="3" >Bridging to the Window System</text:h><text:p text:style-name="Paragraph" ></text:p><text:h text:style-name="Head 1" text:level="1" >Text Documents (51,5 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Text Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Text Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Using Text</text:h><text:h text:style-name="Head 3" text:level="3" >Tables</text:h><text:h text:style-name="Head 3" text:level="3" >Text Fields</text:h><text:h text:style-name="Head 3" text:level="3" >Bookmarks</text:h><text:h text:style-name="Head 3" text:level="3" >Indexes and Index Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Reference Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Footnotes and Endnotes</text:h><text:h text:style-name="Head 3" text:level="3" >Shape Objects in Text</text:h><text:h text:style-name="Head 3" text:level="3" >Redline</text:h><text:h text:style-name="Head 3" text:level="3" >Ruby</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Text Document</text:h><text:h text:style-name="Head 1" text:level="1" >Spreadsheet Documents</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Spreadsheet Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Spreadsheet Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Editing Spreadsheets</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Spreadsheet Document</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Spreadsheet Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Drawings and Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Draw/Impress Files</text:h><text:h text:style-name="Head 3" text:level="3" >Saving</text:h><text:h text:style-name="Head 3" text:level="3" >Printing</text:h><text:h text:style-name="Head 3" text:level="3" >Running Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Working with a Draw/Impress Document</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Draw/Impress Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Draw/Impress Document</text:h><text:h text:style-name="Head 1" text:level="1" >Charts</text:h><text:h text:style-name="Head 2" text:level="2" >Chart Basics</text:h><text:h text:style-name="Head 2" text:level="2" >Creating a Chart Document</text:h><text:h text:style-name="Head 2" text:level="2" >Editing a Chart Document</text:h><text:h text:style-name="Head 3" text:level="3" >Common Diagram API</text:h><text:h text:style-name="Head 3" text:level="3" >Different Chart Types</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Chart Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Basic and Dialogs</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:h text:style-name="Head 2" text:level="2" >Library Organization</text:h><text:h text:style-name="Head 2" text:level="2" >IDE with Dialogs and Events</text:h><text:h text:style-name="Head 2" text:level="2" >Using [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 2" text:level="2" >Toolkit Controls and their Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating Dialogs at Runtime</text:h><text:h text:style-name="Head 1" text:level="1" >Database Access</text:h><text:h text:style-name="Head 2" text:level="2" >Features of the [PRODUCTNAME] Database Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Capabilities</text:h><text:h text:style-name="Head 3" text:level="3" >SDBC, SDBCX, SDB Architecture</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Datasources with [PRODUCTNAME]</text:h><text:h text:style-name="Head 3" text:level="3" >DataSources</text:h><text:h text:style-name="Head 3" text:level="3" >Adding and Editing Datasources </text:h><text:h text:style-name="Head 3" text:level="3" >Establishing a Connection</text:h><text:h text:style-name="Head 4" text:level="4" >Getting Connections</text:h><text:h text:style-name="Head 4" text:level="4" >Driver specifics</text:h><text:h text:style-name="Head 3" text:level="3" >Connection Pooling</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Saved Queries</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Data</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Statements</text:h><text:h text:style-name="Head 3" text:level="3" >Resultsets</text:h><text:h text:style-name="Head 3" text:level="3" >Metadata</text:h><text:h text:style-name="Head 3" text:level="3" >Rowsets</text:h><text:h text:style-name="Head 2" text:level="2" >Working with the Database Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using DDL to change the DB Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using SDBCX to access the DB Design</text:h><text:h text:style-name="Head 2" text:level="2" >Using DBMS Features</text:h><text:h text:style-name="Head 3" text:level="3" >Stored Procedures</text:h><text:h text:style-name="Head 3" text:level="3" >Transaction Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Prepared Statements</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Database Drivers</text:h><text:h text:style-name="Head 1" text:level="1" >Forms</text:h><text:h text:style-name="Head 2" text:level="2" >Concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Models and Views</text:h><text:h text:style-name="Head 3" text:level="3" >Form Elements in the Document Model</text:h><text:h text:style-name="Head 3" text:level="3" >Special Form Components</text:h><text:h text:style-name="Head 3" text:level="3" >Events</text:h><text:h text:style-name="Head 3" text:level="3" >Data Awareness</text:h><text:h text:style-name="Head 2" text:level="2" >Recipes</text:h><text:h text:style-name="Head 3" text:level="3" >Making it easier to work with a Form</text:h><text:h text:style-name="Head 3" text:level="3" >Controlling the Data Input</text:h><text:h text:style-name="Head 3" text:level="3" >Collecting Data automatically</text:h><text:h text:style-name="Head 3" text:level="3" >Taking Advantage of Database Server Features</text:h><text:h text:style-name="Head 3" text:level="3" >Adding new Functionality</text:h><text:h text:style-name="Head 3" text:level="3" >Handling Errors</text:h><text:h text:style-name="Head 1" text:level="1" >UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Purpose of UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Document Contents as Streams</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Content Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating, Moving and Copying Document and Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Additional Commands</text:h><text:h text:style-name="Head 2" text:level="2" >Writing a Content Provider</text:h><text:h text:style-name="Head 1" text:level="1" >[PRODUCTNAME] Configuration</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing configuration data</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Configuration Data</text:h><text:h text:style-name="Head 1" text:level="1" >Appendix</text:h></office:body> + +<office:body ><text:sequence-decls ><text:sequence-decl text:display-outline-level="0" text:name="Illustration" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Table" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Text" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Drawing" ></text:sequence-decl></text:sequence-decls><text:p text:style-name="P1" >Programmer's Manual</text:p><text:p text:style-name="P2" >Planned Outline</text:p><text:p text:style-name="P2" ></text:p><text:h text:style-name="Head 1" text:level="1" >Preface (3 Pages)</text:h><text:h text:style-name="Head 1" text:level="1" >First Steps (24 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Programming with UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Fields of Application for UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Getting Started</text:h><text:h text:style-name="Head 3" text:level="3" >Required Files</text:h><text:h text:style-name="Head 3" text:level="3" >Configuration</text:h><text:h text:style-name="Head 3" text:level="3" >First Connection</text:h><text:h text:style-name="Head 2" text:level="2" >How to get Objects in [PRODUCTNAME]</text:h><text:h text:style-name="Head 2" text:level="2" >How to work with Objects</text:h><text:p text:style-name="Paragraph" >Example</text:p><text:h text:style-name="Head 3" text:level="3" >Services</text:h><text:h text:style-name="Head 3" text:level="3" >Querying Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >ElementAccess</text:h><text:h text:style-name="Head 3" text:level="3" >Simple Types</text:h><text:h text:style-name="Head 3" text:level="3" >Strings</text:h><text:h text:style-name="Head 3" text:level="3" >Enums and Constant Groups</text:h><text:h text:style-name="Head 3" text:level="3" >Structs</text:h><text:h text:style-name="Head 3" text:level="3" >Any</text:h><text:h text:style-name="Head 3" text:level="3" >Sequence</text:h><text:h text:style-name="Head 2" text:level="2" >How to find the solution for a problem</text:h><text:h text:style-name="Head 2" text:level="2" >Finding your Way through the API Reference</text:h><text:h text:style-name="Head 2" text:level="2" >Common Mechanisms</text:h><text:h text:style-name="Head 3" text:level="3" >Text</text:h><text:h text:style-name="Head 3" text:level="3" >Table</text:h><text:h text:style-name="Head 3" text:level="3" >Drawing</text:h><text:h text:style-name="Head 1" text:level="1" >UNO in Professional Projects (<text:span text:style-name="T1" >145</text:span>)</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:p text:style-name="Paragraph" >UNO/API constituents: How UNOIDL/API, ServiceManager, Bridges, CoreReflection work together</text:p><text:h text:style-name="Head 2" text:level="2" >API Concepts</text:h><text:p text:style-name="Paragraph" >API is a language independent, abstract specification for UNO objects which are used in <text:s ></text:s>[PRODUCTNAME]</text:p><text:h text:style-name="Head 3" text:level="3" >Types in the API Reference</text:h><text:h text:style-name="Head 4" text:level="4" >Simple Types</text:h><text:h text:style-name="Head 4" text:level="4" >The Any Type</text:h><text:h text:style-name="Head 4" text:level="4" >Interfaces</text:h><text:h text:style-name="Head 4" text:level="4" >Services</text:h><text:h text:style-name="Head 4" text:level="4" >Modules</text:h><text:h text:style-name="Head 4" text:level="4" >Structs</text:h><text:h text:style-name="Head 4" text:level="4" >Constant Groups and Enums</text:h><text:h text:style-name="Head 4" text:level="4" >Sequences</text:h><text:h text:style-name="Head 4" text:level="4" >Exceptions</text:h><text:h text:style-name="Head 3" text:level="3" >API Principles</text:h><text:h text:style-name="Head 4" text:level="4" >Relationship between Specification, Implementation and Instances</text:h><text:h text:style-name="Head 4" text:level="4" >Object Composition</text:h><text:h text:style-name="Head 2" text:level="2" >UNO Concepts</text:h><text:p text:style-name="Paragraph" >UNO is an environment for networked object communication</text:p><text:h text:style-name="Head 3" text:level="3" >Interprocess Connections</text:h><text:h text:style-name="Head 3" text:level="3" >ServiceManager and ComponentContext</text:h><text:h text:style-name="Head 3" text:level="3" >Using UNO Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >Using Collections and Containers</text:h><text:h text:style-name="Head 3" text:level="3" >Event Model</text:h><text:h text:style-name="Head 3" text:level="3" >Exception Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Lifetime Control</text:h><text:h text:style-name="Head 3" text:level="3" >Object Identity</text:h><text:h text:style-name="Head 2" text:level="2" >Language Bindings</text:h><text:h text:style-name="Head 3" text:level="3" >Introduction for language binding</text:h><text:h text:style-name="Head 3" text:level="3" >Java Language Binding</text:h><text:h text:style-name="Head 3" text:level="3" >C++ Binding</text:h><text:h text:style-name="Head 3" text:level="3" >Access for [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 3" text:level="3" >Automation</text:h><text:h text:style-name="Head 1" text:level="1" >Writing UNO components</text:h><text:h text:style-name="Head 2" text:level="2" >Specifying a new Component</text:h><text:h text:style-name="Head 3" text:level="3" >UNOIDL language specification</text:h><text:h text:style-name="Head 2" text:level="2" >Implementing a Component</text:h><text:h text:style-name="Head 3" text:level="3" >Component Development Basics</text:h><text:unordered-list text:style-name="L1" ><text:list-item ><text:p text:style-name="P3" >Introduction</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >Mandatory interfaces: XInterface, XServiceInfo ((from UseInterfaces.CoreInterfaces))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >"Should be implemented" interfaces: XTypeProvider ((from UseInterfaces.CoreInterfaces ))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >optional interface: XMain for standalone execution</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Simple Component in Java</text:h><text:unordered-list text:style-name="L2" ><text:list-item ><text:p text:style-name="P4" >Getting the service manager ((Chapter Java components from unoBindingJava))</text:p></text:list-item><text:list-item ><text:p text:style-name="P4" >simple component chapter</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >C++ Component</text:h><text:h text:style-name="Head 3" text:level="3" >((Automation Component?))</text:h><text:h text:style-name="Head 2" text:level="2" >Deployment Options for Components</text:h><text:h text:style-name="Head 3" text:level="3" >Component Registration</text:h><text:h text:style-name="Head 3" text:level="3" >Service Manager Configuration</text:h><text:unordered-list text:style-name="L3" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P5" >XSet Interface</text:p><text:p text:style-name="P5" >Adding components during runtime, particularly interesting during development</text:p></text:list-item><text:list-item ><text:p text:style-name="P5" >ServiceManager Content</text:p><text:p text:style-name="P5" >Dynamically modifying the ServiceManager</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Bootstrapping the Service Manager ((from CppBind chapter))</text:h><text:unordered-list text:style-name="L4" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P6" >Simple Test Application</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >Configuring Your Application with Bootstrap Parameters</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >The UNO Executable</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Standalone Runtime Environment</text:h><text:p text:style-name="Paragraph" ><text:tab-stop ></text:tab-stop>The UNO executable and XMain</text:p><text:h text:style-name="Head 3" text:level="3" >Configuring the Java Runtime Environment</text:h><text:unordered-list text:style-name="L5" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P7" >The office and Java ((from UnoBindingJava))</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 1" text:level="1" >Advanced UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Design Patterns</text:h><text:h text:style-name="Head 2" text:level="2" >Bridging concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Requirements for Language Bindings and Bridges</text:h><text:h text:style-name="Head 3" text:level="3" >New Scripting Engines</text:h><text:h text:style-name="Head 2" text:level="2" >ServiceManager and loader</text:h><text:h text:style-name="Head 2" text:level="2" >Special Interfaces for internal use</text:h><text:p text:style-name="Paragraph" >XUNOTunnel</text:p><text:p text:style-name="Paragraph" >XAggregation</text:p><text:h text:style-name="Head 2" text:level="2" >UNO Reflection API</text:h><text:h text:style-name="Head 2" text:level="2" >TypeLibrary and TypeProviders</text:h><text:h text:style-name="Head 2" text:level="2" >Differences from Corba</text:h><text:h text:style-name="Head 1" text:level="1" >Office Development</text:h><text:h text:style-name="Head 2" text:level="2" >Global Object Structure</text:h><text:h text:style-name="Head 3" text:level="3" >Desktop Environment</text:h><text:h text:style-name="Head 3" text:level="3" >Frames and Frame Hierarchies</text:h><text:h text:style-name="Head 3" text:level="3" >Frame-Controller-Model Paradigm</text:h><text:h text:style-name="Head 3" text:level="3" >Loading and Saving Office Components</text:h><text:h text:style-name="Head 3" text:level="3" >Dispatch Framework</text:h><text:h text:style-name="Head 2" text:level="2" >Common Features</text:h><text:h text:style-name="Head 3" text:level="3" >Common Dialogs</text:h><text:h text:style-name="Head 3" text:level="3" >DocumentInfo</text:h><text:h text:style-name="Head 3" text:level="3" >Styles</text:h><text:h text:style-name="Head 3" text:level="3" >Search and Replace</text:h><text:h text:style-name="Head 3" text:level="3" >Number Formats</text:h><text:h text:style-name="Head 3" text:level="3" >Package File Formats</text:h><text:h text:style-name="Head 2" text:level="2" >Internationalization</text:h><text:h text:style-name="Head 2" text:level="2" >Linguistic</text:h><text:h text:style-name="Head 2" text:level="2" >System Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Clipboard</text:h><text:h text:style-name="Head 3" text:level="3" >File Picker</text:h><text:h text:style-name="Head 3" text:level="3" >Bridging to the Window System</text:h><text:p text:style-name="Paragraph" ></text:p><text:h text:style-name="Head 1" text:level="1" >Text Documents (51,5 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Text Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Text Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Using Text</text:h><text:h text:style-name="Head 3" text:level="3" >Tables</text:h><text:h text:style-name="Head 3" text:level="3" >Text Fields</text:h><text:h text:style-name="Head 3" text:level="3" >Bookmarks</text:h><text:h text:style-name="Head 3" text:level="3" >Indexes and Index Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Reference Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Footnotes and Endnotes</text:h><text:h text:style-name="Head 3" text:level="3" >Shape Objects in Text</text:h><text:h text:style-name="Head 3" text:level="3" >Redline</text:h><text:h text:style-name="Head 3" text:level="3" >Ruby</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Text Document</text:h><text:h text:style-name="Head 1" text:level="1" >Spreadsheet Documents</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Spreadsheet Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Spreadsheet Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Editing Spreadsheets</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Spreadsheet Document</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Spreadsheet Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Drawings and Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Draw/Impress Files</text:h><text:h text:style-name="Head 3" text:level="3" >Saving</text:h><text:h text:style-name="Head 3" text:level="3" >Printing</text:h><text:h text:style-name="Head 3" text:level="3" >Running Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Working with a Draw/Impress Document</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Draw/Impress Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Draw/Impress Document</text:h><text:h text:style-name="Head 1" text:level="1" >Charts</text:h><text:h text:style-name="Head 2" text:level="2" >Chart Basics</text:h><text:h text:style-name="Head 2" text:level="2" >Creating a Chart Document</text:h><text:h text:style-name="Head 2" text:level="2" >Editing a Chart Document</text:h><text:h text:style-name="Head 3" text:level="3" >Common Diagram API</text:h><text:h text:style-name="Head 3" text:level="3" >Different Chart Types</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Chart Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Basic and Dialogs</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:h text:style-name="Head 2" text:level="2" >Library Organization</text:h><text:h text:style-name="Head 2" text:level="2" >IDE with Dialogs and Events</text:h><text:h text:style-name="Head 2" text:level="2" >Using [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 2" text:level="2" >Toolkit Controls and their Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating Dialogs at Runtime</text:h><text:h text:style-name="Head 1" text:level="1" >Database Access</text:h><text:h text:style-name="Head 2" text:level="2" >Features of the [PRODUCTNAME] Database Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Capabilities</text:h><text:h text:style-name="Head 3" text:level="3" >SDBC, SDBCX, SDB Architecture</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Datasources with [PRODUCTNAME]</text:h><text:h text:style-name="Head 3" text:level="3" >DataSources</text:h><text:h text:style-name="Head 3" text:level="3" >Adding and Editing Datasources </text:h><text:h text:style-name="Head 3" text:level="3" >Establishing a Connection</text:h><text:h text:style-name="Head 4" text:level="4" >Getting Connections</text:h><text:h text:style-name="Head 4" text:level="4" >Driver specifics</text:h><text:h text:style-name="Head 3" text:level="3" >Connection Pooling</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Saved Queries</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Data</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Statements</text:h><text:h text:style-name="Head 3" text:level="3" >Resultsets</text:h><text:h text:style-name="Head 3" text:level="3" >Metadata</text:h><text:h text:style-name="Head 3" text:level="3" >Rowsets</text:h><text:h text:style-name="Head 2" text:level="2" >Working with the Database Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using DDL to change the DB Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using SDBCX to access the DB Design</text:h><text:h text:style-name="Head 2" text:level="2" >Using DBMS Features</text:h><text:h text:style-name="Head 3" text:level="3" >Stored Procedures</text:h><text:h text:style-name="Head 3" text:level="3" >Transaction Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Prepared Statements</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Database Drivers</text:h><text:h text:style-name="Head 1" text:level="1" >Forms</text:h><text:h text:style-name="Head 2" text:level="2" >Concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Models and Views</text:h><text:h text:style-name="Head 3" text:level="3" >Form Elements in the Document Model</text:h><text:h text:style-name="Head 3" text:level="3" >Special Form Components</text:h><text:h text:style-name="Head 3" text:level="3" >Events</text:h><text:h text:style-name="Head 3" text:level="3" >Data Awareness</text:h><text:h text:style-name="Head 2" text:level="2" >Recipes</text:h><text:h text:style-name="Head 3" text:level="3" >Making it easier to work with a Form</text:h><text:h text:style-name="Head 3" text:level="3" >Controlling the Data Input</text:h><text:h text:style-name="Head 3" text:level="3" >Collecting Data automatically</text:h><text:h text:style-name="Head 3" text:level="3" >Taking Advantage of Database Server Features</text:h><text:h text:style-name="Head 3" text:level="3" >Adding new Functionality</text:h><text:h text:style-name="Head 3" text:level="3" >Handling Errors</text:h><text:h text:style-name="Head 1" text:level="1" >UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Purpose of UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Document Contents as Streams</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Content Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating, Moving and Copying Document and Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Additional Commands</text:h><text:h text:style-name="Head 2" text:level="2" >Writing a Content Provider</text:h><text:h text:style-name="Head 1" text:level="1" >[PRODUCTNAME] Configuration</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing configuration data</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Configuration Data</text:h><text:h text:style-name="Head 1" text:level="1" >Appendix</text:h></office:body> + +<office:body ><text:sequence-decls ><text:sequence-decl text:display-outline-level="0" text:name="Illustration" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Table" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Text" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Drawing" ></text:sequence-decl></text:sequence-decls><text:p text:style-name="P1" >Programmer's Manual</text:p><text:p text:style-name="P2" >Planned Outline</text:p><text:p text:style-name="P2" ></text:p><text:h text:style-name="Head 1" text:level="1" >Preface (3 Pages)</text:h><text:h text:style-name="Head 1" text:level="1" >First Steps (24 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Programming with UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Fields of Application for UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Getting Started</text:h><text:h text:style-name="Head 3" text:level="3" >Required Files</text:h><text:h text:style-name="Head 3" text:level="3" >Configuration</text:h><text:h text:style-name="Head 3" text:level="3" >First Connection</text:h><text:h text:style-name="Head 2" text:level="2" >How to get Objects in [PRODUCTNAME]</text:h><text:h text:style-name="Head 2" text:level="2" >How to work with Objects</text:h><text:p text:style-name="Paragraph" >Example</text:p><text:h text:style-name="Head 3" text:level="3" >Services</text:h><text:h text:style-name="Head 3" text:level="3" >Querying Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >ElementAccess</text:h><text:h text:style-name="Head 3" text:level="3" >Simple Types</text:h><text:h text:style-name="Head 3" text:level="3" >Strings</text:h><text:h text:style-name="Head 3" text:level="3" >Enums and Constant Groups</text:h><text:h text:style-name="Head 3" text:level="3" >Structs</text:h><text:h text:style-name="Head 3" text:level="3" >Any</text:h><text:h text:style-name="Head 3" text:level="3" >Sequence</text:h><text:h text:style-name="Head 2" text:level="2" >How to find the solution for a problem</text:h><text:h text:style-name="Head 2" text:level="2" >Finding your Way through the API Reference</text:h><text:h text:style-name="Head 2" text:level="2" >Common Mechanisms</text:h><text:h text:style-name="Head 3" text:level="3" >Text</text:h><text:h text:style-name="Head 3" text:level="3" >Table</text:h><text:h text:style-name="Head 3" text:level="3" >Drawing</text:h><text:h text:style-name="Head 1" text:level="1" >UNO in Professional Projects (<text:span text:style-name="T1" >145</text:span>)</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:p text:style-name="Paragraph" >UNO/API constituents: How UNOIDL/API, ServiceManager, Bridges, CoreReflection work together</text:p><text:h text:style-name="Head 2" text:level="2" >API Concepts</text:h><text:p text:style-name="Paragraph" >API is a language independent, abstract specification for UNO objects which are used in <text:s ></text:s>[PRODUCTNAME]</text:p><text:h text:style-name="Head 3" text:level="3" >Types in the API Reference</text:h><text:h text:style-name="Head 4" text:level="4" >Simple Types</text:h><text:h text:style-name="Head 4" text:level="4" >The Any Type</text:h><text:h text:style-name="Head 4" text:level="4" >Interfaces</text:h><text:h text:style-name="Head 4" text:level="4" >Services</text:h><text:h text:style-name="Head 4" text:level="4" >Modules</text:h><text:h text:style-name="Head 4" text:level="4" >Structs</text:h><text:h text:style-name="Head 4" text:level="4" >Constant Groups and Enums</text:h><text:h text:style-name="Head 4" text:level="4" >Sequences</text:h><text:h text:style-name="Head 4" text:level="4" >Exceptions</text:h><text:h text:style-name="Head 3" text:level="3" >API Principles</text:h><text:h text:style-name="Head 4" text:level="4" >Relationship between Specification, Implementation and Instances</text:h><text:h text:style-name="Head 4" text:level="4" >Object Composition</text:h><text:h text:style-name="Head 2" text:level="2" >UNO Concepts</text:h><text:p text:style-name="Paragraph" >UNO is an environment for networked object communication</text:p><text:h text:style-name="Head 3" text:level="3" >Interprocess Connections</text:h><text:h text:style-name="Head 3" text:level="3" >ServiceManager and ComponentContext</text:h><text:h text:style-name="Head 3" text:level="3" >Using UNO Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >Using Collections and Containers</text:h><text:h text:style-name="Head 3" text:level="3" >Event Model</text:h><text:h text:style-name="Head 3" text:level="3" >Exception Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Lifetime Control</text:h><text:h text:style-name="Head 3" text:level="3" >Object Identity</text:h><text:h text:style-name="Head 2" text:level="2" >Language Bindings</text:h><text:h text:style-name="Head 3" text:level="3" >Introduction for language binding</text:h><text:h text:style-name="Head 3" text:level="3" >Java Language Binding</text:h><text:h text:style-name="Head 3" text:level="3" >C++ Binding</text:h><text:h text:style-name="Head 3" text:level="3" >Access for [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 3" text:level="3" >Automation</text:h><text:h text:style-name="Head 1" text:level="1" >Writing UNO components</text:h><text:h text:style-name="Head 2" text:level="2" >Specifying a new Component</text:h><text:h text:style-name="Head 3" text:level="3" >UNOIDL language specification</text:h><text:h text:style-name="Head 2" text:level="2" >Implementing a Component</text:h><text:h text:style-name="Head 3" text:level="3" >Component Development Basics</text:h><text:unordered-list text:style-name="L1" ><text:list-item ><text:p text:style-name="P3" >Introduction</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >Mandatory interfaces: XInterface, XServiceInfo ((from UseInterfaces.CoreInterfaces))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >"Should be implemented" interfaces: XTypeProvider ((from UseInterfaces.CoreInterfaces ))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >optional interface: XMain for standalone execution</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Simple Component in Java</text:h><text:unordered-list text:style-name="L2" ><text:list-item ><text:p text:style-name="P4" >Getting the service manager ((Chapter Java components from unoBindingJava))</text:p></text:list-item><text:list-item ><text:p text:style-name="P4" >simple component chapter</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >C++ Component</text:h><text:h text:style-name="Head 3" text:level="3" >((Automation Component?))</text:h><text:h text:style-name="Head 2" text:level="2" >Deployment Options for Components</text:h><text:h text:style-name="Head 3" text:level="3" >Component Registration</text:h><text:h text:style-name="Head 3" text:level="3" >Service Manager Configuration</text:h><text:unordered-list text:style-name="L3" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P5" >XSet Interface</text:p><text:p text:style-name="P5" >Adding components during runtime, particularly interesting during development</text:p></text:list-item><text:list-item ><text:p text:style-name="P5" >ServiceManager Content</text:p><text:p text:style-name="P5" >Dynamically modifying the ServiceManager</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Bootstrapping the Service Manager ((from CppBind chapter))</text:h><text:unordered-list text:style-name="L4" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P6" >Simple Test Application</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >Configuring Your Application with Bootstrap Parameters</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >The UNO Executable</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Standalone Runtime Environment</text:h><text:p text:style-name="Paragraph" ><text:tab-stop ></text:tab-stop>The UNO executable and XMain</text:p><text:h text:style-name="Head 3" text:level="3" >Configuring the Java Runtime Environment</text:h><text:unordered-list text:style-name="L5" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P7" >The office and Java ((from UnoBindingJava))</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 1" text:level="1" >Advanced UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Design Patterns</text:h><text:h text:style-name="Head 2" text:level="2" >Bridging concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Requirements for Language Bindings and Bridges</text:h><text:h text:style-name="Head 3" text:level="3" >New Scripting Engines</text:h><text:h text:style-name="Head 2" text:level="2" >ServiceManager and loader</text:h><text:h text:style-name="Head 2" text:level="2" >Special Interfaces for internal use</text:h><text:p text:style-name="Paragraph" >XUNOTunnel</text:p><text:p text:style-name="Paragraph" >XAggregation</text:p><text:h text:style-name="Head 2" text:level="2" >UNO Reflection API</text:h><text:h text:style-name="Head 2" text:level="2" >TypeLibrary and TypeProviders</text:h><text:h text:style-name="Head 2" text:level="2" >Differences from Corba</text:h><text:h text:style-name="Head 1" text:level="1" >Office Development</text:h><text:h text:style-name="Head 2" text:level="2" >Global Object Structure</text:h><text:h text:style-name="Head 3" text:level="3" >Desktop Environment</text:h><text:h text:style-name="Head 3" text:level="3" >Frames and Frame Hierarchies</text:h><text:h text:style-name="Head 3" text:level="3" >Frame-Controller-Model Paradigm</text:h><text:h text:style-name="Head 3" text:level="3" >Loading and Saving Office Components</text:h><text:h text:style-name="Head 3" text:level="3" >Dispatch Framework</text:h><text:h text:style-name="Head 2" text:level="2" >Common Features</text:h><text:h text:style-name="Head 3" text:level="3" >Common Dialogs</text:h><text:h text:style-name="Head 3" text:level="3" >DocumentInfo</text:h><text:h text:style-name="Head 3" text:level="3" >Styles</text:h><text:h text:style-name="Head 3" text:level="3" >Search and Replace</text:h><text:h text:style-name="Head 3" text:level="3" >Number Formats</text:h><text:h text:style-name="Head 3" text:level="3" >Package File Formats</text:h><text:h text:style-name="Head 2" text:level="2" >Internationalization</text:h><text:h text:style-name="Head 2" text:level="2" >Linguistic</text:h><text:h text:style-name="Head 2" text:level="2" >System Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Clipboard</text:h><text:h text:style-name="Head 3" text:level="3" >File Picker</text:h><text:h text:style-name="Head 3" text:level="3" >Bridging to the Window System</text:h><text:p text:style-name="Paragraph" ></text:p><text:h text:style-name="Head 1" text:level="1" >Text Documents (51,5 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Text Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Text Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Using Text</text:h><text:h text:style-name="Head 3" text:level="3" >Tables</text:h><text:h text:style-name="Head 3" text:level="3" >Text Fields</text:h><text:h text:style-name="Head 3" text:level="3" >Bookmarks</text:h><text:h text:style-name="Head 3" text:level="3" >Indexes and Index Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Reference Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Footnotes and Endnotes</text:h><text:h text:style-name="Head 3" text:level="3" >Shape Objects in Text</text:h><text:h text:style-name="Head 3" text:level="3" >Redline</text:h><text:h text:style-name="Head 3" text:level="3" >Ruby</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Text Document</text:h><text:h text:style-name="Head 1" text:level="1" >Spreadsheet Documents</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Spreadsheet Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Spreadsheet Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Editing Spreadsheets</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Spreadsheet Document</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Spreadsheet Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Drawings and Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Draw/Impress Files</text:h><text:h text:style-name="Head 3" text:level="3" >Saving</text:h><text:h text:style-name="Head 3" text:level="3" >Printing</text:h><text:h text:style-name="Head 3" text:level="3" >Running Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Working with a Draw/Impress Document</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Draw/Impress Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Draw/Impress Document</text:h><text:h text:style-name="Head 1" text:level="1" >Charts</text:h><text:h text:style-name="Head 2" text:level="2" >Chart Basics</text:h><text:h text:style-name="Head 2" text:level="2" >Creating a Chart Document</text:h><text:h text:style-name="Head 2" text:level="2" >Editing a Chart Document</text:h><text:h text:style-name="Head 3" text:level="3" >Common Diagram API</text:h><text:h text:style-name="Head 3" text:level="3" >Different Chart Types</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Chart Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Basic and Dialogs</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:h text:style-name="Head 2" text:level="2" >Library Organization</text:h><text:h text:style-name="Head 2" text:level="2" >IDE with Dialogs and Events</text:h><text:h text:style-name="Head 2" text:level="2" >Using [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 2" text:level="2" >Toolkit Controls and their Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating Dialogs at Runtime</text:h><text:h text:style-name="Head 1" text:level="1" >Database Access</text:h><text:h text:style-name="Head 2" text:level="2" >Features of the [PRODUCTNAME] Database Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Capabilities</text:h><text:h text:style-name="Head 3" text:level="3" >SDBC, SDBCX, SDB Architecture</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Datasources with [PRODUCTNAME]</text:h><text:h text:style-name="Head 3" text:level="3" >DataSources</text:h><text:h text:style-name="Head 3" text:level="3" >Adding and Editing Datasources </text:h><text:h text:style-name="Head 3" text:level="3" >Establishing a Connection</text:h><text:h text:style-name="Head 4" text:level="4" >Getting Connections</text:h><text:h text:style-name="Head 4" text:level="4" >Driver specifics</text:h><text:h text:style-name="Head 3" text:level="3" >Connection Pooling</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Saved Queries</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Data</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Statements</text:h><text:h text:style-name="Head 3" text:level="3" >Resultsets</text:h><text:h text:style-name="Head 3" text:level="3" >Metadata</text:h><text:h text:style-name="Head 3" text:level="3" >Rowsets</text:h><text:h text:style-name="Head 2" text:level="2" >Working with the Database Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using DDL to change the DB Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using SDBCX to access the DB Design</text:h><text:h text:style-name="Head 2" text:level="2" >Using DBMS Features</text:h><text:h text:style-name="Head 3" text:level="3" >Stored Procedures</text:h><text:h text:style-name="Head 3" text:level="3" >Transaction Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Prepared Statements</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Database Drivers</text:h><text:h text:style-name="Head 1" text:level="1" >Forms</text:h><text:h text:style-name="Head 2" text:level="2" >Concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Models and Views</text:h><text:h text:style-name="Head 3" text:level="3" >Form Elements in the Document Model</text:h><text:h text:style-name="Head 3" text:level="3" >Special Form Components</text:h><text:h text:style-name="Head 3" text:level="3" >Events</text:h><text:h text:style-name="Head 3" text:level="3" >Data Awareness</text:h><text:h text:style-name="Head 2" text:level="2" >Recipes</text:h><text:h text:style-name="Head 3" text:level="3" >Making it easier to work with a Form</text:h><text:h text:style-name="Head 3" text:level="3" >Controlling the Data Input</text:h><text:h text:style-name="Head 3" text:level="3" >Collecting Data automatically</text:h><text:h text:style-name="Head 3" text:level="3" >Taking Advantage of Database Server Features</text:h><text:h text:style-name="Head 3" text:level="3" >Adding new Functionality</text:h><text:h text:style-name="Head 3" text:level="3" >Handling Errors</text:h><text:h text:style-name="Head 1" text:level="1" >UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Purpose of UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Document Contents as Streams</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Content Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating, Moving and Copying Document and Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Additional Commands</text:h><text:h text:style-name="Head 2" text:level="2" >Writing a Content Provider</text:h><text:h text:style-name="Head 1" text:level="1" >[PRODUCTNAME] Configuration</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing configuration data</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Configuration Data</text:h><text:h text:style-name="Head 1" text:level="1" >Appendix</text:h></office:body> + +<office:body ><text:sequence-decls ><text:sequence-decl text:display-outline-level="0" text:name="Illustration" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Table" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Text" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Drawing" ></text:sequence-decl></text:sequence-decls><text:p text:style-name="P1" >Programmer's Manual</text:p><text:p text:style-name="P2" >Planned Outline</text:p><text:p text:style-name="P2" ></text:p><text:h text:style-name="Head 1" text:level="1" >Preface (3 Pages)</text:h><text:h text:style-name="Head 1" text:level="1" >First Steps (24 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Programming with UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Fields of Application for UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Getting Started</text:h><text:h text:style-name="Head 3" text:level="3" >Required Files</text:h><text:h text:style-name="Head 3" text:level="3" >Configuration</text:h><text:h text:style-name="Head 3" text:level="3" >First Connection</text:h><text:h text:style-name="Head 2" text:level="2" >How to get Objects in [PRODUCTNAME]</text:h><text:h text:style-name="Head 2" text:level="2" >How to work with Objects</text:h><text:p text:style-name="Paragraph" >Example</text:p><text:h text:style-name="Head 3" text:level="3" >Services</text:h><text:h text:style-name="Head 3" text:level="3" >Querying Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >ElementAccess</text:h><text:h text:style-name="Head 3" text:level="3" >Simple Types</text:h><text:h text:style-name="Head 3" text:level="3" >Strings</text:h><text:h text:style-name="Head 3" text:level="3" >Enums and Constant Groups</text:h><text:h text:style-name="Head 3" text:level="3" >Structs</text:h><text:h text:style-name="Head 3" text:level="3" >Any</text:h><text:h text:style-name="Head 3" text:level="3" >Sequence</text:h><text:h text:style-name="Head 2" text:level="2" >How to find the solution for a problem</text:h><text:h text:style-name="Head 2" text:level="2" >Finding your Way through the API Reference</text:h><text:h text:style-name="Head 2" text:level="2" >Common Mechanisms</text:h><text:h text:style-name="Head 3" text:level="3" >Text</text:h><text:h text:style-name="Head 3" text:level="3" >Table</text:h><text:h text:style-name="Head 3" text:level="3" >Drawing</text:h><text:h text:style-name="Head 1" text:level="1" >UNO in Professional Projects (<text:span text:style-name="T1" >145</text:span>)</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:p text:style-name="Paragraph" >UNO/API constituents: How UNOIDL/API, ServiceManager, Bridges, CoreReflection work together</text:p><text:h text:style-name="Head 2" text:level="2" >API Concepts</text:h><text:p text:style-name="Paragraph" >API is a language independent, abstract specification for UNO objects which are used in <text:s ></text:s>[PRODUCTNAME]</text:p><text:h text:style-name="Head 3" text:level="3" >Types in the API Reference</text:h><text:h text:style-name="Head 4" text:level="4" >Simple Types</text:h><text:h text:style-name="Head 4" text:level="4" >The Any Type</text:h><text:h text:style-name="Head 4" text:level="4" >Interfaces</text:h><text:h text:style-name="Head 4" text:level="4" >Services</text:h><text:h text:style-name="Head 4" text:level="4" >Modules</text:h><text:h text:style-name="Head 4" text:level="4" >Structs</text:h><text:h text:style-name="Head 4" text:level="4" >Constant Groups and Enums</text:h><text:h text:style-name="Head 4" text:level="4" >Sequences</text:h><text:h text:style-name="Head 4" text:level="4" >Exceptions</text:h><text:h text:style-name="Head 3" text:level="3" >API Principles</text:h><text:h text:style-name="Head 4" text:level="4" >Relationship between Specification, Implementation and Instances</text:h><text:h text:style-name="Head 4" text:level="4" >Object Composition</text:h><text:h text:style-name="Head 2" text:level="2" >UNO Concepts</text:h><text:p text:style-name="Paragraph" >UNO is an environment for networked object communication</text:p><text:h text:style-name="Head 3" text:level="3" >Interprocess Connections</text:h><text:h text:style-name="Head 3" text:level="3" >ServiceManager and ComponentContext</text:h><text:h text:style-name="Head 3" text:level="3" >Using UNO Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >Using Collections and Containers</text:h><text:h text:style-name="Head 3" text:level="3" >Event Model</text:h><text:h text:style-name="Head 3" text:level="3" >Exception Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Lifetime Control</text:h><text:h text:style-name="Head 3" text:level="3" >Object Identity</text:h><text:h text:style-name="Head 2" text:level="2" >Language Bindings</text:h><text:h text:style-name="Head 3" text:level="3" >Introduction for language binding</text:h><text:h text:style-name="Head 3" text:level="3" >Java Language Binding</text:h><text:h text:style-name="Head 3" text:level="3" >C++ Binding</text:h><text:h text:style-name="Head 3" text:level="3" >Access for [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 3" text:level="3" >Automation</text:h><text:h text:style-name="Head 1" text:level="1" >Writing UNO components</text:h><text:h text:style-name="Head 2" text:level="2" >Specifying a new Component</text:h><text:h text:style-name="Head 3" text:level="3" >UNOIDL language specification</text:h><text:h text:style-name="Head 2" text:level="2" >Implementing a Component</text:h><text:h text:style-name="Head 3" text:level="3" >Component Development Basics</text:h><text:unordered-list text:style-name="L1" ><text:list-item ><text:p text:style-name="P3" >Introduction</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >Mandatory interfaces: XInterface, XServiceInfo ((from UseInterfaces.CoreInterfaces))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >"Should be implemented" interfaces: XTypeProvider ((from UseInterfaces.CoreInterfaces ))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >optional interface: XMain for standalone execution</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Simple Component in Java</text:h><text:unordered-list text:style-name="L2" ><text:list-item ><text:p text:style-name="P4" >Getting the service manager ((Chapter Java components from unoBindingJava))</text:p></text:list-item><text:list-item ><text:p text:style-name="P4" >simple component chapter</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >C++ Component</text:h><text:h text:style-name="Head 3" text:level="3" >((Automation Component?))</text:h><text:h text:style-name="Head 2" text:level="2" >Deployment Options for Components</text:h><text:h text:style-name="Head 3" text:level="3" >Component Registration</text:h><text:h text:style-name="Head 3" text:level="3" >Service Manager Configuration</text:h><text:unordered-list text:style-name="L3" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P5" >XSet Interface</text:p><text:p text:style-name="P5" >Adding components during runtime, particularly interesting during development</text:p></text:list-item><text:list-item ><text:p text:style-name="P5" >ServiceManager Content</text:p><text:p text:style-name="P5" >Dynamically modifying the ServiceManager</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Bootstrapping the Service Manager ((from CppBind chapter))</text:h><text:unordered-list text:style-name="L4" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P6" >Simple Test Application</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >Configuring Your Application with Bootstrap Parameters</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >The UNO Executable</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Standalone Runtime Environment</text:h><text:p text:style-name="Paragraph" ><text:tab-stop ></text:tab-stop>The UNO executable and XMain</text:p><text:h text:style-name="Head 3" text:level="3" >Configuring the Java Runtime Environment</text:h><text:unordered-list text:style-name="L5" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P7" >The office and Java ((from UnoBindingJava))</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 1" text:level="1" >Advanced UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Design Patterns</text:h><text:h text:style-name="Head 2" text:level="2" >Bridging concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Requirements for Language Bindings and Bridges</text:h><text:h text:style-name="Head 3" text:level="3" >New Scripting Engines</text:h><text:h text:style-name="Head 2" text:level="2" >ServiceManager and loader</text:h><text:h text:style-name="Head 2" text:level="2" >Special Interfaces for internal use</text:h><text:p text:style-name="Paragraph" >XUNOTunnel</text:p><text:p text:style-name="Paragraph" >XAggregation</text:p><text:h text:style-name="Head 2" text:level="2" >UNO Reflection API</text:h><text:h text:style-name="Head 2" text:level="2" >TypeLibrary and TypeProviders</text:h><text:h text:style-name="Head 2" text:level="2" >Differences from Corba</text:h><text:h text:style-name="Head 1" text:level="1" >Office Development</text:h><text:h text:style-name="Head 2" text:level="2" >Global Object Structure</text:h><text:h text:style-name="Head 3" text:level="3" >Desktop Environment</text:h><text:h text:style-name="Head 3" text:level="3" >Frames and Frame Hierarchies</text:h><text:h text:style-name="Head 3" text:level="3" >Frame-Controller-Model Paradigm</text:h><text:h text:style-name="Head 3" text:level="3" >Loading and Saving Office Components</text:h><text:h text:style-name="Head 3" text:level="3" >Dispatch Framework</text:h><text:h text:style-name="Head 2" text:level="2" >Common Features</text:h><text:h text:style-name="Head 3" text:level="3" >Common Dialogs</text:h><text:h text:style-name="Head 3" text:level="3" >DocumentInfo</text:h><text:h text:style-name="Head 3" text:level="3" >Styles</text:h><text:h text:style-name="Head 3" text:level="3" >Search and Replace</text:h><text:h text:style-name="Head 3" text:level="3" >Number Formats</text:h><text:h text:style-name="Head 3" text:level="3" >Package File Formats</text:h><text:h text:style-name="Head 2" text:level="2" >Internationalization</text:h><text:h text:style-name="Head 2" text:level="2" >Linguistic</text:h><text:h text:style-name="Head 2" text:level="2" >System Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Clipboard</text:h><text:h text:style-name="Head 3" text:level="3" >File Picker</text:h><text:h text:style-name="Head 3" text:level="3" >Bridging to the Window System</text:h><text:p text:style-name="Paragraph" ></text:p><text:h text:style-name="Head 1" text:level="1" >Text Documents (51,5 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Text Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Text Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Using Text</text:h><text:h text:style-name="Head 3" text:level="3" >Tables</text:h><text:h text:style-name="Head 3" text:level="3" >Text Fields</text:h><text:h text:style-name="Head 3" text:level="3" >Bookmarks</text:h><text:h text:style-name="Head 3" text:level="3" >Indexes and Index Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Reference Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Footnotes and Endnotes</text:h><text:h text:style-name="Head 3" text:level="3" >Shape Objects in Text</text:h><text:h text:style-name="Head 3" text:level="3" >Redline</text:h><text:h text:style-name="Head 3" text:level="3" >Ruby</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Text Document</text:h><text:h text:style-name="Head 1" text:level="1" >Spreadsheet Documents</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Spreadsheet Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Spreadsheet Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Editing Spreadsheets</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Spreadsheet Document</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Spreadsheet Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Drawings and Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Draw/Impress Files</text:h><text:h text:style-name="Head 3" text:level="3" >Saving</text:h><text:h text:style-name="Head 3" text:level="3" >Printing</text:h><text:h text:style-name="Head 3" text:level="3" >Running Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Working with a Draw/Impress Document</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Draw/Impress Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Draw/Impress Document</text:h><text:h text:style-name="Head 1" text:level="1" >Charts</text:h><text:h text:style-name="Head 2" text:level="2" >Chart Basics</text:h><text:h text:style-name="Head 2" text:level="2" >Creating a Chart Document</text:h><text:h text:style-name="Head 2" text:level="2" >Editing a Chart Document</text:h><text:h text:style-name="Head 3" text:level="3" >Common Diagram API</text:h><text:h text:style-name="Head 3" text:level="3" >Different Chart Types</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Chart Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Basic and Dialogs</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:h text:style-name="Head 2" text:level="2" >Library Organization</text:h><text:h text:style-name="Head 2" text:level="2" >IDE with Dialogs and Events</text:h><text:h text:style-name="Head 2" text:level="2" >Using [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 2" text:level="2" >Toolkit Controls and their Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating Dialogs at Runtime</text:h><text:h text:style-name="Head 1" text:level="1" >Database Access</text:h><text:h text:style-name="Head 2" text:level="2" >Features of the [PRODUCTNAME] Database Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Capabilities</text:h><text:h text:style-name="Head 3" text:level="3" >SDBC, SDBCX, SDB Architecture</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Datasources with [PRODUCTNAME]</text:h><text:h text:style-name="Head 3" text:level="3" >DataSources</text:h><text:h text:style-name="Head 3" text:level="3" >Adding and Editing Datasources </text:h><text:h text:style-name="Head 3" text:level="3" >Establishing a Connection</text:h><text:h text:style-name="Head 4" text:level="4" >Getting Connections</text:h><text:h text:style-name="Head 4" text:level="4" >Driver specifics</text:h><text:h text:style-name="Head 3" text:level="3" >Connection Pooling</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Saved Queries</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Data</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Statements</text:h><text:h text:style-name="Head 3" text:level="3" >Resultsets</text:h><text:h text:style-name="Head 3" text:level="3" >Metadata</text:h><text:h text:style-name="Head 3" text:level="3" >Rowsets</text:h><text:h text:style-name="Head 2" text:level="2" >Working with the Database Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using DDL to change the DB Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using SDBCX to access the DB Design</text:h><text:h text:style-name="Head 2" text:level="2" >Using DBMS Features</text:h><text:h text:style-name="Head 3" text:level="3" >Stored Procedures</text:h><text:h text:style-name="Head 3" text:level="3" >Transaction Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Prepared Statements</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Database Drivers</text:h><text:h text:style-name="Head 1" text:level="1" >Forms</text:h><text:h text:style-name="Head 2" text:level="2" >Concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Models and Views</text:h><text:h text:style-name="Head 3" text:level="3" >Form Elements in the Document Model</text:h><text:h text:style-name="Head 3" text:level="3" >Special Form Components</text:h><text:h text:style-name="Head 3" text:level="3" >Events</text:h><text:h text:style-name="Head 3" text:level="3" >Data Awareness</text:h><text:h text:style-name="Head 2" text:level="2" >Recipes</text:h><text:h text:style-name="Head 3" text:level="3" >Making it easier to work with a Form</text:h><text:h text:style-name="Head 3" text:level="3" >Controlling the Data Input</text:h><text:h text:style-name="Head 3" text:level="3" >Collecting Data automatically</text:h><text:h text:style-name="Head 3" text:level="3" >Taking Advantage of Database Server Features</text:h><text:h text:style-name="Head 3" text:level="3" >Adding new Functionality</text:h><text:h text:style-name="Head 3" text:level="3" >Handling Errors</text:h><text:h text:style-name="Head 1" text:level="1" >UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Purpose of UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Document Contents as Streams</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Content Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating, Moving and Copying Document and Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Additional Commands</text:h><text:h text:style-name="Head 2" text:level="2" >Writing a Content Provider</text:h><text:h text:style-name="Head 1" text:level="1" >[PRODUCTNAME] Configuration</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing configuration data</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Configuration Data</text:h><text:h text:style-name="Head 1" text:level="1" >Appendix</text:h></office:body> + +<office:body ><text:sequence-decls ><text:sequence-decl text:display-outline-level="0" text:name="Illustration" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Table" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Text" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Drawing" ></text:sequence-decl></text:sequence-decls><text:p text:style-name="P1" >Programmer's Manual</text:p><text:p text:style-name="P2" >Planned Outline</text:p><text:p text:style-name="P2" ></text:p><text:h text:style-name="Head 1" text:level="1" >Preface (3 Pages)</text:h><text:h text:style-name="Head 1" text:level="1" >First Steps (24 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Programming with UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Fields of Application for UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Getting Started</text:h><text:h text:style-name="Head 3" text:level="3" >Required Files</text:h><text:h text:style-name="Head 3" text:level="3" >Configuration</text:h><text:h text:style-name="Head 3" text:level="3" >First Connection</text:h><text:h text:style-name="Head 2" text:level="2" >How to get Objects in [PRODUCTNAME]</text:h><text:h text:style-name="Head 2" text:level="2" >How to work with Objects</text:h><text:p text:style-name="Paragraph" >Example</text:p><text:h text:style-name="Head 3" text:level="3" >Services</text:h><text:h text:style-name="Head 3" text:level="3" >Querying Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >ElementAccess</text:h><text:h text:style-name="Head 3" text:level="3" >Simple Types</text:h><text:h text:style-name="Head 3" text:level="3" >Strings</text:h><text:h text:style-name="Head 3" text:level="3" >Enums and Constant Groups</text:h><text:h text:style-name="Head 3" text:level="3" >Structs</text:h><text:h text:style-name="Head 3" text:level="3" >Any</text:h><text:h text:style-name="Head 3" text:level="3" >Sequence</text:h><text:h text:style-name="Head 2" text:level="2" >How to find the solution for a problem</text:h><text:h text:style-name="Head 2" text:level="2" >Finding your Way through the API Reference</text:h><text:h text:style-name="Head 2" text:level="2" >Common Mechanisms</text:h><text:h text:style-name="Head 3" text:level="3" >Text</text:h><text:h text:style-name="Head 3" text:level="3" >Table</text:h><text:h text:style-name="Head 3" text:level="3" >Drawing</text:h><text:h text:style-name="Head 1" text:level="1" >UNO in Professional Projects (<text:span text:style-name="T1" >145</text:span>)</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:p text:style-name="Paragraph" >UNO/API constituents: How UNOIDL/API, ServiceManager, Bridges, CoreReflection work together</text:p><text:h text:style-name="Head 2" text:level="2" >API Concepts</text:h><text:p text:style-name="Paragraph" >API is a language independent, abstract specification for UNO objects which are used in <text:s ></text:s>[PRODUCTNAME]</text:p><text:h text:style-name="Head 3" text:level="3" >Types in the API Reference</text:h><text:h text:style-name="Head 4" text:level="4" >Simple Types</text:h><text:h text:style-name="Head 4" text:level="4" >The Any Type</text:h><text:h text:style-name="Head 4" text:level="4" >Interfaces</text:h><text:h text:style-name="Head 4" text:level="4" >Services</text:h><text:h text:style-name="Head 4" text:level="4" >Modules</text:h><text:h text:style-name="Head 4" text:level="4" >Structs</text:h><text:h text:style-name="Head 4" text:level="4" >Constant Groups and Enums</text:h><text:h text:style-name="Head 4" text:level="4" >Sequences</text:h><text:h text:style-name="Head 4" text:level="4" >Exceptions</text:h><text:h text:style-name="Head 3" text:level="3" >API Principles</text:h><text:h text:style-name="Head 4" text:level="4" >Relationship between Specification, Implementation and Instances</text:h><text:h text:style-name="Head 4" text:level="4" >Object Composition</text:h><text:h text:style-name="Head 2" text:level="2" >UNO Concepts</text:h><text:p text:style-name="Paragraph" >UNO is an environment for networked object communication</text:p><text:h text:style-name="Head 3" text:level="3" >Interprocess Connections</text:h><text:h text:style-name="Head 3" text:level="3" >ServiceManager and ComponentContext</text:h><text:h text:style-name="Head 3" text:level="3" >Using UNO Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >Using Collections and Containers</text:h><text:h text:style-name="Head 3" text:level="3" >Event Model</text:h><text:h text:style-name="Head 3" text:level="3" >Exception Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Lifetime Control</text:h><text:h text:style-name="Head 3" text:level="3" >Object Identity</text:h><text:h text:style-name="Head 2" text:level="2" >Language Bindings</text:h><text:h text:style-name="Head 3" text:level="3" >Introduction for language binding</text:h><text:h text:style-name="Head 3" text:level="3" >Java Language Binding</text:h><text:h text:style-name="Head 3" text:level="3" >C++ Binding</text:h><text:h text:style-name="Head 3" text:level="3" >Access for [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 3" text:level="3" >Automation</text:h><text:h text:style-name="Head 1" text:level="1" >Writing UNO components</text:h><text:h text:style-name="Head 2" text:level="2" >Specifying a new Component</text:h><text:h text:style-name="Head 3" text:level="3" >UNOIDL language specification</text:h><text:h text:style-name="Head 2" text:level="2" >Implementing a Component</text:h><text:h text:style-name="Head 3" text:level="3" >Component Development Basics</text:h><text:unordered-list text:style-name="L1" ><text:list-item ><text:p text:style-name="P3" >Introduction</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >Mandatory interfaces: XInterface, XServiceInfo ((from UseInterfaces.CoreInterfaces))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >"Should be implemented" interfaces: XTypeProvider ((from UseInterfaces.CoreInterfaces ))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >optional interface: XMain for standalone execution</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Simple Component in Java</text:h><text:unordered-list text:style-name="L2" ><text:list-item ><text:p text:style-name="P4" >Getting the service manager ((Chapter Java components from unoBindingJava))</text:p></text:list-item><text:list-item ><text:p text:style-name="P4" >simple component chapter</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >C++ Component</text:h><text:h text:style-name="Head 3" text:level="3" >((Automation Component?))</text:h><text:h text:style-name="Head 2" text:level="2" >Deployment Options for Components</text:h><text:h text:style-name="Head 3" text:level="3" >Component Registration</text:h><text:h text:style-name="Head 3" text:level="3" >Service Manager Configuration</text:h><text:unordered-list text:style-name="L3" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P5" >XSet Interface</text:p><text:p text:style-name="P5" >Adding components during runtime, particularly interesting during development</text:p></text:list-item><text:list-item ><text:p text:style-name="P5" >ServiceManager Content</text:p><text:p text:style-name="P5" >Dynamically modifying the ServiceManager</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Bootstrapping the Service Manager ((from CppBind chapter))</text:h><text:unordered-list text:style-name="L4" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P6" >Simple Test Application</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >Configuring Your Application with Bootstrap Parameters</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >The UNO Executable</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Standalone Runtime Environment</text:h><text:p text:style-name="Paragraph" ><text:tab-stop ></text:tab-stop>The UNO executable and XMain</text:p><text:h text:style-name="Head 3" text:level="3" >Configuring the Java Runtime Environment</text:h><text:unordered-list text:style-name="L5" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P7" >The office and Java ((from UnoBindingJava))</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 1" text:level="1" >Advanced UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Design Patterns</text:h><text:h text:style-name="Head 2" text:level="2" >Bridging concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Requirements for Language Bindings and Bridges</text:h><text:h text:style-name="Head 3" text:level="3" >New Scripting Engines</text:h><text:h text:style-name="Head 2" text:level="2" >ServiceManager and loader</text:h><text:h text:style-name="Head 2" text:level="2" >Special Interfaces for internal use</text:h><text:p text:style-name="Paragraph" >XUNOTunnel</text:p><text:p text:style-name="Paragraph" >XAggregation</text:p><text:h text:style-name="Head 2" text:level="2" >UNO Reflection API</text:h><text:h text:style-name="Head 2" text:level="2" >TypeLibrary and TypeProviders</text:h><text:h text:style-name="Head 2" text:level="2" >Differences from Corba</text:h><text:h text:style-name="Head 1" text:level="1" >Office Development</text:h><text:h text:style-name="Head 2" text:level="2" >Global Object Structure</text:h><text:h text:style-name="Head 3" text:level="3" >Desktop Environment</text:h><text:h text:style-name="Head 3" text:level="3" >Frames and Frame Hierarchies</text:h><text:h text:style-name="Head 3" text:level="3" >Frame-Controller-Model Paradigm</text:h><text:h text:style-name="Head 3" text:level="3" >Loading and Saving Office Components</text:h><text:h text:style-name="Head 3" text:level="3" >Dispatch Framework</text:h><text:h text:style-name="Head 2" text:level="2" >Common Features</text:h><text:h text:style-name="Head 3" text:level="3" >Common Dialogs</text:h><text:h text:style-name="Head 3" text:level="3" >DocumentInfo</text:h><text:h text:style-name="Head 3" text:level="3" >Styles</text:h><text:h text:style-name="Head 3" text:level="3" >Search and Replace</text:h><text:h text:style-name="Head 3" text:level="3" >Number Formats</text:h><text:h text:style-name="Head 3" text:level="3" >Package File Formats</text:h><text:h text:style-name="Head 2" text:level="2" >Internationalization</text:h><text:h text:style-name="Head 2" text:level="2" >Linguistic</text:h><text:h text:style-name="Head 2" text:level="2" >System Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Clipboard</text:h><text:h text:style-name="Head 3" text:level="3" >File Picker</text:h><text:h text:style-name="Head 3" text:level="3" >Bridging to the Window System</text:h><text:p text:style-name="Paragraph" ></text:p><text:h text:style-name="Head 1" text:level="1" >Text Documents (51,5 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Text Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Text Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Using Text</text:h><text:h text:style-name="Head 3" text:level="3" >Tables</text:h><text:h text:style-name="Head 3" text:level="3" >Text Fields</text:h><text:h text:style-name="Head 3" text:level="3" >Bookmarks</text:h><text:h text:style-name="Head 3" text:level="3" >Indexes and Index Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Reference Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Footnotes and Endnotes</text:h><text:h text:style-name="Head 3" text:level="3" >Shape Objects in Text</text:h><text:h text:style-name="Head 3" text:level="3" >Redline</text:h><text:h text:style-name="Head 3" text:level="3" >Ruby</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Text Document</text:h><text:h text:style-name="Head 1" text:level="1" >Spreadsheet Documents</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Spreadsheet Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Spreadsheet Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Editing Spreadsheets</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Spreadsheet Document</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Spreadsheet Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Drawings and Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Draw/Impress Files</text:h><text:h text:style-name="Head 3" text:level="3" >Saving</text:h><text:h text:style-name="Head 3" text:level="3" >Printing</text:h><text:h text:style-name="Head 3" text:level="3" >Running Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Working with a Draw/Impress Document</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Draw/Impress Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Draw/Impress Document</text:h><text:h text:style-name="Head 1" text:level="1" >Charts</text:h><text:h text:style-name="Head 2" text:level="2" >Chart Basics</text:h><text:h text:style-name="Head 2" text:level="2" >Creating a Chart Document</text:h><text:h text:style-name="Head 2" text:level="2" >Editing a Chart Document</text:h><text:h text:style-name="Head 3" text:level="3" >Common Diagram API</text:h><text:h text:style-name="Head 3" text:level="3" >Different Chart Types</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Chart Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Basic and Dialogs</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:h text:style-name="Head 2" text:level="2" >Library Organization</text:h><text:h text:style-name="Head 2" text:level="2" >IDE with Dialogs and Events</text:h><text:h text:style-name="Head 2" text:level="2" >Using [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 2" text:level="2" >Toolkit Controls and their Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating Dialogs at Runtime</text:h><text:h text:style-name="Head 1" text:level="1" >Database Access</text:h><text:h text:style-name="Head 2" text:level="2" >Features of the [PRODUCTNAME] Database Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Capabilities</text:h><text:h text:style-name="Head 3" text:level="3" >SDBC, SDBCX, SDB Architecture</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Datasources with [PRODUCTNAME]</text:h><text:h text:style-name="Head 3" text:level="3" >DataSources</text:h><text:h text:style-name="Head 3" text:level="3" >Adding and Editing Datasources </text:h><text:h text:style-name="Head 3" text:level="3" >Establishing a Connection</text:h><text:h text:style-name="Head 4" text:level="4" >Getting Connections</text:h><text:h text:style-name="Head 4" text:level="4" >Driver specifics</text:h><text:h text:style-name="Head 3" text:level="3" >Connection Pooling</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Saved Queries</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Data</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Statements</text:h><text:h text:style-name="Head 3" text:level="3" >Resultsets</text:h><text:h text:style-name="Head 3" text:level="3" >Metadata</text:h><text:h text:style-name="Head 3" text:level="3" >Rowsets</text:h><text:h text:style-name="Head 2" text:level="2" >Working with the Database Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using DDL to change the DB Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using SDBCX to access the DB Design</text:h><text:h text:style-name="Head 2" text:level="2" >Using DBMS Features</text:h><text:h text:style-name="Head 3" text:level="3" >Stored Procedures</text:h><text:h text:style-name="Head 3" text:level="3" >Transaction Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Prepared Statements</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Database Drivers</text:h><text:h text:style-name="Head 1" text:level="1" >Forms</text:h><text:h text:style-name="Head 2" text:level="2" >Concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Models and Views</text:h><text:h text:style-name="Head 3" text:level="3" >Form Elements in the Document Model</text:h><text:h text:style-name="Head 3" text:level="3" >Special Form Components</text:h><text:h text:style-name="Head 3" text:level="3" >Events</text:h><text:h text:style-name="Head 3" text:level="3" >Data Awareness</text:h><text:h text:style-name="Head 2" text:level="2" >Recipes</text:h><text:h text:style-name="Head 3" text:level="3" >Making it easier to work with a Form</text:h><text:h text:style-name="Head 3" text:level="3" >Controlling the Data Input</text:h><text:h text:style-name="Head 3" text:level="3" >Collecting Data automatically</text:h><text:h text:style-name="Head 3" text:level="3" >Taking Advantage of Database Server Features</text:h><text:h text:style-name="Head 3" text:level="3" >Adding new Functionality</text:h><text:h text:style-name="Head 3" text:level="3" >Handling Errors</text:h><text:h text:style-name="Head 1" text:level="1" >UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Purpose of UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Document Contents as Streams</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Content Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating, Moving and Copying Document and Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Additional Commands</text:h><text:h text:style-name="Head 2" text:level="2" >Writing a Content Provider</text:h><text:h text:style-name="Head 1" text:level="1" >[PRODUCTNAME] Configuration</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing configuration data</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Configuration Data</text:h><text:h text:style-name="Head 1" text:level="1" >Appendix</text:h></office:body> + +<office:body ><text:sequence-decls ><text:sequence-decl text:display-outline-level="0" text:name="Illustration" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Table" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Text" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Drawing" ></text:sequence-decl></text:sequence-decls><text:p text:style-name="P1" >Programmer's Manual</text:p><text:p text:style-name="P2" >Planned Outline</text:p><text:p text:style-name="P2" ></text:p><text:h text:style-name="Head 1" text:level="1" >Preface (3 Pages)</text:h><text:h text:style-name="Head 1" text:level="1" >First Steps (24 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Programming with UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Fields of Application for UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Getting Started</text:h><text:h text:style-name="Head 3" text:level="3" >Required Files</text:h><text:h text:style-name="Head 3" text:level="3" >Configuration</text:h><text:h text:style-name="Head 3" text:level="3" >First Connection</text:h><text:h text:style-name="Head 2" text:level="2" >How to get Objects in [PRODUCTNAME]</text:h><text:h text:style-name="Head 2" text:level="2" >How to work with Objects</text:h><text:p text:style-name="Paragraph" >Example</text:p><text:h text:style-name="Head 3" text:level="3" >Services</text:h><text:h text:style-name="Head 3" text:level="3" >Querying Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >ElementAccess</text:h><text:h text:style-name="Head 3" text:level="3" >Simple Types</text:h><text:h text:style-name="Head 3" text:level="3" >Strings</text:h><text:h text:style-name="Head 3" text:level="3" >Enums and Constant Groups</text:h><text:h text:style-name="Head 3" text:level="3" >Structs</text:h><text:h text:style-name="Head 3" text:level="3" >Any</text:h><text:h text:style-name="Head 3" text:level="3" >Sequence</text:h><text:h text:style-name="Head 2" text:level="2" >How to find the solution for a problem</text:h><text:h text:style-name="Head 2" text:level="2" >Finding your Way through the API Reference</text:h><text:h text:style-name="Head 2" text:level="2" >Common Mechanisms</text:h><text:h text:style-name="Head 3" text:level="3" >Text</text:h><text:h text:style-name="Head 3" text:level="3" >Table</text:h><text:h text:style-name="Head 3" text:level="3" >Drawing</text:h><text:h text:style-name="Head 1" text:level="1" >UNO in Professional Projects (<text:span text:style-name="T1" >145</text:span>)</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:p text:style-name="Paragraph" >UNO/API constituents: How UNOIDL/API, ServiceManager, Bridges, CoreReflection work together</text:p><text:h text:style-name="Head 2" text:level="2" >API Concepts</text:h><text:p text:style-name="Paragraph" >API is a language independent, abstract specification for UNO objects which are used in <text:s ></text:s>[PRODUCTNAME]</text:p><text:h text:style-name="Head 3" text:level="3" >Types in the API Reference</text:h><text:h text:style-name="Head 4" text:level="4" >Simple Types</text:h><text:h text:style-name="Head 4" text:level="4" >The Any Type</text:h><text:h text:style-name="Head 4" text:level="4" >Interfaces</text:h><text:h text:style-name="Head 4" text:level="4" >Services</text:h><text:h text:style-name="Head 4" text:level="4" >Modules</text:h><text:h text:style-name="Head 4" text:level="4" >Structs</text:h><text:h text:style-name="Head 4" text:level="4" >Constant Groups and Enums</text:h><text:h text:style-name="Head 4" text:level="4" >Sequences</text:h><text:h text:style-name="Head 4" text:level="4" >Exceptions</text:h><text:h text:style-name="Head 3" text:level="3" >API Principles</text:h><text:h text:style-name="Head 4" text:level="4" >Relationship between Specification, Implementation and Instances</text:h><text:h text:style-name="Head 4" text:level="4" >Object Composition</text:h><text:h text:style-name="Head 2" text:level="2" >UNO Concepts</text:h><text:p text:style-name="Paragraph" >UNO is an environment for networked object communication</text:p><text:h text:style-name="Head 3" text:level="3" >Interprocess Connections</text:h><text:h text:style-name="Head 3" text:level="3" >ServiceManager and ComponentContext</text:h><text:h text:style-name="Head 3" text:level="3" >Using UNO Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >Using Collections and Containers</text:h><text:h text:style-name="Head 3" text:level="3" >Event Model</text:h><text:h text:style-name="Head 3" text:level="3" >Exception Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Lifetime Control</text:h><text:h text:style-name="Head 3" text:level="3" >Object Identity</text:h><text:h text:style-name="Head 2" text:level="2" >Language Bindings</text:h><text:h text:style-name="Head 3" text:level="3" >Introduction for language binding</text:h><text:h text:style-name="Head 3" text:level="3" >Java Language Binding</text:h><text:h text:style-name="Head 3" text:level="3" >C++ Binding</text:h><text:h text:style-name="Head 3" text:level="3" >Access for [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 3" text:level="3" >Automation</text:h><text:h text:style-name="Head 1" text:level="1" >Writing UNO components</text:h><text:h text:style-name="Head 2" text:level="2" >Specifying a new Component</text:h><text:h text:style-name="Head 3" text:level="3" >UNOIDL language specification</text:h><text:h text:style-name="Head 2" text:level="2" >Implementing a Component</text:h><text:h text:style-name="Head 3" text:level="3" >Component Development Basics</text:h><text:unordered-list text:style-name="L1" ><text:list-item ><text:p text:style-name="P3" >Introduction</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >Mandatory interfaces: XInterface, XServiceInfo ((from UseInterfaces.CoreInterfaces))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >"Should be implemented" interfaces: XTypeProvider ((from UseInterfaces.CoreInterfaces ))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >optional interface: XMain for standalone execution</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Simple Component in Java</text:h><text:unordered-list text:style-name="L2" ><text:list-item ><text:p text:style-name="P4" >Getting the service manager ((Chapter Java components from unoBindingJava))</text:p></text:list-item><text:list-item ><text:p text:style-name="P4" >simple component chapter</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >C++ Component</text:h><text:h text:style-name="Head 3" text:level="3" >((Automation Component?))</text:h><text:h text:style-name="Head 2" text:level="2" >Deployment Options for Components</text:h><text:h text:style-name="Head 3" text:level="3" >Component Registration</text:h><text:h text:style-name="Head 3" text:level="3" >Service Manager Configuration</text:h><text:unordered-list text:style-name="L3" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P5" >XSet Interface</text:p><text:p text:style-name="P5" >Adding components during runtime, particularly interesting during development</text:p></text:list-item><text:list-item ><text:p text:style-name="P5" >ServiceManager Content</text:p><text:p text:style-name="P5" >Dynamically modifying the ServiceManager</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Bootstrapping the Service Manager ((from CppBind chapter))</text:h><text:unordered-list text:style-name="L4" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P6" >Simple Test Application</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >Configuring Your Application with Bootstrap Parameters</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >The UNO Executable</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Standalone Runtime Environment</text:h><text:p text:style-name="Paragraph" ><text:tab-stop ></text:tab-stop>The UNO executable and XMain</text:p><text:h text:style-name="Head 3" text:level="3" >Configuring the Java Runtime Environment</text:h><text:unordered-list text:style-name="L5" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P7" >The office and Java ((from UnoBindingJava))</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 1" text:level="1" >Advanced UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Design Patterns</text:h><text:h text:style-name="Head 2" text:level="2" >Bridging concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Requirements for Language Bindings and Bridges</text:h><text:h text:style-name="Head 3" text:level="3" >New Scripting Engines</text:h><text:h text:style-name="Head 2" text:level="2" >ServiceManager and loader</text:h><text:h text:style-name="Head 2" text:level="2" >Special Interfaces for internal use</text:h><text:p text:style-name="Paragraph" >XUNOTunnel</text:p><text:p text:style-name="Paragraph" >XAggregation</text:p><text:h text:style-name="Head 2" text:level="2" >UNO Reflection API</text:h><text:h text:style-name="Head 2" text:level="2" >TypeLibrary and TypeProviders</text:h><text:h text:style-name="Head 2" text:level="2" >Differences from Corba</text:h><text:h text:style-name="Head 1" text:level="1" >Office Development</text:h><text:h text:style-name="Head 2" text:level="2" >Global Object Structure</text:h><text:h text:style-name="Head 3" text:level="3" >Desktop Environment</text:h><text:h text:style-name="Head 3" text:level="3" >Frames and Frame Hierarchies</text:h><text:h text:style-name="Head 3" text:level="3" >Frame-Controller-Model Paradigm</text:h><text:h text:style-name="Head 3" text:level="3" >Loading and Saving Office Components</text:h><text:h text:style-name="Head 3" text:level="3" >Dispatch Framework</text:h><text:h text:style-name="Head 2" text:level="2" >Common Features</text:h><text:h text:style-name="Head 3" text:level="3" >Common Dialogs</text:h><text:h text:style-name="Head 3" text:level="3" >DocumentInfo</text:h><text:h text:style-name="Head 3" text:level="3" >Styles</text:h><text:h text:style-name="Head 3" text:level="3" >Search and Replace</text:h><text:h text:style-name="Head 3" text:level="3" >Number Formats</text:h><text:h text:style-name="Head 3" text:level="3" >Package File Formats</text:h><text:h text:style-name="Head 2" text:level="2" >Internationalization</text:h><text:h text:style-name="Head 2" text:level="2" >Linguistic</text:h><text:h text:style-name="Head 2" text:level="2" >System Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Clipboard</text:h><text:h text:style-name="Head 3" text:level="3" >File Picker</text:h><text:h text:style-name="Head 3" text:level="3" >Bridging to the Window System</text:h><text:p text:style-name="Paragraph" ></text:p><text:h text:style-name="Head 1" text:level="1" >Text Documents (51,5 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Text Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Text Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Using Text</text:h><text:h text:style-name="Head 3" text:level="3" >Tables</text:h><text:h text:style-name="Head 3" text:level="3" >Text Fields</text:h><text:h text:style-name="Head 3" text:level="3" >Bookmarks</text:h><text:h text:style-name="Head 3" text:level="3" >Indexes and Index Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Reference Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Footnotes and Endnotes</text:h><text:h text:style-name="Head 3" text:level="3" >Shape Objects in Text</text:h><text:h text:style-name="Head 3" text:level="3" >Redline</text:h><text:h text:style-name="Head 3" text:level="3" >Ruby</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Text Document</text:h><text:h text:style-name="Head 1" text:level="1" >Spreadsheet Documents</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Spreadsheet Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Spreadsheet Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Editing Spreadsheets</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Spreadsheet Document</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Spreadsheet Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Drawings and Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Draw/Impress Files</text:h><text:h text:style-name="Head 3" text:level="3" >Saving</text:h><text:h text:style-name="Head 3" text:level="3" >Printing</text:h><text:h text:style-name="Head 3" text:level="3" >Running Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Working with a Draw/Impress Document</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Draw/Impress Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Draw/Impress Document</text:h><text:h text:style-name="Head 1" text:level="1" >Charts</text:h><text:h text:style-name="Head 2" text:level="2" >Chart Basics</text:h><text:h text:style-name="Head 2" text:level="2" >Creating a Chart Document</text:h><text:h text:style-name="Head 2" text:level="2" >Editing a Chart Document</text:h><text:h text:style-name="Head 3" text:level="3" >Common Diagram API</text:h><text:h text:style-name="Head 3" text:level="3" >Different Chart Types</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Chart Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Basic and Dialogs</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:h text:style-name="Head 2" text:level="2" >Library Organization</text:h><text:h text:style-name="Head 2" text:level="2" >IDE with Dialogs and Events</text:h><text:h text:style-name="Head 2" text:level="2" >Using [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 2" text:level="2" >Toolkit Controls and their Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating Dialogs at Runtime</text:h><text:h text:style-name="Head 1" text:level="1" >Database Access</text:h><text:h text:style-name="Head 2" text:level="2" >Features of the [PRODUCTNAME] Database Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Capabilities</text:h><text:h text:style-name="Head 3" text:level="3" >SDBC, SDBCX, SDB Architecture</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Datasources with [PRODUCTNAME]</text:h><text:h text:style-name="Head 3" text:level="3" >DataSources</text:h><text:h text:style-name="Head 3" text:level="3" >Adding and Editing Datasources </text:h><text:h text:style-name="Head 3" text:level="3" >Establishing a Connection</text:h><text:h text:style-name="Head 4" text:level="4" >Getting Connections</text:h><text:h text:style-name="Head 4" text:level="4" >Driver specifics</text:h><text:h text:style-name="Head 3" text:level="3" >Connection Pooling</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Saved Queries</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Data</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Statements</text:h><text:h text:style-name="Head 3" text:level="3" >Resultsets</text:h><text:h text:style-name="Head 3" text:level="3" >Metadata</text:h><text:h text:style-name="Head 3" text:level="3" >Rowsets</text:h><text:h text:style-name="Head 2" text:level="2" >Working with the Database Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using DDL to change the DB Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using SDBCX to access the DB Design</text:h><text:h text:style-name="Head 2" text:level="2" >Using DBMS Features</text:h><text:h text:style-name="Head 3" text:level="3" >Stored Procedures</text:h><text:h text:style-name="Head 3" text:level="3" >Transaction Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Prepared Statements</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Database Drivers</text:h><text:h text:style-name="Head 1" text:level="1" >Forms</text:h><text:h text:style-name="Head 2" text:level="2" >Concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Models and Views</text:h><text:h text:style-name="Head 3" text:level="3" >Form Elements in the Document Model</text:h><text:h text:style-name="Head 3" text:level="3" >Special Form Components</text:h><text:h text:style-name="Head 3" text:level="3" >Events</text:h><text:h text:style-name="Head 3" text:level="3" >Data Awareness</text:h><text:h text:style-name="Head 2" text:level="2" >Recipes</text:h><text:h text:style-name="Head 3" text:level="3" >Making it easier to work with a Form</text:h><text:h text:style-name="Head 3" text:level="3" >Controlling the Data Input</text:h><text:h text:style-name="Head 3" text:level="3" >Collecting Data automatically</text:h><text:h text:style-name="Head 3" text:level="3" >Taking Advantage of Database Server Features</text:h><text:h text:style-name="Head 3" text:level="3" >Adding new Functionality</text:h><text:h text:style-name="Head 3" text:level="3" >Handling Errors</text:h><text:h text:style-name="Head 1" text:level="1" >UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Purpose of UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Document Contents as Streams</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Content Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating, Moving and Copying Document and Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Additional Commands</text:h><text:h text:style-name="Head 2" text:level="2" >Writing a Content Provider</text:h><text:h text:style-name="Head 1" text:level="1" >[PRODUCTNAME] Configuration</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing configuration data</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Configuration Data</text:h><text:h text:style-name="Head 1" text:level="1" >Appendix</text:h></office:body> + +<office:body ><text:sequence-decls ><text:sequence-decl text:display-outline-level="0" text:name="Illustration" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Table" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Text" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Drawing" ></text:sequence-decl></text:sequence-decls><text:p text:style-name="P1" >Programmer's Manual</text:p><text:p text:style-name="P2" >Planned Outline</text:p><text:p text:style-name="P2" ></text:p><text:h text:style-name="Head 1" text:level="1" >Preface (3 Pages)</text:h><text:h text:style-name="Head 1" text:level="1" >First Steps (24 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Programming with UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Fields of Application for UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Getting Started</text:h><text:h text:style-name="Head 3" text:level="3" >Required Files</text:h><text:h text:style-name="Head 3" text:level="3" >Configuration</text:h><text:h text:style-name="Head 3" text:level="3" >First Connection</text:h><text:h text:style-name="Head 2" text:level="2" >How to get Objects in [PRODUCTNAME]</text:h><text:h text:style-name="Head 2" text:level="2" >How to work with Objects</text:h><text:p text:style-name="Paragraph" >Example</text:p><text:h text:style-name="Head 3" text:level="3" >Services</text:h><text:h text:style-name="Head 3" text:level="3" >Querying Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >ElementAccess</text:h><text:h text:style-name="Head 3" text:level="3" >Simple Types</text:h><text:h text:style-name="Head 3" text:level="3" >Strings</text:h><text:h text:style-name="Head 3" text:level="3" >Enums and Constant Groups</text:h><text:h text:style-name="Head 3" text:level="3" >Structs</text:h><text:h text:style-name="Head 3" text:level="3" >Any</text:h><text:h text:style-name="Head 3" text:level="3" >Sequence</text:h><text:h text:style-name="Head 2" text:level="2" >How to find the solution for a problem</text:h><text:h text:style-name="Head 2" text:level="2" >Finding your Way through the API Reference</text:h><text:h text:style-name="Head 2" text:level="2" >Common Mechanisms</text:h><text:h text:style-name="Head 3" text:level="3" >Text</text:h><text:h text:style-name="Head 3" text:level="3" >Table</text:h><text:h text:style-name="Head 3" text:level="3" >Drawing</text:h><text:h text:style-name="Head 1" text:level="1" >UNO in Professional Projects (<text:span text:style-name="T1" >145</text:span>)</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:p text:style-name="Paragraph" >UNO/API constituents: How UNOIDL/API, ServiceManager, Bridges, CoreReflection work together</text:p><text:h text:style-name="Head 2" text:level="2" >API Concepts</text:h><text:p text:style-name="Paragraph" >API is a language independent, abstract specification for UNO objects which are used in <text:s ></text:s>[PRODUCTNAME]</text:p><text:h text:style-name="Head 3" text:level="3" >Types in the API Reference</text:h><text:h text:style-name="Head 4" text:level="4" >Simple Types</text:h><text:h text:style-name="Head 4" text:level="4" >The Any Type</text:h><text:h text:style-name="Head 4" text:level="4" >Interfaces</text:h><text:h text:style-name="Head 4" text:level="4" >Services</text:h><text:h text:style-name="Head 4" text:level="4" >Modules</text:h><text:h text:style-name="Head 4" text:level="4" >Structs</text:h><text:h text:style-name="Head 4" text:level="4" >Constant Groups and Enums</text:h><text:h text:style-name="Head 4" text:level="4" >Sequences</text:h><text:h text:style-name="Head 4" text:level="4" >Exceptions</text:h><text:h text:style-name="Head 3" text:level="3" >API Principles</text:h><text:h text:style-name="Head 4" text:level="4" >Relationship between Specification, Implementation and Instances</text:h><text:h text:style-name="Head 4" text:level="4" >Object Composition</text:h><text:h text:style-name="Head 2" text:level="2" >UNO Concepts</text:h><text:p text:style-name="Paragraph" >UNO is an environment for networked object communication</text:p><text:h text:style-name="Head 3" text:level="3" >Interprocess Connections</text:h><text:h text:style-name="Head 3" text:level="3" >ServiceManager and ComponentContext</text:h><text:h text:style-name="Head 3" text:level="3" >Using UNO Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >Using Collections and Containers</text:h><text:h text:style-name="Head 3" text:level="3" >Event Model</text:h><text:h text:style-name="Head 3" text:level="3" >Exception Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Lifetime Control</text:h><text:h text:style-name="Head 3" text:level="3" >Object Identity</text:h><text:h text:style-name="Head 2" text:level="2" >Language Bindings</text:h><text:h text:style-name="Head 3" text:level="3" >Introduction for language binding</text:h><text:h text:style-name="Head 3" text:level="3" >Java Language Binding</text:h><text:h text:style-name="Head 3" text:level="3" >C++ Binding</text:h><text:h text:style-name="Head 3" text:level="3" >Access for [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 3" text:level="3" >Automation</text:h><text:h text:style-name="Head 1" text:level="1" >Writing UNO components</text:h><text:h text:style-name="Head 2" text:level="2" >Specifying a new Component</text:h><text:h text:style-name="Head 3" text:level="3" >UNOIDL language specification</text:h><text:h text:style-name="Head 2" text:level="2" >Implementing a Component</text:h><text:h text:style-name="Head 3" text:level="3" >Component Development Basics</text:h><text:unordered-list text:style-name="L1" ><text:list-item ><text:p text:style-name="P3" >Introduction</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >Mandatory interfaces: XInterface, XServiceInfo ((from UseInterfaces.CoreInterfaces))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >"Should be implemented" interfaces: XTypeProvider ((from UseInterfaces.CoreInterfaces ))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >optional interface: XMain for standalone execution</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Simple Component in Java</text:h><text:unordered-list text:style-name="L2" ><text:list-item ><text:p text:style-name="P4" >Getting the service manager ((Chapter Java components from unoBindingJava))</text:p></text:list-item><text:list-item ><text:p text:style-name="P4" >simple component chapter</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >C++ Component</text:h><text:h text:style-name="Head 3" text:level="3" >((Automation Component?))</text:h><text:h text:style-name="Head 2" text:level="2" >Deployment Options for Components</text:h><text:h text:style-name="Head 3" text:level="3" >Component Registration</text:h><text:h text:style-name="Head 3" text:level="3" >Service Manager Configuration</text:h><text:unordered-list text:style-name="L3" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P5" >XSet Interface</text:p><text:p text:style-name="P5" >Adding components during runtime, particularly interesting during development</text:p></text:list-item><text:list-item ><text:p text:style-name="P5" >ServiceManager Content</text:p><text:p text:style-name="P5" >Dynamically modifying the ServiceManager</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Bootstrapping the Service Manager ((from CppBind chapter))</text:h><text:unordered-list text:style-name="L4" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P6" >Simple Test Application</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >Configuring Your Application with Bootstrap Parameters</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >The UNO Executable</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Standalone Runtime Environment</text:h><text:p text:style-name="Paragraph" ><text:tab-stop ></text:tab-stop>The UNO executable and XMain</text:p><text:h text:style-name="Head 3" text:level="3" >Configuring the Java Runtime Environment</text:h><text:unordered-list text:style-name="L5" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P7" >The office and Java ((from UnoBindingJava))</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 1" text:level="1" >Advanced UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Design Patterns</text:h><text:h text:style-name="Head 2" text:level="2" >Bridging concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Requirements for Language Bindings and Bridges</text:h><text:h text:style-name="Head 3" text:level="3" >New Scripting Engines</text:h><text:h text:style-name="Head 2" text:level="2" >ServiceManager and loader</text:h><text:h text:style-name="Head 2" text:level="2" >Special Interfaces for internal use</text:h><text:p text:style-name="Paragraph" >XUNOTunnel</text:p><text:p text:style-name="Paragraph" >XAggregation</text:p><text:h text:style-name="Head 2" text:level="2" >UNO Reflection API</text:h><text:h text:style-name="Head 2" text:level="2" >TypeLibrary and TypeProviders</text:h><text:h text:style-name="Head 2" text:level="2" >Differences from Corba</text:h><text:h text:style-name="Head 1" text:level="1" >Office Development</text:h><text:h text:style-name="Head 2" text:level="2" >Global Object Structure</text:h><text:h text:style-name="Head 3" text:level="3" >Desktop Environment</text:h><text:h text:style-name="Head 3" text:level="3" >Frames and Frame Hierarchies</text:h><text:h text:style-name="Head 3" text:level="3" >Frame-Controller-Model Paradigm</text:h><text:h text:style-name="Head 3" text:level="3" >Loading and Saving Office Components</text:h><text:h text:style-name="Head 3" text:level="3" >Dispatch Framework</text:h><text:h text:style-name="Head 2" text:level="2" >Common Features</text:h><text:h text:style-name="Head 3" text:level="3" >Common Dialogs</text:h><text:h text:style-name="Head 3" text:level="3" >DocumentInfo</text:h><text:h text:style-name="Head 3" text:level="3" >Styles</text:h><text:h text:style-name="Head 3" text:level="3" >Search and Replace</text:h><text:h text:style-name="Head 3" text:level="3" >Number Formats</text:h><text:h text:style-name="Head 3" text:level="3" >Package File Formats</text:h><text:h text:style-name="Head 2" text:level="2" >Internationalization</text:h><text:h text:style-name="Head 2" text:level="2" >Linguistic</text:h><text:h text:style-name="Head 2" text:level="2" >System Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Clipboard</text:h><text:h text:style-name="Head 3" text:level="3" >File Picker</text:h><text:h text:style-name="Head 3" text:level="3" >Bridging to the Window System</text:h><text:p text:style-name="Paragraph" ></text:p><text:h text:style-name="Head 1" text:level="1" >Text Documents (51,5 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Text Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Text Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Using Text</text:h><text:h text:style-name="Head 3" text:level="3" >Tables</text:h><text:h text:style-name="Head 3" text:level="3" >Text Fields</text:h><text:h text:style-name="Head 3" text:level="3" >Bookmarks</text:h><text:h text:style-name="Head 3" text:level="3" >Indexes and Index Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Reference Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Footnotes and Endnotes</text:h><text:h text:style-name="Head 3" text:level="3" >Shape Objects in Text</text:h><text:h text:style-name="Head 3" text:level="3" >Redline</text:h><text:h text:style-name="Head 3" text:level="3" >Ruby</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Text Document</text:h><text:h text:style-name="Head 1" text:level="1" >Spreadsheet Documents</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Spreadsheet Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Spreadsheet Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Editing Spreadsheets</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Spreadsheet Document</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Spreadsheet Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Drawings and Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Draw/Impress Files</text:h><text:h text:style-name="Head 3" text:level="3" >Saving</text:h><text:h text:style-name="Head 3" text:level="3" >Printing</text:h><text:h text:style-name="Head 3" text:level="3" >Running Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Working with a Draw/Impress Document</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Draw/Impress Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Draw/Impress Document</text:h><text:h text:style-name="Head 1" text:level="1" >Charts</text:h><text:h text:style-name="Head 2" text:level="2" >Chart Basics</text:h><text:h text:style-name="Head 2" text:level="2" >Creating a Chart Document</text:h><text:h text:style-name="Head 2" text:level="2" >Editing a Chart Document</text:h><text:h text:style-name="Head 3" text:level="3" >Common Diagram API</text:h><text:h text:style-name="Head 3" text:level="3" >Different Chart Types</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Chart Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Basic and Dialogs</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:h text:style-name="Head 2" text:level="2" >Library Organization</text:h><text:h text:style-name="Head 2" text:level="2" >IDE with Dialogs and Events</text:h><text:h text:style-name="Head 2" text:level="2" >Using [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 2" text:level="2" >Toolkit Controls and their Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating Dialogs at Runtime</text:h><text:h text:style-name="Head 1" text:level="1" >Database Access</text:h><text:h text:style-name="Head 2" text:level="2" >Features of the [PRODUCTNAME] Database Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Capabilities</text:h><text:h text:style-name="Head 3" text:level="3" >SDBC, SDBCX, SDB Architecture</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Datasources with [PRODUCTNAME]</text:h><text:h text:style-name="Head 3" text:level="3" >DataSources</text:h><text:h text:style-name="Head 3" text:level="3" >Adding and Editing Datasources </text:h><text:h text:style-name="Head 3" text:level="3" >Establishing a Connection</text:h><text:h text:style-name="Head 4" text:level="4" >Getting Connections</text:h><text:h text:style-name="Head 4" text:level="4" >Driver specifics</text:h><text:h text:style-name="Head 3" text:level="3" >Connection Pooling</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Saved Queries</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Data</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Statements</text:h><text:h text:style-name="Head 3" text:level="3" >Resultsets</text:h><text:h text:style-name="Head 3" text:level="3" >Metadata</text:h><text:h text:style-name="Head 3" text:level="3" >Rowsets</text:h><text:h text:style-name="Head 2" text:level="2" >Working with the Database Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using DDL to change the DB Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using SDBCX to access the DB Design</text:h><text:h text:style-name="Head 2" text:level="2" >Using DBMS Features</text:h><text:h text:style-name="Head 3" text:level="3" >Stored Procedures</text:h><text:h text:style-name="Head 3" text:level="3" >Transaction Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Prepared Statements</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Database Drivers</text:h><text:h text:style-name="Head 1" text:level="1" >Forms</text:h><text:h text:style-name="Head 2" text:level="2" >Concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Models and Views</text:h><text:h text:style-name="Head 3" text:level="3" >Form Elements in the Document Model</text:h><text:h text:style-name="Head 3" text:level="3" >Special Form Components</text:h><text:h text:style-name="Head 3" text:level="3" >Events</text:h><text:h text:style-name="Head 3" text:level="3" >Data Awareness</text:h><text:h text:style-name="Head 2" text:level="2" >Recipes</text:h><text:h text:style-name="Head 3" text:level="3" >Making it easier to work with a Form</text:h><text:h text:style-name="Head 3" text:level="3" >Controlling the Data Input</text:h><text:h text:style-name="Head 3" text:level="3" >Collecting Data automatically</text:h><text:h text:style-name="Head 3" text:level="3" >Taking Advantage of Database Server Features</text:h><text:h text:style-name="Head 3" text:level="3" >Adding new Functionality</text:h><text:h text:style-name="Head 3" text:level="3" >Handling Errors</text:h><text:h text:style-name="Head 1" text:level="1" >UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Purpose of UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Document Contents as Streams</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Content Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating, Moving and Copying Document and Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Additional Commands</text:h><text:h text:style-name="Head 2" text:level="2" >Writing a Content Provider</text:h><text:h text:style-name="Head 1" text:level="1" >[PRODUCTNAME] Configuration</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing configuration data</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Configuration Data</text:h><text:h text:style-name="Head 1" text:level="1" >Appendix</text:h></office:body> + +<office:body ><text:sequence-decls ><text:sequence-decl text:display-outline-level="0" text:name="Illustration" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Table" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Text" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Drawing" ></text:sequence-decl></text:sequence-decls><text:p text:style-name="P1" >Programmer's Manual</text:p><text:p text:style-name="P2" >Planned Outline</text:p><text:p text:style-name="P2" ></text:p><text:h text:style-name="Head 1" text:level="1" >Preface (3 Pages)</text:h><text:h text:style-name="Head 1" text:level="1" >First Steps (24 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Programming with UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Fields of Application for UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Getting Started</text:h><text:h text:style-name="Head 3" text:level="3" >Required Files</text:h><text:h text:style-name="Head 3" text:level="3" >Configuration</text:h><text:h text:style-name="Head 3" text:level="3" >First Connection</text:h><text:h text:style-name="Head 2" text:level="2" >How to get Objects in [PRODUCTNAME]</text:h><text:h text:style-name="Head 2" text:level="2" >How to work with Objects</text:h><text:p text:style-name="Paragraph" >Example</text:p><text:h text:style-name="Head 3" text:level="3" >Services</text:h><text:h text:style-name="Head 3" text:level="3" >Querying Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >ElementAccess</text:h><text:h text:style-name="Head 3" text:level="3" >Simple Types</text:h><text:h text:style-name="Head 3" text:level="3" >Strings</text:h><text:h text:style-name="Head 3" text:level="3" >Enums and Constant Groups</text:h><text:h text:style-name="Head 3" text:level="3" >Structs</text:h><text:h text:style-name="Head 3" text:level="3" >Any</text:h><text:h text:style-name="Head 3" text:level="3" >Sequence</text:h><text:h text:style-name="Head 2" text:level="2" >How to find the solution for a problem</text:h><text:h text:style-name="Head 2" text:level="2" >Finding your Way through the API Reference</text:h><text:h text:style-name="Head 2" text:level="2" >Common Mechanisms</text:h><text:h text:style-name="Head 3" text:level="3" >Text</text:h><text:h text:style-name="Head 3" text:level="3" >Table</text:h><text:h text:style-name="Head 3" text:level="3" >Drawing</text:h><text:h text:style-name="Head 1" text:level="1" >UNO in Professional Projects (<text:span text:style-name="T1" >145</text:span>)</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:p text:style-name="Paragraph" >UNO/API constituents: How UNOIDL/API, ServiceManager, Bridges, CoreReflection work together</text:p><text:h text:style-name="Head 2" text:level="2" >API Concepts</text:h><text:p text:style-name="Paragraph" >API is a language independent, abstract specification for UNO objects which are used in <text:s ></text:s>[PRODUCTNAME]</text:p><text:h text:style-name="Head 3" text:level="3" >Types in the API Reference</text:h><text:h text:style-name="Head 4" text:level="4" >Simple Types</text:h><text:h text:style-name="Head 4" text:level="4" >The Any Type</text:h><text:h text:style-name="Head 4" text:level="4" >Interfaces</text:h><text:h text:style-name="Head 4" text:level="4" >Services</text:h><text:h text:style-name="Head 4" text:level="4" >Modules</text:h><text:h text:style-name="Head 4" text:level="4" >Structs</text:h><text:h text:style-name="Head 4" text:level="4" >Constant Groups and Enums</text:h><text:h text:style-name="Head 4" text:level="4" >Sequences</text:h><text:h text:style-name="Head 4" text:level="4" >Exceptions</text:h><text:h text:style-name="Head 3" text:level="3" >API Principles</text:h><text:h text:style-name="Head 4" text:level="4" >Relationship between Specification, Implementation and Instances</text:h><text:h text:style-name="Head 4" text:level="4" >Object Composition</text:h><text:h text:style-name="Head 2" text:level="2" >UNO Concepts</text:h><text:p text:style-name="Paragraph" >UNO is an environment for networked object communication</text:p><text:h text:style-name="Head 3" text:level="3" >Interprocess Connections</text:h><text:h text:style-name="Head 3" text:level="3" >ServiceManager and ComponentContext</text:h><text:h text:style-name="Head 3" text:level="3" >Using UNO Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >Using Collections and Containers</text:h><text:h text:style-name="Head 3" text:level="3" >Event Model</text:h><text:h text:style-name="Head 3" text:level="3" >Exception Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Lifetime Control</text:h><text:h text:style-name="Head 3" text:level="3" >Object Identity</text:h><text:h text:style-name="Head 2" text:level="2" >Language Bindings</text:h><text:h text:style-name="Head 3" text:level="3" >Introduction for language binding</text:h><text:h text:style-name="Head 3" text:level="3" >Java Language Binding</text:h><text:h text:style-name="Head 3" text:level="3" >C++ Binding</text:h><text:h text:style-name="Head 3" text:level="3" >Access for [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 3" text:level="3" >Automation</text:h><text:h text:style-name="Head 1" text:level="1" >Writing UNO components</text:h><text:h text:style-name="Head 2" text:level="2" >Specifying a new Component</text:h><text:h text:style-name="Head 3" text:level="3" >UNOIDL language specification</text:h><text:h text:style-name="Head 2" text:level="2" >Implementing a Component</text:h><text:h text:style-name="Head 3" text:level="3" >Component Development Basics</text:h><text:unordered-list text:style-name="L1" ><text:list-item ><text:p text:style-name="P3" >Introduction</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >Mandatory interfaces: XInterface, XServiceInfo ((from UseInterfaces.CoreInterfaces))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >"Should be implemented" interfaces: XTypeProvider ((from UseInterfaces.CoreInterfaces ))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >optional interface: XMain for standalone execution</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Simple Component in Java</text:h><text:unordered-list text:style-name="L2" ><text:list-item ><text:p text:style-name="P4" >Getting the service manager ((Chapter Java components from unoBindingJava))</text:p></text:list-item><text:list-item ><text:p text:style-name="P4" >simple component chapter</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >C++ Component</text:h><text:h text:style-name="Head 3" text:level="3" >((Automation Component?))</text:h><text:h text:style-name="Head 2" text:level="2" >Deployment Options for Components</text:h><text:h text:style-name="Head 3" text:level="3" >Component Registration</text:h><text:h text:style-name="Head 3" text:level="3" >Service Manager Configuration</text:h><text:unordered-list text:style-name="L3" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P5" >XSet Interface</text:p><text:p text:style-name="P5" >Adding components during runtime, particularly interesting during development</text:p></text:list-item><text:list-item ><text:p text:style-name="P5" >ServiceManager Content</text:p><text:p text:style-name="P5" >Dynamically modifying the ServiceManager</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Bootstrapping the Service Manager ((from CppBind chapter))</text:h><text:unordered-list text:style-name="L4" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P6" >Simple Test Application</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >Configuring Your Application with Bootstrap Parameters</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >The UNO Executable</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Standalone Runtime Environment</text:h><text:p text:style-name="Paragraph" ><text:tab-stop ></text:tab-stop>The UNO executable and XMain</text:p><text:h text:style-name="Head 3" text:level="3" >Configuring the Java Runtime Environment</text:h><text:unordered-list text:style-name="L5" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P7" >The office and Java ((from UnoBindingJava))</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 1" text:level="1" >Advanced UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Design Patterns</text:h><text:h text:style-name="Head 2" text:level="2" >Bridging concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Requirements for Language Bindings and Bridges</text:h><text:h text:style-name="Head 3" text:level="3" >New Scripting Engines</text:h><text:h text:style-name="Head 2" text:level="2" >ServiceManager and loader</text:h><text:h text:style-name="Head 2" text:level="2" >Special Interfaces for internal use</text:h><text:p text:style-name="Paragraph" >XUNOTunnel</text:p><text:p text:style-name="Paragraph" >XAggregation</text:p><text:h text:style-name="Head 2" text:level="2" >UNO Reflection API</text:h><text:h text:style-name="Head 2" text:level="2" >TypeLibrary and TypeProviders</text:h><text:h text:style-name="Head 2" text:level="2" >Differences from Corba</text:h><text:h text:style-name="Head 1" text:level="1" >Office Development</text:h><text:h text:style-name="Head 2" text:level="2" >Global Object Structure</text:h><text:h text:style-name="Head 3" text:level="3" >Desktop Environment</text:h><text:h text:style-name="Head 3" text:level="3" >Frames and Frame Hierarchies</text:h><text:h text:style-name="Head 3" text:level="3" >Frame-Controller-Model Paradigm</text:h><text:h text:style-name="Head 3" text:level="3" >Loading and Saving Office Components</text:h><text:h text:style-name="Head 3" text:level="3" >Dispatch Framework</text:h><text:h text:style-name="Head 2" text:level="2" >Common Features</text:h><text:h text:style-name="Head 3" text:level="3" >Common Dialogs</text:h><text:h text:style-name="Head 3" text:level="3" >DocumentInfo</text:h><text:h text:style-name="Head 3" text:level="3" >Styles</text:h><text:h text:style-name="Head 3" text:level="3" >Search and Replace</text:h><text:h text:style-name="Head 3" text:level="3" >Number Formats</text:h><text:h text:style-name="Head 3" text:level="3" >Package File Formats</text:h><text:h text:style-name="Head 2" text:level="2" >Internationalization</text:h><text:h text:style-name="Head 2" text:level="2" >Linguistic</text:h><text:h text:style-name="Head 2" text:level="2" >System Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Clipboard</text:h><text:h text:style-name="Head 3" text:level="3" >File Picker</text:h><text:h text:style-name="Head 3" text:level="3" >Bridging to the Window System</text:h><text:p text:style-name="Paragraph" ></text:p><text:h text:style-name="Head 1" text:level="1" >Text Documents (51,5 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Text Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Text Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Using Text</text:h><text:h text:style-name="Head 3" text:level="3" >Tables</text:h><text:h text:style-name="Head 3" text:level="3" >Text Fields</text:h><text:h text:style-name="Head 3" text:level="3" >Bookmarks</text:h><text:h text:style-name="Head 3" text:level="3" >Indexes and Index Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Reference Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Footnotes and Endnotes</text:h><text:h text:style-name="Head 3" text:level="3" >Shape Objects in Text</text:h><text:h text:style-name="Head 3" text:level="3" >Redline</text:h><text:h text:style-name="Head 3" text:level="3" >Ruby</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Text Document</text:h><text:h text:style-name="Head 1" text:level="1" >Spreadsheet Documents</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Spreadsheet Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Spreadsheet Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Editing Spreadsheets</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Spreadsheet Document</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Spreadsheet Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Drawings and Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Draw/Impress Files</text:h><text:h text:style-name="Head 3" text:level="3" >Saving</text:h><text:h text:style-name="Head 3" text:level="3" >Printing</text:h><text:h text:style-name="Head 3" text:level="3" >Running Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Working with a Draw/Impress Document</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Draw/Impress Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Draw/Impress Document</text:h><text:h text:style-name="Head 1" text:level="1" >Charts</text:h><text:h text:style-name="Head 2" text:level="2" >Chart Basics</text:h><text:h text:style-name="Head 2" text:level="2" >Creating a Chart Document</text:h><text:h text:style-name="Head 2" text:level="2" >Editing a Chart Document</text:h><text:h text:style-name="Head 3" text:level="3" >Common Diagram API</text:h><text:h text:style-name="Head 3" text:level="3" >Different Chart Types</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Chart Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Basic and Dialogs</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:h text:style-name="Head 2" text:level="2" >Library Organization</text:h><text:h text:style-name="Head 2" text:level="2" >IDE with Dialogs and Events</text:h><text:h text:style-name="Head 2" text:level="2" >Using [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 2" text:level="2" >Toolkit Controls and their Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating Dialogs at Runtime</text:h><text:h text:style-name="Head 1" text:level="1" >Database Access</text:h><text:h text:style-name="Head 2" text:level="2" >Features of the [PRODUCTNAME] Database Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Capabilities</text:h><text:h text:style-name="Head 3" text:level="3" >SDBC, SDBCX, SDB Architecture</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Datasources with [PRODUCTNAME]</text:h><text:h text:style-name="Head 3" text:level="3" >DataSources</text:h><text:h text:style-name="Head 3" text:level="3" >Adding and Editing Datasources </text:h><text:h text:style-name="Head 3" text:level="3" >Establishing a Connection</text:h><text:h text:style-name="Head 4" text:level="4" >Getting Connections</text:h><text:h text:style-name="Head 4" text:level="4" >Driver specifics</text:h><text:h text:style-name="Head 3" text:level="3" >Connection Pooling</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Saved Queries</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Data</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Statements</text:h><text:h text:style-name="Head 3" text:level="3" >Resultsets</text:h><text:h text:style-name="Head 3" text:level="3" >Metadata</text:h><text:h text:style-name="Head 3" text:level="3" >Rowsets</text:h><text:h text:style-name="Head 2" text:level="2" >Working with the Database Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using DDL to change the DB Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using SDBCX to access the DB Design</text:h><text:h text:style-name="Head 2" text:level="2" >Using DBMS Features</text:h><text:h text:style-name="Head 3" text:level="3" >Stored Procedures</text:h><text:h text:style-name="Head 3" text:level="3" >Transaction Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Prepared Statements</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Database Drivers</text:h><text:h text:style-name="Head 1" text:level="1" >Forms</text:h><text:h text:style-name="Head 2" text:level="2" >Concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Models and Views</text:h><text:h text:style-name="Head 3" text:level="3" >Form Elements in the Document Model</text:h><text:h text:style-name="Head 3" text:level="3" >Special Form Components</text:h><text:h text:style-name="Head 3" text:level="3" >Events</text:h><text:h text:style-name="Head 3" text:level="3" >Data Awareness</text:h><text:h text:style-name="Head 2" text:level="2" >Recipes</text:h><text:h text:style-name="Head 3" text:level="3" >Making it easier to work with a Form</text:h><text:h text:style-name="Head 3" text:level="3" >Controlling the Data Input</text:h><text:h text:style-name="Head 3" text:level="3" >Collecting Data automatically</text:h><text:h text:style-name="Head 3" text:level="3" >Taking Advantage of Database Server Features</text:h><text:h text:style-name="Head 3" text:level="3" >Adding new Functionality</text:h><text:h text:style-name="Head 3" text:level="3" >Handling Errors</text:h><text:h text:style-name="Head 1" text:level="1" >UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Purpose of UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Document Contents as Streams</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Content Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating, Moving and Copying Document and Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Additional Commands</text:h><text:h text:style-name="Head 2" text:level="2" >Writing a Content Provider</text:h><text:h text:style-name="Head 1" text:level="1" >[PRODUCTNAME] Configuration</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing configuration data</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Configuration Data</text:h><text:h text:style-name="Head 1" text:level="1" >Appendix</text:h></office:body> + +<office:body ><text:sequence-decls ><text:sequence-decl text:display-outline-level="0" text:name="Illustration" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Table" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Text" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Drawing" ></text:sequence-decl></text:sequence-decls><text:p text:style-name="P1" >Programmer's Manual</text:p><text:p text:style-name="P2" >Planned Outline</text:p><text:p text:style-name="P2" ></text:p><text:h text:style-name="Head 1" text:level="1" >Preface (3 Pages)</text:h><text:h text:style-name="Head 1" text:level="1" >First Steps (24 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Programming with UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Fields of Application for UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Getting Started</text:h><text:h text:style-name="Head 3" text:level="3" >Required Files</text:h><text:h text:style-name="Head 3" text:level="3" >Configuration</text:h><text:h text:style-name="Head 3" text:level="3" >First Connection</text:h><text:h text:style-name="Head 2" text:level="2" >How to get Objects in [PRODUCTNAME]</text:h><text:h text:style-name="Head 2" text:level="2" >How to work with Objects</text:h><text:p text:style-name="Paragraph" >Example</text:p><text:h text:style-name="Head 3" text:level="3" >Services</text:h><text:h text:style-name="Head 3" text:level="3" >Querying Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >ElementAccess</text:h><text:h text:style-name="Head 3" text:level="3" >Simple Types</text:h><text:h text:style-name="Head 3" text:level="3" >Strings</text:h><text:h text:style-name="Head 3" text:level="3" >Enums and Constant Groups</text:h><text:h text:style-name="Head 3" text:level="3" >Structs</text:h><text:h text:style-name="Head 3" text:level="3" >Any</text:h><text:h text:style-name="Head 3" text:level="3" >Sequence</text:h><text:h text:style-name="Head 2" text:level="2" >How to find the solution for a problem</text:h><text:h text:style-name="Head 2" text:level="2" >Finding your Way through the API Reference</text:h><text:h text:style-name="Head 2" text:level="2" >Common Mechanisms</text:h><text:h text:style-name="Head 3" text:level="3" >Text</text:h><text:h text:style-name="Head 3" text:level="3" >Table</text:h><text:h text:style-name="Head 3" text:level="3" >Drawing</text:h><text:h text:style-name="Head 1" text:level="1" >UNO in Professional Projects (<text:span text:style-name="T1" >145</text:span>)</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:p text:style-name="Paragraph" >UNO/API constituents: How UNOIDL/API, ServiceManager, Bridges, CoreReflection work together</text:p><text:h text:style-name="Head 2" text:level="2" >API Concepts</text:h><text:p text:style-name="Paragraph" >API is a language independent, abstract specification for UNO objects which are used in <text:s ></text:s>[PRODUCTNAME]</text:p><text:h text:style-name="Head 3" text:level="3" >Types in the API Reference</text:h><text:h text:style-name="Head 4" text:level="4" >Simple Types</text:h><text:h text:style-name="Head 4" text:level="4" >The Any Type</text:h><text:h text:style-name="Head 4" text:level="4" >Interfaces</text:h><text:h text:style-name="Head 4" text:level="4" >Services</text:h><text:h text:style-name="Head 4" text:level="4" >Modules</text:h><text:h text:style-name="Head 4" text:level="4" >Structs</text:h><text:h text:style-name="Head 4" text:level="4" >Constant Groups and Enums</text:h><text:h text:style-name="Head 4" text:level="4" >Sequences</text:h><text:h text:style-name="Head 4" text:level="4" >Exceptions</text:h><text:h text:style-name="Head 3" text:level="3" >API Principles</text:h><text:h text:style-name="Head 4" text:level="4" >Relationship between Specification, Implementation and Instances</text:h><text:h text:style-name="Head 4" text:level="4" >Object Composition</text:h><text:h text:style-name="Head 2" text:level="2" >UNO Concepts</text:h><text:p text:style-name="Paragraph" >UNO is an environment for networked object communication</text:p><text:h text:style-name="Head 3" text:level="3" >Interprocess Connections</text:h><text:h text:style-name="Head 3" text:level="3" >ServiceManager and ComponentContext</text:h><text:h text:style-name="Head 3" text:level="3" >Using UNO Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >Using Collections and Containers</text:h><text:h text:style-name="Head 3" text:level="3" >Event Model</text:h><text:h text:style-name="Head 3" text:level="3" >Exception Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Lifetime Control</text:h><text:h text:style-name="Head 3" text:level="3" >Object Identity</text:h><text:h text:style-name="Head 2" text:level="2" >Language Bindings</text:h><text:h text:style-name="Head 3" text:level="3" >Introduction for language binding</text:h><text:h text:style-name="Head 3" text:level="3" >Java Language Binding</text:h><text:h text:style-name="Head 3" text:level="3" >C++ Binding</text:h><text:h text:style-name="Head 3" text:level="3" >Access for [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 3" text:level="3" >Automation</text:h><text:h text:style-name="Head 1" text:level="1" >Writing UNO components</text:h><text:h text:style-name="Head 2" text:level="2" >Specifying a new Component</text:h><text:h text:style-name="Head 3" text:level="3" >UNOIDL language specification</text:h><text:h text:style-name="Head 2" text:level="2" >Implementing a Component</text:h><text:h text:style-name="Head 3" text:level="3" >Component Development Basics</text:h><text:unordered-list text:style-name="L1" ><text:list-item ><text:p text:style-name="P3" >Introduction</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >Mandatory interfaces: XInterface, XServiceInfo ((from UseInterfaces.CoreInterfaces))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >"Should be implemented" interfaces: XTypeProvider ((from UseInterfaces.CoreInterfaces ))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >optional interface: XMain for standalone execution</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Simple Component in Java</text:h><text:unordered-list text:style-name="L2" ><text:list-item ><text:p text:style-name="P4" >Getting the service manager ((Chapter Java components from unoBindingJava))</text:p></text:list-item><text:list-item ><text:p text:style-name="P4" >simple component chapter</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >C++ Component</text:h><text:h text:style-name="Head 3" text:level="3" >((Automation Component?))</text:h><text:h text:style-name="Head 2" text:level="2" >Deployment Options for Components</text:h><text:h text:style-name="Head 3" text:level="3" >Component Registration</text:h><text:h text:style-name="Head 3" text:level="3" >Service Manager Configuration</text:h><text:unordered-list text:style-name="L3" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P5" >XSet Interface</text:p><text:p text:style-name="P5" >Adding components during runtime, particularly interesting during development</text:p></text:list-item><text:list-item ><text:p text:style-name="P5" >ServiceManager Content</text:p><text:p text:style-name="P5" >Dynamically modifying the ServiceManager</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Bootstrapping the Service Manager ((from CppBind chapter))</text:h><text:unordered-list text:style-name="L4" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P6" >Simple Test Application</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >Configuring Your Application with Bootstrap Parameters</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >The UNO Executable</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Standalone Runtime Environment</text:h><text:p text:style-name="Paragraph" ><text:tab-stop ></text:tab-stop>The UNO executable and XMain</text:p><text:h text:style-name="Head 3" text:level="3" >Configuring the Java Runtime Environment</text:h><text:unordered-list text:style-name="L5" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P7" >The office and Java ((from UnoBindingJava))</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 1" text:level="1" >Advanced UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Design Patterns</text:h><text:h text:style-name="Head 2" text:level="2" >Bridging concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Requirements for Language Bindings and Bridges</text:h><text:h text:style-name="Head 3" text:level="3" >New Scripting Engines</text:h><text:h text:style-name="Head 2" text:level="2" >ServiceManager and loader</text:h><text:h text:style-name="Head 2" text:level="2" >Special Interfaces for internal use</text:h><text:p text:style-name="Paragraph" >XUNOTunnel</text:p><text:p text:style-name="Paragraph" >XAggregation</text:p><text:h text:style-name="Head 2" text:level="2" >UNO Reflection API</text:h><text:h text:style-name="Head 2" text:level="2" >TypeLibrary and TypeProviders</text:h><text:h text:style-name="Head 2" text:level="2" >Differences from Corba</text:h><text:h text:style-name="Head 1" text:level="1" >Office Development</text:h><text:h text:style-name="Head 2" text:level="2" >Global Object Structure</text:h><text:h text:style-name="Head 3" text:level="3" >Desktop Environment</text:h><text:h text:style-name="Head 3" text:level="3" >Frames and Frame Hierarchies</text:h><text:h text:style-name="Head 3" text:level="3" >Frame-Controller-Model Paradigm</text:h><text:h text:style-name="Head 3" text:level="3" >Loading and Saving Office Components</text:h><text:h text:style-name="Head 3" text:level="3" >Dispatch Framework</text:h><text:h text:style-name="Head 2" text:level="2" >Common Features</text:h><text:h text:style-name="Head 3" text:level="3" >Common Dialogs</text:h><text:h text:style-name="Head 3" text:level="3" >DocumentInfo</text:h><text:h text:style-name="Head 3" text:level="3" >Styles</text:h><text:h text:style-name="Head 3" text:level="3" >Search and Replace</text:h><text:h text:style-name="Head 3" text:level="3" >Number Formats</text:h><text:h text:style-name="Head 3" text:level="3" >Package File Formats</text:h><text:h text:style-name="Head 2" text:level="2" >Internationalization</text:h><text:h text:style-name="Head 2" text:level="2" >Linguistic</text:h><text:h text:style-name="Head 2" text:level="2" >System Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Clipboard</text:h><text:h text:style-name="Head 3" text:level="3" >File Picker</text:h><text:h text:style-name="Head 3" text:level="3" >Bridging to the Window System</text:h><text:p text:style-name="Paragraph" ></text:p><text:h text:style-name="Head 1" text:level="1" >Text Documents (51,5 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Text Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Text Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Using Text</text:h><text:h text:style-name="Head 3" text:level="3" >Tables</text:h><text:h text:style-name="Head 3" text:level="3" >Text Fields</text:h><text:h text:style-name="Head 3" text:level="3" >Bookmarks</text:h><text:h text:style-name="Head 3" text:level="3" >Indexes and Index Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Reference Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Footnotes and Endnotes</text:h><text:h text:style-name="Head 3" text:level="3" >Shape Objects in Text</text:h><text:h text:style-name="Head 3" text:level="3" >Redline</text:h><text:h text:style-name="Head 3" text:level="3" >Ruby</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Text Document</text:h><text:h text:style-name="Head 1" text:level="1" >Spreadsheet Documents</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Spreadsheet Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Spreadsheet Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Editing Spreadsheets</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Spreadsheet Document</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Spreadsheet Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Drawings and Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Draw/Impress Files</text:h><text:h text:style-name="Head 3" text:level="3" >Saving</text:h><text:h text:style-name="Head 3" text:level="3" >Printing</text:h><text:h text:style-name="Head 3" text:level="3" >Running Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Working with a Draw/Impress Document</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Draw/Impress Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Draw/Impress Document</text:h><text:h text:style-name="Head 1" text:level="1" >Charts</text:h><text:h text:style-name="Head 2" text:level="2" >Chart Basics</text:h><text:h text:style-name="Head 2" text:level="2" >Creating a Chart Document</text:h><text:h text:style-name="Head 2" text:level="2" >Editing a Chart Document</text:h><text:h text:style-name="Head 3" text:level="3" >Common Diagram API</text:h><text:h text:style-name="Head 3" text:level="3" >Different Chart Types</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Chart Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Basic and Dialogs</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:h text:style-name="Head 2" text:level="2" >Library Organization</text:h><text:h text:style-name="Head 2" text:level="2" >IDE with Dialogs and Events</text:h><text:h text:style-name="Head 2" text:level="2" >Using [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 2" text:level="2" >Toolkit Controls and their Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating Dialogs at Runtime</text:h><text:h text:style-name="Head 1" text:level="1" >Database Access</text:h><text:h text:style-name="Head 2" text:level="2" >Features of the [PRODUCTNAME] Database Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Capabilities</text:h><text:h text:style-name="Head 3" text:level="3" >SDBC, SDBCX, SDB Architecture</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Datasources with [PRODUCTNAME]</text:h><text:h text:style-name="Head 3" text:level="3" >DataSources</text:h><text:h text:style-name="Head 3" text:level="3" >Adding and Editing Datasources </text:h><text:h text:style-name="Head 3" text:level="3" >Establishing a Connection</text:h><text:h text:style-name="Head 4" text:level="4" >Getting Connections</text:h><text:h text:style-name="Head 4" text:level="4" >Driver specifics</text:h><text:h text:style-name="Head 3" text:level="3" >Connection Pooling</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Saved Queries</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Data</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Statements</text:h><text:h text:style-name="Head 3" text:level="3" >Resultsets</text:h><text:h text:style-name="Head 3" text:level="3" >Metadata</text:h><text:h text:style-name="Head 3" text:level="3" >Rowsets</text:h><text:h text:style-name="Head 2" text:level="2" >Working with the Database Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using DDL to change the DB Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using SDBCX to access the DB Design</text:h><text:h text:style-name="Head 2" text:level="2" >Using DBMS Features</text:h><text:h text:style-name="Head 3" text:level="3" >Stored Procedures</text:h><text:h text:style-name="Head 3" text:level="3" >Transaction Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Prepared Statements</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Database Drivers</text:h><text:h text:style-name="Head 1" text:level="1" >Forms</text:h><text:h text:style-name="Head 2" text:level="2" >Concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Models and Views</text:h><text:h text:style-name="Head 3" text:level="3" >Form Elements in the Document Model</text:h><text:h text:style-name="Head 3" text:level="3" >Special Form Components</text:h><text:h text:style-name="Head 3" text:level="3" >Events</text:h><text:h text:style-name="Head 3" text:level="3" >Data Awareness</text:h><text:h text:style-name="Head 2" text:level="2" >Recipes</text:h><text:h text:style-name="Head 3" text:level="3" >Making it easier to work with a Form</text:h><text:h text:style-name="Head 3" text:level="3" >Controlling the Data Input</text:h><text:h text:style-name="Head 3" text:level="3" >Collecting Data automatically</text:h><text:h text:style-name="Head 3" text:level="3" >Taking Advantage of Database Server Features</text:h><text:h text:style-name="Head 3" text:level="3" >Adding new Functionality</text:h><text:h text:style-name="Head 3" text:level="3" >Handling Errors</text:h><text:h text:style-name="Head 1" text:level="1" >UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Purpose of UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Document Contents as Streams</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Content Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating, Moving and Copying Document and Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Additional Commands</text:h><text:h text:style-name="Head 2" text:level="2" >Writing a Content Provider</text:h><text:h text:style-name="Head 1" text:level="1" >[PRODUCTNAME] Configuration</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing configuration data</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Configuration Data</text:h><text:h text:style-name="Head 1" text:level="1" >Appendix</text:h></office:body> + +<office:body ><text:sequence-decls ><text:sequence-decl text:display-outline-level="0" text:name="Illustration" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Table" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Text" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Drawing" ></text:sequence-decl></text:sequence-decls><text:p text:style-name="P1" >Programmer's Manual</text:p><text:p text:style-name="P2" >Planned Outline</text:p><text:p text:style-name="P2" ></text:p><text:h text:style-name="Head 1" text:level="1" >Preface (3 Pages)</text:h><text:h text:style-name="Head 1" text:level="1" >First Steps (24 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Programming with UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Fields of Application for UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Getting Started</text:h><text:h text:style-name="Head 3" text:level="3" >Required Files</text:h><text:h text:style-name="Head 3" text:level="3" >Configuration</text:h><text:h text:style-name="Head 3" text:level="3" >First Connection</text:h><text:h text:style-name="Head 2" text:level="2" >How to get Objects in [PRODUCTNAME]</text:h><text:h text:style-name="Head 2" text:level="2" >How to work with Objects</text:h><text:p text:style-name="Paragraph" >Example</text:p><text:h text:style-name="Head 3" text:level="3" >Services</text:h><text:h text:style-name="Head 3" text:level="3" >Querying Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >ElementAccess</text:h><text:h text:style-name="Head 3" text:level="3" >Simple Types</text:h><text:h text:style-name="Head 3" text:level="3" >Strings</text:h><text:h text:style-name="Head 3" text:level="3" >Enums and Constant Groups</text:h><text:h text:style-name="Head 3" text:level="3" >Structs</text:h><text:h text:style-name="Head 3" text:level="3" >Any</text:h><text:h text:style-name="Head 3" text:level="3" >Sequence</text:h><text:h text:style-name="Head 2" text:level="2" >How to find the solution for a problem</text:h><text:h text:style-name="Head 2" text:level="2" >Finding your Way through the API Reference</text:h><text:h text:style-name="Head 2" text:level="2" >Common Mechanisms</text:h><text:h text:style-name="Head 3" text:level="3" >Text</text:h><text:h text:style-name="Head 3" text:level="3" >Table</text:h><text:h text:style-name="Head 3" text:level="3" >Drawing</text:h><text:h text:style-name="Head 1" text:level="1" >UNO in Professional Projects (<text:span text:style-name="T1" >145</text:span>)</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:p text:style-name="Paragraph" >UNO/API constituents: How UNOIDL/API, ServiceManager, Bridges, CoreReflection work together</text:p><text:h text:style-name="Head 2" text:level="2" >API Concepts</text:h><text:p text:style-name="Paragraph" >API is a language independent, abstract specification for UNO objects which are used in <text:s ></text:s>[PRODUCTNAME]</text:p><text:h text:style-name="Head 3" text:level="3" >Types in the API Reference</text:h><text:h text:style-name="Head 4" text:level="4" >Simple Types</text:h><text:h text:style-name="Head 4" text:level="4" >The Any Type</text:h><text:h text:style-name="Head 4" text:level="4" >Interfaces</text:h><text:h text:style-name="Head 4" text:level="4" >Services</text:h><text:h text:style-name="Head 4" text:level="4" >Modules</text:h><text:h text:style-name="Head 4" text:level="4" >Structs</text:h><text:h text:style-name="Head 4" text:level="4" >Constant Groups and Enums</text:h><text:h text:style-name="Head 4" text:level="4" >Sequences</text:h><text:h text:style-name="Head 4" text:level="4" >Exceptions</text:h><text:h text:style-name="Head 3" text:level="3" >API Principles</text:h><text:h text:style-name="Head 4" text:level="4" >Relationship between Specification, Implementation and Instances</text:h><text:h text:style-name="Head 4" text:level="4" >Object Composition</text:h><text:h text:style-name="Head 2" text:level="2" >UNO Concepts</text:h><text:p text:style-name="Paragraph" >UNO is an environment for networked object communication</text:p><text:h text:style-name="Head 3" text:level="3" >Interprocess Connections</text:h><text:h text:style-name="Head 3" text:level="3" >ServiceManager and ComponentContext</text:h><text:h text:style-name="Head 3" text:level="3" >Using UNO Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >Using Collections and Containers</text:h><text:h text:style-name="Head 3" text:level="3" >Event Model</text:h><text:h text:style-name="Head 3" text:level="3" >Exception Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Lifetime Control</text:h><text:h text:style-name="Head 3" text:level="3" >Object Identity</text:h><text:h text:style-name="Head 2" text:level="2" >Language Bindings</text:h><text:h text:style-name="Head 3" text:level="3" >Introduction for language binding</text:h><text:h text:style-name="Head 3" text:level="3" >Java Language Binding</text:h><text:h text:style-name="Head 3" text:level="3" >C++ Binding</text:h><text:h text:style-name="Head 3" text:level="3" >Access for [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 3" text:level="3" >Automation</text:h><text:h text:style-name="Head 1" text:level="1" >Writing UNO components</text:h><text:h text:style-name="Head 2" text:level="2" >Specifying a new Component</text:h><text:h text:style-name="Head 3" text:level="3" >UNOIDL language specification</text:h><text:h text:style-name="Head 2" text:level="2" >Implementing a Component</text:h><text:h text:style-name="Head 3" text:level="3" >Component Development Basics</text:h><text:unordered-list text:style-name="L1" ><text:list-item ><text:p text:style-name="P3" >Introduction</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >Mandatory interfaces: XInterface, XServiceInfo ((from UseInterfaces.CoreInterfaces))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >"Should be implemented" interfaces: XTypeProvider ((from UseInterfaces.CoreInterfaces ))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >optional interface: XMain for standalone execution</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Simple Component in Java</text:h><text:unordered-list text:style-name="L2" ><text:list-item ><text:p text:style-name="P4" >Getting the service manager ((Chapter Java components from unoBindingJava))</text:p></text:list-item><text:list-item ><text:p text:style-name="P4" >simple component chapter</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >C++ Component</text:h><text:h text:style-name="Head 3" text:level="3" >((Automation Component?))</text:h><text:h text:style-name="Head 2" text:level="2" >Deployment Options for Components</text:h><text:h text:style-name="Head 3" text:level="3" >Component Registration</text:h><text:h text:style-name="Head 3" text:level="3" >Service Manager Configuration</text:h><text:unordered-list text:style-name="L3" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P5" >XSet Interface</text:p><text:p text:style-name="P5" >Adding components during runtime, particularly interesting during development</text:p></text:list-item><text:list-item ><text:p text:style-name="P5" >ServiceManager Content</text:p><text:p text:style-name="P5" >Dynamically modifying the ServiceManager</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Bootstrapping the Service Manager ((from CppBind chapter))</text:h><text:unordered-list text:style-name="L4" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P6" >Simple Test Application</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >Configuring Your Application with Bootstrap Parameters</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >The UNO Executable</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Standalone Runtime Environment</text:h><text:p text:style-name="Paragraph" ><text:tab-stop ></text:tab-stop>The UNO executable and XMain</text:p><text:h text:style-name="Head 3" text:level="3" >Configuring the Java Runtime Environment</text:h><text:unordered-list text:style-name="L5" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P7" >The office and Java ((from UnoBindingJava))</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 1" text:level="1" >Advanced UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Design Patterns</text:h><text:h text:style-name="Head 2" text:level="2" >Bridging concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Requirements for Language Bindings and Bridges</text:h><text:h text:style-name="Head 3" text:level="3" >New Scripting Engines</text:h><text:h text:style-name="Head 2" text:level="2" >ServiceManager and loader</text:h><text:h text:style-name="Head 2" text:level="2" >Special Interfaces for internal use</text:h><text:p text:style-name="Paragraph" >XUNOTunnel</text:p><text:p text:style-name="Paragraph" >XAggregation</text:p><text:h text:style-name="Head 2" text:level="2" >UNO Reflection API</text:h><text:h text:style-name="Head 2" text:level="2" >TypeLibrary and TypeProviders</text:h><text:h text:style-name="Head 2" text:level="2" >Differences from Corba</text:h><text:h text:style-name="Head 1" text:level="1" >Office Development</text:h><text:h text:style-name="Head 2" text:level="2" >Global Object Structure</text:h><text:h text:style-name="Head 3" text:level="3" >Desktop Environment</text:h><text:h text:style-name="Head 3" text:level="3" >Frames and Frame Hierarchies</text:h><text:h text:style-name="Head 3" text:level="3" >Frame-Controller-Model Paradigm</text:h><text:h text:style-name="Head 3" text:level="3" >Loading and Saving Office Components</text:h><text:h text:style-name="Head 3" text:level="3" >Dispatch Framework</text:h><text:h text:style-name="Head 2" text:level="2" >Common Features</text:h><text:h text:style-name="Head 3" text:level="3" >Common Dialogs</text:h><text:h text:style-name="Head 3" text:level="3" >DocumentInfo</text:h><text:h text:style-name="Head 3" text:level="3" >Styles</text:h><text:h text:style-name="Head 3" text:level="3" >Search and Replace</text:h><text:h text:style-name="Head 3" text:level="3" >Number Formats</text:h><text:h text:style-name="Head 3" text:level="3" >Package File Formats</text:h><text:h text:style-name="Head 2" text:level="2" >Internationalization</text:h><text:h text:style-name="Head 2" text:level="2" >Linguistic</text:h><text:h text:style-name="Head 2" text:level="2" >System Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Clipboard</text:h><text:h text:style-name="Head 3" text:level="3" >File Picker</text:h><text:h text:style-name="Head 3" text:level="3" >Bridging to the Window System</text:h><text:p text:style-name="Paragraph" ></text:p><text:h text:style-name="Head 1" text:level="1" >Text Documents (51,5 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Text Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Text Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Using Text</text:h><text:h text:style-name="Head 3" text:level="3" >Tables</text:h><text:h text:style-name="Head 3" text:level="3" >Text Fields</text:h><text:h text:style-name="Head 3" text:level="3" >Bookmarks</text:h><text:h text:style-name="Head 3" text:level="3" >Indexes and Index Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Reference Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Footnotes and Endnotes</text:h><text:h text:style-name="Head 3" text:level="3" >Shape Objects in Text</text:h><text:h text:style-name="Head 3" text:level="3" >Redline</text:h><text:h text:style-name="Head 3" text:level="3" >Ruby</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Text Document</text:h><text:h text:style-name="Head 1" text:level="1" >Spreadsheet Documents</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Spreadsheet Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Spreadsheet Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Editing Spreadsheets</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Spreadsheet Document</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Spreadsheet Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Drawings and Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Draw/Impress Files</text:h><text:h text:style-name="Head 3" text:level="3" >Saving</text:h><text:h text:style-name="Head 3" text:level="3" >Printing</text:h><text:h text:style-name="Head 3" text:level="3" >Running Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Working with a Draw/Impress Document</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Draw/Impress Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Draw/Impress Document</text:h><text:h text:style-name="Head 1" text:level="1" >Charts</text:h><text:h text:style-name="Head 2" text:level="2" >Chart Basics</text:h><text:h text:style-name="Head 2" text:level="2" >Creating a Chart Document</text:h><text:h text:style-name="Head 2" text:level="2" >Editing a Chart Document</text:h><text:h text:style-name="Head 3" text:level="3" >Common Diagram API</text:h><text:h text:style-name="Head 3" text:level="3" >Different Chart Types</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Chart Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Basic and Dialogs</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:h text:style-name="Head 2" text:level="2" >Library Organization</text:h><text:h text:style-name="Head 2" text:level="2" >IDE with Dialogs and Events</text:h><text:h text:style-name="Head 2" text:level="2" >Using [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 2" text:level="2" >Toolkit Controls and their Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating Dialogs at Runtime</text:h><text:h text:style-name="Head 1" text:level="1" >Database Access</text:h><text:h text:style-name="Head 2" text:level="2" >Features of the [PRODUCTNAME] Database Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Capabilities</text:h><text:h text:style-name="Head 3" text:level="3" >SDBC, SDBCX, SDB Architecture</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Datasources with [PRODUCTNAME]</text:h><text:h text:style-name="Head 3" text:level="3" >DataSources</text:h><text:h text:style-name="Head 3" text:level="3" >Adding and Editing Datasources </text:h><text:h text:style-name="Head 3" text:level="3" >Establishing a Connection</text:h><text:h text:style-name="Head 4" text:level="4" >Getting Connections</text:h><text:h text:style-name="Head 4" text:level="4" >Driver specifics</text:h><text:h text:style-name="Head 3" text:level="3" >Connection Pooling</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Saved Queries</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Data</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Statements</text:h><text:h text:style-name="Head 3" text:level="3" >Resultsets</text:h><text:h text:style-name="Head 3" text:level="3" >Metadata</text:h><text:h text:style-name="Head 3" text:level="3" >Rowsets</text:h><text:h text:style-name="Head 2" text:level="2" >Working with the Database Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using DDL to change the DB Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using SDBCX to access the DB Design</text:h><text:h text:style-name="Head 2" text:level="2" >Using DBMS Features</text:h><text:h text:style-name="Head 3" text:level="3" >Stored Procedures</text:h><text:h text:style-name="Head 3" text:level="3" >Transaction Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Prepared Statements</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Database Drivers</text:h><text:h text:style-name="Head 1" text:level="1" >Forms</text:h><text:h text:style-name="Head 2" text:level="2" >Concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Models and Views</text:h><text:h text:style-name="Head 3" text:level="3" >Form Elements in the Document Model</text:h><text:h text:style-name="Head 3" text:level="3" >Special Form Components</text:h><text:h text:style-name="Head 3" text:level="3" >Events</text:h><text:h text:style-name="Head 3" text:level="3" >Data Awareness</text:h><text:h text:style-name="Head 2" text:level="2" >Recipes</text:h><text:h text:style-name="Head 3" text:level="3" >Making it easier to work with a Form</text:h><text:h text:style-name="Head 3" text:level="3" >Controlling the Data Input</text:h><text:h text:style-name="Head 3" text:level="3" >Collecting Data automatically</text:h><text:h text:style-name="Head 3" text:level="3" >Taking Advantage of Database Server Features</text:h><text:h text:style-name="Head 3" text:level="3" >Adding new Functionality</text:h><text:h text:style-name="Head 3" text:level="3" >Handling Errors</text:h><text:h text:style-name="Head 1" text:level="1" >UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Purpose of UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Document Contents as Streams</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Content Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating, Moving and Copying Document and Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Additional Commands</text:h><text:h text:style-name="Head 2" text:level="2" >Writing a Content Provider</text:h><text:h text:style-name="Head 1" text:level="1" >[PRODUCTNAME] Configuration</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing configuration data</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Configuration Data</text:h><text:h text:style-name="Head 1" text:level="1" >Appendix</text:h></office:body> + +<office:body ><text:sequence-decls ><text:sequence-decl text:display-outline-level="0" text:name="Illustration" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Table" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Text" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Drawing" ></text:sequence-decl></text:sequence-decls><text:p text:style-name="P1" >Programmer's Manual</text:p><text:p text:style-name="P2" >Planned Outline</text:p><text:p text:style-name="P2" ></text:p><text:h text:style-name="Head 1" text:level="1" >Preface (3 Pages)</text:h><text:h text:style-name="Head 1" text:level="1" >First Steps (24 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Programming with UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Fields of Application for UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Getting Started</text:h><text:h text:style-name="Head 3" text:level="3" >Required Files</text:h><text:h text:style-name="Head 3" text:level="3" >Configuration</text:h><text:h text:style-name="Head 3" text:level="3" >First Connection</text:h><text:h text:style-name="Head 2" text:level="2" >How to get Objects in [PRODUCTNAME]</text:h><text:h text:style-name="Head 2" text:level="2" >How to work with Objects</text:h><text:p text:style-name="Paragraph" >Example</text:p><text:h text:style-name="Head 3" text:level="3" >Services</text:h><text:h text:style-name="Head 3" text:level="3" >Querying Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >ElementAccess</text:h><text:h text:style-name="Head 3" text:level="3" >Simple Types</text:h><text:h text:style-name="Head 3" text:level="3" >Strings</text:h><text:h text:style-name="Head 3" text:level="3" >Enums and Constant Groups</text:h><text:h text:style-name="Head 3" text:level="3" >Structs</text:h><text:h text:style-name="Head 3" text:level="3" >Any</text:h><text:h text:style-name="Head 3" text:level="3" >Sequence</text:h><text:h text:style-name="Head 2" text:level="2" >How to find the solution for a problem</text:h><text:h text:style-name="Head 2" text:level="2" >Finding your Way through the API Reference</text:h><text:h text:style-name="Head 2" text:level="2" >Common Mechanisms</text:h><text:h text:style-name="Head 3" text:level="3" >Text</text:h><text:h text:style-name="Head 3" text:level="3" >Table</text:h><text:h text:style-name="Head 3" text:level="3" >Drawing</text:h><text:h text:style-name="Head 1" text:level="1" >UNO in Professional Projects (<text:span text:style-name="T1" >145</text:span>)</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:p text:style-name="Paragraph" >UNO/API constituents: How UNOIDL/API, ServiceManager, Bridges, CoreReflection work together</text:p><text:h text:style-name="Head 2" text:level="2" >API Concepts</text:h><text:p text:style-name="Paragraph" >API is a language independent, abstract specification for UNO objects which are used in <text:s ></text:s>[PRODUCTNAME]</text:p><text:h text:style-name="Head 3" text:level="3" >Types in the API Reference</text:h><text:h text:style-name="Head 4" text:level="4" >Simple Types</text:h><text:h text:style-name="Head 4" text:level="4" >The Any Type</text:h><text:h text:style-name="Head 4" text:level="4" >Interfaces</text:h><text:h text:style-name="Head 4" text:level="4" >Services</text:h><text:h text:style-name="Head 4" text:level="4" >Modules</text:h><text:h text:style-name="Head 4" text:level="4" >Structs</text:h><text:h text:style-name="Head 4" text:level="4" >Constant Groups and Enums</text:h><text:h text:style-name="Head 4" text:level="4" >Sequences</text:h><text:h text:style-name="Head 4" text:level="4" >Exceptions</text:h><text:h text:style-name="Head 3" text:level="3" >API Principles</text:h><text:h text:style-name="Head 4" text:level="4" >Relationship between Specification, Implementation and Instances</text:h><text:h text:style-name="Head 4" text:level="4" >Object Composition</text:h><text:h text:style-name="Head 2" text:level="2" >UNO Concepts</text:h><text:p text:style-name="Paragraph" >UNO is an environment for networked object communication</text:p><text:h text:style-name="Head 3" text:level="3" >Interprocess Connections</text:h><text:h text:style-name="Head 3" text:level="3" >ServiceManager and ComponentContext</text:h><text:h text:style-name="Head 3" text:level="3" >Using UNO Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >Using Collections and Containers</text:h><text:h text:style-name="Head 3" text:level="3" >Event Model</text:h><text:h text:style-name="Head 3" text:level="3" >Exception Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Lifetime Control</text:h><text:h text:style-name="Head 3" text:level="3" >Object Identity</text:h><text:h text:style-name="Head 2" text:level="2" >Language Bindings</text:h><text:h text:style-name="Head 3" text:level="3" >Introduction for language binding</text:h><text:h text:style-name="Head 3" text:level="3" >Java Language Binding</text:h><text:h text:style-name="Head 3" text:level="3" >C++ Binding</text:h><text:h text:style-name="Head 3" text:level="3" >Access for [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 3" text:level="3" >Automation</text:h><text:h text:style-name="Head 1" text:level="1" >Writing UNO components</text:h><text:h text:style-name="Head 2" text:level="2" >Specifying a new Component</text:h><text:h text:style-name="Head 3" text:level="3" >UNOIDL language specification</text:h><text:h text:style-name="Head 2" text:level="2" >Implementing a Component</text:h><text:h text:style-name="Head 3" text:level="3" >Component Development Basics</text:h><text:unordered-list text:style-name="L1" ><text:list-item ><text:p text:style-name="P3" >Introduction</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >Mandatory interfaces: XInterface, XServiceInfo ((from UseInterfaces.CoreInterfaces))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >"Should be implemented" interfaces: XTypeProvider ((from UseInterfaces.CoreInterfaces ))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >optional interface: XMain for standalone execution</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Simple Component in Java</text:h><text:unordered-list text:style-name="L2" ><text:list-item ><text:p text:style-name="P4" >Getting the service manager ((Chapter Java components from unoBindingJava))</text:p></text:list-item><text:list-item ><text:p text:style-name="P4" >simple component chapter</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >C++ Component</text:h><text:h text:style-name="Head 3" text:level="3" >((Automation Component?))</text:h><text:h text:style-name="Head 2" text:level="2" >Deployment Options for Components</text:h><text:h text:style-name="Head 3" text:level="3" >Component Registration</text:h><text:h text:style-name="Head 3" text:level="3" >Service Manager Configuration</text:h><text:unordered-list text:style-name="L3" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P5" >XSet Interface</text:p><text:p text:style-name="P5" >Adding components during runtime, particularly interesting during development</text:p></text:list-item><text:list-item ><text:p text:style-name="P5" >ServiceManager Content</text:p><text:p text:style-name="P5" >Dynamically modifying the ServiceManager</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Bootstrapping the Service Manager ((from CppBind chapter))</text:h><text:unordered-list text:style-name="L4" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P6" >Simple Test Application</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >Configuring Your Application with Bootstrap Parameters</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >The UNO Executable</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Standalone Runtime Environment</text:h><text:p text:style-name="Paragraph" ><text:tab-stop ></text:tab-stop>The UNO executable and XMain</text:p><text:h text:style-name="Head 3" text:level="3" >Configuring the Java Runtime Environment</text:h><text:unordered-list text:style-name="L5" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P7" >The office and Java ((from UnoBindingJava))</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 1" text:level="1" >Advanced UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Design Patterns</text:h><text:h text:style-name="Head 2" text:level="2" >Bridging concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Requirements for Language Bindings and Bridges</text:h><text:h text:style-name="Head 3" text:level="3" >New Scripting Engines</text:h><text:h text:style-name="Head 2" text:level="2" >ServiceManager and loader</text:h><text:h text:style-name="Head 2" text:level="2" >Special Interfaces for internal use</text:h><text:p text:style-name="Paragraph" >XUNOTunnel</text:p><text:p text:style-name="Paragraph" >XAggregation</text:p><text:h text:style-name="Head 2" text:level="2" >UNO Reflection API</text:h><text:h text:style-name="Head 2" text:level="2" >TypeLibrary and TypeProviders</text:h><text:h text:style-name="Head 2" text:level="2" >Differences from Corba</text:h><text:h text:style-name="Head 1" text:level="1" >Office Development</text:h><text:h text:style-name="Head 2" text:level="2" >Global Object Structure</text:h><text:h text:style-name="Head 3" text:level="3" >Desktop Environment</text:h><text:h text:style-name="Head 3" text:level="3" >Frames and Frame Hierarchies</text:h><text:h text:style-name="Head 3" text:level="3" >Frame-Controller-Model Paradigm</text:h><text:h text:style-name="Head 3" text:level="3" >Loading and Saving Office Components</text:h><text:h text:style-name="Head 3" text:level="3" >Dispatch Framework</text:h><text:h text:style-name="Head 2" text:level="2" >Common Features</text:h><text:h text:style-name="Head 3" text:level="3" >Common Dialogs</text:h><text:h text:style-name="Head 3" text:level="3" >DocumentInfo</text:h><text:h text:style-name="Head 3" text:level="3" >Styles</text:h><text:h text:style-name="Head 3" text:level="3" >Search and Replace</text:h><text:h text:style-name="Head 3" text:level="3" >Number Formats</text:h><text:h text:style-name="Head 3" text:level="3" >Package File Formats</text:h><text:h text:style-name="Head 2" text:level="2" >Internationalization</text:h><text:h text:style-name="Head 2" text:level="2" >Linguistic</text:h><text:h text:style-name="Head 2" text:level="2" >System Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Clipboard</text:h><text:h text:style-name="Head 3" text:level="3" >File Picker</text:h><text:h text:style-name="Head 3" text:level="3" >Bridging to the Window System</text:h><text:p text:style-name="Paragraph" ></text:p><text:h text:style-name="Head 1" text:level="1" >Text Documents (51,5 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Text Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Text Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Using Text</text:h><text:h text:style-name="Head 3" text:level="3" >Tables</text:h><text:h text:style-name="Head 3" text:level="3" >Text Fields</text:h><text:h text:style-name="Head 3" text:level="3" >Bookmarks</text:h><text:h text:style-name="Head 3" text:level="3" >Indexes and Index Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Reference Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Footnotes and Endnotes</text:h><text:h text:style-name="Head 3" text:level="3" >Shape Objects in Text</text:h><text:h text:style-name="Head 3" text:level="3" >Redline</text:h><text:h text:style-name="Head 3" text:level="3" >Ruby</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Text Document</text:h><text:h text:style-name="Head 1" text:level="1" >Spreadsheet Documents</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Spreadsheet Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Spreadsheet Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Editing Spreadsheets</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Spreadsheet Document</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Spreadsheet Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Drawings and Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Draw/Impress Files</text:h><text:h text:style-name="Head 3" text:level="3" >Saving</text:h><text:h text:style-name="Head 3" text:level="3" >Printing</text:h><text:h text:style-name="Head 3" text:level="3" >Running Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Working with a Draw/Impress Document</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Draw/Impress Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Draw/Impress Document</text:h><text:h text:style-name="Head 1" text:level="1" >Charts</text:h><text:h text:style-name="Head 2" text:level="2" >Chart Basics</text:h><text:h text:style-name="Head 2" text:level="2" >Creating a Chart Document</text:h><text:h text:style-name="Head 2" text:level="2" >Editing a Chart Document</text:h><text:h text:style-name="Head 3" text:level="3" >Common Diagram API</text:h><text:h text:style-name="Head 3" text:level="3" >Different Chart Types</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Chart Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Basic and Dialogs</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:h text:style-name="Head 2" text:level="2" >Library Organization</text:h><text:h text:style-name="Head 2" text:level="2" >IDE with Dialogs and Events</text:h><text:h text:style-name="Head 2" text:level="2" >Using [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 2" text:level="2" >Toolkit Controls and their Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating Dialogs at Runtime</text:h><text:h text:style-name="Head 1" text:level="1" >Database Access</text:h><text:h text:style-name="Head 2" text:level="2" >Features of the [PRODUCTNAME] Database Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Capabilities</text:h><text:h text:style-name="Head 3" text:level="3" >SDBC, SDBCX, SDB Architecture</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Datasources with [PRODUCTNAME]</text:h><text:h text:style-name="Head 3" text:level="3" >DataSources</text:h><text:h text:style-name="Head 3" text:level="3" >Adding and Editing Datasources </text:h><text:h text:style-name="Head 3" text:level="3" >Establishing a Connection</text:h><text:h text:style-name="Head 4" text:level="4" >Getting Connections</text:h><text:h text:style-name="Head 4" text:level="4" >Driver specifics</text:h><text:h text:style-name="Head 3" text:level="3" >Connection Pooling</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Saved Queries</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Data</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Statements</text:h><text:h text:style-name="Head 3" text:level="3" >Resultsets</text:h><text:h text:style-name="Head 3" text:level="3" >Metadata</text:h><text:h text:style-name="Head 3" text:level="3" >Rowsets</text:h><text:h text:style-name="Head 2" text:level="2" >Working with the Database Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using DDL to change the DB Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using SDBCX to access the DB Design</text:h><text:h text:style-name="Head 2" text:level="2" >Using DBMS Features</text:h><text:h text:style-name="Head 3" text:level="3" >Stored Procedures</text:h><text:h text:style-name="Head 3" text:level="3" >Transaction Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Prepared Statements</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Database Drivers</text:h><text:h text:style-name="Head 1" text:level="1" >Forms</text:h><text:h text:style-name="Head 2" text:level="2" >Concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Models and Views</text:h><text:h text:style-name="Head 3" text:level="3" >Form Elements in the Document Model</text:h><text:h text:style-name="Head 3" text:level="3" >Special Form Components</text:h><text:h text:style-name="Head 3" text:level="3" >Events</text:h><text:h text:style-name="Head 3" text:level="3" >Data Awareness</text:h><text:h text:style-name="Head 2" text:level="2" >Recipes</text:h><text:h text:style-name="Head 3" text:level="3" >Making it easier to work with a Form</text:h><text:h text:style-name="Head 3" text:level="3" >Controlling the Data Input</text:h><text:h text:style-name="Head 3" text:level="3" >Collecting Data automatically</text:h><text:h text:style-name="Head 3" text:level="3" >Taking Advantage of Database Server Features</text:h><text:h text:style-name="Head 3" text:level="3" >Adding new Functionality</text:h><text:h text:style-name="Head 3" text:level="3" >Handling Errors</text:h><text:h text:style-name="Head 1" text:level="1" >UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Purpose of UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Document Contents as Streams</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Content Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating, Moving and Copying Document and Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Additional Commands</text:h><text:h text:style-name="Head 2" text:level="2" >Writing a Content Provider</text:h><text:h text:style-name="Head 1" text:level="1" >[PRODUCTNAME] Configuration</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing configuration data</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Configuration Data</text:h><text:h text:style-name="Head 1" text:level="1" >Appendix</text:h></office:body> + +<office:body ><text:sequence-decls ><text:sequence-decl text:display-outline-level="0" text:name="Illustration" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Table" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Text" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Drawing" ></text:sequence-decl></text:sequence-decls><text:p text:style-name="P1" >Programmer's Manual</text:p><text:p text:style-name="P2" >Planned Outline</text:p><text:p text:style-name="P2" ></text:p><text:h text:style-name="Head 1" text:level="1" >Preface (3 Pages)</text:h><text:h text:style-name="Head 1" text:level="1" >First Steps (24 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Programming with UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Fields of Application for UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Getting Started</text:h><text:h text:style-name="Head 3" text:level="3" >Required Files</text:h><text:h text:style-name="Head 3" text:level="3" >Configuration</text:h><text:h text:style-name="Head 3" text:level="3" >First Connection</text:h><text:h text:style-name="Head 2" text:level="2" >How to get Objects in [PRODUCTNAME]</text:h><text:h text:style-name="Head 2" text:level="2" >How to work with Objects</text:h><text:p text:style-name="Paragraph" >Example</text:p><text:h text:style-name="Head 3" text:level="3" >Services</text:h><text:h text:style-name="Head 3" text:level="3" >Querying Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >ElementAccess</text:h><text:h text:style-name="Head 3" text:level="3" >Simple Types</text:h><text:h text:style-name="Head 3" text:level="3" >Strings</text:h><text:h text:style-name="Head 3" text:level="3" >Enums and Constant Groups</text:h><text:h text:style-name="Head 3" text:level="3" >Structs</text:h><text:h text:style-name="Head 3" text:level="3" >Any</text:h><text:h text:style-name="Head 3" text:level="3" >Sequence</text:h><text:h text:style-name="Head 2" text:level="2" >How to find the solution for a problem</text:h><text:h text:style-name="Head 2" text:level="2" >Finding your Way through the API Reference</text:h><text:h text:style-name="Head 2" text:level="2" >Common Mechanisms</text:h><text:h text:style-name="Head 3" text:level="3" >Text</text:h><text:h text:style-name="Head 3" text:level="3" >Table</text:h><text:h text:style-name="Head 3" text:level="3" >Drawing</text:h><text:h text:style-name="Head 1" text:level="1" >UNO in Professional Projects (<text:span text:style-name="T1" >145</text:span>)</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:p text:style-name="Paragraph" >UNO/API constituents: How UNOIDL/API, ServiceManager, Bridges, CoreReflection work together</text:p><text:h text:style-name="Head 2" text:level="2" >API Concepts</text:h><text:p text:style-name="Paragraph" >API is a language independent, abstract specification for UNO objects which are used in <text:s ></text:s>[PRODUCTNAME]</text:p><text:h text:style-name="Head 3" text:level="3" >Types in the API Reference</text:h><text:h text:style-name="Head 4" text:level="4" >Simple Types</text:h><text:h text:style-name="Head 4" text:level="4" >The Any Type</text:h><text:h text:style-name="Head 4" text:level="4" >Interfaces</text:h><text:h text:style-name="Head 4" text:level="4" >Services</text:h><text:h text:style-name="Head 4" text:level="4" >Modules</text:h><text:h text:style-name="Head 4" text:level="4" >Structs</text:h><text:h text:style-name="Head 4" text:level="4" >Constant Groups and Enums</text:h><text:h text:style-name="Head 4" text:level="4" >Sequences</text:h><text:h text:style-name="Head 4" text:level="4" >Exceptions</text:h><text:h text:style-name="Head 3" text:level="3" >API Principles</text:h><text:h text:style-name="Head 4" text:level="4" >Relationship between Specification, Implementation and Instances</text:h><text:h text:style-name="Head 4" text:level="4" >Object Composition</text:h><text:h text:style-name="Head 2" text:level="2" >UNO Concepts</text:h><text:p text:style-name="Paragraph" >UNO is an environment for networked object communication</text:p><text:h text:style-name="Head 3" text:level="3" >Interprocess Connections</text:h><text:h text:style-name="Head 3" text:level="3" >ServiceManager and ComponentContext</text:h><text:h text:style-name="Head 3" text:level="3" >Using UNO Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >Using Collections and Containers</text:h><text:h text:style-name="Head 3" text:level="3" >Event Model</text:h><text:h text:style-name="Head 3" text:level="3" >Exception Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Lifetime Control</text:h><text:h text:style-name="Head 3" text:level="3" >Object Identity</text:h><text:h text:style-name="Head 2" text:level="2" >Language Bindings</text:h><text:h text:style-name="Head 3" text:level="3" >Introduction for language binding</text:h><text:h text:style-name="Head 3" text:level="3" >Java Language Binding</text:h><text:h text:style-name="Head 3" text:level="3" >C++ Binding</text:h><text:h text:style-name="Head 3" text:level="3" >Access for [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 3" text:level="3" >Automation</text:h><text:h text:style-name="Head 1" text:level="1" >Writing UNO components</text:h><text:h text:style-name="Head 2" text:level="2" >Specifying a new Component</text:h><text:h text:style-name="Head 3" text:level="3" >UNOIDL language specification</text:h><text:h text:style-name="Head 2" text:level="2" >Implementing a Component</text:h><text:h text:style-name="Head 3" text:level="3" >Component Development Basics</text:h><text:unordered-list text:style-name="L1" ><text:list-item ><text:p text:style-name="P3" >Introduction</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >Mandatory interfaces: XInterface, XServiceInfo ((from UseInterfaces.CoreInterfaces))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >"Should be implemented" interfaces: XTypeProvider ((from UseInterfaces.CoreInterfaces ))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >optional interface: XMain for standalone execution</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Simple Component in Java</text:h><text:unordered-list text:style-name="L2" ><text:list-item ><text:p text:style-name="P4" >Getting the service manager ((Chapter Java components from unoBindingJava))</text:p></text:list-item><text:list-item ><text:p text:style-name="P4" >simple component chapter</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >C++ Component</text:h><text:h text:style-name="Head 3" text:level="3" >((Automation Component?))</text:h><text:h text:style-name="Head 2" text:level="2" >Deployment Options for Components</text:h><text:h text:style-name="Head 3" text:level="3" >Component Registration</text:h><text:h text:style-name="Head 3" text:level="3" >Service Manager Configuration</text:h><text:unordered-list text:style-name="L3" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P5" >XSet Interface</text:p><text:p text:style-name="P5" >Adding components during runtime, particularly interesting during development</text:p></text:list-item><text:list-item ><text:p text:style-name="P5" >ServiceManager Content</text:p><text:p text:style-name="P5" >Dynamically modifying the ServiceManager</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Bootstrapping the Service Manager ((from CppBind chapter))</text:h><text:unordered-list text:style-name="L4" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P6" >Simple Test Application</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >Configuring Your Application with Bootstrap Parameters</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >The UNO Executable</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Standalone Runtime Environment</text:h><text:p text:style-name="Paragraph" ><text:tab-stop ></text:tab-stop>The UNO executable and XMain</text:p><text:h text:style-name="Head 3" text:level="3" >Configuring the Java Runtime Environment</text:h><text:unordered-list text:style-name="L5" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P7" >The office and Java ((from UnoBindingJava))</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 1" text:level="1" >Advanced UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Design Patterns</text:h><text:h text:style-name="Head 2" text:level="2" >Bridging concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Requirements for Language Bindings and Bridges</text:h><text:h text:style-name="Head 3" text:level="3" >New Scripting Engines</text:h><text:h text:style-name="Head 2" text:level="2" >ServiceManager and loader</text:h><text:h text:style-name="Head 2" text:level="2" >Special Interfaces for internal use</text:h><text:p text:style-name="Paragraph" >XUNOTunnel</text:p><text:p text:style-name="Paragraph" >XAggregation</text:p><text:h text:style-name="Head 2" text:level="2" >UNO Reflection API</text:h><text:h text:style-name="Head 2" text:level="2" >TypeLibrary and TypeProviders</text:h><text:h text:style-name="Head 2" text:level="2" >Differences from Corba</text:h><text:h text:style-name="Head 1" text:level="1" >Office Development</text:h><text:h text:style-name="Head 2" text:level="2" >Global Object Structure</text:h><text:h text:style-name="Head 3" text:level="3" >Desktop Environment</text:h><text:h text:style-name="Head 3" text:level="3" >Frames and Frame Hierarchies</text:h><text:h text:style-name="Head 3" text:level="3" >Frame-Controller-Model Paradigm</text:h><text:h text:style-name="Head 3" text:level="3" >Loading and Saving Office Components</text:h><text:h text:style-name="Head 3" text:level="3" >Dispatch Framework</text:h><text:h text:style-name="Head 2" text:level="2" >Common Features</text:h><text:h text:style-name="Head 3" text:level="3" >Common Dialogs</text:h><text:h text:style-name="Head 3" text:level="3" >DocumentInfo</text:h><text:h text:style-name="Head 3" text:level="3" >Styles</text:h><text:h text:style-name="Head 3" text:level="3" >Search and Replace</text:h><text:h text:style-name="Head 3" text:level="3" >Number Formats</text:h><text:h text:style-name="Head 3" text:level="3" >Package File Formats</text:h><text:h text:style-name="Head 2" text:level="2" >Internationalization</text:h><text:h text:style-name="Head 2" text:level="2" >Linguistic</text:h><text:h text:style-name="Head 2" text:level="2" >System Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Clipboard</text:h><text:h text:style-name="Head 3" text:level="3" >File Picker</text:h><text:h text:style-name="Head 3" text:level="3" >Bridging to the Window System</text:h><text:p text:style-name="Paragraph" ></text:p><text:h text:style-name="Head 1" text:level="1" >Text Documents (51,5 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Text Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Text Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Using Text</text:h><text:h text:style-name="Head 3" text:level="3" >Tables</text:h><text:h text:style-name="Head 3" text:level="3" >Text Fields</text:h><text:h text:style-name="Head 3" text:level="3" >Bookmarks</text:h><text:h text:style-name="Head 3" text:level="3" >Indexes and Index Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Reference Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Footnotes and Endnotes</text:h><text:h text:style-name="Head 3" text:level="3" >Shape Objects in Text</text:h><text:h text:style-name="Head 3" text:level="3" >Redline</text:h><text:h text:style-name="Head 3" text:level="3" >Ruby</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Text Document</text:h><text:h text:style-name="Head 1" text:level="1" >Spreadsheet Documents</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Spreadsheet Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Spreadsheet Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Editing Spreadsheets</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Spreadsheet Document</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Spreadsheet Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Drawings and Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Draw/Impress Files</text:h><text:h text:style-name="Head 3" text:level="3" >Saving</text:h><text:h text:style-name="Head 3" text:level="3" >Printing</text:h><text:h text:style-name="Head 3" text:level="3" >Running Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Working with a Draw/Impress Document</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Draw/Impress Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Draw/Impress Document</text:h><text:h text:style-name="Head 1" text:level="1" >Charts</text:h><text:h text:style-name="Head 2" text:level="2" >Chart Basics</text:h><text:h text:style-name="Head 2" text:level="2" >Creating a Chart Document</text:h><text:h text:style-name="Head 2" text:level="2" >Editing a Chart Document</text:h><text:h text:style-name="Head 3" text:level="3" >Common Diagram API</text:h><text:h text:style-name="Head 3" text:level="3" >Different Chart Types</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Chart Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Basic and Dialogs</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:h text:style-name="Head 2" text:level="2" >Library Organization</text:h><text:h text:style-name="Head 2" text:level="2" >IDE with Dialogs and Events</text:h><text:h text:style-name="Head 2" text:level="2" >Using [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 2" text:level="2" >Toolkit Controls and their Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating Dialogs at Runtime</text:h><text:h text:style-name="Head 1" text:level="1" >Database Access</text:h><text:h text:style-name="Head 2" text:level="2" >Features of the [PRODUCTNAME] Database Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Capabilities</text:h><text:h text:style-name="Head 3" text:level="3" >SDBC, SDBCX, SDB Architecture</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Datasources with [PRODUCTNAME]</text:h><text:h text:style-name="Head 3" text:level="3" >DataSources</text:h><text:h text:style-name="Head 3" text:level="3" >Adding and Editing Datasources </text:h><text:h text:style-name="Head 3" text:level="3" >Establishing a Connection</text:h><text:h text:style-name="Head 4" text:level="4" >Getting Connections</text:h><text:h text:style-name="Head 4" text:level="4" >Driver specifics</text:h><text:h text:style-name="Head 3" text:level="3" >Connection Pooling</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Saved Queries</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Data</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Statements</text:h><text:h text:style-name="Head 3" text:level="3" >Resultsets</text:h><text:h text:style-name="Head 3" text:level="3" >Metadata</text:h><text:h text:style-name="Head 3" text:level="3" >Rowsets</text:h><text:h text:style-name="Head 2" text:level="2" >Working with the Database Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using DDL to change the DB Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using SDBCX to access the DB Design</text:h><text:h text:style-name="Head 2" text:level="2" >Using DBMS Features</text:h><text:h text:style-name="Head 3" text:level="3" >Stored Procedures</text:h><text:h text:style-name="Head 3" text:level="3" >Transaction Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Prepared Statements</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Database Drivers</text:h><text:h text:style-name="Head 1" text:level="1" >Forms</text:h><text:h text:style-name="Head 2" text:level="2" >Concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Models and Views</text:h><text:h text:style-name="Head 3" text:level="3" >Form Elements in the Document Model</text:h><text:h text:style-name="Head 3" text:level="3" >Special Form Components</text:h><text:h text:style-name="Head 3" text:level="3" >Events</text:h><text:h text:style-name="Head 3" text:level="3" >Data Awareness</text:h><text:h text:style-name="Head 2" text:level="2" >Recipes</text:h><text:h text:style-name="Head 3" text:level="3" >Making it easier to work with a Form</text:h><text:h text:style-name="Head 3" text:level="3" >Controlling the Data Input</text:h><text:h text:style-name="Head 3" text:level="3" >Collecting Data automatically</text:h><text:h text:style-name="Head 3" text:level="3" >Taking Advantage of Database Server Features</text:h><text:h text:style-name="Head 3" text:level="3" >Adding new Functionality</text:h><text:h text:style-name="Head 3" text:level="3" >Handling Errors</text:h><text:h text:style-name="Head 1" text:level="1" >UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Purpose of UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Document Contents as Streams</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Content Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating, Moving and Copying Document and Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Additional Commands</text:h><text:h text:style-name="Head 2" text:level="2" >Writing a Content Provider</text:h><text:h text:style-name="Head 1" text:level="1" >[PRODUCTNAME] Configuration</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing configuration data</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Configuration Data</text:h><text:h text:style-name="Head 1" text:level="1" >Appendix</text:h></office:body> + +</office:document> +</signtest>
\ No newline at end of file diff --git a/xmlsecurity/tools/examples/sign-5.xml b/xmlsecurity/tools/examples/sign-5.xml new file mode 100644 index 000000000000..46cb6d609fe5 --- /dev/null +++ b/xmlsecurity/tools/examples/sign-5.xml @@ -0,0 +1,89 @@ +<?xml version="1.0" encoding="UTF-8"?> +<signtest> +<Signature xmlns="http://www.w3.org/2000/09/xmldsig#"> + <SignedInfo> + <CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" /> + <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" /> + <Reference URI="#target"> + <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" /> + <DigestValue> </DigestValue> + </Reference> + </SignedInfo> + <SignatureValue> </SignatureValue> + <KeyInfo> + <X509Data> + <X509IssuerSerial> + <X509IssuerName>CN=Test Issuer</X509IssuerName> + <X509SerialNumber>123450005</X509SerialNumber> + </X509IssuerSerial> + </X509Data> + </KeyInfo> +</Signature> +<office:document id="target" xmlns:office="http://openoffice.org/2000/office" xmlns:style="http://openoffice.org/2000/style" xmlns:text="http://openoffice.org/2000/text" xmlns:table="http://openoffice.org/2000/table" xmlns:draw="http://openoffice.org/2000/drawing" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:meta="http://openoffice.org/2000/meta" xmlns:number="http://openoffice.org/2000/datastyle" xmlns:svg="http://www.w3.org/2000/svg" xmlns:chart="http://openoffice.org/2000/chart" xmlns:dr3d="http://openoffice.org/2000/dr3d" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="http://openoffice.org/2000/form" xmlns:script="http://openoffice.org/2000/script" xmlns:config="http://openoffice.org/2001/config" office:class="text" office:version="1.0" > + +<office:body ><text:sequence-decls ><text:sequence-decl text:display-outline-level="0" text:name="Illustration" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Table" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Text" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Drawing" ></text:sequence-decl></text:sequence-decls><text:p text:style-name="P1" >Programmer's Manual</text:p><text:p text:style-name="P2" >Planned Outline</text:p><text:p text:style-name="P2" ></text:p><text:h text:style-name="Head 1" text:level="1" >Preface (3 Pages)</text:h><text:h text:style-name="Head 1" text:level="1" >First Steps (24 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Programming with UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Fields of Application for UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Getting Started</text:h><text:h text:style-name="Head 3" text:level="3" >Required Files</text:h><text:h text:style-name="Head 3" text:level="3" >Configuration</text:h><text:h text:style-name="Head 3" text:level="3" >First Connection</text:h><text:h text:style-name="Head 2" text:level="2" >How to get Objects in [PRODUCTNAME]</text:h><text:h text:style-name="Head 2" text:level="2" >How to work with Objects</text:h><text:p text:style-name="Paragraph" >Example</text:p><text:h text:style-name="Head 3" text:level="3" >Services</text:h><text:h text:style-name="Head 3" text:level="3" >Querying Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >ElementAccess</text:h><text:h text:style-name="Head 3" text:level="3" >Simple Types</text:h><text:h text:style-name="Head 3" text:level="3" >Strings</text:h><text:h text:style-name="Head 3" text:level="3" >Enums and Constant Groups</text:h><text:h text:style-name="Head 3" text:level="3" >Structs</text:h><text:h text:style-name="Head 3" text:level="3" >Any</text:h><text:h text:style-name="Head 3" text:level="3" >Sequence</text:h><text:h text:style-name="Head 2" text:level="2" >How to find the solution for a problem</text:h><text:h text:style-name="Head 2" text:level="2" >Finding your Way through the API Reference</text:h><text:h text:style-name="Head 2" text:level="2" >Common Mechanisms</text:h><text:h text:style-name="Head 3" text:level="3" >Text</text:h><text:h text:style-name="Head 3" text:level="3" >Table</text:h><text:h text:style-name="Head 3" text:level="3" >Drawing</text:h><text:h text:style-name="Head 1" text:level="1" >UNO in Professional Projects (<text:span text:style-name="T1" >145</text:span>)</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:p text:style-name="Paragraph" >UNO/API constituents: How UNOIDL/API, ServiceManager, Bridges, CoreReflection work together</text:p><text:h text:style-name="Head 2" text:level="2" >API Concepts</text:h><text:p text:style-name="Paragraph" >API is a language independent, abstract specification for UNO objects which are used in <text:s ></text:s>[PRODUCTNAME]</text:p><text:h text:style-name="Head 3" text:level="3" >Types in the API Reference</text:h><text:h text:style-name="Head 4" text:level="4" >Simple Types</text:h><text:h text:style-name="Head 4" text:level="4" >The Any Type</text:h><text:h text:style-name="Head 4" text:level="4" >Interfaces</text:h><text:h text:style-name="Head 4" text:level="4" >Services</text:h><text:h text:style-name="Head 4" text:level="4" >Modules</text:h><text:h text:style-name="Head 4" text:level="4" >Structs</text:h><text:h text:style-name="Head 4" text:level="4" >Constant Groups and Enums</text:h><text:h text:style-name="Head 4" text:level="4" >Sequences</text:h><text:h text:style-name="Head 4" text:level="4" >Exceptions</text:h><text:h text:style-name="Head 3" text:level="3" >API Principles</text:h><text:h text:style-name="Head 4" text:level="4" >Relationship between Specification, Implementation and Instances</text:h><text:h text:style-name="Head 4" text:level="4" >Object Composition</text:h><text:h text:style-name="Head 2" text:level="2" >UNO Concepts</text:h><text:p text:style-name="Paragraph" >UNO is an environment for networked object communication</text:p><text:h text:style-name="Head 3" text:level="3" >Interprocess Connections</text:h><text:h text:style-name="Head 3" text:level="3" >ServiceManager and ComponentContext</text:h><text:h text:style-name="Head 3" text:level="3" >Using UNO Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >Using Collections and Containers</text:h><text:h text:style-name="Head 3" text:level="3" >Event Model</text:h><text:h text:style-name="Head 3" text:level="3" >Exception Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Lifetime Control</text:h><text:h text:style-name="Head 3" text:level="3" >Object Identity</text:h><text:h text:style-name="Head 2" text:level="2" >Language Bindings</text:h><text:h text:style-name="Head 3" text:level="3" >Introduction for language binding</text:h><text:h text:style-name="Head 3" text:level="3" >Java Language Binding</text:h><text:h text:style-name="Head 3" text:level="3" >C++ Binding</text:h><text:h text:style-name="Head 3" text:level="3" >Access for [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 3" text:level="3" >Automation</text:h><text:h text:style-name="Head 1" text:level="1" >Writing UNO components</text:h><text:h text:style-name="Head 2" text:level="2" >Specifying a new Component</text:h><text:h text:style-name="Head 3" text:level="3" >UNOIDL language specification</text:h><text:h text:style-name="Head 2" text:level="2" >Implementing a Component</text:h><text:h text:style-name="Head 3" text:level="3" >Component Development Basics</text:h><text:unordered-list text:style-name="L1" ><text:list-item ><text:p text:style-name="P3" >Introduction</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >Mandatory interfaces: XInterface, XServiceInfo ((from UseInterfaces.CoreInterfaces))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >"Should be implemented" interfaces: XTypeProvider ((from UseInterfaces.CoreInterfaces ))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >optional interface: XMain for standalone execution</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Simple Component in Java</text:h><text:unordered-list text:style-name="L2" ><text:list-item ><text:p text:style-name="P4" >Getting the service manager ((Chapter Java components from unoBindingJava))</text:p></text:list-item><text:list-item ><text:p text:style-name="P4" >simple component chapter</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >C++ Component</text:h><text:h text:style-name="Head 3" text:level="3" >((Automation Component?))</text:h><text:h text:style-name="Head 2" text:level="2" >Deployment Options for Components</text:h><text:h text:style-name="Head 3" text:level="3" >Component Registration</text:h><text:h text:style-name="Head 3" text:level="3" >Service Manager Configuration</text:h><text:unordered-list text:style-name="L3" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P5" >XSet Interface</text:p><text:p text:style-name="P5" >Adding components during runtime, particularly interesting during development</text:p></text:list-item><text:list-item ><text:p text:style-name="P5" >ServiceManager Content</text:p><text:p text:style-name="P5" >Dynamically modifying the ServiceManager</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Bootstrapping the Service Manager ((from CppBind chapter))</text:h><text:unordered-list text:style-name="L4" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P6" >Simple Test Application</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >Configuring Your Application with Bootstrap Parameters</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >The UNO Executable</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Standalone Runtime Environment</text:h><text:p text:style-name="Paragraph" ><text:tab-stop ></text:tab-stop>The UNO executable and XMain</text:p><text:h text:style-name="Head 3" text:level="3" >Configuring the Java Runtime Environment</text:h><text:unordered-list text:style-name="L5" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P7" >The office and Java ((from UnoBindingJava))</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 1" text:level="1" >Advanced UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Design Patterns</text:h><text:h text:style-name="Head 2" text:level="2" >Bridging concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Requirements for Language Bindings and Bridges</text:h><text:h text:style-name="Head 3" text:level="3" >New Scripting Engines</text:h><text:h text:style-name="Head 2" text:level="2" >ServiceManager and loader</text:h><text:h text:style-name="Head 2" text:level="2" >Special Interfaces for internal use</text:h><text:p text:style-name="Paragraph" >XUNOTunnel</text:p><text:p text:style-name="Paragraph" >XAggregation</text:p><text:h text:style-name="Head 2" text:level="2" >UNO Reflection API</text:h><text:h text:style-name="Head 2" text:level="2" >TypeLibrary and TypeProviders</text:h><text:h text:style-name="Head 2" text:level="2" >Differences from Corba</text:h><text:h text:style-name="Head 1" text:level="1" >Office Development</text:h><text:h text:style-name="Head 2" text:level="2" >Global Object Structure</text:h><text:h text:style-name="Head 3" text:level="3" >Desktop Environment</text:h><text:h text:style-name="Head 3" text:level="3" >Frames and Frame Hierarchies</text:h><text:h text:style-name="Head 3" text:level="3" >Frame-Controller-Model Paradigm</text:h><text:h text:style-name="Head 3" text:level="3" >Loading and Saving Office Components</text:h><text:h text:style-name="Head 3" text:level="3" >Dispatch Framework</text:h><text:h text:style-name="Head 2" text:level="2" >Common Features</text:h><text:h text:style-name="Head 3" text:level="3" >Common Dialogs</text:h><text:h text:style-name="Head 3" text:level="3" >DocumentInfo</text:h><text:h text:style-name="Head 3" text:level="3" >Styles</text:h><text:h text:style-name="Head 3" text:level="3" >Search and Replace</text:h><text:h text:style-name="Head 3" text:level="3" >Number Formats</text:h><text:h text:style-name="Head 3" text:level="3" >Package File Formats</text:h><text:h text:style-name="Head 2" text:level="2" >Internationalization</text:h><text:h text:style-name="Head 2" text:level="2" >Linguistic</text:h><text:h text:style-name="Head 2" text:level="2" >System Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Clipboard</text:h><text:h text:style-name="Head 3" text:level="3" >File Picker</text:h><text:h text:style-name="Head 3" text:level="3" >Bridging to the Window System</text:h><text:p text:style-name="Paragraph" ></text:p><text:h text:style-name="Head 1" text:level="1" >Text Documents (51,5 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Text Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Text Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Using Text</text:h><text:h text:style-name="Head 3" text:level="3" >Tables</text:h><text:h text:style-name="Head 3" text:level="3" >Text Fields</text:h><text:h text:style-name="Head 3" text:level="3" >Bookmarks</text:h><text:h text:style-name="Head 3" text:level="3" >Indexes and Index Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Reference Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Footnotes and Endnotes</text:h><text:h text:style-name="Head 3" text:level="3" >Shape Objects in Text</text:h><text:h text:style-name="Head 3" text:level="3" >Redline</text:h><text:h text:style-name="Head 3" text:level="3" >Ruby</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Text Document</text:h><text:h text:style-name="Head 1" text:level="1" >Spreadsheet Documents</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Spreadsheet Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Spreadsheet Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Editing Spreadsheets</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Spreadsheet Document</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Spreadsheet Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Drawings and Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Draw/Impress Files</text:h><text:h text:style-name="Head 3" text:level="3" >Saving</text:h><text:h text:style-name="Head 3" text:level="3" >Printing</text:h><text:h text:style-name="Head 3" text:level="3" >Running Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Working with a Draw/Impress Document</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Draw/Impress Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Draw/Impress Document</text:h><text:h text:style-name="Head 1" text:level="1" >Charts</text:h><text:h text:style-name="Head 2" text:level="2" >Chart Basics</text:h><text:h text:style-name="Head 2" text:level="2" >Creating a Chart Document</text:h><text:h text:style-name="Head 2" text:level="2" >Editing a Chart Document</text:h><text:h text:style-name="Head 3" text:level="3" >Common Diagram API</text:h><text:h text:style-name="Head 3" text:level="3" >Different Chart Types</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Chart Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Basic and Dialogs</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:h text:style-name="Head 2" text:level="2" >Library Organization</text:h><text:h text:style-name="Head 2" text:level="2" >IDE with Dialogs and Events</text:h><text:h text:style-name="Head 2" text:level="2" >Using [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 2" text:level="2" >Toolkit Controls and their Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating Dialogs at Runtime</text:h><text:h text:style-name="Head 1" text:level="1" >Database Access</text:h><text:h text:style-name="Head 2" text:level="2" >Features of the [PRODUCTNAME] Database Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Capabilities</text:h><text:h text:style-name="Head 3" text:level="3" >SDBC, SDBCX, SDB Architecture</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Datasources with [PRODUCTNAME]</text:h><text:h text:style-name="Head 3" text:level="3" >DataSources</text:h><text:h text:style-name="Head 3" text:level="3" >Adding and Editing Datasources </text:h><text:h text:style-name="Head 3" text:level="3" >Establishing a Connection</text:h><text:h text:style-name="Head 4" text:level="4" >Getting Connections</text:h><text:h text:style-name="Head 4" text:level="4" >Driver specifics</text:h><text:h text:style-name="Head 3" text:level="3" >Connection Pooling</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Saved Queries</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Data</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Statements</text:h><text:h text:style-name="Head 3" text:level="3" >Resultsets</text:h><text:h text:style-name="Head 3" text:level="3" >Metadata</text:h><text:h text:style-name="Head 3" text:level="3" >Rowsets</text:h><text:h text:style-name="Head 2" text:level="2" >Working with the Database Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using DDL to change the DB Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using SDBCX to access the DB Design</text:h><text:h text:style-name="Head 2" text:level="2" >Using DBMS Features</text:h><text:h text:style-name="Head 3" text:level="3" >Stored Procedures</text:h><text:h text:style-name="Head 3" text:level="3" >Transaction Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Prepared Statements</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Database Drivers</text:h><text:h text:style-name="Head 1" text:level="1" >Forms</text:h><text:h text:style-name="Head 2" text:level="2" >Concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Models and Views</text:h><text:h text:style-name="Head 3" text:level="3" >Form Elements in the Document Model</text:h><text:h text:style-name="Head 3" text:level="3" >Special Form Components</text:h><text:h text:style-name="Head 3" text:level="3" >Events</text:h><text:h text:style-name="Head 3" text:level="3" >Data Awareness</text:h><text:h text:style-name="Head 2" text:level="2" >Recipes</text:h><text:h text:style-name="Head 3" text:level="3" >Making it easier to work with a Form</text:h><text:h text:style-name="Head 3" text:level="3" >Controlling the Data Input</text:h><text:h text:style-name="Head 3" text:level="3" >Collecting Data automatically</text:h><text:h text:style-name="Head 3" text:level="3" >Taking Advantage of Database Server Features</text:h><text:h text:style-name="Head 3" text:level="3" >Adding new Functionality</text:h><text:h text:style-name="Head 3" text:level="3" >Handling Errors</text:h><text:h text:style-name="Head 1" text:level="1" >UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Purpose of UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Document Contents as Streams</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Content Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating, Moving and Copying Document and Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Additional Commands</text:h><text:h text:style-name="Head 2" text:level="2" >Writing a Content Provider</text:h><text:h text:style-name="Head 1" text:level="1" >[PRODUCTNAME] Configuration</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing configuration data</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Configuration Data</text:h><text:h text:style-name="Head 1" text:level="1" >Appendix</text:h></office:body> + +<office:body ><text:sequence-decls ><text:sequence-decl text:display-outline-level="0" text:name="Illustration" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Table" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Text" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Drawing" ></text:sequence-decl></text:sequence-decls><text:p text:style-name="P1" >Programmer's Manual</text:p><text:p text:style-name="P2" >Planned Outline</text:p><text:p text:style-name="P2" ></text:p><text:h text:style-name="Head 1" text:level="1" >Preface (3 Pages)</text:h><text:h text:style-name="Head 1" text:level="1" >First Steps (24 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Programming with UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Fields of Application for UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Getting Started</text:h><text:h text:style-name="Head 3" text:level="3" >Required Files</text:h><text:h text:style-name="Head 3" text:level="3" >Configuration</text:h><text:h text:style-name="Head 3" text:level="3" >First Connection</text:h><text:h text:style-name="Head 2" text:level="2" >How to get Objects in [PRODUCTNAME]</text:h><text:h text:style-name="Head 2" text:level="2" >How to work with Objects</text:h><text:p text:style-name="Paragraph" >Example</text:p><text:h text:style-name="Head 3" text:level="3" >Services</text:h><text:h text:style-name="Head 3" text:level="3" >Querying Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >ElementAccess</text:h><text:h text:style-name="Head 3" text:level="3" >Simple Types</text:h><text:h text:style-name="Head 3" text:level="3" >Strings</text:h><text:h text:style-name="Head 3" text:level="3" >Enums and Constant Groups</text:h><text:h text:style-name="Head 3" text:level="3" >Structs</text:h><text:h text:style-name="Head 3" text:level="3" >Any</text:h><text:h text:style-name="Head 3" text:level="3" >Sequence</text:h><text:h text:style-name="Head 2" text:level="2" >How to find the solution for a problem</text:h><text:h text:style-name="Head 2" text:level="2" >Finding your Way through the API Reference</text:h><text:h text:style-name="Head 2" text:level="2" >Common Mechanisms</text:h><text:h text:style-name="Head 3" text:level="3" >Text</text:h><text:h text:style-name="Head 3" text:level="3" >Table</text:h><text:h text:style-name="Head 3" text:level="3" >Drawing</text:h><text:h text:style-name="Head 1" text:level="1" >UNO in Professional Projects (<text:span text:style-name="T1" >145</text:span>)</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:p text:style-name="Paragraph" >UNO/API constituents: How UNOIDL/API, ServiceManager, Bridges, CoreReflection work together</text:p><text:h text:style-name="Head 2" text:level="2" >API Concepts</text:h><text:p text:style-name="Paragraph" >API is a language independent, abstract specification for UNO objects which are used in <text:s ></text:s>[PRODUCTNAME]</text:p><text:h text:style-name="Head 3" text:level="3" >Types in the API Reference</text:h><text:h text:style-name="Head 4" text:level="4" >Simple Types</text:h><text:h text:style-name="Head 4" text:level="4" >The Any Type</text:h><text:h text:style-name="Head 4" text:level="4" >Interfaces</text:h><text:h text:style-name="Head 4" text:level="4" >Services</text:h><text:h text:style-name="Head 4" text:level="4" >Modules</text:h><text:h text:style-name="Head 4" text:level="4" >Structs</text:h><text:h text:style-name="Head 4" text:level="4" >Constant Groups and Enums</text:h><text:h text:style-name="Head 4" text:level="4" >Sequences</text:h><text:h text:style-name="Head 4" text:level="4" >Exceptions</text:h><text:h text:style-name="Head 3" text:level="3" >API Principles</text:h><text:h text:style-name="Head 4" text:level="4" >Relationship between Specification, Implementation and Instances</text:h><text:h text:style-name="Head 4" text:level="4" >Object Composition</text:h><text:h text:style-name="Head 2" text:level="2" >UNO Concepts</text:h><text:p text:style-name="Paragraph" >UNO is an environment for networked object communication</text:p><text:h text:style-name="Head 3" text:level="3" >Interprocess Connections</text:h><text:h text:style-name="Head 3" text:level="3" >ServiceManager and ComponentContext</text:h><text:h text:style-name="Head 3" text:level="3" >Using UNO Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >Using Collections and Containers</text:h><text:h text:style-name="Head 3" text:level="3" >Event Model</text:h><text:h text:style-name="Head 3" text:level="3" >Exception Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Lifetime Control</text:h><text:h text:style-name="Head 3" text:level="3" >Object Identity</text:h><text:h text:style-name="Head 2" text:level="2" >Language Bindings</text:h><text:h text:style-name="Head 3" text:level="3" >Introduction for language binding</text:h><text:h text:style-name="Head 3" text:level="3" >Java Language Binding</text:h><text:h text:style-name="Head 3" text:level="3" >C++ Binding</text:h><text:h text:style-name="Head 3" text:level="3" >Access for [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 3" text:level="3" >Automation</text:h><text:h text:style-name="Head 1" text:level="1" >Writing UNO components</text:h><text:h text:style-name="Head 2" text:level="2" >Specifying a new Component</text:h><text:h text:style-name="Head 3" text:level="3" >UNOIDL language specification</text:h><text:h text:style-name="Head 2" text:level="2" >Implementing a Component</text:h><text:h text:style-name="Head 3" text:level="3" >Component Development Basics</text:h><text:unordered-list text:style-name="L1" ><text:list-item ><text:p text:style-name="P3" >Introduction</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >Mandatory interfaces: XInterface, XServiceInfo ((from UseInterfaces.CoreInterfaces))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >"Should be implemented" interfaces: XTypeProvider ((from UseInterfaces.CoreInterfaces ))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >optional interface: XMain for standalone execution</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Simple Component in Java</text:h><text:unordered-list text:style-name="L2" ><text:list-item ><text:p text:style-name="P4" >Getting the service manager ((Chapter Java components from unoBindingJava))</text:p></text:list-item><text:list-item ><text:p text:style-name="P4" >simple component chapter</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >C++ Component</text:h><text:h text:style-name="Head 3" text:level="3" >((Automation Component?))</text:h><text:h text:style-name="Head 2" text:level="2" >Deployment Options for Components</text:h><text:h text:style-name="Head 3" text:level="3" >Component Registration</text:h><text:h text:style-name="Head 3" text:level="3" >Service Manager Configuration</text:h><text:unordered-list text:style-name="L3" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P5" >XSet Interface</text:p><text:p text:style-name="P5" >Adding components during runtime, particularly interesting during development</text:p></text:list-item><text:list-item ><text:p text:style-name="P5" >ServiceManager Content</text:p><text:p text:style-name="P5" >Dynamically modifying the ServiceManager</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Bootstrapping the Service Manager ((from CppBind chapter))</text:h><text:unordered-list text:style-name="L4" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P6" >Simple Test Application</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >Configuring Your Application with Bootstrap Parameters</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >The UNO Executable</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Standalone Runtime Environment</text:h><text:p text:style-name="Paragraph" ><text:tab-stop ></text:tab-stop>The UNO executable and XMain</text:p><text:h text:style-name="Head 3" text:level="3" >Configuring the Java Runtime Environment</text:h><text:unordered-list text:style-name="L5" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P7" >The office and Java ((from UnoBindingJava))</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 1" text:level="1" >Advanced UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Design Patterns</text:h><text:h text:style-name="Head 2" text:level="2" >Bridging concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Requirements for Language Bindings and Bridges</text:h><text:h text:style-name="Head 3" text:level="3" >New Scripting Engines</text:h><text:h text:style-name="Head 2" text:level="2" >ServiceManager and loader</text:h><text:h text:style-name="Head 2" text:level="2" >Special Interfaces for internal use</text:h><text:p text:style-name="Paragraph" >XUNOTunnel</text:p><text:p text:style-name="Paragraph" >XAggregation</text:p><text:h text:style-name="Head 2" text:level="2" >UNO Reflection API</text:h><text:h text:style-name="Head 2" text:level="2" >TypeLibrary and TypeProviders</text:h><text:h text:style-name="Head 2" text:level="2" >Differences from Corba</text:h><text:h text:style-name="Head 1" text:level="1" >Office Development</text:h><text:h text:style-name="Head 2" text:level="2" >Global Object Structure</text:h><text:h text:style-name="Head 3" text:level="3" >Desktop Environment</text:h><text:h text:style-name="Head 3" text:level="3" >Frames and Frame Hierarchies</text:h><text:h text:style-name="Head 3" text:level="3" >Frame-Controller-Model Paradigm</text:h><text:h text:style-name="Head 3" text:level="3" >Loading and Saving Office Components</text:h><text:h text:style-name="Head 3" text:level="3" >Dispatch Framework</text:h><text:h text:style-name="Head 2" text:level="2" >Common Features</text:h><text:h text:style-name="Head 3" text:level="3" >Common Dialogs</text:h><text:h text:style-name="Head 3" text:level="3" >DocumentInfo</text:h><text:h text:style-name="Head 3" text:level="3" >Styles</text:h><text:h text:style-name="Head 3" text:level="3" >Search and Replace</text:h><text:h text:style-name="Head 3" text:level="3" >Number Formats</text:h><text:h text:style-name="Head 3" text:level="3" >Package File Formats</text:h><text:h text:style-name="Head 2" text:level="2" >Internationalization</text:h><text:h text:style-name="Head 2" text:level="2" >Linguistic</text:h><text:h text:style-name="Head 2" text:level="2" >System Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Clipboard</text:h><text:h text:style-name="Head 3" text:level="3" >File Picker</text:h><text:h text:style-name="Head 3" text:level="3" >Bridging to the Window System</text:h><text:p text:style-name="Paragraph" ></text:p><text:h text:style-name="Head 1" text:level="1" >Text Documents (51,5 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Text Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Text Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Using Text</text:h><text:h text:style-name="Head 3" text:level="3" >Tables</text:h><text:h text:style-name="Head 3" text:level="3" >Text Fields</text:h><text:h text:style-name="Head 3" text:level="3" >Bookmarks</text:h><text:h text:style-name="Head 3" text:level="3" >Indexes and Index Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Reference Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Footnotes and Endnotes</text:h><text:h text:style-name="Head 3" text:level="3" >Shape Objects in Text</text:h><text:h text:style-name="Head 3" text:level="3" >Redline</text:h><text:h text:style-name="Head 3" text:level="3" >Ruby</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Text Document</text:h><text:h text:style-name="Head 1" text:level="1" >Spreadsheet Documents</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Spreadsheet Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Spreadsheet Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Editing Spreadsheets</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Spreadsheet Document</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Spreadsheet Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Drawings and Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Draw/Impress Files</text:h><text:h text:style-name="Head 3" text:level="3" >Saving</text:h><text:h text:style-name="Head 3" text:level="3" >Printing</text:h><text:h text:style-name="Head 3" text:level="3" >Running Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Working with a Draw/Impress Document</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Draw/Impress Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Draw/Impress Document</text:h><text:h text:style-name="Head 1" text:level="1" >Charts</text:h><text:h text:style-name="Head 2" text:level="2" >Chart Basics</text:h><text:h text:style-name="Head 2" text:level="2" >Creating a Chart Document</text:h><text:h text:style-name="Head 2" text:level="2" >Editing a Chart Document</text:h><text:h text:style-name="Head 3" text:level="3" >Common Diagram API</text:h><text:h text:style-name="Head 3" text:level="3" >Different Chart Types</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Chart Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Basic and Dialogs</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:h text:style-name="Head 2" text:level="2" >Library Organization</text:h><text:h text:style-name="Head 2" text:level="2" >IDE with Dialogs and Events</text:h><text:h text:style-name="Head 2" text:level="2" >Using [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 2" text:level="2" >Toolkit Controls and their Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating Dialogs at Runtime</text:h><text:h text:style-name="Head 1" text:level="1" >Database Access</text:h><text:h text:style-name="Head 2" text:level="2" >Features of the [PRODUCTNAME] Database Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Capabilities</text:h><text:h text:style-name="Head 3" text:level="3" >SDBC, SDBCX, SDB Architecture</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Datasources with [PRODUCTNAME]</text:h><text:h text:style-name="Head 3" text:level="3" >DataSources</text:h><text:h text:style-name="Head 3" text:level="3" >Adding and Editing Datasources </text:h><text:h text:style-name="Head 3" text:level="3" >Establishing a Connection</text:h><text:h text:style-name="Head 4" text:level="4" >Getting Connections</text:h><text:h text:style-name="Head 4" text:level="4" >Driver specifics</text:h><text:h text:style-name="Head 3" text:level="3" >Connection Pooling</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Saved Queries</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Data</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Statements</text:h><text:h text:style-name="Head 3" text:level="3" >Resultsets</text:h><text:h text:style-name="Head 3" text:level="3" >Metadata</text:h><text:h text:style-name="Head 3" text:level="3" >Rowsets</text:h><text:h text:style-name="Head 2" text:level="2" >Working with the Database Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using DDL to change the DB Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using SDBCX to access the DB Design</text:h><text:h text:style-name="Head 2" text:level="2" >Using DBMS Features</text:h><text:h text:style-name="Head 3" text:level="3" >Stored Procedures</text:h><text:h text:style-name="Head 3" text:level="3" >Transaction Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Prepared Statements</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Database Drivers</text:h><text:h text:style-name="Head 1" text:level="1" >Forms</text:h><text:h text:style-name="Head 2" text:level="2" >Concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Models and Views</text:h><text:h text:style-name="Head 3" text:level="3" >Form Elements in the Document Model</text:h><text:h text:style-name="Head 3" text:level="3" >Special Form Components</text:h><text:h text:style-name="Head 3" text:level="3" >Events</text:h><text:h text:style-name="Head 3" text:level="3" >Data Awareness</text:h><text:h text:style-name="Head 2" text:level="2" >Recipes</text:h><text:h text:style-name="Head 3" text:level="3" >Making it easier to work with a Form</text:h><text:h text:style-name="Head 3" text:level="3" >Controlling the Data Input</text:h><text:h text:style-name="Head 3" text:level="3" >Collecting Data automatically</text:h><text:h text:style-name="Head 3" text:level="3" >Taking Advantage of Database Server Features</text:h><text:h text:style-name="Head 3" text:level="3" >Adding new Functionality</text:h><text:h text:style-name="Head 3" text:level="3" >Handling Errors</text:h><text:h text:style-name="Head 1" text:level="1" >UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Purpose of UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Document Contents as Streams</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Content Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating, Moving and Copying Document and Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Additional Commands</text:h><text:h text:style-name="Head 2" text:level="2" >Writing a Content Provider</text:h><text:h text:style-name="Head 1" text:level="1" >[PRODUCTNAME] Configuration</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing configuration data</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Configuration Data</text:h><text:h text:style-name="Head 1" text:level="1" >Appendix</text:h></office:body> + +<office:body ><text:sequence-decls ><text:sequence-decl text:display-outline-level="0" text:name="Illustration" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Table" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Text" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Drawing" ></text:sequence-decl></text:sequence-decls><text:p text:style-name="P1" >Programmer's Manual</text:p><text:p text:style-name="P2" >Planned Outline</text:p><text:p text:style-name="P2" ></text:p><text:h text:style-name="Head 1" text:level="1" >Preface (3 Pages)</text:h><text:h text:style-name="Head 1" text:level="1" >First Steps (24 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Programming with UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Fields of Application for UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Getting Started</text:h><text:h text:style-name="Head 3" text:level="3" >Required Files</text:h><text:h text:style-name="Head 3" text:level="3" >Configuration</text:h><text:h text:style-name="Head 3" text:level="3" >First Connection</text:h><text:h text:style-name="Head 2" text:level="2" >How to get Objects in [PRODUCTNAME]</text:h><text:h text:style-name="Head 2" text:level="2" >How to work with Objects</text:h><text:p text:style-name="Paragraph" >Example</text:p><text:h text:style-name="Head 3" text:level="3" >Services</text:h><text:h text:style-name="Head 3" text:level="3" >Querying Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >ElementAccess</text:h><text:h text:style-name="Head 3" text:level="3" >Simple Types</text:h><text:h text:style-name="Head 3" text:level="3" >Strings</text:h><text:h text:style-name="Head 3" text:level="3" >Enums and Constant Groups</text:h><text:h text:style-name="Head 3" text:level="3" >Structs</text:h><text:h text:style-name="Head 3" text:level="3" >Any</text:h><text:h text:style-name="Head 3" text:level="3" >Sequence</text:h><text:h text:style-name="Head 2" text:level="2" >How to find the solution for a problem</text:h><text:h text:style-name="Head 2" text:level="2" >Finding your Way through the API Reference</text:h><text:h text:style-name="Head 2" text:level="2" >Common Mechanisms</text:h><text:h text:style-name="Head 3" text:level="3" >Text</text:h><text:h text:style-name="Head 3" text:level="3" >Table</text:h><text:h text:style-name="Head 3" text:level="3" >Drawing</text:h><text:h text:style-name="Head 1" text:level="1" >UNO in Professional Projects (<text:span text:style-name="T1" >145</text:span>)</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:p text:style-name="Paragraph" >UNO/API constituents: How UNOIDL/API, ServiceManager, Bridges, CoreReflection work together</text:p><text:h text:style-name="Head 2" text:level="2" >API Concepts</text:h><text:p text:style-name="Paragraph" >API is a language independent, abstract specification for UNO objects which are used in <text:s ></text:s>[PRODUCTNAME]</text:p><text:h text:style-name="Head 3" text:level="3" >Types in the API Reference</text:h><text:h text:style-name="Head 4" text:level="4" >Simple Types</text:h><text:h text:style-name="Head 4" text:level="4" >The Any Type</text:h><text:h text:style-name="Head 4" text:level="4" >Interfaces</text:h><text:h text:style-name="Head 4" text:level="4" >Services</text:h><text:h text:style-name="Head 4" text:level="4" >Modules</text:h><text:h text:style-name="Head 4" text:level="4" >Structs</text:h><text:h text:style-name="Head 4" text:level="4" >Constant Groups and Enums</text:h><text:h text:style-name="Head 4" text:level="4" >Sequences</text:h><text:h text:style-name="Head 4" text:level="4" >Exceptions</text:h><text:h text:style-name="Head 3" text:level="3" >API Principles</text:h><text:h text:style-name="Head 4" text:level="4" >Relationship between Specification, Implementation and Instances</text:h><text:h text:style-name="Head 4" text:level="4" >Object Composition</text:h><text:h text:style-name="Head 2" text:level="2" >UNO Concepts</text:h><text:p text:style-name="Paragraph" >UNO is an environment for networked object communication</text:p><text:h text:style-name="Head 3" text:level="3" >Interprocess Connections</text:h><text:h text:style-name="Head 3" text:level="3" >ServiceManager and ComponentContext</text:h><text:h text:style-name="Head 3" text:level="3" >Using UNO Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >Using Collections and Containers</text:h><text:h text:style-name="Head 3" text:level="3" >Event Model</text:h><text:h text:style-name="Head 3" text:level="3" >Exception Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Lifetime Control</text:h><text:h text:style-name="Head 3" text:level="3" >Object Identity</text:h><text:h text:style-name="Head 2" text:level="2" >Language Bindings</text:h><text:h text:style-name="Head 3" text:level="3" >Introduction for language binding</text:h><text:h text:style-name="Head 3" text:level="3" >Java Language Binding</text:h><text:h text:style-name="Head 3" text:level="3" >C++ Binding</text:h><text:h text:style-name="Head 3" text:level="3" >Access for [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 3" text:level="3" >Automation</text:h><text:h text:style-name="Head 1" text:level="1" >Writing UNO components</text:h><text:h text:style-name="Head 2" text:level="2" >Specifying a new Component</text:h><text:h text:style-name="Head 3" text:level="3" >UNOIDL language specification</text:h><text:h text:style-name="Head 2" text:level="2" >Implementing a Component</text:h><text:h text:style-name="Head 3" text:level="3" >Component Development Basics</text:h><text:unordered-list text:style-name="L1" ><text:list-item ><text:p text:style-name="P3" >Introduction</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >Mandatory interfaces: XInterface, XServiceInfo ((from UseInterfaces.CoreInterfaces))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >"Should be implemented" interfaces: XTypeProvider ((from UseInterfaces.CoreInterfaces ))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >optional interface: XMain for standalone execution</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Simple Component in Java</text:h><text:unordered-list text:style-name="L2" ><text:list-item ><text:p text:style-name="P4" >Getting the service manager ((Chapter Java components from unoBindingJava))</text:p></text:list-item><text:list-item ><text:p text:style-name="P4" >simple component chapter</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >C++ Component</text:h><text:h text:style-name="Head 3" text:level="3" >((Automation Component?))</text:h><text:h text:style-name="Head 2" text:level="2" >Deployment Options for Components</text:h><text:h text:style-name="Head 3" text:level="3" >Component Registration</text:h><text:h text:style-name="Head 3" text:level="3" >Service Manager Configuration</text:h><text:unordered-list text:style-name="L3" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P5" >XSet Interface</text:p><text:p text:style-name="P5" >Adding components during runtime, particularly interesting during development</text:p></text:list-item><text:list-item ><text:p text:style-name="P5" >ServiceManager Content</text:p><text:p text:style-name="P5" >Dynamically modifying the ServiceManager</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Bootstrapping the Service Manager ((from CppBind chapter))</text:h><text:unordered-list text:style-name="L4" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P6" >Simple Test Application</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >Configuring Your Application with Bootstrap Parameters</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >The UNO Executable</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Standalone Runtime Environment</text:h><text:p text:style-name="Paragraph" ><text:tab-stop ></text:tab-stop>The UNO executable and XMain</text:p><text:h text:style-name="Head 3" text:level="3" >Configuring the Java Runtime Environment</text:h><text:unordered-list text:style-name="L5" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P7" >The office and Java ((from UnoBindingJava))</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 1" text:level="1" >Advanced UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Design Patterns</text:h><text:h text:style-name="Head 2" text:level="2" >Bridging concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Requirements for Language Bindings and Bridges</text:h><text:h text:style-name="Head 3" text:level="3" >New Scripting Engines</text:h><text:h text:style-name="Head 2" text:level="2" >ServiceManager and loader</text:h><text:h text:style-name="Head 2" text:level="2" >Special Interfaces for internal use</text:h><text:p text:style-name="Paragraph" >XUNOTunnel</text:p><text:p text:style-name="Paragraph" >XAggregation</text:p><text:h text:style-name="Head 2" text:level="2" >UNO Reflection API</text:h><text:h text:style-name="Head 2" text:level="2" >TypeLibrary and TypeProviders</text:h><text:h text:style-name="Head 2" text:level="2" >Differences from Corba</text:h><text:h text:style-name="Head 1" text:level="1" >Office Development</text:h><text:h text:style-name="Head 2" text:level="2" >Global Object Structure</text:h><text:h text:style-name="Head 3" text:level="3" >Desktop Environment</text:h><text:h text:style-name="Head 3" text:level="3" >Frames and Frame Hierarchies</text:h><text:h text:style-name="Head 3" text:level="3" >Frame-Controller-Model Paradigm</text:h><text:h text:style-name="Head 3" text:level="3" >Loading and Saving Office Components</text:h><text:h text:style-name="Head 3" text:level="3" >Dispatch Framework</text:h><text:h text:style-name="Head 2" text:level="2" >Common Features</text:h><text:h text:style-name="Head 3" text:level="3" >Common Dialogs</text:h><text:h text:style-name="Head 3" text:level="3" >DocumentInfo</text:h><text:h text:style-name="Head 3" text:level="3" >Styles</text:h><text:h text:style-name="Head 3" text:level="3" >Search and Replace</text:h><text:h text:style-name="Head 3" text:level="3" >Number Formats</text:h><text:h text:style-name="Head 3" text:level="3" >Package File Formats</text:h><text:h text:style-name="Head 2" text:level="2" >Internationalization</text:h><text:h text:style-name="Head 2" text:level="2" >Linguistic</text:h><text:h text:style-name="Head 2" text:level="2" >System Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Clipboard</text:h><text:h text:style-name="Head 3" text:level="3" >File Picker</text:h><text:h text:style-name="Head 3" text:level="3" >Bridging to the Window System</text:h><text:p text:style-name="Paragraph" ></text:p><text:h text:style-name="Head 1" text:level="1" >Text Documents (51,5 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Text Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Text Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Using Text</text:h><text:h text:style-name="Head 3" text:level="3" >Tables</text:h><text:h text:style-name="Head 3" text:level="3" >Text Fields</text:h><text:h text:style-name="Head 3" text:level="3" >Bookmarks</text:h><text:h text:style-name="Head 3" text:level="3" >Indexes and Index Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Reference Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Footnotes and Endnotes</text:h><text:h text:style-name="Head 3" text:level="3" >Shape Objects in Text</text:h><text:h text:style-name="Head 3" text:level="3" >Redline</text:h><text:h text:style-name="Head 3" text:level="3" >Ruby</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Text Document</text:h><text:h text:style-name="Head 1" text:level="1" >Spreadsheet Documents</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Spreadsheet Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Spreadsheet Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Editing Spreadsheets</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Spreadsheet Document</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Spreadsheet Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Drawings and Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Draw/Impress Files</text:h><text:h text:style-name="Head 3" text:level="3" >Saving</text:h><text:h text:style-name="Head 3" text:level="3" >Printing</text:h><text:h text:style-name="Head 3" text:level="3" >Running Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Working with a Draw/Impress Document</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Draw/Impress Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Draw/Impress Document</text:h><text:h text:style-name="Head 1" text:level="1" >Charts</text:h><text:h text:style-name="Head 2" text:level="2" >Chart Basics</text:h><text:h text:style-name="Head 2" text:level="2" >Creating a Chart Document</text:h><text:h text:style-name="Head 2" text:level="2" >Editing a Chart Document</text:h><text:h text:style-name="Head 3" text:level="3" >Common Diagram API</text:h><text:h text:style-name="Head 3" text:level="3" >Different Chart Types</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Chart Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Basic and Dialogs</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:h text:style-name="Head 2" text:level="2" >Library Organization</text:h><text:h text:style-name="Head 2" text:level="2" >IDE with Dialogs and Events</text:h><text:h text:style-name="Head 2" text:level="2" >Using [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 2" text:level="2" >Toolkit Controls and their Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating Dialogs at Runtime</text:h><text:h text:style-name="Head 1" text:level="1" >Database Access</text:h><text:h text:style-name="Head 2" text:level="2" >Features of the [PRODUCTNAME] Database Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Capabilities</text:h><text:h text:style-name="Head 3" text:level="3" >SDBC, SDBCX, SDB Architecture</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Datasources with [PRODUCTNAME]</text:h><text:h text:style-name="Head 3" text:level="3" >DataSources</text:h><text:h text:style-name="Head 3" text:level="3" >Adding and Editing Datasources </text:h><text:h text:style-name="Head 3" text:level="3" >Establishing a Connection</text:h><text:h text:style-name="Head 4" text:level="4" >Getting Connections</text:h><text:h text:style-name="Head 4" text:level="4" >Driver specifics</text:h><text:h text:style-name="Head 3" text:level="3" >Connection Pooling</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Saved Queries</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Data</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Statements</text:h><text:h text:style-name="Head 3" text:level="3" >Resultsets</text:h><text:h text:style-name="Head 3" text:level="3" >Metadata</text:h><text:h text:style-name="Head 3" text:level="3" >Rowsets</text:h><text:h text:style-name="Head 2" text:level="2" >Working with the Database Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using DDL to change the DB Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using SDBCX to access the DB Design</text:h><text:h text:style-name="Head 2" text:level="2" >Using DBMS Features</text:h><text:h text:style-name="Head 3" text:level="3" >Stored Procedures</text:h><text:h text:style-name="Head 3" text:level="3" >Transaction Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Prepared Statements</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Database Drivers</text:h><text:h text:style-name="Head 1" text:level="1" >Forms</text:h><text:h text:style-name="Head 2" text:level="2" >Concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Models and Views</text:h><text:h text:style-name="Head 3" text:level="3" >Form Elements in the Document Model</text:h><text:h text:style-name="Head 3" text:level="3" >Special Form Components</text:h><text:h text:style-name="Head 3" text:level="3" >Events</text:h><text:h text:style-name="Head 3" text:level="3" >Data Awareness</text:h><text:h text:style-name="Head 2" text:level="2" >Recipes</text:h><text:h text:style-name="Head 3" text:level="3" >Making it easier to work with a Form</text:h><text:h text:style-name="Head 3" text:level="3" >Controlling the Data Input</text:h><text:h text:style-name="Head 3" text:level="3" >Collecting Data automatically</text:h><text:h text:style-name="Head 3" text:level="3" >Taking Advantage of Database Server Features</text:h><text:h text:style-name="Head 3" text:level="3" >Adding new Functionality</text:h><text:h text:style-name="Head 3" text:level="3" >Handling Errors</text:h><text:h text:style-name="Head 1" text:level="1" >UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Purpose of UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Document Contents as Streams</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Content Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating, Moving and Copying Document and Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Additional Commands</text:h><text:h text:style-name="Head 2" text:level="2" >Writing a Content Provider</text:h><text:h text:style-name="Head 1" text:level="1" >[PRODUCTNAME] Configuration</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing configuration data</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Configuration Data</text:h><text:h text:style-name="Head 1" text:level="1" >Appendix</text:h></office:body> + +<office:body ><text:sequence-decls ><text:sequence-decl text:display-outline-level="0" text:name="Illustration" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Table" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Text" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Drawing" ></text:sequence-decl></text:sequence-decls><text:p text:style-name="P1" >Programmer's Manual</text:p><text:p text:style-name="P2" >Planned Outline</text:p><text:p text:style-name="P2" ></text:p><text:h text:style-name="Head 1" text:level="1" >Preface (3 Pages)</text:h><text:h text:style-name="Head 1" text:level="1" >First Steps (24 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Programming with UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Fields of Application for UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Getting Started</text:h><text:h text:style-name="Head 3" text:level="3" >Required Files</text:h><text:h text:style-name="Head 3" text:level="3" >Configuration</text:h><text:h text:style-name="Head 3" text:level="3" >First Connection</text:h><text:h text:style-name="Head 2" text:level="2" >How to get Objects in [PRODUCTNAME]</text:h><text:h text:style-name="Head 2" text:level="2" >How to work with Objects</text:h><text:p text:style-name="Paragraph" >Example</text:p><text:h text:style-name="Head 3" text:level="3" >Services</text:h><text:h text:style-name="Head 3" text:level="3" >Querying Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >ElementAccess</text:h><text:h text:style-name="Head 3" text:level="3" >Simple Types</text:h><text:h text:style-name="Head 3" text:level="3" >Strings</text:h><text:h text:style-name="Head 3" text:level="3" >Enums and Constant Groups</text:h><text:h text:style-name="Head 3" text:level="3" >Structs</text:h><text:h text:style-name="Head 3" text:level="3" >Any</text:h><text:h text:style-name="Head 3" text:level="3" >Sequence</text:h><text:h text:style-name="Head 2" text:level="2" >How to find the solution for a problem</text:h><text:h text:style-name="Head 2" text:level="2" >Finding your Way through the API Reference</text:h><text:h text:style-name="Head 2" text:level="2" >Common Mechanisms</text:h><text:h text:style-name="Head 3" text:level="3" >Text</text:h><text:h text:style-name="Head 3" text:level="3" >Table</text:h><text:h text:style-name="Head 3" text:level="3" >Drawing</text:h><text:h text:style-name="Head 1" text:level="1" >UNO in Professional Projects (<text:span text:style-name="T1" >145</text:span>)</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:p text:style-name="Paragraph" >UNO/API constituents: How UNOIDL/API, ServiceManager, Bridges, CoreReflection work together</text:p><text:h text:style-name="Head 2" text:level="2" >API Concepts</text:h><text:p text:style-name="Paragraph" >API is a language independent, abstract specification for UNO objects which are used in <text:s ></text:s>[PRODUCTNAME]</text:p><text:h text:style-name="Head 3" text:level="3" >Types in the API Reference</text:h><text:h text:style-name="Head 4" text:level="4" >Simple Types</text:h><text:h text:style-name="Head 4" text:level="4" >The Any Type</text:h><text:h text:style-name="Head 4" text:level="4" >Interfaces</text:h><text:h text:style-name="Head 4" text:level="4" >Services</text:h><text:h text:style-name="Head 4" text:level="4" >Modules</text:h><text:h text:style-name="Head 4" text:level="4" >Structs</text:h><text:h text:style-name="Head 4" text:level="4" >Constant Groups and Enums</text:h><text:h text:style-name="Head 4" text:level="4" >Sequences</text:h><text:h text:style-name="Head 4" text:level="4" >Exceptions</text:h><text:h text:style-name="Head 3" text:level="3" >API Principles</text:h><text:h text:style-name="Head 4" text:level="4" >Relationship between Specification, Implementation and Instances</text:h><text:h text:style-name="Head 4" text:level="4" >Object Composition</text:h><text:h text:style-name="Head 2" text:level="2" >UNO Concepts</text:h><text:p text:style-name="Paragraph" >UNO is an environment for networked object communication</text:p><text:h text:style-name="Head 3" text:level="3" >Interprocess Connections</text:h><text:h text:style-name="Head 3" text:level="3" >ServiceManager and ComponentContext</text:h><text:h text:style-name="Head 3" text:level="3" >Using UNO Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >Using Collections and Containers</text:h><text:h text:style-name="Head 3" text:level="3" >Event Model</text:h><text:h text:style-name="Head 3" text:level="3" >Exception Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Lifetime Control</text:h><text:h text:style-name="Head 3" text:level="3" >Object Identity</text:h><text:h text:style-name="Head 2" text:level="2" >Language Bindings</text:h><text:h text:style-name="Head 3" text:level="3" >Introduction for language binding</text:h><text:h text:style-name="Head 3" text:level="3" >Java Language Binding</text:h><text:h text:style-name="Head 3" text:level="3" >C++ Binding</text:h><text:h text:style-name="Head 3" text:level="3" >Access for [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 3" text:level="3" >Automation</text:h><text:h text:style-name="Head 1" text:level="1" >Writing UNO components</text:h><text:h text:style-name="Head 2" text:level="2" >Specifying a new Component</text:h><text:h text:style-name="Head 3" text:level="3" >UNOIDL language specification</text:h><text:h text:style-name="Head 2" text:level="2" >Implementing a Component</text:h><text:h text:style-name="Head 3" text:level="3" >Component Development Basics</text:h><text:unordered-list text:style-name="L1" ><text:list-item ><text:p text:style-name="P3" >Introduction</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >Mandatory interfaces: XInterface, XServiceInfo ((from UseInterfaces.CoreInterfaces))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >"Should be implemented" interfaces: XTypeProvider ((from UseInterfaces.CoreInterfaces ))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >optional interface: XMain for standalone execution</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Simple Component in Java</text:h><text:unordered-list text:style-name="L2" ><text:list-item ><text:p text:style-name="P4" >Getting the service manager ((Chapter Java components from unoBindingJava))</text:p></text:list-item><text:list-item ><text:p text:style-name="P4" >simple component chapter</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >C++ Component</text:h><text:h text:style-name="Head 3" text:level="3" >((Automation Component?))</text:h><text:h text:style-name="Head 2" text:level="2" >Deployment Options for Components</text:h><text:h text:style-name="Head 3" text:level="3" >Component Registration</text:h><text:h text:style-name="Head 3" text:level="3" >Service Manager Configuration</text:h><text:unordered-list text:style-name="L3" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P5" >XSet Interface</text:p><text:p text:style-name="P5" >Adding components during runtime, particularly interesting during development</text:p></text:list-item><text:list-item ><text:p text:style-name="P5" >ServiceManager Content</text:p><text:p text:style-name="P5" >Dynamically modifying the ServiceManager</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Bootstrapping the Service Manager ((from CppBind chapter))</text:h><text:unordered-list text:style-name="L4" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P6" >Simple Test Application</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >Configuring Your Application with Bootstrap Parameters</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >The UNO Executable</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Standalone Runtime Environment</text:h><text:p text:style-name="Paragraph" ><text:tab-stop ></text:tab-stop>The UNO executable and XMain</text:p><text:h text:style-name="Head 3" text:level="3" >Configuring the Java Runtime Environment</text:h><text:unordered-list text:style-name="L5" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P7" >The office and Java ((from UnoBindingJava))</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 1" text:level="1" >Advanced UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Design Patterns</text:h><text:h text:style-name="Head 2" text:level="2" >Bridging concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Requirements for Language Bindings and Bridges</text:h><text:h text:style-name="Head 3" text:level="3" >New Scripting Engines</text:h><text:h text:style-name="Head 2" text:level="2" >ServiceManager and loader</text:h><text:h text:style-name="Head 2" text:level="2" >Special Interfaces for internal use</text:h><text:p text:style-name="Paragraph" >XUNOTunnel</text:p><text:p text:style-name="Paragraph" >XAggregation</text:p><text:h text:style-name="Head 2" text:level="2" >UNO Reflection API</text:h><text:h text:style-name="Head 2" text:level="2" >TypeLibrary and TypeProviders</text:h><text:h text:style-name="Head 2" text:level="2" >Differences from Corba</text:h><text:h text:style-name="Head 1" text:level="1" >Office Development</text:h><text:h text:style-name="Head 2" text:level="2" >Global Object Structure</text:h><text:h text:style-name="Head 3" text:level="3" >Desktop Environment</text:h><text:h text:style-name="Head 3" text:level="3" >Frames and Frame Hierarchies</text:h><text:h text:style-name="Head 3" text:level="3" >Frame-Controller-Model Paradigm</text:h><text:h text:style-name="Head 3" text:level="3" >Loading and Saving Office Components</text:h><text:h text:style-name="Head 3" text:level="3" >Dispatch Framework</text:h><text:h text:style-name="Head 2" text:level="2" >Common Features</text:h><text:h text:style-name="Head 3" text:level="3" >Common Dialogs</text:h><text:h text:style-name="Head 3" text:level="3" >DocumentInfo</text:h><text:h text:style-name="Head 3" text:level="3" >Styles</text:h><text:h text:style-name="Head 3" text:level="3" >Search and Replace</text:h><text:h text:style-name="Head 3" text:level="3" >Number Formats</text:h><text:h text:style-name="Head 3" text:level="3" >Package File Formats</text:h><text:h text:style-name="Head 2" text:level="2" >Internationalization</text:h><text:h text:style-name="Head 2" text:level="2" >Linguistic</text:h><text:h text:style-name="Head 2" text:level="2" >System Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Clipboard</text:h><text:h text:style-name="Head 3" text:level="3" >File Picker</text:h><text:h text:style-name="Head 3" text:level="3" >Bridging to the Window System</text:h><text:p text:style-name="Paragraph" ></text:p><text:h text:style-name="Head 1" text:level="1" >Text Documents (51,5 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Text Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Text Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Using Text</text:h><text:h text:style-name="Head 3" text:level="3" >Tables</text:h><text:h text:style-name="Head 3" text:level="3" >Text Fields</text:h><text:h text:style-name="Head 3" text:level="3" >Bookmarks</text:h><text:h text:style-name="Head 3" text:level="3" >Indexes and Index Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Reference Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Footnotes and Endnotes</text:h><text:h text:style-name="Head 3" text:level="3" >Shape Objects in Text</text:h><text:h text:style-name="Head 3" text:level="3" >Redline</text:h><text:h text:style-name="Head 3" text:level="3" >Ruby</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Text Document</text:h><text:h text:style-name="Head 1" text:level="1" >Spreadsheet Documents</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Spreadsheet Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Spreadsheet Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Editing Spreadsheets</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Spreadsheet Document</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Spreadsheet Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Drawings and Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Draw/Impress Files</text:h><text:h text:style-name="Head 3" text:level="3" >Saving</text:h><text:h text:style-name="Head 3" text:level="3" >Printing</text:h><text:h text:style-name="Head 3" text:level="3" >Running Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Working with a Draw/Impress Document</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Draw/Impress Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Draw/Impress Document</text:h><text:h text:style-name="Head 1" text:level="1" >Charts</text:h><text:h text:style-name="Head 2" text:level="2" >Chart Basics</text:h><text:h text:style-name="Head 2" text:level="2" >Creating a Chart Document</text:h><text:h text:style-name="Head 2" text:level="2" >Editing a Chart Document</text:h><text:h text:style-name="Head 3" text:level="3" >Common Diagram API</text:h><text:h text:style-name="Head 3" text:level="3" >Different Chart Types</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Chart Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Basic and Dialogs</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:h text:style-name="Head 2" text:level="2" >Library Organization</text:h><text:h text:style-name="Head 2" text:level="2" >IDE with Dialogs and Events</text:h><text:h text:style-name="Head 2" text:level="2" >Using [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 2" text:level="2" >Toolkit Controls and their Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating Dialogs at Runtime</text:h><text:h text:style-name="Head 1" text:level="1" >Database Access</text:h><text:h text:style-name="Head 2" text:level="2" >Features of the [PRODUCTNAME] Database Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Capabilities</text:h><text:h text:style-name="Head 3" text:level="3" >SDBC, SDBCX, SDB Architecture</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Datasources with [PRODUCTNAME]</text:h><text:h text:style-name="Head 3" text:level="3" >DataSources</text:h><text:h text:style-name="Head 3" text:level="3" >Adding and Editing Datasources </text:h><text:h text:style-name="Head 3" text:level="3" >Establishing a Connection</text:h><text:h text:style-name="Head 4" text:level="4" >Getting Connections</text:h><text:h text:style-name="Head 4" text:level="4" >Driver specifics</text:h><text:h text:style-name="Head 3" text:level="3" >Connection Pooling</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Saved Queries</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Data</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Statements</text:h><text:h text:style-name="Head 3" text:level="3" >Resultsets</text:h><text:h text:style-name="Head 3" text:level="3" >Metadata</text:h><text:h text:style-name="Head 3" text:level="3" >Rowsets</text:h><text:h text:style-name="Head 2" text:level="2" >Working with the Database Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using DDL to change the DB Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using SDBCX to access the DB Design</text:h><text:h text:style-name="Head 2" text:level="2" >Using DBMS Features</text:h><text:h text:style-name="Head 3" text:level="3" >Stored Procedures</text:h><text:h text:style-name="Head 3" text:level="3" >Transaction Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Prepared Statements</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Database Drivers</text:h><text:h text:style-name="Head 1" text:level="1" >Forms</text:h><text:h text:style-name="Head 2" text:level="2" >Concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Models and Views</text:h><text:h text:style-name="Head 3" text:level="3" >Form Elements in the Document Model</text:h><text:h text:style-name="Head 3" text:level="3" >Special Form Components</text:h><text:h text:style-name="Head 3" text:level="3" >Events</text:h><text:h text:style-name="Head 3" text:level="3" >Data Awareness</text:h><text:h text:style-name="Head 2" text:level="2" >Recipes</text:h><text:h text:style-name="Head 3" text:level="3" >Making it easier to work with a Form</text:h><text:h text:style-name="Head 3" text:level="3" >Controlling the Data Input</text:h><text:h text:style-name="Head 3" text:level="3" >Collecting Data automatically</text:h><text:h text:style-name="Head 3" text:level="3" >Taking Advantage of Database Server Features</text:h><text:h text:style-name="Head 3" text:level="3" >Adding new Functionality</text:h><text:h text:style-name="Head 3" text:level="3" >Handling Errors</text:h><text:h text:style-name="Head 1" text:level="1" >UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Purpose of UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Document Contents as Streams</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Content Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating, Moving and Copying Document and Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Additional Commands</text:h><text:h text:style-name="Head 2" text:level="2" >Writing a Content Provider</text:h><text:h text:style-name="Head 1" text:level="1" >[PRODUCTNAME] Configuration</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing configuration data</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Configuration Data</text:h><text:h text:style-name="Head 1" text:level="1" >Appendix</text:h></office:body> + +<office:body ><text:sequence-decls ><text:sequence-decl text:display-outline-level="0" text:name="Illustration" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Table" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Text" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Drawing" ></text:sequence-decl></text:sequence-decls><text:p text:style-name="P1" >Programmer's Manual</text:p><text:p text:style-name="P2" >Planned Outline</text:p><text:p text:style-name="P2" ></text:p><text:h text:style-name="Head 1" text:level="1" >Preface (3 Pages)</text:h><text:h text:style-name="Head 1" text:level="1" >First Steps (24 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Programming with UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Fields of Application for UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Getting Started</text:h><text:h text:style-name="Head 3" text:level="3" >Required Files</text:h><text:h text:style-name="Head 3" text:level="3" >Configuration</text:h><text:h text:style-name="Head 3" text:level="3" >First Connection</text:h><text:h text:style-name="Head 2" text:level="2" >How to get Objects in [PRODUCTNAME]</text:h><text:h text:style-name="Head 2" text:level="2" >How to work with Objects</text:h><text:p text:style-name="Paragraph" >Example</text:p><text:h text:style-name="Head 3" text:level="3" >Services</text:h><text:h text:style-name="Head 3" text:level="3" >Querying Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >ElementAccess</text:h><text:h text:style-name="Head 3" text:level="3" >Simple Types</text:h><text:h text:style-name="Head 3" text:level="3" >Strings</text:h><text:h text:style-name="Head 3" text:level="3" >Enums and Constant Groups</text:h><text:h text:style-name="Head 3" text:level="3" >Structs</text:h><text:h text:style-name="Head 3" text:level="3" >Any</text:h><text:h text:style-name="Head 3" text:level="3" >Sequence</text:h><text:h text:style-name="Head 2" text:level="2" >How to find the solution for a problem</text:h><text:h text:style-name="Head 2" text:level="2" >Finding your Way through the API Reference</text:h><text:h text:style-name="Head 2" text:level="2" >Common Mechanisms</text:h><text:h text:style-name="Head 3" text:level="3" >Text</text:h><text:h text:style-name="Head 3" text:level="3" >Table</text:h><text:h text:style-name="Head 3" text:level="3" >Drawing</text:h><text:h text:style-name="Head 1" text:level="1" >UNO in Professional Projects (<text:span text:style-name="T1" >145</text:span>)</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:p text:style-name="Paragraph" >UNO/API constituents: How UNOIDL/API, ServiceManager, Bridges, CoreReflection work together</text:p><text:h text:style-name="Head 2" text:level="2" >API Concepts</text:h><text:p text:style-name="Paragraph" >API is a language independent, abstract specification for UNO objects which are used in <text:s ></text:s>[PRODUCTNAME]</text:p><text:h text:style-name="Head 3" text:level="3" >Types in the API Reference</text:h><text:h text:style-name="Head 4" text:level="4" >Simple Types</text:h><text:h text:style-name="Head 4" text:level="4" >The Any Type</text:h><text:h text:style-name="Head 4" text:level="4" >Interfaces</text:h><text:h text:style-name="Head 4" text:level="4" >Services</text:h><text:h text:style-name="Head 4" text:level="4" >Modules</text:h><text:h text:style-name="Head 4" text:level="4" >Structs</text:h><text:h text:style-name="Head 4" text:level="4" >Constant Groups and Enums</text:h><text:h text:style-name="Head 4" text:level="4" >Sequences</text:h><text:h text:style-name="Head 4" text:level="4" >Exceptions</text:h><text:h text:style-name="Head 3" text:level="3" >API Principles</text:h><text:h text:style-name="Head 4" text:level="4" >Relationship between Specification, Implementation and Instances</text:h><text:h text:style-name="Head 4" text:level="4" >Object Composition</text:h><text:h text:style-name="Head 2" text:level="2" >UNO Concepts</text:h><text:p text:style-name="Paragraph" >UNO is an environment for networked object communication</text:p><text:h text:style-name="Head 3" text:level="3" >Interprocess Connections</text:h><text:h text:style-name="Head 3" text:level="3" >ServiceManager and ComponentContext</text:h><text:h text:style-name="Head 3" text:level="3" >Using UNO Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >Using Collections and Containers</text:h><text:h text:style-name="Head 3" text:level="3" >Event Model</text:h><text:h text:style-name="Head 3" text:level="3" >Exception Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Lifetime Control</text:h><text:h text:style-name="Head 3" text:level="3" >Object Identity</text:h><text:h text:style-name="Head 2" text:level="2" >Language Bindings</text:h><text:h text:style-name="Head 3" text:level="3" >Introduction for language binding</text:h><text:h text:style-name="Head 3" text:level="3" >Java Language Binding</text:h><text:h text:style-name="Head 3" text:level="3" >C++ Binding</text:h><text:h text:style-name="Head 3" text:level="3" >Access for [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 3" text:level="3" >Automation</text:h><text:h text:style-name="Head 1" text:level="1" >Writing UNO components</text:h><text:h text:style-name="Head 2" text:level="2" >Specifying a new Component</text:h><text:h text:style-name="Head 3" text:level="3" >UNOIDL language specification</text:h><text:h text:style-name="Head 2" text:level="2" >Implementing a Component</text:h><text:h text:style-name="Head 3" text:level="3" >Component Development Basics</text:h><text:unordered-list text:style-name="L1" ><text:list-item ><text:p text:style-name="P3" >Introduction</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >Mandatory interfaces: XInterface, XServiceInfo ((from UseInterfaces.CoreInterfaces))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >"Should be implemented" interfaces: XTypeProvider ((from UseInterfaces.CoreInterfaces ))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >optional interface: XMain for standalone execution</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Simple Component in Java</text:h><text:unordered-list text:style-name="L2" ><text:list-item ><text:p text:style-name="P4" >Getting the service manager ((Chapter Java components from unoBindingJava))</text:p></text:list-item><text:list-item ><text:p text:style-name="P4" >simple component chapter</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >C++ Component</text:h><text:h text:style-name="Head 3" text:level="3" >((Automation Component?))</text:h><text:h text:style-name="Head 2" text:level="2" >Deployment Options for Components</text:h><text:h text:style-name="Head 3" text:level="3" >Component Registration</text:h><text:h text:style-name="Head 3" text:level="3" >Service Manager Configuration</text:h><text:unordered-list text:style-name="L3" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P5" >XSet Interface</text:p><text:p text:style-name="P5" >Adding components during runtime, particularly interesting during development</text:p></text:list-item><text:list-item ><text:p text:style-name="P5" >ServiceManager Content</text:p><text:p text:style-name="P5" >Dynamically modifying the ServiceManager</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Bootstrapping the Service Manager ((from CppBind chapter))</text:h><text:unordered-list text:style-name="L4" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P6" >Simple Test Application</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >Configuring Your Application with Bootstrap Parameters</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >The UNO Executable</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Standalone Runtime Environment</text:h><text:p text:style-name="Paragraph" ><text:tab-stop ></text:tab-stop>The UNO executable and XMain</text:p><text:h text:style-name="Head 3" text:level="3" >Configuring the Java Runtime Environment</text:h><text:unordered-list text:style-name="L5" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P7" >The office and Java ((from UnoBindingJava))</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 1" text:level="1" >Advanced UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Design Patterns</text:h><text:h text:style-name="Head 2" text:level="2" >Bridging concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Requirements for Language Bindings and Bridges</text:h><text:h text:style-name="Head 3" text:level="3" >New Scripting Engines</text:h><text:h text:style-name="Head 2" text:level="2" >ServiceManager and loader</text:h><text:h text:style-name="Head 2" text:level="2" >Special Interfaces for internal use</text:h><text:p text:style-name="Paragraph" >XUNOTunnel</text:p><text:p text:style-name="Paragraph" >XAggregation</text:p><text:h text:style-name="Head 2" text:level="2" >UNO Reflection API</text:h><text:h text:style-name="Head 2" text:level="2" >TypeLibrary and TypeProviders</text:h><text:h text:style-name="Head 2" text:level="2" >Differences from Corba</text:h><text:h text:style-name="Head 1" text:level="1" >Office Development</text:h><text:h text:style-name="Head 2" text:level="2" >Global Object Structure</text:h><text:h text:style-name="Head 3" text:level="3" >Desktop Environment</text:h><text:h text:style-name="Head 3" text:level="3" >Frames and Frame Hierarchies</text:h><text:h text:style-name="Head 3" text:level="3" >Frame-Controller-Model Paradigm</text:h><text:h text:style-name="Head 3" text:level="3" >Loading and Saving Office Components</text:h><text:h text:style-name="Head 3" text:level="3" >Dispatch Framework</text:h><text:h text:style-name="Head 2" text:level="2" >Common Features</text:h><text:h text:style-name="Head 3" text:level="3" >Common Dialogs</text:h><text:h text:style-name="Head 3" text:level="3" >DocumentInfo</text:h><text:h text:style-name="Head 3" text:level="3" >Styles</text:h><text:h text:style-name="Head 3" text:level="3" >Search and Replace</text:h><text:h text:style-name="Head 3" text:level="3" >Number Formats</text:h><text:h text:style-name="Head 3" text:level="3" >Package File Formats</text:h><text:h text:style-name="Head 2" text:level="2" >Internationalization</text:h><text:h text:style-name="Head 2" text:level="2" >Linguistic</text:h><text:h text:style-name="Head 2" text:level="2" >System Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Clipboard</text:h><text:h text:style-name="Head 3" text:level="3" >File Picker</text:h><text:h text:style-name="Head 3" text:level="3" >Bridging to the Window System</text:h><text:p text:style-name="Paragraph" ></text:p><text:h text:style-name="Head 1" text:level="1" >Text Documents (51,5 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Text Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Text Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Using Text</text:h><text:h text:style-name="Head 3" text:level="3" >Tables</text:h><text:h text:style-name="Head 3" text:level="3" >Text Fields</text:h><text:h text:style-name="Head 3" text:level="3" >Bookmarks</text:h><text:h text:style-name="Head 3" text:level="3" >Indexes and Index Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Reference Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Footnotes and Endnotes</text:h><text:h text:style-name="Head 3" text:level="3" >Shape Objects in Text</text:h><text:h text:style-name="Head 3" text:level="3" >Redline</text:h><text:h text:style-name="Head 3" text:level="3" >Ruby</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Text Document</text:h><text:h text:style-name="Head 1" text:level="1" >Spreadsheet Documents</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Spreadsheet Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Spreadsheet Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Editing Spreadsheets</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Spreadsheet Document</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Spreadsheet Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Drawings and Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Draw/Impress Files</text:h><text:h text:style-name="Head 3" text:level="3" >Saving</text:h><text:h text:style-name="Head 3" text:level="3" >Printing</text:h><text:h text:style-name="Head 3" text:level="3" >Running Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Working with a Draw/Impress Document</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Draw/Impress Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Draw/Impress Document</text:h><text:h text:style-name="Head 1" text:level="1" >Charts</text:h><text:h text:style-name="Head 2" text:level="2" >Chart Basics</text:h><text:h text:style-name="Head 2" text:level="2" >Creating a Chart Document</text:h><text:h text:style-name="Head 2" text:level="2" >Editing a Chart Document</text:h><text:h text:style-name="Head 3" text:level="3" >Common Diagram API</text:h><text:h text:style-name="Head 3" text:level="3" >Different Chart Types</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Chart Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Basic and Dialogs</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:h text:style-name="Head 2" text:level="2" >Library Organization</text:h><text:h text:style-name="Head 2" text:level="2" >IDE with Dialogs and Events</text:h><text:h text:style-name="Head 2" text:level="2" >Using [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 2" text:level="2" >Toolkit Controls and their Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating Dialogs at Runtime</text:h><text:h text:style-name="Head 1" text:level="1" >Database Access</text:h><text:h text:style-name="Head 2" text:level="2" >Features of the [PRODUCTNAME] Database Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Capabilities</text:h><text:h text:style-name="Head 3" text:level="3" >SDBC, SDBCX, SDB Architecture</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Datasources with [PRODUCTNAME]</text:h><text:h text:style-name="Head 3" text:level="3" >DataSources</text:h><text:h text:style-name="Head 3" text:level="3" >Adding and Editing Datasources </text:h><text:h text:style-name="Head 3" text:level="3" >Establishing a Connection</text:h><text:h text:style-name="Head 4" text:level="4" >Getting Connections</text:h><text:h text:style-name="Head 4" text:level="4" >Driver specifics</text:h><text:h text:style-name="Head 3" text:level="3" >Connection Pooling</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Saved Queries</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Data</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Statements</text:h><text:h text:style-name="Head 3" text:level="3" >Resultsets</text:h><text:h text:style-name="Head 3" text:level="3" >Metadata</text:h><text:h text:style-name="Head 3" text:level="3" >Rowsets</text:h><text:h text:style-name="Head 2" text:level="2" >Working with the Database Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using DDL to change the DB Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using SDBCX to access the DB Design</text:h><text:h text:style-name="Head 2" text:level="2" >Using DBMS Features</text:h><text:h text:style-name="Head 3" text:level="3" >Stored Procedures</text:h><text:h text:style-name="Head 3" text:level="3" >Transaction Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Prepared Statements</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Database Drivers</text:h><text:h text:style-name="Head 1" text:level="1" >Forms</text:h><text:h text:style-name="Head 2" text:level="2" >Concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Models and Views</text:h><text:h text:style-name="Head 3" text:level="3" >Form Elements in the Document Model</text:h><text:h text:style-name="Head 3" text:level="3" >Special Form Components</text:h><text:h text:style-name="Head 3" text:level="3" >Events</text:h><text:h text:style-name="Head 3" text:level="3" >Data Awareness</text:h><text:h text:style-name="Head 2" text:level="2" >Recipes</text:h><text:h text:style-name="Head 3" text:level="3" >Making it easier to work with a Form</text:h><text:h text:style-name="Head 3" text:level="3" >Controlling the Data Input</text:h><text:h text:style-name="Head 3" text:level="3" >Collecting Data automatically</text:h><text:h text:style-name="Head 3" text:level="3" >Taking Advantage of Database Server Features</text:h><text:h text:style-name="Head 3" text:level="3" >Adding new Functionality</text:h><text:h text:style-name="Head 3" text:level="3" >Handling Errors</text:h><text:h text:style-name="Head 1" text:level="1" >UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Purpose of UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Document Contents as Streams</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Content Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating, Moving and Copying Document and Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Additional Commands</text:h><text:h text:style-name="Head 2" text:level="2" >Writing a Content Provider</text:h><text:h text:style-name="Head 1" text:level="1" >[PRODUCTNAME] Configuration</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing configuration data</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Configuration Data</text:h><text:h text:style-name="Head 1" text:level="1" >Appendix</text:h></office:body> + +<office:body ><text:sequence-decls ><text:sequence-decl text:display-outline-level="0" text:name="Illustration" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Table" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Text" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Drawing" ></text:sequence-decl></text:sequence-decls><text:p text:style-name="P1" >Programmer's Manual</text:p><text:p text:style-name="P2" >Planned Outline</text:p><text:p text:style-name="P2" ></text:p><text:h text:style-name="Head 1" text:level="1" >Preface (3 Pages)</text:h><text:h text:style-name="Head 1" text:level="1" >First Steps (24 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Programming with UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Fields of Application for UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Getting Started</text:h><text:h text:style-name="Head 3" text:level="3" >Required Files</text:h><text:h text:style-name="Head 3" text:level="3" >Configuration</text:h><text:h text:style-name="Head 3" text:level="3" >First Connection</text:h><text:h text:style-name="Head 2" text:level="2" >How to get Objects in [PRODUCTNAME]</text:h><text:h text:style-name="Head 2" text:level="2" >How to work with Objects</text:h><text:p text:style-name="Paragraph" >Example</text:p><text:h text:style-name="Head 3" text:level="3" >Services</text:h><text:h text:style-name="Head 3" text:level="3" >Querying Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >ElementAccess</text:h><text:h text:style-name="Head 3" text:level="3" >Simple Types</text:h><text:h text:style-name="Head 3" text:level="3" >Strings</text:h><text:h text:style-name="Head 3" text:level="3" >Enums and Constant Groups</text:h><text:h text:style-name="Head 3" text:level="3" >Structs</text:h><text:h text:style-name="Head 3" text:level="3" >Any</text:h><text:h text:style-name="Head 3" text:level="3" >Sequence</text:h><text:h text:style-name="Head 2" text:level="2" >How to find the solution for a problem</text:h><text:h text:style-name="Head 2" text:level="2" >Finding your Way through the API Reference</text:h><text:h text:style-name="Head 2" text:level="2" >Common Mechanisms</text:h><text:h text:style-name="Head 3" text:level="3" >Text</text:h><text:h text:style-name="Head 3" text:level="3" >Table</text:h><text:h text:style-name="Head 3" text:level="3" >Drawing</text:h><text:h text:style-name="Head 1" text:level="1" >UNO in Professional Projects (<text:span text:style-name="T1" >145</text:span>)</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:p text:style-name="Paragraph" >UNO/API constituents: How UNOIDL/API, ServiceManager, Bridges, CoreReflection work together</text:p><text:h text:style-name="Head 2" text:level="2" >API Concepts</text:h><text:p text:style-name="Paragraph" >API is a language independent, abstract specification for UNO objects which are used in <text:s ></text:s>[PRODUCTNAME]</text:p><text:h text:style-name="Head 3" text:level="3" >Types in the API Reference</text:h><text:h text:style-name="Head 4" text:level="4" >Simple Types</text:h><text:h text:style-name="Head 4" text:level="4" >The Any Type</text:h><text:h text:style-name="Head 4" text:level="4" >Interfaces</text:h><text:h text:style-name="Head 4" text:level="4" >Services</text:h><text:h text:style-name="Head 4" text:level="4" >Modules</text:h><text:h text:style-name="Head 4" text:level="4" >Structs</text:h><text:h text:style-name="Head 4" text:level="4" >Constant Groups and Enums</text:h><text:h text:style-name="Head 4" text:level="4" >Sequences</text:h><text:h text:style-name="Head 4" text:level="4" >Exceptions</text:h><text:h text:style-name="Head 3" text:level="3" >API Principles</text:h><text:h text:style-name="Head 4" text:level="4" >Relationship between Specification, Implementation and Instances</text:h><text:h text:style-name="Head 4" text:level="4" >Object Composition</text:h><text:h text:style-name="Head 2" text:level="2" >UNO Concepts</text:h><text:p text:style-name="Paragraph" >UNO is an environment for networked object communication</text:p><text:h text:style-name="Head 3" text:level="3" >Interprocess Connections</text:h><text:h text:style-name="Head 3" text:level="3" >ServiceManager and ComponentContext</text:h><text:h text:style-name="Head 3" text:level="3" >Using UNO Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >Using Collections and Containers</text:h><text:h text:style-name="Head 3" text:level="3" >Event Model</text:h><text:h text:style-name="Head 3" text:level="3" >Exception Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Lifetime Control</text:h><text:h text:style-name="Head 3" text:level="3" >Object Identity</text:h><text:h text:style-name="Head 2" text:level="2" >Language Bindings</text:h><text:h text:style-name="Head 3" text:level="3" >Introduction for language binding</text:h><text:h text:style-name="Head 3" text:level="3" >Java Language Binding</text:h><text:h text:style-name="Head 3" text:level="3" >C++ Binding</text:h><text:h text:style-name="Head 3" text:level="3" >Access for [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 3" text:level="3" >Automation</text:h><text:h text:style-name="Head 1" text:level="1" >Writing UNO components</text:h><text:h text:style-name="Head 2" text:level="2" >Specifying a new Component</text:h><text:h text:style-name="Head 3" text:level="3" >UNOIDL language specification</text:h><text:h text:style-name="Head 2" text:level="2" >Implementing a Component</text:h><text:h text:style-name="Head 3" text:level="3" >Component Development Basics</text:h><text:unordered-list text:style-name="L1" ><text:list-item ><text:p text:style-name="P3" >Introduction</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >Mandatory interfaces: XInterface, XServiceInfo ((from UseInterfaces.CoreInterfaces))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >"Should be implemented" interfaces: XTypeProvider ((from UseInterfaces.CoreInterfaces ))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >optional interface: XMain for standalone execution</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Simple Component in Java</text:h><text:unordered-list text:style-name="L2" ><text:list-item ><text:p text:style-name="P4" >Getting the service manager ((Chapter Java components from unoBindingJava))</text:p></text:list-item><text:list-item ><text:p text:style-name="P4" >simple component chapter</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >C++ Component</text:h><text:h text:style-name="Head 3" text:level="3" >((Automation Component?))</text:h><text:h text:style-name="Head 2" text:level="2" >Deployment Options for Components</text:h><text:h text:style-name="Head 3" text:level="3" >Component Registration</text:h><text:h text:style-name="Head 3" text:level="3" >Service Manager Configuration</text:h><text:unordered-list text:style-name="L3" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P5" >XSet Interface</text:p><text:p text:style-name="P5" >Adding components during runtime, particularly interesting during development</text:p></text:list-item><text:list-item ><text:p text:style-name="P5" >ServiceManager Content</text:p><text:p text:style-name="P5" >Dynamically modifying the ServiceManager</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Bootstrapping the Service Manager ((from CppBind chapter))</text:h><text:unordered-list text:style-name="L4" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P6" >Simple Test Application</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >Configuring Your Application with Bootstrap Parameters</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >The UNO Executable</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Standalone Runtime Environment</text:h><text:p text:style-name="Paragraph" ><text:tab-stop ></text:tab-stop>The UNO executable and XMain</text:p><text:h text:style-name="Head 3" text:level="3" >Configuring the Java Runtime Environment</text:h><text:unordered-list text:style-name="L5" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P7" >The office and Java ((from UnoBindingJava))</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 1" text:level="1" >Advanced UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Design Patterns</text:h><text:h text:style-name="Head 2" text:level="2" >Bridging concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Requirements for Language Bindings and Bridges</text:h><text:h text:style-name="Head 3" text:level="3" >New Scripting Engines</text:h><text:h text:style-name="Head 2" text:level="2" >ServiceManager and loader</text:h><text:h text:style-name="Head 2" text:level="2" >Special Interfaces for internal use</text:h><text:p text:style-name="Paragraph" >XUNOTunnel</text:p><text:p text:style-name="Paragraph" >XAggregation</text:p><text:h text:style-name="Head 2" text:level="2" >UNO Reflection API</text:h><text:h text:style-name="Head 2" text:level="2" >TypeLibrary and TypeProviders</text:h><text:h text:style-name="Head 2" text:level="2" >Differences from Corba</text:h><text:h text:style-name="Head 1" text:level="1" >Office Development</text:h><text:h text:style-name="Head 2" text:level="2" >Global Object Structure</text:h><text:h text:style-name="Head 3" text:level="3" >Desktop Environment</text:h><text:h text:style-name="Head 3" text:level="3" >Frames and Frame Hierarchies</text:h><text:h text:style-name="Head 3" text:level="3" >Frame-Controller-Model Paradigm</text:h><text:h text:style-name="Head 3" text:level="3" >Loading and Saving Office Components</text:h><text:h text:style-name="Head 3" text:level="3" >Dispatch Framework</text:h><text:h text:style-name="Head 2" text:level="2" >Common Features</text:h><text:h text:style-name="Head 3" text:level="3" >Common Dialogs</text:h><text:h text:style-name="Head 3" text:level="3" >DocumentInfo</text:h><text:h text:style-name="Head 3" text:level="3" >Styles</text:h><text:h text:style-name="Head 3" text:level="3" >Search and Replace</text:h><text:h text:style-name="Head 3" text:level="3" >Number Formats</text:h><text:h text:style-name="Head 3" text:level="3" >Package File Formats</text:h><text:h text:style-name="Head 2" text:level="2" >Internationalization</text:h><text:h text:style-name="Head 2" text:level="2" >Linguistic</text:h><text:h text:style-name="Head 2" text:level="2" >System Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Clipboard</text:h><text:h text:style-name="Head 3" text:level="3" >File Picker</text:h><text:h text:style-name="Head 3" text:level="3" >Bridging to the Window System</text:h><text:p text:style-name="Paragraph" ></text:p><text:h text:style-name="Head 1" text:level="1" >Text Documents (51,5 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Text Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Text Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Using Text</text:h><text:h text:style-name="Head 3" text:level="3" >Tables</text:h><text:h text:style-name="Head 3" text:level="3" >Text Fields</text:h><text:h text:style-name="Head 3" text:level="3" >Bookmarks</text:h><text:h text:style-name="Head 3" text:level="3" >Indexes and Index Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Reference Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Footnotes and Endnotes</text:h><text:h text:style-name="Head 3" text:level="3" >Shape Objects in Text</text:h><text:h text:style-name="Head 3" text:level="3" >Redline</text:h><text:h text:style-name="Head 3" text:level="3" >Ruby</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Text Document</text:h><text:h text:style-name="Head 1" text:level="1" >Spreadsheet Documents</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Spreadsheet Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Spreadsheet Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Editing Spreadsheets</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Spreadsheet Document</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Spreadsheet Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Drawings and Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Draw/Impress Files</text:h><text:h text:style-name="Head 3" text:level="3" >Saving</text:h><text:h text:style-name="Head 3" text:level="3" >Printing</text:h><text:h text:style-name="Head 3" text:level="3" >Running Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Working with a Draw/Impress Document</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Draw/Impress Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Draw/Impress Document</text:h><text:h text:style-name="Head 1" text:level="1" >Charts</text:h><text:h text:style-name="Head 2" text:level="2" >Chart Basics</text:h><text:h text:style-name="Head 2" text:level="2" >Creating a Chart Document</text:h><text:h text:style-name="Head 2" text:level="2" >Editing a Chart Document</text:h><text:h text:style-name="Head 3" text:level="3" >Common Diagram API</text:h><text:h text:style-name="Head 3" text:level="3" >Different Chart Types</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Chart Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Basic and Dialogs</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:h text:style-name="Head 2" text:level="2" >Library Organization</text:h><text:h text:style-name="Head 2" text:level="2" >IDE with Dialogs and Events</text:h><text:h text:style-name="Head 2" text:level="2" >Using [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 2" text:level="2" >Toolkit Controls and their Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating Dialogs at Runtime</text:h><text:h text:style-name="Head 1" text:level="1" >Database Access</text:h><text:h text:style-name="Head 2" text:level="2" >Features of the [PRODUCTNAME] Database Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Capabilities</text:h><text:h text:style-name="Head 3" text:level="3" >SDBC, SDBCX, SDB Architecture</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Datasources with [PRODUCTNAME]</text:h><text:h text:style-name="Head 3" text:level="3" >DataSources</text:h><text:h text:style-name="Head 3" text:level="3" >Adding and Editing Datasources </text:h><text:h text:style-name="Head 3" text:level="3" >Establishing a Connection</text:h><text:h text:style-name="Head 4" text:level="4" >Getting Connections</text:h><text:h text:style-name="Head 4" text:level="4" >Driver specifics</text:h><text:h text:style-name="Head 3" text:level="3" >Connection Pooling</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Saved Queries</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Data</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Statements</text:h><text:h text:style-name="Head 3" text:level="3" >Resultsets</text:h><text:h text:style-name="Head 3" text:level="3" >Metadata</text:h><text:h text:style-name="Head 3" text:level="3" >Rowsets</text:h><text:h text:style-name="Head 2" text:level="2" >Working with the Database Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using DDL to change the DB Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using SDBCX to access the DB Design</text:h><text:h text:style-name="Head 2" text:level="2" >Using DBMS Features</text:h><text:h text:style-name="Head 3" text:level="3" >Stored Procedures</text:h><text:h text:style-name="Head 3" text:level="3" >Transaction Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Prepared Statements</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Database Drivers</text:h><text:h text:style-name="Head 1" text:level="1" >Forms</text:h><text:h text:style-name="Head 2" text:level="2" >Concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Models and Views</text:h><text:h text:style-name="Head 3" text:level="3" >Form Elements in the Document Model</text:h><text:h text:style-name="Head 3" text:level="3" >Special Form Components</text:h><text:h text:style-name="Head 3" text:level="3" >Events</text:h><text:h text:style-name="Head 3" text:level="3" >Data Awareness</text:h><text:h text:style-name="Head 2" text:level="2" >Recipes</text:h><text:h text:style-name="Head 3" text:level="3" >Making it easier to work with a Form</text:h><text:h text:style-name="Head 3" text:level="3" >Controlling the Data Input</text:h><text:h text:style-name="Head 3" text:level="3" >Collecting Data automatically</text:h><text:h text:style-name="Head 3" text:level="3" >Taking Advantage of Database Server Features</text:h><text:h text:style-name="Head 3" text:level="3" >Adding new Functionality</text:h><text:h text:style-name="Head 3" text:level="3" >Handling Errors</text:h><text:h text:style-name="Head 1" text:level="1" >UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Purpose of UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Document Contents as Streams</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Content Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating, Moving and Copying Document and Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Additional Commands</text:h><text:h text:style-name="Head 2" text:level="2" >Writing a Content Provider</text:h><text:h text:style-name="Head 1" text:level="1" >[PRODUCTNAME] Configuration</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing configuration data</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Configuration Data</text:h><text:h text:style-name="Head 1" text:level="1" >Appendix</text:h></office:body> + +<office:body ><text:sequence-decls ><text:sequence-decl text:display-outline-level="0" text:name="Illustration" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Table" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Text" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Drawing" ></text:sequence-decl></text:sequence-decls><text:p text:style-name="P1" >Programmer's Manual</text:p><text:p text:style-name="P2" >Planned Outline</text:p><text:p text:style-name="P2" ></text:p><text:h text:style-name="Head 1" text:level="1" >Preface (3 Pages)</text:h><text:h text:style-name="Head 1" text:level="1" >First Steps (24 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Programming with UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Fields of Application for UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Getting Started</text:h><text:h text:style-name="Head 3" text:level="3" >Required Files</text:h><text:h text:style-name="Head 3" text:level="3" >Configuration</text:h><text:h text:style-name="Head 3" text:level="3" >First Connection</text:h><text:h text:style-name="Head 2" text:level="2" >How to get Objects in [PRODUCTNAME]</text:h><text:h text:style-name="Head 2" text:level="2" >How to work with Objects</text:h><text:p text:style-name="Paragraph" >Example</text:p><text:h text:style-name="Head 3" text:level="3" >Services</text:h><text:h text:style-name="Head 3" text:level="3" >Querying Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >ElementAccess</text:h><text:h text:style-name="Head 3" text:level="3" >Simple Types</text:h><text:h text:style-name="Head 3" text:level="3" >Strings</text:h><text:h text:style-name="Head 3" text:level="3" >Enums and Constant Groups</text:h><text:h text:style-name="Head 3" text:level="3" >Structs</text:h><text:h text:style-name="Head 3" text:level="3" >Any</text:h><text:h text:style-name="Head 3" text:level="3" >Sequence</text:h><text:h text:style-name="Head 2" text:level="2" >How to find the solution for a problem</text:h><text:h text:style-name="Head 2" text:level="2" >Finding your Way through the API Reference</text:h><text:h text:style-name="Head 2" text:level="2" >Common Mechanisms</text:h><text:h text:style-name="Head 3" text:level="3" >Text</text:h><text:h text:style-name="Head 3" text:level="3" >Table</text:h><text:h text:style-name="Head 3" text:level="3" >Drawing</text:h><text:h text:style-name="Head 1" text:level="1" >UNO in Professional Projects (<text:span text:style-name="T1" >145</text:span>)</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:p text:style-name="Paragraph" >UNO/API constituents: How UNOIDL/API, ServiceManager, Bridges, CoreReflection work together</text:p><text:h text:style-name="Head 2" text:level="2" >API Concepts</text:h><text:p text:style-name="Paragraph" >API is a language independent, abstract specification for UNO objects which are used in <text:s ></text:s>[PRODUCTNAME]</text:p><text:h text:style-name="Head 3" text:level="3" >Types in the API Reference</text:h><text:h text:style-name="Head 4" text:level="4" >Simple Types</text:h><text:h text:style-name="Head 4" text:level="4" >The Any Type</text:h><text:h text:style-name="Head 4" text:level="4" >Interfaces</text:h><text:h text:style-name="Head 4" text:level="4" >Services</text:h><text:h text:style-name="Head 4" text:level="4" >Modules</text:h><text:h text:style-name="Head 4" text:level="4" >Structs</text:h><text:h text:style-name="Head 4" text:level="4" >Constant Groups and Enums</text:h><text:h text:style-name="Head 4" text:level="4" >Sequences</text:h><text:h text:style-name="Head 4" text:level="4" >Exceptions</text:h><text:h text:style-name="Head 3" text:level="3" >API Principles</text:h><text:h text:style-name="Head 4" text:level="4" >Relationship between Specification, Implementation and Instances</text:h><text:h text:style-name="Head 4" text:level="4" >Object Composition</text:h><text:h text:style-name="Head 2" text:level="2" >UNO Concepts</text:h><text:p text:style-name="Paragraph" >UNO is an environment for networked object communication</text:p><text:h text:style-name="Head 3" text:level="3" >Interprocess Connections</text:h><text:h text:style-name="Head 3" text:level="3" >ServiceManager and ComponentContext</text:h><text:h text:style-name="Head 3" text:level="3" >Using UNO Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >Using Collections and Containers</text:h><text:h text:style-name="Head 3" text:level="3" >Event Model</text:h><text:h text:style-name="Head 3" text:level="3" >Exception Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Lifetime Control</text:h><text:h text:style-name="Head 3" text:level="3" >Object Identity</text:h><text:h text:style-name="Head 2" text:level="2" >Language Bindings</text:h><text:h text:style-name="Head 3" text:level="3" >Introduction for language binding</text:h><text:h text:style-name="Head 3" text:level="3" >Java Language Binding</text:h><text:h text:style-name="Head 3" text:level="3" >C++ Binding</text:h><text:h text:style-name="Head 3" text:level="3" >Access for [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 3" text:level="3" >Automation</text:h><text:h text:style-name="Head 1" text:level="1" >Writing UNO components</text:h><text:h text:style-name="Head 2" text:level="2" >Specifying a new Component</text:h><text:h text:style-name="Head 3" text:level="3" >UNOIDL language specification</text:h><text:h text:style-name="Head 2" text:level="2" >Implementing a Component</text:h><text:h text:style-name="Head 3" text:level="3" >Component Development Basics</text:h><text:unordered-list text:style-name="L1" ><text:list-item ><text:p text:style-name="P3" >Introduction</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >Mandatory interfaces: XInterface, XServiceInfo ((from UseInterfaces.CoreInterfaces))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >"Should be implemented" interfaces: XTypeProvider ((from UseInterfaces.CoreInterfaces ))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >optional interface: XMain for standalone execution</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Simple Component in Java</text:h><text:unordered-list text:style-name="L2" ><text:list-item ><text:p text:style-name="P4" >Getting the service manager ((Chapter Java components from unoBindingJava))</text:p></text:list-item><text:list-item ><text:p text:style-name="P4" >simple component chapter</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >C++ Component</text:h><text:h text:style-name="Head 3" text:level="3" >((Automation Component?))</text:h><text:h text:style-name="Head 2" text:level="2" >Deployment Options for Components</text:h><text:h text:style-name="Head 3" text:level="3" >Component Registration</text:h><text:h text:style-name="Head 3" text:level="3" >Service Manager Configuration</text:h><text:unordered-list text:style-name="L3" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P5" >XSet Interface</text:p><text:p text:style-name="P5" >Adding components during runtime, particularly interesting during development</text:p></text:list-item><text:list-item ><text:p text:style-name="P5" >ServiceManager Content</text:p><text:p text:style-name="P5" >Dynamically modifying the ServiceManager</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Bootstrapping the Service Manager ((from CppBind chapter))</text:h><text:unordered-list text:style-name="L4" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P6" >Simple Test Application</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >Configuring Your Application with Bootstrap Parameters</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >The UNO Executable</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Standalone Runtime Environment</text:h><text:p text:style-name="Paragraph" ><text:tab-stop ></text:tab-stop>The UNO executable and XMain</text:p><text:h text:style-name="Head 3" text:level="3" >Configuring the Java Runtime Environment</text:h><text:unordered-list text:style-name="L5" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P7" >The office and Java ((from UnoBindingJava))</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 1" text:level="1" >Advanced UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Design Patterns</text:h><text:h text:style-name="Head 2" text:level="2" >Bridging concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Requirements for Language Bindings and Bridges</text:h><text:h text:style-name="Head 3" text:level="3" >New Scripting Engines</text:h><text:h text:style-name="Head 2" text:level="2" >ServiceManager and loader</text:h><text:h text:style-name="Head 2" text:level="2" >Special Interfaces for internal use</text:h><text:p text:style-name="Paragraph" >XUNOTunnel</text:p><text:p text:style-name="Paragraph" >XAggregation</text:p><text:h text:style-name="Head 2" text:level="2" >UNO Reflection API</text:h><text:h text:style-name="Head 2" text:level="2" >TypeLibrary and TypeProviders</text:h><text:h text:style-name="Head 2" text:level="2" >Differences from Corba</text:h><text:h text:style-name="Head 1" text:level="1" >Office Development</text:h><text:h text:style-name="Head 2" text:level="2" >Global Object Structure</text:h><text:h text:style-name="Head 3" text:level="3" >Desktop Environment</text:h><text:h text:style-name="Head 3" text:level="3" >Frames and Frame Hierarchies</text:h><text:h text:style-name="Head 3" text:level="3" >Frame-Controller-Model Paradigm</text:h><text:h text:style-name="Head 3" text:level="3" >Loading and Saving Office Components</text:h><text:h text:style-name="Head 3" text:level="3" >Dispatch Framework</text:h><text:h text:style-name="Head 2" text:level="2" >Common Features</text:h><text:h text:style-name="Head 3" text:level="3" >Common Dialogs</text:h><text:h text:style-name="Head 3" text:level="3" >DocumentInfo</text:h><text:h text:style-name="Head 3" text:level="3" >Styles</text:h><text:h text:style-name="Head 3" text:level="3" >Search and Replace</text:h><text:h text:style-name="Head 3" text:level="3" >Number Formats</text:h><text:h text:style-name="Head 3" text:level="3" >Package File Formats</text:h><text:h text:style-name="Head 2" text:level="2" >Internationalization</text:h><text:h text:style-name="Head 2" text:level="2" >Linguistic</text:h><text:h text:style-name="Head 2" text:level="2" >System Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Clipboard</text:h><text:h text:style-name="Head 3" text:level="3" >File Picker</text:h><text:h text:style-name="Head 3" text:level="3" >Bridging to the Window System</text:h><text:p text:style-name="Paragraph" ></text:p><text:h text:style-name="Head 1" text:level="1" >Text Documents (51,5 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Text Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Text Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Using Text</text:h><text:h text:style-name="Head 3" text:level="3" >Tables</text:h><text:h text:style-name="Head 3" text:level="3" >Text Fields</text:h><text:h text:style-name="Head 3" text:level="3" >Bookmarks</text:h><text:h text:style-name="Head 3" text:level="3" >Indexes and Index Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Reference Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Footnotes and Endnotes</text:h><text:h text:style-name="Head 3" text:level="3" >Shape Objects in Text</text:h><text:h text:style-name="Head 3" text:level="3" >Redline</text:h><text:h text:style-name="Head 3" text:level="3" >Ruby</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Text Document</text:h><text:h text:style-name="Head 1" text:level="1" >Spreadsheet Documents</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Spreadsheet Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Spreadsheet Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Editing Spreadsheets</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Spreadsheet Document</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Spreadsheet Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Drawings and Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Draw/Impress Files</text:h><text:h text:style-name="Head 3" text:level="3" >Saving</text:h><text:h text:style-name="Head 3" text:level="3" >Printing</text:h><text:h text:style-name="Head 3" text:level="3" >Running Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Working with a Draw/Impress Document</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Draw/Impress Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Draw/Impress Document</text:h><text:h text:style-name="Head 1" text:level="1" >Charts</text:h><text:h text:style-name="Head 2" text:level="2" >Chart Basics</text:h><text:h text:style-name="Head 2" text:level="2" >Creating a Chart Document</text:h><text:h text:style-name="Head 2" text:level="2" >Editing a Chart Document</text:h><text:h text:style-name="Head 3" text:level="3" >Common Diagram API</text:h><text:h text:style-name="Head 3" text:level="3" >Different Chart Types</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Chart Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Basic and Dialogs</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:h text:style-name="Head 2" text:level="2" >Library Organization</text:h><text:h text:style-name="Head 2" text:level="2" >IDE with Dialogs and Events</text:h><text:h text:style-name="Head 2" text:level="2" >Using [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 2" text:level="2" >Toolkit Controls and their Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating Dialogs at Runtime</text:h><text:h text:style-name="Head 1" text:level="1" >Database Access</text:h><text:h text:style-name="Head 2" text:level="2" >Features of the [PRODUCTNAME] Database Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Capabilities</text:h><text:h text:style-name="Head 3" text:level="3" >SDBC, SDBCX, SDB Architecture</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Datasources with [PRODUCTNAME]</text:h><text:h text:style-name="Head 3" text:level="3" >DataSources</text:h><text:h text:style-name="Head 3" text:level="3" >Adding and Editing Datasources </text:h><text:h text:style-name="Head 3" text:level="3" >Establishing a Connection</text:h><text:h text:style-name="Head 4" text:level="4" >Getting Connections</text:h><text:h text:style-name="Head 4" text:level="4" >Driver specifics</text:h><text:h text:style-name="Head 3" text:level="3" >Connection Pooling</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Saved Queries</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Data</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Statements</text:h><text:h text:style-name="Head 3" text:level="3" >Resultsets</text:h><text:h text:style-name="Head 3" text:level="3" >Metadata</text:h><text:h text:style-name="Head 3" text:level="3" >Rowsets</text:h><text:h text:style-name="Head 2" text:level="2" >Working with the Database Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using DDL to change the DB Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using SDBCX to access the DB Design</text:h><text:h text:style-name="Head 2" text:level="2" >Using DBMS Features</text:h><text:h text:style-name="Head 3" text:level="3" >Stored Procedures</text:h><text:h text:style-name="Head 3" text:level="3" >Transaction Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Prepared Statements</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Database Drivers</text:h><text:h text:style-name="Head 1" text:level="1" >Forms</text:h><text:h text:style-name="Head 2" text:level="2" >Concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Models and Views</text:h><text:h text:style-name="Head 3" text:level="3" >Form Elements in the Document Model</text:h><text:h text:style-name="Head 3" text:level="3" >Special Form Components</text:h><text:h text:style-name="Head 3" text:level="3" >Events</text:h><text:h text:style-name="Head 3" text:level="3" >Data Awareness</text:h><text:h text:style-name="Head 2" text:level="2" >Recipes</text:h><text:h text:style-name="Head 3" text:level="3" >Making it easier to work with a Form</text:h><text:h text:style-name="Head 3" text:level="3" >Controlling the Data Input</text:h><text:h text:style-name="Head 3" text:level="3" >Collecting Data automatically</text:h><text:h text:style-name="Head 3" text:level="3" >Taking Advantage of Database Server Features</text:h><text:h text:style-name="Head 3" text:level="3" >Adding new Functionality</text:h><text:h text:style-name="Head 3" text:level="3" >Handling Errors</text:h><text:h text:style-name="Head 1" text:level="1" >UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Purpose of UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Document Contents as Streams</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Content Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating, Moving and Copying Document and Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Additional Commands</text:h><text:h text:style-name="Head 2" text:level="2" >Writing a Content Provider</text:h><text:h text:style-name="Head 1" text:level="1" >[PRODUCTNAME] Configuration</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing configuration data</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Configuration Data</text:h><text:h text:style-name="Head 1" text:level="1" >Appendix</text:h></office:body> + +<office:body ><text:sequence-decls ><text:sequence-decl text:display-outline-level="0" text:name="Illustration" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Table" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Text" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Drawing" ></text:sequence-decl></text:sequence-decls><text:p text:style-name="P1" >Programmer's Manual</text:p><text:p text:style-name="P2" >Planned Outline</text:p><text:p text:style-name="P2" ></text:p><text:h text:style-name="Head 1" text:level="1" >Preface (3 Pages)</text:h><text:h text:style-name="Head 1" text:level="1" >First Steps (24 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Programming with UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Fields of Application for UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Getting Started</text:h><text:h text:style-name="Head 3" text:level="3" >Required Files</text:h><text:h text:style-name="Head 3" text:level="3" >Configuration</text:h><text:h text:style-name="Head 3" text:level="3" >First Connection</text:h><text:h text:style-name="Head 2" text:level="2" >How to get Objects in [PRODUCTNAME]</text:h><text:h text:style-name="Head 2" text:level="2" >How to work with Objects</text:h><text:p text:style-name="Paragraph" >Example</text:p><text:h text:style-name="Head 3" text:level="3" >Services</text:h><text:h text:style-name="Head 3" text:level="3" >Querying Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >ElementAccess</text:h><text:h text:style-name="Head 3" text:level="3" >Simple Types</text:h><text:h text:style-name="Head 3" text:level="3" >Strings</text:h><text:h text:style-name="Head 3" text:level="3" >Enums and Constant Groups</text:h><text:h text:style-name="Head 3" text:level="3" >Structs</text:h><text:h text:style-name="Head 3" text:level="3" >Any</text:h><text:h text:style-name="Head 3" text:level="3" >Sequence</text:h><text:h text:style-name="Head 2" text:level="2" >How to find the solution for a problem</text:h><text:h text:style-name="Head 2" text:level="2" >Finding your Way through the API Reference</text:h><text:h text:style-name="Head 2" text:level="2" >Common Mechanisms</text:h><text:h text:style-name="Head 3" text:level="3" >Text</text:h><text:h text:style-name="Head 3" text:level="3" >Table</text:h><text:h text:style-name="Head 3" text:level="3" >Drawing</text:h><text:h text:style-name="Head 1" text:level="1" >UNO in Professional Projects (<text:span text:style-name="T1" >145</text:span>)</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:p text:style-name="Paragraph" >UNO/API constituents: How UNOIDL/API, ServiceManager, Bridges, CoreReflection work together</text:p><text:h text:style-name="Head 2" text:level="2" >API Concepts</text:h><text:p text:style-name="Paragraph" >API is a language independent, abstract specification for UNO objects which are used in <text:s ></text:s>[PRODUCTNAME]</text:p><text:h text:style-name="Head 3" text:level="3" >Types in the API Reference</text:h><text:h text:style-name="Head 4" text:level="4" >Simple Types</text:h><text:h text:style-name="Head 4" text:level="4" >The Any Type</text:h><text:h text:style-name="Head 4" text:level="4" >Interfaces</text:h><text:h text:style-name="Head 4" text:level="4" >Services</text:h><text:h text:style-name="Head 4" text:level="4" >Modules</text:h><text:h text:style-name="Head 4" text:level="4" >Structs</text:h><text:h text:style-name="Head 4" text:level="4" >Constant Groups and Enums</text:h><text:h text:style-name="Head 4" text:level="4" >Sequences</text:h><text:h text:style-name="Head 4" text:level="4" >Exceptions</text:h><text:h text:style-name="Head 3" text:level="3" >API Principles</text:h><text:h text:style-name="Head 4" text:level="4" >Relationship between Specification, Implementation and Instances</text:h><text:h text:style-name="Head 4" text:level="4" >Object Composition</text:h><text:h text:style-name="Head 2" text:level="2" >UNO Concepts</text:h><text:p text:style-name="Paragraph" >UNO is an environment for networked object communication</text:p><text:h text:style-name="Head 3" text:level="3" >Interprocess Connections</text:h><text:h text:style-name="Head 3" text:level="3" >ServiceManager and ComponentContext</text:h><text:h text:style-name="Head 3" text:level="3" >Using UNO Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >Using Collections and Containers</text:h><text:h text:style-name="Head 3" text:level="3" >Event Model</text:h><text:h text:style-name="Head 3" text:level="3" >Exception Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Lifetime Control</text:h><text:h text:style-name="Head 3" text:level="3" >Object Identity</text:h><text:h text:style-name="Head 2" text:level="2" >Language Bindings</text:h><text:h text:style-name="Head 3" text:level="3" >Introduction for language binding</text:h><text:h text:style-name="Head 3" text:level="3" >Java Language Binding</text:h><text:h text:style-name="Head 3" text:level="3" >C++ Binding</text:h><text:h text:style-name="Head 3" text:level="3" >Access for [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 3" text:level="3" >Automation</text:h><text:h text:style-name="Head 1" text:level="1" >Writing UNO components</text:h><text:h text:style-name="Head 2" text:level="2" >Specifying a new Component</text:h><text:h text:style-name="Head 3" text:level="3" >UNOIDL language specification</text:h><text:h text:style-name="Head 2" text:level="2" >Implementing a Component</text:h><text:h text:style-name="Head 3" text:level="3" >Component Development Basics</text:h><text:unordered-list text:style-name="L1" ><text:list-item ><text:p text:style-name="P3" >Introduction</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >Mandatory interfaces: XInterface, XServiceInfo ((from UseInterfaces.CoreInterfaces))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >"Should be implemented" interfaces: XTypeProvider ((from UseInterfaces.CoreInterfaces ))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >optional interface: XMain for standalone execution</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Simple Component in Java</text:h><text:unordered-list text:style-name="L2" ><text:list-item ><text:p text:style-name="P4" >Getting the service manager ((Chapter Java components from unoBindingJava))</text:p></text:list-item><text:list-item ><text:p text:style-name="P4" >simple component chapter</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >C++ Component</text:h><text:h text:style-name="Head 3" text:level="3" >((Automation Component?))</text:h><text:h text:style-name="Head 2" text:level="2" >Deployment Options for Components</text:h><text:h text:style-name="Head 3" text:level="3" >Component Registration</text:h><text:h text:style-name="Head 3" text:level="3" >Service Manager Configuration</text:h><text:unordered-list text:style-name="L3" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P5" >XSet Interface</text:p><text:p text:style-name="P5" >Adding components during runtime, particularly interesting during development</text:p></text:list-item><text:list-item ><text:p text:style-name="P5" >ServiceManager Content</text:p><text:p text:style-name="P5" >Dynamically modifying the ServiceManager</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Bootstrapping the Service Manager ((from CppBind chapter))</text:h><text:unordered-list text:style-name="L4" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P6" >Simple Test Application</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >Configuring Your Application with Bootstrap Parameters</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >The UNO Executable</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Standalone Runtime Environment</text:h><text:p text:style-name="Paragraph" ><text:tab-stop ></text:tab-stop>The UNO executable and XMain</text:p><text:h text:style-name="Head 3" text:level="3" >Configuring the Java Runtime Environment</text:h><text:unordered-list text:style-name="L5" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P7" >The office and Java ((from UnoBindingJava))</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 1" text:level="1" >Advanced UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Design Patterns</text:h><text:h text:style-name="Head 2" text:level="2" >Bridging concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Requirements for Language Bindings and Bridges</text:h><text:h text:style-name="Head 3" text:level="3" >New Scripting Engines</text:h><text:h text:style-name="Head 2" text:level="2" >ServiceManager and loader</text:h><text:h text:style-name="Head 2" text:level="2" >Special Interfaces for internal use</text:h><text:p text:style-name="Paragraph" >XUNOTunnel</text:p><text:p text:style-name="Paragraph" >XAggregation</text:p><text:h text:style-name="Head 2" text:level="2" >UNO Reflection API</text:h><text:h text:style-name="Head 2" text:level="2" >TypeLibrary and TypeProviders</text:h><text:h text:style-name="Head 2" text:level="2" >Differences from Corba</text:h><text:h text:style-name="Head 1" text:level="1" >Office Development</text:h><text:h text:style-name="Head 2" text:level="2" >Global Object Structure</text:h><text:h text:style-name="Head 3" text:level="3" >Desktop Environment</text:h><text:h text:style-name="Head 3" text:level="3" >Frames and Frame Hierarchies</text:h><text:h text:style-name="Head 3" text:level="3" >Frame-Controller-Model Paradigm</text:h><text:h text:style-name="Head 3" text:level="3" >Loading and Saving Office Components</text:h><text:h text:style-name="Head 3" text:level="3" >Dispatch Framework</text:h><text:h text:style-name="Head 2" text:level="2" >Common Features</text:h><text:h text:style-name="Head 3" text:level="3" >Common Dialogs</text:h><text:h text:style-name="Head 3" text:level="3" >DocumentInfo</text:h><text:h text:style-name="Head 3" text:level="3" >Styles</text:h><text:h text:style-name="Head 3" text:level="3" >Search and Replace</text:h><text:h text:style-name="Head 3" text:level="3" >Number Formats</text:h><text:h text:style-name="Head 3" text:level="3" >Package File Formats</text:h><text:h text:style-name="Head 2" text:level="2" >Internationalization</text:h><text:h text:style-name="Head 2" text:level="2" >Linguistic</text:h><text:h text:style-name="Head 2" text:level="2" >System Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Clipboard</text:h><text:h text:style-name="Head 3" text:level="3" >File Picker</text:h><text:h text:style-name="Head 3" text:level="3" >Bridging to the Window System</text:h><text:p text:style-name="Paragraph" ></text:p><text:h text:style-name="Head 1" text:level="1" >Text Documents (51,5 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Text Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Text Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Using Text</text:h><text:h text:style-name="Head 3" text:level="3" >Tables</text:h><text:h text:style-name="Head 3" text:level="3" >Text Fields</text:h><text:h text:style-name="Head 3" text:level="3" >Bookmarks</text:h><text:h text:style-name="Head 3" text:level="3" >Indexes and Index Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Reference Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Footnotes and Endnotes</text:h><text:h text:style-name="Head 3" text:level="3" >Shape Objects in Text</text:h><text:h text:style-name="Head 3" text:level="3" >Redline</text:h><text:h text:style-name="Head 3" text:level="3" >Ruby</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Text Document</text:h><text:h text:style-name="Head 1" text:level="1" >Spreadsheet Documents</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Spreadsheet Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Spreadsheet Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Editing Spreadsheets</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Spreadsheet Document</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Spreadsheet Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Drawings and Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Draw/Impress Files</text:h><text:h text:style-name="Head 3" text:level="3" >Saving</text:h><text:h text:style-name="Head 3" text:level="3" >Printing</text:h><text:h text:style-name="Head 3" text:level="3" >Running Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Working with a Draw/Impress Document</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Draw/Impress Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Draw/Impress Document</text:h><text:h text:style-name="Head 1" text:level="1" >Charts</text:h><text:h text:style-name="Head 2" text:level="2" >Chart Basics</text:h><text:h text:style-name="Head 2" text:level="2" >Creating a Chart Document</text:h><text:h text:style-name="Head 2" text:level="2" >Editing a Chart Document</text:h><text:h text:style-name="Head 3" text:level="3" >Common Diagram API</text:h><text:h text:style-name="Head 3" text:level="3" >Different Chart Types</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Chart Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Basic and Dialogs</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:h text:style-name="Head 2" text:level="2" >Library Organization</text:h><text:h text:style-name="Head 2" text:level="2" >IDE with Dialogs and Events</text:h><text:h text:style-name="Head 2" text:level="2" >Using [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 2" text:level="2" >Toolkit Controls and their Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating Dialogs at Runtime</text:h><text:h text:style-name="Head 1" text:level="1" >Database Access</text:h><text:h text:style-name="Head 2" text:level="2" >Features of the [PRODUCTNAME] Database Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Capabilities</text:h><text:h text:style-name="Head 3" text:level="3" >SDBC, SDBCX, SDB Architecture</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Datasources with [PRODUCTNAME]</text:h><text:h text:style-name="Head 3" text:level="3" >DataSources</text:h><text:h text:style-name="Head 3" text:level="3" >Adding and Editing Datasources </text:h><text:h text:style-name="Head 3" text:level="3" >Establishing a Connection</text:h><text:h text:style-name="Head 4" text:level="4" >Getting Connections</text:h><text:h text:style-name="Head 4" text:level="4" >Driver specifics</text:h><text:h text:style-name="Head 3" text:level="3" >Connection Pooling</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Saved Queries</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Data</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Statements</text:h><text:h text:style-name="Head 3" text:level="3" >Resultsets</text:h><text:h text:style-name="Head 3" text:level="3" >Metadata</text:h><text:h text:style-name="Head 3" text:level="3" >Rowsets</text:h><text:h text:style-name="Head 2" text:level="2" >Working with the Database Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using DDL to change the DB Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using SDBCX to access the DB Design</text:h><text:h text:style-name="Head 2" text:level="2" >Using DBMS Features</text:h><text:h text:style-name="Head 3" text:level="3" >Stored Procedures</text:h><text:h text:style-name="Head 3" text:level="3" >Transaction Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Prepared Statements</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Database Drivers</text:h><text:h text:style-name="Head 1" text:level="1" >Forms</text:h><text:h text:style-name="Head 2" text:level="2" >Concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Models and Views</text:h><text:h text:style-name="Head 3" text:level="3" >Form Elements in the Document Model</text:h><text:h text:style-name="Head 3" text:level="3" >Special Form Components</text:h><text:h text:style-name="Head 3" text:level="3" >Events</text:h><text:h text:style-name="Head 3" text:level="3" >Data Awareness</text:h><text:h text:style-name="Head 2" text:level="2" >Recipes</text:h><text:h text:style-name="Head 3" text:level="3" >Making it easier to work with a Form</text:h><text:h text:style-name="Head 3" text:level="3" >Controlling the Data Input</text:h><text:h text:style-name="Head 3" text:level="3" >Collecting Data automatically</text:h><text:h text:style-name="Head 3" text:level="3" >Taking Advantage of Database Server Features</text:h><text:h text:style-name="Head 3" text:level="3" >Adding new Functionality</text:h><text:h text:style-name="Head 3" text:level="3" >Handling Errors</text:h><text:h text:style-name="Head 1" text:level="1" >UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Purpose of UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Document Contents as Streams</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Content Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating, Moving and Copying Document and Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Additional Commands</text:h><text:h text:style-name="Head 2" text:level="2" >Writing a Content Provider</text:h><text:h text:style-name="Head 1" text:level="1" >[PRODUCTNAME] Configuration</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing configuration data</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Configuration Data</text:h><text:h text:style-name="Head 1" text:level="1" >Appendix</text:h></office:body> + +<office:body ><text:sequence-decls ><text:sequence-decl text:display-outline-level="0" text:name="Illustration" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Table" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Text" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Drawing" ></text:sequence-decl></text:sequence-decls><text:p text:style-name="P1" >Programmer's Manual</text:p><text:p text:style-name="P2" >Planned Outline</text:p><text:p text:style-name="P2" ></text:p><text:h text:style-name="Head 1" text:level="1" >Preface (3 Pages)</text:h><text:h text:style-name="Head 1" text:level="1" >First Steps (24 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Programming with UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Fields of Application for UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Getting Started</text:h><text:h text:style-name="Head 3" text:level="3" >Required Files</text:h><text:h text:style-name="Head 3" text:level="3" >Configuration</text:h><text:h text:style-name="Head 3" text:level="3" >First Connection</text:h><text:h text:style-name="Head 2" text:level="2" >How to get Objects in [PRODUCTNAME]</text:h><text:h text:style-name="Head 2" text:level="2" >How to work with Objects</text:h><text:p text:style-name="Paragraph" >Example</text:p><text:h text:style-name="Head 3" text:level="3" >Services</text:h><text:h text:style-name="Head 3" text:level="3" >Querying Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >ElementAccess</text:h><text:h text:style-name="Head 3" text:level="3" >Simple Types</text:h><text:h text:style-name="Head 3" text:level="3" >Strings</text:h><text:h text:style-name="Head 3" text:level="3" >Enums and Constant Groups</text:h><text:h text:style-name="Head 3" text:level="3" >Structs</text:h><text:h text:style-name="Head 3" text:level="3" >Any</text:h><text:h text:style-name="Head 3" text:level="3" >Sequence</text:h><text:h text:style-name="Head 2" text:level="2" >How to find the solution for a problem</text:h><text:h text:style-name="Head 2" text:level="2" >Finding your Way through the API Reference</text:h><text:h text:style-name="Head 2" text:level="2" >Common Mechanisms</text:h><text:h text:style-name="Head 3" text:level="3" >Text</text:h><text:h text:style-name="Head 3" text:level="3" >Table</text:h><text:h text:style-name="Head 3" text:level="3" >Drawing</text:h><text:h text:style-name="Head 1" text:level="1" >UNO in Professional Projects (<text:span text:style-name="T1" >145</text:span>)</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:p text:style-name="Paragraph" >UNO/API constituents: How UNOIDL/API, ServiceManager, Bridges, CoreReflection work together</text:p><text:h text:style-name="Head 2" text:level="2" >API Concepts</text:h><text:p text:style-name="Paragraph" >API is a language independent, abstract specification for UNO objects which are used in <text:s ></text:s>[PRODUCTNAME]</text:p><text:h text:style-name="Head 3" text:level="3" >Types in the API Reference</text:h><text:h text:style-name="Head 4" text:level="4" >Simple Types</text:h><text:h text:style-name="Head 4" text:level="4" >The Any Type</text:h><text:h text:style-name="Head 4" text:level="4" >Interfaces</text:h><text:h text:style-name="Head 4" text:level="4" >Services</text:h><text:h text:style-name="Head 4" text:level="4" >Modules</text:h><text:h text:style-name="Head 4" text:level="4" >Structs</text:h><text:h text:style-name="Head 4" text:level="4" >Constant Groups and Enums</text:h><text:h text:style-name="Head 4" text:level="4" >Sequences</text:h><text:h text:style-name="Head 4" text:level="4" >Exceptions</text:h><text:h text:style-name="Head 3" text:level="3" >API Principles</text:h><text:h text:style-name="Head 4" text:level="4" >Relationship between Specification, Implementation and Instances</text:h><text:h text:style-name="Head 4" text:level="4" >Object Composition</text:h><text:h text:style-name="Head 2" text:level="2" >UNO Concepts</text:h><text:p text:style-name="Paragraph" >UNO is an environment for networked object communication</text:p><text:h text:style-name="Head 3" text:level="3" >Interprocess Connections</text:h><text:h text:style-name="Head 3" text:level="3" >ServiceManager and ComponentContext</text:h><text:h text:style-name="Head 3" text:level="3" >Using UNO Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >Using Collections and Containers</text:h><text:h text:style-name="Head 3" text:level="3" >Event Model</text:h><text:h text:style-name="Head 3" text:level="3" >Exception Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Lifetime Control</text:h><text:h text:style-name="Head 3" text:level="3" >Object Identity</text:h><text:h text:style-name="Head 2" text:level="2" >Language Bindings</text:h><text:h text:style-name="Head 3" text:level="3" >Introduction for language binding</text:h><text:h text:style-name="Head 3" text:level="3" >Java Language Binding</text:h><text:h text:style-name="Head 3" text:level="3" >C++ Binding</text:h><text:h text:style-name="Head 3" text:level="3" >Access for [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 3" text:level="3" >Automation</text:h><text:h text:style-name="Head 1" text:level="1" >Writing UNO components</text:h><text:h text:style-name="Head 2" text:level="2" >Specifying a new Component</text:h><text:h text:style-name="Head 3" text:level="3" >UNOIDL language specification</text:h><text:h text:style-name="Head 2" text:level="2" >Implementing a Component</text:h><text:h text:style-name="Head 3" text:level="3" >Component Development Basics</text:h><text:unordered-list text:style-name="L1" ><text:list-item ><text:p text:style-name="P3" >Introduction</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >Mandatory interfaces: XInterface, XServiceInfo ((from UseInterfaces.CoreInterfaces))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >"Should be implemented" interfaces: XTypeProvider ((from UseInterfaces.CoreInterfaces ))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >optional interface: XMain for standalone execution</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Simple Component in Java</text:h><text:unordered-list text:style-name="L2" ><text:list-item ><text:p text:style-name="P4" >Getting the service manager ((Chapter Java components from unoBindingJava))</text:p></text:list-item><text:list-item ><text:p text:style-name="P4" >simple component chapter</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >C++ Component</text:h><text:h text:style-name="Head 3" text:level="3" >((Automation Component?))</text:h><text:h text:style-name="Head 2" text:level="2" >Deployment Options for Components</text:h><text:h text:style-name="Head 3" text:level="3" >Component Registration</text:h><text:h text:style-name="Head 3" text:level="3" >Service Manager Configuration</text:h><text:unordered-list text:style-name="L3" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P5" >XSet Interface</text:p><text:p text:style-name="P5" >Adding components during runtime, particularly interesting during development</text:p></text:list-item><text:list-item ><text:p text:style-name="P5" >ServiceManager Content</text:p><text:p text:style-name="P5" >Dynamically modifying the ServiceManager</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Bootstrapping the Service Manager ((from CppBind chapter))</text:h><text:unordered-list text:style-name="L4" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P6" >Simple Test Application</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >Configuring Your Application with Bootstrap Parameters</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >The UNO Executable</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Standalone Runtime Environment</text:h><text:p text:style-name="Paragraph" ><text:tab-stop ></text:tab-stop>The UNO executable and XMain</text:p><text:h text:style-name="Head 3" text:level="3" >Configuring the Java Runtime Environment</text:h><text:unordered-list text:style-name="L5" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P7" >The office and Java ((from UnoBindingJava))</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 1" text:level="1" >Advanced UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Design Patterns</text:h><text:h text:style-name="Head 2" text:level="2" >Bridging concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Requirements for Language Bindings and Bridges</text:h><text:h text:style-name="Head 3" text:level="3" >New Scripting Engines</text:h><text:h text:style-name="Head 2" text:level="2" >ServiceManager and loader</text:h><text:h text:style-name="Head 2" text:level="2" >Special Interfaces for internal use</text:h><text:p text:style-name="Paragraph" >XUNOTunnel</text:p><text:p text:style-name="Paragraph" >XAggregation</text:p><text:h text:style-name="Head 2" text:level="2" >UNO Reflection API</text:h><text:h text:style-name="Head 2" text:level="2" >TypeLibrary and TypeProviders</text:h><text:h text:style-name="Head 2" text:level="2" >Differences from Corba</text:h><text:h text:style-name="Head 1" text:level="1" >Office Development</text:h><text:h text:style-name="Head 2" text:level="2" >Global Object Structure</text:h><text:h text:style-name="Head 3" text:level="3" >Desktop Environment</text:h><text:h text:style-name="Head 3" text:level="3" >Frames and Frame Hierarchies</text:h><text:h text:style-name="Head 3" text:level="3" >Frame-Controller-Model Paradigm</text:h><text:h text:style-name="Head 3" text:level="3" >Loading and Saving Office Components</text:h><text:h text:style-name="Head 3" text:level="3" >Dispatch Framework</text:h><text:h text:style-name="Head 2" text:level="2" >Common Features</text:h><text:h text:style-name="Head 3" text:level="3" >Common Dialogs</text:h><text:h text:style-name="Head 3" text:level="3" >DocumentInfo</text:h><text:h text:style-name="Head 3" text:level="3" >Styles</text:h><text:h text:style-name="Head 3" text:level="3" >Search and Replace</text:h><text:h text:style-name="Head 3" text:level="3" >Number Formats</text:h><text:h text:style-name="Head 3" text:level="3" >Package File Formats</text:h><text:h text:style-name="Head 2" text:level="2" >Internationalization</text:h><text:h text:style-name="Head 2" text:level="2" >Linguistic</text:h><text:h text:style-name="Head 2" text:level="2" >System Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Clipboard</text:h><text:h text:style-name="Head 3" text:level="3" >File Picker</text:h><text:h text:style-name="Head 3" text:level="3" >Bridging to the Window System</text:h><text:p text:style-name="Paragraph" ></text:p><text:h text:style-name="Head 1" text:level="1" >Text Documents (51,5 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Text Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Text Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Using Text</text:h><text:h text:style-name="Head 3" text:level="3" >Tables</text:h><text:h text:style-name="Head 3" text:level="3" >Text Fields</text:h><text:h text:style-name="Head 3" text:level="3" >Bookmarks</text:h><text:h text:style-name="Head 3" text:level="3" >Indexes and Index Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Reference Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Footnotes and Endnotes</text:h><text:h text:style-name="Head 3" text:level="3" >Shape Objects in Text</text:h><text:h text:style-name="Head 3" text:level="3" >Redline</text:h><text:h text:style-name="Head 3" text:level="3" >Ruby</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Text Document</text:h><text:h text:style-name="Head 1" text:level="1" >Spreadsheet Documents</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Spreadsheet Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Spreadsheet Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Editing Spreadsheets</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Spreadsheet Document</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Spreadsheet Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Drawings and Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Draw/Impress Files</text:h><text:h text:style-name="Head 3" text:level="3" >Saving</text:h><text:h text:style-name="Head 3" text:level="3" >Printing</text:h><text:h text:style-name="Head 3" text:level="3" >Running Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Working with a Draw/Impress Document</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Draw/Impress Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Draw/Impress Document</text:h><text:h text:style-name="Head 1" text:level="1" >Charts</text:h><text:h text:style-name="Head 2" text:level="2" >Chart Basics</text:h><text:h text:style-name="Head 2" text:level="2" >Creating a Chart Document</text:h><text:h text:style-name="Head 2" text:level="2" >Editing a Chart Document</text:h><text:h text:style-name="Head 3" text:level="3" >Common Diagram API</text:h><text:h text:style-name="Head 3" text:level="3" >Different Chart Types</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Chart Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Basic and Dialogs</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:h text:style-name="Head 2" text:level="2" >Library Organization</text:h><text:h text:style-name="Head 2" text:level="2" >IDE with Dialogs and Events</text:h><text:h text:style-name="Head 2" text:level="2" >Using [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 2" text:level="2" >Toolkit Controls and their Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating Dialogs at Runtime</text:h><text:h text:style-name="Head 1" text:level="1" >Database Access</text:h><text:h text:style-name="Head 2" text:level="2" >Features of the [PRODUCTNAME] Database Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Capabilities</text:h><text:h text:style-name="Head 3" text:level="3" >SDBC, SDBCX, SDB Architecture</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Datasources with [PRODUCTNAME]</text:h><text:h text:style-name="Head 3" text:level="3" >DataSources</text:h><text:h text:style-name="Head 3" text:level="3" >Adding and Editing Datasources </text:h><text:h text:style-name="Head 3" text:level="3" >Establishing a Connection</text:h><text:h text:style-name="Head 4" text:level="4" >Getting Connections</text:h><text:h text:style-name="Head 4" text:level="4" >Driver specifics</text:h><text:h text:style-name="Head 3" text:level="3" >Connection Pooling</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Saved Queries</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Data</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Statements</text:h><text:h text:style-name="Head 3" text:level="3" >Resultsets</text:h><text:h text:style-name="Head 3" text:level="3" >Metadata</text:h><text:h text:style-name="Head 3" text:level="3" >Rowsets</text:h><text:h text:style-name="Head 2" text:level="2" >Working with the Database Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using DDL to change the DB Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using SDBCX to access the DB Design</text:h><text:h text:style-name="Head 2" text:level="2" >Using DBMS Features</text:h><text:h text:style-name="Head 3" text:level="3" >Stored Procedures</text:h><text:h text:style-name="Head 3" text:level="3" >Transaction Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Prepared Statements</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Database Drivers</text:h><text:h text:style-name="Head 1" text:level="1" >Forms</text:h><text:h text:style-name="Head 2" text:level="2" >Concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Models and Views</text:h><text:h text:style-name="Head 3" text:level="3" >Form Elements in the Document Model</text:h><text:h text:style-name="Head 3" text:level="3" >Special Form Components</text:h><text:h text:style-name="Head 3" text:level="3" >Events</text:h><text:h text:style-name="Head 3" text:level="3" >Data Awareness</text:h><text:h text:style-name="Head 2" text:level="2" >Recipes</text:h><text:h text:style-name="Head 3" text:level="3" >Making it easier to work with a Form</text:h><text:h text:style-name="Head 3" text:level="3" >Controlling the Data Input</text:h><text:h text:style-name="Head 3" text:level="3" >Collecting Data automatically</text:h><text:h text:style-name="Head 3" text:level="3" >Taking Advantage of Database Server Features</text:h><text:h text:style-name="Head 3" text:level="3" >Adding new Functionality</text:h><text:h text:style-name="Head 3" text:level="3" >Handling Errors</text:h><text:h text:style-name="Head 1" text:level="1" >UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Purpose of UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Document Contents as Streams</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Content Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating, Moving and Copying Document and Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Additional Commands</text:h><text:h text:style-name="Head 2" text:level="2" >Writing a Content Provider</text:h><text:h text:style-name="Head 1" text:level="1" >[PRODUCTNAME] Configuration</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing configuration data</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Configuration Data</text:h><text:h text:style-name="Head 1" text:level="1" >Appendix</text:h></office:body> + +<office:body ><text:sequence-decls ><text:sequence-decl text:display-outline-level="0" text:name="Illustration" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Table" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Text" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Drawing" ></text:sequence-decl></text:sequence-decls><text:p text:style-name="P1" >Programmer's Manual</text:p><text:p text:style-name="P2" >Planned Outline</text:p><text:p text:style-name="P2" ></text:p><text:h text:style-name="Head 1" text:level="1" >Preface (3 Pages)</text:h><text:h text:style-name="Head 1" text:level="1" >First Steps (24 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Programming with UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Fields of Application for UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Getting Started</text:h><text:h text:style-name="Head 3" text:level="3" >Required Files</text:h><text:h text:style-name="Head 3" text:level="3" >Configuration</text:h><text:h text:style-name="Head 3" text:level="3" >First Connection</text:h><text:h text:style-name="Head 2" text:level="2" >How to get Objects in [PRODUCTNAME]</text:h><text:h text:style-name="Head 2" text:level="2" >How to work with Objects</text:h><text:p text:style-name="Paragraph" >Example</text:p><text:h text:style-name="Head 3" text:level="3" >Services</text:h><text:h text:style-name="Head 3" text:level="3" >Querying Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >ElementAccess</text:h><text:h text:style-name="Head 3" text:level="3" >Simple Types</text:h><text:h text:style-name="Head 3" text:level="3" >Strings</text:h><text:h text:style-name="Head 3" text:level="3" >Enums and Constant Groups</text:h><text:h text:style-name="Head 3" text:level="3" >Structs</text:h><text:h text:style-name="Head 3" text:level="3" >Any</text:h><text:h text:style-name="Head 3" text:level="3" >Sequence</text:h><text:h text:style-name="Head 2" text:level="2" >How to find the solution for a problem</text:h><text:h text:style-name="Head 2" text:level="2" >Finding your Way through the API Reference</text:h><text:h text:style-name="Head 2" text:level="2" >Common Mechanisms</text:h><text:h text:style-name="Head 3" text:level="3" >Text</text:h><text:h text:style-name="Head 3" text:level="3" >Table</text:h><text:h text:style-name="Head 3" text:level="3" >Drawing</text:h><text:h text:style-name="Head 1" text:level="1" >UNO in Professional Projects (<text:span text:style-name="T1" >145</text:span>)</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:p text:style-name="Paragraph" >UNO/API constituents: How UNOIDL/API, ServiceManager, Bridges, CoreReflection work together</text:p><text:h text:style-name="Head 2" text:level="2" >API Concepts</text:h><text:p text:style-name="Paragraph" >API is a language independent, abstract specification for UNO objects which are used in <text:s ></text:s>[PRODUCTNAME]</text:p><text:h text:style-name="Head 3" text:level="3" >Types in the API Reference</text:h><text:h text:style-name="Head 4" text:level="4" >Simple Types</text:h><text:h text:style-name="Head 4" text:level="4" >The Any Type</text:h><text:h text:style-name="Head 4" text:level="4" >Interfaces</text:h><text:h text:style-name="Head 4" text:level="4" >Services</text:h><text:h text:style-name="Head 4" text:level="4" >Modules</text:h><text:h text:style-name="Head 4" text:level="4" >Structs</text:h><text:h text:style-name="Head 4" text:level="4" >Constant Groups and Enums</text:h><text:h text:style-name="Head 4" text:level="4" >Sequences</text:h><text:h text:style-name="Head 4" text:level="4" >Exceptions</text:h><text:h text:style-name="Head 3" text:level="3" >API Principles</text:h><text:h text:style-name="Head 4" text:level="4" >Relationship between Specification, Implementation and Instances</text:h><text:h text:style-name="Head 4" text:level="4" >Object Composition</text:h><text:h text:style-name="Head 2" text:level="2" >UNO Concepts</text:h><text:p text:style-name="Paragraph" >UNO is an environment for networked object communication</text:p><text:h text:style-name="Head 3" text:level="3" >Interprocess Connections</text:h><text:h text:style-name="Head 3" text:level="3" >ServiceManager and ComponentContext</text:h><text:h text:style-name="Head 3" text:level="3" >Using UNO Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >Using Collections and Containers</text:h><text:h text:style-name="Head 3" text:level="3" >Event Model</text:h><text:h text:style-name="Head 3" text:level="3" >Exception Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Lifetime Control</text:h><text:h text:style-name="Head 3" text:level="3" >Object Identity</text:h><text:h text:style-name="Head 2" text:level="2" >Language Bindings</text:h><text:h text:style-name="Head 3" text:level="3" >Introduction for language binding</text:h><text:h text:style-name="Head 3" text:level="3" >Java Language Binding</text:h><text:h text:style-name="Head 3" text:level="3" >C++ Binding</text:h><text:h text:style-name="Head 3" text:level="3" >Access for [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 3" text:level="3" >Automation</text:h><text:h text:style-name="Head 1" text:level="1" >Writing UNO components</text:h><text:h text:style-name="Head 2" text:level="2" >Specifying a new Component</text:h><text:h text:style-name="Head 3" text:level="3" >UNOIDL language specification</text:h><text:h text:style-name="Head 2" text:level="2" >Implementing a Component</text:h><text:h text:style-name="Head 3" text:level="3" >Component Development Basics</text:h><text:unordered-list text:style-name="L1" ><text:list-item ><text:p text:style-name="P3" >Introduction</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >Mandatory interfaces: XInterface, XServiceInfo ((from UseInterfaces.CoreInterfaces))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >"Should be implemented" interfaces: XTypeProvider ((from UseInterfaces.CoreInterfaces ))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >optional interface: XMain for standalone execution</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Simple Component in Java</text:h><text:unordered-list text:style-name="L2" ><text:list-item ><text:p text:style-name="P4" >Getting the service manager ((Chapter Java components from unoBindingJava))</text:p></text:list-item><text:list-item ><text:p text:style-name="P4" >simple component chapter</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >C++ Component</text:h><text:h text:style-name="Head 3" text:level="3" >((Automation Component?))</text:h><text:h text:style-name="Head 2" text:level="2" >Deployment Options for Components</text:h><text:h text:style-name="Head 3" text:level="3" >Component Registration</text:h><text:h text:style-name="Head 3" text:level="3" >Service Manager Configuration</text:h><text:unordered-list text:style-name="L3" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P5" >XSet Interface</text:p><text:p text:style-name="P5" >Adding components during runtime, particularly interesting during development</text:p></text:list-item><text:list-item ><text:p text:style-name="P5" >ServiceManager Content</text:p><text:p text:style-name="P5" >Dynamically modifying the ServiceManager</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Bootstrapping the Service Manager ((from CppBind chapter))</text:h><text:unordered-list text:style-name="L4" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P6" >Simple Test Application</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >Configuring Your Application with Bootstrap Parameters</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >The UNO Executable</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Standalone Runtime Environment</text:h><text:p text:style-name="Paragraph" ><text:tab-stop ></text:tab-stop>The UNO executable and XMain</text:p><text:h text:style-name="Head 3" text:level="3" >Configuring the Java Runtime Environment</text:h><text:unordered-list text:style-name="L5" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P7" >The office and Java ((from UnoBindingJava))</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 1" text:level="1" >Advanced UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Design Patterns</text:h><text:h text:style-name="Head 2" text:level="2" >Bridging concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Requirements for Language Bindings and Bridges</text:h><text:h text:style-name="Head 3" text:level="3" >New Scripting Engines</text:h><text:h text:style-name="Head 2" text:level="2" >ServiceManager and loader</text:h><text:h text:style-name="Head 2" text:level="2" >Special Interfaces for internal use</text:h><text:p text:style-name="Paragraph" >XUNOTunnel</text:p><text:p text:style-name="Paragraph" >XAggregation</text:p><text:h text:style-name="Head 2" text:level="2" >UNO Reflection API</text:h><text:h text:style-name="Head 2" text:level="2" >TypeLibrary and TypeProviders</text:h><text:h text:style-name="Head 2" text:level="2" >Differences from Corba</text:h><text:h text:style-name="Head 1" text:level="1" >Office Development</text:h><text:h text:style-name="Head 2" text:level="2" >Global Object Structure</text:h><text:h text:style-name="Head 3" text:level="3" >Desktop Environment</text:h><text:h text:style-name="Head 3" text:level="3" >Frames and Frame Hierarchies</text:h><text:h text:style-name="Head 3" text:level="3" >Frame-Controller-Model Paradigm</text:h><text:h text:style-name="Head 3" text:level="3" >Loading and Saving Office Components</text:h><text:h text:style-name="Head 3" text:level="3" >Dispatch Framework</text:h><text:h text:style-name="Head 2" text:level="2" >Common Features</text:h><text:h text:style-name="Head 3" text:level="3" >Common Dialogs</text:h><text:h text:style-name="Head 3" text:level="3" >DocumentInfo</text:h><text:h text:style-name="Head 3" text:level="3" >Styles</text:h><text:h text:style-name="Head 3" text:level="3" >Search and Replace</text:h><text:h text:style-name="Head 3" text:level="3" >Number Formats</text:h><text:h text:style-name="Head 3" text:level="3" >Package File Formats</text:h><text:h text:style-name="Head 2" text:level="2" >Internationalization</text:h><text:h text:style-name="Head 2" text:level="2" >Linguistic</text:h><text:h text:style-name="Head 2" text:level="2" >System Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Clipboard</text:h><text:h text:style-name="Head 3" text:level="3" >File Picker</text:h><text:h text:style-name="Head 3" text:level="3" >Bridging to the Window System</text:h><text:p text:style-name="Paragraph" ></text:p><text:h text:style-name="Head 1" text:level="1" >Text Documents (51,5 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Text Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Text Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Using Text</text:h><text:h text:style-name="Head 3" text:level="3" >Tables</text:h><text:h text:style-name="Head 3" text:level="3" >Text Fields</text:h><text:h text:style-name="Head 3" text:level="3" >Bookmarks</text:h><text:h text:style-name="Head 3" text:level="3" >Indexes and Index Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Reference Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Footnotes and Endnotes</text:h><text:h text:style-name="Head 3" text:level="3" >Shape Objects in Text</text:h><text:h text:style-name="Head 3" text:level="3" >Redline</text:h><text:h text:style-name="Head 3" text:level="3" >Ruby</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Text Document</text:h><text:h text:style-name="Head 1" text:level="1" >Spreadsheet Documents</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Spreadsheet Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Spreadsheet Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Editing Spreadsheets</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Spreadsheet Document</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Spreadsheet Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Drawings and Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Draw/Impress Files</text:h><text:h text:style-name="Head 3" text:level="3" >Saving</text:h><text:h text:style-name="Head 3" text:level="3" >Printing</text:h><text:h text:style-name="Head 3" text:level="3" >Running Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Working with a Draw/Impress Document</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Draw/Impress Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Draw/Impress Document</text:h><text:h text:style-name="Head 1" text:level="1" >Charts</text:h><text:h text:style-name="Head 2" text:level="2" >Chart Basics</text:h><text:h text:style-name="Head 2" text:level="2" >Creating a Chart Document</text:h><text:h text:style-name="Head 2" text:level="2" >Editing a Chart Document</text:h><text:h text:style-name="Head 3" text:level="3" >Common Diagram API</text:h><text:h text:style-name="Head 3" text:level="3" >Different Chart Types</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Chart Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Basic and Dialogs</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:h text:style-name="Head 2" text:level="2" >Library Organization</text:h><text:h text:style-name="Head 2" text:level="2" >IDE with Dialogs and Events</text:h><text:h text:style-name="Head 2" text:level="2" >Using [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 2" text:level="2" >Toolkit Controls and their Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating Dialogs at Runtime</text:h><text:h text:style-name="Head 1" text:level="1" >Database Access</text:h><text:h text:style-name="Head 2" text:level="2" >Features of the [PRODUCTNAME] Database Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Capabilities</text:h><text:h text:style-name="Head 3" text:level="3" >SDBC, SDBCX, SDB Architecture</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Datasources with [PRODUCTNAME]</text:h><text:h text:style-name="Head 3" text:level="3" >DataSources</text:h><text:h text:style-name="Head 3" text:level="3" >Adding and Editing Datasources </text:h><text:h text:style-name="Head 3" text:level="3" >Establishing a Connection</text:h><text:h text:style-name="Head 4" text:level="4" >Getting Connections</text:h><text:h text:style-name="Head 4" text:level="4" >Driver specifics</text:h><text:h text:style-name="Head 3" text:level="3" >Connection Pooling</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Saved Queries</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Data</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Statements</text:h><text:h text:style-name="Head 3" text:level="3" >Resultsets</text:h><text:h text:style-name="Head 3" text:level="3" >Metadata</text:h><text:h text:style-name="Head 3" text:level="3" >Rowsets</text:h><text:h text:style-name="Head 2" text:level="2" >Working with the Database Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using DDL to change the DB Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using SDBCX to access the DB Design</text:h><text:h text:style-name="Head 2" text:level="2" >Using DBMS Features</text:h><text:h text:style-name="Head 3" text:level="3" >Stored Procedures</text:h><text:h text:style-name="Head 3" text:level="3" >Transaction Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Prepared Statements</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Database Drivers</text:h><text:h text:style-name="Head 1" text:level="1" >Forms</text:h><text:h text:style-name="Head 2" text:level="2" >Concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Models and Views</text:h><text:h text:style-name="Head 3" text:level="3" >Form Elements in the Document Model</text:h><text:h text:style-name="Head 3" text:level="3" >Special Form Components</text:h><text:h text:style-name="Head 3" text:level="3" >Events</text:h><text:h text:style-name="Head 3" text:level="3" >Data Awareness</text:h><text:h text:style-name="Head 2" text:level="2" >Recipes</text:h><text:h text:style-name="Head 3" text:level="3" >Making it easier to work with a Form</text:h><text:h text:style-name="Head 3" text:level="3" >Controlling the Data Input</text:h><text:h text:style-name="Head 3" text:level="3" >Collecting Data automatically</text:h><text:h text:style-name="Head 3" text:level="3" >Taking Advantage of Database Server Features</text:h><text:h text:style-name="Head 3" text:level="3" >Adding new Functionality</text:h><text:h text:style-name="Head 3" text:level="3" >Handling Errors</text:h><text:h text:style-name="Head 1" text:level="1" >UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Purpose of UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Document Contents as Streams</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Content Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating, Moving and Copying Document and Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Additional Commands</text:h><text:h text:style-name="Head 2" text:level="2" >Writing a Content Provider</text:h><text:h text:style-name="Head 1" text:level="1" >[PRODUCTNAME] Configuration</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing configuration data</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Configuration Data</text:h><text:h text:style-name="Head 1" text:level="1" >Appendix</text:h></office:body> + +<office:body ><text:sequence-decls ><text:sequence-decl text:display-outline-level="0" text:name="Illustration" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Table" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Text" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Drawing" ></text:sequence-decl></text:sequence-decls><text:p text:style-name="P1" >Programmer's Manual</text:p><text:p text:style-name="P2" >Planned Outline</text:p><text:p text:style-name="P2" ></text:p><text:h text:style-name="Head 1" text:level="1" >Preface (3 Pages)</text:h><text:h text:style-name="Head 1" text:level="1" >First Steps (24 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Programming with UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Fields of Application for UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Getting Started</text:h><text:h text:style-name="Head 3" text:level="3" >Required Files</text:h><text:h text:style-name="Head 3" text:level="3" >Configuration</text:h><text:h text:style-name="Head 3" text:level="3" >First Connection</text:h><text:h text:style-name="Head 2" text:level="2" >How to get Objects in [PRODUCTNAME]</text:h><text:h text:style-name="Head 2" text:level="2" >How to work with Objects</text:h><text:p text:style-name="Paragraph" >Example</text:p><text:h text:style-name="Head 3" text:level="3" >Services</text:h><text:h text:style-name="Head 3" text:level="3" >Querying Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >ElementAccess</text:h><text:h text:style-name="Head 3" text:level="3" >Simple Types</text:h><text:h text:style-name="Head 3" text:level="3" >Strings</text:h><text:h text:style-name="Head 3" text:level="3" >Enums and Constant Groups</text:h><text:h text:style-name="Head 3" text:level="3" >Structs</text:h><text:h text:style-name="Head 3" text:level="3" >Any</text:h><text:h text:style-name="Head 3" text:level="3" >Sequence</text:h><text:h text:style-name="Head 2" text:level="2" >How to find the solution for a problem</text:h><text:h text:style-name="Head 2" text:level="2" >Finding your Way through the API Reference</text:h><text:h text:style-name="Head 2" text:level="2" >Common Mechanisms</text:h><text:h text:style-name="Head 3" text:level="3" >Text</text:h><text:h text:style-name="Head 3" text:level="3" >Table</text:h><text:h text:style-name="Head 3" text:level="3" >Drawing</text:h><text:h text:style-name="Head 1" text:level="1" >UNO in Professional Projects (<text:span text:style-name="T1" >145</text:span>)</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:p text:style-name="Paragraph" >UNO/API constituents: How UNOIDL/API, ServiceManager, Bridges, CoreReflection work together</text:p><text:h text:style-name="Head 2" text:level="2" >API Concepts</text:h><text:p text:style-name="Paragraph" >API is a language independent, abstract specification for UNO objects which are used in <text:s ></text:s>[PRODUCTNAME]</text:p><text:h text:style-name="Head 3" text:level="3" >Types in the API Reference</text:h><text:h text:style-name="Head 4" text:level="4" >Simple Types</text:h><text:h text:style-name="Head 4" text:level="4" >The Any Type</text:h><text:h text:style-name="Head 4" text:level="4" >Interfaces</text:h><text:h text:style-name="Head 4" text:level="4" >Services</text:h><text:h text:style-name="Head 4" text:level="4" >Modules</text:h><text:h text:style-name="Head 4" text:level="4" >Structs</text:h><text:h text:style-name="Head 4" text:level="4" >Constant Groups and Enums</text:h><text:h text:style-name="Head 4" text:level="4" >Sequences</text:h><text:h text:style-name="Head 4" text:level="4" >Exceptions</text:h><text:h text:style-name="Head 3" text:level="3" >API Principles</text:h><text:h text:style-name="Head 4" text:level="4" >Relationship between Specification, Implementation and Instances</text:h><text:h text:style-name="Head 4" text:level="4" >Object Composition</text:h><text:h text:style-name="Head 2" text:level="2" >UNO Concepts</text:h><text:p text:style-name="Paragraph" >UNO is an environment for networked object communication</text:p><text:h text:style-name="Head 3" text:level="3" >Interprocess Connections</text:h><text:h text:style-name="Head 3" text:level="3" >ServiceManager and ComponentContext</text:h><text:h text:style-name="Head 3" text:level="3" >Using UNO Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >Using Collections and Containers</text:h><text:h text:style-name="Head 3" text:level="3" >Event Model</text:h><text:h text:style-name="Head 3" text:level="3" >Exception Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Lifetime Control</text:h><text:h text:style-name="Head 3" text:level="3" >Object Identity</text:h><text:h text:style-name="Head 2" text:level="2" >Language Bindings</text:h><text:h text:style-name="Head 3" text:level="3" >Introduction for language binding</text:h><text:h text:style-name="Head 3" text:level="3" >Java Language Binding</text:h><text:h text:style-name="Head 3" text:level="3" >C++ Binding</text:h><text:h text:style-name="Head 3" text:level="3" >Access for [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 3" text:level="3" >Automation</text:h><text:h text:style-name="Head 1" text:level="1" >Writing UNO components</text:h><text:h text:style-name="Head 2" text:level="2" >Specifying a new Component</text:h><text:h text:style-name="Head 3" text:level="3" >UNOIDL language specification</text:h><text:h text:style-name="Head 2" text:level="2" >Implementing a Component</text:h><text:h text:style-name="Head 3" text:level="3" >Component Development Basics</text:h><text:unordered-list text:style-name="L1" ><text:list-item ><text:p text:style-name="P3" >Introduction</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >Mandatory interfaces: XInterface, XServiceInfo ((from UseInterfaces.CoreInterfaces))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >"Should be implemented" interfaces: XTypeProvider ((from UseInterfaces.CoreInterfaces ))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >optional interface: XMain for standalone execution</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Simple Component in Java</text:h><text:unordered-list text:style-name="L2" ><text:list-item ><text:p text:style-name="P4" >Getting the service manager ((Chapter Java components from unoBindingJava))</text:p></text:list-item><text:list-item ><text:p text:style-name="P4" >simple component chapter</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >C++ Component</text:h><text:h text:style-name="Head 3" text:level="3" >((Automation Component?))</text:h><text:h text:style-name="Head 2" text:level="2" >Deployment Options for Components</text:h><text:h text:style-name="Head 3" text:level="3" >Component Registration</text:h><text:h text:style-name="Head 3" text:level="3" >Service Manager Configuration</text:h><text:unordered-list text:style-name="L3" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P5" >XSet Interface</text:p><text:p text:style-name="P5" >Adding components during runtime, particularly interesting during development</text:p></text:list-item><text:list-item ><text:p text:style-name="P5" >ServiceManager Content</text:p><text:p text:style-name="P5" >Dynamically modifying the ServiceManager</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Bootstrapping the Service Manager ((from CppBind chapter))</text:h><text:unordered-list text:style-name="L4" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P6" >Simple Test Application</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >Configuring Your Application with Bootstrap Parameters</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >The UNO Executable</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Standalone Runtime Environment</text:h><text:p text:style-name="Paragraph" ><text:tab-stop ></text:tab-stop>The UNO executable and XMain</text:p><text:h text:style-name="Head 3" text:level="3" >Configuring the Java Runtime Environment</text:h><text:unordered-list text:style-name="L5" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P7" >The office and Java ((from UnoBindingJava))</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 1" text:level="1" >Advanced UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Design Patterns</text:h><text:h text:style-name="Head 2" text:level="2" >Bridging concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Requirements for Language Bindings and Bridges</text:h><text:h text:style-name="Head 3" text:level="3" >New Scripting Engines</text:h><text:h text:style-name="Head 2" text:level="2" >ServiceManager and loader</text:h><text:h text:style-name="Head 2" text:level="2" >Special Interfaces for internal use</text:h><text:p text:style-name="Paragraph" >XUNOTunnel</text:p><text:p text:style-name="Paragraph" >XAggregation</text:p><text:h text:style-name="Head 2" text:level="2" >UNO Reflection API</text:h><text:h text:style-name="Head 2" text:level="2" >TypeLibrary and TypeProviders</text:h><text:h text:style-name="Head 2" text:level="2" >Differences from Corba</text:h><text:h text:style-name="Head 1" text:level="1" >Office Development</text:h><text:h text:style-name="Head 2" text:level="2" >Global Object Structure</text:h><text:h text:style-name="Head 3" text:level="3" >Desktop Environment</text:h><text:h text:style-name="Head 3" text:level="3" >Frames and Frame Hierarchies</text:h><text:h text:style-name="Head 3" text:level="3" >Frame-Controller-Model Paradigm</text:h><text:h text:style-name="Head 3" text:level="3" >Loading and Saving Office Components</text:h><text:h text:style-name="Head 3" text:level="3" >Dispatch Framework</text:h><text:h text:style-name="Head 2" text:level="2" >Common Features</text:h><text:h text:style-name="Head 3" text:level="3" >Common Dialogs</text:h><text:h text:style-name="Head 3" text:level="3" >DocumentInfo</text:h><text:h text:style-name="Head 3" text:level="3" >Styles</text:h><text:h text:style-name="Head 3" text:level="3" >Search and Replace</text:h><text:h text:style-name="Head 3" text:level="3" >Number Formats</text:h><text:h text:style-name="Head 3" text:level="3" >Package File Formats</text:h><text:h text:style-name="Head 2" text:level="2" >Internationalization</text:h><text:h text:style-name="Head 2" text:level="2" >Linguistic</text:h><text:h text:style-name="Head 2" text:level="2" >System Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Clipboard</text:h><text:h text:style-name="Head 3" text:level="3" >File Picker</text:h><text:h text:style-name="Head 3" text:level="3" >Bridging to the Window System</text:h><text:p text:style-name="Paragraph" ></text:p><text:h text:style-name="Head 1" text:level="1" >Text Documents (51,5 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Text Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Text Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Using Text</text:h><text:h text:style-name="Head 3" text:level="3" >Tables</text:h><text:h text:style-name="Head 3" text:level="3" >Text Fields</text:h><text:h text:style-name="Head 3" text:level="3" >Bookmarks</text:h><text:h text:style-name="Head 3" text:level="3" >Indexes and Index Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Reference Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Footnotes and Endnotes</text:h><text:h text:style-name="Head 3" text:level="3" >Shape Objects in Text</text:h><text:h text:style-name="Head 3" text:level="3" >Redline</text:h><text:h text:style-name="Head 3" text:level="3" >Ruby</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Text Document</text:h><text:h text:style-name="Head 1" text:level="1" >Spreadsheet Documents</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Spreadsheet Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Spreadsheet Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Editing Spreadsheets</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Spreadsheet Document</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Spreadsheet Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Drawings and Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Draw/Impress Files</text:h><text:h text:style-name="Head 3" text:level="3" >Saving</text:h><text:h text:style-name="Head 3" text:level="3" >Printing</text:h><text:h text:style-name="Head 3" text:level="3" >Running Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Working with a Draw/Impress Document</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Draw/Impress Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Draw/Impress Document</text:h><text:h text:style-name="Head 1" text:level="1" >Charts</text:h><text:h text:style-name="Head 2" text:level="2" >Chart Basics</text:h><text:h text:style-name="Head 2" text:level="2" >Creating a Chart Document</text:h><text:h text:style-name="Head 2" text:level="2" >Editing a Chart Document</text:h><text:h text:style-name="Head 3" text:level="3" >Common Diagram API</text:h><text:h text:style-name="Head 3" text:level="3" >Different Chart Types</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Chart Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Basic and Dialogs</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:h text:style-name="Head 2" text:level="2" >Library Organization</text:h><text:h text:style-name="Head 2" text:level="2" >IDE with Dialogs and Events</text:h><text:h text:style-name="Head 2" text:level="2" >Using [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 2" text:level="2" >Toolkit Controls and their Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating Dialogs at Runtime</text:h><text:h text:style-name="Head 1" text:level="1" >Database Access</text:h><text:h text:style-name="Head 2" text:level="2" >Features of the [PRODUCTNAME] Database Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Capabilities</text:h><text:h text:style-name="Head 3" text:level="3" >SDBC, SDBCX, SDB Architecture</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Datasources with [PRODUCTNAME]</text:h><text:h text:style-name="Head 3" text:level="3" >DataSources</text:h><text:h text:style-name="Head 3" text:level="3" >Adding and Editing Datasources </text:h><text:h text:style-name="Head 3" text:level="3" >Establishing a Connection</text:h><text:h text:style-name="Head 4" text:level="4" >Getting Connections</text:h><text:h text:style-name="Head 4" text:level="4" >Driver specifics</text:h><text:h text:style-name="Head 3" text:level="3" >Connection Pooling</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Saved Queries</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Data</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Statements</text:h><text:h text:style-name="Head 3" text:level="3" >Resultsets</text:h><text:h text:style-name="Head 3" text:level="3" >Metadata</text:h><text:h text:style-name="Head 3" text:level="3" >Rowsets</text:h><text:h text:style-name="Head 2" text:level="2" >Working with the Database Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using DDL to change the DB Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using SDBCX to access the DB Design</text:h><text:h text:style-name="Head 2" text:level="2" >Using DBMS Features</text:h><text:h text:style-name="Head 3" text:level="3" >Stored Procedures</text:h><text:h text:style-name="Head 3" text:level="3" >Transaction Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Prepared Statements</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Database Drivers</text:h><text:h text:style-name="Head 1" text:level="1" >Forms</text:h><text:h text:style-name="Head 2" text:level="2" >Concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Models and Views</text:h><text:h text:style-name="Head 3" text:level="3" >Form Elements in the Document Model</text:h><text:h text:style-name="Head 3" text:level="3" >Special Form Components</text:h><text:h text:style-name="Head 3" text:level="3" >Events</text:h><text:h text:style-name="Head 3" text:level="3" >Data Awareness</text:h><text:h text:style-name="Head 2" text:level="2" >Recipes</text:h><text:h text:style-name="Head 3" text:level="3" >Making it easier to work with a Form</text:h><text:h text:style-name="Head 3" text:level="3" >Controlling the Data Input</text:h><text:h text:style-name="Head 3" text:level="3" >Collecting Data automatically</text:h><text:h text:style-name="Head 3" text:level="3" >Taking Advantage of Database Server Features</text:h><text:h text:style-name="Head 3" text:level="3" >Adding new Functionality</text:h><text:h text:style-name="Head 3" text:level="3" >Handling Errors</text:h><text:h text:style-name="Head 1" text:level="1" >UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Purpose of UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Document Contents as Streams</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Content Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating, Moving and Copying Document and Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Additional Commands</text:h><text:h text:style-name="Head 2" text:level="2" >Writing a Content Provider</text:h><text:h text:style-name="Head 1" text:level="1" >[PRODUCTNAME] Configuration</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing configuration data</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Configuration Data</text:h><text:h text:style-name="Head 1" text:level="1" >Appendix</text:h></office:body> + +<office:body ><text:sequence-decls ><text:sequence-decl text:display-outline-level="0" text:name="Illustration" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Table" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Text" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Drawing" ></text:sequence-decl></text:sequence-decls><text:p text:style-name="P1" >Programmer's Manual</text:p><text:p text:style-name="P2" >Planned Outline</text:p><text:p text:style-name="P2" ></text:p><text:h text:style-name="Head 1" text:level="1" >Preface (3 Pages)</text:h><text:h text:style-name="Head 1" text:level="1" >First Steps (24 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Programming with UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Fields of Application for UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Getting Started</text:h><text:h text:style-name="Head 3" text:level="3" >Required Files</text:h><text:h text:style-name="Head 3" text:level="3" >Configuration</text:h><text:h text:style-name="Head 3" text:level="3" >First Connection</text:h><text:h text:style-name="Head 2" text:level="2" >How to get Objects in [PRODUCTNAME]</text:h><text:h text:style-name="Head 2" text:level="2" >How to work with Objects</text:h><text:p text:style-name="Paragraph" >Example</text:p><text:h text:style-name="Head 3" text:level="3" >Services</text:h><text:h text:style-name="Head 3" text:level="3" >Querying Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >ElementAccess</text:h><text:h text:style-name="Head 3" text:level="3" >Simple Types</text:h><text:h text:style-name="Head 3" text:level="3" >Strings</text:h><text:h text:style-name="Head 3" text:level="3" >Enums and Constant Groups</text:h><text:h text:style-name="Head 3" text:level="3" >Structs</text:h><text:h text:style-name="Head 3" text:level="3" >Any</text:h><text:h text:style-name="Head 3" text:level="3" >Sequence</text:h><text:h text:style-name="Head 2" text:level="2" >How to find the solution for a problem</text:h><text:h text:style-name="Head 2" text:level="2" >Finding your Way through the API Reference</text:h><text:h text:style-name="Head 2" text:level="2" >Common Mechanisms</text:h><text:h text:style-name="Head 3" text:level="3" >Text</text:h><text:h text:style-name="Head 3" text:level="3" >Table</text:h><text:h text:style-name="Head 3" text:level="3" >Drawing</text:h><text:h text:style-name="Head 1" text:level="1" >UNO in Professional Projects (<text:span text:style-name="T1" >145</text:span>)</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:p text:style-name="Paragraph" >UNO/API constituents: How UNOIDL/API, ServiceManager, Bridges, CoreReflection work together</text:p><text:h text:style-name="Head 2" text:level="2" >API Concepts</text:h><text:p text:style-name="Paragraph" >API is a language independent, abstract specification for UNO objects which are used in <text:s ></text:s>[PRODUCTNAME]</text:p><text:h text:style-name="Head 3" text:level="3" >Types in the API Reference</text:h><text:h text:style-name="Head 4" text:level="4" >Simple Types</text:h><text:h text:style-name="Head 4" text:level="4" >The Any Type</text:h><text:h text:style-name="Head 4" text:level="4" >Interfaces</text:h><text:h text:style-name="Head 4" text:level="4" >Services</text:h><text:h text:style-name="Head 4" text:level="4" >Modules</text:h><text:h text:style-name="Head 4" text:level="4" >Structs</text:h><text:h text:style-name="Head 4" text:level="4" >Constant Groups and Enums</text:h><text:h text:style-name="Head 4" text:level="4" >Sequences</text:h><text:h text:style-name="Head 4" text:level="4" >Exceptions</text:h><text:h text:style-name="Head 3" text:level="3" >API Principles</text:h><text:h text:style-name="Head 4" text:level="4" >Relationship between Specification, Implementation and Instances</text:h><text:h text:style-name="Head 4" text:level="4" >Object Composition</text:h><text:h text:style-name="Head 2" text:level="2" >UNO Concepts</text:h><text:p text:style-name="Paragraph" >UNO is an environment for networked object communication</text:p><text:h text:style-name="Head 3" text:level="3" >Interprocess Connections</text:h><text:h text:style-name="Head 3" text:level="3" >ServiceManager and ComponentContext</text:h><text:h text:style-name="Head 3" text:level="3" >Using UNO Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >Using Collections and Containers</text:h><text:h text:style-name="Head 3" text:level="3" >Event Model</text:h><text:h text:style-name="Head 3" text:level="3" >Exception Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Lifetime Control</text:h><text:h text:style-name="Head 3" text:level="3" >Object Identity</text:h><text:h text:style-name="Head 2" text:level="2" >Language Bindings</text:h><text:h text:style-name="Head 3" text:level="3" >Introduction for language binding</text:h><text:h text:style-name="Head 3" text:level="3" >Java Language Binding</text:h><text:h text:style-name="Head 3" text:level="3" >C++ Binding</text:h><text:h text:style-name="Head 3" text:level="3" >Access for [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 3" text:level="3" >Automation</text:h><text:h text:style-name="Head 1" text:level="1" >Writing UNO components</text:h><text:h text:style-name="Head 2" text:level="2" >Specifying a new Component</text:h><text:h text:style-name="Head 3" text:level="3" >UNOIDL language specification</text:h><text:h text:style-name="Head 2" text:level="2" >Implementing a Component</text:h><text:h text:style-name="Head 3" text:level="3" >Component Development Basics</text:h><text:unordered-list text:style-name="L1" ><text:list-item ><text:p text:style-name="P3" >Introduction</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >Mandatory interfaces: XInterface, XServiceInfo ((from UseInterfaces.CoreInterfaces))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >"Should be implemented" interfaces: XTypeProvider ((from UseInterfaces.CoreInterfaces ))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >optional interface: XMain for standalone execution</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Simple Component in Java</text:h><text:unordered-list text:style-name="L2" ><text:list-item ><text:p text:style-name="P4" >Getting the service manager ((Chapter Java components from unoBindingJava))</text:p></text:list-item><text:list-item ><text:p text:style-name="P4" >simple component chapter</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >C++ Component</text:h><text:h text:style-name="Head 3" text:level="3" >((Automation Component?))</text:h><text:h text:style-name="Head 2" text:level="2" >Deployment Options for Components</text:h><text:h text:style-name="Head 3" text:level="3" >Component Registration</text:h><text:h text:style-name="Head 3" text:level="3" >Service Manager Configuration</text:h><text:unordered-list text:style-name="L3" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P5" >XSet Interface</text:p><text:p text:style-name="P5" >Adding components during runtime, particularly interesting during development</text:p></text:list-item><text:list-item ><text:p text:style-name="P5" >ServiceManager Content</text:p><text:p text:style-name="P5" >Dynamically modifying the ServiceManager</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Bootstrapping the Service Manager ((from CppBind chapter))</text:h><text:unordered-list text:style-name="L4" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P6" >Simple Test Application</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >Configuring Your Application with Bootstrap Parameters</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >The UNO Executable</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Standalone Runtime Environment</text:h><text:p text:style-name="Paragraph" ><text:tab-stop ></text:tab-stop>The UNO executable and XMain</text:p><text:h text:style-name="Head 3" text:level="3" >Configuring the Java Runtime Environment</text:h><text:unordered-list text:style-name="L5" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P7" >The office and Java ((from UnoBindingJava))</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 1" text:level="1" >Advanced UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Design Patterns</text:h><text:h text:style-name="Head 2" text:level="2" >Bridging concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Requirements for Language Bindings and Bridges</text:h><text:h text:style-name="Head 3" text:level="3" >New Scripting Engines</text:h><text:h text:style-name="Head 2" text:level="2" >ServiceManager and loader</text:h><text:h text:style-name="Head 2" text:level="2" >Special Interfaces for internal use</text:h><text:p text:style-name="Paragraph" >XUNOTunnel</text:p><text:p text:style-name="Paragraph" >XAggregation</text:p><text:h text:style-name="Head 2" text:level="2" >UNO Reflection API</text:h><text:h text:style-name="Head 2" text:level="2" >TypeLibrary and TypeProviders</text:h><text:h text:style-name="Head 2" text:level="2" >Differences from Corba</text:h><text:h text:style-name="Head 1" text:level="1" >Office Development</text:h><text:h text:style-name="Head 2" text:level="2" >Global Object Structure</text:h><text:h text:style-name="Head 3" text:level="3" >Desktop Environment</text:h><text:h text:style-name="Head 3" text:level="3" >Frames and Frame Hierarchies</text:h><text:h text:style-name="Head 3" text:level="3" >Frame-Controller-Model Paradigm</text:h><text:h text:style-name="Head 3" text:level="3" >Loading and Saving Office Components</text:h><text:h text:style-name="Head 3" text:level="3" >Dispatch Framework</text:h><text:h text:style-name="Head 2" text:level="2" >Common Features</text:h><text:h text:style-name="Head 3" text:level="3" >Common Dialogs</text:h><text:h text:style-name="Head 3" text:level="3" >DocumentInfo</text:h><text:h text:style-name="Head 3" text:level="3" >Styles</text:h><text:h text:style-name="Head 3" text:level="3" >Search and Replace</text:h><text:h text:style-name="Head 3" text:level="3" >Number Formats</text:h><text:h text:style-name="Head 3" text:level="3" >Package File Formats</text:h><text:h text:style-name="Head 2" text:level="2" >Internationalization</text:h><text:h text:style-name="Head 2" text:level="2" >Linguistic</text:h><text:h text:style-name="Head 2" text:level="2" >System Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Clipboard</text:h><text:h text:style-name="Head 3" text:level="3" >File Picker</text:h><text:h text:style-name="Head 3" text:level="3" >Bridging to the Window System</text:h><text:p text:style-name="Paragraph" ></text:p><text:h text:style-name="Head 1" text:level="1" >Text Documents (51,5 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Text Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Text Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Using Text</text:h><text:h text:style-name="Head 3" text:level="3" >Tables</text:h><text:h text:style-name="Head 3" text:level="3" >Text Fields</text:h><text:h text:style-name="Head 3" text:level="3" >Bookmarks</text:h><text:h text:style-name="Head 3" text:level="3" >Indexes and Index Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Reference Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Footnotes and Endnotes</text:h><text:h text:style-name="Head 3" text:level="3" >Shape Objects in Text</text:h><text:h text:style-name="Head 3" text:level="3" >Redline</text:h><text:h text:style-name="Head 3" text:level="3" >Ruby</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Text Document</text:h><text:h text:style-name="Head 1" text:level="1" >Spreadsheet Documents</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Spreadsheet Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Spreadsheet Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Editing Spreadsheets</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Spreadsheet Document</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Spreadsheet Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Drawings and Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Draw/Impress Files</text:h><text:h text:style-name="Head 3" text:level="3" >Saving</text:h><text:h text:style-name="Head 3" text:level="3" >Printing</text:h><text:h text:style-name="Head 3" text:level="3" >Running Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Working with a Draw/Impress Document</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Draw/Impress Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Draw/Impress Document</text:h><text:h text:style-name="Head 1" text:level="1" >Charts</text:h><text:h text:style-name="Head 2" text:level="2" >Chart Basics</text:h><text:h text:style-name="Head 2" text:level="2" >Creating a Chart Document</text:h><text:h text:style-name="Head 2" text:level="2" >Editing a Chart Document</text:h><text:h text:style-name="Head 3" text:level="3" >Common Diagram API</text:h><text:h text:style-name="Head 3" text:level="3" >Different Chart Types</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Chart Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Basic and Dialogs</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:h text:style-name="Head 2" text:level="2" >Library Organization</text:h><text:h text:style-name="Head 2" text:level="2" >IDE with Dialogs and Events</text:h><text:h text:style-name="Head 2" text:level="2" >Using [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 2" text:level="2" >Toolkit Controls and their Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating Dialogs at Runtime</text:h><text:h text:style-name="Head 1" text:level="1" >Database Access</text:h><text:h text:style-name="Head 2" text:level="2" >Features of the [PRODUCTNAME] Database Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Capabilities</text:h><text:h text:style-name="Head 3" text:level="3" >SDBC, SDBCX, SDB Architecture</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Datasources with [PRODUCTNAME]</text:h><text:h text:style-name="Head 3" text:level="3" >DataSources</text:h><text:h text:style-name="Head 3" text:level="3" >Adding and Editing Datasources </text:h><text:h text:style-name="Head 3" text:level="3" >Establishing a Connection</text:h><text:h text:style-name="Head 4" text:level="4" >Getting Connections</text:h><text:h text:style-name="Head 4" text:level="4" >Driver specifics</text:h><text:h text:style-name="Head 3" text:level="3" >Connection Pooling</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Saved Queries</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Data</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Statements</text:h><text:h text:style-name="Head 3" text:level="3" >Resultsets</text:h><text:h text:style-name="Head 3" text:level="3" >Metadata</text:h><text:h text:style-name="Head 3" text:level="3" >Rowsets</text:h><text:h text:style-name="Head 2" text:level="2" >Working with the Database Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using DDL to change the DB Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using SDBCX to access the DB Design</text:h><text:h text:style-name="Head 2" text:level="2" >Using DBMS Features</text:h><text:h text:style-name="Head 3" text:level="3" >Stored Procedures</text:h><text:h text:style-name="Head 3" text:level="3" >Transaction Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Prepared Statements</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Database Drivers</text:h><text:h text:style-name="Head 1" text:level="1" >Forms</text:h><text:h text:style-name="Head 2" text:level="2" >Concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Models and Views</text:h><text:h text:style-name="Head 3" text:level="3" >Form Elements in the Document Model</text:h><text:h text:style-name="Head 3" text:level="3" >Special Form Components</text:h><text:h text:style-name="Head 3" text:level="3" >Events</text:h><text:h text:style-name="Head 3" text:level="3" >Data Awareness</text:h><text:h text:style-name="Head 2" text:level="2" >Recipes</text:h><text:h text:style-name="Head 3" text:level="3" >Making it easier to work with a Form</text:h><text:h text:style-name="Head 3" text:level="3" >Controlling the Data Input</text:h><text:h text:style-name="Head 3" text:level="3" >Collecting Data automatically</text:h><text:h text:style-name="Head 3" text:level="3" >Taking Advantage of Database Server Features</text:h><text:h text:style-name="Head 3" text:level="3" >Adding new Functionality</text:h><text:h text:style-name="Head 3" text:level="3" >Handling Errors</text:h><text:h text:style-name="Head 1" text:level="1" >UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Purpose of UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Document Contents as Streams</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Content Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating, Moving and Copying Document and Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Additional Commands</text:h><text:h text:style-name="Head 2" text:level="2" >Writing a Content Provider</text:h><text:h text:style-name="Head 1" text:level="1" >[PRODUCTNAME] Configuration</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing configuration data</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Configuration Data</text:h><text:h text:style-name="Head 1" text:level="1" >Appendix</text:h></office:body> + +<office:body ><text:sequence-decls ><text:sequence-decl text:display-outline-level="0" text:name="Illustration" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Table" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Text" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Drawing" ></text:sequence-decl></text:sequence-decls><text:p text:style-name="P1" >Programmer's Manual</text:p><text:p text:style-name="P2" >Planned Outline</text:p><text:p text:style-name="P2" ></text:p><text:h text:style-name="Head 1" text:level="1" >Preface (3 Pages)</text:h><text:h text:style-name="Head 1" text:level="1" >First Steps (24 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Programming with UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Fields of Application for UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Getting Started</text:h><text:h text:style-name="Head 3" text:level="3" >Required Files</text:h><text:h text:style-name="Head 3" text:level="3" >Configuration</text:h><text:h text:style-name="Head 3" text:level="3" >First Connection</text:h><text:h text:style-name="Head 2" text:level="2" >How to get Objects in [PRODUCTNAME]</text:h><text:h text:style-name="Head 2" text:level="2" >How to work with Objects</text:h><text:p text:style-name="Paragraph" >Example</text:p><text:h text:style-name="Head 3" text:level="3" >Services</text:h><text:h text:style-name="Head 3" text:level="3" >Querying Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >ElementAccess</text:h><text:h text:style-name="Head 3" text:level="3" >Simple Types</text:h><text:h text:style-name="Head 3" text:level="3" >Strings</text:h><text:h text:style-name="Head 3" text:level="3" >Enums and Constant Groups</text:h><text:h text:style-name="Head 3" text:level="3" >Structs</text:h><text:h text:style-name="Head 3" text:level="3" >Any</text:h><text:h text:style-name="Head 3" text:level="3" >Sequence</text:h><text:h text:style-name="Head 2" text:level="2" >How to find the solution for a problem</text:h><text:h text:style-name="Head 2" text:level="2" >Finding your Way through the API Reference</text:h><text:h text:style-name="Head 2" text:level="2" >Common Mechanisms</text:h><text:h text:style-name="Head 3" text:level="3" >Text</text:h><text:h text:style-name="Head 3" text:level="3" >Table</text:h><text:h text:style-name="Head 3" text:level="3" >Drawing</text:h><text:h text:style-name="Head 1" text:level="1" >UNO in Professional Projects (<text:span text:style-name="T1" >145</text:span>)</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:p text:style-name="Paragraph" >UNO/API constituents: How UNOIDL/API, ServiceManager, Bridges, CoreReflection work together</text:p><text:h text:style-name="Head 2" text:level="2" >API Concepts</text:h><text:p text:style-name="Paragraph" >API is a language independent, abstract specification for UNO objects which are used in <text:s ></text:s>[PRODUCTNAME]</text:p><text:h text:style-name="Head 3" text:level="3" >Types in the API Reference</text:h><text:h text:style-name="Head 4" text:level="4" >Simple Types</text:h><text:h text:style-name="Head 4" text:level="4" >The Any Type</text:h><text:h text:style-name="Head 4" text:level="4" >Interfaces</text:h><text:h text:style-name="Head 4" text:level="4" >Services</text:h><text:h text:style-name="Head 4" text:level="4" >Modules</text:h><text:h text:style-name="Head 4" text:level="4" >Structs</text:h><text:h text:style-name="Head 4" text:level="4" >Constant Groups and Enums</text:h><text:h text:style-name="Head 4" text:level="4" >Sequences</text:h><text:h text:style-name="Head 4" text:level="4" >Exceptions</text:h><text:h text:style-name="Head 3" text:level="3" >API Principles</text:h><text:h text:style-name="Head 4" text:level="4" >Relationship between Specification, Implementation and Instances</text:h><text:h text:style-name="Head 4" text:level="4" >Object Composition</text:h><text:h text:style-name="Head 2" text:level="2" >UNO Concepts</text:h><text:p text:style-name="Paragraph" >UNO is an environment for networked object communication</text:p><text:h text:style-name="Head 3" text:level="3" >Interprocess Connections</text:h><text:h text:style-name="Head 3" text:level="3" >ServiceManager and ComponentContext</text:h><text:h text:style-name="Head 3" text:level="3" >Using UNO Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >Using Collections and Containers</text:h><text:h text:style-name="Head 3" text:level="3" >Event Model</text:h><text:h text:style-name="Head 3" text:level="3" >Exception Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Lifetime Control</text:h><text:h text:style-name="Head 3" text:level="3" >Object Identity</text:h><text:h text:style-name="Head 2" text:level="2" >Language Bindings</text:h><text:h text:style-name="Head 3" text:level="3" >Introduction for language binding</text:h><text:h text:style-name="Head 3" text:level="3" >Java Language Binding</text:h><text:h text:style-name="Head 3" text:level="3" >C++ Binding</text:h><text:h text:style-name="Head 3" text:level="3" >Access for [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 3" text:level="3" >Automation</text:h><text:h text:style-name="Head 1" text:level="1" >Writing UNO components</text:h><text:h text:style-name="Head 2" text:level="2" >Specifying a new Component</text:h><text:h text:style-name="Head 3" text:level="3" >UNOIDL language specification</text:h><text:h text:style-name="Head 2" text:level="2" >Implementing a Component</text:h><text:h text:style-name="Head 3" text:level="3" >Component Development Basics</text:h><text:unordered-list text:style-name="L1" ><text:list-item ><text:p text:style-name="P3" >Introduction</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >Mandatory interfaces: XInterface, XServiceInfo ((from UseInterfaces.CoreInterfaces))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >"Should be implemented" interfaces: XTypeProvider ((from UseInterfaces.CoreInterfaces ))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >optional interface: XMain for standalone execution</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Simple Component in Java</text:h><text:unordered-list text:style-name="L2" ><text:list-item ><text:p text:style-name="P4" >Getting the service manager ((Chapter Java components from unoBindingJava))</text:p></text:list-item><text:list-item ><text:p text:style-name="P4" >simple component chapter</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >C++ Component</text:h><text:h text:style-name="Head 3" text:level="3" >((Automation Component?))</text:h><text:h text:style-name="Head 2" text:level="2" >Deployment Options for Components</text:h><text:h text:style-name="Head 3" text:level="3" >Component Registration</text:h><text:h text:style-name="Head 3" text:level="3" >Service Manager Configuration</text:h><text:unordered-list text:style-name="L3" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P5" >XSet Interface</text:p><text:p text:style-name="P5" >Adding components during runtime, particularly interesting during development</text:p></text:list-item><text:list-item ><text:p text:style-name="P5" >ServiceManager Content</text:p><text:p text:style-name="P5" >Dynamically modifying the ServiceManager</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Bootstrapping the Service Manager ((from CppBind chapter))</text:h><text:unordered-list text:style-name="L4" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P6" >Simple Test Application</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >Configuring Your Application with Bootstrap Parameters</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >The UNO Executable</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Standalone Runtime Environment</text:h><text:p text:style-name="Paragraph" ><text:tab-stop ></text:tab-stop>The UNO executable and XMain</text:p><text:h text:style-name="Head 3" text:level="3" >Configuring the Java Runtime Environment</text:h><text:unordered-list text:style-name="L5" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P7" >The office and Java ((from UnoBindingJava))</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 1" text:level="1" >Advanced UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Design Patterns</text:h><text:h text:style-name="Head 2" text:level="2" >Bridging concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Requirements for Language Bindings and Bridges</text:h><text:h text:style-name="Head 3" text:level="3" >New Scripting Engines</text:h><text:h text:style-name="Head 2" text:level="2" >ServiceManager and loader</text:h><text:h text:style-name="Head 2" text:level="2" >Special Interfaces for internal use</text:h><text:p text:style-name="Paragraph" >XUNOTunnel</text:p><text:p text:style-name="Paragraph" >XAggregation</text:p><text:h text:style-name="Head 2" text:level="2" >UNO Reflection API</text:h><text:h text:style-name="Head 2" text:level="2" >TypeLibrary and TypeProviders</text:h><text:h text:style-name="Head 2" text:level="2" >Differences from Corba</text:h><text:h text:style-name="Head 1" text:level="1" >Office Development</text:h><text:h text:style-name="Head 2" text:level="2" >Global Object Structure</text:h><text:h text:style-name="Head 3" text:level="3" >Desktop Environment</text:h><text:h text:style-name="Head 3" text:level="3" >Frames and Frame Hierarchies</text:h><text:h text:style-name="Head 3" text:level="3" >Frame-Controller-Model Paradigm</text:h><text:h text:style-name="Head 3" text:level="3" >Loading and Saving Office Components</text:h><text:h text:style-name="Head 3" text:level="3" >Dispatch Framework</text:h><text:h text:style-name="Head 2" text:level="2" >Common Features</text:h><text:h text:style-name="Head 3" text:level="3" >Common Dialogs</text:h><text:h text:style-name="Head 3" text:level="3" >DocumentInfo</text:h><text:h text:style-name="Head 3" text:level="3" >Styles</text:h><text:h text:style-name="Head 3" text:level="3" >Search and Replace</text:h><text:h text:style-name="Head 3" text:level="3" >Number Formats</text:h><text:h text:style-name="Head 3" text:level="3" >Package File Formats</text:h><text:h text:style-name="Head 2" text:level="2" >Internationalization</text:h><text:h text:style-name="Head 2" text:level="2" >Linguistic</text:h><text:h text:style-name="Head 2" text:level="2" >System Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Clipboard</text:h><text:h text:style-name="Head 3" text:level="3" >File Picker</text:h><text:h text:style-name="Head 3" text:level="3" >Bridging to the Window System</text:h><text:p text:style-name="Paragraph" ></text:p><text:h text:style-name="Head 1" text:level="1" >Text Documents (51,5 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Text Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Text Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Using Text</text:h><text:h text:style-name="Head 3" text:level="3" >Tables</text:h><text:h text:style-name="Head 3" text:level="3" >Text Fields</text:h><text:h text:style-name="Head 3" text:level="3" >Bookmarks</text:h><text:h text:style-name="Head 3" text:level="3" >Indexes and Index Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Reference Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Footnotes and Endnotes</text:h><text:h text:style-name="Head 3" text:level="3" >Shape Objects in Text</text:h><text:h text:style-name="Head 3" text:level="3" >Redline</text:h><text:h text:style-name="Head 3" text:level="3" >Ruby</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Text Document</text:h><text:h text:style-name="Head 1" text:level="1" >Spreadsheet Documents</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Spreadsheet Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Spreadsheet Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Editing Spreadsheets</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Spreadsheet Document</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Spreadsheet Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Drawings and Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Draw/Impress Files</text:h><text:h text:style-name="Head 3" text:level="3" >Saving</text:h><text:h text:style-name="Head 3" text:level="3" >Printing</text:h><text:h text:style-name="Head 3" text:level="3" >Running Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Working with a Draw/Impress Document</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Draw/Impress Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Draw/Impress Document</text:h><text:h text:style-name="Head 1" text:level="1" >Charts</text:h><text:h text:style-name="Head 2" text:level="2" >Chart Basics</text:h><text:h text:style-name="Head 2" text:level="2" >Creating a Chart Document</text:h><text:h text:style-name="Head 2" text:level="2" >Editing a Chart Document</text:h><text:h text:style-name="Head 3" text:level="3" >Common Diagram API</text:h><text:h text:style-name="Head 3" text:level="3" >Different Chart Types</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Chart Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Basic and Dialogs</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:h text:style-name="Head 2" text:level="2" >Library Organization</text:h><text:h text:style-name="Head 2" text:level="2" >IDE with Dialogs and Events</text:h><text:h text:style-name="Head 2" text:level="2" >Using [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 2" text:level="2" >Toolkit Controls and their Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating Dialogs at Runtime</text:h><text:h text:style-name="Head 1" text:level="1" >Database Access</text:h><text:h text:style-name="Head 2" text:level="2" >Features of the [PRODUCTNAME] Database Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Capabilities</text:h><text:h text:style-name="Head 3" text:level="3" >SDBC, SDBCX, SDB Architecture</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Datasources with [PRODUCTNAME]</text:h><text:h text:style-name="Head 3" text:level="3" >DataSources</text:h><text:h text:style-name="Head 3" text:level="3" >Adding and Editing Datasources </text:h><text:h text:style-name="Head 3" text:level="3" >Establishing a Connection</text:h><text:h text:style-name="Head 4" text:level="4" >Getting Connections</text:h><text:h text:style-name="Head 4" text:level="4" >Driver specifics</text:h><text:h text:style-name="Head 3" text:level="3" >Connection Pooling</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Saved Queries</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Data</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Statements</text:h><text:h text:style-name="Head 3" text:level="3" >Resultsets</text:h><text:h text:style-name="Head 3" text:level="3" >Metadata</text:h><text:h text:style-name="Head 3" text:level="3" >Rowsets</text:h><text:h text:style-name="Head 2" text:level="2" >Working with the Database Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using DDL to change the DB Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using SDBCX to access the DB Design</text:h><text:h text:style-name="Head 2" text:level="2" >Using DBMS Features</text:h><text:h text:style-name="Head 3" text:level="3" >Stored Procedures</text:h><text:h text:style-name="Head 3" text:level="3" >Transaction Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Prepared Statements</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Database Drivers</text:h><text:h text:style-name="Head 1" text:level="1" >Forms</text:h><text:h text:style-name="Head 2" text:level="2" >Concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Models and Views</text:h><text:h text:style-name="Head 3" text:level="3" >Form Elements in the Document Model</text:h><text:h text:style-name="Head 3" text:level="3" >Special Form Components</text:h><text:h text:style-name="Head 3" text:level="3" >Events</text:h><text:h text:style-name="Head 3" text:level="3" >Data Awareness</text:h><text:h text:style-name="Head 2" text:level="2" >Recipes</text:h><text:h text:style-name="Head 3" text:level="3" >Making it easier to work with a Form</text:h><text:h text:style-name="Head 3" text:level="3" >Controlling the Data Input</text:h><text:h text:style-name="Head 3" text:level="3" >Collecting Data automatically</text:h><text:h text:style-name="Head 3" text:level="3" >Taking Advantage of Database Server Features</text:h><text:h text:style-name="Head 3" text:level="3" >Adding new Functionality</text:h><text:h text:style-name="Head 3" text:level="3" >Handling Errors</text:h><text:h text:style-name="Head 1" text:level="1" >UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Purpose of UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Document Contents as Streams</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Content Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating, Moving and Copying Document and Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Additional Commands</text:h><text:h text:style-name="Head 2" text:level="2" >Writing a Content Provider</text:h><text:h text:style-name="Head 1" text:level="1" >[PRODUCTNAME] Configuration</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing configuration data</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Configuration Data</text:h><text:h text:style-name="Head 1" text:level="1" >Appendix</text:h></office:body> + +<office:body ><text:sequence-decls ><text:sequence-decl text:display-outline-level="0" text:name="Illustration" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Table" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Text" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Drawing" ></text:sequence-decl></text:sequence-decls><text:p text:style-name="P1" >Programmer's Manual</text:p><text:p text:style-name="P2" >Planned Outline</text:p><text:p text:style-name="P2" ></text:p><text:h text:style-name="Head 1" text:level="1" >Preface (3 Pages)</text:h><text:h text:style-name="Head 1" text:level="1" >First Steps (24 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Programming with UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Fields of Application for UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Getting Started</text:h><text:h text:style-name="Head 3" text:level="3" >Required Files</text:h><text:h text:style-name="Head 3" text:level="3" >Configuration</text:h><text:h text:style-name="Head 3" text:level="3" >First Connection</text:h><text:h text:style-name="Head 2" text:level="2" >How to get Objects in [PRODUCTNAME]</text:h><text:h text:style-name="Head 2" text:level="2" >How to work with Objects</text:h><text:p text:style-name="Paragraph" >Example</text:p><text:h text:style-name="Head 3" text:level="3" >Services</text:h><text:h text:style-name="Head 3" text:level="3" >Querying Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >ElementAccess</text:h><text:h text:style-name="Head 3" text:level="3" >Simple Types</text:h><text:h text:style-name="Head 3" text:level="3" >Strings</text:h><text:h text:style-name="Head 3" text:level="3" >Enums and Constant Groups</text:h><text:h text:style-name="Head 3" text:level="3" >Structs</text:h><text:h text:style-name="Head 3" text:level="3" >Any</text:h><text:h text:style-name="Head 3" text:level="3" >Sequence</text:h><text:h text:style-name="Head 2" text:level="2" >How to find the solution for a problem</text:h><text:h text:style-name="Head 2" text:level="2" >Finding your Way through the API Reference</text:h><text:h text:style-name="Head 2" text:level="2" >Common Mechanisms</text:h><text:h text:style-name="Head 3" text:level="3" >Text</text:h><text:h text:style-name="Head 3" text:level="3" >Table</text:h><text:h text:style-name="Head 3" text:level="3" >Drawing</text:h><text:h text:style-name="Head 1" text:level="1" >UNO in Professional Projects (<text:span text:style-name="T1" >145</text:span>)</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:p text:style-name="Paragraph" >UNO/API constituents: How UNOIDL/API, ServiceManager, Bridges, CoreReflection work together</text:p><text:h text:style-name="Head 2" text:level="2" >API Concepts</text:h><text:p text:style-name="Paragraph" >API is a language independent, abstract specification for UNO objects which are used in <text:s ></text:s>[PRODUCTNAME]</text:p><text:h text:style-name="Head 3" text:level="3" >Types in the API Reference</text:h><text:h text:style-name="Head 4" text:level="4" >Simple Types</text:h><text:h text:style-name="Head 4" text:level="4" >The Any Type</text:h><text:h text:style-name="Head 4" text:level="4" >Interfaces</text:h><text:h text:style-name="Head 4" text:level="4" >Services</text:h><text:h text:style-name="Head 4" text:level="4" >Modules</text:h><text:h text:style-name="Head 4" text:level="4" >Structs</text:h><text:h text:style-name="Head 4" text:level="4" >Constant Groups and Enums</text:h><text:h text:style-name="Head 4" text:level="4" >Sequences</text:h><text:h text:style-name="Head 4" text:level="4" >Exceptions</text:h><text:h text:style-name="Head 3" text:level="3" >API Principles</text:h><text:h text:style-name="Head 4" text:level="4" >Relationship between Specification, Implementation and Instances</text:h><text:h text:style-name="Head 4" text:level="4" >Object Composition</text:h><text:h text:style-name="Head 2" text:level="2" >UNO Concepts</text:h><text:p text:style-name="Paragraph" >UNO is an environment for networked object communication</text:p><text:h text:style-name="Head 3" text:level="3" >Interprocess Connections</text:h><text:h text:style-name="Head 3" text:level="3" >ServiceManager and ComponentContext</text:h><text:h text:style-name="Head 3" text:level="3" >Using UNO Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >Using Collections and Containers</text:h><text:h text:style-name="Head 3" text:level="3" >Event Model</text:h><text:h text:style-name="Head 3" text:level="3" >Exception Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Lifetime Control</text:h><text:h text:style-name="Head 3" text:level="3" >Object Identity</text:h><text:h text:style-name="Head 2" text:level="2" >Language Bindings</text:h><text:h text:style-name="Head 3" text:level="3" >Introduction for language binding</text:h><text:h text:style-name="Head 3" text:level="3" >Java Language Binding</text:h><text:h text:style-name="Head 3" text:level="3" >C++ Binding</text:h><text:h text:style-name="Head 3" text:level="3" >Access for [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 3" text:level="3" >Automation</text:h><text:h text:style-name="Head 1" text:level="1" >Writing UNO components</text:h><text:h text:style-name="Head 2" text:level="2" >Specifying a new Component</text:h><text:h text:style-name="Head 3" text:level="3" >UNOIDL language specification</text:h><text:h text:style-name="Head 2" text:level="2" >Implementing a Component</text:h><text:h text:style-name="Head 3" text:level="3" >Component Development Basics</text:h><text:unordered-list text:style-name="L1" ><text:list-item ><text:p text:style-name="P3" >Introduction</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >Mandatory interfaces: XInterface, XServiceInfo ((from UseInterfaces.CoreInterfaces))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >"Should be implemented" interfaces: XTypeProvider ((from UseInterfaces.CoreInterfaces ))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >optional interface: XMain for standalone execution</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Simple Component in Java</text:h><text:unordered-list text:style-name="L2" ><text:list-item ><text:p text:style-name="P4" >Getting the service manager ((Chapter Java components from unoBindingJava))</text:p></text:list-item><text:list-item ><text:p text:style-name="P4" >simple component chapter</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >C++ Component</text:h><text:h text:style-name="Head 3" text:level="3" >((Automation Component?))</text:h><text:h text:style-name="Head 2" text:level="2" >Deployment Options for Components</text:h><text:h text:style-name="Head 3" text:level="3" >Component Registration</text:h><text:h text:style-name="Head 3" text:level="3" >Service Manager Configuration</text:h><text:unordered-list text:style-name="L3" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P5" >XSet Interface</text:p><text:p text:style-name="P5" >Adding components during runtime, particularly interesting during development</text:p></text:list-item><text:list-item ><text:p text:style-name="P5" >ServiceManager Content</text:p><text:p text:style-name="P5" >Dynamically modifying the ServiceManager</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Bootstrapping the Service Manager ((from CppBind chapter))</text:h><text:unordered-list text:style-name="L4" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P6" >Simple Test Application</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >Configuring Your Application with Bootstrap Parameters</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >The UNO Executable</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Standalone Runtime Environment</text:h><text:p text:style-name="Paragraph" ><text:tab-stop ></text:tab-stop>The UNO executable and XMain</text:p><text:h text:style-name="Head 3" text:level="3" >Configuring the Java Runtime Environment</text:h><text:unordered-list text:style-name="L5" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P7" >The office and Java ((from UnoBindingJava))</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 1" text:level="1" >Advanced UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Design Patterns</text:h><text:h text:style-name="Head 2" text:level="2" >Bridging concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Requirements for Language Bindings and Bridges</text:h><text:h text:style-name="Head 3" text:level="3" >New Scripting Engines</text:h><text:h text:style-name="Head 2" text:level="2" >ServiceManager and loader</text:h><text:h text:style-name="Head 2" text:level="2" >Special Interfaces for internal use</text:h><text:p text:style-name="Paragraph" >XUNOTunnel</text:p><text:p text:style-name="Paragraph" >XAggregation</text:p><text:h text:style-name="Head 2" text:level="2" >UNO Reflection API</text:h><text:h text:style-name="Head 2" text:level="2" >TypeLibrary and TypeProviders</text:h><text:h text:style-name="Head 2" text:level="2" >Differences from Corba</text:h><text:h text:style-name="Head 1" text:level="1" >Office Development</text:h><text:h text:style-name="Head 2" text:level="2" >Global Object Structure</text:h><text:h text:style-name="Head 3" text:level="3" >Desktop Environment</text:h><text:h text:style-name="Head 3" text:level="3" >Frames and Frame Hierarchies</text:h><text:h text:style-name="Head 3" text:level="3" >Frame-Controller-Model Paradigm</text:h><text:h text:style-name="Head 3" text:level="3" >Loading and Saving Office Components</text:h><text:h text:style-name="Head 3" text:level="3" >Dispatch Framework</text:h><text:h text:style-name="Head 2" text:level="2" >Common Features</text:h><text:h text:style-name="Head 3" text:level="3" >Common Dialogs</text:h><text:h text:style-name="Head 3" text:level="3" >DocumentInfo</text:h><text:h text:style-name="Head 3" text:level="3" >Styles</text:h><text:h text:style-name="Head 3" text:level="3" >Search and Replace</text:h><text:h text:style-name="Head 3" text:level="3" >Number Formats</text:h><text:h text:style-name="Head 3" text:level="3" >Package File Formats</text:h><text:h text:style-name="Head 2" text:level="2" >Internationalization</text:h><text:h text:style-name="Head 2" text:level="2" >Linguistic</text:h><text:h text:style-name="Head 2" text:level="2" >System Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Clipboard</text:h><text:h text:style-name="Head 3" text:level="3" >File Picker</text:h><text:h text:style-name="Head 3" text:level="3" >Bridging to the Window System</text:h><text:p text:style-name="Paragraph" ></text:p><text:h text:style-name="Head 1" text:level="1" >Text Documents (51,5 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Text Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Text Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Using Text</text:h><text:h text:style-name="Head 3" text:level="3" >Tables</text:h><text:h text:style-name="Head 3" text:level="3" >Text Fields</text:h><text:h text:style-name="Head 3" text:level="3" >Bookmarks</text:h><text:h text:style-name="Head 3" text:level="3" >Indexes and Index Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Reference Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Footnotes and Endnotes</text:h><text:h text:style-name="Head 3" text:level="3" >Shape Objects in Text</text:h><text:h text:style-name="Head 3" text:level="3" >Redline</text:h><text:h text:style-name="Head 3" text:level="3" >Ruby</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Text Document</text:h><text:h text:style-name="Head 1" text:level="1" >Spreadsheet Documents</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Spreadsheet Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Spreadsheet Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Editing Spreadsheets</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Spreadsheet Document</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Spreadsheet Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Drawings and Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Draw/Impress Files</text:h><text:h text:style-name="Head 3" text:level="3" >Saving</text:h><text:h text:style-name="Head 3" text:level="3" >Printing</text:h><text:h text:style-name="Head 3" text:level="3" >Running Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Working with a Draw/Impress Document</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Draw/Impress Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Draw/Impress Document</text:h><text:h text:style-name="Head 1" text:level="1" >Charts</text:h><text:h text:style-name="Head 2" text:level="2" >Chart Basics</text:h><text:h text:style-name="Head 2" text:level="2" >Creating a Chart Document</text:h><text:h text:style-name="Head 2" text:level="2" >Editing a Chart Document</text:h><text:h text:style-name="Head 3" text:level="3" >Common Diagram API</text:h><text:h text:style-name="Head 3" text:level="3" >Different Chart Types</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Chart Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Basic and Dialogs</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:h text:style-name="Head 2" text:level="2" >Library Organization</text:h><text:h text:style-name="Head 2" text:level="2" >IDE with Dialogs and Events</text:h><text:h text:style-name="Head 2" text:level="2" >Using [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 2" text:level="2" >Toolkit Controls and their Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating Dialogs at Runtime</text:h><text:h text:style-name="Head 1" text:level="1" >Database Access</text:h><text:h text:style-name="Head 2" text:level="2" >Features of the [PRODUCTNAME] Database Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Capabilities</text:h><text:h text:style-name="Head 3" text:level="3" >SDBC, SDBCX, SDB Architecture</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Datasources with [PRODUCTNAME]</text:h><text:h text:style-name="Head 3" text:level="3" >DataSources</text:h><text:h text:style-name="Head 3" text:level="3" >Adding and Editing Datasources </text:h><text:h text:style-name="Head 3" text:level="3" >Establishing a Connection</text:h><text:h text:style-name="Head 4" text:level="4" >Getting Connections</text:h><text:h text:style-name="Head 4" text:level="4" >Driver specifics</text:h><text:h text:style-name="Head 3" text:level="3" >Connection Pooling</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Saved Queries</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Data</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Statements</text:h><text:h text:style-name="Head 3" text:level="3" >Resultsets</text:h><text:h text:style-name="Head 3" text:level="3" >Metadata</text:h><text:h text:style-name="Head 3" text:level="3" >Rowsets</text:h><text:h text:style-name="Head 2" text:level="2" >Working with the Database Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using DDL to change the DB Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using SDBCX to access the DB Design</text:h><text:h text:style-name="Head 2" text:level="2" >Using DBMS Features</text:h><text:h text:style-name="Head 3" text:level="3" >Stored Procedures</text:h><text:h text:style-name="Head 3" text:level="3" >Transaction Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Prepared Statements</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Database Drivers</text:h><text:h text:style-name="Head 1" text:level="1" >Forms</text:h><text:h text:style-name="Head 2" text:level="2" >Concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Models and Views</text:h><text:h text:style-name="Head 3" text:level="3" >Form Elements in the Document Model</text:h><text:h text:style-name="Head 3" text:level="3" >Special Form Components</text:h><text:h text:style-name="Head 3" text:level="3" >Events</text:h><text:h text:style-name="Head 3" text:level="3" >Data Awareness</text:h><text:h text:style-name="Head 2" text:level="2" >Recipes</text:h><text:h text:style-name="Head 3" text:level="3" >Making it easier to work with a Form</text:h><text:h text:style-name="Head 3" text:level="3" >Controlling the Data Input</text:h><text:h text:style-name="Head 3" text:level="3" >Collecting Data automatically</text:h><text:h text:style-name="Head 3" text:level="3" >Taking Advantage of Database Server Features</text:h><text:h text:style-name="Head 3" text:level="3" >Adding new Functionality</text:h><text:h text:style-name="Head 3" text:level="3" >Handling Errors</text:h><text:h text:style-name="Head 1" text:level="1" >UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Purpose of UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Document Contents as Streams</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Content Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating, Moving and Copying Document and Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Additional Commands</text:h><text:h text:style-name="Head 2" text:level="2" >Writing a Content Provider</text:h><text:h text:style-name="Head 1" text:level="1" >[PRODUCTNAME] Configuration</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing configuration data</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Configuration Data</text:h><text:h text:style-name="Head 1" text:level="1" >Appendix</text:h></office:body> + +<office:body ><text:sequence-decls ><text:sequence-decl text:display-outline-level="0" text:name="Illustration" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Table" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Text" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Drawing" ></text:sequence-decl></text:sequence-decls><text:p text:style-name="P1" >Programmer's Manual</text:p><text:p text:style-name="P2" >Planned Outline</text:p><text:p text:style-name="P2" ></text:p><text:h text:style-name="Head 1" text:level="1" >Preface (3 Pages)</text:h><text:h text:style-name="Head 1" text:level="1" >First Steps (24 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Programming with UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Fields of Application for UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Getting Started</text:h><text:h text:style-name="Head 3" text:level="3" >Required Files</text:h><text:h text:style-name="Head 3" text:level="3" >Configuration</text:h><text:h text:style-name="Head 3" text:level="3" >First Connection</text:h><text:h text:style-name="Head 2" text:level="2" >How to get Objects in [PRODUCTNAME]</text:h><text:h text:style-name="Head 2" text:level="2" >How to work with Objects</text:h><text:p text:style-name="Paragraph" >Example</text:p><text:h text:style-name="Head 3" text:level="3" >Services</text:h><text:h text:style-name="Head 3" text:level="3" >Querying Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >ElementAccess</text:h><text:h text:style-name="Head 3" text:level="3" >Simple Types</text:h><text:h text:style-name="Head 3" text:level="3" >Strings</text:h><text:h text:style-name="Head 3" text:level="3" >Enums and Constant Groups</text:h><text:h text:style-name="Head 3" text:level="3" >Structs</text:h><text:h text:style-name="Head 3" text:level="3" >Any</text:h><text:h text:style-name="Head 3" text:level="3" >Sequence</text:h><text:h text:style-name="Head 2" text:level="2" >How to find the solution for a problem</text:h><text:h text:style-name="Head 2" text:level="2" >Finding your Way through the API Reference</text:h><text:h text:style-name="Head 2" text:level="2" >Common Mechanisms</text:h><text:h text:style-name="Head 3" text:level="3" >Text</text:h><text:h text:style-name="Head 3" text:level="3" >Table</text:h><text:h text:style-name="Head 3" text:level="3" >Drawing</text:h><text:h text:style-name="Head 1" text:level="1" >UNO in Professional Projects (<text:span text:style-name="T1" >145</text:span>)</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:p text:style-name="Paragraph" >UNO/API constituents: How UNOIDL/API, ServiceManager, Bridges, CoreReflection work together</text:p><text:h text:style-name="Head 2" text:level="2" >API Concepts</text:h><text:p text:style-name="Paragraph" >API is a language independent, abstract specification for UNO objects which are used in <text:s ></text:s>[PRODUCTNAME]</text:p><text:h text:style-name="Head 3" text:level="3" >Types in the API Reference</text:h><text:h text:style-name="Head 4" text:level="4" >Simple Types</text:h><text:h text:style-name="Head 4" text:level="4" >The Any Type</text:h><text:h text:style-name="Head 4" text:level="4" >Interfaces</text:h><text:h text:style-name="Head 4" text:level="4" >Services</text:h><text:h text:style-name="Head 4" text:level="4" >Modules</text:h><text:h text:style-name="Head 4" text:level="4" >Structs</text:h><text:h text:style-name="Head 4" text:level="4" >Constant Groups and Enums</text:h><text:h text:style-name="Head 4" text:level="4" >Sequences</text:h><text:h text:style-name="Head 4" text:level="4" >Exceptions</text:h><text:h text:style-name="Head 3" text:level="3" >API Principles</text:h><text:h text:style-name="Head 4" text:level="4" >Relationship between Specification, Implementation and Instances</text:h><text:h text:style-name="Head 4" text:level="4" >Object Composition</text:h><text:h text:style-name="Head 2" text:level="2" >UNO Concepts</text:h><text:p text:style-name="Paragraph" >UNO is an environment for networked object communication</text:p><text:h text:style-name="Head 3" text:level="3" >Interprocess Connections</text:h><text:h text:style-name="Head 3" text:level="3" >ServiceManager and ComponentContext</text:h><text:h text:style-name="Head 3" text:level="3" >Using UNO Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >Using Collections and Containers</text:h><text:h text:style-name="Head 3" text:level="3" >Event Model</text:h><text:h text:style-name="Head 3" text:level="3" >Exception Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Lifetime Control</text:h><text:h text:style-name="Head 3" text:level="3" >Object Identity</text:h><text:h text:style-name="Head 2" text:level="2" >Language Bindings</text:h><text:h text:style-name="Head 3" text:level="3" >Introduction for language binding</text:h><text:h text:style-name="Head 3" text:level="3" >Java Language Binding</text:h><text:h text:style-name="Head 3" text:level="3" >C++ Binding</text:h><text:h text:style-name="Head 3" text:level="3" >Access for [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 3" text:level="3" >Automation</text:h><text:h text:style-name="Head 1" text:level="1" >Writing UNO components</text:h><text:h text:style-name="Head 2" text:level="2" >Specifying a new Component</text:h><text:h text:style-name="Head 3" text:level="3" >UNOIDL language specification</text:h><text:h text:style-name="Head 2" text:level="2" >Implementing a Component</text:h><text:h text:style-name="Head 3" text:level="3" >Component Development Basics</text:h><text:unordered-list text:style-name="L1" ><text:list-item ><text:p text:style-name="P3" >Introduction</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >Mandatory interfaces: XInterface, XServiceInfo ((from UseInterfaces.CoreInterfaces))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >"Should be implemented" interfaces: XTypeProvider ((from UseInterfaces.CoreInterfaces ))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >optional interface: XMain for standalone execution</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Simple Component in Java</text:h><text:unordered-list text:style-name="L2" ><text:list-item ><text:p text:style-name="P4" >Getting the service manager ((Chapter Java components from unoBindingJava))</text:p></text:list-item><text:list-item ><text:p text:style-name="P4" >simple component chapter</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >C++ Component</text:h><text:h text:style-name="Head 3" text:level="3" >((Automation Component?))</text:h><text:h text:style-name="Head 2" text:level="2" >Deployment Options for Components</text:h><text:h text:style-name="Head 3" text:level="3" >Component Registration</text:h><text:h text:style-name="Head 3" text:level="3" >Service Manager Configuration</text:h><text:unordered-list text:style-name="L3" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P5" >XSet Interface</text:p><text:p text:style-name="P5" >Adding components during runtime, particularly interesting during development</text:p></text:list-item><text:list-item ><text:p text:style-name="P5" >ServiceManager Content</text:p><text:p text:style-name="P5" >Dynamically modifying the ServiceManager</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Bootstrapping the Service Manager ((from CppBind chapter))</text:h><text:unordered-list text:style-name="L4" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P6" >Simple Test Application</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >Configuring Your Application with Bootstrap Parameters</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >The UNO Executable</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Standalone Runtime Environment</text:h><text:p text:style-name="Paragraph" ><text:tab-stop ></text:tab-stop>The UNO executable and XMain</text:p><text:h text:style-name="Head 3" text:level="3" >Configuring the Java Runtime Environment</text:h><text:unordered-list text:style-name="L5" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P7" >The office and Java ((from UnoBindingJava))</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 1" text:level="1" >Advanced UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Design Patterns</text:h><text:h text:style-name="Head 2" text:level="2" >Bridging concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Requirements for Language Bindings and Bridges</text:h><text:h text:style-name="Head 3" text:level="3" >New Scripting Engines</text:h><text:h text:style-name="Head 2" text:level="2" >ServiceManager and loader</text:h><text:h text:style-name="Head 2" text:level="2" >Special Interfaces for internal use</text:h><text:p text:style-name="Paragraph" >XUNOTunnel</text:p><text:p text:style-name="Paragraph" >XAggregation</text:p><text:h text:style-name="Head 2" text:level="2" >UNO Reflection API</text:h><text:h text:style-name="Head 2" text:level="2" >TypeLibrary and TypeProviders</text:h><text:h text:style-name="Head 2" text:level="2" >Differences from Corba</text:h><text:h text:style-name="Head 1" text:level="1" >Office Development</text:h><text:h text:style-name="Head 2" text:level="2" >Global Object Structure</text:h><text:h text:style-name="Head 3" text:level="3" >Desktop Environment</text:h><text:h text:style-name="Head 3" text:level="3" >Frames and Frame Hierarchies</text:h><text:h text:style-name="Head 3" text:level="3" >Frame-Controller-Model Paradigm</text:h><text:h text:style-name="Head 3" text:level="3" >Loading and Saving Office Components</text:h><text:h text:style-name="Head 3" text:level="3" >Dispatch Framework</text:h><text:h text:style-name="Head 2" text:level="2" >Common Features</text:h><text:h text:style-name="Head 3" text:level="3" >Common Dialogs</text:h><text:h text:style-name="Head 3" text:level="3" >DocumentInfo</text:h><text:h text:style-name="Head 3" text:level="3" >Styles</text:h><text:h text:style-name="Head 3" text:level="3" >Search and Replace</text:h><text:h text:style-name="Head 3" text:level="3" >Number Formats</text:h><text:h text:style-name="Head 3" text:level="3" >Package File Formats</text:h><text:h text:style-name="Head 2" text:level="2" >Internationalization</text:h><text:h text:style-name="Head 2" text:level="2" >Linguistic</text:h><text:h text:style-name="Head 2" text:level="2" >System Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Clipboard</text:h><text:h text:style-name="Head 3" text:level="3" >File Picker</text:h><text:h text:style-name="Head 3" text:level="3" >Bridging to the Window System</text:h><text:p text:style-name="Paragraph" ></text:p><text:h text:style-name="Head 1" text:level="1" >Text Documents (51,5 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Text Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Text Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Using Text</text:h><text:h text:style-name="Head 3" text:level="3" >Tables</text:h><text:h text:style-name="Head 3" text:level="3" >Text Fields</text:h><text:h text:style-name="Head 3" text:level="3" >Bookmarks</text:h><text:h text:style-name="Head 3" text:level="3" >Indexes and Index Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Reference Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Footnotes and Endnotes</text:h><text:h text:style-name="Head 3" text:level="3" >Shape Objects in Text</text:h><text:h text:style-name="Head 3" text:level="3" >Redline</text:h><text:h text:style-name="Head 3" text:level="3" >Ruby</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Text Document</text:h><text:h text:style-name="Head 1" text:level="1" >Spreadsheet Documents</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Spreadsheet Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Spreadsheet Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Editing Spreadsheets</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Spreadsheet Document</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Spreadsheet Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Drawings and Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Draw/Impress Files</text:h><text:h text:style-name="Head 3" text:level="3" >Saving</text:h><text:h text:style-name="Head 3" text:level="3" >Printing</text:h><text:h text:style-name="Head 3" text:level="3" >Running Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Working with a Draw/Impress Document</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Draw/Impress Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Draw/Impress Document</text:h><text:h text:style-name="Head 1" text:level="1" >Charts</text:h><text:h text:style-name="Head 2" text:level="2" >Chart Basics</text:h><text:h text:style-name="Head 2" text:level="2" >Creating a Chart Document</text:h><text:h text:style-name="Head 2" text:level="2" >Editing a Chart Document</text:h><text:h text:style-name="Head 3" text:level="3" >Common Diagram API</text:h><text:h text:style-name="Head 3" text:level="3" >Different Chart Types</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Chart Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Basic and Dialogs</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:h text:style-name="Head 2" text:level="2" >Library Organization</text:h><text:h text:style-name="Head 2" text:level="2" >IDE with Dialogs and Events</text:h><text:h text:style-name="Head 2" text:level="2" >Using [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 2" text:level="2" >Toolkit Controls and their Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating Dialogs at Runtime</text:h><text:h text:style-name="Head 1" text:level="1" >Database Access</text:h><text:h text:style-name="Head 2" text:level="2" >Features of the [PRODUCTNAME] Database Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Capabilities</text:h><text:h text:style-name="Head 3" text:level="3" >SDBC, SDBCX, SDB Architecture</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Datasources with [PRODUCTNAME]</text:h><text:h text:style-name="Head 3" text:level="3" >DataSources</text:h><text:h text:style-name="Head 3" text:level="3" >Adding and Editing Datasources </text:h><text:h text:style-name="Head 3" text:level="3" >Establishing a Connection</text:h><text:h text:style-name="Head 4" text:level="4" >Getting Connections</text:h><text:h text:style-name="Head 4" text:level="4" >Driver specifics</text:h><text:h text:style-name="Head 3" text:level="3" >Connection Pooling</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Saved Queries</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Data</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Statements</text:h><text:h text:style-name="Head 3" text:level="3" >Resultsets</text:h><text:h text:style-name="Head 3" text:level="3" >Metadata</text:h><text:h text:style-name="Head 3" text:level="3" >Rowsets</text:h><text:h text:style-name="Head 2" text:level="2" >Working with the Database Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using DDL to change the DB Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using SDBCX to access the DB Design</text:h><text:h text:style-name="Head 2" text:level="2" >Using DBMS Features</text:h><text:h text:style-name="Head 3" text:level="3" >Stored Procedures</text:h><text:h text:style-name="Head 3" text:level="3" >Transaction Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Prepared Statements</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Database Drivers</text:h><text:h text:style-name="Head 1" text:level="1" >Forms</text:h><text:h text:style-name="Head 2" text:level="2" >Concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Models and Views</text:h><text:h text:style-name="Head 3" text:level="3" >Form Elements in the Document Model</text:h><text:h text:style-name="Head 3" text:level="3" >Special Form Components</text:h><text:h text:style-name="Head 3" text:level="3" >Events</text:h><text:h text:style-name="Head 3" text:level="3" >Data Awareness</text:h><text:h text:style-name="Head 2" text:level="2" >Recipes</text:h><text:h text:style-name="Head 3" text:level="3" >Making it easier to work with a Form</text:h><text:h text:style-name="Head 3" text:level="3" >Controlling the Data Input</text:h><text:h text:style-name="Head 3" text:level="3" >Collecting Data automatically</text:h><text:h text:style-name="Head 3" text:level="3" >Taking Advantage of Database Server Features</text:h><text:h text:style-name="Head 3" text:level="3" >Adding new Functionality</text:h><text:h text:style-name="Head 3" text:level="3" >Handling Errors</text:h><text:h text:style-name="Head 1" text:level="1" >UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Purpose of UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Document Contents as Streams</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Content Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating, Moving and Copying Document and Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Additional Commands</text:h><text:h text:style-name="Head 2" text:level="2" >Writing a Content Provider</text:h><text:h text:style-name="Head 1" text:level="1" >[PRODUCTNAME] Configuration</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing configuration data</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Configuration Data</text:h><text:h text:style-name="Head 1" text:level="1" >Appendix</text:h></office:body> + +<office:body ><text:sequence-decls ><text:sequence-decl text:display-outline-level="0" text:name="Illustration" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Table" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Text" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Drawing" ></text:sequence-decl></text:sequence-decls><text:p text:style-name="P1" >Programmer's Manual</text:p><text:p text:style-name="P2" >Planned Outline</text:p><text:p text:style-name="P2" ></text:p><text:h text:style-name="Head 1" text:level="1" >Preface (3 Pages)</text:h><text:h text:style-name="Head 1" text:level="1" >First Steps (24 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Programming with UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Fields of Application for UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Getting Started</text:h><text:h text:style-name="Head 3" text:level="3" >Required Files</text:h><text:h text:style-name="Head 3" text:level="3" >Configuration</text:h><text:h text:style-name="Head 3" text:level="3" >First Connection</text:h><text:h text:style-name="Head 2" text:level="2" >How to get Objects in [PRODUCTNAME]</text:h><text:h text:style-name="Head 2" text:level="2" >How to work with Objects</text:h><text:p text:style-name="Paragraph" >Example</text:p><text:h text:style-name="Head 3" text:level="3" >Services</text:h><text:h text:style-name="Head 3" text:level="3" >Querying Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >ElementAccess</text:h><text:h text:style-name="Head 3" text:level="3" >Simple Types</text:h><text:h text:style-name="Head 3" text:level="3" >Strings</text:h><text:h text:style-name="Head 3" text:level="3" >Enums and Constant Groups</text:h><text:h text:style-name="Head 3" text:level="3" >Structs</text:h><text:h text:style-name="Head 3" text:level="3" >Any</text:h><text:h text:style-name="Head 3" text:level="3" >Sequence</text:h><text:h text:style-name="Head 2" text:level="2" >How to find the solution for a problem</text:h><text:h text:style-name="Head 2" text:level="2" >Finding your Way through the API Reference</text:h><text:h text:style-name="Head 2" text:level="2" >Common Mechanisms</text:h><text:h text:style-name="Head 3" text:level="3" >Text</text:h><text:h text:style-name="Head 3" text:level="3" >Table</text:h><text:h text:style-name="Head 3" text:level="3" >Drawing</text:h><text:h text:style-name="Head 1" text:level="1" >UNO in Professional Projects (<text:span text:style-name="T1" >145</text:span>)</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:p text:style-name="Paragraph" >UNO/API constituents: How UNOIDL/API, ServiceManager, Bridges, CoreReflection work together</text:p><text:h text:style-name="Head 2" text:level="2" >API Concepts</text:h><text:p text:style-name="Paragraph" >API is a language independent, abstract specification for UNO objects which are used in <text:s ></text:s>[PRODUCTNAME]</text:p><text:h text:style-name="Head 3" text:level="3" >Types in the API Reference</text:h><text:h text:style-name="Head 4" text:level="4" >Simple Types</text:h><text:h text:style-name="Head 4" text:level="4" >The Any Type</text:h><text:h text:style-name="Head 4" text:level="4" >Interfaces</text:h><text:h text:style-name="Head 4" text:level="4" >Services</text:h><text:h text:style-name="Head 4" text:level="4" >Modules</text:h><text:h text:style-name="Head 4" text:level="4" >Structs</text:h><text:h text:style-name="Head 4" text:level="4" >Constant Groups and Enums</text:h><text:h text:style-name="Head 4" text:level="4" >Sequences</text:h><text:h text:style-name="Head 4" text:level="4" >Exceptions</text:h><text:h text:style-name="Head 3" text:level="3" >API Principles</text:h><text:h text:style-name="Head 4" text:level="4" >Relationship between Specification, Implementation and Instances</text:h><text:h text:style-name="Head 4" text:level="4" >Object Composition</text:h><text:h text:style-name="Head 2" text:level="2" >UNO Concepts</text:h><text:p text:style-name="Paragraph" >UNO is an environment for networked object communication</text:p><text:h text:style-name="Head 3" text:level="3" >Interprocess Connections</text:h><text:h text:style-name="Head 3" text:level="3" >ServiceManager and ComponentContext</text:h><text:h text:style-name="Head 3" text:level="3" >Using UNO Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >Using Collections and Containers</text:h><text:h text:style-name="Head 3" text:level="3" >Event Model</text:h><text:h text:style-name="Head 3" text:level="3" >Exception Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Lifetime Control</text:h><text:h text:style-name="Head 3" text:level="3" >Object Identity</text:h><text:h text:style-name="Head 2" text:level="2" >Language Bindings</text:h><text:h text:style-name="Head 3" text:level="3" >Introduction for language binding</text:h><text:h text:style-name="Head 3" text:level="3" >Java Language Binding</text:h><text:h text:style-name="Head 3" text:level="3" >C++ Binding</text:h><text:h text:style-name="Head 3" text:level="3" >Access for [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 3" text:level="3" >Automation</text:h><text:h text:style-name="Head 1" text:level="1" >Writing UNO components</text:h><text:h text:style-name="Head 2" text:level="2" >Specifying a new Component</text:h><text:h text:style-name="Head 3" text:level="3" >UNOIDL language specification</text:h><text:h text:style-name="Head 2" text:level="2" >Implementing a Component</text:h><text:h text:style-name="Head 3" text:level="3" >Component Development Basics</text:h><text:unordered-list text:style-name="L1" ><text:list-item ><text:p text:style-name="P3" >Introduction</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >Mandatory interfaces: XInterface, XServiceInfo ((from UseInterfaces.CoreInterfaces))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >"Should be implemented" interfaces: XTypeProvider ((from UseInterfaces.CoreInterfaces ))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >optional interface: XMain for standalone execution</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Simple Component in Java</text:h><text:unordered-list text:style-name="L2" ><text:list-item ><text:p text:style-name="P4" >Getting the service manager ((Chapter Java components from unoBindingJava))</text:p></text:list-item><text:list-item ><text:p text:style-name="P4" >simple component chapter</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >C++ Component</text:h><text:h text:style-name="Head 3" text:level="3" >((Automation Component?))</text:h><text:h text:style-name="Head 2" text:level="2" >Deployment Options for Components</text:h><text:h text:style-name="Head 3" text:level="3" >Component Registration</text:h><text:h text:style-name="Head 3" text:level="3" >Service Manager Configuration</text:h><text:unordered-list text:style-name="L3" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P5" >XSet Interface</text:p><text:p text:style-name="P5" >Adding components during runtime, particularly interesting during development</text:p></text:list-item><text:list-item ><text:p text:style-name="P5" >ServiceManager Content</text:p><text:p text:style-name="P5" >Dynamically modifying the ServiceManager</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Bootstrapping the Service Manager ((from CppBind chapter))</text:h><text:unordered-list text:style-name="L4" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P6" >Simple Test Application</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >Configuring Your Application with Bootstrap Parameters</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >The UNO Executable</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Standalone Runtime Environment</text:h><text:p text:style-name="Paragraph" ><text:tab-stop ></text:tab-stop>The UNO executable and XMain</text:p><text:h text:style-name="Head 3" text:level="3" >Configuring the Java Runtime Environment</text:h><text:unordered-list text:style-name="L5" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P7" >The office and Java ((from UnoBindingJava))</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 1" text:level="1" >Advanced UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Design Patterns</text:h><text:h text:style-name="Head 2" text:level="2" >Bridging concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Requirements for Language Bindings and Bridges</text:h><text:h text:style-name="Head 3" text:level="3" >New Scripting Engines</text:h><text:h text:style-name="Head 2" text:level="2" >ServiceManager and loader</text:h><text:h text:style-name="Head 2" text:level="2" >Special Interfaces for internal use</text:h><text:p text:style-name="Paragraph" >XUNOTunnel</text:p><text:p text:style-name="Paragraph" >XAggregation</text:p><text:h text:style-name="Head 2" text:level="2" >UNO Reflection API</text:h><text:h text:style-name="Head 2" text:level="2" >TypeLibrary and TypeProviders</text:h><text:h text:style-name="Head 2" text:level="2" >Differences from Corba</text:h><text:h text:style-name="Head 1" text:level="1" >Office Development</text:h><text:h text:style-name="Head 2" text:level="2" >Global Object Structure</text:h><text:h text:style-name="Head 3" text:level="3" >Desktop Environment</text:h><text:h text:style-name="Head 3" text:level="3" >Frames and Frame Hierarchies</text:h><text:h text:style-name="Head 3" text:level="3" >Frame-Controller-Model Paradigm</text:h><text:h text:style-name="Head 3" text:level="3" >Loading and Saving Office Components</text:h><text:h text:style-name="Head 3" text:level="3" >Dispatch Framework</text:h><text:h text:style-name="Head 2" text:level="2" >Common Features</text:h><text:h text:style-name="Head 3" text:level="3" >Common Dialogs</text:h><text:h text:style-name="Head 3" text:level="3" >DocumentInfo</text:h><text:h text:style-name="Head 3" text:level="3" >Styles</text:h><text:h text:style-name="Head 3" text:level="3" >Search and Replace</text:h><text:h text:style-name="Head 3" text:level="3" >Number Formats</text:h><text:h text:style-name="Head 3" text:level="3" >Package File Formats</text:h><text:h text:style-name="Head 2" text:level="2" >Internationalization</text:h><text:h text:style-name="Head 2" text:level="2" >Linguistic</text:h><text:h text:style-name="Head 2" text:level="2" >System Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Clipboard</text:h><text:h text:style-name="Head 3" text:level="3" >File Picker</text:h><text:h text:style-name="Head 3" text:level="3" >Bridging to the Window System</text:h><text:p text:style-name="Paragraph" ></text:p><text:h text:style-name="Head 1" text:level="1" >Text Documents (51,5 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Text Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Text Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Using Text</text:h><text:h text:style-name="Head 3" text:level="3" >Tables</text:h><text:h text:style-name="Head 3" text:level="3" >Text Fields</text:h><text:h text:style-name="Head 3" text:level="3" >Bookmarks</text:h><text:h text:style-name="Head 3" text:level="3" >Indexes and Index Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Reference Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Footnotes and Endnotes</text:h><text:h text:style-name="Head 3" text:level="3" >Shape Objects in Text</text:h><text:h text:style-name="Head 3" text:level="3" >Redline</text:h><text:h text:style-name="Head 3" text:level="3" >Ruby</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Text Document</text:h><text:h text:style-name="Head 1" text:level="1" >Spreadsheet Documents</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Spreadsheet Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Spreadsheet Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Editing Spreadsheets</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Spreadsheet Document</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Spreadsheet Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Drawings and Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Draw/Impress Files</text:h><text:h text:style-name="Head 3" text:level="3" >Saving</text:h><text:h text:style-name="Head 3" text:level="3" >Printing</text:h><text:h text:style-name="Head 3" text:level="3" >Running Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Working with a Draw/Impress Document</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Draw/Impress Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Draw/Impress Document</text:h><text:h text:style-name="Head 1" text:level="1" >Charts</text:h><text:h text:style-name="Head 2" text:level="2" >Chart Basics</text:h><text:h text:style-name="Head 2" text:level="2" >Creating a Chart Document</text:h><text:h text:style-name="Head 2" text:level="2" >Editing a Chart Document</text:h><text:h text:style-name="Head 3" text:level="3" >Common Diagram API</text:h><text:h text:style-name="Head 3" text:level="3" >Different Chart Types</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Chart Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Basic and Dialogs</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:h text:style-name="Head 2" text:level="2" >Library Organization</text:h><text:h text:style-name="Head 2" text:level="2" >IDE with Dialogs and Events</text:h><text:h text:style-name="Head 2" text:level="2" >Using [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 2" text:level="2" >Toolkit Controls and their Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating Dialogs at Runtime</text:h><text:h text:style-name="Head 1" text:level="1" >Database Access</text:h><text:h text:style-name="Head 2" text:level="2" >Features of the [PRODUCTNAME] Database Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Capabilities</text:h><text:h text:style-name="Head 3" text:level="3" >SDBC, SDBCX, SDB Architecture</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Datasources with [PRODUCTNAME]</text:h><text:h text:style-name="Head 3" text:level="3" >DataSources</text:h><text:h text:style-name="Head 3" text:level="3" >Adding and Editing Datasources </text:h><text:h text:style-name="Head 3" text:level="3" >Establishing a Connection</text:h><text:h text:style-name="Head 4" text:level="4" >Getting Connections</text:h><text:h text:style-name="Head 4" text:level="4" >Driver specifics</text:h><text:h text:style-name="Head 3" text:level="3" >Connection Pooling</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Saved Queries</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Data</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Statements</text:h><text:h text:style-name="Head 3" text:level="3" >Resultsets</text:h><text:h text:style-name="Head 3" text:level="3" >Metadata</text:h><text:h text:style-name="Head 3" text:level="3" >Rowsets</text:h><text:h text:style-name="Head 2" text:level="2" >Working with the Database Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using DDL to change the DB Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using SDBCX to access the DB Design</text:h><text:h text:style-name="Head 2" text:level="2" >Using DBMS Features</text:h><text:h text:style-name="Head 3" text:level="3" >Stored Procedures</text:h><text:h text:style-name="Head 3" text:level="3" >Transaction Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Prepared Statements</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Database Drivers</text:h><text:h text:style-name="Head 1" text:level="1" >Forms</text:h><text:h text:style-name="Head 2" text:level="2" >Concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Models and Views</text:h><text:h text:style-name="Head 3" text:level="3" >Form Elements in the Document Model</text:h><text:h text:style-name="Head 3" text:level="3" >Special Form Components</text:h><text:h text:style-name="Head 3" text:level="3" >Events</text:h><text:h text:style-name="Head 3" text:level="3" >Data Awareness</text:h><text:h text:style-name="Head 2" text:level="2" >Recipes</text:h><text:h text:style-name="Head 3" text:level="3" >Making it easier to work with a Form</text:h><text:h text:style-name="Head 3" text:level="3" >Controlling the Data Input</text:h><text:h text:style-name="Head 3" text:level="3" >Collecting Data automatically</text:h><text:h text:style-name="Head 3" text:level="3" >Taking Advantage of Database Server Features</text:h><text:h text:style-name="Head 3" text:level="3" >Adding new Functionality</text:h><text:h text:style-name="Head 3" text:level="3" >Handling Errors</text:h><text:h text:style-name="Head 1" text:level="1" >UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Purpose of UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Document Contents as Streams</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Content Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating, Moving and Copying Document and Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Additional Commands</text:h><text:h text:style-name="Head 2" text:level="2" >Writing a Content Provider</text:h><text:h text:style-name="Head 1" text:level="1" >[PRODUCTNAME] Configuration</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing configuration data</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Configuration Data</text:h><text:h text:style-name="Head 1" text:level="1" >Appendix</text:h></office:body> + +<office:body ><text:sequence-decls ><text:sequence-decl text:display-outline-level="0" text:name="Illustration" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Table" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Text" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Drawing" ></text:sequence-decl></text:sequence-decls><text:p text:style-name="P1" >Programmer's Manual</text:p><text:p text:style-name="P2" >Planned Outline</text:p><text:p text:style-name="P2" ></text:p><text:h text:style-name="Head 1" text:level="1" >Preface (3 Pages)</text:h><text:h text:style-name="Head 1" text:level="1" >First Steps (24 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Programming with UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Fields of Application for UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Getting Started</text:h><text:h text:style-name="Head 3" text:level="3" >Required Files</text:h><text:h text:style-name="Head 3" text:level="3" >Configuration</text:h><text:h text:style-name="Head 3" text:level="3" >First Connection</text:h><text:h text:style-name="Head 2" text:level="2" >How to get Objects in [PRODUCTNAME]</text:h><text:h text:style-name="Head 2" text:level="2" >How to work with Objects</text:h><text:p text:style-name="Paragraph" >Example</text:p><text:h text:style-name="Head 3" text:level="3" >Services</text:h><text:h text:style-name="Head 3" text:level="3" >Querying Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >ElementAccess</text:h><text:h text:style-name="Head 3" text:level="3" >Simple Types</text:h><text:h text:style-name="Head 3" text:level="3" >Strings</text:h><text:h text:style-name="Head 3" text:level="3" >Enums and Constant Groups</text:h><text:h text:style-name="Head 3" text:level="3" >Structs</text:h><text:h text:style-name="Head 3" text:level="3" >Any</text:h><text:h text:style-name="Head 3" text:level="3" >Sequence</text:h><text:h text:style-name="Head 2" text:level="2" >How to find the solution for a problem</text:h><text:h text:style-name="Head 2" text:level="2" >Finding your Way through the API Reference</text:h><text:h text:style-name="Head 2" text:level="2" >Common Mechanisms</text:h><text:h text:style-name="Head 3" text:level="3" >Text</text:h><text:h text:style-name="Head 3" text:level="3" >Table</text:h><text:h text:style-name="Head 3" text:level="3" >Drawing</text:h><text:h text:style-name="Head 1" text:level="1" >UNO in Professional Projects (<text:span text:style-name="T1" >145</text:span>)</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:p text:style-name="Paragraph" >UNO/API constituents: How UNOIDL/API, ServiceManager, Bridges, CoreReflection work together</text:p><text:h text:style-name="Head 2" text:level="2" >API Concepts</text:h><text:p text:style-name="Paragraph" >API is a language independent, abstract specification for UNO objects which are used in <text:s ></text:s>[PRODUCTNAME]</text:p><text:h text:style-name="Head 3" text:level="3" >Types in the API Reference</text:h><text:h text:style-name="Head 4" text:level="4" >Simple Types</text:h><text:h text:style-name="Head 4" text:level="4" >The Any Type</text:h><text:h text:style-name="Head 4" text:level="4" >Interfaces</text:h><text:h text:style-name="Head 4" text:level="4" >Services</text:h><text:h text:style-name="Head 4" text:level="4" >Modules</text:h><text:h text:style-name="Head 4" text:level="4" >Structs</text:h><text:h text:style-name="Head 4" text:level="4" >Constant Groups and Enums</text:h><text:h text:style-name="Head 4" text:level="4" >Sequences</text:h><text:h text:style-name="Head 4" text:level="4" >Exceptions</text:h><text:h text:style-name="Head 3" text:level="3" >API Principles</text:h><text:h text:style-name="Head 4" text:level="4" >Relationship between Specification, Implementation and Instances</text:h><text:h text:style-name="Head 4" text:level="4" >Object Composition</text:h><text:h text:style-name="Head 2" text:level="2" >UNO Concepts</text:h><text:p text:style-name="Paragraph" >UNO is an environment for networked object communication</text:p><text:h text:style-name="Head 3" text:level="3" >Interprocess Connections</text:h><text:h text:style-name="Head 3" text:level="3" >ServiceManager and ComponentContext</text:h><text:h text:style-name="Head 3" text:level="3" >Using UNO Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >Using Collections and Containers</text:h><text:h text:style-name="Head 3" text:level="3" >Event Model</text:h><text:h text:style-name="Head 3" text:level="3" >Exception Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Lifetime Control</text:h><text:h text:style-name="Head 3" text:level="3" >Object Identity</text:h><text:h text:style-name="Head 2" text:level="2" >Language Bindings</text:h><text:h text:style-name="Head 3" text:level="3" >Introduction for language binding</text:h><text:h text:style-name="Head 3" text:level="3" >Java Language Binding</text:h><text:h text:style-name="Head 3" text:level="3" >C++ Binding</text:h><text:h text:style-name="Head 3" text:level="3" >Access for [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 3" text:level="3" >Automation</text:h><text:h text:style-name="Head 1" text:level="1" >Writing UNO components</text:h><text:h text:style-name="Head 2" text:level="2" >Specifying a new Component</text:h><text:h text:style-name="Head 3" text:level="3" >UNOIDL language specification</text:h><text:h text:style-name="Head 2" text:level="2" >Implementing a Component</text:h><text:h text:style-name="Head 3" text:level="3" >Component Development Basics</text:h><text:unordered-list text:style-name="L1" ><text:list-item ><text:p text:style-name="P3" >Introduction</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >Mandatory interfaces: XInterface, XServiceInfo ((from UseInterfaces.CoreInterfaces))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >"Should be implemented" interfaces: XTypeProvider ((from UseInterfaces.CoreInterfaces ))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >optional interface: XMain for standalone execution</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Simple Component in Java</text:h><text:unordered-list text:style-name="L2" ><text:list-item ><text:p text:style-name="P4" >Getting the service manager ((Chapter Java components from unoBindingJava))</text:p></text:list-item><text:list-item ><text:p text:style-name="P4" >simple component chapter</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >C++ Component</text:h><text:h text:style-name="Head 3" text:level="3" >((Automation Component?))</text:h><text:h text:style-name="Head 2" text:level="2" >Deployment Options for Components</text:h><text:h text:style-name="Head 3" text:level="3" >Component Registration</text:h><text:h text:style-name="Head 3" text:level="3" >Service Manager Configuration</text:h><text:unordered-list text:style-name="L3" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P5" >XSet Interface</text:p><text:p text:style-name="P5" >Adding components during runtime, particularly interesting during development</text:p></text:list-item><text:list-item ><text:p text:style-name="P5" >ServiceManager Content</text:p><text:p text:style-name="P5" >Dynamically modifying the ServiceManager</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Bootstrapping the Service Manager ((from CppBind chapter))</text:h><text:unordered-list text:style-name="L4" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P6" >Simple Test Application</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >Configuring Your Application with Bootstrap Parameters</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >The UNO Executable</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Standalone Runtime Environment</text:h><text:p text:style-name="Paragraph" ><text:tab-stop ></text:tab-stop>The UNO executable and XMain</text:p><text:h text:style-name="Head 3" text:level="3" >Configuring the Java Runtime Environment</text:h><text:unordered-list text:style-name="L5" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P7" >The office and Java ((from UnoBindingJava))</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 1" text:level="1" >Advanced UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Design Patterns</text:h><text:h text:style-name="Head 2" text:level="2" >Bridging concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Requirements for Language Bindings and Bridges</text:h><text:h text:style-name="Head 3" text:level="3" >New Scripting Engines</text:h><text:h text:style-name="Head 2" text:level="2" >ServiceManager and loader</text:h><text:h text:style-name="Head 2" text:level="2" >Special Interfaces for internal use</text:h><text:p text:style-name="Paragraph" >XUNOTunnel</text:p><text:p text:style-name="Paragraph" >XAggregation</text:p><text:h text:style-name="Head 2" text:level="2" >UNO Reflection API</text:h><text:h text:style-name="Head 2" text:level="2" >TypeLibrary and TypeProviders</text:h><text:h text:style-name="Head 2" text:level="2" >Differences from Corba</text:h><text:h text:style-name="Head 1" text:level="1" >Office Development</text:h><text:h text:style-name="Head 2" text:level="2" >Global Object Structure</text:h><text:h text:style-name="Head 3" text:level="3" >Desktop Environment</text:h><text:h text:style-name="Head 3" text:level="3" >Frames and Frame Hierarchies</text:h><text:h text:style-name="Head 3" text:level="3" >Frame-Controller-Model Paradigm</text:h><text:h text:style-name="Head 3" text:level="3" >Loading and Saving Office Components</text:h><text:h text:style-name="Head 3" text:level="3" >Dispatch Framework</text:h><text:h text:style-name="Head 2" text:level="2" >Common Features</text:h><text:h text:style-name="Head 3" text:level="3" >Common Dialogs</text:h><text:h text:style-name="Head 3" text:level="3" >DocumentInfo</text:h><text:h text:style-name="Head 3" text:level="3" >Styles</text:h><text:h text:style-name="Head 3" text:level="3" >Search and Replace</text:h><text:h text:style-name="Head 3" text:level="3" >Number Formats</text:h><text:h text:style-name="Head 3" text:level="3" >Package File Formats</text:h><text:h text:style-name="Head 2" text:level="2" >Internationalization</text:h><text:h text:style-name="Head 2" text:level="2" >Linguistic</text:h><text:h text:style-name="Head 2" text:level="2" >System Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Clipboard</text:h><text:h text:style-name="Head 3" text:level="3" >File Picker</text:h><text:h text:style-name="Head 3" text:level="3" >Bridging to the Window System</text:h><text:p text:style-name="Paragraph" ></text:p><text:h text:style-name="Head 1" text:level="1" >Text Documents (51,5 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Text Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Text Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Using Text</text:h><text:h text:style-name="Head 3" text:level="3" >Tables</text:h><text:h text:style-name="Head 3" text:level="3" >Text Fields</text:h><text:h text:style-name="Head 3" text:level="3" >Bookmarks</text:h><text:h text:style-name="Head 3" text:level="3" >Indexes and Index Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Reference Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Footnotes and Endnotes</text:h><text:h text:style-name="Head 3" text:level="3" >Shape Objects in Text</text:h><text:h text:style-name="Head 3" text:level="3" >Redline</text:h><text:h text:style-name="Head 3" text:level="3" >Ruby</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Text Document</text:h><text:h text:style-name="Head 1" text:level="1" >Spreadsheet Documents</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Spreadsheet Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Spreadsheet Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Editing Spreadsheets</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Spreadsheet Document</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Spreadsheet Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Drawings and Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Draw/Impress Files</text:h><text:h text:style-name="Head 3" text:level="3" >Saving</text:h><text:h text:style-name="Head 3" text:level="3" >Printing</text:h><text:h text:style-name="Head 3" text:level="3" >Running Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Working with a Draw/Impress Document</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Draw/Impress Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Draw/Impress Document</text:h><text:h text:style-name="Head 1" text:level="1" >Charts</text:h><text:h text:style-name="Head 2" text:level="2" >Chart Basics</text:h><text:h text:style-name="Head 2" text:level="2" >Creating a Chart Document</text:h><text:h text:style-name="Head 2" text:level="2" >Editing a Chart Document</text:h><text:h text:style-name="Head 3" text:level="3" >Common Diagram API</text:h><text:h text:style-name="Head 3" text:level="3" >Different Chart Types</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Chart Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Basic and Dialogs</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:h text:style-name="Head 2" text:level="2" >Library Organization</text:h><text:h text:style-name="Head 2" text:level="2" >IDE with Dialogs and Events</text:h><text:h text:style-name="Head 2" text:level="2" >Using [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 2" text:level="2" >Toolkit Controls and their Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating Dialogs at Runtime</text:h><text:h text:style-name="Head 1" text:level="1" >Database Access</text:h><text:h text:style-name="Head 2" text:level="2" >Features of the [PRODUCTNAME] Database Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Capabilities</text:h><text:h text:style-name="Head 3" text:level="3" >SDBC, SDBCX, SDB Architecture</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Datasources with [PRODUCTNAME]</text:h><text:h text:style-name="Head 3" text:level="3" >DataSources</text:h><text:h text:style-name="Head 3" text:level="3" >Adding and Editing Datasources </text:h><text:h text:style-name="Head 3" text:level="3" >Establishing a Connection</text:h><text:h text:style-name="Head 4" text:level="4" >Getting Connections</text:h><text:h text:style-name="Head 4" text:level="4" >Driver specifics</text:h><text:h text:style-name="Head 3" text:level="3" >Connection Pooling</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Saved Queries</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Data</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Statements</text:h><text:h text:style-name="Head 3" text:level="3" >Resultsets</text:h><text:h text:style-name="Head 3" text:level="3" >Metadata</text:h><text:h text:style-name="Head 3" text:level="3" >Rowsets</text:h><text:h text:style-name="Head 2" text:level="2" >Working with the Database Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using DDL to change the DB Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using SDBCX to access the DB Design</text:h><text:h text:style-name="Head 2" text:level="2" >Using DBMS Features</text:h><text:h text:style-name="Head 3" text:level="3" >Stored Procedures</text:h><text:h text:style-name="Head 3" text:level="3" >Transaction Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Prepared Statements</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Database Drivers</text:h><text:h text:style-name="Head 1" text:level="1" >Forms</text:h><text:h text:style-name="Head 2" text:level="2" >Concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Models and Views</text:h><text:h text:style-name="Head 3" text:level="3" >Form Elements in the Document Model</text:h><text:h text:style-name="Head 3" text:level="3" >Special Form Components</text:h><text:h text:style-name="Head 3" text:level="3" >Events</text:h><text:h text:style-name="Head 3" text:level="3" >Data Awareness</text:h><text:h text:style-name="Head 2" text:level="2" >Recipes</text:h><text:h text:style-name="Head 3" text:level="3" >Making it easier to work with a Form</text:h><text:h text:style-name="Head 3" text:level="3" >Controlling the Data Input</text:h><text:h text:style-name="Head 3" text:level="3" >Collecting Data automatically</text:h><text:h text:style-name="Head 3" text:level="3" >Taking Advantage of Database Server Features</text:h><text:h text:style-name="Head 3" text:level="3" >Adding new Functionality</text:h><text:h text:style-name="Head 3" text:level="3" >Handling Errors</text:h><text:h text:style-name="Head 1" text:level="1" >UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Purpose of UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Document Contents as Streams</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Content Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating, Moving and Copying Document and Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Additional Commands</text:h><text:h text:style-name="Head 2" text:level="2" >Writing a Content Provider</text:h><text:h text:style-name="Head 1" text:level="1" >[PRODUCTNAME] Configuration</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing configuration data</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Configuration Data</text:h><text:h text:style-name="Head 1" text:level="1" >Appendix</text:h></office:body> + +<office:body ><text:sequence-decls ><text:sequence-decl text:display-outline-level="0" text:name="Illustration" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Table" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Text" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Drawing" ></text:sequence-decl></text:sequence-decls><text:p text:style-name="P1" >Programmer's Manual</text:p><text:p text:style-name="P2" >Planned Outline</text:p><text:p text:style-name="P2" ></text:p><text:h text:style-name="Head 1" text:level="1" >Preface (3 Pages)</text:h><text:h text:style-name="Head 1" text:level="1" >First Steps (24 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Programming with UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Fields of Application for UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Getting Started</text:h><text:h text:style-name="Head 3" text:level="3" >Required Files</text:h><text:h text:style-name="Head 3" text:level="3" >Configuration</text:h><text:h text:style-name="Head 3" text:level="3" >First Connection</text:h><text:h text:style-name="Head 2" text:level="2" >How to get Objects in [PRODUCTNAME]</text:h><text:h text:style-name="Head 2" text:level="2" >How to work with Objects</text:h><text:p text:style-name="Paragraph" >Example</text:p><text:h text:style-name="Head 3" text:level="3" >Services</text:h><text:h text:style-name="Head 3" text:level="3" >Querying Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >ElementAccess</text:h><text:h text:style-name="Head 3" text:level="3" >Simple Types</text:h><text:h text:style-name="Head 3" text:level="3" >Strings</text:h><text:h text:style-name="Head 3" text:level="3" >Enums and Constant Groups</text:h><text:h text:style-name="Head 3" text:level="3" >Structs</text:h><text:h text:style-name="Head 3" text:level="3" >Any</text:h><text:h text:style-name="Head 3" text:level="3" >Sequence</text:h><text:h text:style-name="Head 2" text:level="2" >How to find the solution for a problem</text:h><text:h text:style-name="Head 2" text:level="2" >Finding your Way through the API Reference</text:h><text:h text:style-name="Head 2" text:level="2" >Common Mechanisms</text:h><text:h text:style-name="Head 3" text:level="3" >Text</text:h><text:h text:style-name="Head 3" text:level="3" >Table</text:h><text:h text:style-name="Head 3" text:level="3" >Drawing</text:h><text:h text:style-name="Head 1" text:level="1" >UNO in Professional Projects (<text:span text:style-name="T1" >145</text:span>)</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:p text:style-name="Paragraph" >UNO/API constituents: How UNOIDL/API, ServiceManager, Bridges, CoreReflection work together</text:p><text:h text:style-name="Head 2" text:level="2" >API Concepts</text:h><text:p text:style-name="Paragraph" >API is a language independent, abstract specification for UNO objects which are used in <text:s ></text:s>[PRODUCTNAME]</text:p><text:h text:style-name="Head 3" text:level="3" >Types in the API Reference</text:h><text:h text:style-name="Head 4" text:level="4" >Simple Types</text:h><text:h text:style-name="Head 4" text:level="4" >The Any Type</text:h><text:h text:style-name="Head 4" text:level="4" >Interfaces</text:h><text:h text:style-name="Head 4" text:level="4" >Services</text:h><text:h text:style-name="Head 4" text:level="4" >Modules</text:h><text:h text:style-name="Head 4" text:level="4" >Structs</text:h><text:h text:style-name="Head 4" text:level="4" >Constant Groups and Enums</text:h><text:h text:style-name="Head 4" text:level="4" >Sequences</text:h><text:h text:style-name="Head 4" text:level="4" >Exceptions</text:h><text:h text:style-name="Head 3" text:level="3" >API Principles</text:h><text:h text:style-name="Head 4" text:level="4" >Relationship between Specification, Implementation and Instances</text:h><text:h text:style-name="Head 4" text:level="4" >Object Composition</text:h><text:h text:style-name="Head 2" text:level="2" >UNO Concepts</text:h><text:p text:style-name="Paragraph" >UNO is an environment for networked object communication</text:p><text:h text:style-name="Head 3" text:level="3" >Interprocess Connections</text:h><text:h text:style-name="Head 3" text:level="3" >ServiceManager and ComponentContext</text:h><text:h text:style-name="Head 3" text:level="3" >Using UNO Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >Using Collections and Containers</text:h><text:h text:style-name="Head 3" text:level="3" >Event Model</text:h><text:h text:style-name="Head 3" text:level="3" >Exception Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Lifetime Control</text:h><text:h text:style-name="Head 3" text:level="3" >Object Identity</text:h><text:h text:style-name="Head 2" text:level="2" >Language Bindings</text:h><text:h text:style-name="Head 3" text:level="3" >Introduction for language binding</text:h><text:h text:style-name="Head 3" text:level="3" >Java Language Binding</text:h><text:h text:style-name="Head 3" text:level="3" >C++ Binding</text:h><text:h text:style-name="Head 3" text:level="3" >Access for [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 3" text:level="3" >Automation</text:h><text:h text:style-name="Head 1" text:level="1" >Writing UNO components</text:h><text:h text:style-name="Head 2" text:level="2" >Specifying a new Component</text:h><text:h text:style-name="Head 3" text:level="3" >UNOIDL language specification</text:h><text:h text:style-name="Head 2" text:level="2" >Implementing a Component</text:h><text:h text:style-name="Head 3" text:level="3" >Component Development Basics</text:h><text:unordered-list text:style-name="L1" ><text:list-item ><text:p text:style-name="P3" >Introduction</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >Mandatory interfaces: XInterface, XServiceInfo ((from UseInterfaces.CoreInterfaces))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >"Should be implemented" interfaces: XTypeProvider ((from UseInterfaces.CoreInterfaces ))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >optional interface: XMain for standalone execution</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Simple Component in Java</text:h><text:unordered-list text:style-name="L2" ><text:list-item ><text:p text:style-name="P4" >Getting the service manager ((Chapter Java components from unoBindingJava))</text:p></text:list-item><text:list-item ><text:p text:style-name="P4" >simple component chapter</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >C++ Component</text:h><text:h text:style-name="Head 3" text:level="3" >((Automation Component?))</text:h><text:h text:style-name="Head 2" text:level="2" >Deployment Options for Components</text:h><text:h text:style-name="Head 3" text:level="3" >Component Registration</text:h><text:h text:style-name="Head 3" text:level="3" >Service Manager Configuration</text:h><text:unordered-list text:style-name="L3" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P5" >XSet Interface</text:p><text:p text:style-name="P5" >Adding components during runtime, particularly interesting during development</text:p></text:list-item><text:list-item ><text:p text:style-name="P5" >ServiceManager Content</text:p><text:p text:style-name="P5" >Dynamically modifying the ServiceManager</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Bootstrapping the Service Manager ((from CppBind chapter))</text:h><text:unordered-list text:style-name="L4" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P6" >Simple Test Application</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >Configuring Your Application with Bootstrap Parameters</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >The UNO Executable</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Standalone Runtime Environment</text:h><text:p text:style-name="Paragraph" ><text:tab-stop ></text:tab-stop>The UNO executable and XMain</text:p><text:h text:style-name="Head 3" text:level="3" >Configuring the Java Runtime Environment</text:h><text:unordered-list text:style-name="L5" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P7" >The office and Java ((from UnoBindingJava))</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 1" text:level="1" >Advanced UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Design Patterns</text:h><text:h text:style-name="Head 2" text:level="2" >Bridging concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Requirements for Language Bindings and Bridges</text:h><text:h text:style-name="Head 3" text:level="3" >New Scripting Engines</text:h><text:h text:style-name="Head 2" text:level="2" >ServiceManager and loader</text:h><text:h text:style-name="Head 2" text:level="2" >Special Interfaces for internal use</text:h><text:p text:style-name="Paragraph" >XUNOTunnel</text:p><text:p text:style-name="Paragraph" >XAggregation</text:p><text:h text:style-name="Head 2" text:level="2" >UNO Reflection API</text:h><text:h text:style-name="Head 2" text:level="2" >TypeLibrary and TypeProviders</text:h><text:h text:style-name="Head 2" text:level="2" >Differences from Corba</text:h><text:h text:style-name="Head 1" text:level="1" >Office Development</text:h><text:h text:style-name="Head 2" text:level="2" >Global Object Structure</text:h><text:h text:style-name="Head 3" text:level="3" >Desktop Environment</text:h><text:h text:style-name="Head 3" text:level="3" >Frames and Frame Hierarchies</text:h><text:h text:style-name="Head 3" text:level="3" >Frame-Controller-Model Paradigm</text:h><text:h text:style-name="Head 3" text:level="3" >Loading and Saving Office Components</text:h><text:h text:style-name="Head 3" text:level="3" >Dispatch Framework</text:h><text:h text:style-name="Head 2" text:level="2" >Common Features</text:h><text:h text:style-name="Head 3" text:level="3" >Common Dialogs</text:h><text:h text:style-name="Head 3" text:level="3" >DocumentInfo</text:h><text:h text:style-name="Head 3" text:level="3" >Styles</text:h><text:h text:style-name="Head 3" text:level="3" >Search and Replace</text:h><text:h text:style-name="Head 3" text:level="3" >Number Formats</text:h><text:h text:style-name="Head 3" text:level="3" >Package File Formats</text:h><text:h text:style-name="Head 2" text:level="2" >Internationalization</text:h><text:h text:style-name="Head 2" text:level="2" >Linguistic</text:h><text:h text:style-name="Head 2" text:level="2" >System Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Clipboard</text:h><text:h text:style-name="Head 3" text:level="3" >File Picker</text:h><text:h text:style-name="Head 3" text:level="3" >Bridging to the Window System</text:h><text:p text:style-name="Paragraph" ></text:p><text:h text:style-name="Head 1" text:level="1" >Text Documents (51,5 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Text Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Text Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Using Text</text:h><text:h text:style-name="Head 3" text:level="3" >Tables</text:h><text:h text:style-name="Head 3" text:level="3" >Text Fields</text:h><text:h text:style-name="Head 3" text:level="3" >Bookmarks</text:h><text:h text:style-name="Head 3" text:level="3" >Indexes and Index Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Reference Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Footnotes and Endnotes</text:h><text:h text:style-name="Head 3" text:level="3" >Shape Objects in Text</text:h><text:h text:style-name="Head 3" text:level="3" >Redline</text:h><text:h text:style-name="Head 3" text:level="3" >Ruby</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Text Document</text:h><text:h text:style-name="Head 1" text:level="1" >Spreadsheet Documents</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Spreadsheet Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Spreadsheet Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Editing Spreadsheets</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Spreadsheet Document</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Spreadsheet Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Drawings and Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Draw/Impress Files</text:h><text:h text:style-name="Head 3" text:level="3" >Saving</text:h><text:h text:style-name="Head 3" text:level="3" >Printing</text:h><text:h text:style-name="Head 3" text:level="3" >Running Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Working with a Draw/Impress Document</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Draw/Impress Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Draw/Impress Document</text:h><text:h text:style-name="Head 1" text:level="1" >Charts</text:h><text:h text:style-name="Head 2" text:level="2" >Chart Basics</text:h><text:h text:style-name="Head 2" text:level="2" >Creating a Chart Document</text:h><text:h text:style-name="Head 2" text:level="2" >Editing a Chart Document</text:h><text:h text:style-name="Head 3" text:level="3" >Common Diagram API</text:h><text:h text:style-name="Head 3" text:level="3" >Different Chart Types</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Chart Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Basic and Dialogs</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:h text:style-name="Head 2" text:level="2" >Library Organization</text:h><text:h text:style-name="Head 2" text:level="2" >IDE with Dialogs and Events</text:h><text:h text:style-name="Head 2" text:level="2" >Using [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 2" text:level="2" >Toolkit Controls and their Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating Dialogs at Runtime</text:h><text:h text:style-name="Head 1" text:level="1" >Database Access</text:h><text:h text:style-name="Head 2" text:level="2" >Features of the [PRODUCTNAME] Database Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Capabilities</text:h><text:h text:style-name="Head 3" text:level="3" >SDBC, SDBCX, SDB Architecture</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Datasources with [PRODUCTNAME]</text:h><text:h text:style-name="Head 3" text:level="3" >DataSources</text:h><text:h text:style-name="Head 3" text:level="3" >Adding and Editing Datasources </text:h><text:h text:style-name="Head 3" text:level="3" >Establishing a Connection</text:h><text:h text:style-name="Head 4" text:level="4" >Getting Connections</text:h><text:h text:style-name="Head 4" text:level="4" >Driver specifics</text:h><text:h text:style-name="Head 3" text:level="3" >Connection Pooling</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Saved Queries</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Data</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Statements</text:h><text:h text:style-name="Head 3" text:level="3" >Resultsets</text:h><text:h text:style-name="Head 3" text:level="3" >Metadata</text:h><text:h text:style-name="Head 3" text:level="3" >Rowsets</text:h><text:h text:style-name="Head 2" text:level="2" >Working with the Database Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using DDL to change the DB Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using SDBCX to access the DB Design</text:h><text:h text:style-name="Head 2" text:level="2" >Using DBMS Features</text:h><text:h text:style-name="Head 3" text:level="3" >Stored Procedures</text:h><text:h text:style-name="Head 3" text:level="3" >Transaction Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Prepared Statements</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Database Drivers</text:h><text:h text:style-name="Head 1" text:level="1" >Forms</text:h><text:h text:style-name="Head 2" text:level="2" >Concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Models and Views</text:h><text:h text:style-name="Head 3" text:level="3" >Form Elements in the Document Model</text:h><text:h text:style-name="Head 3" text:level="3" >Special Form Components</text:h><text:h text:style-name="Head 3" text:level="3" >Events</text:h><text:h text:style-name="Head 3" text:level="3" >Data Awareness</text:h><text:h text:style-name="Head 2" text:level="2" >Recipes</text:h><text:h text:style-name="Head 3" text:level="3" >Making it easier to work with a Form</text:h><text:h text:style-name="Head 3" text:level="3" >Controlling the Data Input</text:h><text:h text:style-name="Head 3" text:level="3" >Collecting Data automatically</text:h><text:h text:style-name="Head 3" text:level="3" >Taking Advantage of Database Server Features</text:h><text:h text:style-name="Head 3" text:level="3" >Adding new Functionality</text:h><text:h text:style-name="Head 3" text:level="3" >Handling Errors</text:h><text:h text:style-name="Head 1" text:level="1" >UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Purpose of UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Document Contents as Streams</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Content Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating, Moving and Copying Document and Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Additional Commands</text:h><text:h text:style-name="Head 2" text:level="2" >Writing a Content Provider</text:h><text:h text:style-name="Head 1" text:level="1" >[PRODUCTNAME] Configuration</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing configuration data</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Configuration Data</text:h><text:h text:style-name="Head 1" text:level="1" >Appendix</text:h></office:body> + +<office:body ><text:sequence-decls ><text:sequence-decl text:display-outline-level="0" text:name="Illustration" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Table" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Text" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Drawing" ></text:sequence-decl></text:sequence-decls><text:p text:style-name="P1" >Programmer's Manual</text:p><text:p text:style-name="P2" >Planned Outline</text:p><text:p text:style-name="P2" ></text:p><text:h text:style-name="Head 1" text:level="1" >Preface (3 Pages)</text:h><text:h text:style-name="Head 1" text:level="1" >First Steps (24 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Programming with UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Fields of Application for UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Getting Started</text:h><text:h text:style-name="Head 3" text:level="3" >Required Files</text:h><text:h text:style-name="Head 3" text:level="3" >Configuration</text:h><text:h text:style-name="Head 3" text:level="3" >First Connection</text:h><text:h text:style-name="Head 2" text:level="2" >How to get Objects in [PRODUCTNAME]</text:h><text:h text:style-name="Head 2" text:level="2" >How to work with Objects</text:h><text:p text:style-name="Paragraph" >Example</text:p><text:h text:style-name="Head 3" text:level="3" >Services</text:h><text:h text:style-name="Head 3" text:level="3" >Querying Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >ElementAccess</text:h><text:h text:style-name="Head 3" text:level="3" >Simple Types</text:h><text:h text:style-name="Head 3" text:level="3" >Strings</text:h><text:h text:style-name="Head 3" text:level="3" >Enums and Constant Groups</text:h><text:h text:style-name="Head 3" text:level="3" >Structs</text:h><text:h text:style-name="Head 3" text:level="3" >Any</text:h><text:h text:style-name="Head 3" text:level="3" >Sequence</text:h><text:h text:style-name="Head 2" text:level="2" >How to find the solution for a problem</text:h><text:h text:style-name="Head 2" text:level="2" >Finding your Way through the API Reference</text:h><text:h text:style-name="Head 2" text:level="2" >Common Mechanisms</text:h><text:h text:style-name="Head 3" text:level="3" >Text</text:h><text:h text:style-name="Head 3" text:level="3" >Table</text:h><text:h text:style-name="Head 3" text:level="3" >Drawing</text:h><text:h text:style-name="Head 1" text:level="1" >UNO in Professional Projects (<text:span text:style-name="T1" >145</text:span>)</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:p text:style-name="Paragraph" >UNO/API constituents: How UNOIDL/API, ServiceManager, Bridges, CoreReflection work together</text:p><text:h text:style-name="Head 2" text:level="2" >API Concepts</text:h><text:p text:style-name="Paragraph" >API is a language independent, abstract specification for UNO objects which are used in <text:s ></text:s>[PRODUCTNAME]</text:p><text:h text:style-name="Head 3" text:level="3" >Types in the API Reference</text:h><text:h text:style-name="Head 4" text:level="4" >Simple Types</text:h><text:h text:style-name="Head 4" text:level="4" >The Any Type</text:h><text:h text:style-name="Head 4" text:level="4" >Interfaces</text:h><text:h text:style-name="Head 4" text:level="4" >Services</text:h><text:h text:style-name="Head 4" text:level="4" >Modules</text:h><text:h text:style-name="Head 4" text:level="4" >Structs</text:h><text:h text:style-name="Head 4" text:level="4" >Constant Groups and Enums</text:h><text:h text:style-name="Head 4" text:level="4" >Sequences</text:h><text:h text:style-name="Head 4" text:level="4" >Exceptions</text:h><text:h text:style-name="Head 3" text:level="3" >API Principles</text:h><text:h text:style-name="Head 4" text:level="4" >Relationship between Specification, Implementation and Instances</text:h><text:h text:style-name="Head 4" text:level="4" >Object Composition</text:h><text:h text:style-name="Head 2" text:level="2" >UNO Concepts</text:h><text:p text:style-name="Paragraph" >UNO is an environment for networked object communication</text:p><text:h text:style-name="Head 3" text:level="3" >Interprocess Connections</text:h><text:h text:style-name="Head 3" text:level="3" >ServiceManager and ComponentContext</text:h><text:h text:style-name="Head 3" text:level="3" >Using UNO Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >Using Collections and Containers</text:h><text:h text:style-name="Head 3" text:level="3" >Event Model</text:h><text:h text:style-name="Head 3" text:level="3" >Exception Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Lifetime Control</text:h><text:h text:style-name="Head 3" text:level="3" >Object Identity</text:h><text:h text:style-name="Head 2" text:level="2" >Language Bindings</text:h><text:h text:style-name="Head 3" text:level="3" >Introduction for language binding</text:h><text:h text:style-name="Head 3" text:level="3" >Java Language Binding</text:h><text:h text:style-name="Head 3" text:level="3" >C++ Binding</text:h><text:h text:style-name="Head 3" text:level="3" >Access for [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 3" text:level="3" >Automation</text:h><text:h text:style-name="Head 1" text:level="1" >Writing UNO components</text:h><text:h text:style-name="Head 2" text:level="2" >Specifying a new Component</text:h><text:h text:style-name="Head 3" text:level="3" >UNOIDL language specification</text:h><text:h text:style-name="Head 2" text:level="2" >Implementing a Component</text:h><text:h text:style-name="Head 3" text:level="3" >Component Development Basics</text:h><text:unordered-list text:style-name="L1" ><text:list-item ><text:p text:style-name="P3" >Introduction</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >Mandatory interfaces: XInterface, XServiceInfo ((from UseInterfaces.CoreInterfaces))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >"Should be implemented" interfaces: XTypeProvider ((from UseInterfaces.CoreInterfaces ))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >optional interface: XMain for standalone execution</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Simple Component in Java</text:h><text:unordered-list text:style-name="L2" ><text:list-item ><text:p text:style-name="P4" >Getting the service manager ((Chapter Java components from unoBindingJava))</text:p></text:list-item><text:list-item ><text:p text:style-name="P4" >simple component chapter</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >C++ Component</text:h><text:h text:style-name="Head 3" text:level="3" >((Automation Component?))</text:h><text:h text:style-name="Head 2" text:level="2" >Deployment Options for Components</text:h><text:h text:style-name="Head 3" text:level="3" >Component Registration</text:h><text:h text:style-name="Head 3" text:level="3" >Service Manager Configuration</text:h><text:unordered-list text:style-name="L3" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P5" >XSet Interface</text:p><text:p text:style-name="P5" >Adding components during runtime, particularly interesting during development</text:p></text:list-item><text:list-item ><text:p text:style-name="P5" >ServiceManager Content</text:p><text:p text:style-name="P5" >Dynamically modifying the ServiceManager</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Bootstrapping the Service Manager ((from CppBind chapter))</text:h><text:unordered-list text:style-name="L4" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P6" >Simple Test Application</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >Configuring Your Application with Bootstrap Parameters</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >The UNO Executable</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Standalone Runtime Environment</text:h><text:p text:style-name="Paragraph" ><text:tab-stop ></text:tab-stop>The UNO executable and XMain</text:p><text:h text:style-name="Head 3" text:level="3" >Configuring the Java Runtime Environment</text:h><text:unordered-list text:style-name="L5" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P7" >The office and Java ((from UnoBindingJava))</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 1" text:level="1" >Advanced UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Design Patterns</text:h><text:h text:style-name="Head 2" text:level="2" >Bridging concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Requirements for Language Bindings and Bridges</text:h><text:h text:style-name="Head 3" text:level="3" >New Scripting Engines</text:h><text:h text:style-name="Head 2" text:level="2" >ServiceManager and loader</text:h><text:h text:style-name="Head 2" text:level="2" >Special Interfaces for internal use</text:h><text:p text:style-name="Paragraph" >XUNOTunnel</text:p><text:p text:style-name="Paragraph" >XAggregation</text:p><text:h text:style-name="Head 2" text:level="2" >UNO Reflection API</text:h><text:h text:style-name="Head 2" text:level="2" >TypeLibrary and TypeProviders</text:h><text:h text:style-name="Head 2" text:level="2" >Differences from Corba</text:h><text:h text:style-name="Head 1" text:level="1" >Office Development</text:h><text:h text:style-name="Head 2" text:level="2" >Global Object Structure</text:h><text:h text:style-name="Head 3" text:level="3" >Desktop Environment</text:h><text:h text:style-name="Head 3" text:level="3" >Frames and Frame Hierarchies</text:h><text:h text:style-name="Head 3" text:level="3" >Frame-Controller-Model Paradigm</text:h><text:h text:style-name="Head 3" text:level="3" >Loading and Saving Office Components</text:h><text:h text:style-name="Head 3" text:level="3" >Dispatch Framework</text:h><text:h text:style-name="Head 2" text:level="2" >Common Features</text:h><text:h text:style-name="Head 3" text:level="3" >Common Dialogs</text:h><text:h text:style-name="Head 3" text:level="3" >DocumentInfo</text:h><text:h text:style-name="Head 3" text:level="3" >Styles</text:h><text:h text:style-name="Head 3" text:level="3" >Search and Replace</text:h><text:h text:style-name="Head 3" text:level="3" >Number Formats</text:h><text:h text:style-name="Head 3" text:level="3" >Package File Formats</text:h><text:h text:style-name="Head 2" text:level="2" >Internationalization</text:h><text:h text:style-name="Head 2" text:level="2" >Linguistic</text:h><text:h text:style-name="Head 2" text:level="2" >System Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Clipboard</text:h><text:h text:style-name="Head 3" text:level="3" >File Picker</text:h><text:h text:style-name="Head 3" text:level="3" >Bridging to the Window System</text:h><text:p text:style-name="Paragraph" ></text:p><text:h text:style-name="Head 1" text:level="1" >Text Documents (51,5 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Text Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Text Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Using Text</text:h><text:h text:style-name="Head 3" text:level="3" >Tables</text:h><text:h text:style-name="Head 3" text:level="3" >Text Fields</text:h><text:h text:style-name="Head 3" text:level="3" >Bookmarks</text:h><text:h text:style-name="Head 3" text:level="3" >Indexes and Index Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Reference Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Footnotes and Endnotes</text:h><text:h text:style-name="Head 3" text:level="3" >Shape Objects in Text</text:h><text:h text:style-name="Head 3" text:level="3" >Redline</text:h><text:h text:style-name="Head 3" text:level="3" >Ruby</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Text Document</text:h><text:h text:style-name="Head 1" text:level="1" >Spreadsheet Documents</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Spreadsheet Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Spreadsheet Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Editing Spreadsheets</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Spreadsheet Document</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Spreadsheet Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Drawings and Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Draw/Impress Files</text:h><text:h text:style-name="Head 3" text:level="3" >Saving</text:h><text:h text:style-name="Head 3" text:level="3" >Printing</text:h><text:h text:style-name="Head 3" text:level="3" >Running Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Working with a Draw/Impress Document</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Draw/Impress Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Draw/Impress Document</text:h><text:h text:style-name="Head 1" text:level="1" >Charts</text:h><text:h text:style-name="Head 2" text:level="2" >Chart Basics</text:h><text:h text:style-name="Head 2" text:level="2" >Creating a Chart Document</text:h><text:h text:style-name="Head 2" text:level="2" >Editing a Chart Document</text:h><text:h text:style-name="Head 3" text:level="3" >Common Diagram API</text:h><text:h text:style-name="Head 3" text:level="3" >Different Chart Types</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Chart Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Basic and Dialogs</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:h text:style-name="Head 2" text:level="2" >Library Organization</text:h><text:h text:style-name="Head 2" text:level="2" >IDE with Dialogs and Events</text:h><text:h text:style-name="Head 2" text:level="2" >Using [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 2" text:level="2" >Toolkit Controls and their Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating Dialogs at Runtime</text:h><text:h text:style-name="Head 1" text:level="1" >Database Access</text:h><text:h text:style-name="Head 2" text:level="2" >Features of the [PRODUCTNAME] Database Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Capabilities</text:h><text:h text:style-name="Head 3" text:level="3" >SDBC, SDBCX, SDB Architecture</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Datasources with [PRODUCTNAME]</text:h><text:h text:style-name="Head 3" text:level="3" >DataSources</text:h><text:h text:style-name="Head 3" text:level="3" >Adding and Editing Datasources </text:h><text:h text:style-name="Head 3" text:level="3" >Establishing a Connection</text:h><text:h text:style-name="Head 4" text:level="4" >Getting Connections</text:h><text:h text:style-name="Head 4" text:level="4" >Driver specifics</text:h><text:h text:style-name="Head 3" text:level="3" >Connection Pooling</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Saved Queries</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Data</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Statements</text:h><text:h text:style-name="Head 3" text:level="3" >Resultsets</text:h><text:h text:style-name="Head 3" text:level="3" >Metadata</text:h><text:h text:style-name="Head 3" text:level="3" >Rowsets</text:h><text:h text:style-name="Head 2" text:level="2" >Working with the Database Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using DDL to change the DB Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using SDBCX to access the DB Design</text:h><text:h text:style-name="Head 2" text:level="2" >Using DBMS Features</text:h><text:h text:style-name="Head 3" text:level="3" >Stored Procedures</text:h><text:h text:style-name="Head 3" text:level="3" >Transaction Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Prepared Statements</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Database Drivers</text:h><text:h text:style-name="Head 1" text:level="1" >Forms</text:h><text:h text:style-name="Head 2" text:level="2" >Concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Models and Views</text:h><text:h text:style-name="Head 3" text:level="3" >Form Elements in the Document Model</text:h><text:h text:style-name="Head 3" text:level="3" >Special Form Components</text:h><text:h text:style-name="Head 3" text:level="3" >Events</text:h><text:h text:style-name="Head 3" text:level="3" >Data Awareness</text:h><text:h text:style-name="Head 2" text:level="2" >Recipes</text:h><text:h text:style-name="Head 3" text:level="3" >Making it easier to work with a Form</text:h><text:h text:style-name="Head 3" text:level="3" >Controlling the Data Input</text:h><text:h text:style-name="Head 3" text:level="3" >Collecting Data automatically</text:h><text:h text:style-name="Head 3" text:level="3" >Taking Advantage of Database Server Features</text:h><text:h text:style-name="Head 3" text:level="3" >Adding new Functionality</text:h><text:h text:style-name="Head 3" text:level="3" >Handling Errors</text:h><text:h text:style-name="Head 1" text:level="1" >UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Purpose of UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Document Contents as Streams</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Content Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating, Moving and Copying Document and Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Additional Commands</text:h><text:h text:style-name="Head 2" text:level="2" >Writing a Content Provider</text:h><text:h text:style-name="Head 1" text:level="1" >[PRODUCTNAME] Configuration</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing configuration data</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Configuration Data</text:h><text:h text:style-name="Head 1" text:level="1" >Appendix</text:h></office:body> + +<office:body ><text:sequence-decls ><text:sequence-decl text:display-outline-level="0" text:name="Illustration" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Table" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Text" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Drawing" ></text:sequence-decl></text:sequence-decls><text:p text:style-name="P1" >Programmer's Manual</text:p><text:p text:style-name="P2" >Planned Outline</text:p><text:p text:style-name="P2" ></text:p><text:h text:style-name="Head 1" text:level="1" >Preface (3 Pages)</text:h><text:h text:style-name="Head 1" text:level="1" >First Steps (24 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Programming with UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Fields of Application for UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Getting Started</text:h><text:h text:style-name="Head 3" text:level="3" >Required Files</text:h><text:h text:style-name="Head 3" text:level="3" >Configuration</text:h><text:h text:style-name="Head 3" text:level="3" >First Connection</text:h><text:h text:style-name="Head 2" text:level="2" >How to get Objects in [PRODUCTNAME]</text:h><text:h text:style-name="Head 2" text:level="2" >How to work with Objects</text:h><text:p text:style-name="Paragraph" >Example</text:p><text:h text:style-name="Head 3" text:level="3" >Services</text:h><text:h text:style-name="Head 3" text:level="3" >Querying Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >ElementAccess</text:h><text:h text:style-name="Head 3" text:level="3" >Simple Types</text:h><text:h text:style-name="Head 3" text:level="3" >Strings</text:h><text:h text:style-name="Head 3" text:level="3" >Enums and Constant Groups</text:h><text:h text:style-name="Head 3" text:level="3" >Structs</text:h><text:h text:style-name="Head 3" text:level="3" >Any</text:h><text:h text:style-name="Head 3" text:level="3" >Sequence</text:h><text:h text:style-name="Head 2" text:level="2" >How to find the solution for a problem</text:h><text:h text:style-name="Head 2" text:level="2" >Finding your Way through the API Reference</text:h><text:h text:style-name="Head 2" text:level="2" >Common Mechanisms</text:h><text:h text:style-name="Head 3" text:level="3" >Text</text:h><text:h text:style-name="Head 3" text:level="3" >Table</text:h><text:h text:style-name="Head 3" text:level="3" >Drawing</text:h><text:h text:style-name="Head 1" text:level="1" >UNO in Professional Projects (<text:span text:style-name="T1" >145</text:span>)</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:p text:style-name="Paragraph" >UNO/API constituents: How UNOIDL/API, ServiceManager, Bridges, CoreReflection work together</text:p><text:h text:style-name="Head 2" text:level="2" >API Concepts</text:h><text:p text:style-name="Paragraph" >API is a language independent, abstract specification for UNO objects which are used in <text:s ></text:s>[PRODUCTNAME]</text:p><text:h text:style-name="Head 3" text:level="3" >Types in the API Reference</text:h><text:h text:style-name="Head 4" text:level="4" >Simple Types</text:h><text:h text:style-name="Head 4" text:level="4" >The Any Type</text:h><text:h text:style-name="Head 4" text:level="4" >Interfaces</text:h><text:h text:style-name="Head 4" text:level="4" >Services</text:h><text:h text:style-name="Head 4" text:level="4" >Modules</text:h><text:h text:style-name="Head 4" text:level="4" >Structs</text:h><text:h text:style-name="Head 4" text:level="4" >Constant Groups and Enums</text:h><text:h text:style-name="Head 4" text:level="4" >Sequences</text:h><text:h text:style-name="Head 4" text:level="4" >Exceptions</text:h><text:h text:style-name="Head 3" text:level="3" >API Principles</text:h><text:h text:style-name="Head 4" text:level="4" >Relationship between Specification, Implementation and Instances</text:h><text:h text:style-name="Head 4" text:level="4" >Object Composition</text:h><text:h text:style-name="Head 2" text:level="2" >UNO Concepts</text:h><text:p text:style-name="Paragraph" >UNO is an environment for networked object communication</text:p><text:h text:style-name="Head 3" text:level="3" >Interprocess Connections</text:h><text:h text:style-name="Head 3" text:level="3" >ServiceManager and ComponentContext</text:h><text:h text:style-name="Head 3" text:level="3" >Using UNO Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >Using Collections and Containers</text:h><text:h text:style-name="Head 3" text:level="3" >Event Model</text:h><text:h text:style-name="Head 3" text:level="3" >Exception Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Lifetime Control</text:h><text:h text:style-name="Head 3" text:level="3" >Object Identity</text:h><text:h text:style-name="Head 2" text:level="2" >Language Bindings</text:h><text:h text:style-name="Head 3" text:level="3" >Introduction for language binding</text:h><text:h text:style-name="Head 3" text:level="3" >Java Language Binding</text:h><text:h text:style-name="Head 3" text:level="3" >C++ Binding</text:h><text:h text:style-name="Head 3" text:level="3" >Access for [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 3" text:level="3" >Automation</text:h><text:h text:style-name="Head 1" text:level="1" >Writing UNO components</text:h><text:h text:style-name="Head 2" text:level="2" >Specifying a new Component</text:h><text:h text:style-name="Head 3" text:level="3" >UNOIDL language specification</text:h><text:h text:style-name="Head 2" text:level="2" >Implementing a Component</text:h><text:h text:style-name="Head 3" text:level="3" >Component Development Basics</text:h><text:unordered-list text:style-name="L1" ><text:list-item ><text:p text:style-name="P3" >Introduction</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >Mandatory interfaces: XInterface, XServiceInfo ((from UseInterfaces.CoreInterfaces))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >"Should be implemented" interfaces: XTypeProvider ((from UseInterfaces.CoreInterfaces ))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >optional interface: XMain for standalone execution</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Simple Component in Java</text:h><text:unordered-list text:style-name="L2" ><text:list-item ><text:p text:style-name="P4" >Getting the service manager ((Chapter Java components from unoBindingJava))</text:p></text:list-item><text:list-item ><text:p text:style-name="P4" >simple component chapter</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >C++ Component</text:h><text:h text:style-name="Head 3" text:level="3" >((Automation Component?))</text:h><text:h text:style-name="Head 2" text:level="2" >Deployment Options for Components</text:h><text:h text:style-name="Head 3" text:level="3" >Component Registration</text:h><text:h text:style-name="Head 3" text:level="3" >Service Manager Configuration</text:h><text:unordered-list text:style-name="L3" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P5" >XSet Interface</text:p><text:p text:style-name="P5" >Adding components during runtime, particularly interesting during development</text:p></text:list-item><text:list-item ><text:p text:style-name="P5" >ServiceManager Content</text:p><text:p text:style-name="P5" >Dynamically modifying the ServiceManager</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Bootstrapping the Service Manager ((from CppBind chapter))</text:h><text:unordered-list text:style-name="L4" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P6" >Simple Test Application</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >Configuring Your Application with Bootstrap Parameters</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >The UNO Executable</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Standalone Runtime Environment</text:h><text:p text:style-name="Paragraph" ><text:tab-stop ></text:tab-stop>The UNO executable and XMain</text:p><text:h text:style-name="Head 3" text:level="3" >Configuring the Java Runtime Environment</text:h><text:unordered-list text:style-name="L5" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P7" >The office and Java ((from UnoBindingJava))</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 1" text:level="1" >Advanced UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Design Patterns</text:h><text:h text:style-name="Head 2" text:level="2" >Bridging concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Requirements for Language Bindings and Bridges</text:h><text:h text:style-name="Head 3" text:level="3" >New Scripting Engines</text:h><text:h text:style-name="Head 2" text:level="2" >ServiceManager and loader</text:h><text:h text:style-name="Head 2" text:level="2" >Special Interfaces for internal use</text:h><text:p text:style-name="Paragraph" >XUNOTunnel</text:p><text:p text:style-name="Paragraph" >XAggregation</text:p><text:h text:style-name="Head 2" text:level="2" >UNO Reflection API</text:h><text:h text:style-name="Head 2" text:level="2" >TypeLibrary and TypeProviders</text:h><text:h text:style-name="Head 2" text:level="2" >Differences from Corba</text:h><text:h text:style-name="Head 1" text:level="1" >Office Development</text:h><text:h text:style-name="Head 2" text:level="2" >Global Object Structure</text:h><text:h text:style-name="Head 3" text:level="3" >Desktop Environment</text:h><text:h text:style-name="Head 3" text:level="3" >Frames and Frame Hierarchies</text:h><text:h text:style-name="Head 3" text:level="3" >Frame-Controller-Model Paradigm</text:h><text:h text:style-name="Head 3" text:level="3" >Loading and Saving Office Components</text:h><text:h text:style-name="Head 3" text:level="3" >Dispatch Framework</text:h><text:h text:style-name="Head 2" text:level="2" >Common Features</text:h><text:h text:style-name="Head 3" text:level="3" >Common Dialogs</text:h><text:h text:style-name="Head 3" text:level="3" >DocumentInfo</text:h><text:h text:style-name="Head 3" text:level="3" >Styles</text:h><text:h text:style-name="Head 3" text:level="3" >Search and Replace</text:h><text:h text:style-name="Head 3" text:level="3" >Number Formats</text:h><text:h text:style-name="Head 3" text:level="3" >Package File Formats</text:h><text:h text:style-name="Head 2" text:level="2" >Internationalization</text:h><text:h text:style-name="Head 2" text:level="2" >Linguistic</text:h><text:h text:style-name="Head 2" text:level="2" >System Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Clipboard</text:h><text:h text:style-name="Head 3" text:level="3" >File Picker</text:h><text:h text:style-name="Head 3" text:level="3" >Bridging to the Window System</text:h><text:p text:style-name="Paragraph" ></text:p><text:h text:style-name="Head 1" text:level="1" >Text Documents (51,5 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Text Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Text Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Using Text</text:h><text:h text:style-name="Head 3" text:level="3" >Tables</text:h><text:h text:style-name="Head 3" text:level="3" >Text Fields</text:h><text:h text:style-name="Head 3" text:level="3" >Bookmarks</text:h><text:h text:style-name="Head 3" text:level="3" >Indexes and Index Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Reference Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Footnotes and Endnotes</text:h><text:h text:style-name="Head 3" text:level="3" >Shape Objects in Text</text:h><text:h text:style-name="Head 3" text:level="3" >Redline</text:h><text:h text:style-name="Head 3" text:level="3" >Ruby</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Text Document</text:h><text:h text:style-name="Head 1" text:level="1" >Spreadsheet Documents</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Spreadsheet Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Spreadsheet Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Editing Spreadsheets</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Spreadsheet Document</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Spreadsheet Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Drawings and Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Draw/Impress Files</text:h><text:h text:style-name="Head 3" text:level="3" >Saving</text:h><text:h text:style-name="Head 3" text:level="3" >Printing</text:h><text:h text:style-name="Head 3" text:level="3" >Running Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Working with a Draw/Impress Document</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Draw/Impress Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Draw/Impress Document</text:h><text:h text:style-name="Head 1" text:level="1" >Charts</text:h><text:h text:style-name="Head 2" text:level="2" >Chart Basics</text:h><text:h text:style-name="Head 2" text:level="2" >Creating a Chart Document</text:h><text:h text:style-name="Head 2" text:level="2" >Editing a Chart Document</text:h><text:h text:style-name="Head 3" text:level="3" >Common Diagram API</text:h><text:h text:style-name="Head 3" text:level="3" >Different Chart Types</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Chart Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Basic and Dialogs</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:h text:style-name="Head 2" text:level="2" >Library Organization</text:h><text:h text:style-name="Head 2" text:level="2" >IDE with Dialogs and Events</text:h><text:h text:style-name="Head 2" text:level="2" >Using [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 2" text:level="2" >Toolkit Controls and their Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating Dialogs at Runtime</text:h><text:h text:style-name="Head 1" text:level="1" >Database Access</text:h><text:h text:style-name="Head 2" text:level="2" >Features of the [PRODUCTNAME] Database Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Capabilities</text:h><text:h text:style-name="Head 3" text:level="3" >SDBC, SDBCX, SDB Architecture</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Datasources with [PRODUCTNAME]</text:h><text:h text:style-name="Head 3" text:level="3" >DataSources</text:h><text:h text:style-name="Head 3" text:level="3" >Adding and Editing Datasources </text:h><text:h text:style-name="Head 3" text:level="3" >Establishing a Connection</text:h><text:h text:style-name="Head 4" text:level="4" >Getting Connections</text:h><text:h text:style-name="Head 4" text:level="4" >Driver specifics</text:h><text:h text:style-name="Head 3" text:level="3" >Connection Pooling</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Saved Queries</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Data</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Statements</text:h><text:h text:style-name="Head 3" text:level="3" >Resultsets</text:h><text:h text:style-name="Head 3" text:level="3" >Metadata</text:h><text:h text:style-name="Head 3" text:level="3" >Rowsets</text:h><text:h text:style-name="Head 2" text:level="2" >Working with the Database Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using DDL to change the DB Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using SDBCX to access the DB Design</text:h><text:h text:style-name="Head 2" text:level="2" >Using DBMS Features</text:h><text:h text:style-name="Head 3" text:level="3" >Stored Procedures</text:h><text:h text:style-name="Head 3" text:level="3" >Transaction Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Prepared Statements</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Database Drivers</text:h><text:h text:style-name="Head 1" text:level="1" >Forms</text:h><text:h text:style-name="Head 2" text:level="2" >Concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Models and Views</text:h><text:h text:style-name="Head 3" text:level="3" >Form Elements in the Document Model</text:h><text:h text:style-name="Head 3" text:level="3" >Special Form Components</text:h><text:h text:style-name="Head 3" text:level="3" >Events</text:h><text:h text:style-name="Head 3" text:level="3" >Data Awareness</text:h><text:h text:style-name="Head 2" text:level="2" >Recipes</text:h><text:h text:style-name="Head 3" text:level="3" >Making it easier to work with a Form</text:h><text:h text:style-name="Head 3" text:level="3" >Controlling the Data Input</text:h><text:h text:style-name="Head 3" text:level="3" >Collecting Data automatically</text:h><text:h text:style-name="Head 3" text:level="3" >Taking Advantage of Database Server Features</text:h><text:h text:style-name="Head 3" text:level="3" >Adding new Functionality</text:h><text:h text:style-name="Head 3" text:level="3" >Handling Errors</text:h><text:h text:style-name="Head 1" text:level="1" >UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Purpose of UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Document Contents as Streams</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Content Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating, Moving and Copying Document and Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Additional Commands</text:h><text:h text:style-name="Head 2" text:level="2" >Writing a Content Provider</text:h><text:h text:style-name="Head 1" text:level="1" >[PRODUCTNAME] Configuration</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing configuration data</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Configuration Data</text:h><text:h text:style-name="Head 1" text:level="1" >Appendix</text:h></office:body> + +<office:body ><text:sequence-decls ><text:sequence-decl text:display-outline-level="0" text:name="Illustration" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Table" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Text" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Drawing" ></text:sequence-decl></text:sequence-decls><text:p text:style-name="P1" >Programmer's Manual</text:p><text:p text:style-name="P2" >Planned Outline</text:p><text:p text:style-name="P2" ></text:p><text:h text:style-name="Head 1" text:level="1" >Preface (3 Pages)</text:h><text:h text:style-name="Head 1" text:level="1" >First Steps (24 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Programming with UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Fields of Application for UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Getting Started</text:h><text:h text:style-name="Head 3" text:level="3" >Required Files</text:h><text:h text:style-name="Head 3" text:level="3" >Configuration</text:h><text:h text:style-name="Head 3" text:level="3" >First Connection</text:h><text:h text:style-name="Head 2" text:level="2" >How to get Objects in [PRODUCTNAME]</text:h><text:h text:style-name="Head 2" text:level="2" >How to work with Objects</text:h><text:p text:style-name="Paragraph" >Example</text:p><text:h text:style-name="Head 3" text:level="3" >Services</text:h><text:h text:style-name="Head 3" text:level="3" >Querying Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >ElementAccess</text:h><text:h text:style-name="Head 3" text:level="3" >Simple Types</text:h><text:h text:style-name="Head 3" text:level="3" >Strings</text:h><text:h text:style-name="Head 3" text:level="3" >Enums and Constant Groups</text:h><text:h text:style-name="Head 3" text:level="3" >Structs</text:h><text:h text:style-name="Head 3" text:level="3" >Any</text:h><text:h text:style-name="Head 3" text:level="3" >Sequence</text:h><text:h text:style-name="Head 2" text:level="2" >How to find the solution for a problem</text:h><text:h text:style-name="Head 2" text:level="2" >Finding your Way through the API Reference</text:h><text:h text:style-name="Head 2" text:level="2" >Common Mechanisms</text:h><text:h text:style-name="Head 3" text:level="3" >Text</text:h><text:h text:style-name="Head 3" text:level="3" >Table</text:h><text:h text:style-name="Head 3" text:level="3" >Drawing</text:h><text:h text:style-name="Head 1" text:level="1" >UNO in Professional Projects (<text:span text:style-name="T1" >145</text:span>)</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:p text:style-name="Paragraph" >UNO/API constituents: How UNOIDL/API, ServiceManager, Bridges, CoreReflection work together</text:p><text:h text:style-name="Head 2" text:level="2" >API Concepts</text:h><text:p text:style-name="Paragraph" >API is a language independent, abstract specification for UNO objects which are used in <text:s ></text:s>[PRODUCTNAME]</text:p><text:h text:style-name="Head 3" text:level="3" >Types in the API Reference</text:h><text:h text:style-name="Head 4" text:level="4" >Simple Types</text:h><text:h text:style-name="Head 4" text:level="4" >The Any Type</text:h><text:h text:style-name="Head 4" text:level="4" >Interfaces</text:h><text:h text:style-name="Head 4" text:level="4" >Services</text:h><text:h text:style-name="Head 4" text:level="4" >Modules</text:h><text:h text:style-name="Head 4" text:level="4" >Structs</text:h><text:h text:style-name="Head 4" text:level="4" >Constant Groups and Enums</text:h><text:h text:style-name="Head 4" text:level="4" >Sequences</text:h><text:h text:style-name="Head 4" text:level="4" >Exceptions</text:h><text:h text:style-name="Head 3" text:level="3" >API Principles</text:h><text:h text:style-name="Head 4" text:level="4" >Relationship between Specification, Implementation and Instances</text:h><text:h text:style-name="Head 4" text:level="4" >Object Composition</text:h><text:h text:style-name="Head 2" text:level="2" >UNO Concepts</text:h><text:p text:style-name="Paragraph" >UNO is an environment for networked object communication</text:p><text:h text:style-name="Head 3" text:level="3" >Interprocess Connections</text:h><text:h text:style-name="Head 3" text:level="3" >ServiceManager and ComponentContext</text:h><text:h text:style-name="Head 3" text:level="3" >Using UNO Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >Using Collections and Containers</text:h><text:h text:style-name="Head 3" text:level="3" >Event Model</text:h><text:h text:style-name="Head 3" text:level="3" >Exception Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Lifetime Control</text:h><text:h text:style-name="Head 3" text:level="3" >Object Identity</text:h><text:h text:style-name="Head 2" text:level="2" >Language Bindings</text:h><text:h text:style-name="Head 3" text:level="3" >Introduction for language binding</text:h><text:h text:style-name="Head 3" text:level="3" >Java Language Binding</text:h><text:h text:style-name="Head 3" text:level="3" >C++ Binding</text:h><text:h text:style-name="Head 3" text:level="3" >Access for [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 3" text:level="3" >Automation</text:h><text:h text:style-name="Head 1" text:level="1" >Writing UNO components</text:h><text:h text:style-name="Head 2" text:level="2" >Specifying a new Component</text:h><text:h text:style-name="Head 3" text:level="3" >UNOIDL language specification</text:h><text:h text:style-name="Head 2" text:level="2" >Implementing a Component</text:h><text:h text:style-name="Head 3" text:level="3" >Component Development Basics</text:h><text:unordered-list text:style-name="L1" ><text:list-item ><text:p text:style-name="P3" >Introduction</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >Mandatory interfaces: XInterface, XServiceInfo ((from UseInterfaces.CoreInterfaces))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >"Should be implemented" interfaces: XTypeProvider ((from UseInterfaces.CoreInterfaces ))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >optional interface: XMain for standalone execution</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Simple Component in Java</text:h><text:unordered-list text:style-name="L2" ><text:list-item ><text:p text:style-name="P4" >Getting the service manager ((Chapter Java components from unoBindingJava))</text:p></text:list-item><text:list-item ><text:p text:style-name="P4" >simple component chapter</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >C++ Component</text:h><text:h text:style-name="Head 3" text:level="3" >((Automation Component?))</text:h><text:h text:style-name="Head 2" text:level="2" >Deployment Options for Components</text:h><text:h text:style-name="Head 3" text:level="3" >Component Registration</text:h><text:h text:style-name="Head 3" text:level="3" >Service Manager Configuration</text:h><text:unordered-list text:style-name="L3" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P5" >XSet Interface</text:p><text:p text:style-name="P5" >Adding components during runtime, particularly interesting during development</text:p></text:list-item><text:list-item ><text:p text:style-name="P5" >ServiceManager Content</text:p><text:p text:style-name="P5" >Dynamically modifying the ServiceManager</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Bootstrapping the Service Manager ((from CppBind chapter))</text:h><text:unordered-list text:style-name="L4" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P6" >Simple Test Application</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >Configuring Your Application with Bootstrap Parameters</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >The UNO Executable</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Standalone Runtime Environment</text:h><text:p text:style-name="Paragraph" ><text:tab-stop ></text:tab-stop>The UNO executable and XMain</text:p><text:h text:style-name="Head 3" text:level="3" >Configuring the Java Runtime Environment</text:h><text:unordered-list text:style-name="L5" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P7" >The office and Java ((from UnoBindingJava))</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 1" text:level="1" >Advanced UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Design Patterns</text:h><text:h text:style-name="Head 2" text:level="2" >Bridging concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Requirements for Language Bindings and Bridges</text:h><text:h text:style-name="Head 3" text:level="3" >New Scripting Engines</text:h><text:h text:style-name="Head 2" text:level="2" >ServiceManager and loader</text:h><text:h text:style-name="Head 2" text:level="2" >Special Interfaces for internal use</text:h><text:p text:style-name="Paragraph" >XUNOTunnel</text:p><text:p text:style-name="Paragraph" >XAggregation</text:p><text:h text:style-name="Head 2" text:level="2" >UNO Reflection API</text:h><text:h text:style-name="Head 2" text:level="2" >TypeLibrary and TypeProviders</text:h><text:h text:style-name="Head 2" text:level="2" >Differences from Corba</text:h><text:h text:style-name="Head 1" text:level="1" >Office Development</text:h><text:h text:style-name="Head 2" text:level="2" >Global Object Structure</text:h><text:h text:style-name="Head 3" text:level="3" >Desktop Environment</text:h><text:h text:style-name="Head 3" text:level="3" >Frames and Frame Hierarchies</text:h><text:h text:style-name="Head 3" text:level="3" >Frame-Controller-Model Paradigm</text:h><text:h text:style-name="Head 3" text:level="3" >Loading and Saving Office Components</text:h><text:h text:style-name="Head 3" text:level="3" >Dispatch Framework</text:h><text:h text:style-name="Head 2" text:level="2" >Common Features</text:h><text:h text:style-name="Head 3" text:level="3" >Common Dialogs</text:h><text:h text:style-name="Head 3" text:level="3" >DocumentInfo</text:h><text:h text:style-name="Head 3" text:level="3" >Styles</text:h><text:h text:style-name="Head 3" text:level="3" >Search and Replace</text:h><text:h text:style-name="Head 3" text:level="3" >Number Formats</text:h><text:h text:style-name="Head 3" text:level="3" >Package File Formats</text:h><text:h text:style-name="Head 2" text:level="2" >Internationalization</text:h><text:h text:style-name="Head 2" text:level="2" >Linguistic</text:h><text:h text:style-name="Head 2" text:level="2" >System Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Clipboard</text:h><text:h text:style-name="Head 3" text:level="3" >File Picker</text:h><text:h text:style-name="Head 3" text:level="3" >Bridging to the Window System</text:h><text:p text:style-name="Paragraph" ></text:p><text:h text:style-name="Head 1" text:level="1" >Text Documents (51,5 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Text Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Text Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Using Text</text:h><text:h text:style-name="Head 3" text:level="3" >Tables</text:h><text:h text:style-name="Head 3" text:level="3" >Text Fields</text:h><text:h text:style-name="Head 3" text:level="3" >Bookmarks</text:h><text:h text:style-name="Head 3" text:level="3" >Indexes and Index Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Reference Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Footnotes and Endnotes</text:h><text:h text:style-name="Head 3" text:level="3" >Shape Objects in Text</text:h><text:h text:style-name="Head 3" text:level="3" >Redline</text:h><text:h text:style-name="Head 3" text:level="3" >Ruby</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Text Document</text:h><text:h text:style-name="Head 1" text:level="1" >Spreadsheet Documents</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Spreadsheet Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Spreadsheet Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Editing Spreadsheets</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Spreadsheet Document</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Spreadsheet Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Drawings and Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Draw/Impress Files</text:h><text:h text:style-name="Head 3" text:level="3" >Saving</text:h><text:h text:style-name="Head 3" text:level="3" >Printing</text:h><text:h text:style-name="Head 3" text:level="3" >Running Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Working with a Draw/Impress Document</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Draw/Impress Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Draw/Impress Document</text:h><text:h text:style-name="Head 1" text:level="1" >Charts</text:h><text:h text:style-name="Head 2" text:level="2" >Chart Basics</text:h><text:h text:style-name="Head 2" text:level="2" >Creating a Chart Document</text:h><text:h text:style-name="Head 2" text:level="2" >Editing a Chart Document</text:h><text:h text:style-name="Head 3" text:level="3" >Common Diagram API</text:h><text:h text:style-name="Head 3" text:level="3" >Different Chart Types</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Chart Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Basic and Dialogs</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:h text:style-name="Head 2" text:level="2" >Library Organization</text:h><text:h text:style-name="Head 2" text:level="2" >IDE with Dialogs and Events</text:h><text:h text:style-name="Head 2" text:level="2" >Using [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 2" text:level="2" >Toolkit Controls and their Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating Dialogs at Runtime</text:h><text:h text:style-name="Head 1" text:level="1" >Database Access</text:h><text:h text:style-name="Head 2" text:level="2" >Features of the [PRODUCTNAME] Database Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Capabilities</text:h><text:h text:style-name="Head 3" text:level="3" >SDBC, SDBCX, SDB Architecture</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Datasources with [PRODUCTNAME]</text:h><text:h text:style-name="Head 3" text:level="3" >DataSources</text:h><text:h text:style-name="Head 3" text:level="3" >Adding and Editing Datasources </text:h><text:h text:style-name="Head 3" text:level="3" >Establishing a Connection</text:h><text:h text:style-name="Head 4" text:level="4" >Getting Connections</text:h><text:h text:style-name="Head 4" text:level="4" >Driver specifics</text:h><text:h text:style-name="Head 3" text:level="3" >Connection Pooling</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Saved Queries</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Data</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Statements</text:h><text:h text:style-name="Head 3" text:level="3" >Resultsets</text:h><text:h text:style-name="Head 3" text:level="3" >Metadata</text:h><text:h text:style-name="Head 3" text:level="3" >Rowsets</text:h><text:h text:style-name="Head 2" text:level="2" >Working with the Database Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using DDL to change the DB Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using SDBCX to access the DB Design</text:h><text:h text:style-name="Head 2" text:level="2" >Using DBMS Features</text:h><text:h text:style-name="Head 3" text:level="3" >Stored Procedures</text:h><text:h text:style-name="Head 3" text:level="3" >Transaction Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Prepared Statements</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Database Drivers</text:h><text:h text:style-name="Head 1" text:level="1" >Forms</text:h><text:h text:style-name="Head 2" text:level="2" >Concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Models and Views</text:h><text:h text:style-name="Head 3" text:level="3" >Form Elements in the Document Model</text:h><text:h text:style-name="Head 3" text:level="3" >Special Form Components</text:h><text:h text:style-name="Head 3" text:level="3" >Events</text:h><text:h text:style-name="Head 3" text:level="3" >Data Awareness</text:h><text:h text:style-name="Head 2" text:level="2" >Recipes</text:h><text:h text:style-name="Head 3" text:level="3" >Making it easier to work with a Form</text:h><text:h text:style-name="Head 3" text:level="3" >Controlling the Data Input</text:h><text:h text:style-name="Head 3" text:level="3" >Collecting Data automatically</text:h><text:h text:style-name="Head 3" text:level="3" >Taking Advantage of Database Server Features</text:h><text:h text:style-name="Head 3" text:level="3" >Adding new Functionality</text:h><text:h text:style-name="Head 3" text:level="3" >Handling Errors</text:h><text:h text:style-name="Head 1" text:level="1" >UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Purpose of UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Document Contents as Streams</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Content Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating, Moving and Copying Document and Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Additional Commands</text:h><text:h text:style-name="Head 2" text:level="2" >Writing a Content Provider</text:h><text:h text:style-name="Head 1" text:level="1" >[PRODUCTNAME] Configuration</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing configuration data</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Configuration Data</text:h><text:h text:style-name="Head 1" text:level="1" >Appendix</text:h></office:body> + +<office:body ><text:sequence-decls ><text:sequence-decl text:display-outline-level="0" text:name="Illustration" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Table" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Text" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Drawing" ></text:sequence-decl></text:sequence-decls><text:p text:style-name="P1" >Programmer's Manual</text:p><text:p text:style-name="P2" >Planned Outline</text:p><text:p text:style-name="P2" ></text:p><text:h text:style-name="Head 1" text:level="1" >Preface (3 Pages)</text:h><text:h text:style-name="Head 1" text:level="1" >First Steps (24 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Programming with UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Fields of Application for UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Getting Started</text:h><text:h text:style-name="Head 3" text:level="3" >Required Files</text:h><text:h text:style-name="Head 3" text:level="3" >Configuration</text:h><text:h text:style-name="Head 3" text:level="3" >First Connection</text:h><text:h text:style-name="Head 2" text:level="2" >How to get Objects in [PRODUCTNAME]</text:h><text:h text:style-name="Head 2" text:level="2" >How to work with Objects</text:h><text:p text:style-name="Paragraph" >Example</text:p><text:h text:style-name="Head 3" text:level="3" >Services</text:h><text:h text:style-name="Head 3" text:level="3" >Querying Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >ElementAccess</text:h><text:h text:style-name="Head 3" text:level="3" >Simple Types</text:h><text:h text:style-name="Head 3" text:level="3" >Strings</text:h><text:h text:style-name="Head 3" text:level="3" >Enums and Constant Groups</text:h><text:h text:style-name="Head 3" text:level="3" >Structs</text:h><text:h text:style-name="Head 3" text:level="3" >Any</text:h><text:h text:style-name="Head 3" text:level="3" >Sequence</text:h><text:h text:style-name="Head 2" text:level="2" >How to find the solution for a problem</text:h><text:h text:style-name="Head 2" text:level="2" >Finding your Way through the API Reference</text:h><text:h text:style-name="Head 2" text:level="2" >Common Mechanisms</text:h><text:h text:style-name="Head 3" text:level="3" >Text</text:h><text:h text:style-name="Head 3" text:level="3" >Table</text:h><text:h text:style-name="Head 3" text:level="3" >Drawing</text:h><text:h text:style-name="Head 1" text:level="1" >UNO in Professional Projects (<text:span text:style-name="T1" >145</text:span>)</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:p text:style-name="Paragraph" >UNO/API constituents: How UNOIDL/API, ServiceManager, Bridges, CoreReflection work together</text:p><text:h text:style-name="Head 2" text:level="2" >API Concepts</text:h><text:p text:style-name="Paragraph" >API is a language independent, abstract specification for UNO objects which are used in <text:s ></text:s>[PRODUCTNAME]</text:p><text:h text:style-name="Head 3" text:level="3" >Types in the API Reference</text:h><text:h text:style-name="Head 4" text:level="4" >Simple Types</text:h><text:h text:style-name="Head 4" text:level="4" >The Any Type</text:h><text:h text:style-name="Head 4" text:level="4" >Interfaces</text:h><text:h text:style-name="Head 4" text:level="4" >Services</text:h><text:h text:style-name="Head 4" text:level="4" >Modules</text:h><text:h text:style-name="Head 4" text:level="4" >Structs</text:h><text:h text:style-name="Head 4" text:level="4" >Constant Groups and Enums</text:h><text:h text:style-name="Head 4" text:level="4" >Sequences</text:h><text:h text:style-name="Head 4" text:level="4" >Exceptions</text:h><text:h text:style-name="Head 3" text:level="3" >API Principles</text:h><text:h text:style-name="Head 4" text:level="4" >Relationship between Specification, Implementation and Instances</text:h><text:h text:style-name="Head 4" text:level="4" >Object Composition</text:h><text:h text:style-name="Head 2" text:level="2" >UNO Concepts</text:h><text:p text:style-name="Paragraph" >UNO is an environment for networked object communication</text:p><text:h text:style-name="Head 3" text:level="3" >Interprocess Connections</text:h><text:h text:style-name="Head 3" text:level="3" >ServiceManager and ComponentContext</text:h><text:h text:style-name="Head 3" text:level="3" >Using UNO Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >Using Collections and Containers</text:h><text:h text:style-name="Head 3" text:level="3" >Event Model</text:h><text:h text:style-name="Head 3" text:level="3" >Exception Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Lifetime Control</text:h><text:h text:style-name="Head 3" text:level="3" >Object Identity</text:h><text:h text:style-name="Head 2" text:level="2" >Language Bindings</text:h><text:h text:style-name="Head 3" text:level="3" >Introduction for language binding</text:h><text:h text:style-name="Head 3" text:level="3" >Java Language Binding</text:h><text:h text:style-name="Head 3" text:level="3" >C++ Binding</text:h><text:h text:style-name="Head 3" text:level="3" >Access for [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 3" text:level="3" >Automation</text:h><text:h text:style-name="Head 1" text:level="1" >Writing UNO components</text:h><text:h text:style-name="Head 2" text:level="2" >Specifying a new Component</text:h><text:h text:style-name="Head 3" text:level="3" >UNOIDL language specification</text:h><text:h text:style-name="Head 2" text:level="2" >Implementing a Component</text:h><text:h text:style-name="Head 3" text:level="3" >Component Development Basics</text:h><text:unordered-list text:style-name="L1" ><text:list-item ><text:p text:style-name="P3" >Introduction</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >Mandatory interfaces: XInterface, XServiceInfo ((from UseInterfaces.CoreInterfaces))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >"Should be implemented" interfaces: XTypeProvider ((from UseInterfaces.CoreInterfaces ))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >optional interface: XMain for standalone execution</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Simple Component in Java</text:h><text:unordered-list text:style-name="L2" ><text:list-item ><text:p text:style-name="P4" >Getting the service manager ((Chapter Java components from unoBindingJava))</text:p></text:list-item><text:list-item ><text:p text:style-name="P4" >simple component chapter</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >C++ Component</text:h><text:h text:style-name="Head 3" text:level="3" >((Automation Component?))</text:h><text:h text:style-name="Head 2" text:level="2" >Deployment Options for Components</text:h><text:h text:style-name="Head 3" text:level="3" >Component Registration</text:h><text:h text:style-name="Head 3" text:level="3" >Service Manager Configuration</text:h><text:unordered-list text:style-name="L3" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P5" >XSet Interface</text:p><text:p text:style-name="P5" >Adding components during runtime, particularly interesting during development</text:p></text:list-item><text:list-item ><text:p text:style-name="P5" >ServiceManager Content</text:p><text:p text:style-name="P5" >Dynamically modifying the ServiceManager</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Bootstrapping the Service Manager ((from CppBind chapter))</text:h><text:unordered-list text:style-name="L4" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P6" >Simple Test Application</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >Configuring Your Application with Bootstrap Parameters</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >The UNO Executable</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Standalone Runtime Environment</text:h><text:p text:style-name="Paragraph" ><text:tab-stop ></text:tab-stop>The UNO executable and XMain</text:p><text:h text:style-name="Head 3" text:level="3" >Configuring the Java Runtime Environment</text:h><text:unordered-list text:style-name="L5" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P7" >The office and Java ((from UnoBindingJava))</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 1" text:level="1" >Advanced UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Design Patterns</text:h><text:h text:style-name="Head 2" text:level="2" >Bridging concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Requirements for Language Bindings and Bridges</text:h><text:h text:style-name="Head 3" text:level="3" >New Scripting Engines</text:h><text:h text:style-name="Head 2" text:level="2" >ServiceManager and loader</text:h><text:h text:style-name="Head 2" text:level="2" >Special Interfaces for internal use</text:h><text:p text:style-name="Paragraph" >XUNOTunnel</text:p><text:p text:style-name="Paragraph" >XAggregation</text:p><text:h text:style-name="Head 2" text:level="2" >UNO Reflection API</text:h><text:h text:style-name="Head 2" text:level="2" >TypeLibrary and TypeProviders</text:h><text:h text:style-name="Head 2" text:level="2" >Differences from Corba</text:h><text:h text:style-name="Head 1" text:level="1" >Office Development</text:h><text:h text:style-name="Head 2" text:level="2" >Global Object Structure</text:h><text:h text:style-name="Head 3" text:level="3" >Desktop Environment</text:h><text:h text:style-name="Head 3" text:level="3" >Frames and Frame Hierarchies</text:h><text:h text:style-name="Head 3" text:level="3" >Frame-Controller-Model Paradigm</text:h><text:h text:style-name="Head 3" text:level="3" >Loading and Saving Office Components</text:h><text:h text:style-name="Head 3" text:level="3" >Dispatch Framework</text:h><text:h text:style-name="Head 2" text:level="2" >Common Features</text:h><text:h text:style-name="Head 3" text:level="3" >Common Dialogs</text:h><text:h text:style-name="Head 3" text:level="3" >DocumentInfo</text:h><text:h text:style-name="Head 3" text:level="3" >Styles</text:h><text:h text:style-name="Head 3" text:level="3" >Search and Replace</text:h><text:h text:style-name="Head 3" text:level="3" >Number Formats</text:h><text:h text:style-name="Head 3" text:level="3" >Package File Formats</text:h><text:h text:style-name="Head 2" text:level="2" >Internationalization</text:h><text:h text:style-name="Head 2" text:level="2" >Linguistic</text:h><text:h text:style-name="Head 2" text:level="2" >System Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Clipboard</text:h><text:h text:style-name="Head 3" text:level="3" >File Picker</text:h><text:h text:style-name="Head 3" text:level="3" >Bridging to the Window System</text:h><text:p text:style-name="Paragraph" ></text:p><text:h text:style-name="Head 1" text:level="1" >Text Documents (51,5 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Text Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Text Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Using Text</text:h><text:h text:style-name="Head 3" text:level="3" >Tables</text:h><text:h text:style-name="Head 3" text:level="3" >Text Fields</text:h><text:h text:style-name="Head 3" text:level="3" >Bookmarks</text:h><text:h text:style-name="Head 3" text:level="3" >Indexes and Index Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Reference Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Footnotes and Endnotes</text:h><text:h text:style-name="Head 3" text:level="3" >Shape Objects in Text</text:h><text:h text:style-name="Head 3" text:level="3" >Redline</text:h><text:h text:style-name="Head 3" text:level="3" >Ruby</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Text Document</text:h><text:h text:style-name="Head 1" text:level="1" >Spreadsheet Documents</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Spreadsheet Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Spreadsheet Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Editing Spreadsheets</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Spreadsheet Document</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Spreadsheet Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Drawings and Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Draw/Impress Files</text:h><text:h text:style-name="Head 3" text:level="3" >Saving</text:h><text:h text:style-name="Head 3" text:level="3" >Printing</text:h><text:h text:style-name="Head 3" text:level="3" >Running Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Working with a Draw/Impress Document</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Draw/Impress Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Draw/Impress Document</text:h><text:h text:style-name="Head 1" text:level="1" >Charts</text:h><text:h text:style-name="Head 2" text:level="2" >Chart Basics</text:h><text:h text:style-name="Head 2" text:level="2" >Creating a Chart Document</text:h><text:h text:style-name="Head 2" text:level="2" >Editing a Chart Document</text:h><text:h text:style-name="Head 3" text:level="3" >Common Diagram API</text:h><text:h text:style-name="Head 3" text:level="3" >Different Chart Types</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Chart Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Basic and Dialogs</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:h text:style-name="Head 2" text:level="2" >Library Organization</text:h><text:h text:style-name="Head 2" text:level="2" >IDE with Dialogs and Events</text:h><text:h text:style-name="Head 2" text:level="2" >Using [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 2" text:level="2" >Toolkit Controls and their Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating Dialogs at Runtime</text:h><text:h text:style-name="Head 1" text:level="1" >Database Access</text:h><text:h text:style-name="Head 2" text:level="2" >Features of the [PRODUCTNAME] Database Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Capabilities</text:h><text:h text:style-name="Head 3" text:level="3" >SDBC, SDBCX, SDB Architecture</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Datasources with [PRODUCTNAME]</text:h><text:h text:style-name="Head 3" text:level="3" >DataSources</text:h><text:h text:style-name="Head 3" text:level="3" >Adding and Editing Datasources </text:h><text:h text:style-name="Head 3" text:level="3" >Establishing a Connection</text:h><text:h text:style-name="Head 4" text:level="4" >Getting Connections</text:h><text:h text:style-name="Head 4" text:level="4" >Driver specifics</text:h><text:h text:style-name="Head 3" text:level="3" >Connection Pooling</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Saved Queries</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Data</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Statements</text:h><text:h text:style-name="Head 3" text:level="3" >Resultsets</text:h><text:h text:style-name="Head 3" text:level="3" >Metadata</text:h><text:h text:style-name="Head 3" text:level="3" >Rowsets</text:h><text:h text:style-name="Head 2" text:level="2" >Working with the Database Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using DDL to change the DB Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using SDBCX to access the DB Design</text:h><text:h text:style-name="Head 2" text:level="2" >Using DBMS Features</text:h><text:h text:style-name="Head 3" text:level="3" >Stored Procedures</text:h><text:h text:style-name="Head 3" text:level="3" >Transaction Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Prepared Statements</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Database Drivers</text:h><text:h text:style-name="Head 1" text:level="1" >Forms</text:h><text:h text:style-name="Head 2" text:level="2" >Concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Models and Views</text:h><text:h text:style-name="Head 3" text:level="3" >Form Elements in the Document Model</text:h><text:h text:style-name="Head 3" text:level="3" >Special Form Components</text:h><text:h text:style-name="Head 3" text:level="3" >Events</text:h><text:h text:style-name="Head 3" text:level="3" >Data Awareness</text:h><text:h text:style-name="Head 2" text:level="2" >Recipes</text:h><text:h text:style-name="Head 3" text:level="3" >Making it easier to work with a Form</text:h><text:h text:style-name="Head 3" text:level="3" >Controlling the Data Input</text:h><text:h text:style-name="Head 3" text:level="3" >Collecting Data automatically</text:h><text:h text:style-name="Head 3" text:level="3" >Taking Advantage of Database Server Features</text:h><text:h text:style-name="Head 3" text:level="3" >Adding new Functionality</text:h><text:h text:style-name="Head 3" text:level="3" >Handling Errors</text:h><text:h text:style-name="Head 1" text:level="1" >UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Purpose of UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Document Contents as Streams</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Content Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating, Moving and Copying Document and Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Additional Commands</text:h><text:h text:style-name="Head 2" text:level="2" >Writing a Content Provider</text:h><text:h text:style-name="Head 1" text:level="1" >[PRODUCTNAME] Configuration</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing configuration data</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Configuration Data</text:h><text:h text:style-name="Head 1" text:level="1" >Appendix</text:h></office:body> + +<office:body ><text:sequence-decls ><text:sequence-decl text:display-outline-level="0" text:name="Illustration" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Table" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Text" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Drawing" ></text:sequence-decl></text:sequence-decls><text:p text:style-name="P1" >Programmer's Manual</text:p><text:p text:style-name="P2" >Planned Outline</text:p><text:p text:style-name="P2" ></text:p><text:h text:style-name="Head 1" text:level="1" >Preface (3 Pages)</text:h><text:h text:style-name="Head 1" text:level="1" >First Steps (24 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Programming with UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Fields of Application for UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Getting Started</text:h><text:h text:style-name="Head 3" text:level="3" >Required Files</text:h><text:h text:style-name="Head 3" text:level="3" >Configuration</text:h><text:h text:style-name="Head 3" text:level="3" >First Connection</text:h><text:h text:style-name="Head 2" text:level="2" >How to get Objects in [PRODUCTNAME]</text:h><text:h text:style-name="Head 2" text:level="2" >How to work with Objects</text:h><text:p text:style-name="Paragraph" >Example</text:p><text:h text:style-name="Head 3" text:level="3" >Services</text:h><text:h text:style-name="Head 3" text:level="3" >Querying Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >ElementAccess</text:h><text:h text:style-name="Head 3" text:level="3" >Simple Types</text:h><text:h text:style-name="Head 3" text:level="3" >Strings</text:h><text:h text:style-name="Head 3" text:level="3" >Enums and Constant Groups</text:h><text:h text:style-name="Head 3" text:level="3" >Structs</text:h><text:h text:style-name="Head 3" text:level="3" >Any</text:h><text:h text:style-name="Head 3" text:level="3" >Sequence</text:h><text:h text:style-name="Head 2" text:level="2" >How to find the solution for a problem</text:h><text:h text:style-name="Head 2" text:level="2" >Finding your Way through the API Reference</text:h><text:h text:style-name="Head 2" text:level="2" >Common Mechanisms</text:h><text:h text:style-name="Head 3" text:level="3" >Text</text:h><text:h text:style-name="Head 3" text:level="3" >Table</text:h><text:h text:style-name="Head 3" text:level="3" >Drawing</text:h><text:h text:style-name="Head 1" text:level="1" >UNO in Professional Projects (<text:span text:style-name="T1" >145</text:span>)</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:p text:style-name="Paragraph" >UNO/API constituents: How UNOIDL/API, ServiceManager, Bridges, CoreReflection work together</text:p><text:h text:style-name="Head 2" text:level="2" >API Concepts</text:h><text:p text:style-name="Paragraph" >API is a language independent, abstract specification for UNO objects which are used in <text:s ></text:s>[PRODUCTNAME]</text:p><text:h text:style-name="Head 3" text:level="3" >Types in the API Reference</text:h><text:h text:style-name="Head 4" text:level="4" >Simple Types</text:h><text:h text:style-name="Head 4" text:level="4" >The Any Type</text:h><text:h text:style-name="Head 4" text:level="4" >Interfaces</text:h><text:h text:style-name="Head 4" text:level="4" >Services</text:h><text:h text:style-name="Head 4" text:level="4" >Modules</text:h><text:h text:style-name="Head 4" text:level="4" >Structs</text:h><text:h text:style-name="Head 4" text:level="4" >Constant Groups and Enums</text:h><text:h text:style-name="Head 4" text:level="4" >Sequences</text:h><text:h text:style-name="Head 4" text:level="4" >Exceptions</text:h><text:h text:style-name="Head 3" text:level="3" >API Principles</text:h><text:h text:style-name="Head 4" text:level="4" >Relationship between Specification, Implementation and Instances</text:h><text:h text:style-name="Head 4" text:level="4" >Object Composition</text:h><text:h text:style-name="Head 2" text:level="2" >UNO Concepts</text:h><text:p text:style-name="Paragraph" >UNO is an environment for networked object communication</text:p><text:h text:style-name="Head 3" text:level="3" >Interprocess Connections</text:h><text:h text:style-name="Head 3" text:level="3" >ServiceManager and ComponentContext</text:h><text:h text:style-name="Head 3" text:level="3" >Using UNO Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >Using Collections and Containers</text:h><text:h text:style-name="Head 3" text:level="3" >Event Model</text:h><text:h text:style-name="Head 3" text:level="3" >Exception Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Lifetime Control</text:h><text:h text:style-name="Head 3" text:level="3" >Object Identity</text:h><text:h text:style-name="Head 2" text:level="2" >Language Bindings</text:h><text:h text:style-name="Head 3" text:level="3" >Introduction for language binding</text:h><text:h text:style-name="Head 3" text:level="3" >Java Language Binding</text:h><text:h text:style-name="Head 3" text:level="3" >C++ Binding</text:h><text:h text:style-name="Head 3" text:level="3" >Access for [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 3" text:level="3" >Automation</text:h><text:h text:style-name="Head 1" text:level="1" >Writing UNO components</text:h><text:h text:style-name="Head 2" text:level="2" >Specifying a new Component</text:h><text:h text:style-name="Head 3" text:level="3" >UNOIDL language specification</text:h><text:h text:style-name="Head 2" text:level="2" >Implementing a Component</text:h><text:h text:style-name="Head 3" text:level="3" >Component Development Basics</text:h><text:unordered-list text:style-name="L1" ><text:list-item ><text:p text:style-name="P3" >Introduction</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >Mandatory interfaces: XInterface, XServiceInfo ((from UseInterfaces.CoreInterfaces))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >"Should be implemented" interfaces: XTypeProvider ((from UseInterfaces.CoreInterfaces ))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >optional interface: XMain for standalone execution</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Simple Component in Java</text:h><text:unordered-list text:style-name="L2" ><text:list-item ><text:p text:style-name="P4" >Getting the service manager ((Chapter Java components from unoBindingJava))</text:p></text:list-item><text:list-item ><text:p text:style-name="P4" >simple component chapter</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >C++ Component</text:h><text:h text:style-name="Head 3" text:level="3" >((Automation Component?))</text:h><text:h text:style-name="Head 2" text:level="2" >Deployment Options for Components</text:h><text:h text:style-name="Head 3" text:level="3" >Component Registration</text:h><text:h text:style-name="Head 3" text:level="3" >Service Manager Configuration</text:h><text:unordered-list text:style-name="L3" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P5" >XSet Interface</text:p><text:p text:style-name="P5" >Adding components during runtime, particularly interesting during development</text:p></text:list-item><text:list-item ><text:p text:style-name="P5" >ServiceManager Content</text:p><text:p text:style-name="P5" >Dynamically modifying the ServiceManager</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Bootstrapping the Service Manager ((from CppBind chapter))</text:h><text:unordered-list text:style-name="L4" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P6" >Simple Test Application</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >Configuring Your Application with Bootstrap Parameters</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >The UNO Executable</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Standalone Runtime Environment</text:h><text:p text:style-name="Paragraph" ><text:tab-stop ></text:tab-stop>The UNO executable and XMain</text:p><text:h text:style-name="Head 3" text:level="3" >Configuring the Java Runtime Environment</text:h><text:unordered-list text:style-name="L5" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P7" >The office and Java ((from UnoBindingJava))</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 1" text:level="1" >Advanced UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Design Patterns</text:h><text:h text:style-name="Head 2" text:level="2" >Bridging concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Requirements for Language Bindings and Bridges</text:h><text:h text:style-name="Head 3" text:level="3" >New Scripting Engines</text:h><text:h text:style-name="Head 2" text:level="2" >ServiceManager and loader</text:h><text:h text:style-name="Head 2" text:level="2" >Special Interfaces for internal use</text:h><text:p text:style-name="Paragraph" >XUNOTunnel</text:p><text:p text:style-name="Paragraph" >XAggregation</text:p><text:h text:style-name="Head 2" text:level="2" >UNO Reflection API</text:h><text:h text:style-name="Head 2" text:level="2" >TypeLibrary and TypeProviders</text:h><text:h text:style-name="Head 2" text:level="2" >Differences from Corba</text:h><text:h text:style-name="Head 1" text:level="1" >Office Development</text:h><text:h text:style-name="Head 2" text:level="2" >Global Object Structure</text:h><text:h text:style-name="Head 3" text:level="3" >Desktop Environment</text:h><text:h text:style-name="Head 3" text:level="3" >Frames and Frame Hierarchies</text:h><text:h text:style-name="Head 3" text:level="3" >Frame-Controller-Model Paradigm</text:h><text:h text:style-name="Head 3" text:level="3" >Loading and Saving Office Components</text:h><text:h text:style-name="Head 3" text:level="3" >Dispatch Framework</text:h><text:h text:style-name="Head 2" text:level="2" >Common Features</text:h><text:h text:style-name="Head 3" text:level="3" >Common Dialogs</text:h><text:h text:style-name="Head 3" text:level="3" >DocumentInfo</text:h><text:h text:style-name="Head 3" text:level="3" >Styles</text:h><text:h text:style-name="Head 3" text:level="3" >Search and Replace</text:h><text:h text:style-name="Head 3" text:level="3" >Number Formats</text:h><text:h text:style-name="Head 3" text:level="3" >Package File Formats</text:h><text:h text:style-name="Head 2" text:level="2" >Internationalization</text:h><text:h text:style-name="Head 2" text:level="2" >Linguistic</text:h><text:h text:style-name="Head 2" text:level="2" >System Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Clipboard</text:h><text:h text:style-name="Head 3" text:level="3" >File Picker</text:h><text:h text:style-name="Head 3" text:level="3" >Bridging to the Window System</text:h><text:p text:style-name="Paragraph" ></text:p><text:h text:style-name="Head 1" text:level="1" >Text Documents (51,5 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Text Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Text Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Using Text</text:h><text:h text:style-name="Head 3" text:level="3" >Tables</text:h><text:h text:style-name="Head 3" text:level="3" >Text Fields</text:h><text:h text:style-name="Head 3" text:level="3" >Bookmarks</text:h><text:h text:style-name="Head 3" text:level="3" >Indexes and Index Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Reference Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Footnotes and Endnotes</text:h><text:h text:style-name="Head 3" text:level="3" >Shape Objects in Text</text:h><text:h text:style-name="Head 3" text:level="3" >Redline</text:h><text:h text:style-name="Head 3" text:level="3" >Ruby</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Text Document</text:h><text:h text:style-name="Head 1" text:level="1" >Spreadsheet Documents</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Spreadsheet Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Spreadsheet Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Editing Spreadsheets</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Spreadsheet Document</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Spreadsheet Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Drawings and Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Draw/Impress Files</text:h><text:h text:style-name="Head 3" text:level="3" >Saving</text:h><text:h text:style-name="Head 3" text:level="3" >Printing</text:h><text:h text:style-name="Head 3" text:level="3" >Running Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Working with a Draw/Impress Document</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Draw/Impress Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Draw/Impress Document</text:h><text:h text:style-name="Head 1" text:level="1" >Charts</text:h><text:h text:style-name="Head 2" text:level="2" >Chart Basics</text:h><text:h text:style-name="Head 2" text:level="2" >Creating a Chart Document</text:h><text:h text:style-name="Head 2" text:level="2" >Editing a Chart Document</text:h><text:h text:style-name="Head 3" text:level="3" >Common Diagram API</text:h><text:h text:style-name="Head 3" text:level="3" >Different Chart Types</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Chart Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Basic and Dialogs</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:h text:style-name="Head 2" text:level="2" >Library Organization</text:h><text:h text:style-name="Head 2" text:level="2" >IDE with Dialogs and Events</text:h><text:h text:style-name="Head 2" text:level="2" >Using [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 2" text:level="2" >Toolkit Controls and their Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating Dialogs at Runtime</text:h><text:h text:style-name="Head 1" text:level="1" >Database Access</text:h><text:h text:style-name="Head 2" text:level="2" >Features of the [PRODUCTNAME] Database Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Capabilities</text:h><text:h text:style-name="Head 3" text:level="3" >SDBC, SDBCX, SDB Architecture</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Datasources with [PRODUCTNAME]</text:h><text:h text:style-name="Head 3" text:level="3" >DataSources</text:h><text:h text:style-name="Head 3" text:level="3" >Adding and Editing Datasources </text:h><text:h text:style-name="Head 3" text:level="3" >Establishing a Connection</text:h><text:h text:style-name="Head 4" text:level="4" >Getting Connections</text:h><text:h text:style-name="Head 4" text:level="4" >Driver specifics</text:h><text:h text:style-name="Head 3" text:level="3" >Connection Pooling</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Saved Queries</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Data</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Statements</text:h><text:h text:style-name="Head 3" text:level="3" >Resultsets</text:h><text:h text:style-name="Head 3" text:level="3" >Metadata</text:h><text:h text:style-name="Head 3" text:level="3" >Rowsets</text:h><text:h text:style-name="Head 2" text:level="2" >Working with the Database Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using DDL to change the DB Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using SDBCX to access the DB Design</text:h><text:h text:style-name="Head 2" text:level="2" >Using DBMS Features</text:h><text:h text:style-name="Head 3" text:level="3" >Stored Procedures</text:h><text:h text:style-name="Head 3" text:level="3" >Transaction Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Prepared Statements</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Database Drivers</text:h><text:h text:style-name="Head 1" text:level="1" >Forms</text:h><text:h text:style-name="Head 2" text:level="2" >Concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Models and Views</text:h><text:h text:style-name="Head 3" text:level="3" >Form Elements in the Document Model</text:h><text:h text:style-name="Head 3" text:level="3" >Special Form Components</text:h><text:h text:style-name="Head 3" text:level="3" >Events</text:h><text:h text:style-name="Head 3" text:level="3" >Data Awareness</text:h><text:h text:style-name="Head 2" text:level="2" >Recipes</text:h><text:h text:style-name="Head 3" text:level="3" >Making it easier to work with a Form</text:h><text:h text:style-name="Head 3" text:level="3" >Controlling the Data Input</text:h><text:h text:style-name="Head 3" text:level="3" >Collecting Data automatically</text:h><text:h text:style-name="Head 3" text:level="3" >Taking Advantage of Database Server Features</text:h><text:h text:style-name="Head 3" text:level="3" >Adding new Functionality</text:h><text:h text:style-name="Head 3" text:level="3" >Handling Errors</text:h><text:h text:style-name="Head 1" text:level="1" >UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Purpose of UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Document Contents as Streams</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Content Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating, Moving and Copying Document and Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Additional Commands</text:h><text:h text:style-name="Head 2" text:level="2" >Writing a Content Provider</text:h><text:h text:style-name="Head 1" text:level="1" >[PRODUCTNAME] Configuration</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing configuration data</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Configuration Data</text:h><text:h text:style-name="Head 1" text:level="1" >Appendix</text:h></office:body> + +<office:body ><text:sequence-decls ><text:sequence-decl text:display-outline-level="0" text:name="Illustration" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Table" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Text" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Drawing" ></text:sequence-decl></text:sequence-decls><text:p text:style-name="P1" >Programmer's Manual</text:p><text:p text:style-name="P2" >Planned Outline</text:p><text:p text:style-name="P2" ></text:p><text:h text:style-name="Head 1" text:level="1" >Preface (3 Pages)</text:h><text:h text:style-name="Head 1" text:level="1" >First Steps (24 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Programming with UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Fields of Application for UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Getting Started</text:h><text:h text:style-name="Head 3" text:level="3" >Required Files</text:h><text:h text:style-name="Head 3" text:level="3" >Configuration</text:h><text:h text:style-name="Head 3" text:level="3" >First Connection</text:h><text:h text:style-name="Head 2" text:level="2" >How to get Objects in [PRODUCTNAME]</text:h><text:h text:style-name="Head 2" text:level="2" >How to work with Objects</text:h><text:p text:style-name="Paragraph" >Example</text:p><text:h text:style-name="Head 3" text:level="3" >Services</text:h><text:h text:style-name="Head 3" text:level="3" >Querying Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >ElementAccess</text:h><text:h text:style-name="Head 3" text:level="3" >Simple Types</text:h><text:h text:style-name="Head 3" text:level="3" >Strings</text:h><text:h text:style-name="Head 3" text:level="3" >Enums and Constant Groups</text:h><text:h text:style-name="Head 3" text:level="3" >Structs</text:h><text:h text:style-name="Head 3" text:level="3" >Any</text:h><text:h text:style-name="Head 3" text:level="3" >Sequence</text:h><text:h text:style-name="Head 2" text:level="2" >How to find the solution for a problem</text:h><text:h text:style-name="Head 2" text:level="2" >Finding your Way through the API Reference</text:h><text:h text:style-name="Head 2" text:level="2" >Common Mechanisms</text:h><text:h text:style-name="Head 3" text:level="3" >Text</text:h><text:h text:style-name="Head 3" text:level="3" >Table</text:h><text:h text:style-name="Head 3" text:level="3" >Drawing</text:h><text:h text:style-name="Head 1" text:level="1" >UNO in Professional Projects (<text:span text:style-name="T1" >145</text:span>)</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:p text:style-name="Paragraph" >UNO/API constituents: How UNOIDL/API, ServiceManager, Bridges, CoreReflection work together</text:p><text:h text:style-name="Head 2" text:level="2" >API Concepts</text:h><text:p text:style-name="Paragraph" >API is a language independent, abstract specification for UNO objects which are used in <text:s ></text:s>[PRODUCTNAME]</text:p><text:h text:style-name="Head 3" text:level="3" >Types in the API Reference</text:h><text:h text:style-name="Head 4" text:level="4" >Simple Types</text:h><text:h text:style-name="Head 4" text:level="4" >The Any Type</text:h><text:h text:style-name="Head 4" text:level="4" >Interfaces</text:h><text:h text:style-name="Head 4" text:level="4" >Services</text:h><text:h text:style-name="Head 4" text:level="4" >Modules</text:h><text:h text:style-name="Head 4" text:level="4" >Structs</text:h><text:h text:style-name="Head 4" text:level="4" >Constant Groups and Enums</text:h><text:h text:style-name="Head 4" text:level="4" >Sequences</text:h><text:h text:style-name="Head 4" text:level="4" >Exceptions</text:h><text:h text:style-name="Head 3" text:level="3" >API Principles</text:h><text:h text:style-name="Head 4" text:level="4" >Relationship between Specification, Implementation and Instances</text:h><text:h text:style-name="Head 4" text:level="4" >Object Composition</text:h><text:h text:style-name="Head 2" text:level="2" >UNO Concepts</text:h><text:p text:style-name="Paragraph" >UNO is an environment for networked object communication</text:p><text:h text:style-name="Head 3" text:level="3" >Interprocess Connections</text:h><text:h text:style-name="Head 3" text:level="3" >ServiceManager and ComponentContext</text:h><text:h text:style-name="Head 3" text:level="3" >Using UNO Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >Using Collections and Containers</text:h><text:h text:style-name="Head 3" text:level="3" >Event Model</text:h><text:h text:style-name="Head 3" text:level="3" >Exception Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Lifetime Control</text:h><text:h text:style-name="Head 3" text:level="3" >Object Identity</text:h><text:h text:style-name="Head 2" text:level="2" >Language Bindings</text:h><text:h text:style-name="Head 3" text:level="3" >Introduction for language binding</text:h><text:h text:style-name="Head 3" text:level="3" >Java Language Binding</text:h><text:h text:style-name="Head 3" text:level="3" >C++ Binding</text:h><text:h text:style-name="Head 3" text:level="3" >Access for [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 3" text:level="3" >Automation</text:h><text:h text:style-name="Head 1" text:level="1" >Writing UNO components</text:h><text:h text:style-name="Head 2" text:level="2" >Specifying a new Component</text:h><text:h text:style-name="Head 3" text:level="3" >UNOIDL language specification</text:h><text:h text:style-name="Head 2" text:level="2" >Implementing a Component</text:h><text:h text:style-name="Head 3" text:level="3" >Component Development Basics</text:h><text:unordered-list text:style-name="L1" ><text:list-item ><text:p text:style-name="P3" >Introduction</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >Mandatory interfaces: XInterface, XServiceInfo ((from UseInterfaces.CoreInterfaces))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >"Should be implemented" interfaces: XTypeProvider ((from UseInterfaces.CoreInterfaces ))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >optional interface: XMain for standalone execution</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Simple Component in Java</text:h><text:unordered-list text:style-name="L2" ><text:list-item ><text:p text:style-name="P4" >Getting the service manager ((Chapter Java components from unoBindingJava))</text:p></text:list-item><text:list-item ><text:p text:style-name="P4" >simple component chapter</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >C++ Component</text:h><text:h text:style-name="Head 3" text:level="3" >((Automation Component?))</text:h><text:h text:style-name="Head 2" text:level="2" >Deployment Options for Components</text:h><text:h text:style-name="Head 3" text:level="3" >Component Registration</text:h><text:h text:style-name="Head 3" text:level="3" >Service Manager Configuration</text:h><text:unordered-list text:style-name="L3" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P5" >XSet Interface</text:p><text:p text:style-name="P5" >Adding components during runtime, particularly interesting during development</text:p></text:list-item><text:list-item ><text:p text:style-name="P5" >ServiceManager Content</text:p><text:p text:style-name="P5" >Dynamically modifying the ServiceManager</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Bootstrapping the Service Manager ((from CppBind chapter))</text:h><text:unordered-list text:style-name="L4" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P6" >Simple Test Application</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >Configuring Your Application with Bootstrap Parameters</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >The UNO Executable</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Standalone Runtime Environment</text:h><text:p text:style-name="Paragraph" ><text:tab-stop ></text:tab-stop>The UNO executable and XMain</text:p><text:h text:style-name="Head 3" text:level="3" >Configuring the Java Runtime Environment</text:h><text:unordered-list text:style-name="L5" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P7" >The office and Java ((from UnoBindingJava))</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 1" text:level="1" >Advanced UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Design Patterns</text:h><text:h text:style-name="Head 2" text:level="2" >Bridging concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Requirements for Language Bindings and Bridges</text:h><text:h text:style-name="Head 3" text:level="3" >New Scripting Engines</text:h><text:h text:style-name="Head 2" text:level="2" >ServiceManager and loader</text:h><text:h text:style-name="Head 2" text:level="2" >Special Interfaces for internal use</text:h><text:p text:style-name="Paragraph" >XUNOTunnel</text:p><text:p text:style-name="Paragraph" >XAggregation</text:p><text:h text:style-name="Head 2" text:level="2" >UNO Reflection API</text:h><text:h text:style-name="Head 2" text:level="2" >TypeLibrary and TypeProviders</text:h><text:h text:style-name="Head 2" text:level="2" >Differences from Corba</text:h><text:h text:style-name="Head 1" text:level="1" >Office Development</text:h><text:h text:style-name="Head 2" text:level="2" >Global Object Structure</text:h><text:h text:style-name="Head 3" text:level="3" >Desktop Environment</text:h><text:h text:style-name="Head 3" text:level="3" >Frames and Frame Hierarchies</text:h><text:h text:style-name="Head 3" text:level="3" >Frame-Controller-Model Paradigm</text:h><text:h text:style-name="Head 3" text:level="3" >Loading and Saving Office Components</text:h><text:h text:style-name="Head 3" text:level="3" >Dispatch Framework</text:h><text:h text:style-name="Head 2" text:level="2" >Common Features</text:h><text:h text:style-name="Head 3" text:level="3" >Common Dialogs</text:h><text:h text:style-name="Head 3" text:level="3" >DocumentInfo</text:h><text:h text:style-name="Head 3" text:level="3" >Styles</text:h><text:h text:style-name="Head 3" text:level="3" >Search and Replace</text:h><text:h text:style-name="Head 3" text:level="3" >Number Formats</text:h><text:h text:style-name="Head 3" text:level="3" >Package File Formats</text:h><text:h text:style-name="Head 2" text:level="2" >Internationalization</text:h><text:h text:style-name="Head 2" text:level="2" >Linguistic</text:h><text:h text:style-name="Head 2" text:level="2" >System Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Clipboard</text:h><text:h text:style-name="Head 3" text:level="3" >File Picker</text:h><text:h text:style-name="Head 3" text:level="3" >Bridging to the Window System</text:h><text:p text:style-name="Paragraph" ></text:p><text:h text:style-name="Head 1" text:level="1" >Text Documents (51,5 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Text Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Text Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Using Text</text:h><text:h text:style-name="Head 3" text:level="3" >Tables</text:h><text:h text:style-name="Head 3" text:level="3" >Text Fields</text:h><text:h text:style-name="Head 3" text:level="3" >Bookmarks</text:h><text:h text:style-name="Head 3" text:level="3" >Indexes and Index Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Reference Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Footnotes and Endnotes</text:h><text:h text:style-name="Head 3" text:level="3" >Shape Objects in Text</text:h><text:h text:style-name="Head 3" text:level="3" >Redline</text:h><text:h text:style-name="Head 3" text:level="3" >Ruby</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Text Document</text:h><text:h text:style-name="Head 1" text:level="1" >Spreadsheet Documents</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Spreadsheet Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Spreadsheet Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Editing Spreadsheets</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Spreadsheet Document</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Spreadsheet Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Drawings and Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Draw/Impress Files</text:h><text:h text:style-name="Head 3" text:level="3" >Saving</text:h><text:h text:style-name="Head 3" text:level="3" >Printing</text:h><text:h text:style-name="Head 3" text:level="3" >Running Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Working with a Draw/Impress Document</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Draw/Impress Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Draw/Impress Document</text:h><text:h text:style-name="Head 1" text:level="1" >Charts</text:h><text:h text:style-name="Head 2" text:level="2" >Chart Basics</text:h><text:h text:style-name="Head 2" text:level="2" >Creating a Chart Document</text:h><text:h text:style-name="Head 2" text:level="2" >Editing a Chart Document</text:h><text:h text:style-name="Head 3" text:level="3" >Common Diagram API</text:h><text:h text:style-name="Head 3" text:level="3" >Different Chart Types</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Chart Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Basic and Dialogs</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:h text:style-name="Head 2" text:level="2" >Library Organization</text:h><text:h text:style-name="Head 2" text:level="2" >IDE with Dialogs and Events</text:h><text:h text:style-name="Head 2" text:level="2" >Using [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 2" text:level="2" >Toolkit Controls and their Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating Dialogs at Runtime</text:h><text:h text:style-name="Head 1" text:level="1" >Database Access</text:h><text:h text:style-name="Head 2" text:level="2" >Features of the [PRODUCTNAME] Database Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Capabilities</text:h><text:h text:style-name="Head 3" text:level="3" >SDBC, SDBCX, SDB Architecture</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Datasources with [PRODUCTNAME]</text:h><text:h text:style-name="Head 3" text:level="3" >DataSources</text:h><text:h text:style-name="Head 3" text:level="3" >Adding and Editing Datasources </text:h><text:h text:style-name="Head 3" text:level="3" >Establishing a Connection</text:h><text:h text:style-name="Head 4" text:level="4" >Getting Connections</text:h><text:h text:style-name="Head 4" text:level="4" >Driver specifics</text:h><text:h text:style-name="Head 3" text:level="3" >Connection Pooling</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Saved Queries</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Data</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Statements</text:h><text:h text:style-name="Head 3" text:level="3" >Resultsets</text:h><text:h text:style-name="Head 3" text:level="3" >Metadata</text:h><text:h text:style-name="Head 3" text:level="3" >Rowsets</text:h><text:h text:style-name="Head 2" text:level="2" >Working with the Database Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using DDL to change the DB Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using SDBCX to access the DB Design</text:h><text:h text:style-name="Head 2" text:level="2" >Using DBMS Features</text:h><text:h text:style-name="Head 3" text:level="3" >Stored Procedures</text:h><text:h text:style-name="Head 3" text:level="3" >Transaction Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Prepared Statements</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Database Drivers</text:h><text:h text:style-name="Head 1" text:level="1" >Forms</text:h><text:h text:style-name="Head 2" text:level="2" >Concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Models and Views</text:h><text:h text:style-name="Head 3" text:level="3" >Form Elements in the Document Model</text:h><text:h text:style-name="Head 3" text:level="3" >Special Form Components</text:h><text:h text:style-name="Head 3" text:level="3" >Events</text:h><text:h text:style-name="Head 3" text:level="3" >Data Awareness</text:h><text:h text:style-name="Head 2" text:level="2" >Recipes</text:h><text:h text:style-name="Head 3" text:level="3" >Making it easier to work with a Form</text:h><text:h text:style-name="Head 3" text:level="3" >Controlling the Data Input</text:h><text:h text:style-name="Head 3" text:level="3" >Collecting Data automatically</text:h><text:h text:style-name="Head 3" text:level="3" >Taking Advantage of Database Server Features</text:h><text:h text:style-name="Head 3" text:level="3" >Adding new Functionality</text:h><text:h text:style-name="Head 3" text:level="3" >Handling Errors</text:h><text:h text:style-name="Head 1" text:level="1" >UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Purpose of UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Document Contents as Streams</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Content Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating, Moving and Copying Document and Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Additional Commands</text:h><text:h text:style-name="Head 2" text:level="2" >Writing a Content Provider</text:h><text:h text:style-name="Head 1" text:level="1" >[PRODUCTNAME] Configuration</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing configuration data</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Configuration Data</text:h><text:h text:style-name="Head 1" text:level="1" >Appendix</text:h></office:body> + +<office:body ><text:sequence-decls ><text:sequence-decl text:display-outline-level="0" text:name="Illustration" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Table" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Text" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Drawing" ></text:sequence-decl></text:sequence-decls><text:p text:style-name="P1" >Programmer's Manual</text:p><text:p text:style-name="P2" >Planned Outline</text:p><text:p text:style-name="P2" ></text:p><text:h text:style-name="Head 1" text:level="1" >Preface (3 Pages)</text:h><text:h text:style-name="Head 1" text:level="1" >First Steps (24 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Programming with UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Fields of Application for UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Getting Started</text:h><text:h text:style-name="Head 3" text:level="3" >Required Files</text:h><text:h text:style-name="Head 3" text:level="3" >Configuration</text:h><text:h text:style-name="Head 3" text:level="3" >First Connection</text:h><text:h text:style-name="Head 2" text:level="2" >How to get Objects in [PRODUCTNAME]</text:h><text:h text:style-name="Head 2" text:level="2" >How to work with Objects</text:h><text:p text:style-name="Paragraph" >Example</text:p><text:h text:style-name="Head 3" text:level="3" >Services</text:h><text:h text:style-name="Head 3" text:level="3" >Querying Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >ElementAccess</text:h><text:h text:style-name="Head 3" text:level="3" >Simple Types</text:h><text:h text:style-name="Head 3" text:level="3" >Strings</text:h><text:h text:style-name="Head 3" text:level="3" >Enums and Constant Groups</text:h><text:h text:style-name="Head 3" text:level="3" >Structs</text:h><text:h text:style-name="Head 3" text:level="3" >Any</text:h><text:h text:style-name="Head 3" text:level="3" >Sequence</text:h><text:h text:style-name="Head 2" text:level="2" >How to find the solution for a problem</text:h><text:h text:style-name="Head 2" text:level="2" >Finding your Way through the API Reference</text:h><text:h text:style-name="Head 2" text:level="2" >Common Mechanisms</text:h><text:h text:style-name="Head 3" text:level="3" >Text</text:h><text:h text:style-name="Head 3" text:level="3" >Table</text:h><text:h text:style-name="Head 3" text:level="3" >Drawing</text:h><text:h text:style-name="Head 1" text:level="1" >UNO in Professional Projects (<text:span text:style-name="T1" >145</text:span>)</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:p text:style-name="Paragraph" >UNO/API constituents: How UNOIDL/API, ServiceManager, Bridges, CoreReflection work together</text:p><text:h text:style-name="Head 2" text:level="2" >API Concepts</text:h><text:p text:style-name="Paragraph" >API is a language independent, abstract specification for UNO objects which are used in <text:s ></text:s>[PRODUCTNAME]</text:p><text:h text:style-name="Head 3" text:level="3" >Types in the API Reference</text:h><text:h text:style-name="Head 4" text:level="4" >Simple Types</text:h><text:h text:style-name="Head 4" text:level="4" >The Any Type</text:h><text:h text:style-name="Head 4" text:level="4" >Interfaces</text:h><text:h text:style-name="Head 4" text:level="4" >Services</text:h><text:h text:style-name="Head 4" text:level="4" >Modules</text:h><text:h text:style-name="Head 4" text:level="4" >Structs</text:h><text:h text:style-name="Head 4" text:level="4" >Constant Groups and Enums</text:h><text:h text:style-name="Head 4" text:level="4" >Sequences</text:h><text:h text:style-name="Head 4" text:level="4" >Exceptions</text:h><text:h text:style-name="Head 3" text:level="3" >API Principles</text:h><text:h text:style-name="Head 4" text:level="4" >Relationship between Specification, Implementation and Instances</text:h><text:h text:style-name="Head 4" text:level="4" >Object Composition</text:h><text:h text:style-name="Head 2" text:level="2" >UNO Concepts</text:h><text:p text:style-name="Paragraph" >UNO is an environment for networked object communication</text:p><text:h text:style-name="Head 3" text:level="3" >Interprocess Connections</text:h><text:h text:style-name="Head 3" text:level="3" >ServiceManager and ComponentContext</text:h><text:h text:style-name="Head 3" text:level="3" >Using UNO Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >Using Collections and Containers</text:h><text:h text:style-name="Head 3" text:level="3" >Event Model</text:h><text:h text:style-name="Head 3" text:level="3" >Exception Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Lifetime Control</text:h><text:h text:style-name="Head 3" text:level="3" >Object Identity</text:h><text:h text:style-name="Head 2" text:level="2" >Language Bindings</text:h><text:h text:style-name="Head 3" text:level="3" >Introduction for language binding</text:h><text:h text:style-name="Head 3" text:level="3" >Java Language Binding</text:h><text:h text:style-name="Head 3" text:level="3" >C++ Binding</text:h><text:h text:style-name="Head 3" text:level="3" >Access for [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 3" text:level="3" >Automation</text:h><text:h text:style-name="Head 1" text:level="1" >Writing UNO components</text:h><text:h text:style-name="Head 2" text:level="2" >Specifying a new Component</text:h><text:h text:style-name="Head 3" text:level="3" >UNOIDL language specification</text:h><text:h text:style-name="Head 2" text:level="2" >Implementing a Component</text:h><text:h text:style-name="Head 3" text:level="3" >Component Development Basics</text:h><text:unordered-list text:style-name="L1" ><text:list-item ><text:p text:style-name="P3" >Introduction</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >Mandatory interfaces: XInterface, XServiceInfo ((from UseInterfaces.CoreInterfaces))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >"Should be implemented" interfaces: XTypeProvider ((from UseInterfaces.CoreInterfaces ))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >optional interface: XMain for standalone execution</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Simple Component in Java</text:h><text:unordered-list text:style-name="L2" ><text:list-item ><text:p text:style-name="P4" >Getting the service manager ((Chapter Java components from unoBindingJava))</text:p></text:list-item><text:list-item ><text:p text:style-name="P4" >simple component chapter</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >C++ Component</text:h><text:h text:style-name="Head 3" text:level="3" >((Automation Component?))</text:h><text:h text:style-name="Head 2" text:level="2" >Deployment Options for Components</text:h><text:h text:style-name="Head 3" text:level="3" >Component Registration</text:h><text:h text:style-name="Head 3" text:level="3" >Service Manager Configuration</text:h><text:unordered-list text:style-name="L3" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P5" >XSet Interface</text:p><text:p text:style-name="P5" >Adding components during runtime, particularly interesting during development</text:p></text:list-item><text:list-item ><text:p text:style-name="P5" >ServiceManager Content</text:p><text:p text:style-name="P5" >Dynamically modifying the ServiceManager</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Bootstrapping the Service Manager ((from CppBind chapter))</text:h><text:unordered-list text:style-name="L4" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P6" >Simple Test Application</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >Configuring Your Application with Bootstrap Parameters</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >The UNO Executable</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Standalone Runtime Environment</text:h><text:p text:style-name="Paragraph" ><text:tab-stop ></text:tab-stop>The UNO executable and XMain</text:p><text:h text:style-name="Head 3" text:level="3" >Configuring the Java Runtime Environment</text:h><text:unordered-list text:style-name="L5" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P7" >The office and Java ((from UnoBindingJava))</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 1" text:level="1" >Advanced UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Design Patterns</text:h><text:h text:style-name="Head 2" text:level="2" >Bridging concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Requirements for Language Bindings and Bridges</text:h><text:h text:style-name="Head 3" text:level="3" >New Scripting Engines</text:h><text:h text:style-name="Head 2" text:level="2" >ServiceManager and loader</text:h><text:h text:style-name="Head 2" text:level="2" >Special Interfaces for internal use</text:h><text:p text:style-name="Paragraph" >XUNOTunnel</text:p><text:p text:style-name="Paragraph" >XAggregation</text:p><text:h text:style-name="Head 2" text:level="2" >UNO Reflection API</text:h><text:h text:style-name="Head 2" text:level="2" >TypeLibrary and TypeProviders</text:h><text:h text:style-name="Head 2" text:level="2" >Differences from Corba</text:h><text:h text:style-name="Head 1" text:level="1" >Office Development</text:h><text:h text:style-name="Head 2" text:level="2" >Global Object Structure</text:h><text:h text:style-name="Head 3" text:level="3" >Desktop Environment</text:h><text:h text:style-name="Head 3" text:level="3" >Frames and Frame Hierarchies</text:h><text:h text:style-name="Head 3" text:level="3" >Frame-Controller-Model Paradigm</text:h><text:h text:style-name="Head 3" text:level="3" >Loading and Saving Office Components</text:h><text:h text:style-name="Head 3" text:level="3" >Dispatch Framework</text:h><text:h text:style-name="Head 2" text:level="2" >Common Features</text:h><text:h text:style-name="Head 3" text:level="3" >Common Dialogs</text:h><text:h text:style-name="Head 3" text:level="3" >DocumentInfo</text:h><text:h text:style-name="Head 3" text:level="3" >Styles</text:h><text:h text:style-name="Head 3" text:level="3" >Search and Replace</text:h><text:h text:style-name="Head 3" text:level="3" >Number Formats</text:h><text:h text:style-name="Head 3" text:level="3" >Package File Formats</text:h><text:h text:style-name="Head 2" text:level="2" >Internationalization</text:h><text:h text:style-name="Head 2" text:level="2" >Linguistic</text:h><text:h text:style-name="Head 2" text:level="2" >System Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Clipboard</text:h><text:h text:style-name="Head 3" text:level="3" >File Picker</text:h><text:h text:style-name="Head 3" text:level="3" >Bridging to the Window System</text:h><text:p text:style-name="Paragraph" ></text:p><text:h text:style-name="Head 1" text:level="1" >Text Documents (51,5 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Text Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Text Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Using Text</text:h><text:h text:style-name="Head 3" text:level="3" >Tables</text:h><text:h text:style-name="Head 3" text:level="3" >Text Fields</text:h><text:h text:style-name="Head 3" text:level="3" >Bookmarks</text:h><text:h text:style-name="Head 3" text:level="3" >Indexes and Index Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Reference Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Footnotes and Endnotes</text:h><text:h text:style-name="Head 3" text:level="3" >Shape Objects in Text</text:h><text:h text:style-name="Head 3" text:level="3" >Redline</text:h><text:h text:style-name="Head 3" text:level="3" >Ruby</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Text Document</text:h><text:h text:style-name="Head 1" text:level="1" >Spreadsheet Documents</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Spreadsheet Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Spreadsheet Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Editing Spreadsheets</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Spreadsheet Document</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Spreadsheet Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Drawings and Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Draw/Impress Files</text:h><text:h text:style-name="Head 3" text:level="3" >Saving</text:h><text:h text:style-name="Head 3" text:level="3" >Printing</text:h><text:h text:style-name="Head 3" text:level="3" >Running Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Working with a Draw/Impress Document</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Draw/Impress Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Draw/Impress Document</text:h><text:h text:style-name="Head 1" text:level="1" >Charts</text:h><text:h text:style-name="Head 2" text:level="2" >Chart Basics</text:h><text:h text:style-name="Head 2" text:level="2" >Creating a Chart Document</text:h><text:h text:style-name="Head 2" text:level="2" >Editing a Chart Document</text:h><text:h text:style-name="Head 3" text:level="3" >Common Diagram API</text:h><text:h text:style-name="Head 3" text:level="3" >Different Chart Types</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Chart Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Basic and Dialogs</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:h text:style-name="Head 2" text:level="2" >Library Organization</text:h><text:h text:style-name="Head 2" text:level="2" >IDE with Dialogs and Events</text:h><text:h text:style-name="Head 2" text:level="2" >Using [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 2" text:level="2" >Toolkit Controls and their Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating Dialogs at Runtime</text:h><text:h text:style-name="Head 1" text:level="1" >Database Access</text:h><text:h text:style-name="Head 2" text:level="2" >Features of the [PRODUCTNAME] Database Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Capabilities</text:h><text:h text:style-name="Head 3" text:level="3" >SDBC, SDBCX, SDB Architecture</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Datasources with [PRODUCTNAME]</text:h><text:h text:style-name="Head 3" text:level="3" >DataSources</text:h><text:h text:style-name="Head 3" text:level="3" >Adding and Editing Datasources </text:h><text:h text:style-name="Head 3" text:level="3" >Establishing a Connection</text:h><text:h text:style-name="Head 4" text:level="4" >Getting Connections</text:h><text:h text:style-name="Head 4" text:level="4" >Driver specifics</text:h><text:h text:style-name="Head 3" text:level="3" >Connection Pooling</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Saved Queries</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Data</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Statements</text:h><text:h text:style-name="Head 3" text:level="3" >Resultsets</text:h><text:h text:style-name="Head 3" text:level="3" >Metadata</text:h><text:h text:style-name="Head 3" text:level="3" >Rowsets</text:h><text:h text:style-name="Head 2" text:level="2" >Working with the Database Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using DDL to change the DB Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using SDBCX to access the DB Design</text:h><text:h text:style-name="Head 2" text:level="2" >Using DBMS Features</text:h><text:h text:style-name="Head 3" text:level="3" >Stored Procedures</text:h><text:h text:style-name="Head 3" text:level="3" >Transaction Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Prepared Statements</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Database Drivers</text:h><text:h text:style-name="Head 1" text:level="1" >Forms</text:h><text:h text:style-name="Head 2" text:level="2" >Concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Models and Views</text:h><text:h text:style-name="Head 3" text:level="3" >Form Elements in the Document Model</text:h><text:h text:style-name="Head 3" text:level="3" >Special Form Components</text:h><text:h text:style-name="Head 3" text:level="3" >Events</text:h><text:h text:style-name="Head 3" text:level="3" >Data Awareness</text:h><text:h text:style-name="Head 2" text:level="2" >Recipes</text:h><text:h text:style-name="Head 3" text:level="3" >Making it easier to work with a Form</text:h><text:h text:style-name="Head 3" text:level="3" >Controlling the Data Input</text:h><text:h text:style-name="Head 3" text:level="3" >Collecting Data automatically</text:h><text:h text:style-name="Head 3" text:level="3" >Taking Advantage of Database Server Features</text:h><text:h text:style-name="Head 3" text:level="3" >Adding new Functionality</text:h><text:h text:style-name="Head 3" text:level="3" >Handling Errors</text:h><text:h text:style-name="Head 1" text:level="1" >UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Purpose of UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Document Contents as Streams</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Content Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating, Moving and Copying Document and Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Additional Commands</text:h><text:h text:style-name="Head 2" text:level="2" >Writing a Content Provider</text:h><text:h text:style-name="Head 1" text:level="1" >[PRODUCTNAME] Configuration</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing configuration data</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Configuration Data</text:h><text:h text:style-name="Head 1" text:level="1" >Appendix</text:h></office:body> + +<office:body ><text:sequence-decls ><text:sequence-decl text:display-outline-level="0" text:name="Illustration" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Table" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Text" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Drawing" ></text:sequence-decl></text:sequence-decls><text:p text:style-name="P1" >Programmer's Manual</text:p><text:p text:style-name="P2" >Planned Outline</text:p><text:p text:style-name="P2" ></text:p><text:h text:style-name="Head 1" text:level="1" >Preface (3 Pages)</text:h><text:h text:style-name="Head 1" text:level="1" >First Steps (24 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Programming with UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Fields of Application for UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Getting Started</text:h><text:h text:style-name="Head 3" text:level="3" >Required Files</text:h><text:h text:style-name="Head 3" text:level="3" >Configuration</text:h><text:h text:style-name="Head 3" text:level="3" >First Connection</text:h><text:h text:style-name="Head 2" text:level="2" >How to get Objects in [PRODUCTNAME]</text:h><text:h text:style-name="Head 2" text:level="2" >How to work with Objects</text:h><text:p text:style-name="Paragraph" >Example</text:p><text:h text:style-name="Head 3" text:level="3" >Services</text:h><text:h text:style-name="Head 3" text:level="3" >Querying Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >ElementAccess</text:h><text:h text:style-name="Head 3" text:level="3" >Simple Types</text:h><text:h text:style-name="Head 3" text:level="3" >Strings</text:h><text:h text:style-name="Head 3" text:level="3" >Enums and Constant Groups</text:h><text:h text:style-name="Head 3" text:level="3" >Structs</text:h><text:h text:style-name="Head 3" text:level="3" >Any</text:h><text:h text:style-name="Head 3" text:level="3" >Sequence</text:h><text:h text:style-name="Head 2" text:level="2" >How to find the solution for a problem</text:h><text:h text:style-name="Head 2" text:level="2" >Finding your Way through the API Reference</text:h><text:h text:style-name="Head 2" text:level="2" >Common Mechanisms</text:h><text:h text:style-name="Head 3" text:level="3" >Text</text:h><text:h text:style-name="Head 3" text:level="3" >Table</text:h><text:h text:style-name="Head 3" text:level="3" >Drawing</text:h><text:h text:style-name="Head 1" text:level="1" >UNO in Professional Projects (<text:span text:style-name="T1" >145</text:span>)</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:p text:style-name="Paragraph" >UNO/API constituents: How UNOIDL/API, ServiceManager, Bridges, CoreReflection work together</text:p><text:h text:style-name="Head 2" text:level="2" >API Concepts</text:h><text:p text:style-name="Paragraph" >API is a language independent, abstract specification for UNO objects which are used in <text:s ></text:s>[PRODUCTNAME]</text:p><text:h text:style-name="Head 3" text:level="3" >Types in the API Reference</text:h><text:h text:style-name="Head 4" text:level="4" >Simple Types</text:h><text:h text:style-name="Head 4" text:level="4" >The Any Type</text:h><text:h text:style-name="Head 4" text:level="4" >Interfaces</text:h><text:h text:style-name="Head 4" text:level="4" >Services</text:h><text:h text:style-name="Head 4" text:level="4" >Modules</text:h><text:h text:style-name="Head 4" text:level="4" >Structs</text:h><text:h text:style-name="Head 4" text:level="4" >Constant Groups and Enums</text:h><text:h text:style-name="Head 4" text:level="4" >Sequences</text:h><text:h text:style-name="Head 4" text:level="4" >Exceptions</text:h><text:h text:style-name="Head 3" text:level="3" >API Principles</text:h><text:h text:style-name="Head 4" text:level="4" >Relationship between Specification, Implementation and Instances</text:h><text:h text:style-name="Head 4" text:level="4" >Object Composition</text:h><text:h text:style-name="Head 2" text:level="2" >UNO Concepts</text:h><text:p text:style-name="Paragraph" >UNO is an environment for networked object communication</text:p><text:h text:style-name="Head 3" text:level="3" >Interprocess Connections</text:h><text:h text:style-name="Head 3" text:level="3" >ServiceManager and ComponentContext</text:h><text:h text:style-name="Head 3" text:level="3" >Using UNO Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >Using Collections and Containers</text:h><text:h text:style-name="Head 3" text:level="3" >Event Model</text:h><text:h text:style-name="Head 3" text:level="3" >Exception Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Lifetime Control</text:h><text:h text:style-name="Head 3" text:level="3" >Object Identity</text:h><text:h text:style-name="Head 2" text:level="2" >Language Bindings</text:h><text:h text:style-name="Head 3" text:level="3" >Introduction for language binding</text:h><text:h text:style-name="Head 3" text:level="3" >Java Language Binding</text:h><text:h text:style-name="Head 3" text:level="3" >C++ Binding</text:h><text:h text:style-name="Head 3" text:level="3" >Access for [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 3" text:level="3" >Automation</text:h><text:h text:style-name="Head 1" text:level="1" >Writing UNO components</text:h><text:h text:style-name="Head 2" text:level="2" >Specifying a new Component</text:h><text:h text:style-name="Head 3" text:level="3" >UNOIDL language specification</text:h><text:h text:style-name="Head 2" text:level="2" >Implementing a Component</text:h><text:h text:style-name="Head 3" text:level="3" >Component Development Basics</text:h><text:unordered-list text:style-name="L1" ><text:list-item ><text:p text:style-name="P3" >Introduction</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >Mandatory interfaces: XInterface, XServiceInfo ((from UseInterfaces.CoreInterfaces))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >"Should be implemented" interfaces: XTypeProvider ((from UseInterfaces.CoreInterfaces ))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >optional interface: XMain for standalone execution</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Simple Component in Java</text:h><text:unordered-list text:style-name="L2" ><text:list-item ><text:p text:style-name="P4" >Getting the service manager ((Chapter Java components from unoBindingJava))</text:p></text:list-item><text:list-item ><text:p text:style-name="P4" >simple component chapter</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >C++ Component</text:h><text:h text:style-name="Head 3" text:level="3" >((Automation Component?))</text:h><text:h text:style-name="Head 2" text:level="2" >Deployment Options for Components</text:h><text:h text:style-name="Head 3" text:level="3" >Component Registration</text:h><text:h text:style-name="Head 3" text:level="3" >Service Manager Configuration</text:h><text:unordered-list text:style-name="L3" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P5" >XSet Interface</text:p><text:p text:style-name="P5" >Adding components during runtime, particularly interesting during development</text:p></text:list-item><text:list-item ><text:p text:style-name="P5" >ServiceManager Content</text:p><text:p text:style-name="P5" >Dynamically modifying the ServiceManager</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Bootstrapping the Service Manager ((from CppBind chapter))</text:h><text:unordered-list text:style-name="L4" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P6" >Simple Test Application</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >Configuring Your Application with Bootstrap Parameters</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >The UNO Executable</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Standalone Runtime Environment</text:h><text:p text:style-name="Paragraph" ><text:tab-stop ></text:tab-stop>The UNO executable and XMain</text:p><text:h text:style-name="Head 3" text:level="3" >Configuring the Java Runtime Environment</text:h><text:unordered-list text:style-name="L5" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P7" >The office and Java ((from UnoBindingJava))</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 1" text:level="1" >Advanced UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Design Patterns</text:h><text:h text:style-name="Head 2" text:level="2" >Bridging concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Requirements for Language Bindings and Bridges</text:h><text:h text:style-name="Head 3" text:level="3" >New Scripting Engines</text:h><text:h text:style-name="Head 2" text:level="2" >ServiceManager and loader</text:h><text:h text:style-name="Head 2" text:level="2" >Special Interfaces for internal use</text:h><text:p text:style-name="Paragraph" >XUNOTunnel</text:p><text:p text:style-name="Paragraph" >XAggregation</text:p><text:h text:style-name="Head 2" text:level="2" >UNO Reflection API</text:h><text:h text:style-name="Head 2" text:level="2" >TypeLibrary and TypeProviders</text:h><text:h text:style-name="Head 2" text:level="2" >Differences from Corba</text:h><text:h text:style-name="Head 1" text:level="1" >Office Development</text:h><text:h text:style-name="Head 2" text:level="2" >Global Object Structure</text:h><text:h text:style-name="Head 3" text:level="3" >Desktop Environment</text:h><text:h text:style-name="Head 3" text:level="3" >Frames and Frame Hierarchies</text:h><text:h text:style-name="Head 3" text:level="3" >Frame-Controller-Model Paradigm</text:h><text:h text:style-name="Head 3" text:level="3" >Loading and Saving Office Components</text:h><text:h text:style-name="Head 3" text:level="3" >Dispatch Framework</text:h><text:h text:style-name="Head 2" text:level="2" >Common Features</text:h><text:h text:style-name="Head 3" text:level="3" >Common Dialogs</text:h><text:h text:style-name="Head 3" text:level="3" >DocumentInfo</text:h><text:h text:style-name="Head 3" text:level="3" >Styles</text:h><text:h text:style-name="Head 3" text:level="3" >Search and Replace</text:h><text:h text:style-name="Head 3" text:level="3" >Number Formats</text:h><text:h text:style-name="Head 3" text:level="3" >Package File Formats</text:h><text:h text:style-name="Head 2" text:level="2" >Internationalization</text:h><text:h text:style-name="Head 2" text:level="2" >Linguistic</text:h><text:h text:style-name="Head 2" text:level="2" >System Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Clipboard</text:h><text:h text:style-name="Head 3" text:level="3" >File Picker</text:h><text:h text:style-name="Head 3" text:level="3" >Bridging to the Window System</text:h><text:p text:style-name="Paragraph" ></text:p><text:h text:style-name="Head 1" text:level="1" >Text Documents (51,5 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Text Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Text Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Using Text</text:h><text:h text:style-name="Head 3" text:level="3" >Tables</text:h><text:h text:style-name="Head 3" text:level="3" >Text Fields</text:h><text:h text:style-name="Head 3" text:level="3" >Bookmarks</text:h><text:h text:style-name="Head 3" text:level="3" >Indexes and Index Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Reference Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Footnotes and Endnotes</text:h><text:h text:style-name="Head 3" text:level="3" >Shape Objects in Text</text:h><text:h text:style-name="Head 3" text:level="3" >Redline</text:h><text:h text:style-name="Head 3" text:level="3" >Ruby</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Text Document</text:h><text:h text:style-name="Head 1" text:level="1" >Spreadsheet Documents</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Spreadsheet Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Spreadsheet Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Editing Spreadsheets</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Spreadsheet Document</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Spreadsheet Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Drawings and Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Draw/Impress Files</text:h><text:h text:style-name="Head 3" text:level="3" >Saving</text:h><text:h text:style-name="Head 3" text:level="3" >Printing</text:h><text:h text:style-name="Head 3" text:level="3" >Running Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Working with a Draw/Impress Document</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Draw/Impress Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Draw/Impress Document</text:h><text:h text:style-name="Head 1" text:level="1" >Charts</text:h><text:h text:style-name="Head 2" text:level="2" >Chart Basics</text:h><text:h text:style-name="Head 2" text:level="2" >Creating a Chart Document</text:h><text:h text:style-name="Head 2" text:level="2" >Editing a Chart Document</text:h><text:h text:style-name="Head 3" text:level="3" >Common Diagram API</text:h><text:h text:style-name="Head 3" text:level="3" >Different Chart Types</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Chart Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Basic and Dialogs</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:h text:style-name="Head 2" text:level="2" >Library Organization</text:h><text:h text:style-name="Head 2" text:level="2" >IDE with Dialogs and Events</text:h><text:h text:style-name="Head 2" text:level="2" >Using [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 2" text:level="2" >Toolkit Controls and their Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating Dialogs at Runtime</text:h><text:h text:style-name="Head 1" text:level="1" >Database Access</text:h><text:h text:style-name="Head 2" text:level="2" >Features of the [PRODUCTNAME] Database Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Capabilities</text:h><text:h text:style-name="Head 3" text:level="3" >SDBC, SDBCX, SDB Architecture</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Datasources with [PRODUCTNAME]</text:h><text:h text:style-name="Head 3" text:level="3" >DataSources</text:h><text:h text:style-name="Head 3" text:level="3" >Adding and Editing Datasources </text:h><text:h text:style-name="Head 3" text:level="3" >Establishing a Connection</text:h><text:h text:style-name="Head 4" text:level="4" >Getting Connections</text:h><text:h text:style-name="Head 4" text:level="4" >Driver specifics</text:h><text:h text:style-name="Head 3" text:level="3" >Connection Pooling</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Saved Queries</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Data</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Statements</text:h><text:h text:style-name="Head 3" text:level="3" >Resultsets</text:h><text:h text:style-name="Head 3" text:level="3" >Metadata</text:h><text:h text:style-name="Head 3" text:level="3" >Rowsets</text:h><text:h text:style-name="Head 2" text:level="2" >Working with the Database Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using DDL to change the DB Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using SDBCX to access the DB Design</text:h><text:h text:style-name="Head 2" text:level="2" >Using DBMS Features</text:h><text:h text:style-name="Head 3" text:level="3" >Stored Procedures</text:h><text:h text:style-name="Head 3" text:level="3" >Transaction Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Prepared Statements</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Database Drivers</text:h><text:h text:style-name="Head 1" text:level="1" >Forms</text:h><text:h text:style-name="Head 2" text:level="2" >Concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Models and Views</text:h><text:h text:style-name="Head 3" text:level="3" >Form Elements in the Document Model</text:h><text:h text:style-name="Head 3" text:level="3" >Special Form Components</text:h><text:h text:style-name="Head 3" text:level="3" >Events</text:h><text:h text:style-name="Head 3" text:level="3" >Data Awareness</text:h><text:h text:style-name="Head 2" text:level="2" >Recipes</text:h><text:h text:style-name="Head 3" text:level="3" >Making it easier to work with a Form</text:h><text:h text:style-name="Head 3" text:level="3" >Controlling the Data Input</text:h><text:h text:style-name="Head 3" text:level="3" >Collecting Data automatically</text:h><text:h text:style-name="Head 3" text:level="3" >Taking Advantage of Database Server Features</text:h><text:h text:style-name="Head 3" text:level="3" >Adding new Functionality</text:h><text:h text:style-name="Head 3" text:level="3" >Handling Errors</text:h><text:h text:style-name="Head 1" text:level="1" >UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Purpose of UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Document Contents as Streams</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Content Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating, Moving and Copying Document and Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Additional Commands</text:h><text:h text:style-name="Head 2" text:level="2" >Writing a Content Provider</text:h><text:h text:style-name="Head 1" text:level="1" >[PRODUCTNAME] Configuration</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing configuration data</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Configuration Data</text:h><text:h text:style-name="Head 1" text:level="1" >Appendix</text:h></office:body> + +<office:body ><text:sequence-decls ><text:sequence-decl text:display-outline-level="0" text:name="Illustration" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Table" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Text" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Drawing" ></text:sequence-decl></text:sequence-decls><text:p text:style-name="P1" >Programmer's Manual</text:p><text:p text:style-name="P2" >Planned Outline</text:p><text:p text:style-name="P2" ></text:p><text:h text:style-name="Head 1" text:level="1" >Preface (3 Pages)</text:h><text:h text:style-name="Head 1" text:level="1" >First Steps (24 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Programming with UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Fields of Application for UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Getting Started</text:h><text:h text:style-name="Head 3" text:level="3" >Required Files</text:h><text:h text:style-name="Head 3" text:level="3" >Configuration</text:h><text:h text:style-name="Head 3" text:level="3" >First Connection</text:h><text:h text:style-name="Head 2" text:level="2" >How to get Objects in [PRODUCTNAME]</text:h><text:h text:style-name="Head 2" text:level="2" >How to work with Objects</text:h><text:p text:style-name="Paragraph" >Example</text:p><text:h text:style-name="Head 3" text:level="3" >Services</text:h><text:h text:style-name="Head 3" text:level="3" >Querying Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >ElementAccess</text:h><text:h text:style-name="Head 3" text:level="3" >Simple Types</text:h><text:h text:style-name="Head 3" text:level="3" >Strings</text:h><text:h text:style-name="Head 3" text:level="3" >Enums and Constant Groups</text:h><text:h text:style-name="Head 3" text:level="3" >Structs</text:h><text:h text:style-name="Head 3" text:level="3" >Any</text:h><text:h text:style-name="Head 3" text:level="3" >Sequence</text:h><text:h text:style-name="Head 2" text:level="2" >How to find the solution for a problem</text:h><text:h text:style-name="Head 2" text:level="2" >Finding your Way through the API Reference</text:h><text:h text:style-name="Head 2" text:level="2" >Common Mechanisms</text:h><text:h text:style-name="Head 3" text:level="3" >Text</text:h><text:h text:style-name="Head 3" text:level="3" >Table</text:h><text:h text:style-name="Head 3" text:level="3" >Drawing</text:h><text:h text:style-name="Head 1" text:level="1" >UNO in Professional Projects (<text:span text:style-name="T1" >145</text:span>)</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:p text:style-name="Paragraph" >UNO/API constituents: How UNOIDL/API, ServiceManager, Bridges, CoreReflection work together</text:p><text:h text:style-name="Head 2" text:level="2" >API Concepts</text:h><text:p text:style-name="Paragraph" >API is a language independent, abstract specification for UNO objects which are used in <text:s ></text:s>[PRODUCTNAME]</text:p><text:h text:style-name="Head 3" text:level="3" >Types in the API Reference</text:h><text:h text:style-name="Head 4" text:level="4" >Simple Types</text:h><text:h text:style-name="Head 4" text:level="4" >The Any Type</text:h><text:h text:style-name="Head 4" text:level="4" >Interfaces</text:h><text:h text:style-name="Head 4" text:level="4" >Services</text:h><text:h text:style-name="Head 4" text:level="4" >Modules</text:h><text:h text:style-name="Head 4" text:level="4" >Structs</text:h><text:h text:style-name="Head 4" text:level="4" >Constant Groups and Enums</text:h><text:h text:style-name="Head 4" text:level="4" >Sequences</text:h><text:h text:style-name="Head 4" text:level="4" >Exceptions</text:h><text:h text:style-name="Head 3" text:level="3" >API Principles</text:h><text:h text:style-name="Head 4" text:level="4" >Relationship between Specification, Implementation and Instances</text:h><text:h text:style-name="Head 4" text:level="4" >Object Composition</text:h><text:h text:style-name="Head 2" text:level="2" >UNO Concepts</text:h><text:p text:style-name="Paragraph" >UNO is an environment for networked object communication</text:p><text:h text:style-name="Head 3" text:level="3" >Interprocess Connections</text:h><text:h text:style-name="Head 3" text:level="3" >ServiceManager and ComponentContext</text:h><text:h text:style-name="Head 3" text:level="3" >Using UNO Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >Using Collections and Containers</text:h><text:h text:style-name="Head 3" text:level="3" >Event Model</text:h><text:h text:style-name="Head 3" text:level="3" >Exception Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Lifetime Control</text:h><text:h text:style-name="Head 3" text:level="3" >Object Identity</text:h><text:h text:style-name="Head 2" text:level="2" >Language Bindings</text:h><text:h text:style-name="Head 3" text:level="3" >Introduction for language binding</text:h><text:h text:style-name="Head 3" text:level="3" >Java Language Binding</text:h><text:h text:style-name="Head 3" text:level="3" >C++ Binding</text:h><text:h text:style-name="Head 3" text:level="3" >Access for [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 3" text:level="3" >Automation</text:h><text:h text:style-name="Head 1" text:level="1" >Writing UNO components</text:h><text:h text:style-name="Head 2" text:level="2" >Specifying a new Component</text:h><text:h text:style-name="Head 3" text:level="3" >UNOIDL language specification</text:h><text:h text:style-name="Head 2" text:level="2" >Implementing a Component</text:h><text:h text:style-name="Head 3" text:level="3" >Component Development Basics</text:h><text:unordered-list text:style-name="L1" ><text:list-item ><text:p text:style-name="P3" >Introduction</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >Mandatory interfaces: XInterface, XServiceInfo ((from UseInterfaces.CoreInterfaces))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >"Should be implemented" interfaces: XTypeProvider ((from UseInterfaces.CoreInterfaces ))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >optional interface: XMain for standalone execution</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Simple Component in Java</text:h><text:unordered-list text:style-name="L2" ><text:list-item ><text:p text:style-name="P4" >Getting the service manager ((Chapter Java components from unoBindingJava))</text:p></text:list-item><text:list-item ><text:p text:style-name="P4" >simple component chapter</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >C++ Component</text:h><text:h text:style-name="Head 3" text:level="3" >((Automation Component?))</text:h><text:h text:style-name="Head 2" text:level="2" >Deployment Options for Components</text:h><text:h text:style-name="Head 3" text:level="3" >Component Registration</text:h><text:h text:style-name="Head 3" text:level="3" >Service Manager Configuration</text:h><text:unordered-list text:style-name="L3" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P5" >XSet Interface</text:p><text:p text:style-name="P5" >Adding components during runtime, particularly interesting during development</text:p></text:list-item><text:list-item ><text:p text:style-name="P5" >ServiceManager Content</text:p><text:p text:style-name="P5" >Dynamically modifying the ServiceManager</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Bootstrapping the Service Manager ((from CppBind chapter))</text:h><text:unordered-list text:style-name="L4" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P6" >Simple Test Application</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >Configuring Your Application with Bootstrap Parameters</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >The UNO Executable</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Standalone Runtime Environment</text:h><text:p text:style-name="Paragraph" ><text:tab-stop ></text:tab-stop>The UNO executable and XMain</text:p><text:h text:style-name="Head 3" text:level="3" >Configuring the Java Runtime Environment</text:h><text:unordered-list text:style-name="L5" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P7" >The office and Java ((from UnoBindingJava))</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 1" text:level="1" >Advanced UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Design Patterns</text:h><text:h text:style-name="Head 2" text:level="2" >Bridging concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Requirements for Language Bindings and Bridges</text:h><text:h text:style-name="Head 3" text:level="3" >New Scripting Engines</text:h><text:h text:style-name="Head 2" text:level="2" >ServiceManager and loader</text:h><text:h text:style-name="Head 2" text:level="2" >Special Interfaces for internal use</text:h><text:p text:style-name="Paragraph" >XUNOTunnel</text:p><text:p text:style-name="Paragraph" >XAggregation</text:p><text:h text:style-name="Head 2" text:level="2" >UNO Reflection API</text:h><text:h text:style-name="Head 2" text:level="2" >TypeLibrary and TypeProviders</text:h><text:h text:style-name="Head 2" text:level="2" >Differences from Corba</text:h><text:h text:style-name="Head 1" text:level="1" >Office Development</text:h><text:h text:style-name="Head 2" text:level="2" >Global Object Structure</text:h><text:h text:style-name="Head 3" text:level="3" >Desktop Environment</text:h><text:h text:style-name="Head 3" text:level="3" >Frames and Frame Hierarchies</text:h><text:h text:style-name="Head 3" text:level="3" >Frame-Controller-Model Paradigm</text:h><text:h text:style-name="Head 3" text:level="3" >Loading and Saving Office Components</text:h><text:h text:style-name="Head 3" text:level="3" >Dispatch Framework</text:h><text:h text:style-name="Head 2" text:level="2" >Common Features</text:h><text:h text:style-name="Head 3" text:level="3" >Common Dialogs</text:h><text:h text:style-name="Head 3" text:level="3" >DocumentInfo</text:h><text:h text:style-name="Head 3" text:level="3" >Styles</text:h><text:h text:style-name="Head 3" text:level="3" >Search and Replace</text:h><text:h text:style-name="Head 3" text:level="3" >Number Formats</text:h><text:h text:style-name="Head 3" text:level="3" >Package File Formats</text:h><text:h text:style-name="Head 2" text:level="2" >Internationalization</text:h><text:h text:style-name="Head 2" text:level="2" >Linguistic</text:h><text:h text:style-name="Head 2" text:level="2" >System Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Clipboard</text:h><text:h text:style-name="Head 3" text:level="3" >File Picker</text:h><text:h text:style-name="Head 3" text:level="3" >Bridging to the Window System</text:h><text:p text:style-name="Paragraph" ></text:p><text:h text:style-name="Head 1" text:level="1" >Text Documents (51,5 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Text Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Text Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Using Text</text:h><text:h text:style-name="Head 3" text:level="3" >Tables</text:h><text:h text:style-name="Head 3" text:level="3" >Text Fields</text:h><text:h text:style-name="Head 3" text:level="3" >Bookmarks</text:h><text:h text:style-name="Head 3" text:level="3" >Indexes and Index Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Reference Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Footnotes and Endnotes</text:h><text:h text:style-name="Head 3" text:level="3" >Shape Objects in Text</text:h><text:h text:style-name="Head 3" text:level="3" >Redline</text:h><text:h text:style-name="Head 3" text:level="3" >Ruby</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Text Document</text:h><text:h text:style-name="Head 1" text:level="1" >Spreadsheet Documents</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Spreadsheet Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Spreadsheet Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Editing Spreadsheets</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Spreadsheet Document</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Spreadsheet Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Drawings and Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Draw/Impress Files</text:h><text:h text:style-name="Head 3" text:level="3" >Saving</text:h><text:h text:style-name="Head 3" text:level="3" >Printing</text:h><text:h text:style-name="Head 3" text:level="3" >Running Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Working with a Draw/Impress Document</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Draw/Impress Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Draw/Impress Document</text:h><text:h text:style-name="Head 1" text:level="1" >Charts</text:h><text:h text:style-name="Head 2" text:level="2" >Chart Basics</text:h><text:h text:style-name="Head 2" text:level="2" >Creating a Chart Document</text:h><text:h text:style-name="Head 2" text:level="2" >Editing a Chart Document</text:h><text:h text:style-name="Head 3" text:level="3" >Common Diagram API</text:h><text:h text:style-name="Head 3" text:level="3" >Different Chart Types</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Chart Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Basic and Dialogs</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:h text:style-name="Head 2" text:level="2" >Library Organization</text:h><text:h text:style-name="Head 2" text:level="2" >IDE with Dialogs and Events</text:h><text:h text:style-name="Head 2" text:level="2" >Using [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 2" text:level="2" >Toolkit Controls and their Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating Dialogs at Runtime</text:h><text:h text:style-name="Head 1" text:level="1" >Database Access</text:h><text:h text:style-name="Head 2" text:level="2" >Features of the [PRODUCTNAME] Database Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Capabilities</text:h><text:h text:style-name="Head 3" text:level="3" >SDBC, SDBCX, SDB Architecture</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Datasources with [PRODUCTNAME]</text:h><text:h text:style-name="Head 3" text:level="3" >DataSources</text:h><text:h text:style-name="Head 3" text:level="3" >Adding and Editing Datasources </text:h><text:h text:style-name="Head 3" text:level="3" >Establishing a Connection</text:h><text:h text:style-name="Head 4" text:level="4" >Getting Connections</text:h><text:h text:style-name="Head 4" text:level="4" >Driver specifics</text:h><text:h text:style-name="Head 3" text:level="3" >Connection Pooling</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Saved Queries</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Data</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Statements</text:h><text:h text:style-name="Head 3" text:level="3" >Resultsets</text:h><text:h text:style-name="Head 3" text:level="3" >Metadata</text:h><text:h text:style-name="Head 3" text:level="3" >Rowsets</text:h><text:h text:style-name="Head 2" text:level="2" >Working with the Database Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using DDL to change the DB Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using SDBCX to access the DB Design</text:h><text:h text:style-name="Head 2" text:level="2" >Using DBMS Features</text:h><text:h text:style-name="Head 3" text:level="3" >Stored Procedures</text:h><text:h text:style-name="Head 3" text:level="3" >Transaction Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Prepared Statements</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Database Drivers</text:h><text:h text:style-name="Head 1" text:level="1" >Forms</text:h><text:h text:style-name="Head 2" text:level="2" >Concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Models and Views</text:h><text:h text:style-name="Head 3" text:level="3" >Form Elements in the Document Model</text:h><text:h text:style-name="Head 3" text:level="3" >Special Form Components</text:h><text:h text:style-name="Head 3" text:level="3" >Events</text:h><text:h text:style-name="Head 3" text:level="3" >Data Awareness</text:h><text:h text:style-name="Head 2" text:level="2" >Recipes</text:h><text:h text:style-name="Head 3" text:level="3" >Making it easier to work with a Form</text:h><text:h text:style-name="Head 3" text:level="3" >Controlling the Data Input</text:h><text:h text:style-name="Head 3" text:level="3" >Collecting Data automatically</text:h><text:h text:style-name="Head 3" text:level="3" >Taking Advantage of Database Server Features</text:h><text:h text:style-name="Head 3" text:level="3" >Adding new Functionality</text:h><text:h text:style-name="Head 3" text:level="3" >Handling Errors</text:h><text:h text:style-name="Head 1" text:level="1" >UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Purpose of UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Document Contents as Streams</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Content Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating, Moving and Copying Document and Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Additional Commands</text:h><text:h text:style-name="Head 2" text:level="2" >Writing a Content Provider</text:h><text:h text:style-name="Head 1" text:level="1" >[PRODUCTNAME] Configuration</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing configuration data</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Configuration Data</text:h><text:h text:style-name="Head 1" text:level="1" >Appendix</text:h></office:body> + +<office:body ><text:sequence-decls ><text:sequence-decl text:display-outline-level="0" text:name="Illustration" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Table" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Text" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Drawing" ></text:sequence-decl></text:sequence-decls><text:p text:style-name="P1" >Programmer's Manual</text:p><text:p text:style-name="P2" >Planned Outline</text:p><text:p text:style-name="P2" ></text:p><text:h text:style-name="Head 1" text:level="1" >Preface (3 Pages)</text:h><text:h text:style-name="Head 1" text:level="1" >First Steps (24 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Programming with UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Fields of Application for UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Getting Started</text:h><text:h text:style-name="Head 3" text:level="3" >Required Files</text:h><text:h text:style-name="Head 3" text:level="3" >Configuration</text:h><text:h text:style-name="Head 3" text:level="3" >First Connection</text:h><text:h text:style-name="Head 2" text:level="2" >How to get Objects in [PRODUCTNAME]</text:h><text:h text:style-name="Head 2" text:level="2" >How to work with Objects</text:h><text:p text:style-name="Paragraph" >Example</text:p><text:h text:style-name="Head 3" text:level="3" >Services</text:h><text:h text:style-name="Head 3" text:level="3" >Querying Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >ElementAccess</text:h><text:h text:style-name="Head 3" text:level="3" >Simple Types</text:h><text:h text:style-name="Head 3" text:level="3" >Strings</text:h><text:h text:style-name="Head 3" text:level="3" >Enums and Constant Groups</text:h><text:h text:style-name="Head 3" text:level="3" >Structs</text:h><text:h text:style-name="Head 3" text:level="3" >Any</text:h><text:h text:style-name="Head 3" text:level="3" >Sequence</text:h><text:h text:style-name="Head 2" text:level="2" >How to find the solution for a problem</text:h><text:h text:style-name="Head 2" text:level="2" >Finding your Way through the API Reference</text:h><text:h text:style-name="Head 2" text:level="2" >Common Mechanisms</text:h><text:h text:style-name="Head 3" text:level="3" >Text</text:h><text:h text:style-name="Head 3" text:level="3" >Table</text:h><text:h text:style-name="Head 3" text:level="3" >Drawing</text:h><text:h text:style-name="Head 1" text:level="1" >UNO in Professional Projects (<text:span text:style-name="T1" >145</text:span>)</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:p text:style-name="Paragraph" >UNO/API constituents: How UNOIDL/API, ServiceManager, Bridges, CoreReflection work together</text:p><text:h text:style-name="Head 2" text:level="2" >API Concepts</text:h><text:p text:style-name="Paragraph" >API is a language independent, abstract specification for UNO objects which are used in <text:s ></text:s>[PRODUCTNAME]</text:p><text:h text:style-name="Head 3" text:level="3" >Types in the API Reference</text:h><text:h text:style-name="Head 4" text:level="4" >Simple Types</text:h><text:h text:style-name="Head 4" text:level="4" >The Any Type</text:h><text:h text:style-name="Head 4" text:level="4" >Interfaces</text:h><text:h text:style-name="Head 4" text:level="4" >Services</text:h><text:h text:style-name="Head 4" text:level="4" >Modules</text:h><text:h text:style-name="Head 4" text:level="4" >Structs</text:h><text:h text:style-name="Head 4" text:level="4" >Constant Groups and Enums</text:h><text:h text:style-name="Head 4" text:level="4" >Sequences</text:h><text:h text:style-name="Head 4" text:level="4" >Exceptions</text:h><text:h text:style-name="Head 3" text:level="3" >API Principles</text:h><text:h text:style-name="Head 4" text:level="4" >Relationship between Specification, Implementation and Instances</text:h><text:h text:style-name="Head 4" text:level="4" >Object Composition</text:h><text:h text:style-name="Head 2" text:level="2" >UNO Concepts</text:h><text:p text:style-name="Paragraph" >UNO is an environment for networked object communication</text:p><text:h text:style-name="Head 3" text:level="3" >Interprocess Connections</text:h><text:h text:style-name="Head 3" text:level="3" >ServiceManager and ComponentContext</text:h><text:h text:style-name="Head 3" text:level="3" >Using UNO Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >Using Collections and Containers</text:h><text:h text:style-name="Head 3" text:level="3" >Event Model</text:h><text:h text:style-name="Head 3" text:level="3" >Exception Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Lifetime Control</text:h><text:h text:style-name="Head 3" text:level="3" >Object Identity</text:h><text:h text:style-name="Head 2" text:level="2" >Language Bindings</text:h><text:h text:style-name="Head 3" text:level="3" >Introduction for language binding</text:h><text:h text:style-name="Head 3" text:level="3" >Java Language Binding</text:h><text:h text:style-name="Head 3" text:level="3" >C++ Binding</text:h><text:h text:style-name="Head 3" text:level="3" >Access for [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 3" text:level="3" >Automation</text:h><text:h text:style-name="Head 1" text:level="1" >Writing UNO components</text:h><text:h text:style-name="Head 2" text:level="2" >Specifying a new Component</text:h><text:h text:style-name="Head 3" text:level="3" >UNOIDL language specification</text:h><text:h text:style-name="Head 2" text:level="2" >Implementing a Component</text:h><text:h text:style-name="Head 3" text:level="3" >Component Development Basics</text:h><text:unordered-list text:style-name="L1" ><text:list-item ><text:p text:style-name="P3" >Introduction</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >Mandatory interfaces: XInterface, XServiceInfo ((from UseInterfaces.CoreInterfaces))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >"Should be implemented" interfaces: XTypeProvider ((from UseInterfaces.CoreInterfaces ))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >optional interface: XMain for standalone execution</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Simple Component in Java</text:h><text:unordered-list text:style-name="L2" ><text:list-item ><text:p text:style-name="P4" >Getting the service manager ((Chapter Java components from unoBindingJava))</text:p></text:list-item><text:list-item ><text:p text:style-name="P4" >simple component chapter</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >C++ Component</text:h><text:h text:style-name="Head 3" text:level="3" >((Automation Component?))</text:h><text:h text:style-name="Head 2" text:level="2" >Deployment Options for Components</text:h><text:h text:style-name="Head 3" text:level="3" >Component Registration</text:h><text:h text:style-name="Head 3" text:level="3" >Service Manager Configuration</text:h><text:unordered-list text:style-name="L3" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P5" >XSet Interface</text:p><text:p text:style-name="P5" >Adding components during runtime, particularly interesting during development</text:p></text:list-item><text:list-item ><text:p text:style-name="P5" >ServiceManager Content</text:p><text:p text:style-name="P5" >Dynamically modifying the ServiceManager</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Bootstrapping the Service Manager ((from CppBind chapter))</text:h><text:unordered-list text:style-name="L4" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P6" >Simple Test Application</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >Configuring Your Application with Bootstrap Parameters</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >The UNO Executable</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Standalone Runtime Environment</text:h><text:p text:style-name="Paragraph" ><text:tab-stop ></text:tab-stop>The UNO executable and XMain</text:p><text:h text:style-name="Head 3" text:level="3" >Configuring the Java Runtime Environment</text:h><text:unordered-list text:style-name="L5" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P7" >The office and Java ((from UnoBindingJava))</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 1" text:level="1" >Advanced UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Design Patterns</text:h><text:h text:style-name="Head 2" text:level="2" >Bridging concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Requirements for Language Bindings and Bridges</text:h><text:h text:style-name="Head 3" text:level="3" >New Scripting Engines</text:h><text:h text:style-name="Head 2" text:level="2" >ServiceManager and loader</text:h><text:h text:style-name="Head 2" text:level="2" >Special Interfaces for internal use</text:h><text:p text:style-name="Paragraph" >XUNOTunnel</text:p><text:p text:style-name="Paragraph" >XAggregation</text:p><text:h text:style-name="Head 2" text:level="2" >UNO Reflection API</text:h><text:h text:style-name="Head 2" text:level="2" >TypeLibrary and TypeProviders</text:h><text:h text:style-name="Head 2" text:level="2" >Differences from Corba</text:h><text:h text:style-name="Head 1" text:level="1" >Office Development</text:h><text:h text:style-name="Head 2" text:level="2" >Global Object Structure</text:h><text:h text:style-name="Head 3" text:level="3" >Desktop Environment</text:h><text:h text:style-name="Head 3" text:level="3" >Frames and Frame Hierarchies</text:h><text:h text:style-name="Head 3" text:level="3" >Frame-Controller-Model Paradigm</text:h><text:h text:style-name="Head 3" text:level="3" >Loading and Saving Office Components</text:h><text:h text:style-name="Head 3" text:level="3" >Dispatch Framework</text:h><text:h text:style-name="Head 2" text:level="2" >Common Features</text:h><text:h text:style-name="Head 3" text:level="3" >Common Dialogs</text:h><text:h text:style-name="Head 3" text:level="3" >DocumentInfo</text:h><text:h text:style-name="Head 3" text:level="3" >Styles</text:h><text:h text:style-name="Head 3" text:level="3" >Search and Replace</text:h><text:h text:style-name="Head 3" text:level="3" >Number Formats</text:h><text:h text:style-name="Head 3" text:level="3" >Package File Formats</text:h><text:h text:style-name="Head 2" text:level="2" >Internationalization</text:h><text:h text:style-name="Head 2" text:level="2" >Linguistic</text:h><text:h text:style-name="Head 2" text:level="2" >System Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Clipboard</text:h><text:h text:style-name="Head 3" text:level="3" >File Picker</text:h><text:h text:style-name="Head 3" text:level="3" >Bridging to the Window System</text:h><text:p text:style-name="Paragraph" ></text:p><text:h text:style-name="Head 1" text:level="1" >Text Documents (51,5 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Text Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Text Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Using Text</text:h><text:h text:style-name="Head 3" text:level="3" >Tables</text:h><text:h text:style-name="Head 3" text:level="3" >Text Fields</text:h><text:h text:style-name="Head 3" text:level="3" >Bookmarks</text:h><text:h text:style-name="Head 3" text:level="3" >Indexes and Index Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Reference Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Footnotes and Endnotes</text:h><text:h text:style-name="Head 3" text:level="3" >Shape Objects in Text</text:h><text:h text:style-name="Head 3" text:level="3" >Redline</text:h><text:h text:style-name="Head 3" text:level="3" >Ruby</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Text Document</text:h><text:h text:style-name="Head 1" text:level="1" >Spreadsheet Documents</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Spreadsheet Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Spreadsheet Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Editing Spreadsheets</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Spreadsheet Document</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Spreadsheet Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Drawings and Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Draw/Impress Files</text:h><text:h text:style-name="Head 3" text:level="3" >Saving</text:h><text:h text:style-name="Head 3" text:level="3" >Printing</text:h><text:h text:style-name="Head 3" text:level="3" >Running Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Working with a Draw/Impress Document</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Draw/Impress Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Draw/Impress Document</text:h><text:h text:style-name="Head 1" text:level="1" >Charts</text:h><text:h text:style-name="Head 2" text:level="2" >Chart Basics</text:h><text:h text:style-name="Head 2" text:level="2" >Creating a Chart Document</text:h><text:h text:style-name="Head 2" text:level="2" >Editing a Chart Document</text:h><text:h text:style-name="Head 3" text:level="3" >Common Diagram API</text:h><text:h text:style-name="Head 3" text:level="3" >Different Chart Types</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Chart Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Basic and Dialogs</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:h text:style-name="Head 2" text:level="2" >Library Organization</text:h><text:h text:style-name="Head 2" text:level="2" >IDE with Dialogs and Events</text:h><text:h text:style-name="Head 2" text:level="2" >Using [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 2" text:level="2" >Toolkit Controls and their Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating Dialogs at Runtime</text:h><text:h text:style-name="Head 1" text:level="1" >Database Access</text:h><text:h text:style-name="Head 2" text:level="2" >Features of the [PRODUCTNAME] Database Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Capabilities</text:h><text:h text:style-name="Head 3" text:level="3" >SDBC, SDBCX, SDB Architecture</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Datasources with [PRODUCTNAME]</text:h><text:h text:style-name="Head 3" text:level="3" >DataSources</text:h><text:h text:style-name="Head 3" text:level="3" >Adding and Editing Datasources </text:h><text:h text:style-name="Head 3" text:level="3" >Establishing a Connection</text:h><text:h text:style-name="Head 4" text:level="4" >Getting Connections</text:h><text:h text:style-name="Head 4" text:level="4" >Driver specifics</text:h><text:h text:style-name="Head 3" text:level="3" >Connection Pooling</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Saved Queries</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Data</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Statements</text:h><text:h text:style-name="Head 3" text:level="3" >Resultsets</text:h><text:h text:style-name="Head 3" text:level="3" >Metadata</text:h><text:h text:style-name="Head 3" text:level="3" >Rowsets</text:h><text:h text:style-name="Head 2" text:level="2" >Working with the Database Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using DDL to change the DB Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using SDBCX to access the DB Design</text:h><text:h text:style-name="Head 2" text:level="2" >Using DBMS Features</text:h><text:h text:style-name="Head 3" text:level="3" >Stored Procedures</text:h><text:h text:style-name="Head 3" text:level="3" >Transaction Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Prepared Statements</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Database Drivers</text:h><text:h text:style-name="Head 1" text:level="1" >Forms</text:h><text:h text:style-name="Head 2" text:level="2" >Concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Models and Views</text:h><text:h text:style-name="Head 3" text:level="3" >Form Elements in the Document Model</text:h><text:h text:style-name="Head 3" text:level="3" >Special Form Components</text:h><text:h text:style-name="Head 3" text:level="3" >Events</text:h><text:h text:style-name="Head 3" text:level="3" >Data Awareness</text:h><text:h text:style-name="Head 2" text:level="2" >Recipes</text:h><text:h text:style-name="Head 3" text:level="3" >Making it easier to work with a Form</text:h><text:h text:style-name="Head 3" text:level="3" >Controlling the Data Input</text:h><text:h text:style-name="Head 3" text:level="3" >Collecting Data automatically</text:h><text:h text:style-name="Head 3" text:level="3" >Taking Advantage of Database Server Features</text:h><text:h text:style-name="Head 3" text:level="3" >Adding new Functionality</text:h><text:h text:style-name="Head 3" text:level="3" >Handling Errors</text:h><text:h text:style-name="Head 1" text:level="1" >UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Purpose of UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Document Contents as Streams</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Content Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating, Moving and Copying Document and Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Additional Commands</text:h><text:h text:style-name="Head 2" text:level="2" >Writing a Content Provider</text:h><text:h text:style-name="Head 1" text:level="1" >[PRODUCTNAME] Configuration</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing configuration data</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Configuration Data</text:h><text:h text:style-name="Head 1" text:level="1" >Appendix</text:h></office:body> + +<office:body ><text:sequence-decls ><text:sequence-decl text:display-outline-level="0" text:name="Illustration" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Table" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Text" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Drawing" ></text:sequence-decl></text:sequence-decls><text:p text:style-name="P1" >Programmer's Manual</text:p><text:p text:style-name="P2" >Planned Outline</text:p><text:p text:style-name="P2" ></text:p><text:h text:style-name="Head 1" text:level="1" >Preface (3 Pages)</text:h><text:h text:style-name="Head 1" text:level="1" >First Steps (24 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Programming with UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Fields of Application for UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Getting Started</text:h><text:h text:style-name="Head 3" text:level="3" >Required Files</text:h><text:h text:style-name="Head 3" text:level="3" >Configuration</text:h><text:h text:style-name="Head 3" text:level="3" >First Connection</text:h><text:h text:style-name="Head 2" text:level="2" >How to get Objects in [PRODUCTNAME]</text:h><text:h text:style-name="Head 2" text:level="2" >How to work with Objects</text:h><text:p text:style-name="Paragraph" >Example</text:p><text:h text:style-name="Head 3" text:level="3" >Services</text:h><text:h text:style-name="Head 3" text:level="3" >Querying Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >ElementAccess</text:h><text:h text:style-name="Head 3" text:level="3" >Simple Types</text:h><text:h text:style-name="Head 3" text:level="3" >Strings</text:h><text:h text:style-name="Head 3" text:level="3" >Enums and Constant Groups</text:h><text:h text:style-name="Head 3" text:level="3" >Structs</text:h><text:h text:style-name="Head 3" text:level="3" >Any</text:h><text:h text:style-name="Head 3" text:level="3" >Sequence</text:h><text:h text:style-name="Head 2" text:level="2" >How to find the solution for a problem</text:h><text:h text:style-name="Head 2" text:level="2" >Finding your Way through the API Reference</text:h><text:h text:style-name="Head 2" text:level="2" >Common Mechanisms</text:h><text:h text:style-name="Head 3" text:level="3" >Text</text:h><text:h text:style-name="Head 3" text:level="3" >Table</text:h><text:h text:style-name="Head 3" text:level="3" >Drawing</text:h><text:h text:style-name="Head 1" text:level="1" >UNO in Professional Projects (<text:span text:style-name="T1" >145</text:span>)</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:p text:style-name="Paragraph" >UNO/API constituents: How UNOIDL/API, ServiceManager, Bridges, CoreReflection work together</text:p><text:h text:style-name="Head 2" text:level="2" >API Concepts</text:h><text:p text:style-name="Paragraph" >API is a language independent, abstract specification for UNO objects which are used in <text:s ></text:s>[PRODUCTNAME]</text:p><text:h text:style-name="Head 3" text:level="3" >Types in the API Reference</text:h><text:h text:style-name="Head 4" text:level="4" >Simple Types</text:h><text:h text:style-name="Head 4" text:level="4" >The Any Type</text:h><text:h text:style-name="Head 4" text:level="4" >Interfaces</text:h><text:h text:style-name="Head 4" text:level="4" >Services</text:h><text:h text:style-name="Head 4" text:level="4" >Modules</text:h><text:h text:style-name="Head 4" text:level="4" >Structs</text:h><text:h text:style-name="Head 4" text:level="4" >Constant Groups and Enums</text:h><text:h text:style-name="Head 4" text:level="4" >Sequences</text:h><text:h text:style-name="Head 4" text:level="4" >Exceptions</text:h><text:h text:style-name="Head 3" text:level="3" >API Principles</text:h><text:h text:style-name="Head 4" text:level="4" >Relationship between Specification, Implementation and Instances</text:h><text:h text:style-name="Head 4" text:level="4" >Object Composition</text:h><text:h text:style-name="Head 2" text:level="2" >UNO Concepts</text:h><text:p text:style-name="Paragraph" >UNO is an environment for networked object communication</text:p><text:h text:style-name="Head 3" text:level="3" >Interprocess Connections</text:h><text:h text:style-name="Head 3" text:level="3" >ServiceManager and ComponentContext</text:h><text:h text:style-name="Head 3" text:level="3" >Using UNO Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >Using Collections and Containers</text:h><text:h text:style-name="Head 3" text:level="3" >Event Model</text:h><text:h text:style-name="Head 3" text:level="3" >Exception Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Lifetime Control</text:h><text:h text:style-name="Head 3" text:level="3" >Object Identity</text:h><text:h text:style-name="Head 2" text:level="2" >Language Bindings</text:h><text:h text:style-name="Head 3" text:level="3" >Introduction for language binding</text:h><text:h text:style-name="Head 3" text:level="3" >Java Language Binding</text:h><text:h text:style-name="Head 3" text:level="3" >C++ Binding</text:h><text:h text:style-name="Head 3" text:level="3" >Access for [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 3" text:level="3" >Automation</text:h><text:h text:style-name="Head 1" text:level="1" >Writing UNO components</text:h><text:h text:style-name="Head 2" text:level="2" >Specifying a new Component</text:h><text:h text:style-name="Head 3" text:level="3" >UNOIDL language specification</text:h><text:h text:style-name="Head 2" text:level="2" >Implementing a Component</text:h><text:h text:style-name="Head 3" text:level="3" >Component Development Basics</text:h><text:unordered-list text:style-name="L1" ><text:list-item ><text:p text:style-name="P3" >Introduction</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >Mandatory interfaces: XInterface, XServiceInfo ((from UseInterfaces.CoreInterfaces))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >"Should be implemented" interfaces: XTypeProvider ((from UseInterfaces.CoreInterfaces ))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >optional interface: XMain for standalone execution</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Simple Component in Java</text:h><text:unordered-list text:style-name="L2" ><text:list-item ><text:p text:style-name="P4" >Getting the service manager ((Chapter Java components from unoBindingJava))</text:p></text:list-item><text:list-item ><text:p text:style-name="P4" >simple component chapter</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >C++ Component</text:h><text:h text:style-name="Head 3" text:level="3" >((Automation Component?))</text:h><text:h text:style-name="Head 2" text:level="2" >Deployment Options for Components</text:h><text:h text:style-name="Head 3" text:level="3" >Component Registration</text:h><text:h text:style-name="Head 3" text:level="3" >Service Manager Configuration</text:h><text:unordered-list text:style-name="L3" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P5" >XSet Interface</text:p><text:p text:style-name="P5" >Adding components during runtime, particularly interesting during development</text:p></text:list-item><text:list-item ><text:p text:style-name="P5" >ServiceManager Content</text:p><text:p text:style-name="P5" >Dynamically modifying the ServiceManager</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Bootstrapping the Service Manager ((from CppBind chapter))</text:h><text:unordered-list text:style-name="L4" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P6" >Simple Test Application</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >Configuring Your Application with Bootstrap Parameters</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >The UNO Executable</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Standalone Runtime Environment</text:h><text:p text:style-name="Paragraph" ><text:tab-stop ></text:tab-stop>The UNO executable and XMain</text:p><text:h text:style-name="Head 3" text:level="3" >Configuring the Java Runtime Environment</text:h><text:unordered-list text:style-name="L5" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P7" >The office and Java ((from UnoBindingJava))</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 1" text:level="1" >Advanced UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Design Patterns</text:h><text:h text:style-name="Head 2" text:level="2" >Bridging concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Requirements for Language Bindings and Bridges</text:h><text:h text:style-name="Head 3" text:level="3" >New Scripting Engines</text:h><text:h text:style-name="Head 2" text:level="2" >ServiceManager and loader</text:h><text:h text:style-name="Head 2" text:level="2" >Special Interfaces for internal use</text:h><text:p text:style-name="Paragraph" >XUNOTunnel</text:p><text:p text:style-name="Paragraph" >XAggregation</text:p><text:h text:style-name="Head 2" text:level="2" >UNO Reflection API</text:h><text:h text:style-name="Head 2" text:level="2" >TypeLibrary and TypeProviders</text:h><text:h text:style-name="Head 2" text:level="2" >Differences from Corba</text:h><text:h text:style-name="Head 1" text:level="1" >Office Development</text:h><text:h text:style-name="Head 2" text:level="2" >Global Object Structure</text:h><text:h text:style-name="Head 3" text:level="3" >Desktop Environment</text:h><text:h text:style-name="Head 3" text:level="3" >Frames and Frame Hierarchies</text:h><text:h text:style-name="Head 3" text:level="3" >Frame-Controller-Model Paradigm</text:h><text:h text:style-name="Head 3" text:level="3" >Loading and Saving Office Components</text:h><text:h text:style-name="Head 3" text:level="3" >Dispatch Framework</text:h><text:h text:style-name="Head 2" text:level="2" >Common Features</text:h><text:h text:style-name="Head 3" text:level="3" >Common Dialogs</text:h><text:h text:style-name="Head 3" text:level="3" >DocumentInfo</text:h><text:h text:style-name="Head 3" text:level="3" >Styles</text:h><text:h text:style-name="Head 3" text:level="3" >Search and Replace</text:h><text:h text:style-name="Head 3" text:level="3" >Number Formats</text:h><text:h text:style-name="Head 3" text:level="3" >Package File Formats</text:h><text:h text:style-name="Head 2" text:level="2" >Internationalization</text:h><text:h text:style-name="Head 2" text:level="2" >Linguistic</text:h><text:h text:style-name="Head 2" text:level="2" >System Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Clipboard</text:h><text:h text:style-name="Head 3" text:level="3" >File Picker</text:h><text:h text:style-name="Head 3" text:level="3" >Bridging to the Window System</text:h><text:p text:style-name="Paragraph" ></text:p><text:h text:style-name="Head 1" text:level="1" >Text Documents (51,5 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Text Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Text Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Using Text</text:h><text:h text:style-name="Head 3" text:level="3" >Tables</text:h><text:h text:style-name="Head 3" text:level="3" >Text Fields</text:h><text:h text:style-name="Head 3" text:level="3" >Bookmarks</text:h><text:h text:style-name="Head 3" text:level="3" >Indexes and Index Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Reference Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Footnotes and Endnotes</text:h><text:h text:style-name="Head 3" text:level="3" >Shape Objects in Text</text:h><text:h text:style-name="Head 3" text:level="3" >Redline</text:h><text:h text:style-name="Head 3" text:level="3" >Ruby</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Text Document</text:h><text:h text:style-name="Head 1" text:level="1" >Spreadsheet Documents</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Spreadsheet Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Spreadsheet Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Editing Spreadsheets</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Spreadsheet Document</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Spreadsheet Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Drawings and Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Draw/Impress Files</text:h><text:h text:style-name="Head 3" text:level="3" >Saving</text:h><text:h text:style-name="Head 3" text:level="3" >Printing</text:h><text:h text:style-name="Head 3" text:level="3" >Running Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Working with a Draw/Impress Document</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Draw/Impress Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Draw/Impress Document</text:h><text:h text:style-name="Head 1" text:level="1" >Charts</text:h><text:h text:style-name="Head 2" text:level="2" >Chart Basics</text:h><text:h text:style-name="Head 2" text:level="2" >Creating a Chart Document</text:h><text:h text:style-name="Head 2" text:level="2" >Editing a Chart Document</text:h><text:h text:style-name="Head 3" text:level="3" >Common Diagram API</text:h><text:h text:style-name="Head 3" text:level="3" >Different Chart Types</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Chart Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Basic and Dialogs</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:h text:style-name="Head 2" text:level="2" >Library Organization</text:h><text:h text:style-name="Head 2" text:level="2" >IDE with Dialogs and Events</text:h><text:h text:style-name="Head 2" text:level="2" >Using [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 2" text:level="2" >Toolkit Controls and their Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating Dialogs at Runtime</text:h><text:h text:style-name="Head 1" text:level="1" >Database Access</text:h><text:h text:style-name="Head 2" text:level="2" >Features of the [PRODUCTNAME] Database Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Capabilities</text:h><text:h text:style-name="Head 3" text:level="3" >SDBC, SDBCX, SDB Architecture</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Datasources with [PRODUCTNAME]</text:h><text:h text:style-name="Head 3" text:level="3" >DataSources</text:h><text:h text:style-name="Head 3" text:level="3" >Adding and Editing Datasources </text:h><text:h text:style-name="Head 3" text:level="3" >Establishing a Connection</text:h><text:h text:style-name="Head 4" text:level="4" >Getting Connections</text:h><text:h text:style-name="Head 4" text:level="4" >Driver specifics</text:h><text:h text:style-name="Head 3" text:level="3" >Connection Pooling</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Saved Queries</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Data</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Statements</text:h><text:h text:style-name="Head 3" text:level="3" >Resultsets</text:h><text:h text:style-name="Head 3" text:level="3" >Metadata</text:h><text:h text:style-name="Head 3" text:level="3" >Rowsets</text:h><text:h text:style-name="Head 2" text:level="2" >Working with the Database Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using DDL to change the DB Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using SDBCX to access the DB Design</text:h><text:h text:style-name="Head 2" text:level="2" >Using DBMS Features</text:h><text:h text:style-name="Head 3" text:level="3" >Stored Procedures</text:h><text:h text:style-name="Head 3" text:level="3" >Transaction Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Prepared Statements</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Database Drivers</text:h><text:h text:style-name="Head 1" text:level="1" >Forms</text:h><text:h text:style-name="Head 2" text:level="2" >Concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Models and Views</text:h><text:h text:style-name="Head 3" text:level="3" >Form Elements in the Document Model</text:h><text:h text:style-name="Head 3" text:level="3" >Special Form Components</text:h><text:h text:style-name="Head 3" text:level="3" >Events</text:h><text:h text:style-name="Head 3" text:level="3" >Data Awareness</text:h><text:h text:style-name="Head 2" text:level="2" >Recipes</text:h><text:h text:style-name="Head 3" text:level="3" >Making it easier to work with a Form</text:h><text:h text:style-name="Head 3" text:level="3" >Controlling the Data Input</text:h><text:h text:style-name="Head 3" text:level="3" >Collecting Data automatically</text:h><text:h text:style-name="Head 3" text:level="3" >Taking Advantage of Database Server Features</text:h><text:h text:style-name="Head 3" text:level="3" >Adding new Functionality</text:h><text:h text:style-name="Head 3" text:level="3" >Handling Errors</text:h><text:h text:style-name="Head 1" text:level="1" >UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Purpose of UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Document Contents as Streams</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Content Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating, Moving and Copying Document and Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Additional Commands</text:h><text:h text:style-name="Head 2" text:level="2" >Writing a Content Provider</text:h><text:h text:style-name="Head 1" text:level="1" >[PRODUCTNAME] Configuration</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing configuration data</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Configuration Data</text:h><text:h text:style-name="Head 1" text:level="1" >Appendix</text:h></office:body> + +<office:body ><text:sequence-decls ><text:sequence-decl text:display-outline-level="0" text:name="Illustration" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Table" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Text" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Drawing" ></text:sequence-decl></text:sequence-decls><text:p text:style-name="P1" >Programmer's Manual</text:p><text:p text:style-name="P2" >Planned Outline</text:p><text:p text:style-name="P2" ></text:p><text:h text:style-name="Head 1" text:level="1" >Preface (3 Pages)</text:h><text:h text:style-name="Head 1" text:level="1" >First Steps (24 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Programming with UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Fields of Application for UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Getting Started</text:h><text:h text:style-name="Head 3" text:level="3" >Required Files</text:h><text:h text:style-name="Head 3" text:level="3" >Configuration</text:h><text:h text:style-name="Head 3" text:level="3" >First Connection</text:h><text:h text:style-name="Head 2" text:level="2" >How to get Objects in [PRODUCTNAME]</text:h><text:h text:style-name="Head 2" text:level="2" >How to work with Objects</text:h><text:p text:style-name="Paragraph" >Example</text:p><text:h text:style-name="Head 3" text:level="3" >Services</text:h><text:h text:style-name="Head 3" text:level="3" >Querying Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >ElementAccess</text:h><text:h text:style-name="Head 3" text:level="3" >Simple Types</text:h><text:h text:style-name="Head 3" text:level="3" >Strings</text:h><text:h text:style-name="Head 3" text:level="3" >Enums and Constant Groups</text:h><text:h text:style-name="Head 3" text:level="3" >Structs</text:h><text:h text:style-name="Head 3" text:level="3" >Any</text:h><text:h text:style-name="Head 3" text:level="3" >Sequence</text:h><text:h text:style-name="Head 2" text:level="2" >How to find the solution for a problem</text:h><text:h text:style-name="Head 2" text:level="2" >Finding your Way through the API Reference</text:h><text:h text:style-name="Head 2" text:level="2" >Common Mechanisms</text:h><text:h text:style-name="Head 3" text:level="3" >Text</text:h><text:h text:style-name="Head 3" text:level="3" >Table</text:h><text:h text:style-name="Head 3" text:level="3" >Drawing</text:h><text:h text:style-name="Head 1" text:level="1" >UNO in Professional Projects (<text:span text:style-name="T1" >145</text:span>)</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:p text:style-name="Paragraph" >UNO/API constituents: How UNOIDL/API, ServiceManager, Bridges, CoreReflection work together</text:p><text:h text:style-name="Head 2" text:level="2" >API Concepts</text:h><text:p text:style-name="Paragraph" >API is a language independent, abstract specification for UNO objects which are used in <text:s ></text:s>[PRODUCTNAME]</text:p><text:h text:style-name="Head 3" text:level="3" >Types in the API Reference</text:h><text:h text:style-name="Head 4" text:level="4" >Simple Types</text:h><text:h text:style-name="Head 4" text:level="4" >The Any Type</text:h><text:h text:style-name="Head 4" text:level="4" >Interfaces</text:h><text:h text:style-name="Head 4" text:level="4" >Services</text:h><text:h text:style-name="Head 4" text:level="4" >Modules</text:h><text:h text:style-name="Head 4" text:level="4" >Structs</text:h><text:h text:style-name="Head 4" text:level="4" >Constant Groups and Enums</text:h><text:h text:style-name="Head 4" text:level="4" >Sequences</text:h><text:h text:style-name="Head 4" text:level="4" >Exceptions</text:h><text:h text:style-name="Head 3" text:level="3" >API Principles</text:h><text:h text:style-name="Head 4" text:level="4" >Relationship between Specification, Implementation and Instances</text:h><text:h text:style-name="Head 4" text:level="4" >Object Composition</text:h><text:h text:style-name="Head 2" text:level="2" >UNO Concepts</text:h><text:p text:style-name="Paragraph" >UNO is an environment for networked object communication</text:p><text:h text:style-name="Head 3" text:level="3" >Interprocess Connections</text:h><text:h text:style-name="Head 3" text:level="3" >ServiceManager and ComponentContext</text:h><text:h text:style-name="Head 3" text:level="3" >Using UNO Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >Using Collections and Containers</text:h><text:h text:style-name="Head 3" text:level="3" >Event Model</text:h><text:h text:style-name="Head 3" text:level="3" >Exception Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Lifetime Control</text:h><text:h text:style-name="Head 3" text:level="3" >Object Identity</text:h><text:h text:style-name="Head 2" text:level="2" >Language Bindings</text:h><text:h text:style-name="Head 3" text:level="3" >Introduction for language binding</text:h><text:h text:style-name="Head 3" text:level="3" >Java Language Binding</text:h><text:h text:style-name="Head 3" text:level="3" >C++ Binding</text:h><text:h text:style-name="Head 3" text:level="3" >Access for [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 3" text:level="3" >Automation</text:h><text:h text:style-name="Head 1" text:level="1" >Writing UNO components</text:h><text:h text:style-name="Head 2" text:level="2" >Specifying a new Component</text:h><text:h text:style-name="Head 3" text:level="3" >UNOIDL language specification</text:h><text:h text:style-name="Head 2" text:level="2" >Implementing a Component</text:h><text:h text:style-name="Head 3" text:level="3" >Component Development Basics</text:h><text:unordered-list text:style-name="L1" ><text:list-item ><text:p text:style-name="P3" >Introduction</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >Mandatory interfaces: XInterface, XServiceInfo ((from UseInterfaces.CoreInterfaces))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >"Should be implemented" interfaces: XTypeProvider ((from UseInterfaces.CoreInterfaces ))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >optional interface: XMain for standalone execution</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Simple Component in Java</text:h><text:unordered-list text:style-name="L2" ><text:list-item ><text:p text:style-name="P4" >Getting the service manager ((Chapter Java components from unoBindingJava))</text:p></text:list-item><text:list-item ><text:p text:style-name="P4" >simple component chapter</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >C++ Component</text:h><text:h text:style-name="Head 3" text:level="3" >((Automation Component?))</text:h><text:h text:style-name="Head 2" text:level="2" >Deployment Options for Components</text:h><text:h text:style-name="Head 3" text:level="3" >Component Registration</text:h><text:h text:style-name="Head 3" text:level="3" >Service Manager Configuration</text:h><text:unordered-list text:style-name="L3" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P5" >XSet Interface</text:p><text:p text:style-name="P5" >Adding components during runtime, particularly interesting during development</text:p></text:list-item><text:list-item ><text:p text:style-name="P5" >ServiceManager Content</text:p><text:p text:style-name="P5" >Dynamically modifying the ServiceManager</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Bootstrapping the Service Manager ((from CppBind chapter))</text:h><text:unordered-list text:style-name="L4" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P6" >Simple Test Application</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >Configuring Your Application with Bootstrap Parameters</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >The UNO Executable</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Standalone Runtime Environment</text:h><text:p text:style-name="Paragraph" ><text:tab-stop ></text:tab-stop>The UNO executable and XMain</text:p><text:h text:style-name="Head 3" text:level="3" >Configuring the Java Runtime Environment</text:h><text:unordered-list text:style-name="L5" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P7" >The office and Java ((from UnoBindingJava))</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 1" text:level="1" >Advanced UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Design Patterns</text:h><text:h text:style-name="Head 2" text:level="2" >Bridging concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Requirements for Language Bindings and Bridges</text:h><text:h text:style-name="Head 3" text:level="3" >New Scripting Engines</text:h><text:h text:style-name="Head 2" text:level="2" >ServiceManager and loader</text:h><text:h text:style-name="Head 2" text:level="2" >Special Interfaces for internal use</text:h><text:p text:style-name="Paragraph" >XUNOTunnel</text:p><text:p text:style-name="Paragraph" >XAggregation</text:p><text:h text:style-name="Head 2" text:level="2" >UNO Reflection API</text:h><text:h text:style-name="Head 2" text:level="2" >TypeLibrary and TypeProviders</text:h><text:h text:style-name="Head 2" text:level="2" >Differences from Corba</text:h><text:h text:style-name="Head 1" text:level="1" >Office Development</text:h><text:h text:style-name="Head 2" text:level="2" >Global Object Structure</text:h><text:h text:style-name="Head 3" text:level="3" >Desktop Environment</text:h><text:h text:style-name="Head 3" text:level="3" >Frames and Frame Hierarchies</text:h><text:h text:style-name="Head 3" text:level="3" >Frame-Controller-Model Paradigm</text:h><text:h text:style-name="Head 3" text:level="3" >Loading and Saving Office Components</text:h><text:h text:style-name="Head 3" text:level="3" >Dispatch Framework</text:h><text:h text:style-name="Head 2" text:level="2" >Common Features</text:h><text:h text:style-name="Head 3" text:level="3" >Common Dialogs</text:h><text:h text:style-name="Head 3" text:level="3" >DocumentInfo</text:h><text:h text:style-name="Head 3" text:level="3" >Styles</text:h><text:h text:style-name="Head 3" text:level="3" >Search and Replace</text:h><text:h text:style-name="Head 3" text:level="3" >Number Formats</text:h><text:h text:style-name="Head 3" text:level="3" >Package File Formats</text:h><text:h text:style-name="Head 2" text:level="2" >Internationalization</text:h><text:h text:style-name="Head 2" text:level="2" >Linguistic</text:h><text:h text:style-name="Head 2" text:level="2" >System Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Clipboard</text:h><text:h text:style-name="Head 3" text:level="3" >File Picker</text:h><text:h text:style-name="Head 3" text:level="3" >Bridging to the Window System</text:h><text:p text:style-name="Paragraph" ></text:p><text:h text:style-name="Head 1" text:level="1" >Text Documents (51,5 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Text Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Text Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Using Text</text:h><text:h text:style-name="Head 3" text:level="3" >Tables</text:h><text:h text:style-name="Head 3" text:level="3" >Text Fields</text:h><text:h text:style-name="Head 3" text:level="3" >Bookmarks</text:h><text:h text:style-name="Head 3" text:level="3" >Indexes and Index Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Reference Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Footnotes and Endnotes</text:h><text:h text:style-name="Head 3" text:level="3" >Shape Objects in Text</text:h><text:h text:style-name="Head 3" text:level="3" >Redline</text:h><text:h text:style-name="Head 3" text:level="3" >Ruby</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Text Document</text:h><text:h text:style-name="Head 1" text:level="1" >Spreadsheet Documents</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Spreadsheet Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Spreadsheet Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Editing Spreadsheets</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Spreadsheet Document</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Spreadsheet Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Drawings and Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Draw/Impress Files</text:h><text:h text:style-name="Head 3" text:level="3" >Saving</text:h><text:h text:style-name="Head 3" text:level="3" >Printing</text:h><text:h text:style-name="Head 3" text:level="3" >Running Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Working with a Draw/Impress Document</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Draw/Impress Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Draw/Impress Document</text:h><text:h text:style-name="Head 1" text:level="1" >Charts</text:h><text:h text:style-name="Head 2" text:level="2" >Chart Basics</text:h><text:h text:style-name="Head 2" text:level="2" >Creating a Chart Document</text:h><text:h text:style-name="Head 2" text:level="2" >Editing a Chart Document</text:h><text:h text:style-name="Head 3" text:level="3" >Common Diagram API</text:h><text:h text:style-name="Head 3" text:level="3" >Different Chart Types</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Chart Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Basic and Dialogs</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:h text:style-name="Head 2" text:level="2" >Library Organization</text:h><text:h text:style-name="Head 2" text:level="2" >IDE with Dialogs and Events</text:h><text:h text:style-name="Head 2" text:level="2" >Using [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 2" text:level="2" >Toolkit Controls and their Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating Dialogs at Runtime</text:h><text:h text:style-name="Head 1" text:level="1" >Database Access</text:h><text:h text:style-name="Head 2" text:level="2" >Features of the [PRODUCTNAME] Database Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Capabilities</text:h><text:h text:style-name="Head 3" text:level="3" >SDBC, SDBCX, SDB Architecture</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Datasources with [PRODUCTNAME]</text:h><text:h text:style-name="Head 3" text:level="3" >DataSources</text:h><text:h text:style-name="Head 3" text:level="3" >Adding and Editing Datasources </text:h><text:h text:style-name="Head 3" text:level="3" >Establishing a Connection</text:h><text:h text:style-name="Head 4" text:level="4" >Getting Connections</text:h><text:h text:style-name="Head 4" text:level="4" >Driver specifics</text:h><text:h text:style-name="Head 3" text:level="3" >Connection Pooling</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Saved Queries</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Data</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Statements</text:h><text:h text:style-name="Head 3" text:level="3" >Resultsets</text:h><text:h text:style-name="Head 3" text:level="3" >Metadata</text:h><text:h text:style-name="Head 3" text:level="3" >Rowsets</text:h><text:h text:style-name="Head 2" text:level="2" >Working with the Database Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using DDL to change the DB Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using SDBCX to access the DB Design</text:h><text:h text:style-name="Head 2" text:level="2" >Using DBMS Features</text:h><text:h text:style-name="Head 3" text:level="3" >Stored Procedures</text:h><text:h text:style-name="Head 3" text:level="3" >Transaction Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Prepared Statements</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Database Drivers</text:h><text:h text:style-name="Head 1" text:level="1" >Forms</text:h><text:h text:style-name="Head 2" text:level="2" >Concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Models and Views</text:h><text:h text:style-name="Head 3" text:level="3" >Form Elements in the Document Model</text:h><text:h text:style-name="Head 3" text:level="3" >Special Form Components</text:h><text:h text:style-name="Head 3" text:level="3" >Events</text:h><text:h text:style-name="Head 3" text:level="3" >Data Awareness</text:h><text:h text:style-name="Head 2" text:level="2" >Recipes</text:h><text:h text:style-name="Head 3" text:level="3" >Making it easier to work with a Form</text:h><text:h text:style-name="Head 3" text:level="3" >Controlling the Data Input</text:h><text:h text:style-name="Head 3" text:level="3" >Collecting Data automatically</text:h><text:h text:style-name="Head 3" text:level="3" >Taking Advantage of Database Server Features</text:h><text:h text:style-name="Head 3" text:level="3" >Adding new Functionality</text:h><text:h text:style-name="Head 3" text:level="3" >Handling Errors</text:h><text:h text:style-name="Head 1" text:level="1" >UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Purpose of UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Document Contents as Streams</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Content Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating, Moving and Copying Document and Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Additional Commands</text:h><text:h text:style-name="Head 2" text:level="2" >Writing a Content Provider</text:h><text:h text:style-name="Head 1" text:level="1" >[PRODUCTNAME] Configuration</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing configuration data</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Configuration Data</text:h><text:h text:style-name="Head 1" text:level="1" >Appendix</text:h></office:body> + +<office:body ><text:sequence-decls ><text:sequence-decl text:display-outline-level="0" text:name="Illustration" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Table" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Text" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Drawing" ></text:sequence-decl></text:sequence-decls><text:p text:style-name="P1" >Programmer's Manual</text:p><text:p text:style-name="P2" >Planned Outline</text:p><text:p text:style-name="P2" ></text:p><text:h text:style-name="Head 1" text:level="1" >Preface (3 Pages)</text:h><text:h text:style-name="Head 1" text:level="1" >First Steps (24 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Programming with UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Fields of Application for UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Getting Started</text:h><text:h text:style-name="Head 3" text:level="3" >Required Files</text:h><text:h text:style-name="Head 3" text:level="3" >Configuration</text:h><text:h text:style-name="Head 3" text:level="3" >First Connection</text:h><text:h text:style-name="Head 2" text:level="2" >How to get Objects in [PRODUCTNAME]</text:h><text:h text:style-name="Head 2" text:level="2" >How to work with Objects</text:h><text:p text:style-name="Paragraph" >Example</text:p><text:h text:style-name="Head 3" text:level="3" >Services</text:h><text:h text:style-name="Head 3" text:level="3" >Querying Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >ElementAccess</text:h><text:h text:style-name="Head 3" text:level="3" >Simple Types</text:h><text:h text:style-name="Head 3" text:level="3" >Strings</text:h><text:h text:style-name="Head 3" text:level="3" >Enums and Constant Groups</text:h><text:h text:style-name="Head 3" text:level="3" >Structs</text:h><text:h text:style-name="Head 3" text:level="3" >Any</text:h><text:h text:style-name="Head 3" text:level="3" >Sequence</text:h><text:h text:style-name="Head 2" text:level="2" >How to find the solution for a problem</text:h><text:h text:style-name="Head 2" text:level="2" >Finding your Way through the API Reference</text:h><text:h text:style-name="Head 2" text:level="2" >Common Mechanisms</text:h><text:h text:style-name="Head 3" text:level="3" >Text</text:h><text:h text:style-name="Head 3" text:level="3" >Table</text:h><text:h text:style-name="Head 3" text:level="3" >Drawing</text:h><text:h text:style-name="Head 1" text:level="1" >UNO in Professional Projects (<text:span text:style-name="T1" >145</text:span>)</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:p text:style-name="Paragraph" >UNO/API constituents: How UNOIDL/API, ServiceManager, Bridges, CoreReflection work together</text:p><text:h text:style-name="Head 2" text:level="2" >API Concepts</text:h><text:p text:style-name="Paragraph" >API is a language independent, abstract specification for UNO objects which are used in <text:s ></text:s>[PRODUCTNAME]</text:p><text:h text:style-name="Head 3" text:level="3" >Types in the API Reference</text:h><text:h text:style-name="Head 4" text:level="4" >Simple Types</text:h><text:h text:style-name="Head 4" text:level="4" >The Any Type</text:h><text:h text:style-name="Head 4" text:level="4" >Interfaces</text:h><text:h text:style-name="Head 4" text:level="4" >Services</text:h><text:h text:style-name="Head 4" text:level="4" >Modules</text:h><text:h text:style-name="Head 4" text:level="4" >Structs</text:h><text:h text:style-name="Head 4" text:level="4" >Constant Groups and Enums</text:h><text:h text:style-name="Head 4" text:level="4" >Sequences</text:h><text:h text:style-name="Head 4" text:level="4" >Exceptions</text:h><text:h text:style-name="Head 3" text:level="3" >API Principles</text:h><text:h text:style-name="Head 4" text:level="4" >Relationship between Specification, Implementation and Instances</text:h><text:h text:style-name="Head 4" text:level="4" >Object Composition</text:h><text:h text:style-name="Head 2" text:level="2" >UNO Concepts</text:h><text:p text:style-name="Paragraph" >UNO is an environment for networked object communication</text:p><text:h text:style-name="Head 3" text:level="3" >Interprocess Connections</text:h><text:h text:style-name="Head 3" text:level="3" >ServiceManager and ComponentContext</text:h><text:h text:style-name="Head 3" text:level="3" >Using UNO Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >Using Collections and Containers</text:h><text:h text:style-name="Head 3" text:level="3" >Event Model</text:h><text:h text:style-name="Head 3" text:level="3" >Exception Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Lifetime Control</text:h><text:h text:style-name="Head 3" text:level="3" >Object Identity</text:h><text:h text:style-name="Head 2" text:level="2" >Language Bindings</text:h><text:h text:style-name="Head 3" text:level="3" >Introduction for language binding</text:h><text:h text:style-name="Head 3" text:level="3" >Java Language Binding</text:h><text:h text:style-name="Head 3" text:level="3" >C++ Binding</text:h><text:h text:style-name="Head 3" text:level="3" >Access for [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 3" text:level="3" >Automation</text:h><text:h text:style-name="Head 1" text:level="1" >Writing UNO components</text:h><text:h text:style-name="Head 2" text:level="2" >Specifying a new Component</text:h><text:h text:style-name="Head 3" text:level="3" >UNOIDL language specification</text:h><text:h text:style-name="Head 2" text:level="2" >Implementing a Component</text:h><text:h text:style-name="Head 3" text:level="3" >Component Development Basics</text:h><text:unordered-list text:style-name="L1" ><text:list-item ><text:p text:style-name="P3" >Introduction</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >Mandatory interfaces: XInterface, XServiceInfo ((from UseInterfaces.CoreInterfaces))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >"Should be implemented" interfaces: XTypeProvider ((from UseInterfaces.CoreInterfaces ))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >optional interface: XMain for standalone execution</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Simple Component in Java</text:h><text:unordered-list text:style-name="L2" ><text:list-item ><text:p text:style-name="P4" >Getting the service manager ((Chapter Java components from unoBindingJava))</text:p></text:list-item><text:list-item ><text:p text:style-name="P4" >simple component chapter</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >C++ Component</text:h><text:h text:style-name="Head 3" text:level="3" >((Automation Component?))</text:h><text:h text:style-name="Head 2" text:level="2" >Deployment Options for Components</text:h><text:h text:style-name="Head 3" text:level="3" >Component Registration</text:h><text:h text:style-name="Head 3" text:level="3" >Service Manager Configuration</text:h><text:unordered-list text:style-name="L3" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P5" >XSet Interface</text:p><text:p text:style-name="P5" >Adding components during runtime, particularly interesting during development</text:p></text:list-item><text:list-item ><text:p text:style-name="P5" >ServiceManager Content</text:p><text:p text:style-name="P5" >Dynamically modifying the ServiceManager</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Bootstrapping the Service Manager ((from CppBind chapter))</text:h><text:unordered-list text:style-name="L4" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P6" >Simple Test Application</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >Configuring Your Application with Bootstrap Parameters</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >The UNO Executable</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Standalone Runtime Environment</text:h><text:p text:style-name="Paragraph" ><text:tab-stop ></text:tab-stop>The UNO executable and XMain</text:p><text:h text:style-name="Head 3" text:level="3" >Configuring the Java Runtime Environment</text:h><text:unordered-list text:style-name="L5" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P7" >The office and Java ((from UnoBindingJava))</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 1" text:level="1" >Advanced UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Design Patterns</text:h><text:h text:style-name="Head 2" text:level="2" >Bridging concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Requirements for Language Bindings and Bridges</text:h><text:h text:style-name="Head 3" text:level="3" >New Scripting Engines</text:h><text:h text:style-name="Head 2" text:level="2" >ServiceManager and loader</text:h><text:h text:style-name="Head 2" text:level="2" >Special Interfaces for internal use</text:h><text:p text:style-name="Paragraph" >XUNOTunnel</text:p><text:p text:style-name="Paragraph" >XAggregation</text:p><text:h text:style-name="Head 2" text:level="2" >UNO Reflection API</text:h><text:h text:style-name="Head 2" text:level="2" >TypeLibrary and TypeProviders</text:h><text:h text:style-name="Head 2" text:level="2" >Differences from Corba</text:h><text:h text:style-name="Head 1" text:level="1" >Office Development</text:h><text:h text:style-name="Head 2" text:level="2" >Global Object Structure</text:h><text:h text:style-name="Head 3" text:level="3" >Desktop Environment</text:h><text:h text:style-name="Head 3" text:level="3" >Frames and Frame Hierarchies</text:h><text:h text:style-name="Head 3" text:level="3" >Frame-Controller-Model Paradigm</text:h><text:h text:style-name="Head 3" text:level="3" >Loading and Saving Office Components</text:h><text:h text:style-name="Head 3" text:level="3" >Dispatch Framework</text:h><text:h text:style-name="Head 2" text:level="2" >Common Features</text:h><text:h text:style-name="Head 3" text:level="3" >Common Dialogs</text:h><text:h text:style-name="Head 3" text:level="3" >DocumentInfo</text:h><text:h text:style-name="Head 3" text:level="3" >Styles</text:h><text:h text:style-name="Head 3" text:level="3" >Search and Replace</text:h><text:h text:style-name="Head 3" text:level="3" >Number Formats</text:h><text:h text:style-name="Head 3" text:level="3" >Package File Formats</text:h><text:h text:style-name="Head 2" text:level="2" >Internationalization</text:h><text:h text:style-name="Head 2" text:level="2" >Linguistic</text:h><text:h text:style-name="Head 2" text:level="2" >System Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Clipboard</text:h><text:h text:style-name="Head 3" text:level="3" >File Picker</text:h><text:h text:style-name="Head 3" text:level="3" >Bridging to the Window System</text:h><text:p text:style-name="Paragraph" ></text:p><text:h text:style-name="Head 1" text:level="1" >Text Documents (51,5 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Text Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Text Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Using Text</text:h><text:h text:style-name="Head 3" text:level="3" >Tables</text:h><text:h text:style-name="Head 3" text:level="3" >Text Fields</text:h><text:h text:style-name="Head 3" text:level="3" >Bookmarks</text:h><text:h text:style-name="Head 3" text:level="3" >Indexes and Index Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Reference Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Footnotes and Endnotes</text:h><text:h text:style-name="Head 3" text:level="3" >Shape Objects in Text</text:h><text:h text:style-name="Head 3" text:level="3" >Redline</text:h><text:h text:style-name="Head 3" text:level="3" >Ruby</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Text Document</text:h><text:h text:style-name="Head 1" text:level="1" >Spreadsheet Documents</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Spreadsheet Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Spreadsheet Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Editing Spreadsheets</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Spreadsheet Document</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Spreadsheet Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Drawings and Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Draw/Impress Files</text:h><text:h text:style-name="Head 3" text:level="3" >Saving</text:h><text:h text:style-name="Head 3" text:level="3" >Printing</text:h><text:h text:style-name="Head 3" text:level="3" >Running Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Working with a Draw/Impress Document</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Draw/Impress Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Draw/Impress Document</text:h><text:h text:style-name="Head 1" text:level="1" >Charts</text:h><text:h text:style-name="Head 2" text:level="2" >Chart Basics</text:h><text:h text:style-name="Head 2" text:level="2" >Creating a Chart Document</text:h><text:h text:style-name="Head 2" text:level="2" >Editing a Chart Document</text:h><text:h text:style-name="Head 3" text:level="3" >Common Diagram API</text:h><text:h text:style-name="Head 3" text:level="3" >Different Chart Types</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Chart Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Basic and Dialogs</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:h text:style-name="Head 2" text:level="2" >Library Organization</text:h><text:h text:style-name="Head 2" text:level="2" >IDE with Dialogs and Events</text:h><text:h text:style-name="Head 2" text:level="2" >Using [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 2" text:level="2" >Toolkit Controls and their Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating Dialogs at Runtime</text:h><text:h text:style-name="Head 1" text:level="1" >Database Access</text:h><text:h text:style-name="Head 2" text:level="2" >Features of the [PRODUCTNAME] Database Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Capabilities</text:h><text:h text:style-name="Head 3" text:level="3" >SDBC, SDBCX, SDB Architecture</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Datasources with [PRODUCTNAME]</text:h><text:h text:style-name="Head 3" text:level="3" >DataSources</text:h><text:h text:style-name="Head 3" text:level="3" >Adding and Editing Datasources </text:h><text:h text:style-name="Head 3" text:level="3" >Establishing a Connection</text:h><text:h text:style-name="Head 4" text:level="4" >Getting Connections</text:h><text:h text:style-name="Head 4" text:level="4" >Driver specifics</text:h><text:h text:style-name="Head 3" text:level="3" >Connection Pooling</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Saved Queries</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Data</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Statements</text:h><text:h text:style-name="Head 3" text:level="3" >Resultsets</text:h><text:h text:style-name="Head 3" text:level="3" >Metadata</text:h><text:h text:style-name="Head 3" text:level="3" >Rowsets</text:h><text:h text:style-name="Head 2" text:level="2" >Working with the Database Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using DDL to change the DB Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using SDBCX to access the DB Design</text:h><text:h text:style-name="Head 2" text:level="2" >Using DBMS Features</text:h><text:h text:style-name="Head 3" text:level="3" >Stored Procedures</text:h><text:h text:style-name="Head 3" text:level="3" >Transaction Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Prepared Statements</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Database Drivers</text:h><text:h text:style-name="Head 1" text:level="1" >Forms</text:h><text:h text:style-name="Head 2" text:level="2" >Concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Models and Views</text:h><text:h text:style-name="Head 3" text:level="3" >Form Elements in the Document Model</text:h><text:h text:style-name="Head 3" text:level="3" >Special Form Components</text:h><text:h text:style-name="Head 3" text:level="3" >Events</text:h><text:h text:style-name="Head 3" text:level="3" >Data Awareness</text:h><text:h text:style-name="Head 2" text:level="2" >Recipes</text:h><text:h text:style-name="Head 3" text:level="3" >Making it easier to work with a Form</text:h><text:h text:style-name="Head 3" text:level="3" >Controlling the Data Input</text:h><text:h text:style-name="Head 3" text:level="3" >Collecting Data automatically</text:h><text:h text:style-name="Head 3" text:level="3" >Taking Advantage of Database Server Features</text:h><text:h text:style-name="Head 3" text:level="3" >Adding new Functionality</text:h><text:h text:style-name="Head 3" text:level="3" >Handling Errors</text:h><text:h text:style-name="Head 1" text:level="1" >UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Purpose of UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Document Contents as Streams</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Content Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating, Moving and Copying Document and Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Additional Commands</text:h><text:h text:style-name="Head 2" text:level="2" >Writing a Content Provider</text:h><text:h text:style-name="Head 1" text:level="1" >[PRODUCTNAME] Configuration</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing configuration data</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Configuration Data</text:h><text:h text:style-name="Head 1" text:level="1" >Appendix</text:h></office:body> + +<office:body ><text:sequence-decls ><text:sequence-decl text:display-outline-level="0" text:name="Illustration" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Table" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Text" ></text:sequence-decl><text:sequence-decl text:display-outline-level="0" text:name="Drawing" ></text:sequence-decl></text:sequence-decls><text:p text:style-name="P1" >Programmer's Manual</text:p><text:p text:style-name="P2" >Planned Outline</text:p><text:p text:style-name="P2" ></text:p><text:h text:style-name="Head 1" text:level="1" >Preface (3 Pages)</text:h><text:h text:style-name="Head 1" text:level="1" >First Steps (24 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Programming with UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Fields of Application for UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Getting Started</text:h><text:h text:style-name="Head 3" text:level="3" >Required Files</text:h><text:h text:style-name="Head 3" text:level="3" >Configuration</text:h><text:h text:style-name="Head 3" text:level="3" >First Connection</text:h><text:h text:style-name="Head 2" text:level="2" >How to get Objects in [PRODUCTNAME]</text:h><text:h text:style-name="Head 2" text:level="2" >How to work with Objects</text:h><text:p text:style-name="Paragraph" >Example</text:p><text:h text:style-name="Head 3" text:level="3" >Services</text:h><text:h text:style-name="Head 3" text:level="3" >Querying Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >ElementAccess</text:h><text:h text:style-name="Head 3" text:level="3" >Simple Types</text:h><text:h text:style-name="Head 3" text:level="3" >Strings</text:h><text:h text:style-name="Head 3" text:level="3" >Enums and Constant Groups</text:h><text:h text:style-name="Head 3" text:level="3" >Structs</text:h><text:h text:style-name="Head 3" text:level="3" >Any</text:h><text:h text:style-name="Head 3" text:level="3" >Sequence</text:h><text:h text:style-name="Head 2" text:level="2" >How to find the solution for a problem</text:h><text:h text:style-name="Head 2" text:level="2" >Finding your Way through the API Reference</text:h><text:h text:style-name="Head 2" text:level="2" >Common Mechanisms</text:h><text:h text:style-name="Head 3" text:level="3" >Text</text:h><text:h text:style-name="Head 3" text:level="3" >Table</text:h><text:h text:style-name="Head 3" text:level="3" >Drawing</text:h><text:h text:style-name="Head 1" text:level="1" >UNO in Professional Projects (<text:span text:style-name="T1" >145</text:span>)</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:p text:style-name="Paragraph" >UNO/API constituents: How UNOIDL/API, ServiceManager, Bridges, CoreReflection work together</text:p><text:h text:style-name="Head 2" text:level="2" >API Concepts</text:h><text:p text:style-name="Paragraph" >API is a language independent, abstract specification for UNO objects which are used in <text:s ></text:s>[PRODUCTNAME]</text:p><text:h text:style-name="Head 3" text:level="3" >Types in the API Reference</text:h><text:h text:style-name="Head 4" text:level="4" >Simple Types</text:h><text:h text:style-name="Head 4" text:level="4" >The Any Type</text:h><text:h text:style-name="Head 4" text:level="4" >Interfaces</text:h><text:h text:style-name="Head 4" text:level="4" >Services</text:h><text:h text:style-name="Head 4" text:level="4" >Modules</text:h><text:h text:style-name="Head 4" text:level="4" >Structs</text:h><text:h text:style-name="Head 4" text:level="4" >Constant Groups and Enums</text:h><text:h text:style-name="Head 4" text:level="4" >Sequences</text:h><text:h text:style-name="Head 4" text:level="4" >Exceptions</text:h><text:h text:style-name="Head 3" text:level="3" >API Principles</text:h><text:h text:style-name="Head 4" text:level="4" >Relationship between Specification, Implementation and Instances</text:h><text:h text:style-name="Head 4" text:level="4" >Object Composition</text:h><text:h text:style-name="Head 2" text:level="2" >UNO Concepts</text:h><text:p text:style-name="Paragraph" >UNO is an environment for networked object communication</text:p><text:h text:style-name="Head 3" text:level="3" >Interprocess Connections</text:h><text:h text:style-name="Head 3" text:level="3" >ServiceManager and ComponentContext</text:h><text:h text:style-name="Head 3" text:level="3" >Using UNO Interfaces</text:h><text:h text:style-name="Head 3" text:level="3" >Using Properties</text:h><text:h text:style-name="Head 3" text:level="3" >Using Collections and Containers</text:h><text:h text:style-name="Head 3" text:level="3" >Event Model</text:h><text:h text:style-name="Head 3" text:level="3" >Exception Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Lifetime Control</text:h><text:h text:style-name="Head 3" text:level="3" >Object Identity</text:h><text:h text:style-name="Head 2" text:level="2" >Language Bindings</text:h><text:h text:style-name="Head 3" text:level="3" >Introduction for language binding</text:h><text:h text:style-name="Head 3" text:level="3" >Java Language Binding</text:h><text:h text:style-name="Head 3" text:level="3" >C++ Binding</text:h><text:h text:style-name="Head 3" text:level="3" >Access for [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 3" text:level="3" >Automation</text:h><text:h text:style-name="Head 1" text:level="1" >Writing UNO components</text:h><text:h text:style-name="Head 2" text:level="2" >Specifying a new Component</text:h><text:h text:style-name="Head 3" text:level="3" >UNOIDL language specification</text:h><text:h text:style-name="Head 2" text:level="2" >Implementing a Component</text:h><text:h text:style-name="Head 3" text:level="3" >Component Development Basics</text:h><text:unordered-list text:style-name="L1" ><text:list-item ><text:p text:style-name="P3" >Introduction</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >Mandatory interfaces: XInterface, XServiceInfo ((from UseInterfaces.CoreInterfaces))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >"Should be implemented" interfaces: XTypeProvider ((from UseInterfaces.CoreInterfaces ))</text:p></text:list-item><text:list-item ><text:p text:style-name="P3" >optional interface: XMain for standalone execution</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Simple Component in Java</text:h><text:unordered-list text:style-name="L2" ><text:list-item ><text:p text:style-name="P4" >Getting the service manager ((Chapter Java components from unoBindingJava))</text:p></text:list-item><text:list-item ><text:p text:style-name="P4" >simple component chapter</text:p></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >C++ Component</text:h><text:h text:style-name="Head 3" text:level="3" >((Automation Component?))</text:h><text:h text:style-name="Head 2" text:level="2" >Deployment Options for Components</text:h><text:h text:style-name="Head 3" text:level="3" >Component Registration</text:h><text:h text:style-name="Head 3" text:level="3" >Service Manager Configuration</text:h><text:unordered-list text:style-name="L3" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P5" >XSet Interface</text:p><text:p text:style-name="P5" >Adding components during runtime, particularly interesting during development</text:p></text:list-item><text:list-item ><text:p text:style-name="P5" >ServiceManager Content</text:p><text:p text:style-name="P5" >Dynamically modifying the ServiceManager</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Bootstrapping the Service Manager ((from CppBind chapter))</text:h><text:unordered-list text:style-name="L4" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P6" >Simple Test Application</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >Configuring Your Application with Bootstrap Parameters</text:p></text:list-item><text:list-item ><text:p text:style-name="P6" >The UNO Executable</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 3" text:level="3" >Standalone Runtime Environment</text:h><text:p text:style-name="Paragraph" ><text:tab-stop ></text:tab-stop>The UNO executable and XMain</text:p><text:h text:style-name="Head 3" text:level="3" >Configuring the Java Runtime Environment</text:h><text:unordered-list text:style-name="L5" ><text:list-item ><text:unordered-list ><text:list-item ><text:p text:style-name="P7" >The office and Java ((from UnoBindingJava))</text:p></text:list-item></text:unordered-list></text:list-item></text:unordered-list><text:h text:style-name="Head 1" text:level="1" >Advanced UNO</text:h><text:h text:style-name="Head 2" text:level="2" >Design Patterns</text:h><text:h text:style-name="Head 2" text:level="2" >Bridging concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Requirements for Language Bindings and Bridges</text:h><text:h text:style-name="Head 3" text:level="3" >New Scripting Engines</text:h><text:h text:style-name="Head 2" text:level="2" >ServiceManager and loader</text:h><text:h text:style-name="Head 2" text:level="2" >Special Interfaces for internal use</text:h><text:p text:style-name="Paragraph" >XUNOTunnel</text:p><text:p text:style-name="Paragraph" >XAggregation</text:p><text:h text:style-name="Head 2" text:level="2" >UNO Reflection API</text:h><text:h text:style-name="Head 2" text:level="2" >TypeLibrary and TypeProviders</text:h><text:h text:style-name="Head 2" text:level="2" >Differences from Corba</text:h><text:h text:style-name="Head 1" text:level="1" >Office Development</text:h><text:h text:style-name="Head 2" text:level="2" >Global Object Structure</text:h><text:h text:style-name="Head 3" text:level="3" >Desktop Environment</text:h><text:h text:style-name="Head 3" text:level="3" >Frames and Frame Hierarchies</text:h><text:h text:style-name="Head 3" text:level="3" >Frame-Controller-Model Paradigm</text:h><text:h text:style-name="Head 3" text:level="3" >Loading and Saving Office Components</text:h><text:h text:style-name="Head 3" text:level="3" >Dispatch Framework</text:h><text:h text:style-name="Head 2" text:level="2" >Common Features</text:h><text:h text:style-name="Head 3" text:level="3" >Common Dialogs</text:h><text:h text:style-name="Head 3" text:level="3" >DocumentInfo</text:h><text:h text:style-name="Head 3" text:level="3" >Styles</text:h><text:h text:style-name="Head 3" text:level="3" >Search and Replace</text:h><text:h text:style-name="Head 3" text:level="3" >Number Formats</text:h><text:h text:style-name="Head 3" text:level="3" >Package File Formats</text:h><text:h text:style-name="Head 2" text:level="2" >Internationalization</text:h><text:h text:style-name="Head 2" text:level="2" >Linguistic</text:h><text:h text:style-name="Head 2" text:level="2" >System Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Clipboard</text:h><text:h text:style-name="Head 3" text:level="3" >File Picker</text:h><text:h text:style-name="Head 3" text:level="3" >Bridging to the Window System</text:h><text:p text:style-name="Paragraph" ></text:p><text:h text:style-name="Head 1" text:level="1" >Text Documents (51,5 Pages)</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Text Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Text Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Using Text</text:h><text:h text:style-name="Head 3" text:level="3" >Tables</text:h><text:h text:style-name="Head 3" text:level="3" >Text Fields</text:h><text:h text:style-name="Head 3" text:level="3" >Bookmarks</text:h><text:h text:style-name="Head 3" text:level="3" >Indexes and Index Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Reference Marks</text:h><text:h text:style-name="Head 3" text:level="3" >Footnotes and Endnotes</text:h><text:h text:style-name="Head 3" text:level="3" >Shape Objects in Text</text:h><text:h text:style-name="Head 3" text:level="3" >Redline</text:h><text:h text:style-name="Head 3" text:level="3" >Ruby</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Text Document</text:h><text:h text:style-name="Head 1" text:level="1" >Spreadsheet Documents</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Spreadsheet Files</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Spreadsheet Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Editing Spreadsheets</text:h><text:h text:style-name="Head 2" text:level="2" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Spreadsheet Document</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Spreadsheet Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Drawings and Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Overview</text:h><text:h text:style-name="Head 2" text:level="2" >Handling Draw/Impress Files</text:h><text:h text:style-name="Head 3" text:level="3" >Saving</text:h><text:h text:style-name="Head 3" text:level="3" >Printing</text:h><text:h text:style-name="Head 3" text:level="3" >Running Presentations</text:h><text:h text:style-name="Head 2" text:level="2" >Working with a Draw/Impress Document</text:h><text:h text:style-name="Head 3" text:level="3" >Navigating</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Draw/Impress Documents</text:h><text:h text:style-name="Head 3" text:level="3" >Global Document Features</text:h><text:h text:style-name="Head 2" text:level="2" >Controlling a Draw/Impress Document</text:h><text:h text:style-name="Head 1" text:level="1" >Charts</text:h><text:h text:style-name="Head 2" text:level="2" >Chart Basics</text:h><text:h text:style-name="Head 2" text:level="2" >Creating a Chart Document</text:h><text:h text:style-name="Head 2" text:level="2" >Editing a Chart Document</text:h><text:h text:style-name="Head 3" text:level="3" >Common Diagram API</text:h><text:h text:style-name="Head 3" text:level="3" >Different Chart Types</text:h><text:h text:style-name="Head 2" text:level="2" >Extending Capabilities of Chart Documents</text:h><text:h text:style-name="Head 1" text:level="1" >Basic and Dialogs</text:h><text:h text:style-name="Head 2" text:level="2" >Introduction</text:h><text:h text:style-name="Head 2" text:level="2" >Library Organization</text:h><text:h text:style-name="Head 2" text:level="2" >IDE with Dialogs and Events</text:h><text:h text:style-name="Head 2" text:level="2" >Using [PRODUCTNAME] Basic</text:h><text:h text:style-name="Head 2" text:level="2" >Toolkit Controls and their Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating Dialogs at Runtime</text:h><text:h text:style-name="Head 1" text:level="1" >Database Access</text:h><text:h text:style-name="Head 2" text:level="2" >Features of the [PRODUCTNAME] Database Integration</text:h><text:h text:style-name="Head 3" text:level="3" >Capabilities</text:h><text:h text:style-name="Head 3" text:level="3" >SDBC, SDBCX, SDB Architecture</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Datasources with [PRODUCTNAME]</text:h><text:h text:style-name="Head 3" text:level="3" >DataSources</text:h><text:h text:style-name="Head 3" text:level="3" >Adding and Editing Datasources </text:h><text:h text:style-name="Head 3" text:level="3" >Establishing a Connection</text:h><text:h text:style-name="Head 4" text:level="4" >Getting Connections</text:h><text:h text:style-name="Head 4" text:level="4" >Driver specifics</text:h><text:h text:style-name="Head 3" text:level="3" >Connection Pooling</text:h><text:h text:style-name="Head 3" text:level="3" >Working with Saved Queries</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Data</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Statements</text:h><text:h text:style-name="Head 3" text:level="3" >Resultsets</text:h><text:h text:style-name="Head 3" text:level="3" >Metadata</text:h><text:h text:style-name="Head 3" text:level="3" >Rowsets</text:h><text:h text:style-name="Head 2" text:level="2" >Working with the Database Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using DDL to change the DB Design</text:h><text:h text:style-name="Head 3" text:level="3" >Using SDBCX to access the DB Design</text:h><text:h text:style-name="Head 2" text:level="2" >Using DBMS Features</text:h><text:h text:style-name="Head 3" text:level="3" >Stored Procedures</text:h><text:h text:style-name="Head 3" text:level="3" >Transaction Handling</text:h><text:h text:style-name="Head 3" text:level="3" >Executing Prepared Statements</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Database Drivers</text:h><text:h text:style-name="Head 1" text:level="1" >Forms</text:h><text:h text:style-name="Head 2" text:level="2" >Concepts</text:h><text:h text:style-name="Head 3" text:level="3" >Models and Views</text:h><text:h text:style-name="Head 3" text:level="3" >Form Elements in the Document Model</text:h><text:h text:style-name="Head 3" text:level="3" >Special Form Components</text:h><text:h text:style-name="Head 3" text:level="3" >Events</text:h><text:h text:style-name="Head 3" text:level="3" >Data Awareness</text:h><text:h text:style-name="Head 2" text:level="2" >Recipes</text:h><text:h text:style-name="Head 3" text:level="3" >Making it easier to work with a Form</text:h><text:h text:style-name="Head 3" text:level="3" >Controlling the Data Input</text:h><text:h text:style-name="Head 3" text:level="3" >Collecting Data automatically</text:h><text:h text:style-name="Head 3" text:level="3" >Taking Advantage of Database Server Features</text:h><text:h text:style-name="Head 3" text:level="3" >Adding new Functionality</text:h><text:h text:style-name="Head 3" text:level="3" >Handling Errors</text:h><text:h text:style-name="Head 1" text:level="1" >UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Purpose of UCB</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Opening Document Contents as Streams</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Content Properties</text:h><text:h text:style-name="Head 2" text:level="2" >Creating, Moving and Copying Document and Folder Contents</text:h><text:h text:style-name="Head 2" text:level="2" >Working with Additional Commands</text:h><text:h text:style-name="Head 2" text:level="2" >Writing a Content Provider</text:h><text:h text:style-name="Head 1" text:level="1" >[PRODUCTNAME] Configuration</text:h><text:h text:style-name="Head 2" text:level="2" >Accessing configuration data</text:h><text:h text:style-name="Head 2" text:level="2" >Writing Configuration Data</text:h><text:h text:style-name="Head 1" text:level="1" >Appendix</text:h></office:body> + +</office:document> +</signtest>
\ No newline at end of file diff --git a/xmlsecurity/tools/examples/uno_win.bat b/xmlsecurity/tools/examples/uno_win.bat new file mode 100644 index 000000000000..6d1f74ada1f6 --- /dev/null +++ b/xmlsecurity/tools/examples/uno_win.bat @@ -0,0 +1,23 @@ +call env_win.bat + +@echo off +echo ============================================= +echo step - 1 start OpenOffice +echo ============================================= +@echo on + +@echo off +echo please start up OpenOffice with "-accept=socket,host=0,port=2002;urp;" +pause Press Enter when finished... +@echo on + +@echo off +echo ============================================= +echo step - 2 run the testtool class +echo ============================================= +@echo on + +cp %WS_PATH%/xmlsecurity/tools/uno/current.gif ./. +java -classpath %WS_PATH%/xmlsecurity/%OUTPUTDIR%/class;%SO_CLASSPATHPATH%/rt.jar;%SO_CLASSPATHPATH%/java_uno.jar;%SO_CLASSPATHPATH%/jurt.jar;%SO_CLASSPATHPATH%/unoil.jar;%SO_CLASSPATHPATH%/ridl.jar;%SO_CLASSPATHPATH%/juh.jar com.sun.star.xml.security.uno.TestTool %WS_PATH%/xmlsecurity/tools/cryptoken/jks/testToken.jks "" +rm ./current.gif + diff --git a/xmlsecurity/tools/examples/warmup.xml b/xmlsecurity/tools/examples/warmup.xml new file mode 100644 index 000000000000..70abf5cd4d34 --- /dev/null +++ b/xmlsecurity/tools/examples/warmup.xml @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="UTF-8"?> +<signtest> +<Signature xmlns="http://www.w3.org/2000/09/xmldsig#"> + <SignedInfo> + <CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" /> + <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" /> + <Reference URI="#target"> + <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" /> + <DigestValue> </DigestValue> + </Reference> + </SignedInfo> + <SignatureValue> </SignatureValue> + <KeyInfo> + <X509Data> + <X509IssuerSerial> + <X509IssuerName>CN=Test Issuer</X509IssuerName> + <X509SerialNumber>123450005</X509SerialNumber> + </X509IssuerSerial> + </X509Data> + </KeyInfo> +</Signature> +<office:document id="target" xmlns:office="http://openoffice.org/2000/office" xmlns:style="http://openoffice.org/2000/style" xmlns:text="http://openoffice.org/2000/text" xmlns:table="http://openoffice.org/2000/table" xmlns:draw="http://openoffice.org/2000/drawing" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:meta="http://openoffice.org/2000/meta" xmlns:number="http://openoffice.org/2000/datastyle" xmlns:svg="http://www.w3.org/2000/svg" xmlns:chart="http://openoffice.org/2000/chart" xmlns:dr3d="http://openoffice.org/2000/dr3d" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="http://openoffice.org/2000/form" xmlns:script="http://openoffice.org/2000/script" xmlns:config="http://openoffice.org/2001/config" office:class="text" office:version="1.0" > + +<office:body text:bullet-char="•" >ä½ å¥½</office:body> + +</office:document> +</signtest>
\ No newline at end of file diff --git a/xmlsecurity/tools/standalone/csfit/certmngr.cxx b/xmlsecurity/tools/standalone/csfit/certmngr.cxx new file mode 100644 index 000000000000..56dc1b5ae1ae --- /dev/null +++ b/xmlsecurity/tools/standalone/csfit/certmngr.cxx @@ -0,0 +1,189 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_xmlsecurity.hxx" + +#include <stdio.h> +#include "helper.hxx" + +#include "libxml/tree.h" +#include "libxml/parser.h" +#ifndef XMLSEC_NO_XSLT +#include "libxslt/xslt.h" +#endif + +#include "securityenvironment_nssimpl.hxx" + +#include <xmlsecurity/biginteger.hxx> + + +#include "nspr.h" +#include "prtypes.h" + +#include "pk11func.h" +#include "cert.h" +#include "cryptohi.h" +#include "certdb.h" +#include "nss.h" + +#include "xmlsec/strings.h" +#include "xmlsec/xmltree.h" + +#include <rtl/ustring.hxx> + +using namespace ::rtl ; +using namespace ::cppu ; +using namespace ::com::sun::star::uno ; +using namespace ::com::sun::star::io ; +using namespace ::com::sun::star::ucb ; +using namespace ::com::sun::star::beans ; +using namespace ::com::sun::star::document ; +using namespace ::com::sun::star::lang ; +using namespace ::com::sun::star::security ; +using namespace ::com::sun::star::xml::wrapper ; +using namespace ::com::sun::star::xml::crypto ; + +int SAL_CALL main( int argc, char **argv ) +{ + CERTCertDBHandle* certHandle ; + PK11SlotInfo* slot ; + + if( argc != 3 ) { + fprintf( stderr, "Usage: %s < CertDir > <rdb file>\n\n" , argv[0] ) ; + return 1 ; + } + + for( ; getchar() != 'q' ; ) { + slot = NULL ; + + //Initialize NSPR and NSS + PR_Init( PR_SYSTEM_THREAD, PR_PRIORITY_NORMAL, 1 ) ; + PK11_SetPasswordFunc( PriPK11PasswordFunc ) ; + if( NSS_Init( argv[1] ) != SECSuccess ) { + fprintf( stderr , "### cannot intialize NSS!\n" ) ; + goto done ; + } + + certHandle = CERT_GetDefaultCertDB() ; + slot = PK11_GetInternalKeySlot() ; + + if( PK11_NeedLogin( slot ) ) { + SECStatus nRet = PK11_Authenticate( slot, PR_TRUE, NULL ); + if( nRet != SECSuccess ) { + fprintf( stderr , "### cannot authehticate the crypto token!\n" ) ; + goto done ; + } + } + + + try { + Reference< XMultiComponentFactory > xManager = NULL ; + Reference< XComponentContext > xContext = NULL ; + + xManager = serviceManager( xContext , OUString::createFromAscii( "local" ), OUString::createFromAscii( argv[2] ) ) ; + OSL_ENSURE( xManager.is() , + "ServicesManager - " + "Cannot get service manager" ) ; + + //Create security environment + //Build Security Environment + Reference< XInterface > xsecenv = + xManager->createInstanceWithContext( OUString::createFromAscii("com.sun.star.xml.security.bridge.xmlsec.SecurityEnvironment_NssImpl"), xContext ) ; + OSL_ENSURE( xsecenv.is() , + "Signer - " + "Cannot get service instance of \"xsec.SecurityEnvironment\"" ) ; + + Reference< XSecurityEnvironment > xSecEnv( xsecenv , UNO_QUERY ) ; + OSL_ENSURE( xSecEnv.is() , + "Signer - " + "Cannot get interface of \"XSecurityEnvironment\" from service \"xsec.SecurityEnvironment\"" ) ; + + //Setup key slot and certDb + Reference< XUnoTunnel > xEnvTunnel( xsecenv , UNO_QUERY ) ; + OSL_ENSURE( xEnvTunnel.is() , + "Signer - " + "Cannot get interface of \"XUnoTunnel\" from service \"xsec.SecurityEnvironment\"" ) ; + + SecurityEnvironment_NssImpl* pSecEnv = ( SecurityEnvironment_NssImpl* )xEnvTunnel->getSomething( SecurityEnvironment_NssImpl::getUnoTunnelId() ) ; + OSL_ENSURE( pSecEnv != NULL , + "Signer - " + "Cannot get implementation of \"xsec.SecurityEnvironment\"" ) ; + + pSecEnv->setCryptoSlot( slot ) ; + pSecEnv->setCertDb( certHandle ) ; + + //Get personal certificate + Sequence < Reference< XCertificate > > xPersonalCerts = pSecEnv->getPersonalCertificates() ; + Sequence < Reference< XCertificate > > xCertPath ; + for( int i = 0; i < xPersonalCerts.getLength(); i ++ ) { + //Print the certificate infomation. + fprintf( stdout, "\nPersonal Certificate Info\n" ) ; + fprintf( stdout, "\tCertificate Issuer[%s]\n", OUStringToOString( xPersonalCerts[i]->getIssuerName(), RTL_TEXTENCODING_ASCII_US ).getStr() ) ; + fprintf( stdout, "\tCertificate Serial Number[%s]\n", OUStringToOString( bigIntegerToNumericString( xPersonalCerts[i]->getSerialNumber() ), RTL_TEXTENCODING_ASCII_US ).getStr() ) ; + fprintf( stdout, "\tCertificate Subject[%s]\n", OUStringToOString( xPersonalCerts[i]->getSubjectName(), RTL_TEXTENCODING_ASCII_US ).getStr() ) ; + + //build the certificate path + xCertPath = pSecEnv->buildCertificatePath( xPersonalCerts[i] ) ; + //Print the certificate path. + fprintf( stdout, "\tCertificate Path\n" ) ; + for( int j = 0; j < xCertPath.getLength(); j ++ ) { + fprintf( stdout, "\t\tCertificate Authority Subject[%s]\n", OUStringToOString( xCertPath[j]->getSubjectName(), RTL_TEXTENCODING_ASCII_US ).getStr() ) ; + } + + //Get the certificate + Sequence < sal_Int8 > serial = xPersonalCerts[i]->getSerialNumber() ; + Reference< XCertificate > xcert = pSecEnv->getCertificate( xPersonalCerts[i]->getIssuerName(), xPersonalCerts[i]->getSerialNumber() ) ; + if( !xcert.is() ) { + fprintf( stdout, "The personal certificate is not in the certificate database\n" ) ; + } + + //Get the certificate characters + sal_Int32 chars = pSecEnv->getCertificateCharacters( xPersonalCerts[i] ) ; + fprintf( stdout, "The certificate characters are %d\n", chars ) ; + + //Get the certificate status + sal_Int32 validity = pSecEnv->verifyCertificate( xPersonalCerts[i] ) ; + fprintf( stdout, "The certificate validities are %d\n", validity ) ; + } + } catch( Exception& e ) { + fprintf( stderr , "Error Message: %s\n" , OUStringToOString( e.Message , RTL_TEXTENCODING_ASCII_US ).getStr() ) ; + goto done ; + } + +done: + if( slot != NULL ) + PK11_FreeSlot( slot ) ; + + PK11_LogoutAll() ; + NSS_Shutdown() ; + + } + + return 0; +} + diff --git a/xmlsecurity/tools/standalone/csfit/decrypter.cxx b/xmlsecurity/tools/standalone/csfit/decrypter.cxx new file mode 100644 index 000000000000..9c2422c19bb5 --- /dev/null +++ b/xmlsecurity/tools/standalone/csfit/decrypter.cxx @@ -0,0 +1,272 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_xmlsecurity.hxx" + +#include <stdio.h> +#include "helper.hxx" + +#include "libxml/tree.h" +#include "libxml/parser.h" +#ifndef XMLSEC_NO_XSLT +#include "libxslt/xslt.h" +#endif + + +#include "securityenvironment_nssimpl.hxx" +#include "xmlelementwrapper_xmlsecimpl.hxx" + +#include "nspr.h" +#include "prtypes.h" + +#include "pk11func.h" +#include "cert.h" +#include "cryptohi.h" +#include "certdb.h" +#include "nss.h" + +#include "xmlsec/strings.h" +#include "xmlsec/xmltree.h" + +#include <rtl/ustring.hxx> +#include <cppuhelper/bootstrap.hxx> +#include <cppuhelper/servicefactory.hxx> + +#include <com/sun/star/beans/PropertyValue.hpp> +#include <com/sun/star/xml/wrapper/XXMLElementWrapper.hpp> +#include <com/sun/star/xml/wrapper/XXMLDocumentWrapper.hpp> +#include <com/sun/star/xml/crypto/XXMLEncryption.hpp> +#include <com/sun/star/xml/crypto/XXMLEncryptionTemplate.hpp> +#include <com/sun/star/xml/crypto/XXMLSecurityContext.hpp> +#include <com/sun/star/xml/crypto/XSecurityEnvironment.hpp> + + +using namespace ::rtl ; +using namespace ::cppu ; +using namespace ::com::sun::star::uno ; +using namespace ::com::sun::star::io ; +using namespace ::com::sun::star::ucb ; +using namespace ::com::sun::star::beans ; +using namespace ::com::sun::star::document ; +using namespace ::com::sun::star::lang ; +using namespace ::com::sun::star::registry ; +using namespace ::com::sun::star::xml::wrapper ; +using namespace ::com::sun::star::xml::crypto ; + + +int SAL_CALL main( int argc, char **argv ) +{ + CERTCertDBHandle* certHandle = NULL ; + PK11SlotInfo* slot = NULL ; + xmlDocPtr doc = NULL ; + xmlNodePtr tplNode ; + xmlNodePtr tarNode ; + FILE* dstFile = NULL ; + + + if( argc != 5 ) { + fprintf( stderr, "Usage: %s < CertDir > <input file_url> <output file_url> <rdb file>\n\n" , argv[0] ) ; + return 1 ; + } + + //Init libxml and libxslt libraries + xmlInitParser(); + LIBXML_TEST_VERSION + xmlLoadExtDtdDefaultValue = XML_DETECT_IDS | XML_COMPLETE_ATTRS; + xmlSubstituteEntitiesDefault(1); + + #ifndef XMLSEC_NO_XSLT + xmlIndentTreeOutput = 1; + #endif // XMLSEC_NO_XSLT + + + //Initialize NSPR and NSS + PR_Init( PR_SYSTEM_THREAD, PR_PRIORITY_NORMAL, 1 ) ; + PK11_SetPasswordFunc( PriPK11PasswordFunc ) ; + if( NSS_Init( argv[1] ) != SECSuccess ) { + fprintf( stderr , "### cannot intialize NSS!\n" ) ; + goto done ; + } + + certHandle = CERT_GetDefaultCertDB() ; + slot = PK11_GetInternalKeySlot() ; + + //Load XML document + doc = xmlParseFile( argv[2] ) ; + if( doc == NULL || xmlDocGetRootElement( doc ) == NULL ) { + fprintf( stderr , "### Cannot load template xml document!\n" ) ; + goto done ; + } + + //Find the encryption template + tplNode = xmlSecFindNode( xmlDocGetRootElement( doc ), xmlSecNodeEncryptedData, xmlSecEncNs ) ; + if( tplNode == NULL ) { + fprintf( stderr , "### Cannot find the encryption template!\n" ) ; + goto done ; + } + + + try { + Reference< XMultiComponentFactory > xManager = NULL ; + Reference< XComponentContext > xContext = NULL ; + + xManager = serviceManager( xContext , OUString::createFromAscii( "local" ), OUString::createFromAscii( argv[4] ) ) ; + + //Create encryption template + Reference< XInterface > tplElement = + xManager->createInstanceWithContext( OUString::createFromAscii( "com.sun.star.xml.security.bridge.xmlsec.XMLElementWrapper_XmlSecImpl" ) , xContext ) ; + OSL_ENSURE( tplElement.is() , + "Decryptor - " + "Cannot get service instance of \"xsec.XMLElementWrapper\"" ) ; + + Reference< XXMLElementWrapper > xTplElement( tplElement , UNO_QUERY ) ; + OSL_ENSURE( xTplElement.is() , + "Decryptor - " + "Cannot get interface of \"XXMLElementWrapper\" from service \"xsec.XMLElementWrapper\"" ) ; + + Reference< XUnoTunnel > xTplEleTunnel( xTplElement , UNO_QUERY ) ; + OSL_ENSURE( xTplEleTunnel.is() , + "Decryptor - " + "Cannot get interface of \"XUnoTunnel\" from service \"xsec.XMLElementWrapper\"" ) ; + + XMLElementWrapper_XmlSecImpl* pTplElement = ( XMLElementWrapper_XmlSecImpl* )xTplEleTunnel->getSomething( XMLElementWrapper_XmlSecImpl::getUnoTunnelImplementationId() ) ; + OSL_ENSURE( pTplElement != NULL , + "Decryptor - " + "Cannot get implementation of \"xsec.XMLElementWrapper\"" ) ; + + pTplElement->setNativeElement( tplNode ) ; + + //Build XML Encryption template + Reference< XInterface > enctpl = + xManager->createInstanceWithContext( OUString::createFromAscii("com.sun.star.xml.crypto.XMLEncryptionTemplate"), xContext ) ; + OSL_ENSURE( enctpl.is() , + "Decryptor - " + "Cannot get service instance of \"xsec.XMLEncryptionTemplate\"" ) ; + + Reference< XXMLEncryptionTemplate > xTemplate( enctpl , UNO_QUERY ) ; + OSL_ENSURE( xTemplate.is() , + "Decryptor - " + "Cannot get interface of \"XXMLEncryptionTemplate\" from service \"xsec.XMLEncryptionTemplate\"" ) ; + + //Import the encryption template + xTemplate->setTemplate( xTplElement ) ; + + //Create security environment + //Build Security Environment + Reference< XInterface > xsecenv = + xManager->createInstanceWithContext( OUString::createFromAscii("com.sun.star.xml.security.bridge.xmlsec.SecurityEnvironment_NssImpl"), xContext ) ; + OSL_ENSURE( xsecenv.is() , + "Decryptor - " + "Cannot get service instance of \"xsec.SecurityEnvironment\"" ) ; + + Reference< XSecurityEnvironment > xSecEnv( xsecenv , UNO_QUERY ) ; + OSL_ENSURE( xSecEnv.is() , + "Decryptor - " + "Cannot get interface of \"XSecurityEnvironment\" from service \"xsec.SecurityEnvironment\"" ) ; + + //Setup key slot and certDb + Reference< XUnoTunnel > xEnvTunnel( xsecenv , UNO_QUERY ) ; + OSL_ENSURE( xEnvTunnel.is() , + "Decryptor - " + "Cannot get interface of \"XUnoTunnel\" from service \"xsec.SecurityEnvironment\"" ) ; + + SecurityEnvironment_NssImpl* pSecEnv = ( SecurityEnvironment_NssImpl* )xEnvTunnel->getSomething( SecurityEnvironment_NssImpl::getUnoTunnelId() ) ; + OSL_ENSURE( pSecEnv != NULL , + "Decryptor - " + "Cannot get implementation of \"xsec.SecurityEnvironment\"" ) ; + + pSecEnv->setCryptoSlot( slot ) ; + pSecEnv->setCertDb( certHandle ) ; + + + //Build XML Security Context + Reference< XInterface > xmlsecctx = + xManager->createInstanceWithContext( OUString::createFromAscii("com.sun.star.xml.security.bridge.xmlsec.XMLSecurityContext_NssImpl"), xContext ) ; + OSL_ENSURE( xmlsecctx.is() , + "Decryptor - " + "Cannot get service instance of \"xsec.XMLSecurityContext\"" ) ; + + Reference< XXMLSecurityContext > xSecCtx( xmlsecctx , UNO_QUERY ) ; + OSL_ENSURE( xSecCtx.is() , + "Decryptor - " + "Cannot get interface of \"XXMLSecurityContext\" from service \"xsec.XMLSecurityContext\"" ) ; + + xSecCtx->setSecurityEnvironment( xSecEnv ) ; + + + //Get encrypter + Reference< XInterface > xmlencrypter = + xManager->createInstanceWithContext( OUString::createFromAscii("com.sun.star.xml.security.bridge.xmlsec.XMLEncryption_NssImpl"), xContext ) ; + OSL_ENSURE( xmlencrypter.is() , + "Decryptor - " + "Cannot get service instance of \"xsec.XMLEncryption\"" ) ; + + Reference< XXMLEncryption > xEncrypter( xmlencrypter , UNO_QUERY ) ; + OSL_ENSURE( xEncrypter.is() , + "Decryptor - " + "Cannot get interface of \"XXMLEncryption\" from service \"xsec.XMLEncryption\"" ) ; + + + //Perform decryption + Reference< XXMLElementWrapper> xDecrRes = xEncrypter->decrypt( xTemplate , xSecCtx ) ; + OSL_ENSURE( xDecrRes.is() , + "Decryptor - " + "Cannot decrypt the xml document" ) ; + } catch( Exception& e ) { + fprintf( stderr , "Error Message: %s\n" , OUStringToOString( e.Message , RTL_TEXTENCODING_ASCII_US ).getStr() ) ; + goto done ; + } + + dstFile = fopen( argv[3], "w" ) ; + if( dstFile == NULL ) { + fprintf( stderr , "### Can not open file %s\n", argv[3] ) ; + goto done ; + } + + //Save result + xmlDocDump( dstFile, doc ) ; + +done: + if( dstFile != NULL ) + fclose( dstFile ) ; + + if( slot != NULL ) + PK11_FreeSlot( slot ) ; + + PK11_LogoutAll() ; + NSS_Shutdown() ; + + /* Shutdown libxslt/libxml */ + #ifndef XMLSEC_NO_XSLT + xsltCleanupGlobals(); + #endif /* XMLSEC_NO_XSLT */ + xmlCleanupParser(); + + return 0; +} + diff --git a/xmlsecurity/tools/standalone/csfit/encrypter.cxx b/xmlsecurity/tools/standalone/csfit/encrypter.cxx new file mode 100644 index 000000000000..37821b6ed54e --- /dev/null +++ b/xmlsecurity/tools/standalone/csfit/encrypter.cxx @@ -0,0 +1,309 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_xmlsecurity.hxx" + +#include <stdio.h> +#include "helper.hxx" + +#include "libxml/tree.h" +#include "libxml/parser.h" +#ifndef XMLSEC_NO_XSLT +#include "libxslt/xslt.h" +#endif + +#include "securityenvironment_nssimpl.hxx" +#include "xmlelementwrapper_xmlsecimpl.hxx" + +#include "nspr.h" +#include "prtypes.h" + +#include "pk11func.h" +#include "cert.h" +#include "cryptohi.h" +#include "certdb.h" +#include "nss.h" + +#include "xmlsec/strings.h" +#include "xmlsec/xmltree.h" + +#include <rtl/ustring.hxx> +#include <cppuhelper/servicefactory.hxx> + +#include <com/sun/star/lang/XComponent.hpp> +#include <com/sun/star/beans/PropertyValue.hpp> +#include <com/sun/star/xml/wrapper/XXMLElementWrapper.hpp> +#include <com/sun/star/xml/wrapper/XXMLDocumentWrapper.hpp> +#include <com/sun/star/xml/crypto/XXMLEncryption.hpp> +#include <com/sun/star/xml/crypto/XXMLEncryptionTemplate.hpp> +#include <com/sun/star/xml/crypto/XXMLSecurityContext.hpp> +#include <com/sun/star/xml/crypto/XSecurityEnvironment.hpp> + +using namespace ::rtl ; +using namespace ::cppu ; +using namespace ::com::sun::star::uno ; +using namespace ::com::sun::star::io ; +using namespace ::com::sun::star::ucb ; +using namespace ::com::sun::star::beans ; +using namespace ::com::sun::star::document ; +using namespace ::com::sun::star::lang ; +using namespace ::com::sun::star::registry ; +using namespace ::com::sun::star::xml::wrapper ; +using namespace ::com::sun::star::xml::crypto ; + +int SAL_CALL main( int argc, char **argv ) +{ + CERTCertDBHandle* certHandle ; + PK11SlotInfo* slot = NULL ; + PK11SymKey* symKey = NULL ; + xmlDocPtr doc = NULL ; + xmlNodePtr tplNode ; + xmlNodePtr tarNode ; + FILE* dstFile = NULL ; + + if( argc != 7 ) { + fprintf( stderr, "Usage: %s < CertDir > <file_url of template> <file_url of result> <target element name> <target element namespace> <rdb file>\n\n" , argv[0] ) ; + return 1 ; + } + + //Init libxml and libxslt libraries + xmlInitParser(); + LIBXML_TEST_VERSION + xmlLoadExtDtdDefaultValue = XML_DETECT_IDS | XML_COMPLETE_ATTRS; + xmlSubstituteEntitiesDefault(1); + + #ifndef XMLSEC_NO_XSLT + xmlIndentTreeOutput = 1; + #endif // XMLSEC_NO_XSLT + + //Initialize NSPR and NSS + PR_Init( PR_SYSTEM_THREAD, PR_PRIORITY_NORMAL, 1 ) ; + PK11_SetPasswordFunc( PriPK11PasswordFunc ) ; + if( NSS_Init( argv[1] ) != SECSuccess ) { + fprintf( stderr , "### cannot intialize NSS!\n" ) ; + goto done ; + } + + certHandle = CERT_GetDefaultCertDB() ; + slot = PK11_GetInternalKeySlot() ; + + symKey = PK11_KeyGen( slot , CKM_DES3_CBC, NULL, 128, NULL ) ; + if( symKey == NULL ) { + fprintf( stderr , "### cannot create symmetric key!\n" ) ; + goto done ; + } + + //Load XML document + doc = xmlParseFile( argv[2] ) ; + if( doc == NULL || xmlDocGetRootElement( doc ) == NULL ) { + fprintf( stderr , "### Cannot load template xml document!\n" ) ; + goto done ; + } + + //Find the encryption template + tplNode = xmlSecFindNode( xmlDocGetRootElement( doc ), xmlSecNodeEncryptedData, xmlSecEncNs ) ; + if( tplNode == NULL ) { + fprintf( stderr , "### Cannot find the encryption template!\n" ) ; + goto done ; + } + + //Find the encryption template + tarNode = xmlSecFindNode( xmlDocGetRootElement( doc ), ( const unsigned char*)argv[4], ( const unsigned char*)argv[5] ) ; + if( tarNode == NULL ) { + fprintf( stderr , "### Cannot find the encryption target!\n" ) ; + goto done ; + } + + try { + Reference< XMultiComponentFactory > xManager = NULL ; + Reference< XComponentContext > xContext = NULL ; + + xManager = serviceManager( xContext , OUString::createFromAscii( "local" ), OUString::createFromAscii( argv[6] ) ) ; + + //Create encryption template + Reference< XInterface > tplElement = + xManager->createInstanceWithContext( OUString::createFromAscii( "com.sun.star.xml.security.bridge.xmlsec.XMLElementWrapper_XmlSecImpl" ) , xContext ) ; + OSL_ENSURE( tplElement.is() , + "Encryptor - " + "Cannot get service instance of \"xsec.XMLElementWrapper\"" ) ; + + Reference< XXMLElementWrapper > xTplElement( tplElement , UNO_QUERY ) ; + OSL_ENSURE( xTplElement.is() , + "Encryptor - " + "Cannot get interface of \"XXMLElementWrapper\" from service \"xsec.XMLElementWrapper\"" ) ; + + Reference< XUnoTunnel > xTplEleTunnel( xTplElement , UNO_QUERY ) ; + OSL_ENSURE( xTplEleTunnel.is() , + "Encryptor - " + "Cannot get interface of \"XUnoTunnel\" from service \"xsec.XMLElementWrapper\"" ) ; + + XMLElementWrapper_XmlSecImpl* pTplElement = ( XMLElementWrapper_XmlSecImpl* )xTplEleTunnel->getSomething( XMLElementWrapper_XmlSecImpl::getUnoTunnelImplementationId() ) ; + OSL_ENSURE( pTplElement != NULL , + "Encryptor - " + "Cannot get implementation of \"xsec.XMLElementWrapper\"" ) ; + + pTplElement->setNativeElement( tplNode ) ; + + //Create encryption target element + Reference< XInterface > tarElement = + xManager->createInstanceWithContext( OUString::createFromAscii( "com.sun.star.xml.security.bridge.xmlsec.XMLElementWrapper_XmlSecImpl" ) , xContext ) ; + OSL_ENSURE( tarElement.is() , + "Encryptor - " + "Cannot get service instance of \"xsec.XMLElementWrapper\"" ) ; + + Reference< XXMLElementWrapper > xTarElement( tarElement , UNO_QUERY ) ; + OSL_ENSURE( xTarElement.is() , + "Encryptor - " + "Cannot get interface of \"XXMLElementWrapper\" from service \"xsec.XMLElementWrapper\"" ) ; + + Reference< XUnoTunnel > xTarEleTunnel( xTarElement , UNO_QUERY ) ; + OSL_ENSURE( xTarEleTunnel.is() , + "Encryptor - " + "Cannot get interface of \"XUnoTunnel\" from service \"xsec.XMLElementWrapper\"" ) ; + + XMLElementWrapper_XmlSecImpl* pTarElement = ( XMLElementWrapper_XmlSecImpl* )xTarEleTunnel->getSomething( XMLElementWrapper_XmlSecImpl::getUnoTunnelImplementationId() ) ; + OSL_ENSURE( pTarElement != NULL , + "Encryptor - " + "Cannot get implementation of \"xsec.XMLElementWrapper\"" ) ; + + pTarElement->setNativeElement( tarNode ) ; + + + //Build XML Encryption template + Reference< XInterface > enctpl = + xManager->createInstanceWithContext( OUString::createFromAscii("com.sun.star.xml.crypto.XMLEncryptionTemplate"), xContext ) ; + OSL_ENSURE( enctpl.is() , + "Encryptor - " + "Cannot get service instance of \"xsec.XMLEncryptionTemplate\"" ) ; + + Reference< XXMLEncryptionTemplate > xTemplate( enctpl , UNO_QUERY ) ; + OSL_ENSURE( xTemplate.is() , + "Encryptor - " + "Cannot get interface of \"XXMLEncryptionTemplate\" from service \"xsec.XMLEncryptionTemplate\"" ) ; + + //Import the encryption template + xTemplate->setTemplate( xTplElement ) ; + xTemplate->setTarget( xTarElement ) ; + + //Create security environment + //Build Security Environment + Reference< XInterface > xsecenv = + xManager->createInstanceWithContext( OUString::createFromAscii("com.sun.star.xml.security.bridge.xmlsec.SecurityEnvironment_NssImpl"), xContext ) ; + OSL_ENSURE( xsecenv.is() , + "Encryptor - " + "Cannot get service instance of \"xsec.SecurityEnvironment\"" ) ; + + Reference< XSecurityEnvironment > xSecEnv( xsecenv , UNO_QUERY ) ; + OSL_ENSURE( xSecEnv.is() , + "Encryptor - " + "Cannot get interface of \"XSecurityEnvironment\" from service \"xsec.SecurityEnvironment\"" ) ; + + //Setup key slot and certDb + Reference< XUnoTunnel > xEnvTunnel( xsecenv , UNO_QUERY ) ; + OSL_ENSURE( xEnvTunnel.is() , + "Encryptor - " + "Cannot get interface of \"XUnoTunnel\" from service \"xsec.SecurityEnvironment\"" ) ; + + SecurityEnvironment_NssImpl* pSecEnv = ( SecurityEnvironment_NssImpl* )xEnvTunnel->getSomething( SecurityEnvironment_NssImpl::getUnoTunnelId() ) ; + OSL_ENSURE( pSecEnv != NULL , + "Encryptor - " + "Cannot get implementation of \"xsec.SecurityEnvironment\"" ) ; + + pSecEnv->setCryptoSlot( slot ) ; + pSecEnv->setCertDb( certHandle ) ; + pSecEnv->adoptSymKey( symKey ) ; + + + //Build XML Security Context + Reference< XInterface > xmlsecctx = + xManager->createInstanceWithContext( OUString::createFromAscii("com.sun.star.xml.security.bridge.xmlsec.XMLSecurityContext_NssImpl"), xContext ) ; + OSL_ENSURE( xmlsecctx.is() , + "Encryptor - " + "Cannot get service instance of \"xsec.XMLSecurityContext\"" ) ; + + Reference< XXMLSecurityContext > xSecCtx( xmlsecctx , UNO_QUERY ) ; + OSL_ENSURE( xSecCtx.is() , + "Encryptor - " + "Cannot get interface of \"XXMLSecurityContext\" from service \"xsec.XMLSecurityContext\"" ) ; + + xSecCtx->setSecurityEnvironment( xSecEnv ) ; + + //Get encrypter + Reference< XInterface > xmlencrypter = + xManager->createInstanceWithContext( OUString::createFromAscii("com.sun.star.xml.security.bridge.xmlsec.XMLEncryption_NssImpl"), xContext ) ; + OSL_ENSURE( xmlencrypter.is() , + "Encryptor - " + "Cannot get service instance of \"xsec.XMLEncryption\"" ) ; + + Reference< XXMLEncryption > xEncrypter( xmlencrypter , UNO_QUERY ) ; + OSL_ENSURE( xEncrypter.is() , + "Encryptor - " + "Cannot get interface of \"XXMLEncryption\" from service \"xsec.XMLEncryption\"" ) ; + + //perform encryption + xTemplate = xEncrypter->encrypt( xTemplate , xSecCtx ) ; + OSL_ENSURE( xTemplate.is() , + "Encryptor - " + "Cannot encrypt the xml document" ) ; + } catch( Exception& e ) { + fprintf( stderr , "Error Message: %s\n" , OUStringToOString( e.Message , RTL_TEXTENCODING_ASCII_US ).getStr() ) ; + goto done ; + } + + dstFile = fopen( argv[3], "w" ) ; + if( dstFile == NULL ) { + fprintf( stderr , "### Can not open file %s\n", argv[3] ) ; + goto done ; + } + + //Save result + xmlDocDump( dstFile, doc ) ; + +done: + if( dstFile != NULL ) + fclose( dstFile ) ; + + if( symKey != NULL ) { + PK11_FreeSymKey( symKey ) ; + } + + if( slot != NULL ) + PK11_FreeSlot( slot ) ; + + PK11_LogoutAll() ; + NSS_Shutdown() ; + + /* Shutdown libxslt/libxml */ + #ifndef XMLSEC_NO_XSLT + xsltCleanupGlobals(); + #endif /* XMLSEC_NO_XSLT */ + xmlCleanupParser(); + + return 0; +} + diff --git a/xmlsecurity/tools/standalone/csfit/helper.cxx b/xmlsecurity/tools/standalone/csfit/helper.cxx new file mode 100644 index 000000000000..23c9e5908758 --- /dev/null +++ b/xmlsecurity/tools/standalone/csfit/helper.cxx @@ -0,0 +1,266 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_xmlsecurity.hxx" + +#include "helper.hxx" +#include "osl/diagnose.h" +#include "rtl/ustring.h" +/*#include "libxml/xmlstring.h" +*/ + +/*- + * Helper : create a input stream from a file + */ +Reference< XInputStream > createStreamFromFile( const OUString sFile ) +{ + const sal_Char* pcFile ; + OString aString ; + + aString = OUStringToOString( sFile , RTL_TEXTENCODING_ASCII_US ) ; + pcFile = aString.getStr() ; + if( pcFile != NULL ) { + FILE *f = fopen( pcFile , "rb" ); + Reference< XInputStream > r; + + if( f ) { + fseek( f , 0 , SEEK_END ); + int nLength = ftell( f ); + fseek( f , 0 , SEEK_SET ); + + Sequence<sal_Int8> seqIn(nLength); + fread( seqIn.getArray() , nLength , 1 , f ); + + r = Reference< XInputStream > ( new OInputStream( seqIn ) ); + fclose( f ); + } + return r; + } else { + return NULL ; + } + + return NULL ; +} + +/*- + * Helper : set a output stream to a file + */ +Reference< XOutputStream > createStreamToFile( const OUString sFile ) +{ + const sal_Char* pcFile ; + OString aString ; + + aString = OUStringToOString( sFile , RTL_TEXTENCODING_ASCII_US ) ; + pcFile = aString.getStr() ; + if( pcFile != NULL ) + return Reference< XOutputStream >( new OOutputStream( pcFile ) ) ; + else + return NULL ; +} + +/*- + * Helper : get service manager and context + */ +Reference< XMultiComponentFactory > serviceManager( Reference< XComponentContext >& xContext , OUString sUnoUrl , OUString sRdbUrl ) throw( RuntimeException , Exception ) +{ + Reference< XMultiComponentFactory > xLocalServiceManager = NULL ; + Reference< XComponentContext > xLocalComponentContext = NULL ; + Reference< XMultiComponentFactory > xUsedServiceManager = NULL ; + Reference< XComponentContext > xUsedComponentContext = NULL ; + + OSL_ENSURE( !sUnoUrl.equalsAscii( "" ) , + "serviceManager - " + "No uno URI specified" ) ; + + OSL_ENSURE( !sRdbUrl.equalsAscii( "" ) , + "serviceManager - " + "No rdb URI specified" ) ; + + if( sUnoUrl.equalsAscii( "local" ) ) { + Reference< XSimpleRegistry > xSimpleRegistry = createSimpleRegistry(); + OSL_ENSURE( xSimpleRegistry.is() , + "serviceManager - " + "Cannot create simple registry" ) ; + + //xSimpleRegistry->open(OUString::createFromAscii("xmlsecurity.rdb"), sal_False, sal_False); + xSimpleRegistry->open(sRdbUrl, sal_True, sal_False); + OSL_ENSURE( xSimpleRegistry->isValid() , + "serviceManager - " + "Cannot open xml security registry rdb" ) ; + + xLocalComponentContext = bootstrap_InitialComponentContext( xSimpleRegistry ) ; + OSL_ENSURE( xLocalComponentContext.is() , + "serviceManager - " + "Cannot create intial component context" ) ; + + xLocalServiceManager = xLocalComponentContext->getServiceManager() ; + OSL_ENSURE( xLocalServiceManager.is() , + "serviceManager - " + "Cannot create intial service manager" ) ; + + /*- + * Because of the exception rasied from + * ucbhelper/source/provider/provconf.cxx, lin 323 + * I do not use the content broker at present + ******************************************************************** + //init ucb + if( ::ucb::ContentBroker::get() == NULL ) { + Reference< lang::XMultiServiceFactory > xSvmg( xLocalServiceManager , UNO_QUERY ) ; + OSL_ENSURE( xLocalServiceManager.is() , + "serviceManager - " + "Cannot get multi-service factory" ) ; + + Sequence< Any > args( 2 ) ; + args[ 0 ] <<= OUString::createFromAscii( UCB_CONFIGURATION_KEY1_LOCAL ) ; + args[ 1 ] <<= OUString::createFromAscii( UCB_CONFIGURATION_KEY2_OFFICE ) ; + if( ! ::ucb::ContentBroker::initialize( xSvmg , args ) ) { + throw RuntimeException( OUString::createFromAscii( "Cannot inlitialize ContentBroker" ) , Reference< XInterface >() , Any() ) ; + } + } + ********************************************************************/ + + xUsedComponentContext = xLocalComponentContext ; + xUsedServiceManager = xLocalServiceManager ; + } else { + Reference< XComponentContext > xLocalComponentContext = defaultBootstrap_InitialComponentContext() ; + OSL_ENSURE( xLocalComponentContext.is() , + "serviceManager - " + "Cannot create intial component context" ) ; + + Reference< XMultiComponentFactory > xLocalServiceManager = xLocalComponentContext->getServiceManager(); + OSL_ENSURE( xLocalServiceManager.is() , + "serviceManager - " + "Cannot create intial service manager" ) ; + + Reference< XInterface > urlResolver = + xLocalServiceManager->createInstanceWithContext( OUString::createFromAscii("com.sun.star.bridge.UnoUrlResolver") , xLocalComponentContext ) ; + OSL_ENSURE( urlResolver.is() , + "serviceManager - " + "Cannot get service instance of \"bridge.UnoUrlResolver\"" ) ; + + Reference< XUnoUrlResolver > xUnoUrlResolver( urlResolver , UNO_QUERY ) ; + OSL_ENSURE( xUnoUrlResolver.is() , + "serviceManager - " + "Cannot get interface of \"XUnoUrlResolver\" from service \"bridge.UnoUrlResolver\"" ) ; + + Reference< XInterface > initialObject = xUnoUrlResolver->resolve( sUnoUrl ) ; + OSL_ENSURE( initialObject.is() , + "serviceManager - " + "Cannot resolve uno url" ) ; + + /*- + * Method 1: with Naming Service + ******************************************************************** + Reference< XNamingService > xNamingService( initialObject , UNO_QUERY ) ; + OSL_ENSURE( xNamingService.is() , + "serviceManager - " + "Cannot get interface of \"XNamingService\" from URL resolver" ) ; + + Reference< XInterface > serviceManager = + xNamingService->getRegisteredObject( OUString::createFromAscii( "StarOffice.ServiceManager" ) ) ; + OSL_ENSURE( serviceManager.is() , + "serviceManager - " + "Cannot get service instance of \"StarOffice.ServiceManager\"" ) ; + + xUsedServiceManager = Reference< XMultiComponentFactory >( serviceManager , UNO_QUERY ); + OSL_ENSURE( xUsedServiceManager.is() , + "serviceManager - " + "Cannot get interface of \"XMultiComponentFactory\" from service \"StarOffice.ServiceManager\"" ) ; + + Reference< XPropertySet > xPropSet( xUsedServiceManager , UNO_QUERY ) ; + OSL_ENSURE( xPropSet.is() , + "serviceManager - " + "Cannot get interface of \"XPropertySet\" from service \"StarOffice.ServiceManager\"" ) ; + + xPropSet->getPropertyValue( OUString::createFromAscii( "DefaultContext" ) ) >>= xUsedComponentContext ; + OSL_ENSURE( xUsedComponentContext.is() , + "serviceManager - " + "Cannot create remote component context" ) ; + + ********************************************************************/ + + /*- + * Method 2: with Componnent context + ******************************************************************** + Reference< XPropertySet > xPropSet( initialObject , UNO_QUERY ) ; + OSL_ENSURE( xPropSet.is() , + "serviceManager - " + "Cannot get interface of \"XPropertySet\" from URL resolver" ) ; + + xPropSet->getPropertyValue( OUString::createFromAscii( "DefaultContext" ) ) >>= xUsedComponentContext ; + OSL_ENSURE( xUsedComponentContext.is() , + "serviceManager - " + "Cannot create remote component context" ) ; + + xUsedServiceManager = xUsedComponentContext->getServiceManager(); + OSL_ENSURE( xUsedServiceManager.is() , + "serviceManager - " + "Cannot create remote service manager" ) ; + ********************************************************************/ + + /*- + * Method 3: with Service Manager + ********************************************************************/ + xUsedServiceManager = Reference< XMultiComponentFactory >( initialObject , UNO_QUERY ); + OSL_ENSURE( xUsedServiceManager.is() , + "serviceManager - " + "Cannot create remote service manager" ) ; + + Reference< XPropertySet > xPropSet( xUsedServiceManager , UNO_QUERY ) ; + OSL_ENSURE( xPropSet.is() , + "serviceManager - " + "Cannot get interface of \"XPropertySet\" from service \"StarOffice.ServiceManager\"" ) ; + + xPropSet->getPropertyValue( OUString::createFromAscii( "DefaultContext" ) ) >>= xUsedComponentContext ; + OSL_ENSURE( xUsedComponentContext.is() , + "serviceManager - " + "Cannot create remote component context" ) ; + /********************************************************************/ + } + + xContext = xUsedComponentContext ; + return xUsedServiceManager ; +} + +char* PriPK11PasswordFunc( + PK11SlotInfo *slot , + PRBool retry , + void* arg +) { + char* passwd = NULL ; + + if( retry != PR_TRUE ) { + passwd = ( char* )PORT_Alloc( 20 ) ; + printf( "Input Password:\n" ) ; + scanf( "%s" , passwd ) ; + printf( "The passwod is [%s]\n" , passwd ) ; + } + + return passwd ; +} + diff --git a/xmlsecurity/tools/standalone/csfit/helper.hxx b/xmlsecurity/tools/standalone/csfit/helper.hxx new file mode 100644 index 000000000000..14a116444b63 --- /dev/null +++ b/xmlsecurity/tools/standalone/csfit/helper.hxx @@ -0,0 +1,241 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include <stdio.h> +/*#include <libxml/xmlstring.h> +*/ + +#include <rtl/ustring.hxx> +#include <pk11func.h> + +#include <cppuhelper/bootstrap.hxx> +#include <cppuhelper/implbase1.hxx> +#include <cppuhelper/servicefactory.hxx> +#include <ucbhelper/contentbroker.hxx> +#include <ucbhelper/configurationkeys.hxx> + +#include <com/sun/star/lang/XComponent.hpp> +#include <com/sun/star/bridge/XUnoUrlResolver.hpp> +#include <com/sun/star/registry/XImplementationRegistration.hpp> +#include <com/sun/star/document/XFilter.hpp> +#include <com/sun/star/document/XExporter.hpp> +#include <com/sun/star/document/XImporter.hpp> +#include <com/sun/star/io/XInputStream.hpp> +#include <com/sun/star/io/XOutputStream.hpp> +#include <com/sun/star/io/XActiveDataSource.hpp> +#include <com/sun/star/beans/PropertyValue.hpp> +#include <com/sun/star/beans/XPropertySet.hpp> +#include <com/sun/star/ucb/XSimpleFileAccess.hpp> + +#include <com/sun/star/xml/crypto/XUriBinding.hpp> +#include <com/sun/star/xml/wrapper/XXMLDocumentWrapper.hpp> +#include <com/sun/star/xml/wrapper/XXMLElementWrapper.hpp> + +#include <com/sun/star/xml/sax/XParser.hpp> +#include <com/sun/star/xml/sax/XDocumentHandler.hpp> +#include <com/sun/star/xml/sax/XExtendedDocumentHandler.hpp> +#include <com/sun/star/xml/sax/InputSource.hpp> +#include <com/sun/star/io/XInputStream.hpp> +#include <com/sun/star/io/XOutputStream.hpp> +#include <com/sun/star/uno/XNamingService.hpp> + +using namespace ::rtl ; +using namespace ::cppu ; +using namespace ::com::sun::star ; +using namespace ::com::sun::star::uno ; +using namespace ::com::sun::star::io ; +using namespace ::com::sun::star::ucb ; +using namespace ::com::sun::star::beans ; +using namespace ::com::sun::star::document ; +using namespace ::com::sun::star::lang ; +using namespace ::com::sun::star::bridge ; +using namespace ::com::sun::star::registry ; +using namespace ::com::sun::star::task ; +using namespace ::com::sun::star::xml ; +using namespace ::com::sun::star::xml::wrapper ; +using namespace ::com::sun::star::xml::sax ; + + +/** + * Helper: Implementation of XInputStream + */ +class OInputStream : public WeakImplHelper1 < XInputStream > +{ + public: + OInputStream( const Sequence< sal_Int8 >&seq ) : m_seq( seq ), nPos( 0 ) {} + + virtual sal_Int32 SAL_CALL readBytes( + Sequence< sal_Int8 >& aData , + sal_Int32 nBytesToRead + ) throw( NotConnectedException, BufferSizeExceededException, IOException, RuntimeException ) + { + nBytesToRead = ( nBytesToRead > m_seq.getLength() - nPos ) ? + m_seq.getLength() - nPos : + nBytesToRead ; + aData = Sequence< sal_Int8 > ( &( m_seq.getConstArray()[nPos] ), nBytesToRead ) ; + nPos += nBytesToRead ; + return nBytesToRead ; + } + + virtual sal_Int32 SAL_CALL readSomeBytes( + ::com::sun::star::uno::Sequence< sal_Int8 >& aData , + sal_Int32 nMaxBytesToRead + ) throw( NotConnectedException, BufferSizeExceededException, IOException, RuntimeException ) + { + return readBytes( aData, nMaxBytesToRead ) ; + } + + virtual void SAL_CALL skipBytes( + sal_Int32 nBytesToSkip + ) throw( NotConnectedException, BufferSizeExceededException, IOException, RuntimeException ) + { + // not implemented + } + + virtual sal_Int32 SAL_CALL available( + void + ) throw( NotConnectedException, IOException, RuntimeException ) + { + return m_seq.getLength() - nPos ; + } + + virtual void SAL_CALL closeInput( + void + ) throw( NotConnectedException, IOException, RuntimeException ) + { + // not needed + } + + private: + sal_Int32 nPos; + Sequence< sal_Int8> m_seq; +} ; + +/** + * Helper : create a input stream from a file + */ +Reference< XInputStream > createStreamFromFile( const OUString sFile ) ; + +/** + * Helper: Implementation of XOutputStream + */ +class OOutputStream : public WeakImplHelper1 < XOutputStream > +{ + public: + OOutputStream( const char *pcFile ) { + strcpy( m_pcFile , pcFile ) ; + m_f = 0 ; + } + + virtual void SAL_CALL writeBytes( + const Sequence< sal_Int8 >& aData + ) throw( NotConnectedException , BufferSizeExceededException , RuntimeException ) { + if( !m_f ) { + m_f = fopen( m_pcFile , "w" ) ; + } + + fwrite( aData.getConstArray() , 1 , aData.getLength() , m_f ) ; + } + + virtual void SAL_CALL flush( + void + ) throw( NotConnectedException , BufferSizeExceededException , RuntimeException ) { + fflush( m_f ) ; + } + + virtual void SAL_CALL closeOutput( + void + ) throw( NotConnectedException , BufferSizeExceededException , RuntimeException ) { + fclose( m_f ) ; + m_f = 0 ; + } + + private: + char m_pcFile[256]; + FILE *m_f; +} ; + +/** + * Helper: Implementation of XUriBinding + */ +class OUriBinding : public WeakImplHelper1 < ::com::sun::star::xml::crypto::XUriBinding > +{ + public: + OUriBinding() { + //Do nothing + } + + OUriBinding( + ::rtl::OUString& aUri, + ::com::sun::star::uno::Reference< com::sun::star::io::XInputStream >& aInputStream ) { + m_vUris.push_back( aUri ) ; + m_vStreams.push_back( aInputStream ) ; + } + + virtual void SAL_CALL setUriBinding( + const ::rtl::OUString& aUri , + const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& aInputStream + ) throw( ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException ) { + m_vUris.push_back( aUri ) ; + m_vStreams.push_back( aInputStream ) ; + } + + virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SAL_CALL getUriBinding( const ::rtl::OUString& uri ) throw( ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException ) { + ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > xInputStream ; + + int size = m_vUris.size() ; + for( int i = 0 ; i<size ; ++i ) { + if( uri == m_vUris[i] ) { + xInputStream = m_vStreams[i]; + break; + } + } + + return xInputStream; + } + + private: + std::vector< ::rtl::OUString > m_vUris ; + std::vector< ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > > m_vStreams ; +} ; + +/** + * Helper : set a output stream to a file + */ +Reference< XOutputStream > createStreamToFile( const OUString sFile ) ; + +/** + * Helper : get service manager and context + */ +Reference< XMultiComponentFactory > serviceManager( Reference< XComponentContext >& xContext , OUString sUnoUrl , OUString sRdbUrl ) throw( RuntimeException , Exception ) ; + +/** + * Helper : Get password function for PKCS11 slot + */ +char* PriPK11PasswordFunc( PK11SlotInfo *slot , PRBool retry , void* arg ) ; + + diff --git a/xmlsecurity/tools/standalone/csfit/makefile.mk b/xmlsecurity/tools/standalone/csfit/makefile.mk new file mode 100644 index 000000000000..36efa47ff648 --- /dev/null +++ b/xmlsecurity/tools/standalone/csfit/makefile.mk @@ -0,0 +1,155 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2000, 2010 Oracle and/or its affiliates. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# This file is part of OpenOffice.org. +# +# OpenOffice.org is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License version 3 +# only, as published by the Free Software Foundation. +# +# OpenOffice.org is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License version 3 for more details +# (a copy is included in the LICENSE file that accompanied this code). +# +# You should have received a copy of the GNU Lesser General Public License +# version 3 along with OpenOffice.org. If not, see +# <http://www.openoffice.org/license.html> +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +PRJ=..$/..$/.. + +PRJNAME=xmlsecurity +TARGET=xmlsecurity-cxsfit +ENABLE_EXCEPTIONS=TRUE +NO_BSYMBOLIC=TRUE +TARGETTYPE=CUI +LIBTARGET=NO + +# --- Settings ----------------------------------------------------- + +.INCLUDE : settings.mk +.INCLUDE : $(PRJ)$/util$/target.pmk + + +.IF "$(CRYPTO_ENGINE)" == "nss" + +MOZ_INC = $(SOLARVERSION)$/$(INPATH)$/inc$(UPDMINOREXT)$/mozilla +NSS_INC = $(MOZ_INC)$/nss +NSPR_INC = $(MOZ_INC)$/nspr + +CDEFS += -DXMLSEC_CRYPTO_NSS -DXMLSEC_NO_XSLT +SOLARINC += \ + -I$(MOZ_INC) \ + -I$(NSPR_INC) \ + -I$(NSS_INC) \ + -I$(PRJ)$/source$/xmlsec \ + -I$(PRJ)$/source$/xmlsec$/nss + +# --- Files -------------------------------------------------------- + +SHARE_LIBS = \ + $(CPPULIB) \ + $(CPPUHELPERLIB) \ + $(SALHELPERLIB) \ + $(SALLIB) + +.IF "$(GUI)"=="WNT" +SHARE_LIBS+= "ixml2.lib" "nss3.lib" "nspr4.lib" "libxmlsec.lib" "libxmlsec-nss.lib" "xsec_xmlsec.lib" +.ELSE +SHARE_LIBS+= "-lxml2" "-lnss3" "-lnspr4" "-lxmlsec1" "-lxmlsec1-nss" "-lxsec_xmlsec" +.ENDIF + +SHARE_OBJS = \ + $(OBJ)$/helper.obj + +# +# The 1st application +# + +APP2TARGET= signer +APP2OBJS= \ + $(SHARE_OBJS) \ + $(OBJ)$/signer.obj + +.IF "$(OS)" == "LINUX" +APP2STDLIBS+= -lstdc++ +.ENDIF + +APP2STDLIBS+= \ + $(SHARE_LIBS) + +# +# The 2nd application +# +APP3TARGET= encrypter +APP3OBJS= \ + $(SHARE_OBJS) \ + $(OBJ)$/encrypter.obj + +.IF "$(OS)" == "LINUX" +APP3STDLIBS+= -lstdc++ +.ENDIF + +APP3STDLIBS+= \ + $(SHARE_LIBS) + +# +# The 3rd application +# +APP4TARGET= verifier +APP4OBJS= \ + $(SHARE_OBJS) \ + $(OBJ)$/verifier.obj + +.IF "$(OS)" == "LINUX" +APP4STDLIBS+= -lstdc++ +.ENDIF + +APP4STDLIBS+= \ + $(SHARE_LIBS) + +# +# The 4th application +# +APP5TARGET= decrypter +APP5OBJS= \ + $(SHARE_OBJS) \ + $(OBJ)$/decrypter.obj + +.IF "$(OS)" == "LINUX" +APP5STDLIBS+= -lstdc++ +.ENDIF + +APP5STDLIBS+= \ + $(SHARE_LIBS) + +# +# The 5th application +# +APP6TARGET= certmngr +APP6OBJS= \ + $(SHARE_OBJS) \ + $(OBJ)$/certmngr.obj + +.IF "$(OS)" == "LINUX" +APP6STDLIBS+= -lstdc++ +.ENDIF + +APP6STDLIBS+= \ + $(SHARE_LIBS) + +.ENDIF + +# --- Targets ------------------------------------------------------ + +.INCLUDE : target.mk + diff --git a/xmlsecurity/tools/standalone/csfit/signer.cxx b/xmlsecurity/tools/standalone/csfit/signer.cxx new file mode 100644 index 000000000000..689b86ea369c --- /dev/null +++ b/xmlsecurity/tools/standalone/csfit/signer.cxx @@ -0,0 +1,370 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_xmlsecurity.hxx" + +#include <stdio.h> +#include "helper.hxx" + +#include "libxml/tree.h" +#include "libxml/parser.h" +#ifndef XMLSEC_NO_XSLT +#include "libxslt/xslt.h" +#endif + +#include "securityenvironment_nssimpl.hxx" +#include "xmlelementwrapper_xmlsecimpl.hxx" + +#include "nspr.h" +#include "prtypes.h" + +#include "pk11func.h" +#include "cert.h" +#include "cryptohi.h" +#include "certdb.h" +#include "nss.h" + +#include "xmlsec/strings.h" +#include "xmlsec/xmltree.h" + +#include <rtl/ustring.hxx> + +#include <com/sun/star/beans/PropertyValue.hpp> +#include <com/sun/star/xml/wrapper/XXMLElementWrapper.hpp> +#include <com/sun/star/xml/wrapper/XXMLDocumentWrapper.hpp> +#include <com/sun/star/xml/crypto/XXMLSignature.hpp> +#include <com/sun/star/xml/crypto/XXMLSignatureTemplate.hpp> +#include <com/sun/star/xml/crypto/XXMLSecurityContext.hpp> +#include <com/sun/star/xml/crypto/XSecurityEnvironment.hpp> + +using namespace ::rtl ; +using namespace ::cppu ; +using namespace ::com::sun::star::uno ; +using namespace ::com::sun::star::io ; +using namespace ::com::sun::star::ucb ; +using namespace ::com::sun::star::beans ; +using namespace ::com::sun::star::document ; +using namespace ::com::sun::star::lang ; +using namespace ::com::sun::star::xml::wrapper ; +using namespace ::com::sun::star::xml::crypto ; + + +int SAL_CALL main( int argc, char **argv ) +{ + CERTCertDBHandle* certHandle ; + PK11SlotInfo* slot ; + xmlDocPtr doc ; + xmlNodePtr tplNode ; + xmlNodePtr tarNode ; + xmlAttrPtr idAttr ; + xmlChar* idValue ; + xmlAttrPtr uriAttr ; + xmlChar* uriValue ; + OUString* uri ; + Reference< XUriBinding > xUriBinding ; + FILE* dstFile ; + + if( argc != 5 ) { + fprintf( stderr, "Usage: %s < CertDir > <file_url of template> <file_url of result> <rdb file>\n\n" , argv[0] ) ; + return 1 ; + } + + for( int hhh = 0 ; hhh < 10 ; hhh ++ ) { + slot = NULL ; + doc = NULL ; + uri = NULL ; + dstFile = NULL ; + + + //Init libxml and libxslt libraries + xmlInitParser(); + LIBXML_TEST_VERSION + xmlLoadExtDtdDefaultValue = XML_DETECT_IDS | XML_COMPLETE_ATTRS; + xmlSubstituteEntitiesDefault(1); + + #ifndef XMLSEC_NO_XSLT + xmlIndentTreeOutput = 1; + #endif // XMLSEC_NO_XSLT + + + //Initialize NSPR and NSS + PR_Init( PR_SYSTEM_THREAD, PR_PRIORITY_NORMAL, 1 ) ; + PK11_SetPasswordFunc( PriPK11PasswordFunc ) ; + if( NSS_Init( argv[1] ) != SECSuccess ) { + fprintf( stderr , "### cannot intialize NSS!\n" ) ; + goto done ; + } + + certHandle = CERT_GetDefaultCertDB() ; + slot = PK11_GetInternalKeySlot() ; + + if( PK11_NeedLogin( slot ) ) { + SECStatus nRet = PK11_Authenticate( slot, PR_TRUE, NULL ); + if( nRet != SECSuccess ) { + fprintf( stderr , "### cannot authehticate the crypto token!\n" ) ; + goto done ; + } + } + + //Load XML document + doc = xmlParseFile( argv[2] ) ; + if( doc == NULL || xmlDocGetRootElement( doc ) == NULL ) { + fprintf( stderr , "### Cannot load template xml document!\n" ) ; + goto done ; + } + + //Find the signature template + tplNode = xmlSecFindNode( xmlDocGetRootElement( doc ), xmlSecNodeSignature, xmlSecDSigNs ) ; + if( tplNode == NULL ) { + fprintf( stderr , "### Cannot find the signature template!\n" ) ; + goto done ; + } + + //Find the element with ID attribute + //Here we only try to find the "document" node. + tarNode = xmlSecFindNode( xmlDocGetRootElement( doc ), ( xmlChar* )"document", ( xmlChar* )"http://openoffice.org/2000/office" ) ; + if( tarNode == NULL ) { + tarNode = xmlSecFindNode( xmlDocGetRootElement( doc ), ( xmlChar* )"document", NULL ) ; + } + + //Find the "id" attrbute in the element + if( tarNode != NULL ) { + if( ( idAttr = xmlHasProp( tarNode, ( xmlChar* )"id" ) ) != NULL ) { + //NULL + } else if( ( idAttr = xmlHasProp( tarNode, ( xmlChar* )"Id" ) ) != NULL ) { + //NULL + } else { + idAttr = NULL ; + } + } + + //Add ID to DOM + if( idAttr != NULL ) { + idValue = xmlNodeListGetString( tarNode->doc, idAttr->children, 1 ) ; + if( idValue == NULL ) { + fprintf( stderr , "### the ID value is NULL!\n" ) ; + goto done ; + } + + if( xmlAddID( NULL, doc, idValue, idAttr ) == NULL ) { + fprintf( stderr , "### Can not add the ID value!\n" ) ; + goto done ; + } + } + + //Reference handler + //Find the signature reference + tarNode = xmlSecFindNode( tplNode, xmlSecNodeReference, xmlSecDSigNs ) ; + if( tarNode == NULL ) { + fprintf( stderr , "### Cannot find the signature reference!\n" ) ; + goto done ; + } + + //Find the "URI" attrbute in the reference + uriAttr = xmlHasProp( tarNode, ( xmlChar* )"URI" ) ; + if( tarNode == NULL ) { + fprintf( stderr , "### Cannot find URI of the reference!\n" ) ; + goto done ; + } + + //Get the "URI" attrbute value + uriValue = xmlNodeListGetString( tarNode->doc, uriAttr->children, 1 ) ; + if( uriValue == NULL ) { + fprintf( stderr , "### the URI value is NULL!\n" ) ; + goto done ; + } + + if( strchr( ( const char* )uriValue, '/' ) != NULL && strchr( ( const char* )uriValue, '#' ) == NULL ) { + fprintf( stdout , "### Find a stream URI [%s]\n", uriValue ) ; + // uri = new ::rtl::OUString( ( const sal_Unicode* )uriValue ) ; + uri = new ::rtl::OUString( ( const sal_Char* )uriValue, xmlStrlen( uriValue ), RTL_TEXTENCODING_ASCII_US ) ; + } + + if( uri != NULL ) { + fprintf( stdout , "### Find the URI [%s]\n", OUStringToOString( *uri , RTL_TEXTENCODING_ASCII_US ).getStr() ) ; + Reference< XInputStream > xStream = createStreamFromFile( *uri ) ; + if( !xStream.is() ) { + fprintf( stderr , "### Can not get the URI stream!\n" ) ; + goto done ; + } + + xUriBinding = new OUriBinding( *uri, xStream ) ; + } + + try { + Reference< XMultiComponentFactory > xManager = NULL ; + Reference< XComponentContext > xContext = NULL ; + + xManager = serviceManager( xContext , OUString::createFromAscii( "local" ), OUString::createFromAscii( argv[4] ) ) ; + OSL_ENSURE( xManager.is() , + "ServicesManager - " + "Cannot get service manager" ) ; + + //Create signature template + Reference< XInterface > element = + xManager->createInstanceWithContext( OUString::createFromAscii( "com.sun.star.xml.security.bridge.xmlsec.XMLElementWrapper_XmlSecImpl" ) , xContext ) ; + OSL_ENSURE( element.is() , + "Signer - " + "Cannot get service instance of \"wrapper.XMLElementWrapper\"" ) ; + + Reference< XXMLElementWrapper > xElement( element , UNO_QUERY ) ; + OSL_ENSURE( xElement.is() , + "Signer - " + "Cannot get interface of \"XXMLElement\" from service \"xsec.XMLElement\"" ) ; + + Reference< XUnoTunnel > xEleTunnel( xElement , UNO_QUERY ) ; + OSL_ENSURE( xEleTunnel.is() , + "Signer - " + "Cannot get interface of \"XUnoTunnel\" from service \"xsec.XMLElement\"" ) ; + + XMLElementWrapper_XmlSecImpl* pElement = ( XMLElementWrapper_XmlSecImpl* )xEleTunnel->getSomething( XMLElementWrapper_XmlSecImpl::getUnoTunnelImplementationId() ) ; + OSL_ENSURE( pElement != NULL , + "Signer - " + "Cannot get implementation of \"xsec.XMLElement\"" ) ; + + //Set signature template + pElement->setNativeElement( tplNode ) ; + + //Build XML Signature template + Reference< XInterface > signtpl = + xManager->createInstanceWithContext( OUString::createFromAscii( "com.sun.star.xml.crypto.XMLSignatureTemplate" ) , xContext ) ; + OSL_ENSURE( signtpl.is() , + "Signer - " + "Cannot get service instance of \"xsec.XMLSignatureTemplate\"" ) ; + + Reference< XXMLSignatureTemplate > xTemplate( signtpl , UNO_QUERY ) ; + OSL_ENSURE( xTemplate.is() , + "Signer - " + "Cannot get interface of \"XXMLSignatureTemplate\" from service \"xsec.XMLSignatureTemplate\"" ) ; + + //Import the signature template + xTemplate->setTemplate( xElement ) ; + + //Import the URI/Stream binding + if( xUriBinding.is() ) + xTemplate->setBinding( xUriBinding ) ; + + //Create security environment + //Build Security Environment + Reference< XInterface > xsecenv = + xManager->createInstanceWithContext( OUString::createFromAscii("com.sun.star.xml.security.bridge.xmlsec.SecurityEnvironment_NssImpl"), xContext ) ; + OSL_ENSURE( xsecenv.is() , + "Signer - " + "Cannot get service instance of \"xsec.SecurityEnvironment\"" ) ; + + Reference< XSecurityEnvironment > xSecEnv( xsecenv , UNO_QUERY ) ; + OSL_ENSURE( xSecEnv.is() , + "Signer - " + "Cannot get interface of \"XSecurityEnvironment\" from service \"xsec.SecurityEnvironment\"" ) ; + + //Setup key slot and certDb + Reference< XUnoTunnel > xEnvTunnel( xsecenv , UNO_QUERY ) ; + OSL_ENSURE( xElement.is() , + "Signer - " + "Cannot get interface of \"XUnoTunnel\" from service \"xsec.SecurityEnvironment\"" ) ; + + SecurityEnvironment_NssImpl* pSecEnv = ( SecurityEnvironment_NssImpl* )xEnvTunnel->getSomething( SecurityEnvironment_NssImpl::getUnoTunnelId() ) ; + OSL_ENSURE( pSecEnv != NULL , + "Signer - " + "Cannot get implementation of \"xsec.SecurityEnvironment\"" ) ; + + pSecEnv->setCryptoSlot( slot ) ; + pSecEnv->setCertDb( certHandle ) ; + + //Build XML Security Context + Reference< XInterface > xmlsecctx = + xManager->createInstanceWithContext( OUString::createFromAscii("com.sun.star.xml.security.bridge.xmlsec.XMLSecurityContext_NssImpl"), xContext ) ; + OSL_ENSURE( xsecenv.is() , + "Signer - " + "Cannot get service instance of \"xsec.XMLSecurityContext\"" ) ; + + Reference< XXMLSecurityContext > xSecCtx( xmlsecctx , UNO_QUERY ) ; + OSL_ENSURE( xSecCtx.is() , + "Signer - " + "Cannot get interface of \"XXMLSecurityContext\" from service \"xsec.XMLSecurityContext\"" ) ; + + xSecCtx->setSecurityEnvironment( xSecEnv ) ; + + //Generate XML signature + Reference< XInterface > xmlsigner = + xManager->createInstanceWithContext( OUString::createFromAscii("com.sun.star.xml.security.bridge.xmlsec.XMLSignature_NssImpl"), xContext ) ; + OSL_ENSURE( xmlsigner.is() , + "Signer - " + "Cannot get service instance of \"xsec.XMLSignature\"" ) ; + + Reference< XXMLSignature > xSigner( xmlsigner , UNO_QUERY ) ; + OSL_ENSURE( xSigner.is() , + "Signer - " + "Cannot get interface of \"XXMLSignature\" from service \"xsec.XMLSignature\"" ) ; + + //perform signature + xTemplate = xSigner->generate( xTemplate , xSecCtx ) ; + OSL_ENSURE( xTemplate.is() , + "Signer - " + "Cannot generate the xml signature" ) ; + } catch( Exception& e ) { + fprintf( stderr , "Error Message: %s\n" , OUStringToOString( e.Message , RTL_TEXTENCODING_ASCII_US ).getStr() ) ; + goto done ; + } + + dstFile = fopen( argv[3], "w" ) ; + if( dstFile == NULL ) { + fprintf( stderr , "### Can not open file %s\n", argv[3] ) ; + goto done ; + } + + //Save result + xmlDocDump( dstFile, doc ) ; + +done: + if( uri != NULL ) + delete uri ; + + if( dstFile != NULL ) + fclose( dstFile ) ; + + if( doc != NULL ) + xmlFreeDoc( doc ) ; + + if( slot != NULL ) + PK11_FreeSlot( slot ) ; + + PK11_LogoutAll() ; + NSS_Shutdown() ; + + /* Shutdown libxslt/libxml */ + #ifndef XMLSEC_NO_XSLT + xsltCleanupGlobals(); + #endif /* XMLSEC_NO_XSLT */ + xmlCleanupParser(); + + } + + return 0; +} + diff --git a/xmlsecurity/tools/standalone/csfit/util/makefile.mk b/xmlsecurity/tools/standalone/csfit/util/makefile.mk new file mode 100644 index 000000000000..ee030fd35320 --- /dev/null +++ b/xmlsecurity/tools/standalone/csfit/util/makefile.mk @@ -0,0 +1,174 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2000, 2010 Oracle and/or its affiliates. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# This file is part of OpenOffice.org. +# +# OpenOffice.org is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License version 3 +# only, as published by the Free Software Foundation. +# +# OpenOffice.org is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License version 3 for more details +# (a copy is included in the LICENSE file that accompanied this code). +# +# You should have received a copy of the GNU Lesser General Public License +# version 3 along with OpenOffice.org. If not, see +# <http://www.openoffice.org/license.html> +# for a copy of the LGPLv3 License. +# +#************************************************************************* +PRJ=..$/..$/..$/.. + +PRJNAME=xmlsecurity +TARGET=xmlsecurity-secfit-boot +TARGETTYPE=GUI + +GEN_HID=TRUE +APP2NOSAL=TRUE + +# --- Settings ----------------------------------------------------------- +USE_JAVAVER=TRUE + +.INCLUDE : settings.mk + +VERINFONAME=verinfo + +.INCLUDE : target.mk +.INCLUDE : $(PRJ)$/util$/target.pmk + +# ------------------------------------------------------------------------- +# --- Targets ------------------------------------------------------------- + +ALLTAR : $(BIN)$/boot_services.rdb + +REGISTERLIBS= \ + i18npool.uno$(DLLPOST) \ + $(DLLPRE)tk$(DLLPOSTFIX)$(DLLPOST) \ + $(DLLPRE)mcnttype$(DLLPOST) + +# $(DLLPRE)i18n$(DLLPOSTFIX)$(DLLPOST) \ +# $(DLLPRE)i18npool$(DLLPOSTFIX)$(DLLPOST) \ +# $(DLLPRE)tk$(DLLPOSTFIX)$(DLLPOST) \ +# $(DLLPRE)mcnttype$(DLLPOST) + +# Additional libraries +DLLPRE_NO= +REGISTERLIBS+= \ + $(DLLPRE_NO)dynamicloader.uno$(DLLPOST) \ + $(DLLPRE_NO)namingservice.uno$(DLLPOST) \ + $(DLLPRE_NO)bootstrap.uno$(DLLPOST) \ + $(DLLPRE)xsec_fw$(DLLPOST) \ + $(DLLPRE)xsec_xmlsec$(DLLPOST) + +.IF "$(GUI)" == "UNX" +MY_DLLDIR=$(SOLARLIBDIR) +REGISTERLIBS+= \ + $(DLLPRE)dtransX11$(DLLPOSTFIX)$(DLLPOST) + +.ELSE # "$(GUI)" == "UNX" +.IF "$(GUI)"=="WNT" + +MY_DLLDIR=$(SOLARBINDIR) +REGISTERLIBS+= \ + $(DLLPRE)sysdtrans$(DLLPOST) \ + $(DLLPRE)ftransl$(DLLPOST) \ + $(DLLPRE)dnd$(DLLPOST) + +.ELSE # "$(GUI)"=="WNT" + + @echo "**********************************************************" + @echo "*** unknown platform: don't know which librarys to use ***" + @echo "**********************************************************" + force_dmake_to_error +.ENDIF # "$(GUI)"=="WNT" +.ENDIF # "$(GUI)" == "UNX" + +.IF "$(SOLAR_JAVA)" != "" +.IF "$(JAVANUMVER)" >= "000100040000" +# native libraries, which are only necessary, when java shall run within setup +REGISTERLIBS_JAVA= \ + javavm.uno$(DLLPOST) \ + javaloader.uno$(DLLPOST) + +# add here java components, which shall run with setup +REGISTERJARS=\ + java_uno_accessbridge.jar +# xsec_jxsec.jar + +# jar-files, which regcomp needs so that it can use java +REGCOMP_JARS=unoil.jar java_uno.jar ridl.jar jurt.jar juh.jar + +# CLASSPATH, which regcomp needs to be run +# $(SOLARLIBDIR) needs to be included in case Java components are registered, +# because java_uno.jar needs to find the native java_uno shared library: +MY_CLASSPATH_TMP=$(foreach,i,$(REGCOMP_JARS) $(SOLARBINDIR)$/$i)$(PATH_SEPERATOR)$(SOLARLIBDIR)$(PATH_SEPERATOR)$(XCLASSPATH) +REGCOMP_CLASSPATH=$(strip $(subst,!,$(PATH_SEPERATOR) $(MY_CLASSPATH_TMP:s/ /!/))) + +.IF "$(GUI)"!="WNT" +DOLLAR_SIGN=\$$ +MY_JAVA_COMPPATH=file://$(SOLARBINDIR) +.IF "$(OS)"=="MACOSX" +REGCOMP_ENV=\ + setenv CLASSPATH $(REGCOMP_CLASSPATH) && \ + setenv DYLD_LIBRARY_PATH $(DYLD_LIBRARY_PATH):$(JDKLIB) +.ELSE +REGCOMP_ENV=\ + setenv CLASSPATH $(REGCOMP_CLASSPATH) && \ + setenv LD_LIBRARY_PATH $(LD_LIBRARY_PATH):$(JDKLIB) +.ENDIF +.ELSE # "$(GUI)" != "WNT" +.IF "$(USE_SHELL)" != "4nt" +DOLLAR_SIGN=\$$ +REGCOMP_ENV=\ + setenv CLASSPATH "$(strip $(subst,\,/ $(shell @guw.pl echo $(REGCOMP_CLASSPATH))))" && \ + setenv PATH "$(PATH):$(JREPATH)" +MY_JAVA_COMPPATH=$(strip $(subst,\,/ file:///$(shell @guw.pl echo $(SOLARBINDIR)))) +.ELSE # "$(USE_SHELL)" != "4nt" +DOLLAR_SIGN=$$ +REGCOMP_ENV=\ + set CLASSPATH=$(REGCOMP_CLASSPATH) && \ + set PATH=$(PATH);$(JREPATH) +MY_JAVA_COMPPATH=$(strip $(subst,\,/ file:///$(SOLARBINDIR))) +.ENDIF # "$(USE_SHELL)" != "4nt" +.ENDIF # "$(GUI)"!="WNT" +.ENDIF # "$(JAVANUMVER)" >= "000100040000" +.ENDIF # "$(SOLAR_JAVA)" != "" + +$(BIN)$/boot_services.rdb: \ + makefile.mk \ + $(foreach,i,$(REGISTERLIBS) $(MY_DLLDIR)$/$(i)) \ + $(foreach,i,$(REGISTERLIBS_JAVA) $(MY_DLLDIR)$/$(i)) + -rm -f $@ $(BIN)$/regcomp.rdb $(BIN)$/boot_services.tmp +# register the native libraries + $(REGCOMP) -register -r $(BIN)$/boot_services.tmp -c "$(strip $(REGISTERLIBS))" +.IF "$(SOLAR_JAVA)" != "" +.IF "$(OS)"!="MACOSX" +.IF "$(JAVANUMVER)" >= "000100040000" + $(REGCOMP) -register -r $(BIN)$/boot_services.tmp -c "$(strip $(REGISTERLIBS_JAVA))" +# prepare a registry which regcomp can work on (types+java services) + $(REGCOMP) -register -r $(BIN)$/regcomp.rdb -c "$(strip $(REGISTERLIBS_JAVA))" + $(REGMERGE) $(BIN)$/regcomp.rdb / $(SOLARBINDIR)/udkapi.rdb +# now do the registration + $(REGCOMP_ENV) && \ + $(REGCOMP) -br $(BIN)$/regcomp.rdb \ + -register \ + -r $(BIN)$/boot_services.tmp \ + -l com.sun.star.loader.Java2 \ + -env:UNO_JAVA_COMPPATH=$(MY_JAVA_COMPPATH) \ + $(foreach,i,$(REGISTERJARS) -c vnd.sun.star.expand:$(DOLLAR_SIGN)UNO_JAVA_COMPPATH/$(i)) +# $(foreach,i,$(REGISTERJARS) -c vnd.sun.star.expand:$(DOLLAR_SIGN)UNO_JAVA_COMPPATH/$(i)) -c $(MY_JAVA_COMPPATH)$/xsec_jxsec.jar + +.ENDIF # "$(JAVANUMVER)" >= "000100040000" +.ENDIF # "$(OS)" != "MACOSX" +.ENDIF # "$(SOLAR_JAVA)" != "" +# to have a transaction, move it now to the final name + $(REGMERGE) $(BIN)$/boot_services.tmp / $(SOLARBINDIR)/types.rdb + mv $(BIN)$/boot_services.tmp $@ + diff --git a/xmlsecurity/tools/standalone/csfit/verifier.cxx b/xmlsecurity/tools/standalone/csfit/verifier.cxx new file mode 100644 index 000000000000..54eaaa926a46 --- /dev/null +++ b/xmlsecurity/tools/standalone/csfit/verifier.cxx @@ -0,0 +1,340 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_xmlsecurity.hxx" + +#include <stdio.h> +#include "helper.hxx" + +#include "libxml/tree.h" +#include "libxml/parser.h" +#ifndef XMLSEC_NO_XSLT +#include "libxslt/xslt.h" +#endif + +#include "securityenvironment_nssimpl.hxx" +#include "xmlelementwrapper_xmlsecimpl.hxx" + +#include "nspr.h" +#include "prtypes.h" + +#include "pk11func.h" +#include "cert.h" +#include "cryptohi.h" +#include "certdb.h" +#include "nss.h" + +#include "xmlsec/strings.h" +#include "xmlsec/xmltree.h" + +#include <rtl/ustring.hxx> +#include <cppuhelper/servicefactory.hxx> + +#include <com/sun/star/lang/XComponent.hpp> +#include <com/sun/star/beans/PropertyValue.hpp> +#include <com/sun/star/xml/wrapper/XXMLElementWrapper.hpp> +#include <com/sun/star/xml/wrapper/XXMLDocumentWrapper.hpp> +#include <com/sun/star/xml/crypto/XXMLSignature.hpp> +#include <com/sun/star/xml/crypto/XXMLSignatureTemplate.hpp> +#include <com/sun/star/xml/crypto/XXMLSecurityContext.hpp> +#include <com/sun/star/xml/crypto/XSecurityEnvironment.hpp> + +using namespace ::rtl ; +using namespace ::cppu ; +using namespace ::com::sun::star::uno ; +using namespace ::com::sun::star::io ; +using namespace ::com::sun::star::ucb ; +using namespace ::com::sun::star::beans ; +using namespace ::com::sun::star::document ; +using namespace ::com::sun::star::lang ; +using namespace ::com::sun::star::registry ; +using namespace ::com::sun::star::xml::wrapper ; +using namespace ::com::sun::star::xml::crypto ; + + +int SAL_CALL main( int argc, char **argv ) +{ + CERTCertDBHandle* certHandle = NULL ; + PK11SlotInfo* slot = NULL ; + xmlDocPtr doc = NULL ; + xmlNodePtr tplNode ; + xmlNodePtr tarNode ; + xmlAttrPtr idAttr ; + xmlChar* idValue ; + xmlAttrPtr uriAttr ; + xmlChar* uriValue ; + OUString* uri = NULL ; + Reference< XUriBinding > xUriBinding ; + + if( argc != 4 ) { + fprintf( stderr, "Usage: %s < CertDir > <file_url> <rdb file>\n" , argv[0] ) ; + return 1 ; + } + + //Init libxml and libxslt libraries + xmlInitParser(); + LIBXML_TEST_VERSION + xmlLoadExtDtdDefaultValue = XML_DETECT_IDS | XML_COMPLETE_ATTRS; + xmlSubstituteEntitiesDefault(1); + + #ifndef XMLSEC_NO_XSLT + xmlIndentTreeOutput = 1; + #endif // XMLSEC_NO_XSLT + + + //Initialize NSPR and NSS + PR_Init( PR_SYSTEM_THREAD, PR_PRIORITY_NORMAL, 1 ) ; + PK11_SetPasswordFunc( PriPK11PasswordFunc ) ; + if( NSS_Init( argv[1] ) != SECSuccess ) { + fprintf( stderr , "### cannot intialize NSS!\n" ) ; + return 1 ; + } + + certHandle = CERT_GetDefaultCertDB() ; + slot = PK11_GetInternalKeySlot() ; + + //Load XML document + doc = xmlParseFile( argv[2] ) ; + if( doc == NULL || xmlDocGetRootElement( doc ) == NULL ) { + fprintf( stderr , "### Cannot load template xml document!\n" ) ; + goto done ; + } + + //Find the signature template + tplNode = xmlSecFindNode( xmlDocGetRootElement( doc ), xmlSecNodeSignature, xmlSecDSigNs ) ; + if( tplNode == NULL ) { + fprintf( stderr , "### Cannot find the signature template!\n" ) ; + goto done ; + } + + //Find the element with ID attribute + tarNode = xmlSecFindNode( xmlDocGetRootElement( doc ), ( xmlChar* )"document", ( xmlChar* )"http://openoffice.org/2000/office" ) ; + if( tarNode == NULL ) { + tarNode = xmlSecFindNode( xmlDocGetRootElement( doc ), ( xmlChar* )"document", NULL ) ; + } + + //Find the "id" attrbute in the element + if( tarNode != NULL ) { + if( ( idAttr = xmlHasProp( tarNode, ( xmlChar* )"id" ) ) != NULL ) { + //NULL + } else if( ( idAttr = xmlHasProp( tarNode, ( xmlChar* )"Id" ) ) != NULL ) { + //NULL + } else { + idAttr = NULL ; + } + } + + //Add ID to DOM + if( idAttr != NULL ) { + idValue = xmlNodeListGetString( tarNode->doc, idAttr->children, 1 ) ; + if( idValue == NULL ) { + fprintf( stderr , "### the ID value is NULL!\n" ) ; + goto done ; + } + + if( xmlAddID( NULL, doc, idValue, idAttr ) == NULL ) { + fprintf( stderr , "### Can not add the ID value!\n" ) ; + goto done ; + } + } + + //Reference handler + //Find the signature reference + tarNode = xmlSecFindNode( tplNode, xmlSecNodeReference, xmlSecDSigNs ) ; + if( tarNode == NULL ) { + fprintf( stderr , "### Cannot find the signature reference!\n" ) ; + goto done ; + } + + //Find the "URI" attrbute in the reference + uriAttr = xmlHasProp( tarNode, ( xmlChar* )"URI" ) ; + if( tarNode == NULL ) { + fprintf( stderr , "### Cannot find URI of the reference!\n" ) ; + goto done ; + } + + //Get the "URI" attrbute value + uriValue = xmlNodeListGetString( tarNode->doc, uriAttr->children, 1 ) ; + if( uriValue == NULL ) { + fprintf( stderr , "### the URI value is NULL!\n" ) ; + goto done ; + } + + if( strchr( ( const char* )uriValue, '/' ) != NULL && strchr( ( const char* )uriValue, '#' ) == NULL ) { + fprintf( stdout , "### Find a stream URI [%s]\n", uriValue ) ; + // uri = new ::rtl::OUString( ( const sal_Unicode* )uriValue ) ; + uri = new ::rtl::OUString( ( const sal_Char* )uriValue, xmlStrlen( uriValue ), RTL_TEXTENCODING_ASCII_US ) ; + } + + if( uri != NULL ) { + fprintf( stdout , "### Find the URI [%s]\n", OUStringToOString( *uri , RTL_TEXTENCODING_ASCII_US ).getStr() ) ; + Reference< XInputStream > xStream = createStreamFromFile( *uri ) ; + if( !xStream.is() ) { + fprintf( stderr , "### Can not get the URI stream!\n" ) ; + goto done ; + } + + xUriBinding = new OUriBinding( *uri, xStream ) ; + } + + + try { + Reference< XMultiComponentFactory > xManager = NULL ; + Reference< XComponentContext > xContext = NULL ; + + xManager = serviceManager( xContext , OUString::createFromAscii( "local" ), OUString::createFromAscii( argv[3] ) ) ; + + //Create signature template + Reference< XInterface > element = + xManager->createInstanceWithContext( OUString::createFromAscii( "com.sun.star.xml.security.bridge.xmlsec.XMLElementWrapper_XmlSecImpl" ) , xContext ) ; + OSL_ENSURE( element.is() , + "Verifier - " + "Cannot get service instance of \"xsec.XMLElementWrapper\"" ) ; + + Reference< XXMLElementWrapper > xElement( element , UNO_QUERY ) ; + OSL_ENSURE( xElement.is() , + "Verifier - " + "Cannot get interface of \"XXMLElementWrapper\" from service \"xsec.XMLElementWrapper\"" ) ; + + Reference< XUnoTunnel > xEleTunnel( xElement , UNO_QUERY ) ; + OSL_ENSURE( xEleTunnel.is() , + "Verifier - " + "Cannot get interface of \"XUnoTunnel\" from service \"xsec.XMLElement\"" ) ; + + XMLElementWrapper_XmlSecImpl* pElement = ( XMLElementWrapper_XmlSecImpl* )xEleTunnel->getSomething( XMLElementWrapper_XmlSecImpl::getUnoTunnelImplementationId() ) ; + OSL_ENSURE( pElement != NULL , + "Verifier - " + "Cannot get implementation of \"xsec.XMLElementWrapper\"" ) ; + + //Set signature template + pElement->setNativeElement( tplNode ) ; + + //Build XML Signature template + Reference< XInterface > signtpl = + xManager->createInstanceWithContext( OUString::createFromAscii("com.sun.star.xml.crypto.XMLSignatureTemplate"), xContext ) ; + OSL_ENSURE( signtpl.is() , + "Verifier - " + "Cannot get service instance of \"xsec.XMLSignatureTemplate\"" ) ; + + Reference< XXMLSignatureTemplate > xTemplate( signtpl , UNO_QUERY ) ; + OSL_ENSURE( xTemplate.is() , + "Verifier - " + "Cannot get interface of \"XXMLSignatureTemplate\" from service \"xsec.XMLSignatureTemplate\"" ) ; + + //Import the signature template + xTemplate->setTemplate( xElement ) ; + + //Import the URI/Stream binding + if( xUriBinding.is() ) + xTemplate->setBinding( xUriBinding ) ; + + //Create security environment + //Build Security Environment + Reference< XInterface > xsecenv = + xManager->createInstanceWithContext( OUString::createFromAscii("com.sun.star.xml.security.bridge.xmlsec.SecurityEnvironment_NssImpl"), xContext ) ; + OSL_ENSURE( xsecenv.is() , + "Verifier - " + "Cannot get service instance of \"xsec.SecurityEnvironment\"" ) ; + + Reference< XSecurityEnvironment > xSecEnv( xsecenv , UNO_QUERY ) ; + OSL_ENSURE( xSecEnv.is() , + "Verifier - " + "Cannot get interface of \"XSecurityEnvironment\" from service \"xsec.SecurityEnvironment\"" ) ; + + //Setup key slot and certDb + Reference< XUnoTunnel > xEnvTunnel( xsecenv , UNO_QUERY ) ; + OSL_ENSURE( xElement.is() , + "Verifier - " + "Cannot get interface of \"XUnoTunnel\" from service \"xsec.SecurityEnvironment\"" ) ; + + SecurityEnvironment_NssImpl* pSecEnv = ( SecurityEnvironment_NssImpl* )xEnvTunnel->getSomething( SecurityEnvironment_NssImpl::getUnoTunnelId() ) ; + OSL_ENSURE( pSecEnv != NULL , + "Verifier - " + "Cannot get implementation of \"xsec.SecurityEnvironment\"" ) ; + + pSecEnv->setCryptoSlot( slot ) ; + pSecEnv->setCertDb( certHandle ) ; + + //Build XML Security Context + Reference< XInterface > xmlsecctx = + xManager->createInstanceWithContext( OUString::createFromAscii("com.sun.star.xml.security.bridge.xmlsec.XMLSecurityContext_NssImpl"), xContext ) ; + OSL_ENSURE( xsecenv.is() , + "Verifier - " + "Cannot get service instance of \"xsec.XMLSecurityContext\"" ) ; + + Reference< XXMLSecurityContext > xSecCtx( xmlsecctx , UNO_QUERY ) ; + OSL_ENSURE( xSecCtx.is() , + "Verifier - " + "Cannot get interface of \"XXMLSecurityContext\" from service \"xsec.XMLSecurityContext\"" ) ; + + xSecCtx->setSecurityEnvironment( xSecEnv ) ; + + //Generate XML signature + Reference< XInterface > xmlsigner = + xManager->createInstanceWithContext( OUString::createFromAscii("com.sun.star.xml.security.bridge.xmlsec.XMLSignature_NssImpl"), xContext ) ; + OSL_ENSURE( xmlsigner.is() , + "Verifier - " + "Cannot get service instance of \"xsec.XMLSignature\"" ) ; + + Reference< XXMLSignature > xSigner( xmlsigner , UNO_QUERY ) ; + OSL_ENSURE( xSigner.is() , + "Verifier - " + "Cannot get interface of \"XXMLSignature\" from service \"xsec.XMLSignature\"" ) ; + + + //perform validation + sal_Bool valid = xSigner->validate( xTemplate , xSecCtx ) ; + if( !valid ) { + printf( "Signature is INVALID!\n" ) ; + } else { + printf( "Signature is VALID!\n" ) ; + } + } catch( Exception& e ) { + fprintf( stderr , "Error Message: %s\n" , OUStringToOString( e.Message , RTL_TEXTENCODING_ASCII_US ).getStr() ) ; + goto done ; + } + +done : + if( doc != NULL ) + xmlFreeDoc( doc ) ; + + if( slot != NULL ) + PK11_FreeSlot( slot ) ; + + PK11_LogoutAll() ; + NSS_Shutdown() ; + + /* Shutdown libxslt/libxml */ + #ifndef XMLSEC_NO_XSLT + xsltCleanupGlobals(); + #endif /* XMLSEC_NO_XSLT */ + xmlCleanupParser(); + + return 0 ; +} + diff --git a/xmlsecurity/tools/standalone/mscsfit/certmngr.cxx b/xmlsecurity/tools/standalone/mscsfit/certmngr.cxx new file mode 100644 index 000000000000..2208eb2e6177 --- /dev/null +++ b/xmlsecurity/tools/standalone/mscsfit/certmngr.cxx @@ -0,0 +1,152 @@ +/** -- C++ Source File -- **/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_xmlsecurity.hxx" +#include <stdio.h> +#include "helper.hxx" + +#include "libxml/tree.h" +#include "libxml/parser.h" +#ifndef XMLSEC_NO_XSLT +#include "libxslt/xslt.h" +#endif + +#include "securityenvironment_mscryptimpl.hxx" + +#include <xmlsecurity/biginteger.hxx> + +#include "xmlsec/strings.h" +#include "xmlsec/xmltree.h" +#include "xmlsec/mscrypto/app.h" + +#include <rtl/ustring.hxx> + +using namespace ::rtl ; +using namespace ::cppu ; +using namespace ::com::sun::star::uno ; +using namespace ::com::sun::star::io ; +using namespace ::com::sun::star::ucb ; +using namespace ::com::sun::star::beans ; +using namespace ::com::sun::star::document ; +using namespace ::com::sun::star::lang ; +using namespace ::com::sun::star::security ; +using namespace ::com::sun::star::xml::wrapper ; +using namespace ::com::sun::star::xml::crypto ; + +int SAL_CALL main( int argc, char **argv ) +{ + const char* n_pCertStore ; + HCERTSTORE n_hStoreHandle ; + + if( argc != 3 && argc != 2 ) { + fprintf( stderr, "Usage: %s <rdb file>\n" , argv[0] ) ; + fprintf( stderr, "Or: \t%s <rdb file> < Cert Store Name >\n\n" , argv[0] ) ; + return 1 ; + } + + //Initialize the crypto engine + if( argc == 3 ) { + n_pCertStore = argv[2] ; + n_hStoreHandle = CertOpenSystemStore( NULL, n_pCertStore ) ; + if( n_hStoreHandle == NULL ) { + fprintf( stderr, "Can not open the system cert store %s\n", n_pCertStore ) ; + return 1 ; + } + } else { + n_pCertStore = NULL ; + n_hStoreHandle = NULL ; + } + //xmlSecMSCryptoAppInit( n_pCertStore ) ; + + try { + Reference< XMultiComponentFactory > xManager = NULL ; + Reference< XComponentContext > xContext = NULL ; + + xManager = serviceManager( xContext , OUString::createFromAscii( "local" ), OUString::createFromAscii( argv[1] ) ) ; + OSL_ENSURE( xManager.is() , + "ServicesManager - " + "Cannot get service manager" ) ; + + //Create security environment + //Build Security Environment + Reference< XInterface > xsecenv = + xManager->createInstanceWithContext( OUString::createFromAscii("com.sun.star.xml.security.bridge.xmlsec.SecurityEnvironment_MSCryptImpl"), xContext ) ; + OSL_ENSURE( xsecenv.is() , + "Signer - " + "Cannot get service instance of \"xsec.SecurityEnvironment\"" ) ; + + Reference< XSecurityEnvironment > xSecEnv( xsecenv , UNO_QUERY ) ; + OSL_ENSURE( xSecEnv.is() , + "Signer - " + "Cannot get interface of \"XSecurityEnvironment\" from service \"xsec.SecurityEnvironment\"" ) ; + + Reference< XUnoTunnel > xEnvTunnel( xsecenv , UNO_QUERY ) ; + OSL_ENSURE( xEnvTunnel.is() , + "Signer - " + "Cannot get interface of \"XUnoTunnel\" from service \"xsec.SecurityEnvironment\"" ) ; + + SecurityEnvironment_MSCryptImpl* pSecEnv = ( SecurityEnvironment_MSCryptImpl* )xEnvTunnel->getSomething( SecurityEnvironment_MSCryptImpl::getUnoTunnelId() ) ; + OSL_ENSURE( pSecEnv != NULL , + "Signer - " + "Cannot get implementation of \"xsec.SecurityEnvironment\"" ) ; + + //Setup key slot and certDb + if( n_hStoreHandle != NULL ) { + pSecEnv->setCryptoSlot( n_hStoreHandle ) ; + pSecEnv->setCertDb( n_hStoreHandle ) ; + } else { + pSecEnv->enableDefaultCrypt( sal_True ) ; + } + + //Get personal certificate + Sequence < Reference< XCertificate > > xPersonalCerts = pSecEnv->getPersonalCertificates() ; + OSL_ENSURE( xPersonalCerts.hasElements() , + "getPersonalCertificates - " + "No personal certificates found\n" ) ; + + Sequence < Reference< XCertificate > > xCertPath ; + for( int i = 0; i < xPersonalCerts.getLength(); i ++ ) { + //Print the certificate infomation. + fprintf( stdout, "\nPersonal Certificate Info\n" ) ; + fprintf( stdout, "\tCertificate Issuer[%s]\n", OUStringToOString( xPersonalCerts[i]->getIssuerName(), RTL_TEXTENCODING_ASCII_US ).getStr() ) ; + fprintf( stdout, "\tCertificate Serial Number[%s]\n", OUStringToOString( bigIntegerToNumericString( xPersonalCerts[i]->getSerialNumber() ), RTL_TEXTENCODING_ASCII_US ).getStr() ) ; + fprintf( stdout, "\tCertificate Subject[%s]\n", OUStringToOString( xPersonalCerts[i]->getSubjectName(), RTL_TEXTENCODING_ASCII_US ).getStr() ) ; + + //build the certificate path + xCertPath = pSecEnv->buildCertificatePath( xPersonalCerts[i] ) ; + //Print the certificate path. + fprintf( stdout, "\tCertificate Path\n" ) ; + for( int j = 0; j < xCertPath.getLength(); j ++ ) { + fprintf( stdout, "\t\tCertificate Authority Subject[%s]\n", OUStringToOString( xCertPath[j]->getSubjectName(), RTL_TEXTENCODING_ASCII_US ).getStr() ) ; + } + + //Get the certificate + Sequence < sal_Int8 > serial = xPersonalCerts[i]->getSerialNumber() ; + Reference< XCertificate > xcert = pSecEnv->getCertificate( xPersonalCerts[i]->getIssuerName(), xPersonalCerts[i]->getSerialNumber() ) ; + if( !xcert.is() ) { + fprintf( stdout, "The personal certificate is not in the certificate database\n" ) ; + } + + //Get the certificate characters + sal_Int32 chars = pSecEnv->getCertificateCharacters( xPersonalCerts[i] ) ; + fprintf( stdout, "The certificate characters are %d\n", chars ) ; + + //Get the certificate status + sal_Int32 validity = pSecEnv->verifyCertificate( xPersonalCerts[i] ) ; + fprintf( stdout, "The certificate validities are %d\n", validity ) ; + + } + } catch( Exception& e ) { + fprintf( stderr , "Error Message: %s\n" , OUStringToOString( e.Message , RTL_TEXTENCODING_ASCII_US ).getStr() ) ; + goto done ; + } + +done: + if( n_hStoreHandle != NULL ) + CertCloseStore( n_hStoreHandle, CERT_CLOSE_STORE_FORCE_FLAG ) ; + + //xmlSecMSCryptoAppShutdown() ; + + return 0; +} + diff --git a/xmlsecurity/tools/standalone/mscsfit/decrypter.cxx b/xmlsecurity/tools/standalone/mscsfit/decrypter.cxx new file mode 100644 index 000000000000..c0864ffb7b2e --- /dev/null +++ b/xmlsecurity/tools/standalone/mscsfit/decrypter.cxx @@ -0,0 +1,246 @@ +/** -- C++ Source File -- **/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_xmlsecurity.hxx" +#include <stdio.h> +#include "helper.hxx" + +#include "libxml/tree.h" +#include "libxml/parser.h" +#ifndef XMLSEC_NO_XSLT +#include "libxslt/xslt.h" +#endif + + +#include "securityenvironment_mscryptimpl.hxx" +#include "xmlelementwrapper_xmlsecimpl.hxx" + +#include "nspr.h" +#include "prtypes.h" + +#include "pk11func.h" +#include "cert.h" +#include "cryptohi.h" +#include "certdb.h" +#include "nss.h" + +#include "xmlsec/strings.h" +#include "xmlsec/xmltree.h" + +#include <rtl/ustring.hxx> +#include <cppuhelper/bootstrap.hxx> +#include <cppuhelper/servicefactory.hxx> + +#include <com/sun/star/beans/PropertyValue.hpp> +#include <com/sun/star/xml/wrapper/XXMLElementWrapper.hpp> +#include <com/sun/star/xml/wrapper/XXMLDocumentWrapper.hpp> +#include <com/sun/star/xml/crypto/XXMLEncryption.hpp> +#include <com/sun/star/xml/crypto/XXMLEncryptionTemplate.hpp> +#include <com/sun/star/xml/crypto/XXMLSecurityContext.hpp> +#include <com/sun/star/xml/crypto/XSecurityEnvironment.hpp> + + +using namespace ::rtl ; +using namespace ::cppu ; +using namespace ::com::sun::star::uno ; +using namespace ::com::sun::star::io ; +using namespace ::com::sun::star::ucb ; +using namespace ::com::sun::star::beans ; +using namespace ::com::sun::star::document ; +using namespace ::com::sun::star::lang ; +using namespace ::com::sun::star::registry ; +using namespace ::com::sun::star::xml::wrapper ; +using namespace ::com::sun::star::xml::crypto ; + + +int SAL_CALL main( int argc, char **argv ) +{ + CERTCertDBHandle* certHandle = NULL ; + PK11SlotInfo* slot = NULL ; + xmlDocPtr doc = NULL ; + xmlNodePtr tplNode ; + xmlNodePtr tarNode ; + FILE* dstFile = NULL ; + + + if( argc != 5 ) { + fprintf( stderr, "Usage: %s < CertDir > <input file_url> <output file_url> <rdb file>\n\n" , argv[0] ) ; + return 1 ; + } + + //Init libxml and libxslt libraries + xmlInitParser(); + LIBXML_TEST_VERSION + xmlLoadExtDtdDefaultValue = XML_DETECT_IDS | XML_COMPLETE_ATTRS; + xmlSubstituteEntitiesDefault(1); + + #ifndef XMLSEC_NO_XSLT + xmlIndentTreeOutput = 1; + #endif // XMLSEC_NO_XSLT + + + //Initialize NSPR and NSS + PR_Init( PR_SYSTEM_THREAD, PR_PRIORITY_NORMAL, 1 ) ; + PK11_SetPasswordFunc( PriPK11PasswordFunc ) ; + if( NSS_Init( argv[1] ) != SECSuccess ) { + fprintf( stderr , "### cannot intialize NSS!\n" ) ; + goto done ; + } + + certHandle = CERT_GetDefaultCertDB() ; + slot = PK11_GetInternalKeySlot() ; + + //Load XML document + doc = xmlParseFile( argv[2] ) ; + if( doc == NULL || xmlDocGetRootElement( doc ) == NULL ) { + fprintf( stderr , "### Cannot load template xml document!\n" ) ; + goto done ; + } + + //Find the encryption template + tplNode = xmlSecFindNode( xmlDocGetRootElement( doc ), xmlSecNodeEncryptedData, xmlSecEncNs ) ; + if( tplNode == NULL ) { + fprintf( stderr , "### Cannot find the encryption template!\n" ) ; + goto done ; + } + + + try { + Reference< XMultiComponentFactory > xManager = NULL ; + Reference< XComponentContext > xContext = NULL ; + + xManager = serviceManager( xContext , OUString::createFromAscii( "local" ), OUString::createFromAscii( argv[4] ) ) ; + + //Create encryption template + Reference< XInterface > tplElement = + xManager->createInstanceWithContext( OUString::createFromAscii( "com.sun.star.xml.xsec.XMLElementWrapper" ) , xContext ) ; + OSL_ENSURE( tplElement.is() , + "Decryptor - " + "Cannot get service instance of \"xsec.XMLElementWrapper\"" ) ; + + Reference< XXMLElementWrapper > xTplElement( tplElement , UNO_QUERY ) ; + OSL_ENSURE( xTplElement.is() , + "Decryptor - " + "Cannot get interface of \"XXMLElementWrapper\" from service \"xsec.XMLElementWrapper\"" ) ; + + Reference< XUnoTunnel > xTplEleTunnel( xTplElement , UNO_QUERY ) ; + OSL_ENSURE( xTplEleTunnel.is() , + "Decryptor - " + "Cannot get interface of \"XUnoTunnel\" from service \"xsec.XMLElementWrapper\"" ) ; + + XMLElementWrapper_XmlSecImpl* pTplElement = ( XMLElementWrapper_XmlSecImpl* )xTplEleTunnel->getSomething( XMLElementWrapper_XmlSecImpl::getUnoTunnelImplementationId() ) ; + OSL_ENSURE( pTplElement != NULL , + "Decryptor - " + "Cannot get implementation of \"xsec.XMLElementWrapper\"" ) ; + + pTplElement->setNativeElement( tplNode ) ; + + //Build XML Encryption template + Reference< XInterface > enctpl = + xManager->createInstanceWithContext( OUString::createFromAscii("com.sun.star.xml.xsec.XMLEncryptionTemplate"), xContext ) ; + OSL_ENSURE( enctpl.is() , + "Decryptor - " + "Cannot get service instance of \"xsec.XMLEncryptionTemplate\"" ) ; + + Reference< XXMLEncryptionTemplate > xTemplate( enctpl , UNO_QUERY ) ; + OSL_ENSURE( xTemplate.is() , + "Decryptor - " + "Cannot get interface of \"XXMLEncryptionTemplate\" from service \"xsec.XMLEncryptionTemplate\"" ) ; + + //Import the encryption template + xTemplate->setTemplate( xTplElement ) ; + + //Create security environment + //Build Security Environment + Reference< XInterface > xsecenv = + xManager->createInstanceWithContext( OUString::createFromAscii("com.sun.star.xml.xsec.SecurityEnvironment"), xContext ) ; + OSL_ENSURE( xsecenv.is() , + "Decryptor - " + "Cannot get service instance of \"xsec.SecurityEnvironment\"" ) ; + + Reference< XSecurityEnvironment > xSecEnv( xsecenv , UNO_QUERY ) ; + OSL_ENSURE( xSecEnv.is() , + "Decryptor - " + "Cannot get interface of \"XSecurityEnvironment\" from service \"xsec.SecurityEnvironment\"" ) ; + + //Setup key slot and certDb + Reference< XUnoTunnel > xEnvTunnel( xsecenv , UNO_QUERY ) ; + OSL_ENSURE( xEnvTunnel.is() , + "Decryptor - " + "Cannot get interface of \"XUnoTunnel\" from service \"xsec.SecurityEnvironment\"" ) ; + + SecurityEnvironment_XmlSecImpl* pSecEnv = ( SecurityEnvironment_XmlSecImpl* )xEnvTunnel->getSomething( SecurityEnvironment_XmlSecImpl::getUnoTunnelId() ) ; + OSL_ENSURE( pSecEnv != NULL , + "Decryptor - " + "Cannot get implementation of \"xsec.SecurityEnvironment\"" ) ; + + pSecEnv->setCryptoSlot( slot ) ; + pSecEnv->setCertDb( certHandle ) ; + + + //Build XML Security Context + Reference< XInterface > xmlsecctx = + xManager->createInstanceWithContext( OUString::createFromAscii("com.sun.star.xml.xsec.XMLSecurityContext"), xContext ) ; + OSL_ENSURE( xmlsecctx.is() , + "Decryptor - " + "Cannot get service instance of \"xsec.XMLSecurityContext\"" ) ; + + Reference< XXMLSecurityContext > xSecCtx( xmlsecctx , UNO_QUERY ) ; + OSL_ENSURE( xSecCtx.is() , + "Decryptor - " + "Cannot get interface of \"XXMLSecurityContext\" from service \"xsec.XMLSecurityContext\"" ) ; + + xSecCtx->setSecurityEnvironment( xSecEnv ) ; + + + //Get encrypter + Reference< XInterface > xmlencrypter = + xManager->createInstanceWithContext( OUString::createFromAscii("com.sun.star.xml.xsec.XMLEncryption"), xContext ) ; + OSL_ENSURE( xmlencrypter.is() , + "Decryptor - " + "Cannot get service instance of \"xsec.XMLEncryption\"" ) ; + + Reference< XXMLEncryption > xEncrypter( xmlencrypter , UNO_QUERY ) ; + OSL_ENSURE( xEncrypter.is() , + "Decryptor - " + "Cannot get interface of \"XXMLEncryption\" from service \"xsec.XMLEncryption\"" ) ; + + + //Perform decryption + Reference< XXMLElementWrapper> xDecrRes = xEncrypter->decrypt( xTemplate , xSecCtx ) ; + OSL_ENSURE( xDecrRes.is() , + "Decryptor - " + "Cannot decrypt the xml document" ) ; + } catch( Exception& e ) { + fprintf( stderr , "Error Message: %s\n" , OUStringToOString( e.Message , RTL_TEXTENCODING_ASCII_US ).getStr() ) ; + goto done ; + } + + dstFile = fopen( argv[3], "w" ) ; + if( dstFile == NULL ) { + fprintf( stderr , "### Can not open file %s\n", argv[3] ) ; + goto done ; + } + + //Save result + xmlDocDump( dstFile, doc ) ; + +done: + if( dstFile != NULL ) + fclose( dstFile ) ; + + if( slot != NULL ) + PK11_FreeSlot( slot ) ; + + PK11_LogoutAll() ; + NSS_Shutdown() ; + + /* Shutdown libxslt/libxml */ + #ifndef XMLSEC_NO_XSLT + xsltCleanupGlobals(); + #endif /* XMLSEC_NO_XSLT */ + xmlCleanupParser(); + + return 0; +} + diff --git a/xmlsecurity/tools/standalone/mscsfit/encrypter.cxx b/xmlsecurity/tools/standalone/mscsfit/encrypter.cxx new file mode 100644 index 000000000000..7402d5c3984f --- /dev/null +++ b/xmlsecurity/tools/standalone/mscsfit/encrypter.cxx @@ -0,0 +1,308 @@ +/** -- C++ Source File -- **/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_xmlsecurity.hxx" +#include <stdio.h> +#include "helper.hxx" + +#include "libxml/tree.h" +#include "libxml/parser.h" +#ifndef XMLSEC_NO_XSLT +#include "libxslt/xslt.h" +#endif + +#include "securityenvironment_mscryptimpl.hxx" +#include "xmlelementwrapper_xmlsecimpl.hxx" + +#include "xmlsec/strings.h" +#include "xmlsec/mscrypto/app.h" +#include "xmlsec/xmltree.h" + +#include <rtl/ustring.hxx> +#include <cppuhelper/servicefactory.hxx> + +#include <com/sun/star/lang/XComponent.hpp> +#include <com/sun/star/beans/PropertyValue.hpp> +#include <com/sun/star/xml/wrapper/XXMLElementWrapper.hpp> +#include <com/sun/star/xml/wrapper/XXMLDocumentWrapper.hpp> +#include <com/sun/star/xml/crypto/XXMLEncryption.hpp> +#include <com/sun/star/xml/crypto/XXMLEncryptionTemplate.hpp> +#include <com/sun/star/xml/crypto/XXMLSecurityContext.hpp> +#include <com/sun/star/xml/crypto/XSecurityEnvironment.hpp> + +using namespace ::rtl ; +using namespace ::cppu ; +using namespace ::com::sun::star::uno ; +using namespace ::com::sun::star::io ; +using namespace ::com::sun::star::ucb ; +using namespace ::com::sun::star::beans ; +using namespace ::com::sun::star::document ; +using namespace ::com::sun::star::lang ; +using namespace ::com::sun::star::registry ; +using namespace ::com::sun::star::xml::wrapper ; +using namespace ::com::sun::star::xml::crypto ; + +int SAL_CALL main( int argc, char **argv ) +{ + const char* n_pCertStore ; + HCERTSTORE n_hStoreHandle ; + + xmlDocPtr doc = NULL ; + xmlNodePtr tplNode ; + xmlNodePtr tarNode ; + FILE* dstFile = NULL ; + + HCRYPTPROV hCryptProv = NULL ; + HCRYPTKEY symKey = NULL ; + + if( argc != 6 && argc != 7 ) { + fprintf( stderr, "Usage: %s <file_url of template> <file_url of result> <target element name> <target element namespace> <rdb file>\n\n" , argv[0] ) ; + fprintf( stderr, "Usage: %s <file_url of template> <file_url of result> <target element name> <target element namespace> <rdb file> < Cert Store Name >\n\n" , argv[0] ) ; + return 1 ; + } + + //Init libxml and libxslt libraries + xmlInitParser(); + LIBXML_TEST_VERSION + xmlLoadExtDtdDefaultValue = XML_DETECT_IDS | XML_COMPLETE_ATTRS; + xmlSubstituteEntitiesDefault(1); + + #ifndef XMLSEC_NO_XSLT + xmlIndentTreeOutput = 1; + #endif // XMLSEC_NO_XSLT + + //Initialize the crypto engine + if( argc == 7 ) { + n_pCertStore = argv[6] ; + n_hStoreHandle = CertOpenSystemStore( NULL, n_pCertStore ) ; + if( n_hStoreHandle == NULL ) { + fprintf( stderr, "Can not open the system cert store %s\n", n_pCertStore ) ; + return 1 ; + } + } else { + n_pCertStore = NULL ; + n_hStoreHandle = NULL ; + } + xmlSecMSCryptoAppInit( n_pCertStore ) ; + + //Create encryption key. + //CryptAcquireContext( &hCryptProv , NULL , NULL , PROV_RSA_FULL , CRYPT_DELETEKEYSET ) ; + //CryptAcquireContext( &hCryptProv , "MyTempKeyContainer" , NULL , PROV_RSA_FULL , CRYPT_DELETEKEYSET ) ; + + if( !CryptAcquireContext( &hCryptProv , NULL , NULL , PROV_RSA_FULL , CRYPT_VERIFYCONTEXT ) ) { + fprintf( stderr, "### cannot get crypto provider context!\n" ); + goto done ; + } + + if( !CryptGenKey( hCryptProv, CALG_RC4, 0x00800000 | CRYPT_EXPORTABLE, &symKey ) ) { + fprintf( stderr , "### cannot create symmetric key!\n" ) ; + goto done ; + } + + //Load XML document + doc = xmlParseFile( argv[1] ) ; + if( doc == NULL || xmlDocGetRootElement( doc ) == NULL ) { + fprintf( stderr , "### Cannot load template xml document!\n" ) ; + goto done ; + } + + //Find the encryption template + tplNode = xmlSecFindNode( xmlDocGetRootElement( doc ), xmlSecNodeEncryptedData, xmlSecEncNs ) ; + if( tplNode == NULL ) { + fprintf( stderr , "### Cannot find the encryption template!\n" ) ; + goto done ; + } + + //Find the encryption template + tarNode = xmlSecFindNode( xmlDocGetRootElement( doc ), ( const unsigned char*)argv[3], ( const unsigned char*)argv[4] ) ; + if( tarNode == NULL ) { + fprintf( stderr , "### Cannot find the encryption target!\n" ) ; + goto done ; + } + + try { + Reference< XMultiComponentFactory > xManager = NULL ; + Reference< XComponentContext > xContext = NULL ; + + xManager = serviceManager( xContext , OUString::createFromAscii( "local" ), OUString::createFromAscii( argv[5] ) ) ; + + //Create encryption template + Reference< XInterface > tplElement = + xManager->createInstanceWithContext( OUString::createFromAscii( "com.sun.star.xml.security.bridge.xmlsec.XMLElementWrapper_XmlSecImpl" ) , xContext ) ; + OSL_ENSURE( tplElement.is() , + "Encryptor - " + "Cannot get service instance of \"xsec.XMLElementWrapper\"" ) ; + + Reference< XXMLElementWrapper > xTplElement( tplElement , UNO_QUERY ) ; + OSL_ENSURE( xTplElement.is() , + "Encryptor - " + "Cannot get interface of \"XXMLElementWrapper\" from service \"xsec.XMLElementWrapper\"" ) ; + + Reference< XUnoTunnel > xTplEleTunnel( xTplElement , UNO_QUERY ) ; + OSL_ENSURE( xTplEleTunnel.is() , + "Encryptor - " + "Cannot get interface of \"XUnoTunnel\" from service \"xsec.XMLElementWrapper\"" ) ; + + XMLElementWrapper_XmlSecImpl* pTplElement = ( XMLElementWrapper_XmlSecImpl* )xTplEleTunnel->getSomething( XMLElementWrapper_XmlSecImpl::getUnoTunnelImplementationId() ) ; + OSL_ENSURE( pTplElement != NULL , + "Encryptor - " + "Cannot get implementation of \"xsec.XMLElementWrapper\"" ) ; + + pTplElement->setNativeElement( tplNode ) ; + + //Create encryption target element + Reference< XInterface > tarElement = + xManager->createInstanceWithContext( OUString::createFromAscii( "com.sun.star.xml.security.bridge.xmlsec.XMLElementWrapper_XmlSecImpl" ) , xContext ) ; + OSL_ENSURE( tarElement.is() , + "Encryptor - " + "Cannot get service instance of \"xsec.XMLElementWrapper\"" ) ; + + Reference< XXMLElementWrapper > xTarElement( tarElement , UNO_QUERY ) ; + OSL_ENSURE( xTarElement.is() , + "Encryptor - " + "Cannot get interface of \"XXMLElementWrapper\" from service \"xsec.XMLElementWrapper\"" ) ; + + Reference< XUnoTunnel > xTarEleTunnel( xTarElement , UNO_QUERY ) ; + OSL_ENSURE( xTarEleTunnel.is() , + "Encryptor - " + "Cannot get interface of \"XUnoTunnel\" from service \"xsec.XMLElementWrapper\"" ) ; + + XMLElementWrapper_XmlSecImpl* pTarElement = ( XMLElementWrapper_XmlSecImpl* )xTarEleTunnel->getSomething( XMLElementWrapper_XmlSecImpl::getUnoTunnelImplementationId() ) ; + OSL_ENSURE( pTarElement != NULL , + "Encryptor - " + "Cannot get implementation of \"xsec.XMLElementWrapper\"" ) ; + + pTarElement->setNativeElement( tarNode ) ; + + + //Build XML Encryption template + Reference< XInterface > enctpl = + xManager->createInstanceWithContext( OUString::createFromAscii("com.sun.star.xml.crypto.XMLEncryptionTemplate"), xContext ) ; + OSL_ENSURE( enctpl.is() , + "Encryptor - " + "Cannot get service instance of \"xsec.XMLEncryptionTemplate\"" ) ; + + Reference< XXMLEncryptionTemplate > xTemplate( enctpl , UNO_QUERY ) ; + OSL_ENSURE( xTemplate.is() , + "Encryptor - " + "Cannot get interface of \"XXMLEncryptionTemplate\" from service \"xsec.XMLEncryptionTemplate\"" ) ; + + //Import the encryption template + xTemplate->setTemplate( xTplElement ) ; + xTemplate->setTarget( xTarElement ) ; + + //Create security environment + //Build Security Environment + Reference< XInterface > xsecenv = + xManager->createInstanceWithContext( OUString::createFromAscii("com.sun.star.xml.security.bridge.xmlsec.SecurityEnvironment_MSCryptImpl"), xContext ) ; + OSL_ENSURE( xsecenv.is() , + "Encryptor - " + "Cannot get service instance of \"xsec.SecurityEnvironment\"" ) ; + + Reference< XSecurityEnvironment > xSecEnv( xsecenv , UNO_QUERY ) ; + OSL_ENSURE( xSecEnv.is() , + "Encryptor - " + "Cannot get interface of \"XSecurityEnvironment\" from service \"xsec.SecurityEnvironment\"" ) ; + + //Setup key slot and certDb + Reference< XUnoTunnel > xEnvTunnel( xsecenv , UNO_QUERY ) ; + OSL_ENSURE( xEnvTunnel.is() , + "Encryptor - " + "Cannot get interface of \"XUnoTunnel\" from service \"xsec.SecurityEnvironment\"" ) ; + + SecurityEnvironment_MSCryptImpl* pSecEnv = ( SecurityEnvironment_MSCryptImpl* )xEnvTunnel->getSomething( SecurityEnvironment_MSCryptImpl::getUnoTunnelId() ) ; + OSL_ENSURE( pSecEnv != NULL , + "Encryptor - " + "Cannot get implementation of \"xsec.SecurityEnvironment\"" ) ; + + //Setup key slot and certDb + if( n_hStoreHandle != NULL ) { + pSecEnv->setCryptoSlot( n_hStoreHandle ) ; + pSecEnv->setCertDb( n_hStoreHandle ) ; + } else { + pSecEnv->enableDefaultCrypt( sal_True ) ; + } + + pSecEnv->adoptSymKey( symKey ) ; + + + //Build XML Security Context + Reference< XInterface > xmlsecctx = + xManager->createInstanceWithContext( OUString::createFromAscii("com.sun.star.xml.security.bridge.xmlsec.XMLSecurityContext_MSCryptImpl"), xContext ) ; + OSL_ENSURE( xmlsecctx.is() , + "Encryptor - " + "Cannot get service instance of \"xsec.XMLSecurityContext\"" ) ; + + Reference< XXMLSecurityContext > xSecCtx( xmlsecctx , UNO_QUERY ) ; + OSL_ENSURE( xSecCtx.is() , + "Encryptor - " + "Cannot get interface of \"XXMLSecurityContext\" from service \"xsec.XMLSecurityContext\"" ) ; + + xSecCtx->addSecurityEnvironment( xSecEnv ) ; + + //Get encrypter + Reference< XInterface > xmlencrypter = + xManager->createInstanceWithContext( OUString::createFromAscii("com.sun.star.xml.security.bridge.xmlsec.XMLEncryption_MSCryptImpl"), xContext ) ; + OSL_ENSURE( xmlencrypter.is() , + "Encryptor - " + "Cannot get service instance of \"xsec.XMLEncryption\"" ) ; + + Reference< XXMLEncryption > xEncrypter( xmlencrypter , UNO_QUERY ) ; + OSL_ENSURE( xEncrypter.is() , + "Encryptor - " + "Cannot get interface of \"XXMLEncryption\" from service \"xsec.XMLEncryption\"" ) ; + + //perform encryption + xTemplate = xEncrypter->encrypt( xTemplate , xSecEnv ) ; + OSL_ENSURE( xTemplate.is() , + "Encryptor - " + "Cannot encrypt the xml document" ) ; + + + com::sun::star::xml::crypto::SecurityOperationStatus m_nStatus = xTemplate->getStatus(); + if (m_nStatus == SecurityOperationStatus_OPERATION_SUCCEEDED) + { + fprintf( stdout, "Operation succeeds.\n") ; + } + else + { + fprintf( stdout, "Operation fails.\n") ; + } + } catch( Exception& e ) { + fprintf( stderr , "Error Message: %s\n" , OUStringToOString( e.Message , RTL_TEXTENCODING_ASCII_US ).getStr() ) ; + goto done ; + } + + dstFile = fopen( argv[2], "w" ) ; + if( dstFile == NULL ) { + fprintf( stderr , "### Can not open file %s\n", argv[2] ) ; + goto done ; + } + + //Save result + xmlDocDump( dstFile, doc ) ; + +done: + if( dstFile != NULL ) + fclose( dstFile ) ; + + if( symKey != NULL ) { + CryptDestroyKey( symKey ) ; + } + + if( hCryptProv != NULL ) { + CryptReleaseContext( hCryptProv, 0 ) ; + } + + if( n_hStoreHandle != NULL ) + CertCloseStore( n_hStoreHandle, CERT_CLOSE_STORE_FORCE_FLAG ) ; + + /* Shutdown libxslt/libxml */ + #ifndef XMLSEC_NO_XSLT + xsltCleanupGlobals(); + #endif /* XMLSEC_NO_XSLT */ + xmlCleanupParser(); + + return 0; +} + diff --git a/xmlsecurity/tools/standalone/mscsfit/helper.cxx b/xmlsecurity/tools/standalone/mscsfit/helper.cxx new file mode 100644 index 000000000000..86cacafa4a8b --- /dev/null +++ b/xmlsecurity/tools/standalone/mscsfit/helper.cxx @@ -0,0 +1,220 @@ +#include "helper.hxx" +#include "osl/diagnose.h" +#include "rtl/ustring.h" + +/*- + * Helper : create a input stream from a file + */ +Reference< XInputStream > createStreamFromFile( const OUString sFile ) +{ + const sal_Char* pcFile ; + OString aString ; + + aString = OUStringToOString( sFile , RTL_TEXTENCODING_ASCII_US ) ; + pcFile = aString.getStr() ; + if( pcFile != NULL ) { + FILE *f = fopen( pcFile , "rb" ); + Reference< XInputStream > r; + + if( f ) { + fseek( f , 0 , SEEK_END ); + int nLength = ftell( f ); + fseek( f , 0 , SEEK_SET ); + + Sequence<sal_Int8> seqIn(nLength); + fread( seqIn.getArray() , nLength , 1 , f ); + + r = Reference< XInputStream > ( new OInputStream( seqIn ) ); + fclose( f ); + } + return r; + } else { + return NULL ; + } + + return NULL ; +} + +/*- + * Helper : set a output stream to a file + */ +Reference< XOutputStream > createStreamToFile( const OUString sFile ) +{ + const sal_Char* pcFile ; + OString aString ; + + aString = OUStringToOString( sFile , RTL_TEXTENCODING_ASCII_US ) ; + pcFile = aString.getStr() ; + if( pcFile != NULL ) + return Reference< XOutputStream >( new OOutputStream( pcFile ) ) ; + else + return NULL ; +} + +/*- + * Helper : get service manager and context + */ +Reference< XMultiComponentFactory > serviceManager( Reference< XComponentContext >& xContext , OUString sUnoUrl , OUString sRdbUrl ) throw( RuntimeException , Exception ) +{ + Reference< XMultiComponentFactory > xLocalServiceManager = NULL ; + Reference< XComponentContext > xLocalComponentContext = NULL ; + Reference< XMultiComponentFactory > xUsedServiceManager = NULL ; + Reference< XComponentContext > xUsedComponentContext = NULL ; + + OSL_ENSURE( !sUnoUrl.equalsAscii( "" ) , + "serviceManager - " + "No uno URI specified" ) ; + + OSL_ENSURE( !sRdbUrl.equalsAscii( "" ) , + "serviceManager - " + "No rdb URI specified" ) ; + + if( sUnoUrl.equalsAscii( "local" ) ) { + Reference< XSimpleRegistry > xSimpleRegistry = createSimpleRegistry(); + OSL_ENSURE( xSimpleRegistry.is() , + "serviceManager - " + "Cannot create simple registry" ) ; + + //xSimpleRegistry->open(OUString::createFromAscii("xmlsecurity.rdb"), sal_False, sal_False); + xSimpleRegistry->open(sRdbUrl, sal_True, sal_False); + OSL_ENSURE( xSimpleRegistry->isValid() , + "serviceManager - " + "Cannot open xml security registry rdb" ) ; + + xLocalComponentContext = bootstrap_InitialComponentContext( xSimpleRegistry ) ; + OSL_ENSURE( xLocalComponentContext.is() , + "serviceManager - " + "Cannot create intial component context" ) ; + + xLocalServiceManager = xLocalComponentContext->getServiceManager() ; + OSL_ENSURE( xLocalServiceManager.is() , + "serviceManager - " + "Cannot create intial service manager" ) ; + + /*- + * Because of the exception rasied from + * ucbhelper/source/provider/provconf.cxx, lin 323 + * I do not use the content broker at present + ******************************************************************** + //init ucb + if( ::ucb::ContentBroker::get() == NULL ) { + Reference< lang::XMultiServiceFactory > xSvmg( xLocalServiceManager , UNO_QUERY ) ; + OSL_ENSURE( xLocalServiceManager.is() , + "serviceManager - " + "Cannot get multi-service factory" ) ; + + Sequence< Any > args( 2 ) ; + args[ 0 ] <<= OUString::createFromAscii( UCB_CONFIGURATION_KEY1_LOCAL ) ; + args[ 1 ] <<= OUString::createFromAscii( UCB_CONFIGURATION_KEY2_OFFICE ) ; + if( ! ::ucb::ContentBroker::initialize( xSvmg , args ) ) { + throw RuntimeException( OUString::createFromAscii( "Cannot inlitialize ContentBroker" ) , Reference< XInterface >() , Any() ) ; + } + } + ********************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_xmlsecurity.hxx" + + xUsedComponentContext = xLocalComponentContext ; + xUsedServiceManager = xLocalServiceManager ; + } else { + Reference< XComponentContext > xLocalComponentContext = defaultBootstrap_InitialComponentContext() ; + OSL_ENSURE( xLocalComponentContext.is() , + "serviceManager - " + "Cannot create intial component context" ) ; + + Reference< XMultiComponentFactory > xLocalServiceManager = xLocalComponentContext->getServiceManager(); + OSL_ENSURE( xLocalServiceManager.is() , + "serviceManager - " + "Cannot create intial service manager" ) ; + + Reference< XInterface > urlResolver = + xLocalServiceManager->createInstanceWithContext( OUString::createFromAscii("com.sun.star.bridge.UnoUrlResolver") , xLocalComponentContext ) ; + OSL_ENSURE( urlResolver.is() , + "serviceManager - " + "Cannot get service instance of \"bridge.UnoUrlResolver\"" ) ; + + Reference< XUnoUrlResolver > xUnoUrlResolver( urlResolver , UNO_QUERY ) ; + OSL_ENSURE( xUnoUrlResolver.is() , + "serviceManager - " + "Cannot get interface of \"XUnoUrlResolver\" from service \"bridge.UnoUrlResolver\"" ) ; + + Reference< XInterface > initialObject = xUnoUrlResolver->resolve( sUnoUrl ) ; + OSL_ENSURE( initialObject.is() , + "serviceManager - " + "Cannot resolve uno url" ) ; + + /*- + * Method 1: with Naming Service + ******************************************************************** + Reference< XNamingService > xNamingService( initialObject , UNO_QUERY ) ; + OSL_ENSURE( xNamingService.is() , + "serviceManager - " + "Cannot get interface of \"XNamingService\" from URL resolver" ) ; + + Reference< XInterface > serviceManager = + xNamingService->getRegisteredObject( OUString::createFromAscii( "StarOffice.ServiceManager" ) ) ; + OSL_ENSURE( serviceManager.is() , + "serviceManager - " + "Cannot get service instance of \"StarOffice.ServiceManager\"" ) ; + + xUsedServiceManager = Reference< XMultiComponentFactory >( serviceManager , UNO_QUERY ); + OSL_ENSURE( xUsedServiceManager.is() , + "serviceManager - " + "Cannot get interface of \"XMultiComponentFactory\" from service \"StarOffice.ServiceManager\"" ) ; + + Reference< XPropertySet > xPropSet( xUsedServiceManager , UNO_QUERY ) ; + OSL_ENSURE( xPropSet.is() , + "serviceManager - " + "Cannot get interface of \"XPropertySet\" from service \"StarOffice.ServiceManager\"" ) ; + + xPropSet->getPropertyValue( OUString::createFromAscii( "DefaultContext" ) ) >>= xUsedComponentContext ; + OSL_ENSURE( xUsedComponentContext.is() , + "serviceManager - " + "Cannot create remote component context" ) ; + + ********************************************************************/ + + /*- + * Method 2: with Componnent context + ******************************************************************** + Reference< XPropertySet > xPropSet( initialObject , UNO_QUERY ) ; + OSL_ENSURE( xPropSet.is() , + "serviceManager - " + "Cannot get interface of \"XPropertySet\" from URL resolver" ) ; + + xPropSet->getPropertyValue( OUString::createFromAscii( "DefaultContext" ) ) >>= xUsedComponentContext ; + OSL_ENSURE( xUsedComponentContext.is() , + "serviceManager - " + "Cannot create remote component context" ) ; + + xUsedServiceManager = xUsedComponentContext->getServiceManager(); + OSL_ENSURE( xUsedServiceManager.is() , + "serviceManager - " + "Cannot create remote service manager" ) ; + ********************************************************************/ + + /*- + * Method 3: with Service Manager + ********************************************************************/ + xUsedServiceManager = Reference< XMultiComponentFactory >( initialObject , UNO_QUERY ); + OSL_ENSURE( xUsedServiceManager.is() , + "serviceManager - " + "Cannot create remote service manager" ) ; + + Reference< XPropertySet > xPropSet( xUsedServiceManager , UNO_QUERY ) ; + OSL_ENSURE( xPropSet.is() , + "serviceManager - " + "Cannot get interface of \"XPropertySet\" from service \"StarOffice.ServiceManager\"" ) ; + + xPropSet->getPropertyValue( OUString::createFromAscii( "DefaultContext" ) ) >>= xUsedComponentContext ; + OSL_ENSURE( xUsedComponentContext.is() , + "serviceManager - " + "Cannot create remote component context" ) ; + /********************************************************************/ + } + + xContext = xUsedComponentContext ; + return xUsedServiceManager ; +} + diff --git a/xmlsecurity/tools/standalone/mscsfit/helper.hxx b/xmlsecurity/tools/standalone/mscsfit/helper.hxx new file mode 100644 index 000000000000..0f95ef50c4ab --- /dev/null +++ b/xmlsecurity/tools/standalone/mscsfit/helper.hxx @@ -0,0 +1,204 @@ +#include <stdio.h> +#include <rtl/ustring.hxx> + +#include <cppuhelper/bootstrap.hxx> +#include <cppuhelper/implbase1.hxx> +#include <cppuhelper/servicefactory.hxx> +#include <ucbhelper/contentbroker.hxx> +#include <ucbhelper/configurationkeys.hxx> + +#include <com/sun/star/lang/XComponent.hpp> +#include <com/sun/star/bridge/XUnoUrlResolver.hpp> +#include <com/sun/star/registry/XImplementationRegistration.hpp> +#include <com/sun/star/document/XFilter.hpp> +#include <com/sun/star/document/XExporter.hpp> +#include <com/sun/star/document/XImporter.hpp> +#include <com/sun/star/io/XInputStream.hpp> +#include <com/sun/star/io/XOutputStream.hpp> +#include <com/sun/star/io/XActiveDataSource.hpp> +#include <com/sun/star/beans/PropertyValue.hpp> +#include <com/sun/star/beans/XPropertySet.hpp> +#include <com/sun/star/ucb/XSimpleFileAccess.hpp> + +#include <com/sun/star/xml/crypto/XUriBinding.hpp> +#include <com/sun/star/xml/wrapper/XXMLDocumentWrapper.hpp> +#include <com/sun/star/xml/wrapper/XXMLElementWrapper.hpp> + +#include <com/sun/star/xml/sax/XParser.hpp> +#include <com/sun/star/xml/sax/XDocumentHandler.hpp> +#include <com/sun/star/xml/sax/XExtendedDocumentHandler.hpp> +#include <com/sun/star/xml/sax/InputSource.hpp> +#include <com/sun/star/io/XInputStream.hpp> +#include <com/sun/star/io/XOutputStream.hpp> +#include <com/sun/star/uno/XNamingService.hpp> + +using namespace ::rtl ; +using namespace ::cppu ; +using namespace ::com::sun::star ; +using namespace ::com::sun::star::uno ; +using namespace ::com::sun::star::io ; +using namespace ::com::sun::star::ucb ; +using namespace ::com::sun::star::beans ; +using namespace ::com::sun::star::document ; +using namespace ::com::sun::star::lang ; +using namespace ::com::sun::star::bridge ; +using namespace ::com::sun::star::registry ; +using namespace ::com::sun::star::task ; +using namespace ::com::sun::star::xml ; +using namespace ::com::sun::star::xml::wrapper ; +using namespace ::com::sun::star::xml::sax ; + + +/** + * Helper: Implementation of XInputStream + */ +class OInputStream : public WeakImplHelper1 < XInputStream > +{ + public: + OInputStream( const Sequence< sal_Int8 >&seq ) : m_seq( seq ), nPos( 0 ) {} + + virtual sal_Int32 SAL_CALL readBytes( + Sequence< sal_Int8 >& aData , + sal_Int32 nBytesToRead + ) throw( NotConnectedException, BufferSizeExceededException, IOException, RuntimeException ) + { + nBytesToRead = ( nBytesToRead > m_seq.getLength() - nPos ) ? + m_seq.getLength() - nPos : + nBytesToRead ; + aData = Sequence< sal_Int8 > ( &( m_seq.getConstArray()[nPos] ), nBytesToRead ) ; + nPos += nBytesToRead ; + return nBytesToRead ; + } + + virtual sal_Int32 SAL_CALL readSomeBytes( + ::com::sun::star::uno::Sequence< sal_Int8 >& aData , + sal_Int32 nMaxBytesToRead + ) throw( NotConnectedException, BufferSizeExceededException, IOException, RuntimeException ) + { + return readBytes( aData, nMaxBytesToRead ) ; + } + + virtual void SAL_CALL skipBytes( + sal_Int32 nBytesToSkip + ) throw( NotConnectedException, BufferSizeExceededException, IOException, RuntimeException ) + { + // not implemented + } + + virtual sal_Int32 SAL_CALL available( + void + ) throw( NotConnectedException, IOException, RuntimeException ) + { + return m_seq.getLength() - nPos ; + } + + virtual void SAL_CALL closeInput( + void + ) throw( NotConnectedException, IOException, RuntimeException ) + { + // not needed + } + + private: + sal_Int32 nPos; + Sequence< sal_Int8> m_seq; +} ; + +/** + * Helper : create a input stream from a file + */ +Reference< XInputStream > createStreamFromFile( const OUString sFile ) ; + +/** + * Helper: Implementation of XOutputStream + */ +class OOutputStream : public WeakImplHelper1 < XOutputStream > +{ + public: + OOutputStream( const char *pcFile ) { + strcpy( m_pcFile , pcFile ) ; + m_f = 0 ; + } + + virtual void SAL_CALL writeBytes( + const Sequence< sal_Int8 >& aData + ) throw( NotConnectedException , BufferSizeExceededException , RuntimeException ) { + if( !m_f ) { + m_f = fopen( m_pcFile , "w" ) ; + } + + fwrite( aData.getConstArray() , 1 , aData.getLength() , m_f ) ; + } + + virtual void SAL_CALL flush( + void + ) throw( NotConnectedException , BufferSizeExceededException , RuntimeException ) { + fflush( m_f ) ; + } + + virtual void SAL_CALL closeOutput( + void + ) throw( NotConnectedException , BufferSizeExceededException , RuntimeException ) { + fclose( m_f ) ; + m_f = 0 ; + } + + private: + char m_pcFile[256]; + FILE *m_f; +} ; + +/** + * Helper: Implementation of XUriBinding + */ +class OUriBinding : public WeakImplHelper1 < ::com::sun::star::xml::crypto::XUriBinding > +{ + public: + OUriBinding() { + //Do nothing + } + + OUriBinding( + ::rtl::OUString& aUri, + ::com::sun::star::uno::Reference< com::sun::star::io::XInputStream >& aInputStream ) { + m_vUris.push_back( aUri ) ; + m_vStreams.push_back( aInputStream ) ; + } + + virtual void SAL_CALL setUriBinding( + const ::rtl::OUString& aUri , + const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& aInputStream + ) throw( ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException ) { + m_vUris.push_back( aUri ) ; + m_vStreams.push_back( aInputStream ) ; + } + + virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SAL_CALL getUriBinding( const ::rtl::OUString& uri ) throw( ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException ) { + ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > xInputStream ; + + int size = m_vUris.size() ; + for( int i = 0 ; i<size ; ++i ) { + if( uri == m_vUris[i] ) { + xInputStream = m_vStreams[i]; + break; + } + } + + return xInputStream; + } + + private: + std::vector< ::rtl::OUString > m_vUris ; + std::vector< ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > > m_vStreams ; +} ; + +/** + * Helper : set a output stream to a file + */ +Reference< XOutputStream > createStreamToFile( const OUString sFile ) ; + +/** + * Helper : get service manager and context + */ +Reference< XMultiComponentFactory > serviceManager( Reference< XComponentContext >& xContext , OUString sUnoUrl , OUString sRdbUrl ) throw( RuntimeException , Exception ) ; + diff --git a/xmlsecurity/tools/standalone/mscsfit/makefile.mk b/xmlsecurity/tools/standalone/mscsfit/makefile.mk new file mode 100644 index 000000000000..1ab4575b5226 --- /dev/null +++ b/xmlsecurity/tools/standalone/mscsfit/makefile.mk @@ -0,0 +1,147 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2000, 2010 Oracle and/or its affiliates. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# This file is part of OpenOffice.org. +# +# OpenOffice.org is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License version 3 +# only, as published by the Free Software Foundation. +# +# OpenOffice.org is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License version 3 for more details +# (a copy is included in the LICENSE file that accompanied this code). +# +# You should have received a copy of the GNU Lesser General Public License +# version 3 along with OpenOffice.org. If not, see +# <http://www.openoffice.org/license.html> +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +PRJ=..$/..$/.. + +PRJNAME=xmlsecurity +TARGET=xmlsecurity-mscxsfit +ENABLE_EXCEPTIONS=TRUE +NO_BSYMBOLIC=TRUE +#TARGETTYPE=CUI +LIBTARGET=NO + + +# --- Settings ----------------------------------------------------- + +.INCLUDE : settings.mk +.INCLUDE : $(PRJ)$/util$/target.pmk + +.IF "$(CRYPTO_ENGINE)" == "mscrypto" + +CDEFS += -DXMLSEC_CRYPTO_MSCRYPTO -DXMLSEC_NO_XSLT +SOLARINC += \ + -I$(PRJ)$/source$/xmlsec \ + -I$(PRJ)$/source$/xmlsec$/mscrypt + +# --- Files -------------------------------------------------------- + +SHARE_LIBS = \ + $(CPPULIB) \ + $(CPPUHELPERLIB) \ + $(SALLIB) + +.IF "$(GUI)"=="WNT" +SHARE_LIBS+= "libxml2.lib" "crypt32.lib" "advapi32.lib" "libxmlsec.lib" "libxmlsec-mscrypto.lib" "xsec_xmlsec.lib" "xs_comm.lib" "xs_mscrypt.lib" +.ELSE +SHARE_LIBS+= "-lxml2" "-lnss3" "-lnspr4" "-lxmlsec1" "-lxmlsec1-nss" "-lxsec_xmlsec" "-lxs_comm" "-lxs_nss" +.ENDIF + +SHARE_OBJS = \ + $(OBJ)$/helper.obj + +# +# The 1st application +# + +APP2TARGET= signer +APP2OBJS= \ + $(SHARE_OBJS) \ + $(OBJ)$/signer.obj + +.IF "$(OS)" == "LINUX" +APP2STDLIBS+= -lstdc++ +.ENDIF + +APP2STDLIBS+= \ + $(SHARE_LIBS) + +# +# The 2nd application +# +APP3TARGET= encrypter +APP3OBJS= \ + $(SHARE_OBJS) \ + $(OBJ)$/encrypter.obj + +.IF "$(OS)" == "LINUX" +APP3STDLIBS+= -lstdc++ +.ENDIF + +APP3STDLIBS+= \ + $(SHARE_LIBS) + +# +# The 3rd application +# +APP4TARGET= verifier +APP4OBJS= \ + $(SHARE_OBJS) \ + $(OBJ)$/verifier.obj + +.IF "$(OS)" == "LINUX" +APP4STDLIBS+= -lstdc++ +.ENDIF + +APP4STDLIBS+= \ + $(SHARE_LIBS) + +## +## The 4th application +## +#APP5TARGET= decrypter +#APP5OBJS= \ +# $(SHARE_OBJS) \ +# $(OBJ)$/decrypter.obj +# +#.IF "$(OS)" == "LINUX" +#APP5STDLIBS+= -lstdc++ +#.ENDIF +# +#APP5STDLIBS+= \ +# $(SHARE_LIBS) + +# +# The 5th application +# +APP6TARGET= certmngr +APP6OBJS= \ + $(SHARE_OBJS) \ + $(OBJ)$/certmngr.obj + +.IF "$(OS)" == "LINUX" +APP6STDLIBS+= -lstdc++ +.ENDIF + +APP6STDLIBS+= \ + $(SHARE_LIBS) + +.ENDIF + +# --- Targets ------------------------------------------------------ + +.INCLUDE : target.mk + diff --git a/xmlsecurity/tools/standalone/mscsfit/signer.cxx b/xmlsecurity/tools/standalone/mscsfit/signer.cxx new file mode 100644 index 000000000000..29542ee27492 --- /dev/null +++ b/xmlsecurity/tools/standalone/mscsfit/signer.cxx @@ -0,0 +1,342 @@ +/** -- C++ Source File -- **/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_xmlsecurity.hxx" +#include <stdio.h> +#include "helper.hxx" + +#include "libxml/tree.h" +#include "libxml/parser.h" +#ifndef XMLSEC_NO_XSLT +#include "libxslt/xslt.h" +#endif + +#include "securityenvironment_mscryptimpl.hxx" +#include "xmlelementwrapper_xmlsecimpl.hxx" + +#include "xmlsec/strings.h" +#include "xmlsec/mscrypto/app.h" +#include "xmlsec/xmltree.h" + +#include <rtl/ustring.hxx> + +#include <com/sun/star/beans/PropertyValue.hpp> +#include <com/sun/star/xml/wrapper/XXMLElementWrapper.hpp> +#include <com/sun/star/xml/wrapper/XXMLDocumentWrapper.hpp> +#include <com/sun/star/xml/crypto/XXMLSignature.hpp> +#include <com/sun/star/xml/crypto/XXMLSignatureTemplate.hpp> +#include <com/sun/star/xml/crypto/XXMLSecurityContext.hpp> +#include <com/sun/star/xml/crypto/XSecurityEnvironment.hpp> + +using namespace ::rtl ; +using namespace ::cppu ; +using namespace ::com::sun::star::uno ; +using namespace ::com::sun::star::io ; +using namespace ::com::sun::star::ucb ; +using namespace ::com::sun::star::beans ; +using namespace ::com::sun::star::document ; +using namespace ::com::sun::star::lang ; +using namespace ::com::sun::star::xml::wrapper ; +using namespace ::com::sun::star::xml::crypto ; + + +int SAL_CALL main( int argc, char **argv ) +{ + const char* n_pCertStore ; + HCERTSTORE n_hStoreHandle ; + + xmlDocPtr doc = NULL ; + xmlNodePtr tplNode ; + xmlNodePtr tarNode ; + xmlAttrPtr idAttr ; + xmlChar* idValue ; + xmlAttrPtr uriAttr ; + xmlChar* uriValue ; + OUString* uri = NULL ; + Reference< XUriBinding > xUriBinding ; + FILE* dstFile = NULL ; + + if( argc !=4 && argc != 5 ) { + fprintf( stderr, "Usage: %s <file_url of template> <file_url of result> <rdb file>\n" , argv[0] ) ; + fprintf( stderr, "Or: \t%s <file_url of template> <file_url of result> <rdb file> < Cert Store Name >\n\n" , argv[0] ) ; + return 1 ; + } + + for( int hhh = 0 ; hhh < 4 ; hhh ++ ) { + + //Init libxml and libxslt libraries + xmlInitParser(); + LIBXML_TEST_VERSION + xmlLoadExtDtdDefaultValue = XML_DETECT_IDS | XML_COMPLETE_ATTRS; + xmlSubstituteEntitiesDefault(1); + + #ifndef XMLSEC_NO_XSLT + xmlIndentTreeOutput = 1; + #endif // XMLSEC_NO_XSLT + + //Initialize the crypto engine + if( argc == 5 ) { + n_pCertStore = argv[4] ; + n_hStoreHandle = CertOpenSystemStore( NULL, n_pCertStore ) ; + if( n_hStoreHandle == NULL ) { + fprintf( stderr, "Can not open the system cert store %s\n", n_pCertStore ) ; + return 1 ; + } + } else { + n_pCertStore = NULL ; + n_hStoreHandle = NULL ; + } + xmlSecMSCryptoAppInit( n_pCertStore ) ; + + //Load XML document + doc = xmlParseFile( argv[1] ) ; + if( doc == NULL || xmlDocGetRootElement( doc ) == NULL ) { + fprintf( stderr , "### Cannot load template xml document!\n" ) ; + goto done ; + } + + //Find the signature template + tplNode = xmlSecFindNode( xmlDocGetRootElement( doc ), xmlSecNodeSignature, xmlSecDSigNs ) ; + if( tplNode == NULL ) { + fprintf( stderr , "### Cannot find the signature template!\n" ) ; + goto done ; + } + + //Find the element with ID attribute + //Here we only try to find the "document" node. + tarNode = xmlSecFindNode( xmlDocGetRootElement( doc ), ( xmlChar* )"document", ( xmlChar* )"http://openoffice.org/2000/office" ) ; + if( tarNode == NULL ) { + tarNode = xmlSecFindNode( xmlDocGetRootElement( doc ), ( xmlChar* )"document", NULL ) ; + } + + //Find the "id" attrbute in the element + if( tarNode != NULL ) { + if( ( idAttr = xmlHasProp( tarNode, ( xmlChar* )"id" ) ) != NULL ) { + //NULL + } else if( ( idAttr = xmlHasProp( tarNode, ( xmlChar* )"Id" ) ) != NULL ) { + //NULL + } else { + idAttr = NULL ; + } + } + + //Add ID to DOM + if( idAttr != NULL ) { + idValue = xmlNodeListGetString( tarNode->doc, idAttr->children, 1 ) ; + if( idValue == NULL ) { + fprintf( stderr , "### the ID value is NULL!\n" ) ; + goto done ; + } + + if( xmlAddID( NULL, doc, idValue, idAttr ) == NULL ) { + fprintf( stderr , "### Can not add the ID value!\n" ) ; + goto done ; + } + } + + //Reference handler + //Find the signature reference + tarNode = xmlSecFindNode( tplNode, xmlSecNodeReference, xmlSecDSigNs ) ; + if( tarNode == NULL ) { + fprintf( stderr , "### Cannot find the signature reference!\n" ) ; + goto done ; + } + + //Find the "URI" attrbute in the reference + uriAttr = xmlHasProp( tarNode, ( xmlChar* )"URI" ) ; + if( tarNode == NULL ) { + fprintf( stderr , "### Cannot find URI of the reference!\n" ) ; + goto done ; + } + + //Get the "URI" attrbute value + uriValue = xmlNodeListGetString( tarNode->doc, uriAttr->children, 1 ) ; + if( uriValue == NULL ) { + fprintf( stderr , "### the URI value is NULL!\n" ) ; + goto done ; + } + + if( strchr( ( const char* )uriValue, '/' ) != NULL && strchr( ( const char* )uriValue, '#' ) == NULL ) { + fprintf( stdout , "### Find a stream URI [%s]\n", uriValue ) ; + // uri = new ::rtl::OUString( ( const sal_Unicode* )uriValue ) ; + uri = new ::rtl::OUString( ( const sal_Char* )uriValue, xmlStrlen( uriValue ), RTL_TEXTENCODING_ASCII_US ) ; + } + + if( uri != NULL ) { + fprintf( stdout , "### Find the URI [%s]\n", OUStringToOString( *uri , RTL_TEXTENCODING_ASCII_US ).getStr() ) ; + Reference< XInputStream > xStream = createStreamFromFile( *uri ) ; + if( !xStream.is() ) { + fprintf( stderr , "### Can not get the URI stream!\n" ) ; + goto done ; + } + + xUriBinding = new OUriBinding( *uri, xStream ) ; + } + + try { + Reference< XMultiComponentFactory > xManager = NULL ; + Reference< XComponentContext > xContext = NULL ; + + xManager = serviceManager( xContext , OUString::createFromAscii( "local" ), OUString::createFromAscii( argv[3] ) ) ; + OSL_ENSURE( xManager.is() , + "ServicesManager - " + "Cannot get service manager" ) ; + + //Create signature template + Reference< XInterface > element = + xManager->createInstanceWithContext( OUString::createFromAscii( "com.sun.star.xml.security.bridge.xmlsec.XMLElementWrapper_XmlSecImpl" ) , xContext ) ; + OSL_ENSURE( element.is() , + "Signer - " + "Cannot get service instance of \"wrapper.XMLElementWrapper\"" ) ; + + Reference< XXMLElementWrapper > xElement( element , UNO_QUERY ) ; + OSL_ENSURE( xElement.is() , + "Signer - " + "Cannot get interface of \"XXMLElement\" from service \"xsec.XMLElement\"" ) ; + + Reference< XUnoTunnel > xEleTunnel( xElement , UNO_QUERY ) ; + OSL_ENSURE( xEleTunnel.is() , + "Signer - " + "Cannot get interface of \"XUnoTunnel\" from service \"xsec.XMLElement\"" ) ; + + XMLElementWrapper_XmlSecImpl* pElement = ( XMLElementWrapper_XmlSecImpl* )xEleTunnel->getSomething( XMLElementWrapper_XmlSecImpl::getUnoTunnelImplementationId() ) ; + OSL_ENSURE( pElement != NULL , + "Signer - " + "Cannot get implementation of \"xsec.XMLElement\"" ) ; + + //Set signature template + pElement->setNativeElement( tplNode ) ; + + //Build XML Signature template + Reference< XInterface > signtpl = + xManager->createInstanceWithContext( OUString::createFromAscii( "com.sun.star.xml.crypto.XMLSignatureTemplate" ) , xContext ) ; + OSL_ENSURE( signtpl.is() , + "Signer - " + "Cannot get service instance of \"xsec.XMLSignatureTemplate\"" ) ; + + Reference< XXMLSignatureTemplate > xTemplate( signtpl , UNO_QUERY ) ; + OSL_ENSURE( xTemplate.is() , + "Signer - " + "Cannot get interface of \"XXMLSignatureTemplate\" from service \"xsec.XMLSignatureTemplate\"" ) ; + + //Import the signature template + xTemplate->setTemplate( xElement ) ; + + //Import the URI/Stream binding + if( xUriBinding.is() ) + xTemplate->setBinding( xUriBinding ) ; + + //Create security environment + //Build Security Environment + Reference< XInterface > xsecenv = + xManager->createInstanceWithContext( OUString::createFromAscii("com.sun.star.xml.security.bridge.xmlsec.SecurityEnvironment_MSCryptImpl"), xContext ) ; + OSL_ENSURE( xsecenv.is() , + "Signer - " + "Cannot get service instance of \"xsec.SecurityEnvironment\"" ) ; + + Reference< XSecurityEnvironment > xSecEnv( xsecenv , UNO_QUERY ) ; + OSL_ENSURE( xSecEnv.is() , + "Signer - " + "Cannot get interface of \"XSecurityEnvironment\" from service \"xsec.SecurityEnvironment\"" ) ; + + //Setup key slot and certDb + Reference< XUnoTunnel > xEnvTunnel( xsecenv , UNO_QUERY ) ; + OSL_ENSURE( xElement.is() , + "Signer - " + "Cannot get interface of \"XUnoTunnel\" from service \"xsec.SecurityEnvironment\"" ) ; + + SecurityEnvironment_MSCryptImpl* pSecEnv = ( SecurityEnvironment_MSCryptImpl* )xEnvTunnel->getSomething( SecurityEnvironment_MSCryptImpl::getUnoTunnelId() ) ; + OSL_ENSURE( pSecEnv != NULL , + "Signer - " + "Cannot get implementation of \"xsec.SecurityEnvironment\"" ) ; + + //Setup key slot and certDb + if( n_hStoreHandle != NULL ) { + pSecEnv->setCryptoSlot( n_hStoreHandle ) ; + pSecEnv->setCertDb( n_hStoreHandle ) ; + } else { + pSecEnv->enableDefaultCrypt( sal_True ) ; + } + + //Build XML Security Context + Reference< XInterface > xmlsecctx = + xManager->createInstanceWithContext( OUString::createFromAscii("com.sun.star.xml.security.bridge.xmlsec.XMLSecurityContext_MSCryptImpl"), xContext ) ; + OSL_ENSURE( xsecenv.is() , + "Signer - " + "Cannot get service instance of \"xsec.XMLSecurityContext\"" ) ; + + Reference< XXMLSecurityContext > xSecCtx( xmlsecctx , UNO_QUERY ) ; + OSL_ENSURE( xSecCtx.is() , + "Signer - " + "Cannot get interface of \"XXMLSecurityContext\" from service \"xsec.XMLSecurityContext\"" ) ; + + xSecCtx->addSecurityEnvironment( xSecEnv ) ; + + //Generate XML signature + Reference< XInterface > xmlsigner = + xManager->createInstanceWithContext( OUString::createFromAscii("com.sun.star.xml.security.bridge.xmlsec.XMLSignature_MSCryptImpl"), xContext ) ; + OSL_ENSURE( xmlsigner.is() , + "Signer - " + "Cannot get service instance of \"xsec.XMLSignature\"" ) ; + + Reference< XXMLSignature > xSigner( xmlsigner , UNO_QUERY ) ; + OSL_ENSURE( xSigner.is() , + "Signer - " + "Cannot get interface of \"XXMLSignature\" from service \"xsec.XMLSignature\"" ) ; + + //perform signature + xTemplate = xSigner->generate( xTemplate , xSecEnv ) ; + OSL_ENSURE( xTemplate.is() , + "Signer - " + "Cannot generate the xml signature" ) ; + + SecurityOperationStatus m_nStatus = xTemplate->getStatus(); + + if (m_nStatus == SecurityOperationStatus_OPERATION_SUCCEEDED) + { + fprintf( stdout, "Operation succeeds.\n") ; + } + else + { + fprintf( stdout, "Operation fails.\n") ; + } + } catch( Exception& e ) { + fprintf( stderr , "Error Message: %s\n" , OUStringToOString( e.Message , RTL_TEXTENCODING_ASCII_US ).getStr() ) ; + goto done ; + } + + dstFile = fopen( argv[2], "w" ) ; + if( dstFile == NULL ) { + fprintf( stderr , "### Can not open file %s\n", argv[2] ) ; + goto done ; + } + + //Save result + xmlDocDump( dstFile, doc ) ; + +done: + if( uri != NULL ) + delete uri ; + + if( dstFile != NULL ) + fclose( dstFile ) ; + + if( doc != NULL ) + xmlFreeDoc( doc ) ; + + if( n_hStoreHandle != NULL ) + CertCloseStore( n_hStoreHandle, CERT_CLOSE_STORE_FORCE_FLAG ) ; + + xmlSecMSCryptoAppShutdown() ; + + /* Shutdown libxslt/libxml */ + #ifndef XMLSEC_NO_XSLT + xsltCleanupGlobals(); + #endif /* XMLSEC_NO_XSLT */ + xmlCleanupParser(); + + } + + return 0; +} + diff --git a/xmlsecurity/tools/standalone/mscsfit/util/makefile.mk b/xmlsecurity/tools/standalone/mscsfit/util/makefile.mk new file mode 100644 index 000000000000..16236ab60dfc --- /dev/null +++ b/xmlsecurity/tools/standalone/mscsfit/util/makefile.mk @@ -0,0 +1,174 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2000, 2010 Oracle and/or its affiliates. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# This file is part of OpenOffice.org. +# +# OpenOffice.org is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License version 3 +# only, as published by the Free Software Foundation. +# +# OpenOffice.org is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License version 3 for more details +# (a copy is included in the LICENSE file that accompanied this code). +# +# You should have received a copy of the GNU Lesser General Public License +# version 3 along with OpenOffice.org. If not, see +# <http://www.openoffice.org/license.html> +# for a copy of the LGPLv3 License. +# +#************************************************************************* +PRJ=..$/..$/..$/.. + +PRJNAME=xmlsecurity +TARGET=xmlsecurity-mscsfit-boot +TARGETTYPE=GUI + +GEN_HID=TRUE +APP2NOSAL=TRUE + +# --- Settings ----------------------------------------------------------- +USE_JAVAVER=TRUE + +.INCLUDE : settings.mk +.INCLUDE : $(PRJ)$/util$/target.pmk + +VERINFONAME=verinfo + +.INCLUDE : target.mk + +# ------------------------------------------------------------------------- +# --- Targets ------------------------------------------------------------- + +ALLTAR : $(BIN)$/boot_services.rdb + +REGISTERLIBS= \ + i18npool.uno$(DLLPOST) \ + $(DLLPRE)tk$(DLLPOSTFIX)$(DLLPOST) \ + $(DLLPRE)mcnttype$(DLLPOST) + +# $(DLLPRE)i18n$(DLLPOSTFIX)$(DLLPOST) \ +# $(DLLPRE)i18npool$(DLLPOSTFIX)$(DLLPOST) \ +# $(DLLPRE)tk$(DLLPOSTFIX)$(DLLPOST) \ +# $(DLLPRE)mcnttype$(DLLPOST) + +# Additional libraries +DLLPRE_NO= +REGISTERLIBS+= \ + $(DLLPRE_NO)dynamicloader.uno$(DLLPOST) \ + $(DLLPRE_NO)namingservice.uno$(DLLPOST) \ + $(DLLPRE_NO)bootstrap.uno$(DLLPOST) \ + $(DLLPRE)xsec_fw$(DLLPOST) \ + $(DLLPRE)xsec_xmlsec$(DLLPOST) + +.IF "$(GUI)" == "UNX" +MY_DLLDIR=$(SOLARLIBDIR) +REGISTERLIBS+= \ + $(DLLPRE)dtransX11$(DLLPOSTFIX)$(DLLPOST) + +.ELSE # "$(GUI)" == "UNX" +.IF "$(GUI)"=="WNT" + +MY_DLLDIR=$(SOLARBINDIR) +REGISTERLIBS+= \ + $(DLLPRE)sysdtrans$(DLLPOST) \ + $(DLLPRE)ftransl$(DLLPOST) \ + $(DLLPRE)dnd$(DLLPOST) + +.ELSE # "$(GUI)"=="WNT" + + @echo "**********************************************************" + @echo "*** unknown platform: don't know which librarys to use ***" + @echo "**********************************************************" + force_dmake_to_error +.ENDIF # "$(GUI)"=="WNT" +.ENDIF # "$(GUI)" == "UNX" + +.IF "$(SOLAR_JAVA)" != "" +.IF "$(JAVANUMVER)" >= "000100040000" +# native libraries, which are only necessary, when java shall run within setup +REGISTERLIBS_JAVA= \ + javavm.uno$(DLLPOST) \ + javaloader.uno$(DLLPOST) + +# add here java components, which shall run with setup +REGISTERJARS=\ + java_uno_accessbridge.jar +# xsec_jxsec.jar + +# jar-files, which regcomp needs so that it can use java +REGCOMP_JARS=unoil.jar java_uno.jar ridl.jar jurt.jar juh.jar + +# CLASSPATH, which regcomp needs to be run +# $(SOLARLIBDIR) needs to be included in case Java components are registered, +# because java_uno.jar needs to find the native java_uno shared library: +MY_CLASSPATH_TMP=$(foreach,i,$(REGCOMP_JARS) $(SOLARBINDIR)$/$i)$(PATH_SEPERATOR)$(SOLARLIBDIR)$(PATH_SEPERATOR)$(XCLASSPATH) +REGCOMP_CLASSPATH=$(strip $(subst,!,$(PATH_SEPERATOR) $(MY_CLASSPATH_TMP:s/ /!/))) + +.IF "$(GUI)"!="WNT" +DOLLAR_SIGN=\$$ +MY_JAVA_COMPPATH=file://$(SOLARBINDIR) +.IF "$(OS)"=="MACOSX" +REGCOMP_ENV=\ + setenv CLASSPATH $(REGCOMP_CLASSPATH) && \ + setenv DYLD_LIBRARY_PATH $(DYLD_LIBRARY_PATH):$(JDKLIB) +.ELSE +REGCOMP_ENV=\ + setenv CLASSPATH $(REGCOMP_CLASSPATH) && \ + setenv LD_LIBRARY_PATH $(LD_LIBRARY_PATH):$(JDKLIB) +.ENDIF +.ELSE # "$(GUI)" != "WNT" +.IF "$(USE_SHELL)" != "4nt" +DOLLAR_SIGN=\$$ +REGCOMP_ENV=\ + setenv CLASSPATH "$(strip $(subst,\,/ $(shell @guw.pl echo $(REGCOMP_CLASSPATH))))" && \ + setenv PATH "$(PATH):$(JREPATH)" +MY_JAVA_COMPPATH=$(strip $(subst,\,/ file:///$(shell @guw.pl echo $(SOLARBINDIR)))) +.ELSE # "$(USE_SHELL)" != "4nt" +DOLLAR_SIGN=$$ +REGCOMP_ENV=\ + set CLASSPATH=$(REGCOMP_CLASSPATH) && \ + set PATH=$(PATH);$(JREPATH) +MY_JAVA_COMPPATH=$(strip $(subst,\,/ file:///$(SOLARBINDIR))) +.ENDIF # "$(USE_SHELL)" != "4nt" +.ENDIF # "$(GUI)"!="WNT" +.ENDIF # "$(JAVANUMVER)" >= "000100040000" +.ENDIF # "$(SOLAR_JAVA)" != "" + +$(BIN)$/boot_services.rdb: \ + makefile.mk \ + $(foreach,i,$(REGISTERLIBS) $(MY_DLLDIR)$/$(i)) \ + $(foreach,i,$(REGISTERLIBS_JAVA) $(MY_DLLDIR)$/$(i)) + -rm -f $@ $(BIN)$/regcomp.rdb $(BIN)$/boot_services.tmp +# register the native libraries + $(REGCOMP) -register -r $(BIN)$/boot_services.tmp -c "$(strip $(REGISTERLIBS))" +.IF "$(SOLAR_JAVA)" != "" +.IF "$(OS)"!="MACOSX" +.IF "$(JAVANUMVER)" >= "000100040000" + $(REGCOMP) -register -r $(BIN)$/boot_services.tmp -c "$(strip $(REGISTERLIBS_JAVA))" +# prepare a registry which regcomp can work on (types+java services) + $(REGCOMP) -register -r $(BIN)$/regcomp.rdb -c "$(strip $(REGISTERLIBS_JAVA))" + $(REGMERGE) $(BIN)$/regcomp.rdb / $(SOLARBINDIR)/udkapi.rdb +# now do the registration + $(REGCOMP_ENV) && \ + $(REGCOMP) -br $(BIN)$/regcomp.rdb \ + -register \ + -r $(BIN)$/boot_services.tmp \ + -l com.sun.star.loader.Java2 \ + -env:UNO_JAVA_COMPPATH=$(MY_JAVA_COMPPATH) \ + $(foreach,i,$(REGISTERJARS) -c vnd.sun.star.expand:$(DOLLAR_SIGN)UNO_JAVA_COMPPATH/$(i)) +# $(foreach,i,$(REGISTERJARS) -c vnd.sun.star.expand:$(DOLLAR_SIGN)UNO_JAVA_COMPPATH/$(i)) -c $(MY_JAVA_COMPPATH)$/xsec_jxsec.jar + +.ENDIF # "$(JAVANUMVER)" >= "000100040000" +.ENDIF # "$(OS)" != "MACOSX" +.ENDIF # "$(SOLAR_JAVA)" != "" +# to have a transaction, move it now to the final name + $(REGMERGE) $(BIN)$/boot_services.tmp / $(SOLARBINDIR)/types.rdb + mv $(BIN)$/boot_services.tmp $@ + diff --git a/xmlsecurity/tools/standalone/mscsfit/verifier.cxx b/xmlsecurity/tools/standalone/mscsfit/verifier.cxx new file mode 100644 index 000000000000..fa4325718fd1 --- /dev/null +++ b/xmlsecurity/tools/standalone/mscsfit/verifier.cxx @@ -0,0 +1,328 @@ +/** -- C++ Source File -- **/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_xmlsecurity.hxx" +#include <stdio.h> +#include "helper.hxx" + +#include "libxml/tree.h" +#include "libxml/parser.h" +#ifndef XMLSEC_NO_XSLT +#include "libxslt/xslt.h" +#endif + +#include "securityenvironment_mscryptimpl.hxx" +#include "xmlelementwrapper_xmlsecimpl.hxx" + +#include "xmlsec/strings.h" +#include "xmlsec/mscrypto/app.h" +#include "xmlsec/xmltree.h" + +#include <rtl/ustring.hxx> +#include <cppuhelper/servicefactory.hxx> + +#include <com/sun/star/lang/XComponent.hpp> +#include <com/sun/star/beans/PropertyValue.hpp> +#include <com/sun/star/xml/wrapper/XXMLElementWrapper.hpp> +#include <com/sun/star/xml/wrapper/XXMLDocumentWrapper.hpp> +#include <com/sun/star/xml/crypto/XXMLSignature.hpp> +#include <com/sun/star/xml/crypto/XXMLSignatureTemplate.hpp> +#include <com/sun/star/xml/crypto/XXMLSecurityContext.hpp> +#include <com/sun/star/xml/crypto/XSecurityEnvironment.hpp> + +using namespace ::rtl ; +using namespace ::cppu ; +using namespace ::com::sun::star::uno ; +using namespace ::com::sun::star::io ; +using namespace ::com::sun::star::ucb ; +using namespace ::com::sun::star::beans ; +using namespace ::com::sun::star::document ; +using namespace ::com::sun::star::lang ; +using namespace ::com::sun::star::registry ; +using namespace ::com::sun::star::xml::wrapper ; +using namespace ::com::sun::star::xml::crypto ; + + +int SAL_CALL main( int argc, char **argv ) +{ + const char* n_pCertStore ; + HCERTSTORE n_hStoreHandle ; + + xmlDocPtr doc = NULL ; + xmlNodePtr tplNode ; + xmlNodePtr tarNode ; + xmlAttrPtr idAttr ; + xmlChar* idValue ; + xmlAttrPtr uriAttr ; + xmlChar* uriValue ; + OUString* uri = NULL ; + Reference< XUriBinding > xUriBinding ; + FILE* dstFile = NULL ; + + if( argc !=3 && argc != 4 ) { + fprintf( stderr, "Usage: %s <file_url> <rdb file>\n" , argv[0] ) ; + fprintf( stderr, "Or: \t%s <file_url> <rdb file> < Cert Store Name >\n\n" , argv[0] ) ; + return 1 ; + } + + for( int hhh = 0 ; hhh < 1 ; hhh ++ ) { + + //Init libxml and libxslt libraries + xmlInitParser(); + LIBXML_TEST_VERSION + xmlLoadExtDtdDefaultValue = XML_DETECT_IDS | XML_COMPLETE_ATTRS; + xmlSubstituteEntitiesDefault(1); + + #ifndef XMLSEC_NO_XSLT + xmlIndentTreeOutput = 1; + #endif // XMLSEC_NO_XSLT + + //Initialize the crypto engine + if( argc == 4 ) { + n_pCertStore = argv[3] ; + n_hStoreHandle = CertOpenSystemStore( NULL, n_pCertStore ) ; + if( n_hStoreHandle == NULL ) { + fprintf( stderr, "Can not open the system cert store %s\n", n_pCertStore ) ; + return 1 ; + } + } else { + n_pCertStore = NULL ; + n_hStoreHandle = NULL ; + } + xmlSecMSCryptoAppInit( n_pCertStore ) ; + + //Load XML document + doc = xmlParseFile( argv[1] ) ; + if( doc == NULL || xmlDocGetRootElement( doc ) == NULL ) { + fprintf( stderr , "### Cannot load template xml document!\n" ) ; + goto done ; + } + + //Find the signature template + tplNode = xmlSecFindNode( xmlDocGetRootElement( doc ), xmlSecNodeSignature, xmlSecDSigNs ) ; + if( tplNode == NULL ) { + fprintf( stderr , "### Cannot find the signature template!\n" ) ; + goto done ; + } + + //Find the element with ID attribute + tarNode = xmlSecFindNode( xmlDocGetRootElement( doc ), ( xmlChar* )"document", ( xmlChar* )"http://openoffice.org/2000/office" ) ; + if( tarNode == NULL ) { + tarNode = xmlSecFindNode( xmlDocGetRootElement( doc ), ( xmlChar* )"document", NULL ) ; + } + + //Find the "id" attrbute in the element + if( tarNode != NULL ) { + if( ( idAttr = xmlHasProp( tarNode, ( xmlChar* )"id" ) ) != NULL ) { + //NULL + } else if( ( idAttr = xmlHasProp( tarNode, ( xmlChar* )"Id" ) ) != NULL ) { + //NULL + } else { + idAttr = NULL ; + } + } + + //Add ID to DOM + if( idAttr != NULL ) { + idValue = xmlNodeListGetString( tarNode->doc, idAttr->children, 1 ) ; + if( idValue == NULL ) { + fprintf( stderr , "### the ID value is NULL!\n" ) ; + goto done ; + } + + if( xmlAddID( NULL, doc, idValue, idAttr ) == NULL ) { + fprintf( stderr , "### Can not add the ID value!\n" ) ; + goto done ; + } + } + + //Reference handler + //Find the signature reference + tarNode = xmlSecFindNode( tplNode, xmlSecNodeReference, xmlSecDSigNs ) ; + if( tarNode == NULL ) { + fprintf( stderr , "### Cannot find the signature reference!\n" ) ; + goto done ; + } + + //Find the "URI" attrbute in the reference + uriAttr = xmlHasProp( tarNode, ( xmlChar* )"URI" ) ; + if( tarNode == NULL ) { + fprintf( stderr , "### Cannot find URI of the reference!\n" ) ; + goto done ; + } + + //Get the "URI" attrbute value + uriValue = xmlNodeListGetString( tarNode->doc, uriAttr->children, 1 ) ; + if( uriValue == NULL ) { + fprintf( stderr , "### the URI value is NULL!\n" ) ; + goto done ; + } + + if( strchr( ( const char* )uriValue, '/' ) != NULL && strchr( ( const char* )uriValue, '#' ) == NULL ) { + fprintf( stdout , "### Find a stream URI [%s]\n", uriValue ) ; + // uri = new ::rtl::OUString( ( const sal_Unicode* )uriValue ) ; + uri = new ::rtl::OUString( ( const sal_Char* )uriValue, xmlStrlen( uriValue ), RTL_TEXTENCODING_ASCII_US ) ; + } + + if( uri != NULL ) { + fprintf( stdout , "### Find the URI [%s]\n", OUStringToOString( *uri , RTL_TEXTENCODING_ASCII_US ).getStr() ) ; + Reference< XInputStream > xStream = createStreamFromFile( *uri ) ; + if( !xStream.is() ) { + fprintf( stderr , "### Can not get the URI stream!\n" ) ; + goto done ; + } + + xUriBinding = new OUriBinding( *uri, xStream ) ; + } + + + try { + Reference< XMultiComponentFactory > xManager = NULL ; + Reference< XComponentContext > xContext = NULL ; + + xManager = serviceManager( xContext , OUString::createFromAscii( "local" ), OUString::createFromAscii( argv[2] ) ) ; + + //Create signature template + Reference< XInterface > element = + xManager->createInstanceWithContext( OUString::createFromAscii( "com.sun.star.xml.security.bridge.xmlsec.XMLElementWrapper_XmlSecImpl" ) , xContext ) ; + OSL_ENSURE( element.is() , + "Verifier - " + "Cannot get service instance of \"xsec.XMLElementWrapper\"" ) ; + + Reference< XXMLElementWrapper > xElement( element , UNO_QUERY ) ; + OSL_ENSURE( xElement.is() , + "Verifier - " + "Cannot get interface of \"XXMLElementWrapper\" from service \"xsec.XMLElementWrapper\"" ) ; + + Reference< XUnoTunnel > xEleTunnel( xElement , UNO_QUERY ) ; + OSL_ENSURE( xEleTunnel.is() , + "Verifier - " + "Cannot get interface of \"XUnoTunnel\" from service \"xsec.XMLElement\"" ) ; + + XMLElementWrapper_XmlSecImpl* pElement = ( XMLElementWrapper_XmlSecImpl* )xEleTunnel->getSomething( XMLElementWrapper_XmlSecImpl::getUnoTunnelImplementationId() ) ; + OSL_ENSURE( pElement != NULL , + "Verifier - " + "Cannot get implementation of \"xsec.XMLElementWrapper\"" ) ; + + //Set signature template + pElement->setNativeElement( tplNode ) ; + + //Build XML Signature template + Reference< XInterface > signtpl = + xManager->createInstanceWithContext( OUString::createFromAscii("com.sun.star.xml.crypto.XMLSignatureTemplate"), xContext ) ; + OSL_ENSURE( signtpl.is() , + "Verifier - " + "Cannot get service instance of \"xsec.XMLSignatureTemplate\"" ) ; + + Reference< XXMLSignatureTemplate > xTemplate( signtpl , UNO_QUERY ) ; + OSL_ENSURE( xTemplate.is() , + "Verifier - " + "Cannot get interface of \"XXMLSignatureTemplate\" from service \"xsec.XMLSignatureTemplate\"" ) ; + + //Import the signature template + xTemplate->setTemplate( xElement ) ; + + //Import the URI/Stream binding + if( xUriBinding.is() ) + xTemplate->setBinding( xUriBinding ) ; + + //Create security environment + //Build Security Environment + Reference< XInterface > xsecenv = + xManager->createInstanceWithContext( OUString::createFromAscii("com.sun.star.xml.security.bridge.xmlsec.SecurityEnvironment_MSCryptImpl"), xContext ) ; + OSL_ENSURE( xsecenv.is() , + "Verifier - " + "Cannot get service instance of \"xsec.SecurityEnvironment\"" ) ; + + Reference< XSecurityEnvironment > xSecEnv( xsecenv , UNO_QUERY ) ; + OSL_ENSURE( xSecEnv.is() , + "Verifier - " + "Cannot get interface of \"XSecurityEnvironment\" from service \"xsec.SecurityEnvironment\"" ) ; + + //Setup key slot and certDb + Reference< XUnoTunnel > xEnvTunnel( xsecenv , UNO_QUERY ) ; + OSL_ENSURE( xElement.is() , + "Verifier - " + "Cannot get interface of \"XUnoTunnel\" from service \"xsec.SecurityEnvironment\"" ) ; + + SecurityEnvironment_MSCryptImpl* pSecEnv = ( SecurityEnvironment_MSCryptImpl* )xEnvTunnel->getSomething( SecurityEnvironment_MSCryptImpl::getUnoTunnelId() ) ; + OSL_ENSURE( pSecEnv != NULL , + "Verifier - " + "Cannot get implementation of \"xsec.SecurityEnvironment\"" ) ; + + //Setup key slot and certDb + if( n_hStoreHandle != NULL ) { + pSecEnv->setCryptoSlot( n_hStoreHandle ) ; + pSecEnv->setCertDb( n_hStoreHandle ) ; + } else { + pSecEnv->enableDefaultCrypt( sal_True ) ; + } + + //Build XML Security Context + Reference< XInterface > xmlsecctx = + xManager->createInstanceWithContext( OUString::createFromAscii("com.sun.star.xml.security.bridge.xmlsec.XMLSecurityContext_MSCryptImpl"), xContext ) ; + OSL_ENSURE( xsecenv.is() , + "Verifier - " + "Cannot get service instance of \"xsec.XMLSecurityContext\"" ) ; + + Reference< XXMLSecurityContext > xSecCtx( xmlsecctx , UNO_QUERY ) ; + OSL_ENSURE( xSecCtx.is() , + "Verifier - " + "Cannot get interface of \"XXMLSecurityContext\" from service \"xsec.XMLSecurityContext\"" ) ; + + xSecCtx->addSecurityEnvironment( xSecEnv ) ; + + //Generate XML signature + Reference< XInterface > xmlsigner = + xManager->createInstanceWithContext( OUString::createFromAscii("com.sun.star.xml.security.bridge.xmlsec.XMLSignature_MSCryptImpl"), xContext ) ; + OSL_ENSURE( xmlsigner.is() , + "Verifier - " + "Cannot get service instance of \"xsec.XMLSignature\"" ) ; + + Reference< XXMLSignature > xSigner( xmlsigner , UNO_QUERY ) ; + OSL_ENSURE( xSigner.is() , + "Verifier - " + "Cannot get interface of \"XXMLSignature\" from service \"xsec.XMLSignature\"" ) ; + + + //perform validation + xTemplate = xSigner->validate( xTemplate , xSecCtx ) ; + + com::sun::star::xml::crypto::SecurityOperationStatus m_nStatus = xTemplate->getStatus(); + + if (m_nStatus == SecurityOperationStatus_OPERATION_SUCCEEDED) + { + fprintf( stdout, "Operation succeeds.\n") ; + } + else + { + fprintf( stdout, "Operation fails.\n") ; + } + } catch( Exception& e ) { + fprintf( stderr , "Error Message: %s\n" , OUStringToOString( e.Message , RTL_TEXTENCODING_ASCII_US ).getStr() ) ; + goto done ; + } + +done : + if( uri != NULL ) + delete uri ; + + if( doc != NULL ) + xmlFreeDoc( doc ) ; + + if( n_hStoreHandle != NULL ) + CertCloseStore( n_hStoreHandle, CERT_CLOSE_STORE_FORCE_FLAG ) ; + + xmlSecMSCryptoAppShutdown() ; + + /* Shutdown libxslt/libxml */ + #ifndef XMLSEC_NO_XSLT + xsltCleanupGlobals(); + #endif /* XMLSEC_NO_XSLT */ + xmlCleanupParser(); + + } + + return 0 ; +} + diff --git a/xmlsecurity/tools/standalone/readme.txt b/xmlsecurity/tools/standalone/readme.txt new file mode 100644 index 000000000000..8ea7fa2ffbf2 --- /dev/null +++ b/xmlsecurity/tools/standalone/readme.txt @@ -0,0 +1,19 @@ +How to use the standalone program + +After building, there is two programs named jsfit.dsig.signer and jsfit.dsig.verifier under the class folder, these two program are used to test the jsr based bridge component. + +After installation, you need do following step to launch the program. + +1) create a temporary folder + +2) copy services.rdb, types.rdb and setup_services.rdb from the <OpenOffice>/program folder to the temporary folder, + +3) in the temporary folder, merge both the types.rdb and the setup_services.rdb into the services.rdb. + +4) register jsr-based component into services.rdb + +5) run the signer program + +6) run the verifier program + +7) remove the temporary folder diff --git a/xmlsecurity/tools/uno/AdapterNode.java b/xmlsecurity/tools/uno/AdapterNode.java new file mode 100644 index 000000000000..bed8e2a3631c --- /dev/null +++ b/xmlsecurity/tools/uno/AdapterNode.java @@ -0,0 +1,165 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +package com.sun.star.xml.security.uno; + +import org.w3c.dom.Node; +import org.w3c.dom.Attr; +import org.w3c.dom.NamedNodeMap; + + +/* + * This class wraps a DOM node and returns the text we want to + * display in the tree. It also returns children, index values, + * and child counts. + */ +class AdapterNode +{ + private Node m_domNode; + static final int ELEMENT_TYPE = Node.ELEMENT_NODE; + + /* + * An array of names for DOM node-types + */ + static final String[] typeName = { + "none", + "Element", + "Attr", + "Text", + "CDATA", + "EntityRef", + "Entity", + "ProcInstr", + "Comment", + "Document", + "DocType", + "DocFragment", + "Notation", + }; + + protected Node getNode() + { + return m_domNode; + } + + /* + * Construct an Adapter node from a DOM node + */ + protected AdapterNode(org.w3c.dom.Node node) + { + m_domNode = node; + } + + /* + * Return children, index, and count values + */ + protected int index(AdapterNode child) + { + int count = childCount(); + for (int i=0; i<count; ++i) + { + AdapterNode n = this.child(i); + if (child.m_domNode == n.m_domNode) return i; + } + return -1; + } + + protected AdapterNode child(int searchIndex) + { + if (m_domNode == null) return null; + + /* + * Note: JTree index is zero-based. + */ + org.w3c.dom.Node node = + m_domNode.getChildNodes().item(searchIndex); + + return new AdapterNode(node); + } + + protected int childCount() + { + int rc = 0; + + if (m_domNode != null) + { + rc = m_domNode.getChildNodes().getLength(); + } + + return rc; + } + + /* + * Return a string that identifies this node in the tree + */ + public String toString() + { + String rc = null; + + if (m_domNode != null) + { + String s = typeName[m_domNode.getNodeType()]; + String nodeName = m_domNode.getNodeName(); + + if (! nodeName.startsWith("#")) + { + s += ": " + nodeName; + } + + if (m_domNode.getNodeValue() != null) + { + if (s.startsWith("ProcInstr")) + { + s += ", "; + } + else + { + s += ": "; + } + + String t = m_domNode.getNodeValue(); + s += t; + } + + if (m_domNode.getNodeType() == ELEMENT_TYPE) + { + NamedNodeMap attrs = m_domNode.getAttributes(); + + int length = attrs.getLength(); + for (int i=0; i<length; ++i) + { + Attr attr = (Attr)(attrs.item(i)); + s += " "+ attr.getName()+"='"+attr.getValue() + "'"; + } + } + rc = s; + } + + return rc; + } +} + diff --git a/xmlsecurity/tools/uno/AttributeListHelper.java b/xmlsecurity/tools/uno/AttributeListHelper.java new file mode 100644 index 000000000000..c95067bcecb6 --- /dev/null +++ b/xmlsecurity/tools/uno/AttributeListHelper.java @@ -0,0 +1,148 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +package com.sun.star.xml.security.uno; + +import java.util.Vector; +import com.sun.star.xml.sax.XAttributeList; + +/** + * Class to construct an attribute list, and provide a XAttributeList + * interface. + * + * @author Michael Mi + * @version %I%, %G% + */ +public class AttributeListHelper implements com.sun.star.xml.sax.XAttributeList +{ + private Vector m_AttributeList; + + public AttributeListHelper() + { + m_AttributeList = new Vector(); + } + + public void clear() + { + m_AttributeList.removeAllElements(); + } + + public void setAttribute(String name, String type, String value) + { + int nLength = m_AttributeList.size(); + boolean bFound = false; + + for (int i=0; i<nLength; ++i) + { + if (getNameByIndex((short)i).equals(name)) + { + Vector attribute = (Vector)m_AttributeList.get(i); + attribute.setElementAt(type,1); + attribute.setElementAt(value,2); + bFound = true; + break; + } + } + + if (!bFound) + { + Vector attribute = new Vector(); + attribute.addElement(name); + attribute.addElement(type); + attribute.addElement(value); + m_AttributeList.addElement(attribute); + } + } + + public String getAttributeItem(short index, int itemIndex) + { + String item = null; + + if (index>=0 && index<getLength()) + { + Vector attribute = (Vector)m_AttributeList.get(index); + item = (String)(attribute.get(itemIndex)); + } + + return item; + } + + /* XAttributeList */ + public short getLength() + { + return (short)m_AttributeList.size(); + } + + public String getNameByIndex(short i) + { + return getAttributeItem(i, 0); + } + + public String getTypeByIndex(short i) + { + return getAttributeItem(i, 1); + } + + public String getValueByIndex(short i) + { + return getAttributeItem(i, 2); + } + + public String getTypeByName(String aName) + { + int nLength = m_AttributeList.size(); + String type = null; + + for (int i=0; i<nLength; ++i) + { + if (getNameByIndex((short)i).equals(aName)) + { + type = getTypeByIndex((short)i); + break; + } + } + + return type; + } + + public String getValueByName(String aName) + { + int nLength = m_AttributeList.size(); + String value = null; + + for (int i=0; i<nLength; ++i) + { + if (getNameByIndex((short)i).equals(aName)) + { + value = getValueByIndex((short)i); + break; + } + } + return value; + } +} + diff --git a/xmlsecurity/tools/uno/DomToTreeModelAdapter.java b/xmlsecurity/tools/uno/DomToTreeModelAdapter.java new file mode 100644 index 000000000000..709d0efa9515 --- /dev/null +++ b/xmlsecurity/tools/uno/DomToTreeModelAdapter.java @@ -0,0 +1,166 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +package com.sun.star.xml.security.uno; + +import org.w3c.dom.Document; +import javax.swing.event.TreeModelListener; +import javax.swing.event.TreeModelEvent; +import javax.swing.tree.TreePath; +import java.util.Enumeration; +import java.util.Vector; + +/* + * This adapter converts the current Document (a DOM) into + * a JTree model. + */ +class DomToTreeModelAdapter + implements javax.swing.tree.TreeModel +{ + private Document m_document; + private Vector m_listenerList = new Vector(); + + public DomToTreeModelAdapter(Document document) + { + m_document = document; + } + + /* + * Basic TreeModel operations + */ + public Object getRoot() + { + return new AdapterNode(m_document); + } + + public boolean isLeaf(Object aNode) + { + boolean rc = true; + + /* + * Determines whether the icon shows up to the left. + * Return true for any node with no children. + */ + AdapterNode node = (AdapterNode) aNode; + + if (node.childCount() > 0) + { + rc = false; + } + + return rc; + } + + public int getChildCount(Object parent) + { + AdapterNode node = (AdapterNode) parent; + return node.childCount(); + } + + public Object getChild(Object parent, int index) + { + AdapterNode node = (AdapterNode) parent; + return node.child(index); + } + + public int getIndexOfChild(Object parent, Object child) + { + AdapterNode node = (AdapterNode) parent; + return node.index((AdapterNode) child); + } + + public void valueForPathChanged(TreePath path, Object newValue) + { + /* + * Null. We won't be making changes in the GUI + * If we did, we would ensure the new value was really new, + * adjust the model, and then fire a TreeNodesChanged event. + */ + } + + public void addTreeModelListener(TreeModelListener listener) + { + if ( listener != null + && ! m_listenerList.contains( listener ) ) + { + m_listenerList.addElement( listener ); + } + } + + public void removeTreeModelListener(TreeModelListener listener) + { + if ( listener != null ) + { + m_listenerList.removeElement( listener ); + } + } + + public void fireTreeNodesChanged( TreeModelEvent e ) + { + Enumeration listeners = m_listenerList.elements(); + while ( listeners.hasMoreElements() ) + { + TreeModelListener listener = + (TreeModelListener) listeners.nextElement(); + listener.treeNodesChanged( e ); + } + } + + public void fireTreeNodesInserted( TreeModelEvent e ) + { + Enumeration listeners = m_listenerList.elements(); + while ( listeners.hasMoreElements() ) + { + TreeModelListener listener = + (TreeModelListener) listeners.nextElement(); + listener.treeNodesInserted( e ); + } + } + + public void fireTreeNodesRemoved( TreeModelEvent e ) + { + Enumeration listeners = m_listenerList.elements(); + while ( listeners.hasMoreElements() ) + { + TreeModelListener listener = + (TreeModelListener) listeners.nextElement(); + listener.treeNodesRemoved( e ); + } + } + + public void fireTreeStructureChanged( TreeModelEvent e ) + { + Enumeration listeners = m_listenerList.elements(); + while ( listeners.hasMoreElements() ) + { + TreeModelListener listener = + (TreeModelListener) listeners.nextElement(); + listener.treeStructureChanged( e ); + } + } +} + diff --git a/xmlsecurity/tools/uno/EncryptionEntity.java b/xmlsecurity/tools/uno/EncryptionEntity.java new file mode 100644 index 000000000000..51f14b2bbf6b --- /dev/null +++ b/xmlsecurity/tools/uno/EncryptionEntity.java @@ -0,0 +1,218 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +package com.sun.star.xml.security.uno; + +/* uno classes */ +import com.sun.star.uno.UnoRuntime; +import com.sun.star.lang.XMultiComponentFactory; +import com.sun.star.lang.XInitialization; +import com.sun.star.uno.XComponentContext; + +import com.sun.star.xml.crypto.*; +import com.sun.star.xml.crypto.sax.*; + +/* + * this class maintains the data for an encryption operation. + */ +class EncryptionEntity extends SecurityEntity +{ + private int m_nEncryptionElementCollectorId; + + EncryptionEntity( + XSecuritySAXEventKeeper xSAXEventKeeper, + boolean isExporting, + Object resultListener, + XXMLSecurityContext xXMLSecurityContext, + XXMLSignature xXMLSignature, + XXMLEncryption xXMLEncryption, + XMultiComponentFactory xRemoteServiceManager, + XComponentContext xRemoteContext) + { + super(xSAXEventKeeper, xXMLSecurityContext, xXMLSignature, + xXMLEncryption, xRemoteServiceManager, xRemoteContext); + + m_nEncryptionElementCollectorId = m_xSAXEventKeeper.addSecurityElementCollector( + ElementMarkPriority.AFTERMODIFY, + true); + + m_xSAXEventKeeper.setSecurityId(m_nEncryptionElementCollectorId, m_nSecurityId); + + if (isExporting) + { + try + { + /* + * creates a Encryptor. + */ + Object encryptor = m_xRemoteServiceManager.createInstanceWithContext( + TestTool.ENCRYPTOR_COMPONENT, m_xRemoteContext); + + m_xReferenceResolvedListener = + (XReferenceResolvedListener)UnoRuntime.queryInterface( + XReferenceResolvedListener.class, encryptor); + + /* + * initializes the Encryptor. + */ + XInitialization xInitialization = + (XInitialization)UnoRuntime.queryInterface( + XInitialization.class, m_xReferenceResolvedListener); + Object args[]=new Object[5]; + args[0] = new Integer(m_nSecurityId).toString(); + args[1] = m_xSAXEventKeeper; + args[2] = new Integer(m_nEncryptionElementCollectorId).toString(); + args[3] = m_xXMLSecurityContext.getSecurityEnvironment(); + args[4] = m_xXMLEncryption; + xInitialization.initialize(args); + + /* + * sets encryption result listener. + */ + XEncryptionResultBroadcaster m_xEncryptionResultBroadcaster = + (XEncryptionResultBroadcaster)UnoRuntime.queryInterface( + XEncryptionResultBroadcaster.class, m_xReferenceResolvedListener); + m_xEncryptionResultBroadcaster.addEncryptionResultListener( + (XEncryptionResultListener)UnoRuntime.queryInterface( + XEncryptionResultListener.class, resultListener)); + } + catch( com.sun.star.uno.Exception e) + { + e.printStackTrace(); + } + } + else + { + try{ + /* + * creates a Decryptor. + */ + Object decryptor = m_xRemoteServiceManager.createInstanceWithContext( + TestTool.DECRYPTOR_COMPONENT, m_xRemoteContext); + + m_xReferenceResolvedListener = + (XReferenceResolvedListener)UnoRuntime.queryInterface( + XReferenceResolvedListener.class, decryptor); + + /* + * initializes the Decryptor. + */ + XInitialization xInitialization = (XInitialization)UnoRuntime.queryInterface(XInitialization.class, m_xReferenceResolvedListener); + Object args[]=new Object[5]; + args[0] = new Integer(m_nSecurityId).toString(); + args[1] = m_xSAXEventKeeper; + args[2] = new Integer(m_nEncryptionElementCollectorId).toString(); + args[3] = m_xXMLSecurityContext; + args[4] = m_xXMLEncryption; + xInitialization.initialize(args); + + /* + * sets decryption result listener. + */ + XDecryptionResultBroadcaster m_xDecryptionResultBroadcaster = + (XDecryptionResultBroadcaster)UnoRuntime.queryInterface( + XDecryptionResultBroadcaster.class, m_xReferenceResolvedListener); + m_xDecryptionResultBroadcaster.addDecryptionResultListener( + (XDecryptionResultListener)UnoRuntime.queryInterface( + XDecryptionResultListener.class, resultListener)); + } + catch( com.sun.star.uno.Exception e) + { + e.printStackTrace(); + } + } + + /* + * creates a Blocker. + */ + int blockerId = m_xSAXEventKeeper.addBlocker(); + m_xSAXEventKeeper.setSecurityId(blockerId, m_nSecurityId); + + try + { + XBlockerMonitor xBlockerMonitor = (XBlockerMonitor)UnoRuntime.queryInterface( + XBlockerMonitor.class, m_xReferenceResolvedListener); + xBlockerMonitor.setBlockerId(blockerId); + } + catch( com.sun.star.uno.Exception e) + { + e.printStackTrace(); + } + + /* + * configures the resolve listener for the encryption template. + */ + XReferenceResolvedBroadcaster xReferenceResolvedBroadcaster = + (XReferenceResolvedBroadcaster)UnoRuntime.queryInterface( + XReferenceResolvedBroadcaster.class, m_xSAXEventKeeper); + xReferenceResolvedBroadcaster.addReferenceResolvedListener(m_nEncryptionElementCollectorId, m_xReferenceResolvedListener); + } + + /* + * add the reference to this encryption. + * + * 1. askes the SAXEventKeeper to add a ElementCollector to for the new + * referenced element; + * 2. configures this ElementCollector's security id; + * 3. tells the SAXEventKeeper which listener will receive the reference + * resolved notification. + * 4. notifies the SignatureCollector about the reference id. + */ + protected boolean setReference(boolean isExporting) + { + boolean rc = false; + + int referenceId = m_xSAXEventKeeper.addSecurityElementCollector( + isExporting? + (ElementMarkPriority.AFTERMODIFY):(ElementMarkPriority.BEFOREMODIFY), + true); + + m_xSAXEventKeeper.setSecurityId(referenceId, m_nSecurityId); + + XReferenceResolvedBroadcaster xReferenceResolvedBroadcaster = + (XReferenceResolvedBroadcaster)UnoRuntime.queryInterface( + XReferenceResolvedBroadcaster.class, m_xSAXEventKeeper); + xReferenceResolvedBroadcaster.addReferenceResolvedListener( + referenceId, m_xReferenceResolvedListener); + + try + { + XReferenceCollector xReferenceCollector = + (XReferenceCollector)UnoRuntime.queryInterface( + XReferenceCollector.class, m_xReferenceResolvedListener); + xReferenceCollector.setReferenceId(referenceId); + } + catch( com.sun.star.uno.Exception e) + { + e.printStackTrace(); + rc = false; + } + + return rc; + } +} + diff --git a/xmlsecurity/tools/uno/ParsingThread.java b/xmlsecurity/tools/uno/ParsingThread.java new file mode 100644 index 000000000000..f4bfea4a442e --- /dev/null +++ b/xmlsecurity/tools/uno/ParsingThread.java @@ -0,0 +1,248 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +package com.sun.star.xml.security.uno; + +import org.w3c.dom.Node; +import com.sun.star.xml.sax.XDocumentHandler; +import org.w3c.dom.Attr; +import org.w3c.dom.NamedNodeMap; + +/* + * this class is used to parse a document into SAX events + */ +class ParsingThread +{ + /* + * the Node which will be handled with in the next step + */ + private Node m_node; + + /* + * the event to be handled in the next step. + * true means endElement event, false otherwise. + */ + private boolean m_bIsEndEvent; + + /* + * the document handler which receives generated SAX events + */ + private XDocumentHandler m_xDocumentHandler; + + /* + * the TestTool which receives UI feedbacks + */ + private TestTool m_testTool; + + + ParsingThread(Node node, XDocumentHandler xDocumentHandler, TestTool testTool) + { + m_node = node; + m_xDocumentHandler = xDocumentHandler; + m_testTool = testTool; + + m_bIsEndEvent = false; + } + + /* + * changes the document handler. + */ + protected void setHandler(XDocumentHandler xDocumentHandler) + { + this.m_xDocumentHandler = xDocumentHandler; + } + + /* + * sends the next SAX event. + * when there is no further step, then false is returned, + * otherwise, true returned. + */ + protected boolean nextStep() + { + boolean rc = true; + + try + { + String message; + int type = m_node.getNodeType(); + if (!m_bIsEndEvent) + /* + * the next event is not a endElement event. + */ + { + switch (type) + { + case Node.DOCUMENT_NODE: /* startDocument */ + m_testTool.updatesCurrentSAXEventInformation("startDocument"); + m_xDocumentHandler.startDocument(); + m_testTool.updatesUIs(); + break; + case Node.ELEMENT_NODE: /* startElement */ + String nodeName = m_node.getNodeName(); + message = "startElement:"+nodeName; + NamedNodeMap attrs = m_node.getAttributes(); + + AttributeListHelper attributeListHelper = new AttributeListHelper(); + + int length = attrs.getLength(); + for (int i=0; i<length; ++i) + { + Attr attr = (Attr)attrs.item(i); + attributeListHelper.setAttribute(attr.getName(), "CDATA", attr.getValue()); + message += " "+attr.getName()+"='"+attr.getValue()+"'"; + } + + m_testTool.updatesCurrentSAXEventInformation(message); + m_xDocumentHandler.startElement(m_node.getNodeName(), attributeListHelper); + + m_testTool.updatesUIs(); + break; + case Node.TEXT_NODE: /* characters */ + message = m_node.getNodeValue(); + if (message != null) + { + m_testTool.updatesCurrentSAXEventInformation("characters:"+message); + m_xDocumentHandler.characters(message); + m_testTool.updatesUIs(); + } + break; + case Node.COMMENT_NODE: /* comment */ + break; + case Node.PROCESSING_INSTRUCTION_NODE: /* PI */ + m_testTool.updatesCurrentSAXEventInformation("processingInstruction:"+m_node.getNodeName()+" "+m_node.getNodeValue()); + m_xDocumentHandler.processingInstruction(m_node.getNodeName(), m_node.getNodeValue()); + m_testTool.updatesUIs(); + break; + } + + /* + * figures out the event for the next step. + */ + switch (type) + { + case Node.DOCUMENT_NODE: + case Node.ELEMENT_NODE: + if (m_node.hasChildNodes()) + /* + * for a Document node or an Element node, + * if the node has children, then the next event will be for its + * first child node. + */ + { + m_node = m_node.getFirstChild(); + } + else + /* + * otherwise, the next event will be endElement. + */ + { + m_bIsEndEvent = true; + } + break; + case Node.TEXT_NODE: + case Node.PROCESSING_INSTRUCTION_NODE: + case Node.COMMENT_NODE: + Node nextNode = m_node.getNextSibling(); + if (nextNode != null) + /* + * for other kinds of node, + * if it has a next sibling, then the next event will be for that + * sibling. + */ + { + m_node = nextNode; + } + else + /* + * otherwise, the next event will be the endElement for the node's + * parent node. + */ + { + m_node = m_node.getParentNode(); + m_bIsEndEvent = true; + } + break; + } + } + else + /* + * the next event is an endElement event. + */ + { + switch (type) + { + case Node.DOCUMENT_NODE: /* endDocument */ + m_testTool.updatesCurrentSAXEventInformation("endDocument"); + m_xDocumentHandler.endDocument(); + m_testTool.updatesUIs(); + + /* + * no further steps. + */ + rc = false; + break; + case Node.ELEMENT_NODE: /* endElement */ + m_testTool.updatesCurrentSAXEventInformation("endElement:"+m_node.getNodeName()); + m_xDocumentHandler.endElement(m_node.getNodeName()); + m_testTool.updatesUIs(); + + Node nextNode = m_node.getNextSibling(); + if (nextNode != null) + /* + * if the node has a next sibling, then the next event will be the + * start event for that sibling node. + */ + { + m_node = nextNode; + m_bIsEndEvent = false; + } + else + /* + * otherwise, the next event will be the endElement for the node's + * parent node. + */ + { + m_node = m_node.getParentNode(); + } + break; + } + } + } + catch( com.sun.star.xml.sax.SAXException e) + { + e.printStackTrace(); + + /* + * forces to end. + */ + rc = false; + } + + return rc; + } +} + diff --git a/xmlsecurity/tools/uno/SAXEventCollector.java b/xmlsecurity/tools/uno/SAXEventCollector.java new file mode 100644 index 000000000000..e94c55252083 --- /dev/null +++ b/xmlsecurity/tools/uno/SAXEventCollector.java @@ -0,0 +1,195 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +package com.sun.star.xml.security.uno; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; + +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.dom.Text; +import org.w3c.dom.ProcessingInstruction; + +/* uno classes */ +import com.sun.star.xml.sax.XDocumentHandler; +import com.sun.star.xml.sax.XAttributeList; + +/* + * this class is used to collect all received SAX events + * into a DOM document. + */ +class SAXEventCollector implements XDocumentHandler +{ + /* + * the document which keeps received SAX events + */ + private Document m_document; + + /* + * the current Element to which the next received + * SAX event will be added. + */ + private Node m_currentElement; + + /* + * the TestTool which receives UI feedbacks + */ + private TestTool m_testTool; + + /* + * whether displays information on console. + */ + private boolean m_systemDisplay; + + SAXEventCollector(TestTool testTool) + { + this(testTool, false); + } + + SAXEventCollector(TestTool testTool, boolean sysDis) + { + m_systemDisplay = sysDis; + m_testTool = testTool; + + DocumentBuilderFactory factory = + DocumentBuilderFactory.newInstance(); + + try + { + DocumentBuilder builder = factory.newDocumentBuilder(); + m_document = builder.newDocument(); + + m_currentElement = m_document; + } + catch (ParserConfigurationException pce) { + pce.printStackTrace(); + } + } + + protected Document getDocument() + { + return m_document; + } + + protected Node getCurrentElement() + { + return m_currentElement; + } + + /* + * XDocumentHandler + */ + public void startDocument () + { + } + + public void endDocument() + { + } + + public void startElement (String str, com.sun.star.xml.sax.XAttributeList xattribs) + { + Element newElement = m_document.createElement(str); + + if (xattribs !=null) + { + int length = xattribs.getLength(); + for (short i=0; i<length; ++i) + { + newElement.setAttribute( + xattribs.getNameByIndex(i), + xattribs.getValueByIndex(i)); + } + } + + if (m_systemDisplay) + { + System.out.println("startElement:"+m_currentElement.toString()); + } + + m_currentElement.appendChild(newElement); + m_currentElement = newElement; + + if (m_testTool != null) + { + m_testTool.updatesUIs(); + } + } + + public void endElement(String str) + { + if (m_systemDisplay) + { + System.out.println("endElement:"+str+" "+m_currentElement.toString()); + } + + m_currentElement = m_currentElement.getParentNode(); + if (m_systemDisplay) + { + System.out.println("----> "+m_currentElement.toString()); + } + + if (m_testTool != null) + { + m_testTool.updatesUIs(); + } + } + + public void characters(String str) + { + Text newText = m_document.createTextNode(str); + m_currentElement.appendChild(newText); + if (m_testTool != null) + { + m_testTool.updatesUIs(); + } + } + + public void ignorableWhitespace(String str) + { + } + + public void processingInstruction(String aTarget, String aData) + { + ProcessingInstruction newPI + = m_document.createProcessingInstruction(aTarget, aData); + m_currentElement.appendChild(newPI); + if (m_testTool != null) + { + m_testTool.updatesUIs(); + } + } + + public void setDocumentLocator (com.sun.star.xml.sax.XLocator xLocator ) + throws com.sun.star.xml.sax.SAXException + { + } +} + diff --git a/xmlsecurity/tools/uno/SAXEventPrinter.java b/xmlsecurity/tools/uno/SAXEventPrinter.java new file mode 100644 index 000000000000..d841926bdd13 --- /dev/null +++ b/xmlsecurity/tools/uno/SAXEventPrinter.java @@ -0,0 +1,320 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +package com.sun.star.xml.security.uno; + +import org.w3c.dom.Node; +import org.w3c.dom.NamedNodeMap; +import org.w3c.dom.Attr; +import org.w3c.dom.NodeList; +import java.io.IOException; +import java.io.FileOutputStream; + +/* uno classes */ +import com.sun.star.xml.sax.XDocumentHandler; +import com.sun.star.xml.sax.XAttributeList; + +/* + * The SAXEventPrinter class is used to print out received + * SAX event stream. + */ +class SAXEventPrinter implements XDocumentHandler +{ + /* + * how many spaces as the indent of line + */ + private int m_nIndent; + + /* + * whether a NEW LINE character need to be appended to + * each line + */ + private boolean m_bIsFormatted; + + /* + * the output stream to write + */ + private FileOutputStream m_fileOutputStream; + + SAXEventPrinter(FileOutputStream fileOutputStream, boolean isFormatted) + { + m_nIndent = 0; + m_fileOutputStream = fileOutputStream; + m_bIsFormatted = isFormatted; + } + + protected static void outputIndent(int m_nIndent, FileOutputStream fileOutputStream) + throws IOException + { + for (int i=0; i<m_nIndent; ++i) + { + fileOutputStream.write(" ".getBytes()); + } + } + + /* + * displays the tree of a Node. + */ + protected static void display(Node node, int indent, FileOutputStream fileOutputStream, boolean isFormatted) + throws IOException + { + if (node != null) + { + int type = node.getNodeType(); + String message; + NodeList children; + int i, length; + + switch (type) + { + case Node.DOCUMENT_NODE: + children = node.getChildNodes(); + length = children.getLength(); + for (i=0; i<length; ++i) + { + display(children.item(i), indent+2, fileOutputStream, isFormatted); + } + + break; + + case Node.ELEMENT_NODE: + message = new String("<"+node.getNodeName()); + NamedNodeMap attrs = node.getAttributes(); + + length = attrs.getLength(); + for (i=0; i<length; ++i) + { + Attr attr = (Attr)attrs.item(i); + message += " "+attr.getNodeName()+"=\""+attr.getNodeValue()+"\""; + } + + message += ">"; + + if (isFormatted) + { + outputIndent(indent, fileOutputStream); + } + + fileOutputStream.write(message.getBytes("UTF-8")); + + if (isFormatted) + { + fileOutputStream.write("\n".getBytes()); + } + + children = node.getChildNodes(); + length = children.getLength(); + for (i=0; i<length; ++i) + { + display(children.item(i), indent+2, fileOutputStream, isFormatted); + } + + if (isFormatted) + { + outputIndent(indent, fileOutputStream); + } + + fileOutputStream.write("</".getBytes()); + fileOutputStream.write(node.getNodeName().getBytes("UTF-8")); + fileOutputStream.write(">".getBytes()); + + if (isFormatted) + { + fileOutputStream.write("\n".getBytes()); + } + + break; + + case Node.TEXT_NODE: + message = node.getNodeValue(); + if (message != null ) + { + if (isFormatted) + { + outputIndent(indent, fileOutputStream); + } + + fileOutputStream.write(node.getNodeValue().getBytes("UTF-8")); + + if (isFormatted) + { + fileOutputStream.write("\n".getBytes()); + } + } + break; + + case Node.PROCESSING_INSTRUCTION_NODE: + if (isFormatted) + { + outputIndent(indent, fileOutputStream); + } + + fileOutputStream.write("<?".getBytes()); + fileOutputStream.write(node.getNodeName().getBytes("UTF-8")); + fileOutputStream.write(node.getNodeValue().getBytes("UTF-8")); + fileOutputStream.write("?>".getBytes()); + + if (isFormatted) + { + fileOutputStream.write("\n".getBytes()); + } + + break; + default: + break; + } + } + } + + /* + * XDocumentHandler + */ + public void startDocument () + { + } + + public void endDocument() + { + } + + public void startElement (String str, com.sun.star.xml.sax.XAttributeList xattribs) + { + try + { + String message; + + message = new String("<"+str); + if (xattribs !=null) + { + int length = xattribs.getLength(); + for (short i=0; i<length; ++i) + { + message += " "+xattribs.getNameByIndex(i)+"=\""+xattribs.getValueByIndex(i)+"\""; + } + } + message += ">"; + + if (m_bIsFormatted) + { + outputIndent(m_nIndent, m_fileOutputStream); + } + + m_fileOutputStream.write(message.getBytes("UTF-8")); + + if (m_bIsFormatted) + { + m_fileOutputStream.write("\n".getBytes()); + } + + m_nIndent += 2; + } + catch (IOException e) + { + e.printStackTrace(); + } + } + + public void endElement(String str) + { + try + { + m_nIndent -= 2; + if (m_bIsFormatted) + { + outputIndent(m_nIndent, m_fileOutputStream); + } + + m_fileOutputStream.write("</".getBytes()); + m_fileOutputStream.write(str.getBytes("UTF-8")); + m_fileOutputStream.write(">".getBytes()); + + if (m_bIsFormatted) + { + m_fileOutputStream.write("\n".getBytes()); + } + } + catch (IOException e) + { + e.printStackTrace(); + } + } + + public void characters(String str) + { + try + { + if (m_bIsFormatted) + { + outputIndent(m_nIndent, m_fileOutputStream); + } + + m_fileOutputStream.write(str.getBytes("UTF-8")); + + if (m_bIsFormatted) + { + m_fileOutputStream.write("\n".getBytes()); + } + } + catch (IOException e) + { + e.printStackTrace(); + } + } + + public void ignorableWhitespace(String str) + { + } + + public void processingInstruction(String aTarget, String aData) + { + try + { + if (m_bIsFormatted) + { + outputIndent(m_nIndent, m_fileOutputStream); + } + + m_fileOutputStream.write("<?".getBytes()); + m_fileOutputStream.write(aTarget.getBytes("UTF-8")); + m_fileOutputStream.write("?>".getBytes()); + + if (m_bIsFormatted) + { + m_fileOutputStream.write("\n".getBytes()); + } + } + catch (IOException e) + { + e.printStackTrace(); + } + } + + public void setDocumentLocator (com.sun.star.xml.sax.XLocator xLocator ) + throws com.sun.star.xml.sax.SAXException + { + } +} diff --git a/xmlsecurity/tools/uno/SecurityEntity.java b/xmlsecurity/tools/uno/SecurityEntity.java new file mode 100644 index 000000000000..85ef5ed49891 --- /dev/null +++ b/xmlsecurity/tools/uno/SecurityEntity.java @@ -0,0 +1,202 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +package com.sun.star.xml.security.uno; + +/* uno classes */ +import com.sun.star.uno.UnoRuntime; +import com.sun.star.lang.XMultiComponentFactory; +import com.sun.star.uno.XComponentContext; + +import com.sun.star.xml.crypto.*; +import com.sun.star.xml.crypto.sax.*; + +/* + * this class maintains the data for a security operation. + */ +class SecurityEntity +{ + /* + * the security id, which identifies this security entity + * uniquely. + */ + private static int m_nNextSecurityId = 1; + protected int m_nSecurityId; + + /* + * xml security related components + */ + protected XXMLSecurityContext m_xXMLSecurityContext; + protected XXMLSignature m_xXMLSignature; + protected XXMLEncryption m_xXMLEncryption; + protected XMultiComponentFactory m_xRemoteServiceManager; + protected XComponentContext m_xRemoteContext; + protected XReferenceResolvedListener m_xReferenceResolvedListener; + protected XSecuritySAXEventKeeper m_xSAXEventKeeper; + + /* + * the uri of the key material of this security entity + */ + private String m_keyURI; + + SecurityEntity( + XSecuritySAXEventKeeper xSAXEventKeeper, + XXMLSecurityContext xXMLSecurityContext, + XXMLSignature xXMLSignature, + XXMLEncryption xXMLEncryption, + XMultiComponentFactory xRemoteServiceManager, + XComponentContext xRemoteContext) + { + m_xSAXEventKeeper = xSAXEventKeeper; + m_xXMLSecurityContext = xXMLSecurityContext; + m_xXMLSignature = xXMLSignature; + m_xXMLEncryption = xXMLEncryption; + m_xRemoteServiceManager = xRemoteServiceManager; + m_xRemoteContext = xRemoteContext; + + m_nSecurityId = getNextSecurityId(); + m_keyURI = null; + } + +/************************************************************************************** + * private methods + **************************************************************************************/ + + /* + * generates a new security id. + */ + private static int getNextSecurityId() + { + int id = m_nNextSecurityId++; + return id; + } + +/************************************************************************************** + * protected methods + **************************************************************************************/ + + /* + * notifies the key collector about the key id, this key id + * is used to ask the SAXEventKeeper to release the bufferred + * key element. + * when the id is 0, that means there is no independant key + * element needed. + */ + protected void setKeyId(int id) + { + try + { + XKeyCollector xKeyCollector = + (XKeyCollector)UnoRuntime.queryInterface( + XKeyCollector.class, m_xReferenceResolvedListener); + xKeyCollector.setKeyId(id); + } + catch( com.sun.star.uno.Exception e) + { + e.printStackTrace(); + } + } + + /* + * set the key uri, which will be the value of the id attribute + * of the key element + */ + protected void setKeyURI(String uri) + { + m_keyURI = new String(uri); + } + + protected XReferenceResolvedListener getReferenceListener() + { + return m_xReferenceResolvedListener; + } + + protected int getSecurityId() + { + return m_nSecurityId; + } + + /* + * configures the key material to the security entity. + * + * if the uri is the key, then: + * 1. askes the SAXEventKeeper to add a ElementCollector to the key + * element; + * 2. notifies the key collector; + * 3. configures this ElementCollector's security id; + * 4. tells the SAXEventKeeper which listener will receive the reference + * resolved notification. + */ + protected boolean setKey(String uri, boolean isExporting) + { + boolean rc = false; + + if (m_keyURI != null && + m_keyURI.equals(uri)) + { + int referenceId = m_xSAXEventKeeper.addSecurityElementCollector( + isExporting? + (ElementMarkPriority.BEFOREMODIFY):(ElementMarkPriority.AFTERMODIFY), + false ); + + setKeyId(referenceId); + m_xSAXEventKeeper.setSecurityId(referenceId, m_nSecurityId); + + XReferenceResolvedBroadcaster xReferenceResolvedBroadcaster = + (XReferenceResolvedBroadcaster)UnoRuntime.queryInterface( + XReferenceResolvedBroadcaster.class, m_xSAXEventKeeper); + + xReferenceResolvedBroadcaster.addReferenceResolvedListener(referenceId, m_xReferenceResolvedListener); + + rc = true; + } + + return rc; + } + + /* + * ends this misstion, asks the security engine to clear up all + * resources. + */ + protected boolean endMission() + { + XMissionTaker xMissionTaker = + (XMissionTaker)UnoRuntime.queryInterface( + XMissionTaker.class, m_xReferenceResolvedListener); + + boolean rc = xMissionTaker.endMission(); + + m_xXMLSecurityContext = null; + m_xXMLSignature = null; + m_xXMLEncryption = null; + m_xReferenceResolvedListener = null; + m_xSAXEventKeeper = null; + + return rc; + } +} + diff --git a/xmlsecurity/tools/uno/SignatureEntity.java b/xmlsecurity/tools/uno/SignatureEntity.java new file mode 100644 index 000000000000..d02ad3ee74d7 --- /dev/null +++ b/xmlsecurity/tools/uno/SignatureEntity.java @@ -0,0 +1,288 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +package com.sun.star.xml.security.uno; + +import java.util.Vector; + +/* uno classes */ +import com.sun.star.uno.UnoRuntime; +import com.sun.star.lang.XMultiComponentFactory; +import com.sun.star.lang.XInitialization; +import com.sun.star.uno.XComponentContext; + +import com.sun.star.xml.crypto.*; +import com.sun.star.xml.crypto.sax.*; + +/* + * this class maintains the data for a signature operation. + */ +class SignatureEntity extends SecurityEntity +{ + private Vector m_vReferenceIds; + private int m_nSignatureElementCollectorId; + + SignatureEntity( + XSecuritySAXEventKeeper xSAXEventKeeper, + boolean isExporting, + Object resultListener, + XXMLSecurityContext xXMLSecurityContext, + XXMLSignature xXMLSignature, + XXMLEncryption xXMLEncryption, + XMultiComponentFactory xRemoteServiceManager, + XComponentContext xRemoteContext) + { + super(xSAXEventKeeper, xXMLSecurityContext, xXMLSignature, + xXMLEncryption, xRemoteServiceManager, xRemoteContext); + + m_vReferenceIds = new Vector(); + + if (isExporting) + { + m_nSignatureElementCollectorId = m_xSAXEventKeeper.addSecurityElementCollector( + ElementMarkPriority.AFTERMODIFY, + true); + + m_xSAXEventKeeper.setSecurityId(m_nSignatureElementCollectorId, m_nSecurityId); + + try + { + /* + * creates a SignatureCreator. + */ + Object signatureCreator = m_xRemoteServiceManager.createInstanceWithContext( + TestTool.SIGNATURECREATOR_COMPONENT, m_xRemoteContext); + + m_xReferenceResolvedListener = + (XReferenceResolvedListener)UnoRuntime.queryInterface( + XReferenceResolvedListener.class, signatureCreator); + + /* + * initializes the SignatureCreator. + */ + XInitialization xInitialization = + (XInitialization)UnoRuntime.queryInterface( + XInitialization.class, m_xReferenceResolvedListener); + + Object args[]=new Object[5]; + args[0] = new Integer(m_nSecurityId).toString(); + args[1] = m_xSAXEventKeeper; + args[2] = new Integer(m_nSignatureElementCollectorId).toString(); + args[3] = m_xXMLSecurityContext.getSecurityEnvironment(); + args[4] = m_xXMLSignature; + xInitialization.initialize(args); + + /* + * creates a Blocker. + */ + int blockerId = m_xSAXEventKeeper.addBlocker(); + m_xSAXEventKeeper.setSecurityId(blockerId, m_nSecurityId); + + XBlockerMonitor xBlockerMonitor = (XBlockerMonitor)UnoRuntime.queryInterface( + XBlockerMonitor.class, m_xReferenceResolvedListener); + xBlockerMonitor.setBlockerId(blockerId); + + /* + * sets signature creation result listener. + */ + XSignatureCreationResultBroadcaster xSignatureCreationResultBroadcaster = + (XSignatureCreationResultBroadcaster)UnoRuntime.queryInterface( + XSignatureCreationResultBroadcaster.class, m_xReferenceResolvedListener); + xSignatureCreationResultBroadcaster.addSignatureCreationResultListener( + (XSignatureCreationResultListener)UnoRuntime.queryInterface( + XSignatureCreationResultListener.class, resultListener)); + } + catch( com.sun.star.uno.Exception e) + { + e.printStackTrace(); + } + + } + else + { + m_nSignatureElementCollectorId = m_xSAXEventKeeper.addSecurityElementCollector( + ElementMarkPriority.BEFOREMODIFY, false); + + m_xSAXEventKeeper.setSecurityId(m_nSignatureElementCollectorId, m_nSecurityId); + + try + { + /* + * creates a SignatureVerifier. + */ + Object signatureVerifier = m_xRemoteServiceManager.createInstanceWithContext( + TestTool.SIGNATUREVERIFIER_COMPONENT, m_xRemoteContext); + + m_xReferenceResolvedListener = + (XReferenceResolvedListener)UnoRuntime.queryInterface( + XReferenceResolvedListener.class, signatureVerifier); + + /* + * initializes the SignatureVerifier. + */ + XInitialization xInitialization = + (XInitialization)UnoRuntime.queryInterface( + XInitialization.class, m_xReferenceResolvedListener); + Object args[]=new Object[5]; + args[0] = new Integer(m_nSecurityId).toString(); + args[1] = m_xSAXEventKeeper; + args[2] = new Integer(m_nSignatureElementCollectorId).toString(); + args[3] = m_xXMLSecurityContext; + args[4] = m_xXMLSignature; + xInitialization.initialize(args); + + /* + * sets signature verify result listener. + */ + XSignatureVerifyResultBroadcaster xSignatureVerifyResultBroadcaster = + (XSignatureVerifyResultBroadcaster)UnoRuntime.queryInterface( + XSignatureVerifyResultBroadcaster.class, m_xReferenceResolvedListener); + xSignatureVerifyResultBroadcaster.addSignatureVerifyResultListener( + (XSignatureVerifyResultListener)UnoRuntime.queryInterface( + XSignatureVerifyResultListener.class, resultListener)); + } + catch( com.sun.star.uno.Exception e) + { + e.printStackTrace(); + } + } + + /* + * configures the resolve listener for the signature template. + */ + XReferenceResolvedBroadcaster xReferenceResolvedBroadcaster = + (XReferenceResolvedBroadcaster)UnoRuntime.queryInterface( + XReferenceResolvedBroadcaster.class, m_xSAXEventKeeper); + xReferenceResolvedBroadcaster.addReferenceResolvedListener( + m_nSignatureElementCollectorId, m_xReferenceResolvedListener); + } + +/************************************************************************************** + * private methods + **************************************************************************************/ + + /* + * checks whether this signature has a reference with + * the particular id. + */ + private boolean hasReference(String id) + { + boolean rc = false; + + int length = m_vReferenceIds.size(); + for (int i=0; i<length; ++i) + { + if (id.equals((String)m_vReferenceIds.elementAt(i))) + { + rc = true; + break; + } + } + + return rc; + } + + +/************************************************************************************** + * protected methods + **************************************************************************************/ + + /* + * adds a new reference id. + */ + protected void addReferenceId(String referenceId) + { + m_vReferenceIds.add(referenceId); + } + + /* + * notifies how many reference in this signature. + */ + protected void setReferenceNumber() + { + try + { + XReferenceCollector xReferenceCollector = + (XReferenceCollector)UnoRuntime.queryInterface( + XReferenceCollector.class, m_xReferenceResolvedListener); + xReferenceCollector.setReferenceCount(m_vReferenceIds.size()); + } + catch( com.sun.star.uno.Exception e) + { + e.printStackTrace(); + } + } + + /* + * tries to add a reference to this signature. + * + * If the specific id belongs to this signature's references, then: + * 1. askes the SAXEventKeeper to add a ElementCollector to for the new + * referenced element; + * 2. configures this ElementCollector's security id; + * 3. tells the SAXEventKeeper which listener will receive the reference + * resolved notification. + * 4. notifies the SignatureCollector about the reference id. + */ + protected boolean setReference(String id, boolean isExporting) + { + boolean rc = false; + + if (hasReference(id)) + { + int referenceId = m_xSAXEventKeeper.addSecurityElementCollector( + isExporting? + (ElementMarkPriority.AFTERMODIFY):(ElementMarkPriority.BEFOREMODIFY), + false ); + + m_xSAXEventKeeper.setSecurityId(referenceId, m_nSecurityId); + + XReferenceResolvedBroadcaster xReferenceResolvedBroadcaster = + (XReferenceResolvedBroadcaster)UnoRuntime.queryInterface( + XReferenceResolvedBroadcaster.class, m_xSAXEventKeeper); + xReferenceResolvedBroadcaster.addReferenceResolvedListener( + referenceId, m_xReferenceResolvedListener); + + try + { + XReferenceCollector xReferenceCollector = + (XReferenceCollector)UnoRuntime.queryInterface( + XReferenceCollector.class, m_xReferenceResolvedListener); + xReferenceCollector.setReferenceId(referenceId); + } + catch( com.sun.star.uno.Exception e) + { + e.printStackTrace(); + } + + rc = true; + } + + return rc; + } +} + diff --git a/xmlsecurity/tools/uno/TestTool.java b/xmlsecurity/tools/uno/TestTool.java new file mode 100644 index 000000000000..6c87b34bbb43 --- /dev/null +++ b/xmlsecurity/tools/uno/TestTool.java @@ -0,0 +1,1392 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +package com.sun.star.xml.security.uno; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; + +import java.io.File; +import java.io.IOException; +import java.io.FileOutputStream; +import java.io.FileInputStream; +import java.io.InputStream; +import java.io.ByteArrayInputStream; +import java.io.UnsupportedEncodingException; + +import org.w3c.dom.Document; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; + +/* Basic GUI components */ +import javax.swing.JFrame; +import javax.swing.JPanel; +import javax.swing.JScrollPane; +import javax.swing.JTree; +import javax.swing.JButton; +import javax.swing.JCheckBox; +import javax.swing.JTextArea; +import javax.swing.JTextField; +import javax.swing.JFileChooser; +import javax.swing.ToolTipManager; +import javax.swing.JTable; +import javax.swing.JLabel; +import javax.swing.BorderFactory; + +/* GUI components for right-hand side */ +import javax.swing.JSplitPane; +import javax.swing.JOptionPane; +import javax.swing.JTabbedPane; + + +/* GUI support classes */ +import java.awt.BorderLayout; +import java.awt.Dimension; +import java.awt.Container; +import java.awt.Toolkit; +import java.awt.event.WindowEvent; +import java.awt.event.WindowAdapter; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; + +/* For creating borders */ +import javax.swing.border.EmptyBorder; +import javax.swing.border.BevelBorder; +import javax.swing.border.CompoundBorder; + +/* For creating a TreeModel */ +import javax.swing.tree.TreePath; +import java.util.Vector; + +/* UNO classes */ +import com.sun.star.uno.UnoRuntime; +import com.sun.star.bridge.XUnoUrlResolver; +import com.sun.star.lang.XMultiComponentFactory; +import com.sun.star.beans.XPropertySet; +import com.sun.star.uno.XComponentContext; +import com.sun.star.xml.sax.XDocumentHandler; + +import com.sun.star.xml.crypto.*; +import com.sun.star.xml.crypto.sax.*; + +public class TestTool extends JFrame implements ActionListener +{ + /* + * xml security framewrok component names + */ + public static String SIGNATURECREATOR_COMPONENT = "com.sun.star.xml.crypto.sax.SignatureCreator"; + public static String SIGNATUREVERIFIER_COMPONENT = "com.sun.star.xml.crypto.sax.SignatureVerifier"; + public static String ENCRYPTOR_COMPONENT = "com.sun.star.xml.crypto.sax.Encryptor"; + public static String DECRYPTOR_COMPONENT = "com.sun.star.xml.crypto.sax.Decryptor"; + public static String SAXEVENTKEEPER_COMPONENT = "com.sun.star.xml.crypto.sax.SAXEventKeeper"; + + /* + * Java-based component names + */ + public static String SEINITIALIZER_COMPONENT_JAVA = "com.sun.star.xml.security.bridge.jxsec.SEInitializer_JxsecImpl"; + public static String XMLSIGNATURE_COMPONENT_JAVA = "com.sun.star.xml.security.bridge.jxsec.XMLSignature_JxsecImpl"; + public static String XMLENCRYPTION_COMPONENT_JAVA = "com.sun.star.xml.security.bridge.jxsec.XMLEncryption_JxsecImpl"; + public static String XMLDOCUMENTWRAPPER_COMPONENT_JAVA = "com.sun.star.xml.security.bridge.jxsec.XMLDocumentWrapper_JxsecImpl"; + + /* + * C-based component names + */ + public static String SEINITIALIZER_COMPONENT_C = "com.sun.star.xml.crypto.SEInitializer"; + public static String XMLSIGNATURE_COMPONENT_C = "com.sun.star.xml.crypto.XMLSignature"; + public static String XMLENCRYPTION_COMPONENT_C = "com.sun.star.xml.crypto.XMLEncryption"; + public static String XMLDOCUMENTWRAPPER_COMPONENT_C = "com.sun.star.xml.wrapper.XMLDocumentWrapper"; + + /* url resolver name */ + public static String UNOURLRESOLVER = "com.sun.star.bridge.UnoUrlResolver"; + + /* + * connection URL + */ + private String m_unoURL = "uno:socket,host=localhost,port=2002;urp;StarOffice.ServiceManager"; + + /* key file */ + private String m_javaTokenFile = null; + private String m_nssTokenPath = null; + + /* User Interfaces */ + private JButton m_goButton; + private JButton m_stepButton; + private JButton m_startButton; + private JButton m_openButton; + private JCheckBox m_isExportingButton; + private JCheckBox m_isJavaComponentButton; + private JButton m_saveButton; + private JButton m_batchButton; + private JTree m_leftTree; + private JTextArea m_leftTextArea; + private JTree m_middleTree; + private JTree m_rightTree; + private JTabbedPane m_leftTabPane; + private JTextArea m_bufferNodeTextArea; + private JLabel m_saxChainLabel; + private JTextField m_saxEventText; + private JTable m_unsolvedReferenceTable; + + /* + * whether a batch file is running, + * if so, no message box is popped up + */ + private boolean m_bIsBatchRunning = false; + + /* + * whether the UI needs to be updated. + * when user click the "go" button, the UI needs + * not to be updated step by step for performance + * reason + */ + private boolean m_bIsUIUpdateSuppressed = false; + + /* + * three DOM tree adapter + */ + private DomToTreeModelAdapter m_leftTreeModelAdapter; + private DomToTreeModelAdapter m_middleTreeModelAdapter; + private DomToTreeModelAdapter m_rightTreeModelAdapter; + + /* + * the current directory, which reserves the default + * location when user open/save a file. + */ + private File m_currentDirectory = null; + + /* + * the log file + */ + private FileOutputStream m_logFileOutputStream = null; + + /* + * the thread which is parsing the current XML + * file + */ + private ParsingThread m_parsingThread; + + /* + * whether is exporting or importing + */ + private boolean m_bIsExporting; + + /* + * whether java based component or c based component + * is used now + */ + private boolean m_bIsJavaBased; + + /* + * XML security component interface + */ + private XComponentContext m_xRemoteContext = null; + private XMultiComponentFactory m_xRemoteServiceManager = null; + private XXMLSecurityContext m_xXMLSecurityContext = null; + private XXMLSignature m_xXMLSignature = null; + private XXMLEncryption m_xXMLEncryption = null; + private XSEInitializer m_xSEInitializer = null; + + /* + * SAX event collector for the middle tree and the right tree + */ + private SAXEventCollector m_rightTreeEventCollector = null; + private SAXEventCollector m_middleTreeEventCollector = null; + + /* + * security framework controller + */ + private XMLSecurityFrameworkController m_xmlSecurityFrameworkController = null; + + /* org.w3c.dom.Document */ + private Document m_document; + + /* represents whether "Go" or "Step" */ + private boolean stepMode = true; + +/************************************************************************************** + * private methods + **************************************************************************************/ + + + /****************************************************************************** + * UI related methods + ******************************************************************************/ + + /* + * initalizes the UI. + */ + private void initUI() + { + m_leftTreeModelAdapter = new DomToTreeModelAdapter(m_document); + m_middleTreeModelAdapter = new DomToTreeModelAdapter(m_document); + m_rightTreeModelAdapter = new DomToTreeModelAdapter(m_document); + + m_parsingThread = null; + + m_leftTree.setModel(m_leftTreeModelAdapter); + m_middleTree.setModel(m_middleTreeModelAdapter); + m_rightTree.setModel(m_rightTreeModelAdapter); + } + + /* + * constructs the user interface. + */ + private Container buildUI(int width, int height) + { + JPanel mainPanel = new JPanel(); + + int frameHeight = height-40; + int leftWindowWidth = (width-40)/3; + int middleWindowWidth = leftWindowWidth; + int rightWindowWidth = leftWindowWidth; + int leftPaneWidth = leftWindowWidth+middleWindowWidth; + int frameWidth = leftPaneWidth + rightWindowWidth; + + /* Make a nice border */ + EmptyBorder emptyBorder = new EmptyBorder(5,5,5,5); + BevelBorder bevelBorder = new BevelBorder(BevelBorder.LOWERED); + CompoundBorder compoundBorder = new CompoundBorder(emptyBorder,bevelBorder); + mainPanel.setBorder(new CompoundBorder(compoundBorder,emptyBorder)); + + /* Set up the tree */ + m_leftTreeModelAdapter = new DomToTreeModelAdapter(m_document); + m_middleTreeModelAdapter = new DomToTreeModelAdapter(m_document); + m_rightTreeModelAdapter = new DomToTreeModelAdapter(m_document); + + m_leftTree = new JTree(m_leftTreeModelAdapter); + m_leftTextArea = new JTextArea(); + m_middleTree = new JTree(m_middleTreeModelAdapter); + m_rightTree = new JTree(m_rightTreeModelAdapter); + + ToolTipManager.sharedInstance().registerComponent(m_leftTree); + ToolTipManager.sharedInstance().registerComponent(m_middleTree); + ToolTipManager.sharedInstance().registerComponent(m_rightTree); + + /* Builds left tab pane */ + JScrollPane leftTreePane = new JScrollPane(m_leftTree); + JScrollPane leftTextPane = new JScrollPane(m_leftTextArea); + m_leftTabPane= new JTabbedPane(); + m_leftTabPane.add("Tree View",leftTreePane); + m_leftTabPane.add("Text View",leftTextPane); + + /* Builds middle tree pane */ + JScrollPane middleTreePane = new JScrollPane(m_middleTree); + + /* Builds right tree pane */ + JScrollPane rightTreePane = new JScrollPane(m_rightTree); + rightTreePane.setBorder(BorderFactory.createCompoundBorder( + BorderFactory.createTitledBorder("Result"), + BorderFactory.createEmptyBorder(8,8,8,8))); + + m_leftTabPane.setPreferredSize( + new Dimension( leftWindowWidth, frameHeight )); + middleTreePane.setPreferredSize( + new Dimension( middleWindowWidth, frameHeight )); + rightTreePane.setPreferredSize( + new Dimension( rightWindowWidth, frameHeight )); + + /* Builds the SAX event text box */ + m_saxEventText = new JTextField(); + + /* Builds the unsolved reference table */ + m_unsolvedReferenceTable = new JTable( + new UnsolvedReferenceTableModel(this)); + + /* Builds the BufferNode information text area */ + m_bufferNodeTextArea = new JTextArea(); + + /* Builds the SAX chain information label */ + m_saxChainLabel = new JLabel(); + + /* Builds the left pane */ + JPanel tabPaneWithSaxEventPane = new JPanel(); + tabPaneWithSaxEventPane.setLayout(new BorderLayout()); + tabPaneWithSaxEventPane.add("Center",m_leftTabPane); + tabPaneWithSaxEventPane.add("South",new JScrollPane(m_saxEventText)); + + JSplitPane leftPane = + new JSplitPane( JSplitPane.VERTICAL_SPLIT, + tabPaneWithSaxEventPane, + new JScrollPane(m_unsolvedReferenceTable)); + leftPane.setBorder(BorderFactory.createCompoundBorder( + BorderFactory.createTitledBorder("Original"), + BorderFactory.createEmptyBorder(8,8,8,8))); + + leftPane.setContinuousLayout( true ); + leftPane.setDividerLocation( frameHeight*2/3 ); + leftPane.setPreferredSize( + new Dimension( leftWindowWidth, frameHeight )); + + /* Builds the middle pane */ + JPanel bufferNodeWithSaxChainPane = new JPanel(); + bufferNodeWithSaxChainPane.setLayout(new BorderLayout()); + bufferNodeWithSaxChainPane.add("Center",m_bufferNodeTextArea); + bufferNodeWithSaxChainPane.add("South",new JScrollPane(m_saxChainLabel)); + + JSplitPane middlePane = + new JSplitPane( JSplitPane.VERTICAL_SPLIT, + middleTreePane, + new JScrollPane(bufferNodeWithSaxChainPane)); + + middlePane.setBorder(BorderFactory.createCompoundBorder( + BorderFactory.createTitledBorder("Insight SAXEventKeeper"), + BorderFactory.createEmptyBorder(8,8,8,8))); + + middlePane.setContinuousLayout( true ); + middlePane.setDividerLocation( frameHeight/2+5 ); + middlePane.setPreferredSize( + new Dimension( middleWindowWidth, frameHeight )); + + /* Builds the whole frame pane */ + JSplitPane leftWithMiddlePane = + new JSplitPane( JSplitPane.HORIZONTAL_SPLIT, + leftPane, + middlePane ); + leftWithMiddlePane.setContinuousLayout( true ); + leftWithMiddlePane.setDividerLocation( leftWindowWidth ); + leftWithMiddlePane.setPreferredSize( + new Dimension( leftPaneWidth + 10, frameHeight+10 )); + + JSplitPane framePane = + new JSplitPane( JSplitPane.HORIZONTAL_SPLIT, + leftWithMiddlePane, + rightTreePane ); + + + framePane.setContinuousLayout( true ); + framePane.setDividerLocation(leftPaneWidth+10 ); + framePane.setPreferredSize( + new Dimension( frameWidth + 20, frameHeight+10 )); + + /* Adds all GUI components to the main panel */ + mainPanel.setLayout(new BorderLayout()); + mainPanel.add("Center", framePane ); + + m_openButton = new JButton("Open..."); + m_openButton.addActionListener(this); + + m_goButton = new JButton("Go!"); + m_goButton.addActionListener(this); + + m_stepButton = new JButton("Step"); + m_stepButton.addActionListener(this); + + m_startButton = new JButton("Start"); + m_startButton.addActionListener(this); + m_startButton.setEnabled(false); + + m_isExportingButton = new JCheckBox("export, not import", true); + m_isJavaComponentButton = new JCheckBox("use java component", false); + + m_saveButton = new JButton("Save..."); + m_saveButton.addActionListener(this); + + m_batchButton = new JButton("Batch..."); + m_batchButton.addActionListener(this); + + JPanel buttonPanel = new JPanel(); + buttonPanel.add(m_batchButton); + buttonPanel.add(m_openButton); + buttonPanel.add(m_startButton); + buttonPanel.add(m_goButton); + buttonPanel.add(m_stepButton); + buttonPanel.add(m_isExportingButton); + buttonPanel.add(m_isJavaComponentButton); + buttonPanel.add(m_saveButton); + + mainPanel.add("South", buttonPanel); + + enableGoButton(false); + + return mainPanel; + } + + /* + * enables/disables the Go(and Step) button. + */ + private void enableGoButton(boolean enabled) + { + m_goButton.setEnabled(enabled); + m_stepButton.setEnabled(enabled); + } + + /* + * updates the unsolved reference information. + */ + private void updatesUnsolvedReferencesInformation() + { + m_unsolvedReferenceTable.setModel(new UnsolvedReferenceTableModel(this)); + } + + /* + * adjusts the view of the tree in order to make the + * particular Node into the focus tree leaf. + */ + private void updatesTree(Node node, JTree tree) + { + int i=0; + int currentLine = 0; + + while (i<tree.getRowCount()) + { + TreePath treePath = tree.getPathForRow(i); + tree.expandPath(treePath); + + AdapterNode adapterNode = (AdapterNode)treePath.getLastPathComponent(); + + if (node == adapterNode.getNode()) + { + tree.addSelectionPath(treePath); + currentLine = i; + } + + ++i; + } + + tree.setCellRenderer(new XMLTreeCellRanderer(node)); + tree.scrollRowToVisible(currentLine); + } + + /****************************************************************************** + * action listener related methods. + ******************************************************************************/ + + /* + * reads in a document, either the document is a file or + * is a text paragraph. + */ + private void openDocument() + { + if (m_leftTabPane.getSelectedIndex() == 0) + { + File f = openFile(); + if (f != null) + { + parseFile(f); + } + } + else + { + String text = m_leftTextArea.getText(); + + try + { + parseStream(new ByteArrayInputStream(text.getBytes("UTF-8"))); + } + catch(UnsupportedEncodingException e) + { + e.printStackTrace(); + } + + m_leftTabPane.setSelectedIndex(0); + } + } + + /* + * save the result tree to a file. + */ + private void saveResult() + { + saveFile(); + } + + /* + * selects a batch file to excute. + */ + private void openBatch() + { + File f = openFile(); + if (f != null) + { + runBatch(f); + } + } + + /* + * makes the current operation to an end. + */ + private void endMission() + { + enableGoButton(false); + m_parsingThread = null; + + if (m_xmlSecurityFrameworkController != null) + { + m_xmlSecurityFrameworkController.endMission(); + } + + updatesUIs(); + + m_xmlSecurityFrameworkController = null; + freeComponents(); + + System.gc(); + } + + + /****************************************************************************** + * UNO component related methods + ******************************************************************************/ + + /* + * connects the SO server. + */ + private void connectSO(String unoUrlString) + { + if (unoUrlString != null) + { + m_unoURL = new String(unoUrlString); + } + + try + { + m_xRemoteServiceManager = getRemoteServiceManager(m_unoURL); + } + catch(Exception e) + { + e.printStackTrace(); + } + } + + /* + * creates UNO components. + */ + private boolean createComponents() + { + try + { + String SEInitializer_comp; + String XMLSignature_comp; + String XMLEncryption_comp; + String tokenPath; + + if (m_bIsJavaBased) + { + SEInitializer_comp = SEINITIALIZER_COMPONENT_JAVA; + XMLSignature_comp = XMLSIGNATURE_COMPONENT_JAVA; + XMLEncryption_comp = XMLENCRYPTION_COMPONENT_JAVA; + tokenPath = m_javaTokenFile; + } + else + { + SEInitializer_comp = SEINITIALIZER_COMPONENT_C; + XMLSignature_comp = XMLSIGNATURE_COMPONENT_C; + XMLEncryption_comp = XMLENCRYPTION_COMPONENT_C; + tokenPath = m_nssTokenPath; + } + + Object seInitializerObj = m_xRemoteServiceManager.createInstanceWithContext( + SEInitializer_comp, m_xRemoteContext); + + if (seInitializerObj == null) + { + freeComponents(); + return false; + } + + m_xSEInitializer = (XSEInitializer)UnoRuntime.queryInterface( + XSEInitializer.class, seInitializerObj); + + m_xXMLSecurityContext = m_xSEInitializer.createSecurityContext(tokenPath); + + Object xmlSignatureObj = m_xRemoteServiceManager.createInstanceWithContext( + XMLSignature_comp, m_xRemoteContext); + + if (xmlSignatureObj == null) + { + freeComponents(); + return false; + } + + m_xXMLSignature = (XXMLSignature)UnoRuntime.queryInterface( + XXMLSignature.class, xmlSignatureObj); + + Object xmlEncryptionObj = m_xRemoteServiceManager.createInstanceWithContext( + XMLEncryption_comp, m_xRemoteContext); + + if (xmlEncryptionObj == null) + { + freeComponents(); + return false; + } + + m_xXMLEncryption = (XXMLEncryption)UnoRuntime.queryInterface( + XXMLEncryption.class, xmlEncryptionObj); + + return true; + } + catch(Exception e) + { + freeComponents(); + e.printStackTrace(); + return false; + } + } + + /* + * frees UNO components. + */ + private void freeComponents() + { + try + { + if (m_xXMLSecurityContext != null) + { + m_xSEInitializer.freeSecurityContext(m_xXMLSecurityContext); + m_xXMLSecurityContext = null; + } + + m_xXMLSignature = null; + m_xXMLEncryption = null; + m_xSEInitializer = null; + } + catch(Exception e) + { + e.printStackTrace(); + } + } + + /* + * getRemoteServiceManager + */ + private XMultiComponentFactory getRemoteServiceManager(String unoUrl) throws java.lang.Exception + { + if (m_xRemoteContext == null) + { + /* + * First step: create local component context, get local servicemanager and + * ask it to create a UnoUrlResolver object with an XUnoUrlResolver interface + */ + XComponentContext xLocalContext = + com.sun.star.comp.helper.Bootstrap.createInitialComponentContext(null); + XMultiComponentFactory xLocalServiceManager = xLocalContext.getServiceManager(); + Object urlResolver = xLocalServiceManager.createInstanceWithContext( + UNOURLRESOLVER, xLocalContext ); + /* + * query XUnoUrlResolver interface from urlResolver object + */ + XUnoUrlResolver xUnoUrlResolver = (XUnoUrlResolver) UnoRuntime.queryInterface( + XUnoUrlResolver.class, urlResolver ); + + /* + * Second step: use xUrlResolver interface to import the remote StarOffice.ServiceManager, + * retrieve its property DefaultContext and get the remote servicemanager + */ + Object initialObject = xUnoUrlResolver.resolve( unoUrl ); + XPropertySet xPropertySet = (XPropertySet)UnoRuntime.queryInterface( + XPropertySet.class, initialObject); + Object context = xPropertySet.getPropertyValue("DefaultContext"); + m_xRemoteContext = (XComponentContext)UnoRuntime.queryInterface( + XComponentContext.class, context); + } + return m_xRemoteContext.getServiceManager(); + } + + + /****************************************************************************** + * XML related methods + ******************************************************************************/ + + /* + * removes all empty text node inside the particular element + */ + private void removeEmptyText(Node node) + { + int type = node.getNodeType(); + NodeList children; + int i; + + switch (type) + { + case Node.DOCUMENT_NODE: + case Node.ELEMENT_NODE: + Node child = node.getFirstChild(); + while (child!= null) + { + Node nextSibling = child.getNextSibling(); + int childType = child.getNodeType(); + + if (childType==Node.TEXT_NODE) + { + String message = child.getNodeValue().trim(); + if (message == null || message.length()<=0) + { + node.removeChild(child); + } + } + else if (childType == Node.ELEMENT_NODE) + { + removeEmptyText(child); + } + + child = nextSibling; + } + break; + } + } + + /* + * reads a stream, and parses it into the original tree. + */ + private void parseStream(InputStream is) + { + try + { + DocumentBuilderFactory factory = + DocumentBuilderFactory.newInstance(); + m_document = null; + m_startButton.setEnabled(false); + initUI(); + + /* factory.setValidating(true); */ + /* factory.setNamespaceAware(true); */ + + try + { + DocumentBuilder builder = factory.newDocumentBuilder(); + m_document = builder.parse(is); + m_startButton.setEnabled(true); + initUI(); + } + catch (ParserConfigurationException pce) + { + pce.printStackTrace(); + } + catch (IOException ioe) + { + ioe.printStackTrace(); + } + } + catch(Exception exce) + { + System.out.println("input stream Exception"); + } + } + + + /****************************************************************************** + * file operation related methods + ******************************************************************************/ + + /* + * opens a file, and parses it into the original tree. + */ + private void parseFile(File name) + { + try + { + FileInputStream fis = new FileInputStream(name); + parseStream(fis); + fis.close(); + } + catch(Exception exce) + { + System.out.println("open file Exception"); + } + } + + + /* + * selects a file to open + */ + private File openFile() + { + File rc = null; + + JFileChooser fileChooser= new JFileChooser(); + + fileChooser.setDialogTitle("Select File To Open"); + fileChooser.setDialogType(JFileChooser.OPEN_DIALOG); + + fileChooser.setApproveButtonText("Ok"); + + if (m_currentDirectory == null) + { + fileChooser.rescanCurrentDirectory(); + } + else + { + fileChooser.setCurrentDirectory(m_currentDirectory); + } + + fileChooser.setFileFilter(new XMLFileFilter()); + + int result = fileChooser.showDialog(this,null); + if (result==fileChooser.APPROVE_OPTION) + { + m_currentDirectory = fileChooser.getCurrentDirectory(); + rc = fileChooser.getSelectedFile(); + } + + return rc; + } + + private void saveFile() + { + JFileChooser fileChooser= new JFileChooser(); + + fileChooser.setDialogTitle("Select File To Save"); + fileChooser.setDialogType(JFileChooser.SAVE_DIALOG); + + fileChooser.setApproveButtonText("Ok"); + + if (m_currentDirectory == null) + { + fileChooser.rescanCurrentDirectory(); + } + else + { + fileChooser.setCurrentDirectory(m_currentDirectory); + } + + fileChooser.setFileFilter(new XMLFileFilter()); + + int result = fileChooser.showDialog(this,null); + if (result==fileChooser.APPROVE_OPTION) + { + try + { + m_currentDirectory = fileChooser.getCurrentDirectory(); + saveFile(fileChooser.getSelectedFile()); + } + catch(Exception exce) + { + System.out.println("save file Exception"); + exce.printStackTrace(); + } + } + } + + /* + * excutes a batch file. + */ + private void runBatch(File f) + { + FileInputStream fis = null; + + try + { + fis = new FileInputStream(f); + StringBuffer commandBuffer = new StringBuffer(); + + m_logFileOutputStream = new FileOutputStream("TestTool-log.txt"); + m_bIsBatchRunning = true; + int ch = 0; + + while (ch != -1) + { + ch = fis.read(); + + if (ch != 0x0a && ch != -1) + { + if (ch != 0x0d) + { + commandBuffer.append((char)ch); + } + } + else + { + String command = new String(commandBuffer); + if (command.startsWith("Open ")) + { + m_logFileOutputStream.write(("start \""+command+"\" ...\n").getBytes()); + String fileName = command.substring(5); + parseFile(new File(fileName)); + m_logFileOutputStream.write("command end \n\n".getBytes()); + } + else if (command.startsWith("Use Java Component")) + { + m_logFileOutputStream.write(("start \""+command+"\" ...\n").getBytes()); + m_isJavaComponentButton.setSelected(true); + m_logFileOutputStream.write("command end \n\n".getBytes()); + } + else if (command.startsWith("Use C++ Component")) + { + m_logFileOutputStream.write(("start \""+command+"\" ...\n").getBytes()); + m_isJavaComponentButton.setSelected(false); + m_logFileOutputStream.write("command end \n\n".getBytes()); + } + else if (command.startsWith("Go ")) + { + m_logFileOutputStream.write(("start \""+command+"\" ...\n").getBytes()); + String opera = command.substring(3); + if (opera.equals("Sign") || opera.equals("Encrypt")) + { + m_isExportingButton.setSelected(true); + } + else + { + m_isExportingButton.setSelected(false); + } + + startsUp(); + if (m_parsingThread != null) + { + m_bIsUIUpdateSuppressed = true; + try{ + while (m_parsingThread.nextStep()); + endMission(); + } + catch(Exception e) + { + System.out.println("exception happen during batch:"+e); + e.printStackTrace(); + } + + m_bIsUIUpdateSuppressed = false; + updatesUIs(); + } + m_logFileOutputStream.write("command end \n\n".getBytes()); + } + else if (command.startsWith("Save ")) + { + m_logFileOutputStream.write(("start \""+command+"\" ...\n").getBytes()); + String fileName = command.substring(5); + saveFile(new File(fileName)); + m_logFileOutputStream.write("command end \n\n".getBytes()); + } + + commandBuffer = new StringBuffer(); + } + } + + m_bIsBatchRunning = false; + m_logFileOutputStream.close(); + m_logFileOutputStream = null; + + fis.close(); + fis = null; + } + catch(java.io.IOException e) + { + e.printStackTrace(); + } + } + + /* + * save the current result tree to a particular file. + */ + private void saveFile(File f) + { + try{ + FileOutputStream fos = new FileOutputStream(f); + SAXEventPrinter.display((Document)m_rightTreeEventCollector.getDocument(), + 0,fos,false); + fos.close(); + }catch(Exception e) + { + e.printStackTrace(); + } + } + + /****************************************************************************** + * others + ******************************************************************************/ + + /* + * starts up the operation. + */ + private void startsUp() + { + if (m_parsingThread != null) + { + m_parsingThread = null; + } + + m_bIsExporting = m_isExportingButton.isSelected(); + m_bIsJavaBased = m_isJavaComponentButton.isSelected(); + + if (createComponents()) + { + m_rightTreeEventCollector = new SAXEventCollector(this); + + m_parsingThread = new ParsingThread( + m_document, + null, + this); + + m_xmlSecurityFrameworkController = + new XMLSecurityFrameworkController( + this, + m_bIsExporting, + m_bIsJavaBased, + m_rightTreeEventCollector, + m_parsingThread, + m_xXMLSecurityContext, + m_xXMLSignature, + m_xXMLEncryption, + m_xRemoteServiceManager, + m_xRemoteContext); + + enableGoButton(true); + } + else + { + showMessage("Error in creating XML Security Components!"); + } + } + +/************************************************************************************** + * protected methods + **************************************************************************************/ + + /****************************************************************************** + * UI related methods + ******************************************************************************/ + + /* + * updates the sax chain information. + */ + protected void updatesSAXChainInformation(String chainStr) + { + m_saxChainLabel.setText(chainStr); + } + + /* + * update the current SAX event information. + */ + protected void updatesCurrentSAXEventInformation(String event) + { + m_saxEventText.setText(event); + } + + /* + * updates all information in the UI. + */ + protected void updatesUIs() + { + if (!m_bIsUIUpdateSuppressed) + { + m_leftTree.clearSelection(); + updatesTree(null, m_leftTree); + + if (m_xmlSecurityFrameworkController != null) + { + String bufferNodeTreeText = m_xmlSecurityFrameworkController.getBufferNodeTreeInformation(); + if (bufferNodeTreeText == null) + { + m_middleTree.setVisible(false); + m_bufferNodeTextArea.setText("No XML Security Related"); + } + else + { + m_middleTreeEventCollector = new SAXEventCollector(null); + m_xmlSecurityFrameworkController.getDocument(m_middleTreeEventCollector); + + m_middleTreeModelAdapter = new DomToTreeModelAdapter(m_middleTreeEventCollector.getDocument()); + m_middleTree.setModel(m_middleTreeModelAdapter); + updatesTree(null, m_middleTree); + m_middleTree.setVisible(true); + m_bufferNodeTextArea.setText(bufferNodeTreeText); + } + } + else + { + m_middleTree.setVisible(false); + m_bufferNodeTextArea.setText("No XMLImporter/XMLExporter"); + } + + if (m_rightTreeEventCollector != null) + { + m_rightTreeModelAdapter = new DomToTreeModelAdapter((Document)m_rightTreeEventCollector.getDocument()); + m_rightTree.setModel(m_rightTreeModelAdapter); + updatesTree((Node)m_rightTreeEventCollector.getCurrentElement(), m_rightTree); + } + + updatesUnsolvedReferencesInformation(); + } + } + + /* + * shows a message. + */ + protected void showMessage(String msg) + { + if (m_bIsBatchRunning) + { + try + { + if (!msg.startsWith("Message from : SAXEventKeeper")) + { + byte [] b = msg.getBytes(); + m_logFileOutputStream.write(" ".getBytes()); + + for (int i=0; i<b.length; ++i) + { + m_logFileOutputStream.write(b[i]); + if (b[i] == '\n') + { + m_logFileOutputStream.write(" ".getBytes()); + } + } + m_logFileOutputStream.write("\n ==============================\n".getBytes()); + } + } + catch(IOException e) + { + e.printStackTrace(); + } + } + else + { + if (stepMode) + { + JOptionPane optionPane = new JOptionPane(); + optionPane.showMessageDialog(this, msg, "TestTool Notification", JOptionPane.INFORMATION_MESSAGE); + } + else + { + Object[] options = { "OK", "Go back to step mode" }; + if (1 == JOptionPane.showOptionDialog(this, msg, "TestTool Notification", + JOptionPane.DEFAULT_OPTION, JOptionPane.PLAIN_MESSAGE, + null, options, options[0])) + { + stepMode = true; + } + } + } + } + + + /****************************************************************************** + * information retrieving + ******************************************************************************/ + + /* + * gets all unsolved reference ids. + * a reference id is the value of the id attribute of an + * referenced element. + */ + protected Vector getUnsolvedReferenceIds() + { + Vector rc; + + if (m_xmlSecurityFrameworkController == null) + { + rc = new Vector(); + } + else + { + rc = ((XMLSecurityFrameworkController)m_xmlSecurityFrameworkController). + getUnsolvedReferenceIds(); + } + + return rc; + } + + /* + * gets all unsolved reference keeper ids. + * a reference keeper id is the id which the SAXEventKeeper uses + * to identify the corresponding BufferNode. + */ + protected Vector getUnsolvedReferenceKeeperIds() + { + Vector rc; + + if (m_xmlSecurityFrameworkController == null) + { + rc = new Vector(); + } + else + { + rc = ((XMLSecurityFrameworkController)m_xmlSecurityFrameworkController). + getUnsolvedReferenceKeeperIds(); + } + + return rc; + } + + /* + * gets all unsolved references' remaining numbers. + * a remaining number is that how many claims have not been found for + * a unsolved reference. + */ + protected Vector getUnsolvedReferenceRefNum() + { + Vector rc; + + if (m_xmlSecurityFrameworkController == null) + { + rc = new Vector(); + } + else + { + rc = ((XMLSecurityFrameworkController)m_xmlSecurityFrameworkController). + getUnsolvedReferenceRefNum(); + } + + return rc; + } + + +/************************************************************************************** + * public methods + **************************************************************************************/ + + /****************************************************************************** + * action listener related methods. + ******************************************************************************/ + + /* + * action listening method. + */ + public void actionPerformed(ActionEvent e) + { + if (e.getSource().equals(m_startButton)) + { + endMission(); + startsUp(); + } + if (e.getSource().equals(m_goButton)) + { + if (m_parsingThread != null) + { + stepMode = false; + boolean notOver; + while ( notOver = m_parsingThread.nextStep()) + { + if (stepMode) break; + } + + if (!notOver) endMission(); + } + } + if (e.getSource().equals(m_stepButton)) + { + if (m_parsingThread != null) + { + if (!m_parsingThread.nextStep()) + { + endMission(); + } + } + } + if (e.getSource().equals(m_openButton)) + { + openDocument(); + } + if (e.getSource().equals(m_saveButton)) + { + saveResult(); + } + if (e.getSource().equals(m_batchButton)) + { + openBatch(); + } + } + + /* + * void-consturctor method + */ + public TestTool() + { + getRootPane().putClientProperty("defeatSystemEventQueueCheck", Boolean.TRUE); + + try + { + m_currentDirectory = new File(System.getProperty("user.dir")); + } + catch(Exception e) + { + System.out.println("getProperty error :"+e); + } + } + + /* + * consturctor method with a specific connection URL + */ + public TestTool(String connecturl) + { + this(); + m_unoURL = new String(connecturl); + } + + public static void main(String argv[]) + { + Dimension screenSize = + Toolkit.getDefaultToolkit().getScreenSize(); + + TestTool tt; + + if (argv.length < 1) + { + System.out.println("Usage: java TestTool [javaTokenFile] [nssTokenPath] [xml file]?"); + return; + } + + boolean hasFile = false; + boolean hasBatch = false; + String fileName = null; + + if (argv.length >= 3) + { + if (argv[2].startsWith("-b")) + { + fileName = argv[2].substring(2); + hasBatch = true; + } + else + { + fileName = argv[2]; + hasFile = true; + } + } + + tt = new TestTool(); + tt.m_javaTokenFile = new String(argv[0]); + tt.m_nssTokenPath = new String(argv[1]); + tt.connectSO(null); + + /* Set up a GUI framework */ + JFrame myFrame = new JFrame("XML Security Components Tester"); + myFrame.addWindowListener( + new WindowAdapter() { + public void windowClosing(WindowEvent e) {System.exit(0);} + } + ); + + myFrame.setContentPane(tt.buildUI(screenSize.width, screenSize.height)); + myFrame.pack(); + int w = screenSize.width-30; + int h = screenSize.height-30; + myFrame.setLocation(screenSize.width/2 - w/2, + screenSize.height/2 - h/2); + myFrame.setSize(w, h); + myFrame.setVisible(true); + + if (hasFile) + { + tt.parseFile(new File(fileName)); + } + else if (hasBatch) + { + tt.runBatch(new File(fileName)); + } + } +} + diff --git a/xmlsecurity/tools/uno/UnsolvedReferenceTableModel.java b/xmlsecurity/tools/uno/UnsolvedReferenceTableModel.java new file mode 100644 index 000000000000..21f17de8877d --- /dev/null +++ b/xmlsecurity/tools/uno/UnsolvedReferenceTableModel.java @@ -0,0 +1,89 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +package com.sun.star.xml.security.uno; + +import javax.swing.table.AbstractTableModel; + +/* + * this class is used to maintain the unsolved reference + * table. + */ +class UnsolvedReferenceTableModel extends AbstractTableModel +{ + private String[] m_columnNames = {"id", + "refNum", + "EC's id"}; + + private TestTool m_testTool; + + UnsolvedReferenceTableModel(TestTool testTool) + { + m_testTool = testTool; + } + + public String getColumnName(int col) + { + return m_columnNames[col].toString(); + } + + public int getRowCount() + { + return m_testTool.getUnsolvedReferenceIds().size(); + } + + public int getColumnCount() + { + return m_columnNames.length; + } + + public Object getValueAt(int row, int col) + { + if (col == 0) + { + return (String)m_testTool.getUnsolvedReferenceIds().elementAt(row); + } + else if (col == 1) + { + return ((Integer)m_testTool.getUnsolvedReferenceRefNum().elementAt(row)).toString(); + } + else if (col == 2) + { + return ((Integer)m_testTool.getUnsolvedReferenceKeeperIds().elementAt(row)).toString(); + } + else + { + return null; + } + } + + public boolean isCellEditable(int row, int col) + { + return false; + } +} + diff --git a/xmlsecurity/tools/uno/XMLFileFilter.java b/xmlsecurity/tools/uno/XMLFileFilter.java new file mode 100644 index 000000000000..b9436cacfbda --- /dev/null +++ b/xmlsecurity/tools/uno/XMLFileFilter.java @@ -0,0 +1,79 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +package com.sun.star.xml.security.uno; + +import java.io.File; +import javax.swing.filechooser.FileFilter; + +/* + * this class is used as a file filter for the XML file + * (*.xml) and the batch file (*.txt). + */ +class XMLFileFilter extends FileFilter +{ + public static String getExtension(File f) + { + String ext = null; + String s = f.getName(); + int i = s.lastIndexOf('.'); + + if (i > 0 && i < s.length() - 1) { + ext = s.substring(i+1).toLowerCase(); + } + + return ext; + } + + public boolean accept(File f) + { + boolean rc = false; + + if (f.isDirectory()) + { + rc = true; + } + else + { + String extension = getExtension(f); + if (extension != null) + { + if (extension.equals("xml") || extension.equals("txt")) + { + rc = true; + } + } + } + + return rc; + } + + public String getDescription() + { + return "XML and batch files (.xml,.txt)"; + } +} diff --git a/xmlsecurity/tools/uno/XMLSecurityFrameworkController.java b/xmlsecurity/tools/uno/XMLSecurityFrameworkController.java new file mode 100644 index 000000000000..058981b460b0 --- /dev/null +++ b/xmlsecurity/tools/uno/XMLSecurityFrameworkController.java @@ -0,0 +1,1085 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +package com.sun.star.xml.security.uno; + +import java.util.Stack; +import java.util.Vector; + +/* uno classes */ +import com.sun.star.uno.UnoRuntime; +import com.sun.star.lang.XMultiComponentFactory; +import com.sun.star.lang.XInitialization; +import com.sun.star.uno.XComponentContext; +import com.sun.star.xml.sax.XDocumentHandler; +import com.sun.star.xml.sax.XAttributeList; +import com.sun.star.xml.sax.SAXException; + +import com.sun.star.xml.crypto.*; +import com.sun.star.xml.crypto.sax.*; +import com.sun.star.xml.wrapper.*; + +/* + * the XMLSecurityFrameworkController class is used to controll the xml security framework. + */ +public class XMLSecurityFrameworkController + implements XDocumentHandler, XSignatureCreationResultListener, XSignatureVerifyResultListener, + XEncryptionResultListener, XDecryptionResultListener, XSAXEventKeeperStatusChangeListener +{ + /* + * UNO framework component + */ + private XMultiComponentFactory m_xRemoteServiceManager; + private XComponentContext m_xRemoteContext; + + /* + * xml security related UNO components + */ + private XSecuritySAXEventKeeper m_xSAXEventKeeper; + private XXMLDocumentWrapper m_xXMLDocumentWrapper; + private XDocumentHandler m_xOutputHandler; + private XXMLSecurityContext m_xXMLSecurityContext; + private XXMLSignature m_xXMLSignature; + private XXMLEncryption m_xXMLEncryption; + + /* + * used to reserve the current SAX ancestor path + */ + private Stack m_currentPath; + + /* + * maintains all SignatureEntities. + */ + private Vector m_signatureList; + + /* + * maintains all EncryptionEntities. + */ + private Vector m_encryptionList; + + /* + * maintains all unsolved reference Ids. + * These ids are strings which is the value of the id attribute + * of the referenced element. + */ + private Vector m_vUnsolvedReferenceIds; + + /* + * maintains all unsolved reference keeper ids. + * The keeper id is used to uniquely identify a bufferred element + * by the SAXEventKeeper. + */ + private Vector m_vUnsolvedReferencedKeeperIds; + + /* + * maintains the left time that each unsolved reference can be + * claimed. + */ + private Vector m_vUnsolvedReferenceRefNum; + + /* + * whether exporting or importing + */ + private boolean m_bIsExporting; + + /* + * whether java or c + */ + private boolean m_bIsJavaBased; + + /* + * whether the SAXEventKeeper is blocking + */ + private boolean m_bIsBlocking; + + /* + * whether it is collecting a bufferred element + */ + private boolean m_bIsInsideCollectedElement; + + /* + * whether a SAXEventKeeper is in the SAX chain + */ + private boolean m_bSAXEventKeeperIncluded; + + /* + * the ParsingThread used to parse the document + */ + private ParsingThread m_parsingThread; + + /* + * the next document handler that will receives SAX events + * from the parsing thread. + * if the SAXEventKeeper is on the SAX chain, then this + * variable will be the SAXEventKeeper, otherwise, this + * variable will be the xOutputHandler. + */ + private XDocumentHandler m_xExportHandler; + + /* + * the TestTool used to feedback information + */ + private TestTool m_testTool; + + /* + * for encryption target + */ + private boolean m_bIsEncryptionTarget; + private EncryptionEntity m_EncryptionForTarget; + + XMLSecurityFrameworkController( + TestTool testTool, + boolean bIsExporting, + boolean bIsJavaBased, + XDocumentHandler xOutputHandler, + ParsingThread parsingThread, + XXMLSecurityContext xXMLSecurityContext, + XXMLSignature xXMLSignature, + XXMLEncryption xXMLEncryption, + XMultiComponentFactory xRemoteServiceManager, + XComponentContext xRemoteContext) + { + m_bIsExporting = bIsExporting; + m_bIsJavaBased = bIsJavaBased; + + m_xOutputHandler = xOutputHandler; + m_xXMLSecurityContext = xXMLSecurityContext; + m_xXMLSignature = xXMLSignature; + m_xXMLEncryption = xXMLEncryption; + m_xRemoteServiceManager = xRemoteServiceManager; + m_xRemoteContext = xRemoteContext; + + m_testTool = testTool; + m_parsingThread = parsingThread; + + m_signatureList = new Vector(); + m_encryptionList = new Vector(); + + m_vUnsolvedReferenceIds = new Vector(); + m_vUnsolvedReferencedKeeperIds = new Vector(); + m_vUnsolvedReferenceRefNum = new Vector(); + + m_xXMLDocumentWrapper = null; + m_xSAXEventKeeper = null; + + m_bSAXEventKeeperIncluded = false; + m_bIsBlocking = false; + m_bIsInsideCollectedElement = false; + + m_bIsEncryptionTarget = false; + m_EncryptionForTarget = null; + + changeOutput(); + + m_currentPath = new Stack(); + + foundSecurityRelated(); + } + +/************************************************************************************** + * private methods + **************************************************************************************/ + + /* + * changes the output document handler. + */ + private void changeOutput() + { + if (m_bIsExporting) + { + m_parsingThread.setHandler(this); + + /* + * If the SAXEventKeeper is in the SAX chain, then redirects output + * to the SAXEventKeeper, otherwise, to the m_xOutputHandler + */ + if (m_bSAXEventKeeperIncluded) + { + m_xExportHandler = (XDocumentHandler)UnoRuntime.queryInterface( + XDocumentHandler.class, m_xSAXEventKeeper); + m_xSAXEventKeeper.setNextHandler(m_xOutputHandler); + + m_testTool.updatesSAXChainInformation("XMLExporter -> SAXEventKeeper -> SAXWriter"); + } + else + { + m_xExportHandler = m_xOutputHandler; + m_testTool.updatesSAXChainInformation("XMLExporter -> SAXWriter"); + } + } + else + { + if (m_bSAXEventKeeperIncluded) + { + m_parsingThread.setHandler( + (XDocumentHandler)UnoRuntime.queryInterface(XDocumentHandler.class, m_xSAXEventKeeper)); + m_xSAXEventKeeper.setNextHandler(this); + m_testTool.updatesSAXChainInformation("SAXParser -> SAXEventKeeper -> XMLImporter"); + } + else + { + m_parsingThread.setHandler(this); + m_testTool.updatesSAXChainInformation("SAXParser -> XMLImporter"); + } + m_xExportHandler = m_xOutputHandler; + } + } + + /* + * handles the situation when a security related element is found. + * if the SAXEventKeeper is not initialized, then creates a + * SAXEventKeeper. + * the return value represents whether the SAXEventKeeper is newly + * created. + */ + private boolean foundSecurityRelated() + { + if (m_xSAXEventKeeper == null) + { + m_testTool.showMessage("Message from : "+ + (m_bIsExporting?"XMLExporter":"XMLImporter")+ + "\n\nA security related content found, a SAXEventKeeper is created.\n "); + + m_bIsBlocking = false; + m_bIsInsideCollectedElement = false; + + try + { + /* + * creates an XMLDocumentWrapper component. + */ + Object xmlDocumentObj = null; + + if (m_bIsJavaBased) + { + xmlDocumentObj = m_xRemoteServiceManager.createInstanceWithContext( + TestTool.XMLDOCUMENTWRAPPER_COMPONENT_JAVA, m_xRemoteContext); + } + else + { + xmlDocumentObj = m_xRemoteServiceManager.createInstanceWithContext( + TestTool.XMLDOCUMENTWRAPPER_COMPONENT_C, m_xRemoteContext); + } + + m_xXMLDocumentWrapper = (XXMLDocumentWrapper)UnoRuntime.queryInterface( + XXMLDocumentWrapper.class, xmlDocumentObj); + + /* + * creates a SAXEventKeeper component. + */ + Object saxEventKeeperObj = m_xRemoteServiceManager.createInstanceWithContext( + TestTool.SAXEVENTKEEPER_COMPONENT, m_xRemoteContext); + + m_xSAXEventKeeper = + (XSecuritySAXEventKeeper)UnoRuntime.queryInterface( + XSecuritySAXEventKeeper.class, saxEventKeeperObj); + + /* + * initializes the SAXEventKeeper component with the XMLDocumentWrapper component. + */ + XInitialization xInitialization = + (XInitialization)UnoRuntime.queryInterface( + XInitialization.class, m_xSAXEventKeeper); + Object args[]=new Object[1]; + args[0] = m_xXMLDocumentWrapper; + xInitialization.initialize(args); + } + catch( com.sun.star.uno.Exception e) + { + e.printStackTrace(); + } + + /* + * configures the SAXEventKeeper's status change listener. + */ + XSAXEventKeeperStatusChangeBroadcaster xSaxEventKeeperStatusChangeBroadcaster = + (XSAXEventKeeperStatusChangeBroadcaster)UnoRuntime.queryInterface( + XSAXEventKeeperStatusChangeBroadcaster.class, m_xSAXEventKeeper); + xSaxEventKeeperStatusChangeBroadcaster.addSAXEventKeeperStatusChangeListener(this); + } + + boolean rc = !m_bSAXEventKeeperIncluded; + + /* + * changes the export document handler. + */ + m_bSAXEventKeeperIncluded=true; + changeOutput(); + + return rc; + } + + /* + * finds key element or referenced element for a signature. + */ + private void findKeyOrReference(SecurityEntity signatureEntity, String uriStr, boolean isFindingKey) + { + int i=0; + + while (i<m_vUnsolvedReferenceIds.size()) + { + String id = (String)m_vUnsolvedReferenceIds.elementAt(i); + + if (id.equals(uriStr)) + { + int refNum = ((Integer)m_vUnsolvedReferenceRefNum.elementAt(i)).intValue(); + int keeperId = ((Integer)m_vUnsolvedReferencedKeeperIds.elementAt(i)).intValue(); + + if (isFindingKey) + { + /* + * clones a new ElementCollector for the key element. + */ + int cloneKeeperId = m_xSAXEventKeeper.cloneElementCollector( + keeperId, + m_bIsExporting? + (ElementMarkPriority.BEFOREMODIFY):(ElementMarkPriority.AFTERMODIFY)); + + /* + * notifies the key keeper id. + */ + signatureEntity.setKeyId(cloneKeeperId); + + /* + * sets the security id for the key. + */ + m_xSAXEventKeeper.setSecurityId(cloneKeeperId, signatureEntity.getSecurityId()); + + /* + * sets the resolve listener. + */ + XReferenceResolvedBroadcaster xReferenceResolvedBroadcaster = + (XReferenceResolvedBroadcaster)UnoRuntime.queryInterface( + XReferenceResolvedBroadcaster.class, m_xSAXEventKeeper); + xReferenceResolvedBroadcaster.addReferenceResolvedListener( + cloneKeeperId, + signatureEntity.getReferenceListener()); + } + else + { + /* + * clones a new ElementCollector for the referenced element. + */ + int cloneKeeperId = m_xSAXEventKeeper.cloneElementCollector( + keeperId, + m_bIsExporting? + (ElementMarkPriority.AFTERMODIFY):(ElementMarkPriority.BEFOREMODIFY)); + + /* + * sets the security id. + */ + m_xSAXEventKeeper.setSecurityId(cloneKeeperId, signatureEntity.getSecurityId()); + + /* + * sets the resolve listener. + */ + XReferenceResolvedBroadcaster xReferenceResolvedBroadcaster = + (XReferenceResolvedBroadcaster)UnoRuntime.queryInterface( + XReferenceResolvedBroadcaster.class, m_xSAXEventKeeper); + xReferenceResolvedBroadcaster.addReferenceResolvedListener(cloneKeeperId, + signatureEntity.getReferenceListener()); + + try{ + XReferenceCollector xReferenceCollector = + (XReferenceCollector)UnoRuntime.queryInterface( + XReferenceCollector.class, signatureEntity.getReferenceListener()); + xReferenceCollector.setReferenceId(cloneKeeperId); + } + catch( com.sun.star.uno.Exception e) + { + e.printStackTrace(); + } + } + + /* + * if this unsolved reference reaches its max reference number, remove this reference + * from all vectors. + */ + refNum--; + if (refNum == 0) + { + m_xSAXEventKeeper.removeElementCollector(keeperId); + m_vUnsolvedReferenceIds.remove(i); + m_vUnsolvedReferencedKeeperIds.remove(i); + m_vUnsolvedReferenceRefNum.remove(i); + } + else + { + m_vUnsolvedReferenceRefNum.setElementAt(new Integer(refNum),(i)); + ++i; + } + + /* + * If it is find a key, then no further search is needed, one + * signature has one key at most. + */ + if (isFindingKey) + { + break; + } + } + else + { + ++i; + } + } + } + + /* + * checks whether a startElement event represents any security related information. + * return true if this event can't be forwarded into the SAX chain. + */ + private boolean checkSecurityElement(String localName, com.sun.star.xml.sax.XAttributeList xattribs) + { + boolean rc = false; + + if (localName.equals("Signature")) + /* + * this element is a Signature element. + */ + { + SignatureEntity signatureEntity = new SignatureEntity( + m_xSAXEventKeeper, + m_bIsExporting, + this, + m_xXMLSecurityContext, + m_xXMLSignature, + m_xXMLEncryption, + m_xRemoteServiceManager, + m_xRemoteContext); + + m_signatureList.add(signatureEntity); + m_currentPath.push(signatureEntity); + } + else if(localName.equals("Reference")) + { + if (!m_currentPath.empty()) + { + Object signedInfo = m_currentPath.pop(); + + if (!m_currentPath.empty()) + { + Object objSignature = m_currentPath.peek(); + + if ((objSignature instanceof SignatureEntity) && signedInfo.toString().equals("SignedInfo")) + /* + * this element is a Reference element in a signature. + */ + { + String uriStr = xattribs.getValueByName("URI"); + + if (uriStr.charAt(0) == '#') + { + uriStr = uriStr.substring(1); + SignatureEntity signatureEntity = (SignatureEntity)objSignature; + + if (uriStr != null && uriStr.length()>0) + { + signatureEntity.addReferenceId(uriStr); + findKeyOrReference(signatureEntity, uriStr, false); + } + } + } + } + m_currentPath.push(signedInfo); + } + m_currentPath.push(localName); + } + else if(localName.equals("KeyValue") || + localName.equals("KeyName") || + localName.equals("X509Data") || + localName.equals("EncryptedKey")) + { + if (!m_currentPath.empty()) + { + Object keyInfo = m_currentPath.pop(); + + if (!m_currentPath.empty()) + { + Object objSorE = m_currentPath.peek(); + + if ((objSorE instanceof SignatureEntity) && keyInfo.toString().equals("KeyInfo")) + /* + * this element is the key element of a signature. + */ + { + SignatureEntity signatureEntity = (SignatureEntity)objSorE; + signatureEntity.setKeyId(0); + } + else if ((objSorE instanceof EncryptionEntity) && keyInfo.toString().equals("KeyInfo")) + /* + * this element is the key element of an encryption. + */ + { + EncryptionEntity theEncryption = (EncryptionEntity)objSorE; + theEncryption.setKeyId(0); + } + } + m_currentPath.push(keyInfo); + } + + m_currentPath.push(localName); + } + else if(localName.equals("RetrievalMethod")) + { + if (!m_currentPath.empty()) + { + Object keyInfo = m_currentPath.pop(); + + if (!m_currentPath.empty()) + { + Object objSorE = m_currentPath.peek(); + + if ((objSorE instanceof SignatureEntity) && keyInfo.toString().equals("KeyInfo")) + /* + * this element is the RetrievalMethod element in a signature, + * which will include the key uri of this signature. + */ + { + String uriStr = xattribs.getValueByName("URI"); + SignatureEntity signatureEntity = (SignatureEntity)objSorE; + + if (uriStr != null && uriStr.length()>0) + { + signatureEntity.setKeyURI(uriStr); + findKeyOrReference(signatureEntity,uriStr, true); + } + } + else if ((objSorE instanceof EncryptionEntity) && keyInfo.toString().equals("KeyInfo")) + /* + * this element is the RetrievalMethod element in an encryption, + * which will include the key uri of this encryption. + */ + { + String uriStr = xattribs.getValueByName("URI"); + EncryptionEntity theEncryption = (EncryptionEntity)objSorE; + + if (uriStr != null && uriStr.length()>0) + { + theEncryption.setKeyURI(uriStr); + findKeyOrReference(theEncryption, uriStr, true); + } + } + } + m_currentPath.push(keyInfo); + } + m_currentPath.push(localName); + } + else if (localName.equals("EncryptedData")) /* || localName.equals("EncryptedKey")) */ + /* + * this element is an Encryption element. + */ + { + EncryptionEntity theEncryption = new EncryptionEntity( + m_xSAXEventKeeper, + m_bIsExporting, + this, + m_xXMLSecurityContext, + m_xXMLSignature, + m_xXMLEncryption, + m_xRemoteServiceManager, + m_xRemoteContext); + + m_encryptionList.add(theEncryption); + + if (m_bIsExporting) + { + m_currentPath.push(theEncryption); + } + else + { + String uriStr = xattribs.getValueByName("keyURI"); + if (uriStr != null && uriStr.length()>0) + { + theEncryption.setKeyURI(uriStr); + findKeyOrReference(theEncryption,uriStr, true); + } + else + { + theEncryption.setKeyId(0); + } + + rc = true; + } + } + else + /* + * not a security related element. + */ + { + m_currentPath.push(localName); + } + + return rc; + } + + /* + * checks whether a startElement event is referenced by any security entity. + */ + private void checkReference(String localName, com.sun.star.xml.sax.XAttributeList xattribs, String id) + { + String refNumStr = xattribs.getValueByName("refNum"); + + if ( m_bIsEncryptionTarget ) + { + m_EncryptionForTarget.setReference(m_bIsExporting); + m_bIsEncryptionTarget = false; + } + + if (id != null && id.length()>0 ) + /* + * only if this element has id attribute, then it can be referenced by + * a security entity. + */ + { + /* + * if this element has an "refNum" attribute, then the value will be + * the max referencing number on this element, otherwise, set the max + * referencing number to 999. + */ + int refNum = 999; + + if (refNumStr != null && refNumStr.length()>0 ) + { + refNum = new Integer(refNumStr).intValue(); + } + + int length; + + /* + * searches the signature list to check whether any sigture has + * reference on this element. + */ + length = m_signatureList.size(); + for (int i=0; i<length; ++i) + { + SignatureEntity signatureEntity = (SignatureEntity)m_signatureList.elementAt(i); + + if (signatureEntity.setReference(id, m_bIsExporting)) + { + refNum--; + } + + if (signatureEntity.setKey(id, m_bIsExporting)) + { + refNum--; + } + } + + /* + * searches the encryption list for reference. + */ + length = m_encryptionList.size(); + for (int i=0; i<length; ++i) + { + EncryptionEntity theEncryption = (EncryptionEntity)m_encryptionList.elementAt(i); + + if (theEncryption.setKey(id, m_bIsExporting)) + { + refNum--; + } + } + + /* + * if the max referencing number is not reached, then add this element + * into the unsolved reference list. + */ + if (refNum>0) + { + int keeperId; + + if (localName.equals("EncryptedKey")) + { + keeperId = m_xSAXEventKeeper.addSecurityElementCollector( + m_bIsExporting? + (ElementMarkPriority.BEFOREMODIFY):(ElementMarkPriority.AFTERMODIFY), + true); + } + else + { + keeperId = m_xSAXEventKeeper.addSecurityElementCollector( + m_bIsExporting? + (ElementMarkPriority.AFTERMODIFY):(ElementMarkPriority.BEFOREMODIFY), + false); + } + + m_vUnsolvedReferenceIds.add(id); + m_vUnsolvedReferencedKeeperIds.add(new Integer(keeperId)); + m_vUnsolvedReferenceRefNum.add(new Integer(refNum)); + } + } + } + + /* + * configures the output handler. + */ + private void setOutputHandler(XDocumentHandler handler) + { + m_xOutputHandler = handler; + changeOutput(); + } + + +/************************************************************************************** + * protected methods + **************************************************************************************/ + + /* + * methods used to transfer unsolved reference information. + */ + protected Vector getUnsolvedReferenceIds() + { + return m_vUnsolvedReferenceIds; + } + + protected Vector getUnsolvedReferenceKeeperIds() + { + return m_vUnsolvedReferencedKeeperIds; + } + + protected Vector getUnsolvedReferenceRefNum() + { + return m_vUnsolvedReferenceRefNum; + } + + protected String getBufferNodeTreeInformation() + { + if (m_xSAXEventKeeper != null) + { + return m_xSAXEventKeeper.printBufferNodeTree(); + } + else + { + return null; + } + } + + protected void getDocument(XDocumentHandler handler) + { + if (m_xXMLDocumentWrapper != null) + { + try + { + m_xXMLDocumentWrapper.getTree(handler); + } + catch(SAXException e) + { + e.printStackTrace(); + } + } + } + + protected void endMission() + { + while (m_signatureList.size()>0 || m_encryptionList.size()>0) + { + if (m_signatureList.size()>0) + { + SignatureEntity signatureEntity = (SignatureEntity)m_signatureList.elementAt(0); + m_signatureList.remove(0); + signatureEntity.endMission(); + } + else if (m_encryptionList.size()>0) + { + EncryptionEntity theEncryption = (EncryptionEntity)m_encryptionList.elementAt(0); + m_encryptionList.remove(0); + theEncryption.endMission(); + } + } + + while (m_vUnsolvedReferenceIds.size()>0) + { + int keeperId = ((Integer)m_vUnsolvedReferencedKeeperIds.elementAt(0)).intValue(); + m_xSAXEventKeeper.removeElementCollector(keeperId); + m_vUnsolvedReferenceIds.remove(0); + m_vUnsolvedReferencedKeeperIds.remove(0); + m_vUnsolvedReferenceRefNum.remove(0); + } + + m_xSAXEventKeeper.setNextHandler(null); + + XSAXEventKeeperStatusChangeBroadcaster xSaxEventKeeperStatusChangeBroadcaster = + (XSAXEventKeeperStatusChangeBroadcaster)UnoRuntime.queryInterface( + XSAXEventKeeperStatusChangeBroadcaster.class, m_xSAXEventKeeper); + xSaxEventKeeperStatusChangeBroadcaster.addSAXEventKeeperStatusChangeListener(null); + + m_xSAXEventKeeper = null; + m_xXMLDocumentWrapper = null; + m_xOutputHandler = null; + m_xXMLSecurityContext = null; + m_xXMLSignature = null; + m_xXMLEncryption = null; + + m_xExportHandler = null; + m_parsingThread.setHandler(null); + } + +/************************************************************************************** + * public methods + **************************************************************************************/ + + /* + * XDocumentHandler + */ + public void startDocument() + { + try{ + m_xExportHandler.startDocument(); + } + catch( com.sun.star.xml.sax.SAXException e) + { + e.printStackTrace(); + } + + } + + public void endDocument() + { + try{ + m_xExportHandler.endDocument(); + } + catch( com.sun.star.xml.sax.SAXException e) + { + e.printStackTrace(); + } + } + + public void startElement (String str, com.sun.star.xml.sax.XAttributeList xattribs) + { + try{ + String idAttr = xattribs.getValueByName("id"); + if (idAttr == null) + { + idAttr = xattribs.getValueByName("Id"); + } + + boolean hasIdAttr = (idAttr != null && idAttr.length()>0 ); + boolean needResend = false; + + if (hasIdAttr || + (str.equals("Signature")||str.equals("EncryptedData")))/* || str.equals("EncryptedKey"))) */ + { + if (foundSecurityRelated() && !m_bIsExporting) + { + needResend = true; + } + } + + boolean suppressToNext = checkSecurityElement(str, xattribs); + + checkReference(str, xattribs, idAttr); + + if (needResend) + { + m_xSAXEventKeeper.setNextHandler(null); + + XDocumentHandler saxEventKeeperHandler = + (XDocumentHandler)UnoRuntime.queryInterface( + XDocumentHandler.class, m_xSAXEventKeeper); + saxEventKeeperHandler.startElement(str, xattribs); + m_xSAXEventKeeper.setNextHandler((XDocumentHandler)this); + } + + if (!suppressToNext) + { + m_xExportHandler.startElement(str, xattribs); + } + } + catch( com.sun.star.xml.sax.SAXException e) + { + e.printStackTrace(); + } + } + + public void endElement(String str) + { + if (!m_currentPath.empty()) + { + Object obj = m_currentPath.pop(); + + if (obj.toString().equals("SignedInfo")) + { + if (!m_currentPath.empty()) + { + Object objSignature = m_currentPath.peek(); + if (objSignature != null && objSignature instanceof SignatureEntity) + { + ((SignatureEntity)objSignature).setReferenceNumber(); + } + } + } + else if (obj instanceof EncryptionEntity) + { + m_bIsEncryptionTarget = true; + m_EncryptionForTarget = (EncryptionEntity)obj; + + } + } + + try{ + m_xExportHandler.endElement(str); + } + catch( com.sun.star.xml.sax.SAXException e) + { + e.printStackTrace(); + } + } + + public void characters(String str) + { + try{ + m_xExportHandler.characters(str); + } + catch( com.sun.star.xml.sax.SAXException e) + { + e.printStackTrace(); + } + } + + public void ignorableWhitespace(String str) + { + } + + public void processingInstruction(String aTarget, String aData) + { + try{ + m_xExportHandler.processingInstruction(aTarget, aData); + } + catch( com.sun.star.xml.sax.SAXException e) + { + e.printStackTrace(); + } + } + + public void setDocumentLocator (com.sun.star.xml.sax.XLocator xLocator ) + throws com.sun.star.xml.sax.SAXException + { + } + + + /* + * XSignatureCreationResultListener + */ + public void signatureCreated(int securityId, SecurityOperationStatus creationResult) + { + String message = new String(); + message += "A Signature is created:"; + message += "\nSecurity Id = "+securityId; + message += "\nCreation result = "+((creationResult==SecurityOperationStatus.OPERATION_SUCCEEDED)?"Succeed":"Fail"); + + m_testTool.showMessage("Message from : SignatureCreator\n\n"+message+"\n "); + } + + /* + * XSignatureVerifyResultListener + */ + public void signatureVerified(int securityId, SecurityOperationStatus verifyResult) + { + String message = new String(); + message += "A Signature is verified:"; + message += "\nSecurity Id = "+securityId; + message += "\nVerify result = "+((verifyResult==SecurityOperationStatus.OPERATION_SUCCEEDED)?"Succeed":"Fail"); + + m_testTool.showMessage("Message from : SignatureVerifier\n\n"+message+"\n "); + } + + /* + * XEncryptionResultListener + */ + public void encrypted(int securityId, SecurityOperationStatus encryptionResult) + { + String message = new String(); + message += "An EncryptedData is encrypted:"; + message += "\nSecurity Id = "+securityId; + message += "\nEncrypt result = "+((encryptionResult==SecurityOperationStatus.OPERATION_SUCCEEDED)?"Succeed":"Fail"); + + m_testTool.showMessage("Message from : Encryptor\n\n"+message+"\n "); + } + + /* + * XDecryptionResultListener methods + */ + public void decrypted(int securityId, SecurityOperationStatus decryptionResult) + { + String message = new String(); + message += "An EncryptedData is decrypted:"; + message += "\nSecurity Id = "+securityId; + message += "\nDecrypt result = "+((decryptionResult==SecurityOperationStatus.OPERATION_SUCCEEDED)?"Succeed":"Fail"); + + m_testTool.showMessage("Message from : Decryptor\n\n"+message+"\n "); + } + + /* + * XSAXEventKeeperStatusChangeListener methods + */ + public void blockingStatusChanged(boolean isBlocking) + { + m_testTool.showMessage("Message from : SAXEventKeeper\n\n"+ + (isBlocking?"The SAX event stream is blocked.":"The SAX event stream is unblocked.")+ + "\n "); + + this.m_bIsBlocking = isBlocking; + } + + public void collectionStatusChanged(boolean isInsideCollectedElement) + { + m_testTool.showMessage("Message from : SAXEventKeeper\n\n"+ + (isInsideCollectedElement?"Begin to buffer data ...":"End of data bufferring.")+ + "\n "); + + /* + this.m_bIsInsideCollectedElement = isInsideCollectedElement; + + if ( !m_bIsInsideCollectedElement && !m_bIsBlocking) + { + m_bSAXEventKeeperIncluded = false; + } + else + { + m_bSAXEventKeeperIncluded = true; + } + changeOutput(); + */ + } + + public void bufferStatusChanged(boolean isBufferEmpty) + { + m_testTool.showMessage("Message from : SAXEventKeeper\n\n"+ + (isBufferEmpty?"All bufferred data are released, the SAXEventKeeper is destroyed.":"buffer data appears.")+ + "\n "); + /* + if (isBufferEmpty) + { + m_xXMLDocumentWrapper = null; + m_xSAXEventKeeper = null; + m_bSAXEventKeeperIncluded = false; + changeOutput(); + } + */ + } +} + diff --git a/xmlsecurity/tools/uno/XMLTreeCellRanderer.java b/xmlsecurity/tools/uno/XMLTreeCellRanderer.java new file mode 100644 index 000000000000..77891a239853 --- /dev/null +++ b/xmlsecurity/tools/uno/XMLTreeCellRanderer.java @@ -0,0 +1,85 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +package com.sun.star.xml.security.uno; + +import javax.swing.tree.DefaultTreeCellRenderer; +import org.w3c.dom.Node; +import javax.swing.ImageIcon; +import java.awt.Component; +import javax.swing.JTree; + +/* + * a TreeCellRender which can show a graph on the current + * tree node. + */ +class XMLTreeCellRanderer extends DefaultTreeCellRenderer +{ + /* + * the icon for the current Node + */ + private ImageIcon m_currentIcon; + + /* + * the current Node + */ + private Node m_currentNode; + + XMLTreeCellRanderer(Node currentNode) + { + m_currentNode = currentNode; + m_currentIcon = new ImageIcon("current.gif"); + } + + public Component getTreeCellRendererComponent( + JTree tree, + Object value, + boolean sel, + boolean expanded, + boolean leaf, + int row, + boolean hasFocus) + { + super.getTreeCellRendererComponent( + tree, value, sel, + expanded, leaf, row, + hasFocus); + + if (((AdapterNode)value).getNode() == m_currentNode) + { + setIcon(m_currentIcon); + setToolTipText("This is the current element."); + } + else + { + setToolTipText(null); /* no tool tip */ + } + + return this; + } +} + diff --git a/xmlsecurity/tools/uno/current.gif b/xmlsecurity/tools/uno/current.gif Binary files differnew file mode 100644 index 000000000000..92b2a025f05e --- /dev/null +++ b/xmlsecurity/tools/uno/current.gif diff --git a/xmlsecurity/tools/uno/makefile.mk b/xmlsecurity/tools/uno/makefile.mk new file mode 100644 index 000000000000..e919e44ea9ee --- /dev/null +++ b/xmlsecurity/tools/uno/makefile.mk @@ -0,0 +1,48 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2000, 2010 Oracle and/or its affiliates. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# This file is part of OpenOffice.org. +# +# OpenOffice.org is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License version 3 +# only, as published by the Free Software Foundation. +# +# OpenOffice.org is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License version 3 for more details +# (a copy is included in the LICENSE file that accompanied this code). +# +# You should have received a copy of the GNU Lesser General Public License +# version 3 along with OpenOffice.org. If not, see +# <http://www.openoffice.org/license.html> +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +PRJNAME = xmlsecurity +TARGET = xmlsecurity-uno +PACKAGE = com$/sun$/star$/xml$/security$/uno +PRJ = ..$/.. + +USE_JAVAVER:=TRUE + +# --- Settings ----------------------------------------------------- + +.INCLUDE : settings.mk +.INCLUDE : $(PRJ)$/util$/target.pmk + +JARFILES = java_uno.jar jurt.jar unoil.jar ridl.jar juh.jar +JAVAFILES := $(shell @ls *.java) +JAVACLASSFILES= $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class) + +# --- Targets ------------------------------------------------------ + + +.INCLUDE : target.mk + diff --git a/xmlsecurity/util/exports_xsmscrypt.dxp b/xmlsecurity/util/exports_xsmscrypt.dxp new file mode 100644 index 000000000000..f0e1c69934bc --- /dev/null +++ b/xmlsecurity/util/exports_xsmscrypt.dxp @@ -0,0 +1,2 @@ +component_getImplementationEnvironment +component_getFactory diff --git a/xmlsecurity/util/exports_xsnss.dxp b/xmlsecurity/util/exports_xsnss.dxp new file mode 100644 index 000000000000..f0e1c69934bc --- /dev/null +++ b/xmlsecurity/util/exports_xsnss.dxp @@ -0,0 +1,2 @@ +component_getImplementationEnvironment +component_getFactory diff --git a/xmlsecurity/util/makefile.mk b/xmlsecurity/util/makefile.mk new file mode 100644 index 000000000000..75ef30c7c5ac --- /dev/null +++ b/xmlsecurity/util/makefile.mk @@ -0,0 +1,201 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2000, 2010 Oracle and/or its affiliates. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# This file is part of OpenOffice.org. +# +# OpenOffice.org is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License version 3 +# only, as published by the Free Software Foundation. +# +# OpenOffice.org is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License version 3 for more details +# (a copy is included in the LICENSE file that accompanied this code). +# +# You should have received a copy of the GNU Lesser General Public License +# version 3 along with OpenOffice.org. If not, see +# <http://www.openoffice.org/license.html> +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +PRJ=.. + +PRJNAME=xmlsecurity +TARGET=xmlsecurity + +# Disable '-z defs' due to broken libxpcom. +#LINKFLAGSDEFS=$(0) +USE_DEFFILE=TRUE + +# --- Settings ----------------------------------------------------- + +.INCLUDE : settings.mk +.INCLUDE : $(PRJ)$/util$/target.pmk + +.IF "$(WITH_MOZILLA)" == "NO" +@all: + @echo "No mozilla -> no nss -> no libxmlsec -> no xmlsecurity..." +.ENDIF + +# --- Files -------------------------------------------------------- + +BMP_IN=$(PRJ)$/res + +# --- Shared-Library ----------------------------------------------- + +# +# The 1st shared library +# +SHL1NAME=xsec_fw +SHL1TARGET= $(SHL1NAME) +SHL1LIBS= $(SLB)$/fw.lib + +SHL1STDLIBS += \ + $(SALLIB) \ + $(CPPULIB) \ + $(CPPUHELPERLIB) + +SHL1IMPLIB = $(SHL1TARGET) +SHL1DEF = $(MISC)$/$(SHL1TARGET).def +DEF1NAME = $(SHL1TARGET) +DEF1EXPORTFILE = xsec_fw.dxp + +# +# The 2nd shared library +# + +SHL2NAME=xsec_xmlsec +SHL2TARGET= $(SHL2NAME) + + +.IF "$(ENABLE_NSS_MODULE)"=="YES" || "$(SYSTEM_MOZILLA)" == "YES" + +SHL2LIBS= \ + $(SLB)$/xs_comm.lib + +.IF "$(CRYPTO_ENGINE)" == "mscrypto" +SHL2LIBS += \ + $(SLB)$/xs_mscrypt.lib +.ELSE +SHL2LIBS += \ + $(SLB)$/xs_nss.lib +.ENDIF + +.ENDIF + + +SHL2STDLIBS += \ + $(SALLIB) \ + $(CPPULIB) \ + $(CPPUHELPERLIB) \ + $(SALLIB) \ + $(SVLLIB) \ + $(TOOLSLIB) \ + $(COMPHELPERLIB) \ + $(CPPUHELPERLIB) \ + $(XMLOFFLIB) + +.IF "$(OS)"=="SOLARIS" +SHL2STDLIBS +=-ldl +.ENDIF + +.IF "$(SYSTEM_MOZILLA)" == "YES" +.IF "$(NSPR_LIB)" != "" +SHL2STDLIBS += $(NSPR_LIB) +.ENDIF +.IF "$(NSS_LIB)" != "" +SHL2STDLIBS += $(NSS_LIB) +.ENDIF +.ENDIF + +.IF "$(CRYPTO_ENGINE)" == "mscrypto" +SHL2STDLIBS+= $(MSCRYPTOLIBS) +.ELSE +SHL2STDLIBS+= $(NSSCRYPTOLIBS) +.ENDIF + +SHL2IMPLIB = $(SHL2TARGET) +SHL2DEF = $(MISC)$/$(SHL2TARGET).def +DEF2NAME = $(SHL2TARGET) +.IF "$(CRYPTO_ENGINE)" == "mscrypto" +DEF2EXPORTFILE = exports_xsmscrypt.dxp +.ELSE +DEF2EXPORTFILE = exports_xsnss.dxp +.ENDIF + +SRSFILELIST= \ + $(SRS)$/component.srs \ + $(SRS)$/dialogs.srs + +RESLIB1NAME=xmlsec +RESLIB1IMAGES=$(PRJ)$/res +RESLIB1SRSFILES= $(SRSFILELIST) + +SHL4TARGET=$(TARGET) +SHL4LIBS=\ + $(SLB)$/helper.lib \ + $(SLB)$/dialogs.lib \ + $(SLB)$/component.lib + +SHL4STDLIBS=\ + $(CPPULIB) \ + $(CPPUHELPERLIB) \ + $(COMPHELPERLIB) \ + $(UCBHELPERLIB) \ + $(UNOTOOLSLIB) \ + $(VCLLIB) \ + $(TOOLSLIB) \ + $(SVTOOLLIB) \ + $(SALLIB) \ + $(SVLLIB) \ + $(XMLOFFLIB) \ + $(SVXCORELIB) + +SHL4VERSIONMAP = $(SOLARENV)/src/component.map +SHL4DEPN= +SHL4IMPLIB=i$(TARGET) +SHL4DEF=$(MISC)$/$(SHL4TARGET).def +DEF4NAME=$(SHL4TARGET) + +# --- Targets ---------------------------------------------------------- + +.INCLUDE : target.mk + +# --- Filter ----------------------------------------------------------- + +$(MISC)$/$(SHL3TARGET).flt: makefile.mk + $(TYPE) $(SHL3TARGET).flt > $@ + +ALLTAR : \ + $(MISC)/xmlsecurity.component \ + $(MISC)/xsec_fw.component \ + $(MISC)/xsec_xmlsec.component + +.IF "$(OS)" == "WNT" +my_platform = .windows +.END + +$(MISC)/xmlsecurity.component .ERRREMOVE : \ + $(SOLARENV)/bin/createcomponent.xslt xmlsecurity.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL4TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt xmlsecurity.component + +$(MISC)/xsec_fw.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + xsec_fw.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt xsec_fw.component + +$(MISC)/xsec_xmlsec.component .ERRREMOVE : \ + $(SOLARENV)/bin/createcomponent.xslt xsec_xmlsec.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL2TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt xsec_xmlsec$(my_platform).component diff --git a/xmlsecurity/util/target.pmk b/xmlsecurity/util/target.pmk new file mode 100644 index 000000000000..e46a4a0d817a --- /dev/null +++ b/xmlsecurity/util/target.pmk @@ -0,0 +1,32 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2000, 2010 Oracle and/or its affiliates. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# This file is part of OpenOffice.org. +# +# OpenOffice.org is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License version 3 +# only, as published by the Free Software Foundation. +# +# OpenOffice.org is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License version 3 for more details +# (a copy is included in the LICENSE file that accompanied this code). +# +# You should have received a copy of the GNU Lesser General Public License +# version 3 along with OpenOffice.org. If not, see +# <http://www.openoffice.org/license.html> +# for a copy of the LGPLv3 License. +# +#************************************************************************* +.IF "$(GUI)" == "WNT" +CRYPTO_ENGINE = mscrypto +#CRYPTO_ENGINE = nss +.ELSE +CRYPTO_ENGINE = nss +.ENDIF diff --git a/xmlsecurity/util/xmlsecurity.component b/xmlsecurity/util/xmlsecurity.component new file mode 100644 index 000000000000..b0759e937dab --- /dev/null +++ b/xmlsecurity/util/xmlsecurity.component @@ -0,0 +1,37 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!--********************************************************************** +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* <http://www.openoffice.org/license.html> +* for a copy of the LGPLv3 License. +* +**********************************************************************--> + +<component loader="com.sun.star.loader.SharedLibrary" + xmlns="http://openoffice.org/2010/uno-components"> + <implementation name="com.sun.star.security.CertificateContainer"> + <service name="com.sun.star.security.CertificateContainer"/> + </implementation> + <implementation name="com.sun.star.security.DocumentDigitalSignatures"> + <service name="com.sun.star.security.DocumentDigitalSignatures"/> + </implementation> +</component> diff --git a/xmlsecurity/util/xsec_fw.component b/xmlsecurity/util/xsec_fw.component new file mode 100644 index 000000000000..eb9e3962a963 --- /dev/null +++ b/xmlsecurity/util/xsec_fw.component @@ -0,0 +1,56 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!--********************************************************************** +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* <http://www.openoffice.org/license.html> +* for a copy of the LGPLv3 License. +* +**********************************************************************--> + +<component loader="com.sun.star.loader.SharedLibrary" + xmlns="http://openoffice.org/2010/uno-components"> + <implementation name="com.sun.star.xml.security.framework.DecryptorImpl"> + <service name="com.sun.star.xml.crypto.sax.Decryptor"/> + </implementation> + <implementation name="com.sun.star.xml.security.framework.EncryptorImpl"> + <service name="com.sun.star.xml.crypto.sax.Encryptor"/> + </implementation> + <implementation name="com.sun.star.xml.security.framework.SAXEventKeeperImpl"> + <service name="com.sun.star.xml.crypto.sax.SAXEventKeeper"/> + </implementation> + <implementation + name="com.sun.star.xml.security.framework.SignatureCreatorImpl"> + <service name="com.sun.star.xml.crypto.sax.SignatureCreator"/> + </implementation> + <implementation + name="com.sun.star.xml.security.framework.SignatureVerifierImpl"> + <service name="com.sun.star.xml.crypto.sax.SignatureVerifier"/> + </implementation> + <implementation + name="com.sun.star.xml.security.framework.XMLEncryptionTemplateImpl"> + <service name="com.sun.star.xml.crypto.XMLEncryptionTemplate"/> + </implementation> + <implementation + name="com.sun.star.xml.security.framework.XMLSignatureTemplateImpl"> + <service name="com.sun.star.xml.crypto.XMLSignatureTemplate"/> + </implementation> +</component> diff --git a/xmlsecurity/util/xsec_fw.dxp b/xmlsecurity/util/xsec_fw.dxp new file mode 100644 index 000000000000..f0e1c69934bc --- /dev/null +++ b/xmlsecurity/util/xsec_fw.dxp @@ -0,0 +1,2 @@ +component_getImplementationEnvironment +component_getFactory diff --git a/xmlsecurity/util/xsec_xmlsec.component b/xmlsecurity/util/xsec_xmlsec.component new file mode 100644 index 000000000000..de991899f026 --- /dev/null +++ b/xmlsecurity/util/xsec_xmlsec.component @@ -0,0 +1,55 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!--********************************************************************** +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* <http://www.openoffice.org/license.html> +* for a copy of the LGPLv3 License. +* +**********************************************************************--> + +<component loader="com.sun.star.loader.SharedLibrary" + xmlns="http://openoffice.org/2010/uno-components"> + <implementation name="com.sun.star.security.SerialNumberAdapter"> + <service name="com.sun.star.security.SerialNumberAdapter"/> + </implementation> + <implementation name="com.sun.star.xml.security.bridge.xmlsec.SEInitializer_NssImpl"> + <service name="com.sun.star.xml.crypto.SEInitializer"/> + </implementation> + <implementation name="com.sun.star.xml.security.bridge.xmlsec.SecurityEnvironment_NssImpl"> + <service name="com.sun.star.xml.crypto.SecurityEnvironment"/> + </implementation> + <implementation name="com.sun.star.xml.security.bridge.xmlsec.XMLDocumentWrapper_XmlSecImpl"> + <service name="com.sun.star.xml.wrapper.XMLDocumentWrapper"/> + </implementation> + <implementation name="com.sun.star.xml.security.bridge.xmlsec.XMLElementWrapper_XmlSecImpl"> + <service name="com.sun.star.xml.wrapper.XMLElementWrapper"/> + </implementation> + <implementation name="com.sun.star.xml.security.bridge.xmlsec.XMLEncryption_NssImpl"> + <service name="com.sun.star.xml.crypto.XMLEncryption"/> + </implementation> + <implementation name="com.sun.star.xml.security.bridge.xmlsec.XMLSecurityContext_NssImpl"> + <service name="com.sun.star.xml.crypto.XMLSecurityContext"/> + </implementation> + <implementation name="com.sun.star.xml.security.bridge.xmlsec.XMLSignature_NssImpl"> + <service name="com.sun.star.xml.crypto.XMLSignature"/> + </implementation> +</component> diff --git a/xmlsecurity/util/xsec_xmlsec.windows.component b/xmlsecurity/util/xsec_xmlsec.windows.component new file mode 100644 index 000000000000..fb11cc6e9d36 --- /dev/null +++ b/xmlsecurity/util/xsec_xmlsec.windows.component @@ -0,0 +1,55 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!--********************************************************************** +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* <http://www.openoffice.org/license.html> +* for a copy of the LGPLv3 License. +* +**********************************************************************--> + +<component loader="com.sun.star.loader.SharedLibrary" + xmlns="http://openoffice.org/2010/uno-components"> + <implementation name="com.sun.star.security.SerialNumberAdapter"> + <service name="com.sun.star.security.SerialNumberAdapter"/> + </implementation> + <implementation name="com.sun.star.xml.security.bridge.xmlsec.SEInitializer_MSCryptImpl"> + <service name="com.sun.star.xml.crypto.SEInitializer"/> + </implementation> + <implementation name="com.sun.star.xml.security.bridge.xmlsec.SecurityEnvironment_MSCryptImpl"> + <service name="com.sun.star.xml.crypto.SecurityEnvironment"/> + </implementation> + <implementation name="com.sun.star.xml.security.bridge.xmlsec.XMLDocumentWrapper_XmlSecImpl"> + <service name="com.sun.star.xml.wrapper.XMLDocumentWrapper"/> + </implementation> + <implementation name="com.sun.star.xml.security.bridge.xmlsec.XMLElementWrapper_XmlSecImpl"> + <service name="com.sun.star.xml.wrapper.XMLElementWrapper"/> + </implementation> + <implementation name="com.sun.star.xml.security.bridge.xmlsec.XMLEncryption_MSCryptImpl"> + <service name="com.sun.star.xml.crypto.XMLEncryption"/> + </implementation> + <implementation name="com.sun.star.xml.security.bridge.xmlsec.XMLSecurityContext_MSCryptImpl"> + <service name="com.sun.star.xml.crypto.XMLSecurityContext"/> + </implementation> + <implementation name="com.sun.star.xml.security.bridge.xmlsec.XMLSignature_MSCryptImpl"> + <service name="com.sun.star.xml.crypto.XMLSignature"/> + </implementation> +</component> diff --git a/xmlsecurity/util/xsecctl.flt b/xmlsecurity/util/xsecctl.flt new file mode 100644 index 000000000000..3e2aa3dba0b7 --- /dev/null +++ b/xmlsecurity/util/xsecctl.flt @@ -0,0 +1,19 @@ +_CT? +??_5 +??_7 +??_8 +??_9 +??_C +??_E +??_F +??_G +??_H +??_I +__CT +_CTA +sXML_ +lcl +_Impl +WEP +LIBMAIN +LibMain diff --git a/xmlsecurity/workben/makefile.mk b/xmlsecurity/workben/makefile.mk new file mode 100644 index 000000000000..2430a36431c8 --- /dev/null +++ b/xmlsecurity/workben/makefile.mk @@ -0,0 +1,71 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2000, 2010 Oracle and/or its affiliates. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# This file is part of OpenOffice.org. +# +# OpenOffice.org is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License version 3 +# only, as published by the Free Software Foundation. +# +# OpenOffice.org is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License version 3 for more details +# (a copy is included in the LICENSE file that accompanied this code). +# +# You should have received a copy of the GNU Lesser General Public License +# version 3 along with OpenOffice.org. If not, see +# <http://www.openoffice.org/license.html> +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +PRJ=.. + +PRJNAME=xmlsecurity +TARGET=signaturetest +LIBTARGET=NO +TARGETTYPE=GUI + +# --- Settings ----------------------------------------------------- + +.INCLUDE : settings.mk +.INCLUDE : $(PRJ)$/util$/target.pmk + + +# --- Files -------------------------------------------------------- + +OBJFILES= $(OBJ)$/signaturetest.obj +EXCEPTIONSFILES=$(OBJ)$/signaturetest.obj + +APP1NOSAL= TRUE +APP1TARGET= $(TARGET) +APP1OBJS= $(OBJFILES) + +APP1STDLIBS= $(CPPULIB) \ + $(CPPUHELPERLIB) \ + $(COMPHELPERLIB) \ + $(UCBHELPERLIB) \ + $(UNOTOOLSLIB) \ + $(VCLLIB) \ + $(TOOLSLIB) \ + $(SVTOOLLIB) \ + $(SALLIB) \ + $(VOSLIB) \ + $(SOTLIB) \ + $(VCLLIB) \ + $(SFXLIB) \ + $(XMLOFFLIB) \ + $(SVXLIB) + + + +# --- Targets ------------------------------------------------------ + +.INCLUDE : target.mk + diff --git a/xmlsecurity/workben/signaturetest.cxx b/xmlsecurity/workben/signaturetest.cxx new file mode 100644 index 000000000000..005122b8cce7 --- /dev/null +++ b/xmlsecurity/workben/signaturetest.cxx @@ -0,0 +1,551 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_xmlsecurity.hxx" + +#include <sal/main.h> +#include <vcl/event.hxx> +#include <vcl/svapp.hxx> +#include <vcl/wrkwin.hxx> +#include <vcl/msgbox.hxx> +#include <vcl/fixed.hxx> +#include <vcl/edit.hxx> +#include <vcl/button.hxx> +#include <vcl/lstbox.hxx> +#include <svtools/filectrl.hxx> +#include <tools/urlobj.hxx> +#include <osl/file.hxx> + +#include <svtools/docpasswdrequest.hxx> + +#include <comphelper/processfactory.hxx> +#include <cppuhelper/servicefactory.hxx> +#include <cppuhelper/bootstrap.hxx> +#include <unotools/streamhelper.hxx> + +#include <ucbhelper/contentbroker.hxx> +#include <ucbhelper/configurationkeys.hxx> + +// Will be in comphelper if CWS MAV09 is integrated +#include <comphelper/storagehelper.hxx> + +#include <com/sun/star/lang/XMultiServiceFactory.hpp> + +#include <xmlsecurity/xmlsignaturehelper.hxx> +#include <xmlsecurity/digitalsignaturesdialog.hxx> +#include <xmlsecurity/certificatechooser.hxx> +#include <xmlsecurity/biginteger.hxx> + +#include <com/sun/star/security/XDocumentDigitalSignatures.hpp> + +using namespace ::com::sun::star; +using namespace ::com::sun::star; + +void Main(); + +#define TEXTFIELDWIDTH 80 +#define TEXTFIELDSTARTX 10 + +#define EDITWIDTH 200 +#define EDITHEIGHT 20 + +#define FIXEDLINEHEIGHT 15 + +#define BUTTONWIDTH 50 +#define BUTTONHEIGHT 22 +#define BUTTONSPACE 20 + +#define LISTBOXHEIGHT 120 + +// #define TEST_IMPLEMENTATION_DIRECTLY + + +// ----------------------------------------------------------------------- + + SAL_IMPLEMENT_MAIN() +{ + uno::Reference< lang::XMultiServiceFactory > xMSF; + try + { + uno::Reference< uno::XComponentContext > xCtx( cppu::defaultBootstrap_InitialComponentContext() ); + if ( !xCtx.is() ) + { + DBG_ERROR( "Error creating initial component context!" ); + return -1; + } + + xMSF = uno::Reference< lang::XMultiServiceFactory >(xCtx->getServiceManager(), uno::UNO_QUERY ); + + if ( !xMSF.is() ) + { + DBG_ERROR( "No service manager!" ); + return -1; + } + + // Init USB + uno::Sequence< uno::Any > aArgs( 2 ); + aArgs[ 0 ] <<= rtl::OUString::createFromAscii( UCB_CONFIGURATION_KEY1_LOCAL ); + aArgs[ 1 ] <<= rtl::OUString::createFromAscii( UCB_CONFIGURATION_KEY2_OFFICE ); + sal_Bool bSuccess = ::ucb::ContentBroker::initialize( xMSF, aArgs ); + if ( !bSuccess ) + { + DBG_ERROR( "Error creating UCB!" ); + return -1; + } + + } + catch ( uno::Exception const & ) + { + DBG_ERROR( "Exception during creation of initial component context!" ); + return -1; + } + comphelper::setProcessServiceFactory( xMSF ); + + InitVCL( xMSF ); + ::Main(); + DeInitVCL(); + + return 0; +} + +// ----------------------------------------------------------------------- + +class MyWin : public WorkWindow +{ +private: + FixedLine maTokenLine; + CheckBox maCryptoCheckBox; + FixedText maFixedTextTokenName; + FileControl maEditTokenName; + FixedLine maTest1Line; + FixedText maFixedTextXMLFileName; + FileControl maEditXMLFileName; + FixedText maFixedTextBINFileName; + FileControl maEditBINFileName; + FixedText maFixedTextSIGFileName; + FileControl maEditSIGFileName; + PushButton maSignButton; + PushButton maVerifyButton; + FixedLine maTest2Line; + FixedText maFixedTextDOCFileName; + FileControl maEditDOCFileName; + PushButton maDigitalSignaturesButton; + PushButton maVerifyDigitalSignaturesButton; + FixedLine maHintLine; + FixedText maHintText; + + DECL_LINK( CryptoCheckBoxHdl, CheckBox* ); + DECL_LINK( SignButtonHdl, Button* ); + DECL_LINK( VerifyButtonHdl, Button* ); + DECL_LINK( DigitalSignaturesWithServiceHdl, Button* ); + DECL_LINK( VerifyDigitalSignaturesHdl, Button* ); + DECL_LINK( DigitalSignaturesWithTokenHdl, Button* ); + DECL_LINK( StartVerifySignatureHdl, void* ); + +public: + MyWin( Window* pParent, WinBits nWinStyle ); + +}; + +// ----------------------------------------------------------------------- + +void Main() +{ + MyWin aMainWin( NULL, WB_APP | WB_STDWORK | WB_3DLOOK); + aMainWin.Show(); + + Application::Execute(); +} + +// ----------------------------------------------------------------------- + +MyWin::MyWin( Window* pParent, WinBits nWinStyle ) : + WorkWindow( pParent, nWinStyle ), + maTokenLine( this ), + maTest1Line( this ), + maTest2Line( this ), + maHintLine( this ), + maFixedTextXMLFileName( this ), + maEditXMLFileName( this, WB_BORDER ), + maFixedTextBINFileName( this ), + maEditBINFileName( this, WB_BORDER ), + maFixedTextSIGFileName( this ), + maEditSIGFileName( this, WB_BORDER ), + maFixedTextTokenName( this ), + maEditTokenName( this, WB_BORDER ), + maFixedTextDOCFileName( this ), + maEditDOCFileName( this, WB_BORDER ), + maSignButton( this ), + maVerifyButton( this ), + maDigitalSignaturesButton( this ), + maVerifyDigitalSignaturesButton( this ), + maHintText( this, WB_WORDBREAK ), + maCryptoCheckBox( this ) + +{ +#ifdef TEST_IMPLEMENTATION_DIRECTLY + Size aOutputSize( 400, 600 ); +#else + Size aOutputSize( 400, 400 ); +#endif + SetOutputSizePixel( aOutputSize ); + SetText( String( RTL_CONSTASCII_USTRINGPARAM( "XML Signature Test" ) ) ); + + long nY = 15; + + maTokenLine.SetPosSizePixel( TEXTFIELDSTARTX, nY, aOutputSize.Width()-2*TEXTFIELDSTARTX, FIXEDLINEHEIGHT ); + maTokenLine.SetText( String( RTL_CONSTASCII_USTRINGPARAM( "Crypto Settings" ) ) ); + maTokenLine.Show(); + + nY += EDITHEIGHT*3/2; + + maCryptoCheckBox.SetPosSizePixel( TEXTFIELDSTARTX, nY, aOutputSize.Width()-2*TEXTFIELDSTARTX, FIXEDLINEHEIGHT ); + maCryptoCheckBox.SetText( String( RTL_CONSTASCII_USTRINGPARAM( "Use Default Token (NSS option only)" ) ) ); + maCryptoCheckBox.Check( sal_True ); + maEditTokenName.Disable(); + maFixedTextTokenName.Disable(); + maCryptoCheckBox.SetClickHdl( LINK( this, MyWin, CryptoCheckBoxHdl ) ); + maCryptoCheckBox.Show(); + + nY += EDITHEIGHT; + + maFixedTextTokenName.SetPosSizePixel( TEXTFIELDSTARTX, nY, TEXTFIELDWIDTH, EDITHEIGHT ); + maFixedTextTokenName.SetText( String( RTL_CONSTASCII_USTRINGPARAM( "Crypto Token:" ) ) ); + maFixedTextTokenName.Show(); + + maEditTokenName.SetPosSizePixel( TEXTFIELDSTARTX+TEXTFIELDWIDTH, nY, EDITWIDTH, EDITHEIGHT ); + maEditTokenName.Show(); + + nY += EDITHEIGHT*3; + +#ifdef TEST_IMPLEMENTATION_DIRECTLY + + maTest1Line.SetPosSizePixel( TEXTFIELDSTARTX, nY, aOutputSize.Width()-2*TEXTFIELDSTARTX, FIXEDLINEHEIGHT ); + maTest1Line.SetText( String( RTL_CONSTASCII_USTRINGPARAM( "Test simple files" ) ) ); + maTest1Line.Show(); + + nY += EDITHEIGHT*3/2; + + maFixedTextXMLFileName.SetPosSizePixel( TEXTFIELDSTARTX, nY, TEXTFIELDWIDTH, EDITHEIGHT ); + maFixedTextXMLFileName.SetText( String( RTL_CONSTASCII_USTRINGPARAM( "XML File:" ) ) ); + maFixedTextXMLFileName.Show(); + + maEditXMLFileName.SetPosSizePixel( TEXTFIELDSTARTX+TEXTFIELDWIDTH, nY, EDITWIDTH, EDITHEIGHT ); + maEditXMLFileName.Show(); + + nY += EDITHEIGHT*3/2; + + maFixedTextBINFileName.SetPosSizePixel( TEXTFIELDSTARTX, nY, TEXTFIELDWIDTH, EDITHEIGHT ); + maFixedTextBINFileName.SetText( String( RTL_CONSTASCII_USTRINGPARAM( "Binary File:" ) ) ); + maFixedTextBINFileName.Show(); + + maEditBINFileName.SetPosSizePixel( TEXTFIELDSTARTX+TEXTFIELDWIDTH, nY, EDITWIDTH, EDITHEIGHT ); + maEditBINFileName.Show(); + + nY += EDITHEIGHT*3/2; + + maFixedTextSIGFileName.SetPosSizePixel( TEXTFIELDSTARTX, nY, TEXTFIELDWIDTH, EDITHEIGHT ); + maFixedTextSIGFileName.SetText( String( RTL_CONSTASCII_USTRINGPARAM( "Signature File:" ) ) ); + maFixedTextSIGFileName.Show(); + + maEditSIGFileName.SetPosSizePixel( TEXTFIELDSTARTX+TEXTFIELDWIDTH, nY, EDITWIDTH, EDITHEIGHT ); + maEditSIGFileName.Show(); + + nY += EDITHEIGHT*2; + + maSignButton.SetPosSizePixel( TEXTFIELDSTARTX, nY, BUTTONWIDTH, BUTTONHEIGHT ); + maSignButton.SetText( String( RTL_CONSTASCII_USTRINGPARAM( "Sign" ) ) ); + maSignButton.SetClickHdl( LINK( this, MyWin, SignButtonHdl ) ); + maSignButton.Show(); + + maVerifyButton.SetPosSizePixel( TEXTFIELDSTARTX+BUTTONWIDTH+BUTTONSPACE, nY, BUTTONWIDTH, BUTTONHEIGHT ); + maVerifyButton.SetText( String( RTL_CONSTASCII_USTRINGPARAM( "Verify" ) ) ); + maVerifyButton.SetClickHdl( LINK( this, MyWin, VerifyButtonHdl ) ); + maVerifyButton.Show(); + + nY += EDITHEIGHT*3; + +#endif // TEST_IMPLEMENTATION_DIRECTLY + + maTest2Line.SetPosSizePixel( TEXTFIELDSTARTX, nY, aOutputSize.Width()-2*TEXTFIELDSTARTX, FIXEDLINEHEIGHT ); + maTest2Line.SetText( String( RTL_CONSTASCII_USTRINGPARAM( "Test Office Document" ) ) ); + maTest2Line.Show(); + + nY += EDITHEIGHT*3/2; + + + maFixedTextDOCFileName.SetPosSizePixel( TEXTFIELDSTARTX, nY, TEXTFIELDWIDTH, EDITHEIGHT ); + maFixedTextDOCFileName.SetText( String( RTL_CONSTASCII_USTRINGPARAM( "Office File:" ) ) ); + maFixedTextDOCFileName.Show(); + + maEditDOCFileName.SetPosSizePixel( TEXTFIELDSTARTX+TEXTFIELDWIDTH, nY, EDITWIDTH, EDITHEIGHT ); + maEditDOCFileName.Show(); + + nY += EDITHEIGHT*2; + + maDigitalSignaturesButton.SetPosSizePixel( TEXTFIELDSTARTX, nY, BUTTONWIDTH*2, BUTTONHEIGHT ); + maDigitalSignaturesButton.SetText( String( RTL_CONSTASCII_USTRINGPARAM( "Digital Signatures..." ) ) ); + maDigitalSignaturesButton.SetClickHdl( LINK( this, MyWin, DigitalSignaturesWithServiceHdl ) ); + maDigitalSignaturesButton.Show(); + + maVerifyDigitalSignaturesButton.SetPosSizePixel( TEXTFIELDSTARTX+BUTTONWIDTH*2+BUTTONSPACE, nY, BUTTONWIDTH*2, BUTTONHEIGHT ); + maVerifyDigitalSignaturesButton.SetText( String( RTL_CONSTASCII_USTRINGPARAM( "Verify Signatures" ) ) ); + maVerifyDigitalSignaturesButton.SetClickHdl( LINK( this, MyWin, VerifyDigitalSignaturesHdl ) ); + maVerifyDigitalSignaturesButton.Show(); + + nY += EDITHEIGHT*2; + + maHintLine.SetPosSizePixel( TEXTFIELDSTARTX, nY, aOutputSize.Width()-2*TEXTFIELDSTARTX, FIXEDLINEHEIGHT ); + maHintLine.Show(); + + nY += EDITHEIGHT*2; + + maHintText.SetPosSizePixel( TEXTFIELDSTARTX, nY, aOutputSize.Width()-2*TEXTFIELDSTARTX, aOutputSize.Height()-nY ); + maHintText.SetText( String( RTL_CONSTASCII_USTRINGPARAM( "Hint: Copy crypto files from xmlsecurity/tools/cryptoken/nss and sample files from xmlsecurity/tools/examples to <temp>/nss.\nThis location will be used from the demo as the default location." ) ) ); + maHintText.Show(); + + // Help the user with some default values + ::rtl::OUString aTempDirURL; + ::osl::File::getTempDirURL( aTempDirURL ); + INetURLObject aURLObj( aTempDirURL ); + aURLObj.insertName( String( RTL_CONSTASCII_USTRINGPARAM( "nss" ) ), true ); + ::rtl::OUString aNSSFolder = aURLObj.getFSysPath( INetURLObject::FSYS_DETECT ); + String aDefaultXMLFileName( aNSSFolder ); + maEditXMLFileName.SetText( aNSSFolder + String( RTL_CONSTASCII_USTRINGPARAM( "demo-sample.xml" ) ) ); + maEditBINFileName.SetText( aNSSFolder + String( RTL_CONSTASCII_USTRINGPARAM( "demo-sample.gif" ) ) ); + maEditDOCFileName.SetText( aNSSFolder + String( RTL_CONSTASCII_USTRINGPARAM( "demo-sample.sxw" ) ) ); + maEditSIGFileName.SetText( aNSSFolder + String( RTL_CONSTASCII_USTRINGPARAM( "demo-result.xml" ) ) ); + maEditTokenName.SetText( aNSSFolder ); + +#ifdef WNT + maEditTokenName.SetText( String() ); + maEditTokenName.Disable(); + maCryptoCheckBox.Disable(); +#endif + +} + +IMPL_LINK( MyWin, CryptoCheckBoxHdl, CheckBox*, EMPTYARG ) +{ + if ( maCryptoCheckBox.IsChecked() ) + { + maEditTokenName.Disable(); + maFixedTextTokenName.Disable(); + } + else + { + maEditTokenName.Enable(); + maFixedTextTokenName.Enable(); + } + return 1; +} + +IMPL_LINK( MyWin, DigitalSignaturesWithServiceHdl, Button*, EMPTYARG ) +{ + rtl::OUString aDocFileName = maEditDOCFileName.GetText(); + uno::Reference < embed::XStorage > xStore = ::comphelper::OStorageHelper::GetStorageFromURL( + aDocFileName, embed::ElementModes::READWRITE, comphelper::getProcessServiceFactory() ); + + uno::Reference< security::XDocumentDigitalSignatures > xD( + comphelper::getProcessServiceFactory()->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.security.DocumentDigitalSignatures" ) ) ), uno::UNO_QUERY ); + if ( xD.is() ) + xD->signDocumentContent( xStore, NULL ); + + + return 0; +} + +IMPL_LINK( MyWin, VerifyDigitalSignaturesHdl, Button*, EMPTYARG ) +{ + rtl::OUString aDocFileName = maEditDOCFileName.GetText(); + uno::Reference < embed::XStorage > xStore = ::comphelper::OStorageHelper::GetStorageFromURL( + aDocFileName, embed::ElementModes::READWRITE, comphelper::getProcessServiceFactory() ); + + uno::Reference< security::XDocumentDigitalSignatures > xD( + comphelper::getProcessServiceFactory()->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.security.DocumentDigitalSignatures" ) ) ), uno::UNO_QUERY ); + if ( xD.is() ) + { + uno::Sequence< security::DocumentSignatureInformation > aInfos = xD->verifyDocumentContentSignatures( xStore, NULL ); + int nInfos = aInfos.getLength(); + for ( int n = 0; n < nInfos; n++ ) + { + security::DocumentSignatureInformation& rInf = aInfos[n]; + String aText( RTL_CONSTASCII_USTRINGPARAM( "The document is signed by\n\n " ) ); + aText += String( rInf.Signer->getSubjectName() ); + aText += String( RTL_CONSTASCII_USTRINGPARAM( "\n\n The signature is " ) ); + if ( !rInf.SignatureIsValid ) + aText += String( RTL_CONSTASCII_USTRINGPARAM( "NOT " ) ); + aText += String( RTL_CONSTASCII_USTRINGPARAM( "valid" ) ); + InfoBox( this, aText ).Execute(); + } + + } + + + return 0; +} + + +#ifdef TEST_IMPLEMENTATION_DIRECTLY + +IMPL_LINK( MyWin, DigitalSignaturesWithTokenHdl, Button*, EMPTYARG ) +{ + String aDocFileName = maEditDOCFileName.GetText(); + String aTokenFileName = maEditTokenName.GetText(); + + DigitalSignaturesDialog aSignaturesDialog( this, comphelper::getProcessServiceFactory(), SignatureModeDocumentContent, false ); + + bool bInit = aSignaturesDialog.Init( aTokenFileName ); + if ( !bInit ) + { + ErrorBox( this, WB_OK, String( RTL_CONSTASCII_USTRINGPARAM( "Error initializing security context!" ) ) ).Execute(); + return 0; + } + + uno::Reference < embed::XStorage > xStore = ::comphelper::OStorageHelper::GetStorageFromURL( + aDocFileName, embed::ElementModes::READWRITE, comphelper::getProcessServiceFactory() ); + + aSignaturesDialog.SetStorage( xStore ); + + aSignaturesDialog.Execute(); + + return 0; +} + +IMPL_LINK( MyWin, SignButtonHdl, Button*, EMPTYARG ) +{ + String aXMLFileName = maEditXMLFileName.GetText(); + String aBINFileName = maEditBINFileName.GetText(); + String aSIGFileName = maEditSIGFileName.GetText(); + + String aTokenFileName; + if ( !maCryptoCheckBox.IsChecked() ) + aTokenFileName = maEditTokenName.GetText(); + + XMLSignatureHelper aSignatureHelper( comphelper::getProcessServiceFactory() ); + bool bInit = aSignatureHelper.Init( aTokenFileName ); + + if ( !bInit ) + { + ErrorBox( this, WB_OK, String( RTL_CONSTASCII_USTRINGPARAM( "Error initializing security context!" ) ) ).Execute(); + return 0; + } + + uno::Reference< ::com::sun::star::security::XCertificate > xCertToUse; + CertificateChooser aChooser( this, aSignatureHelper.GetSecurityEnvironment(), SignatureInformations() ); + if ( aChooser.Execute() ) + xCertToUse = aChooser.GetSelectedCertificate(); + + if ( !xCertToUse.is() ) + return 0; + + + aSignatureHelper.StartMission(); + + sal_Int32 nSecurityId = aSignatureHelper.GetNewSecurityId(); + + aSignatureHelper.SetX509Certificate( nSecurityId, xCertToUse->getIssuerName(), bigIntegerToNumericString( xCertToUse->getSerialNumber() ) ); + + aSignatureHelper.AddForSigning( nSecurityId, aXMLFileName, aXMLFileName, sal_False ); + aSignatureHelper.AddForSigning( nSecurityId, aBINFileName, aBINFileName, sal_True ); + + SvFileStream* pStream = new SvFileStream( aSIGFileName, STREAM_WRITE ); + SvLockBytesRef xLockBytes = new SvLockBytes( pStream, sal_True ); + uno::Reference< io::XOutputStream > xOutputStream = new utl::OOutputStreamHelper( xLockBytes ); + bool bDone = aSignatureHelper.CreateAndWriteSignature( xOutputStream ); + + aSignatureHelper.EndMission(); + + if ( !bDone ) + { + ErrorBox( this, WB_OK, String( RTL_CONSTASCII_USTRINGPARAM( "Error creating Signature!" ) ) ).Execute(); + } + else + { + rtl::OUString aInfo( String( RTL_CONSTASCII_USTRINGPARAM( "Signature successfully created!\n\n" ) ) ); + // aInfo += getSignatureInformationmations( aSignatureHelper.getAllSignatureInformation(), aSignatureHelper.GetSecurityEnvironment() ); + + + InfoBox( this, aInfo ).Execute(); + } + + // Check for more detailed results... + + return 0; +} + +IMPL_LINK( MyWin, VerifyButtonHdl, Button*, EMPTYARG ) +{ + String aXMLFileName = maEditXMLFileName.GetText(); + String aBINFileName = maEditBINFileName.GetText(); + String aSIGFileName = maEditSIGFileName.GetText(); + + String aTokenFileName; + if ( !maCryptoCheckBox.IsChecked() ) + aTokenFileName = maEditTokenName.GetText(); + + XMLSignatureHelper aSignatureHelper( comphelper::getProcessServiceFactory() ); + bool bInit = aSignatureHelper.Init( aTokenFileName ); + + if ( !bInit ) + { + ErrorBox( this, WB_OK, String( RTL_CONSTASCII_USTRINGPARAM( "Error initializing security context!" ) ) ).Execute(); + return 0; + } + + aSignatureHelper.SetStartVerifySignatureHdl( LINK( this, MyWin, StartVerifySignatureHdl ) ); + + aSignatureHelper.StartMission(); + + SvFileStream* pStream = new SvFileStream( aSIGFileName, STREAM_READ ); + pStream->Seek( STREAM_SEEK_TO_END ); + sal_uLong nBytes = pStream->Tell(); + pStream->Seek( STREAM_SEEK_TO_BEGIN ); + SvLockBytesRef xLockBytes = new SvLockBytes( pStream, sal_True ); + uno::Reference< io::XInputStream > xInputStream = new utl::OInputStreamHelper( xLockBytes, nBytes ); + bool bDone = aSignatureHelper.ReadAndVerifySignature( xInputStream ); + xInputStream->closeInput(); + + aSignatureHelper.EndMission(); + + if ( !bDone ) + ErrorBox( this, WB_OK, String( RTL_CONSTASCII_USTRINGPARAM( "Error in Signature!" ) ) ).Execute(); + else + InfoBox( this, String( RTL_CONSTASCII_USTRINGPARAM( "Signatures verified without any problems!" ) ) ).Execute(); + + return 0; +} + +IMPL_LINK( MyWin, StartVerifySignatureHdl, void*, EMPTYARG ) +{ + QueryBox aQueryBox( this, WB_YES_NO|WB_DEF_YES, String( RTL_CONSTASCII_USTRINGPARAM( "Found Signature - Verify?" ) ) ); + return ( aQueryBox.Execute() == RET_YES ) ? 1 : 0; +} + + +#endif // #ifdef TEST_IMPLEMENTATION_DIRECTLY |