X-Git-Url: http://www.project-moonshot.org/gitweb/?a=blobdiff_plain;f=xmltooling%2Fsecurity%2FSecurityHelper.h;h=b62bdf5308b9bcaf385ba69640f057ea850722e3;hb=d46a67991e1da8f4e353fde27590246edaee7bb8;hp=f2a8839da8846964b8c7c9628fd54dfe99cb317e;hpb=06e315e4a095bb5b32ccff37b4e6283e6b714e0c;p=shibboleth%2Fxmltooling.git diff --git a/xmltooling/security/SecurityHelper.h b/xmltooling/security/SecurityHelper.h index f2a8839..b62bdf5 100644 --- a/xmltooling/security/SecurityHelper.h +++ b/xmltooling/security/SecurityHelper.h @@ -1,5 +1,5 @@ /* - * Copyright 2001-2008 Internet2 + * Copyright 2001-2009 Internet2 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -124,6 +124,22 @@ namespace xmltooling { * @return true iff the keys match */ static bool matches(const XSECCryptoKey* key1, const XSECCryptoKey* key2); + + /** + * Returns the base64-encoded DER encoding of a public key in SubjectPublicKeyInfo format. + * + * @param key the key to encode + * @return the base64 encoded key value + */ + static std::string getDEREncoding(const XSECCryptoKey* key); + + /** + * Returns the base64-encoded DER encoding of a certifiate's public key in SubjectPublicKeyInfo format. + * + * @param cert the certificate's key to encode + * @return the base64 encoded key value + */ + static std::string getDEREncoding(const XSECCryptoX509* cert); }; };