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_PACKAGE_XPK_PACKAGE_H_
6 #define XWALK_APPLICATION_COMMON_PACKAGE_XPK_PACKAGE_H_
10 #include "base/files/file_path.h"
11 #include "xwalk/application/common/package/package.h"
14 namespace application {
16 class XPKPackage : public Package {
18 static const char kXPKPackageHeaderMagic[];
19 static const size_t kXPKPackageHeaderMagicSize = 4;
20 static const uint32 kMaxPublicKeySize = 1 << 16;
21 static const uint32 kMaxSignatureKeySize = 1 << 16;
24 char magic[kXPKPackageHeaderMagicSize];
26 uint32 signature_size;
28 virtual ~XPKPackage();
29 explicit XPKPackage(const base::FilePath& path);
30 virtual bool ExtractToTemporaryDir(base::FilePath* target_path) OVERRIDE;
33 // verify the signature in the xpk package
34 virtual bool VerifySignature();
37 std::vector<uint8> signature_;
38 std::vector<uint8> key_;
39 // It's the beginning address of the zip file
43 } // namespace application
46 #endif // XWALK_APPLICATION_COMMON_PACKAGE_XPK_PACKAGE_H_