加载中…
个人资料
spotofleopard
spotofleopard
  • 博客等级:
  • 博客积分:0
  • 博客访问:267,047
  • 关注人气:28
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
相关博文
推荐博文
正文 字体大小:

how to generate, sign and verify ubuntu package

(2013-01-29 04:34:13)
分类: 技术
1. generate your GPG key
gpg --gen-key
fill your information as required

2. prepare your application files. you can create a directory called my_app1.01 somewhere, if you plan to put your files under /usr/local/my_app on target machine, you copy all your /usr/local/my_app/* to this directory, while maintaining the directory structure. Then create file my_app1.01/DEBIAN/control

Package: my-app
Version: 1.01
Architecture: all
Section: misc
Priority: optional
Depends: coreutils
Maintainer: FirstName LastName
Description: my ubuntu application


3. generate .deb package
dpkg-deb --build my_app1.01

4.sign your package
debsigs --sign=origin my_app1.01.deb

5.determine your keyid:
gpg --fingerprint

Key fingerprint = .... 1234 5678 9abc def0 <== your key id

export your public key:
gpg --export -a > pubkey.asc

6. install this key ring on target machine:
mkdir /usr/share/debsig/keyrings/your_key_id
gpg --no-default-keyring --keyring /usr/share/debsig/keyrings/your_key_id/your_name.gpg --import pubkey.asc

7. install policy for this key on target machine.
create file /etc/debsig/policies/your_key_id/your_name.pol

<?xml version="1.0"?>
<!DOCTYPE Policy SYSTEM "http://www.debian.org/debsig/1.0/policy.dtd">
<Policy xmlns="http://www.debian.org/debsig/1.0/">

<Origin Name="YourName" id="123456789abcdef0"
Description="my ubuntu software package"/>

<Selection>
<Required Type="origin" File="
your_name.gpg" id="123456789abcdef0"/>
</Selection>

<Verification MinOptional="0">
<Required Type="origin" File="
your_name.gpg" id="123456789abcdef0"/>
</Verification>

</Policy>

8. you are ready to verify your package

debsig-verify my_app1.01.deb

debsig: Verified package from `Your Name' (your url)

0

阅读 收藏 转载 喜欢 打印举报/Report
  

新浪BLOG意见反馈留言板 电话:4000520066 提示音后按1键(按当地市话标准计费) 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 会员注册 | 产品答疑

新浪公司 版权所有