1 // Copyright (c) 2013 Intel Corporation. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef XWALK_APPLICATION_COMMON_INSTALLER_XPK_PACKAGE_H_
6 #define XWALK_APPLICATION_COMMON_INSTALLER_XPK_PACKAGE_H_
11 #include "base/files/file_path.h"
12 #include "base/memory/scoped_handle.h"
13 #include "base/memory/scoped_ptr.h"
14 #include "xwalk/application/common/installer/package.h"
17 namespace application {
19 class XPKPackage : public Package {
21 static const char kXPKPackageHeaderMagic[];
22 static const size_t kXPKPackageHeaderMagicSize = 4;
23 static const uint32 kMaxPublicKeySize = 1 << 16;
24 static const uint32 kMaxSignatureKeySize = 1 << 16;
27 char magic[kXPKPackageHeaderMagicSize];
29 uint32 signature_size;
31 virtual ~XPKPackage();
32 explicit XPKPackage(const base::FilePath& path);
33 virtual bool Extract(base::FilePath* target_path) OVERRIDE;
36 // verify the signature in the xpk package
37 virtual bool VerifySignature();
40 std::vector<uint8> signature_;
41 std::vector<uint8> key_;
42 // It's the beginning address of the zip file
46 } // namespace application
49 #endif // XWALK_APPLICATION_COMMON_INSTALLER_XPK_PACKAGE_H_