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
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 @@
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 @@
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 @@
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 @@
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.