X-Git-Url: http://www.project-moonshot.org/gitweb/?p=shibboleth%2Fcpp-xmltooling.git;a=blobdiff_plain;f=xmltooling%2Fsecurity%2FSecurityHelper.h;h=0f0207dd7a4f2c6d48c9c75706b7093207a42b72;hp=e09e139401f011edcf9b8df9543f98f4da15bee5;hb=2b4a6cd70522f955d101f73a08fe3d685b7877c5;hpb=ef331b0a0a5090d9e2ce53fb40835acea0764a7c diff --git a/xmltooling/security/SecurityHelper.h b/xmltooling/security/SecurityHelper.h index e09e139..0f0207d 100644 --- a/xmltooling/security/SecurityHelper.h +++ b/xmltooling/security/SecurityHelper.h @@ -130,29 +130,32 @@ namespace xmltooling { /** * Returns the base64-encoded DER encoding of a public key in SubjectPublicKeyInfo format. * - * @param key the credential containing the key to encode + * @param cred the credential containing the key to encode + * @param hash if true, the DER encoded data is hashed with SHA-1 before base64 encoding * @param nowrap if true, any linefeeds will be stripped from the result * @return the base64 encoded key value */ - static std::string getDEREncoding(const Credential& cred, bool nowrap=true); + static std::string getDEREncoding(const Credential& cred, bool hash=false, bool nowrap=true); /** * Returns the base64-encoded DER encoding of a public key in SubjectPublicKeyInfo format. * - * @param key the key to encode + * @param key the key to encode + * @param hash if true, the DER encoded data is hashed with SHA-1 before base64 encoding * @param nowrap if true, any linefeeds will be stripped from the result * @return the base64 encoded key value */ - static std::string getDEREncoding(const XSECCryptoKey& key, bool nowrap=true); + static std::string getDEREncoding(const XSECCryptoKey& key, bool hash=false, bool nowrap=true); /** * Returns the base64-encoded DER encoding of a certifiate's public key in SubjectPublicKeyInfo format. * - * @param cert the certificate's key to encode + * @param cert the certificate's key to encode + * @param hash if true, the DER encoded data is hashed with SHA-1 before base64 encoding * @param nowrap if true, any linefeeds will be stripped from the result * @return the base64 encoded key value */ - static std::string getDEREncoding(const XSECCryptoX509& cert, bool nowrap=true); + static std::string getDEREncoding(const XSECCryptoX509& cert, bool hash=false, bool nowrap=true); }; };