X-Git-Url: http://www.project-moonshot.org/gitweb/?a=blobdiff_plain;f=xmltooling%2Fsignature%2FSignature.h;h=cfadb9c17f7cae4a026bdceeafc744984ed96c5b;hb=83de10b45721b7882182aaa8a6df0c729db8fc01;hp=419629549f0bf329d3980a4595766396424c1cd3;hpb=006818f66e357ec4c0c6e21d671b8624ad8136b1;p=shibboleth%2Fcpp-xmltooling.git diff --git a/xmltooling/signature/Signature.h b/xmltooling/signature/Signature.h index 4196295..cfadb9c 100644 --- a/xmltooling/signature/Signature.h +++ b/xmltooling/signature/Signature.h @@ -1,5 +1,5 @@ /* - * Copyright 2001-2007 Internet2 + * Copyright 2001-2010 Internet2 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,11 +24,10 @@ #define __xmltooling_sig_h__ #include -#include -#include -#include +#include -#include +class DSIGSignature; +class XSECCryptoKey; /** * @namespace xmlsignature @@ -36,6 +35,7 @@ */ namespace xmlsignature { + class XMLTOOL_API ContentReference; class XMLTOOL_API KeyInfo; /** @@ -46,7 +46,7 @@ namespace xmlsignature { class XMLTOOL_API Signature : public virtual xmltooling::XMLObject { public: - virtual ~Signature() {} + virtual ~Signature(); /** Element local name */ static const XMLCh LOCAL_NAME[]; @@ -61,7 +61,7 @@ namespace xmlsignature { /** * Gets the signing algorithm for the signature. * - * @return the signature algorithm + * @return the signature algorithm, or NULL if indeterminate */ virtual const XMLCh* getSignatureAlgorithm() const=0; @@ -194,13 +194,14 @@ namespace xmlsignature { ); protected: - Signature() {} + /** Default constructor. */ + Signature(); }; /** * Builder for Signature objects. */ - class XMLTOOL_API SignatureBuilder : public xmltooling::XMLObjectBuilder + class XMLTOOL_API SignatureBuilder : public xmltooling::ConcreteXMLObjectBuilder { public: #ifdef HAVE_COVARIANT_RETURNS @@ -222,21 +223,7 @@ namespace xmlsignature { virtual xmltooling::XMLObject* buildObject() const; #endif /** Singleton builder. */ - static Signature* buildSignature() { - const SignatureBuilder* b = dynamic_cast( - xmltooling::XMLObjectBuilder::getBuilder( - xmltooling::QName(xmlconstants::XMLSIG_NS,Signature::LOCAL_NAME) - ) - ); - if (b) { -#ifdef HAVE_COVARIANT_RETURNS - return b->buildObject(); -#else - return dynamic_cast(b->buildObject()); -#endif - } - throw xmltooling::XMLObjectException("Unable to obtain typed builder for Signature."); - } + static Signature* buildSignature(); }; DECL_XMLTOOLING_EXCEPTION(SignatureException,XMLTOOL_EXCEPTIONAPI(XMLTOOL_API),xmlsignature,xmltooling::XMLSecurityException,Exceptions in signature processing);