From a17f946fe4acf8bef67945d76931c14607e8e404 Mon Sep 17 00:00:00 2001 From: "rafaelw@chromium.org" Date: Tue, 9 Jun 2009 02:56:41 +0000 Subject: chrome.exe --package-extension generates .crx from extension directory R=aa BUG=12114 Review URL: http://codereview.chromium.org/118328 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17927 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/common/extensions/extension.h | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'chrome/common/extensions/extension.h') diff --git a/chrome/common/extensions/extension.h b/chrome/common/extensions/extension.h index 245d7b6..9a5bfbf 100644 --- a/chrome/common/extensions/extension.h +++ b/chrome/common/extensions/extension.h @@ -48,6 +48,7 @@ class Extension { static const char kManifestFilename[]; // Keys used in JSON representation of extensions. + static const wchar_t* kBackgroundKey; static const wchar_t* kContentScriptsKey; static const wchar_t* kCssKey; static const wchar_t* kDescriptionKey; @@ -61,8 +62,8 @@ class Extension { static const wchar_t* kPluginsKey; static const wchar_t* kPluginsPathKey; static const wchar_t* kPluginsPublicKey; - - static const wchar_t* kBackgroundKey; + static const wchar_t* kPublicKeyKey; + static const wchar_t* kSignatureKey; static const wchar_t* kRunAtKey; static const wchar_t* kThemeKey; static const wchar_t* kThemeImagesKey; @@ -73,7 +74,6 @@ class Extension { static const wchar_t* kTooltipKey; static const wchar_t* kTypeKey; static const wchar_t* kVersionKey; - static const wchar_t* kZipHashKey; // Some values expected in manifests. static const char* kRunAtDocumentStartValue; @@ -164,6 +164,20 @@ class Extension { return GetResourcePath(path(), relative_path); } + // |input| is expected to be the text of an rsa public or private key. It + // tolerates the presence or absence of bracking header/footer like this: + // -----(BEGIN|END) [RSA PUBLIC/PRIVATE] KEY----- + // and may contain newlines. + static bool ParsePEMKeyBytes(const std::string& input, std::string* output); + + // Does a simple base64 encoding of |input| into |output|. + static bool ProducePEM(const std::string& input, std::string* output); + + // Expects base64 encoded |input| and formats into |output| including + // the appropriate header & footer. + static bool FormatPEMForFileOutput(const std::string input, + std::string* output, bool is_public); + // Initialize the extension from a parsed manifest. // If |require_id| is true, will return an error if the "id" key is missing // from the value. -- cgit v1.1