X-Git-Url: http://www.project-moonshot.org/gitweb/?p=shibboleth%2Fcpp-xmltooling.git;a=blobdiff_plain;f=xmltooling%2Fsecurity%2FSecurityHelper.h;h=e6cbee3305e82144ecb74839fcc3c00b22d758c6;hp=7ad65d9c1308f34a292e8af89eb7cc0c08705b7f;hb=c4b9345c1dac797b6492ed5c1eb695236852fe24;hpb=41d10205744e6cc07f435efd29838384c54a6b03 diff --git a/xmltooling/security/SecurityHelper.h b/xmltooling/security/SecurityHelper.h index 7ad65d9..e6cbee3 100644 --- a/xmltooling/security/SecurityHelper.h +++ b/xmltooling/security/SecurityHelper.h @@ -138,9 +138,10 @@ namespace xmltooling { * @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 + * @param hashAlg name of hash algorithm, syntax specific to crypto provider * @return the base64 encoded key value */ - static std::string getDEREncoding(const Credential& cred, bool hash=false, bool nowrap=true); + static std::string getDEREncoding(const Credential& cred, bool hash=false, bool nowrap=true, const char* hashAlg="SHA1"); /** * Returns the base64-encoded DER encoding of a public key in SubjectPublicKeyInfo format. @@ -148,9 +149,10 @@ namespace xmltooling { * @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 + * @param hashAlg name of hash algorithm, syntax specific to crypto provider * @return the base64 encoded key value */ - static std::string getDEREncoding(const XSECCryptoKey& key, bool hash=false, bool nowrap=true); + static std::string getDEREncoding(const XSECCryptoKey& key, bool hash=false, bool nowrap=true, const char* hashAlg="SHA1"); /** * Returns the base64-encoded DER encoding of a certifiate's public key in SubjectPublicKeyInfo format. @@ -158,9 +160,10 @@ namespace xmltooling { * @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 + * @param hashAlg name of hash algorithm, syntax specific to crypto provider * @return the base64 encoded key value */ - static std::string getDEREncoding(const XSECCryptoX509& cert, bool hash=false, bool nowrap=true); + static std::string getDEREncoding(const XSECCryptoX509& cert, bool hash=false, bool nowrap=true, const char* hashAlg="SHA1"); }; };