X-Git-Url: http://www.project-moonshot.org/gitweb/?a=blobdiff_plain;f=xmltooling%2Fsignature%2FSignature.h;h=aa8db505b767b4e1e6fe90c7d3fa43d38b427811;hb=d96a01ce4d9648bb3186f74d43610b6f12d49758;hp=23121b837e51c83c147aba78bbf5542a23a6e9a7;hpb=28e2077c02f1bb4196730a88aa81aa72de9798e1;p=shibboleth%2Fcpp-xmltooling.git diff --git a/xmltooling/signature/Signature.h b/xmltooling/signature/Signature.h index 23121b8..aa8db50 100644 --- a/xmltooling/signature/Signature.h +++ b/xmltooling/signature/Signature.h @@ -1,5 +1,5 @@ /* - * Copyright 2001-2006 Internet2 + * Copyright 2001-2007 Internet2 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -52,7 +52,21 @@ namespace xmlsignature { static const XMLCh LOCAL_NAME[]; /** - * Sets the canonicalization method for the ds:SignedInfo element + * Gets the canonicalization method for the ds:SignedInfo element. + * + * @return the canonicalization method + */ + virtual const XMLCh* getCanonicalizationMethod() const=0; + + /** + * Gets the signing algorithm for the signature. + * + * @return the signature algorithm + */ + virtual const XMLCh* getSignatureAlgorithm() const=0; + + /** + * Sets the canonicalization method for the ds:SignedInfo element. * * @param c14n the canonicalization method */ @@ -122,8 +136,10 @@ namespace xmlsignature { /** * Compute and append the signature based on the assigned * ContentReference, KeyInfo, and signing key. + * + * @param credential optional source of signing key and KeyInfo */ - virtual void sign()=0; + virtual void sign(const xmltooling::Credential* credential=NULL)=0; /** * Type-safe clone operation. @@ -177,6 +193,14 @@ namespace xmlsignature { unsigned int in_len ); + /** + * Populates a set of key names using the information found in a native KeyInfo object. + * + * @param keyInfo a native KeyInfo object + * @param names a set of names to populate + */ + static void extractNames(DSIGKeyInfoList* keyInfo, std::set& names); + protected: Signature() {} }; @@ -187,7 +211,11 @@ namespace xmlsignature { class XMLTOOL_API SignatureBuilder : public xmltooling::XMLObjectBuilder { public: +#ifdef HAVE_COVARIANT_RETURNS virtual Signature* buildObject( +#else + virtual xmltooling::XMLObject* buildObject( +#endif const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix=NULL, const xmltooling::QName* schemaType=NULL ) const;