diff options
Diffstat (limited to 'xmlsecurity/source/helper/xsecparser.hxx')
-rw-r--r-- | xmlsecurity/source/helper/xsecparser.hxx | 99 |
1 files changed, 51 insertions, 48 deletions
diff --git a/xmlsecurity/source/helper/xsecparser.hxx b/xmlsecurity/source/helper/xsecparser.hxx index 42b63975ecb9..135f41d1971f 100644 --- a/xmlsecurity/source/helper/xsecparser.hxx +++ b/xmlsecurity/source/helper/xsecparser.hxx @@ -29,6 +29,10 @@ #include <cppuhelper/implbase.hxx> +#include <xmloff/nmspmap.hxx> + +#include <stack> + class XSecParser: public cppu::WeakImplHelper < css::xml::sax::XDocumentHandler, @@ -49,47 +53,59 @@ class XSecParser: public cppu::WeakImplHelper ******************************************************************************/ { friend class XSecController; +public: + class Context; private: + class UnknownContext; + class LoPGPOwnerContext; + class DsPGPKeyPacketContext; + class DsPGPKeyIDContext; + class DsPGPDataContext; + class DsX509CertificateContext; + class DsX509SerialNumberContext; + class DsX509IssuerNameContext; + class DsX509IssuerSerialContext; + class DsX509DataContext; + class DsKeyInfoContext; + class DsSignatureValueContext; + class DsDigestValueContext; + class DsDigestMethodContext; + class DsTransformContext; + class DsTransformsContext; + class DsReferenceContext; + class DsSignatureMethodContext; + class DsSignedInfoContext; + class XadesEncapsulatedX509CertificateContext; + class XadesCertificateValuesContext; + class XadesUnsignedSignaturePropertiesContext; + class XadesUnsignedPropertiesContext; + class LoSignatureLineIdContext; + class LoSignatureLineValidImageContext; + class LoSignatureLineInvalidImageContext; + class LoSignatureLineContext; + class XadesCertDigestContext; + class XadesCertContext; + class XadesSigningCertificateContext; + class XadesSigningTimeContext; + class XadesSignedSignaturePropertiesContext; + class XadesSignedPropertiesContext; + class XadesQualifyingPropertiesContext; + class DcDateContext; + class DcDescriptionContext; + class DsSignaturePropertyContext; + class DsSignaturePropertiesContext; + class DsObjectContext; + class DsSignatureContext; + class DsigSignaturesContext; + /* * the following members are used to reserve the signature information, * including X509IssuerName, X509SerialNumber, and X509Certificate,etc. */ - OUString m_ouX509IssuerName; - OUString m_ouX509SerialNumber; - OUString m_ouX509Certificate; - OUString m_ouGpgCertificate; - OUString m_ouGpgKeyID; - OUString m_ouGpgOwner; - OUString m_ouCertDigest; - OUString m_ouEncapsulatedX509Certificate; - OUString m_ouDigestValue; - OUString m_ouSignatureValue; OUString m_ouDate; - /// Characters of a <dc:description> element, as just read from XML. - OUString m_ouDescription; - OUString m_ouSignatureLineId; - OUString m_ouSignatureLineValidImage; - OUString m_ouSignatureLineInvalidImage; - /* - * whether inside a particular element - */ - bool m_bInX509IssuerName; - bool m_bInX509SerialNumber; - bool m_bInX509Certificate; - bool m_bInGpgCertificate; - bool m_bInGpgKeyID; - bool m_bInGpgOwner; - bool m_bInCertDigest; - bool m_bInEncapsulatedX509Certificate; - bool m_bInSigningTime; - bool m_bInDigestValue; - bool m_bInSignatureValue; - bool m_bInDate; - bool m_bInDescription; - bool m_bInSignatureLineId; - bool m_bInSignatureLineValidImage; - bool m_bInSignatureLineInvalidImage; + std::stack<std::unique_ptr<Context>> m_ContextStack; + std::unique_ptr<SvXMLNamespaceMap> m_pNamespaceMap; /* * the XSecController collaborating with XSecParser @@ -102,22 +118,9 @@ private: css::uno::Reference< css::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. - */ - OUString m_currentReferenceURI; - bool m_bReferenceUnresolved; - - // Relevant for ODF. The digest algorithm selected by the current DigestMethod element's - // Algorithm attribute in the current Reference element. From css::xml::crypto::DigestID. - sal_Int32 m_nReferenceDigestID; XMLSignatureHelper& m_rXMLSignatureHelper; -private: + OUString HandleIdAttr(css::uno::Reference<css::xml::sax::XAttributeList> const& xAttrs); static OUString getIdAttr(const css::uno::Reference< css::xml::sax::XAttributeList >& xAttribs ); |