Seiden Group
Modern Development & Open Source for IBM i
  • Link to LinkedIn
  • Link to Mail
  • Home
  • Seiden PHP+
    • Seiden PHP+
    • Install & Learn
    • SmartSupport
    • PHP Migrations & Upgrades
    • Success Stories
    • Free PHP Assessment
    • Documentation
    • What’s New (Changelog)
  • IBM i Services
    • Development
    • Training & Mentoring
    • Open Source Setup & Upgrades
    • SSL/TLS Install & Learn
    • Performance
  • Support
    • Open Source & PHP
    • VS Code for i
    • Developer Support
    • Support Success Stories
  • VS Code for i
    • Support
    • Training
    • Code for i Resource Guide
    • Getting Started Videos
    • Code for IBM i Fridays
  • Free Stuff
    • IBM i Strategy & Tips
    • PHP Upgrade Assessment
    • CNX Valence Assessment
    • VS Code for IBM i Resources
    • Code for IBM i Fridays
    • QCachegrind Download
    • PHP Toolkit for IBM i Resources
    • Qshell on i Library
  • Blog
  • About
    • About Our Team
    • About Alan Seiden
    • Speakers & Sessions
    • In the News
  • Contact
  • 201.447.2437
  • Search
  • Menu Menu

Seiden Group Blog

RPM Package Signing

July 23, 2020/0 Comments/in Open Source, PHP /by Calvin Buckley

RPM package signingIn our current work with RPMs, we’re adding digital signatures to our PHP packages to enhance their security.

Package Signing ensures the integrity of a package at rest by detecting and deterring tampering. A package is signed with a private key, which is then validated by the public key provided by the package builder and installed by the user. This technique complements TLS encryption, which guards against tampering and snooping in transport.

The remainder of this article explains how to use RPM package signing when installing—or building—RPMs for IBM i.

User’s Perspective

When installing a repository on IBM i and setting it up in Yum, you also want to install the public keys provided by the maintainer of the repository. Without these keys, your system can’t determine the integrity of each package—the packages might be signed, but by whom? Because of the importance of the public keys, always check to make sure the one you have is legitimate.

To install a public key into RPM, use the rpm --import command on a file or URL. You can use the rpm -q gpg-pubkey --qf '%{name}-%{version}-%{release} --> %{summary}\n' command to see what public keys are installed.

Verification is done automatically when using Yum, provided the repository has the signing option in the repository file. (You can check this yourself by looking at the repository files in /QOpenSys/etc/yum/repos.d.) If you’re installing RPMs manually, you can use the rpm --checksig command on an RPM to do an integrity check, including both signatures and checksums. PGP should be mentioned as passing.

RPM Package Not Signed?

Some repositories do not yet support package signing. If not explicitly stated, you can still tell because they don’t mention what keys they have. If you still want to use a repository that doesn’t support signing, ask the maintainer of the repository to add it because of the security implications.

Packager’s Perspective

You need to generate a GPG key and set up the RPM environment to use one. You can sign packages from any system, even if you built them elsewhere. This might be useful if you want to keep your keys on a system you trust locally.

To make a GPG key, you can run the gpg --gen-key command and follow its instructions. The gpg --list-keys command can be used to verify that they’ve been generated.

To make a public key file, you can run the gpg --export -a 'My Name' > public_key_filer command (substituting your name in and anything needed to disambiguate it in case, as well as the file name for the key). You can proceed to import the key into RPM; your users will have to do this as well.

The name associated with your key should be put into your RPM macros file (~/.rpmmacros); for example, %_gpg_name My Name (again, substitute your name and any other required details here). When this is done, you can use the rpm --sign command on an RPM. Again, the rpm --checksig command can be used to make sure it now has GPG verification.

Multiple keys

If you have multiple keys (for example, maintaining separate repositories), you can remove the _gpg_name from your RPM macros file (optionally, to avoid accidentally signing with the wrong key) and then explicitly state which key you want to sign with when running the sign command; for example, rpm -D "_gpg_name My Name (Comment)" --addsign package.rpm. Here, you might have multiple keys with the same name and use a comment to disambiguate them.

To add a comment when making a key, you may need to use the --full-gen-key flag with GPG. Similarly, when exporting the GPG public key, the comment or email can be specified for disambiguation.

References

  • https://access.redhat.com/articles/3359321
Share this entry
  • Share on Facebook
  • Share on X
  • Share on Pinterest
  • Share on LinkedIn
  • Share on Tumblr
  • Share on Reddit
  • Share by Mail
https://www.seidengroup.com/wp-content/uploads/2017/03/SeidenLogo-180.png 0 0 Calvin Buckley https://www.seidengroup.com/wp-content/uploads/2017/03/SeidenLogo-180.png Calvin Buckley2020-07-23 11:12:482020-08-03 15:33:18RPM Package Signing
Calvin Buckley

About Calvin Buckley

Recognized as an IBM Champion and a 2020 Fresh Face of IBM i, Calvin exhibits remarkable talent for expanding the use of IBM i through open ...Read More

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

SUBSCRIBE
Open Thinking
Monthly IBM i Strategy & Tips
  • This field is for validation purposes and should be left unchanged.

IBM i Development

  • RPG, COBOL, SQL, Node,
    PHP, Python, Valance, etc.
  • Modernization. Integration.
  • Web and API Solutions
  • Legacy Maintenance
    ...
LET'S GET IT DONE!

Recent Posts

  • Mitigating the eMudhra Intermediate CA Compromise with IBM i
  • Critical php2shell Security Update Available in Seiden PHP+ Server
  • Moving to IBM i 7.6? An SDA Alternative with VS Code and IBM Bob
  • What’s New with Mapepire Database Connector for IBM i
  • Do You Need IBM i Observability?
  • PHP 8.6 is Coming Soon to IBM i
  • Safer npm installation is on the way for Node.js (and all JavaScript)
  • Access Modern Security for IBM i and Connected Web Environments
  • IBM i: A Natural Platform for Agentic AI
  • PHP on IBM i in 2026: The Modernization Engine

SEIDEN GROUP: Modern Development & Open Source for IBM i

Home   |   Seiden PHP+   |   IBM i Services  |   Support   |   VS Code for i   |   Free Stuff   |   Blog  |   Privacy Policy  |   Contact         201.447.2437

© 2026 Seiden Group, LLC
  • Link to LinkedIn
  • Link to Mail
Link to: How-To Video: The Zen of Using PHP without Zend Server Link to: How-To Video: The Zen of Using PHP without Zend Server How-To Video: The Zen of Using PHP without Zend Server Link to: How to Access the PHP Toolkit for IBM i Link to: How to Access the PHP Toolkit for IBM i How to Access the PHP Toolkit for IBM i
Scroll to top Scroll to top Scroll to top