OpenPGP Signature Verification Guide
OpenPGP Signature Verification Guide
V100R001C00
Signature Verification
Guide
Issue 04
Date 2020-02-29
and other Huawei trademarks are trademarks of Huawei Technologies Co., Ltd.
Notice
The purchased products, services and features are stipulated by the contract made between Huawei and
the customer. All or part of the products, services and features described in this document may not be
within the purchase scope or the usage scope. Unless otherwise specified in the contract, all statements,
information, and recommendations in this document are provided "AS IS" without warranties, guarantees
or representations of any kind, either express or implied.
The information in this document is subject to change without notice. Every effort has been made in the
preparation of this document to ensure accuracy of the contents, but all statements, information, and
recommendations in this document do not constitute a warranty of any kind, express or implied.
Email: [email protected]
Purpose
This document describes OpenPGP signature tools, and verification process.
Intended Audience
This document is intended for:
Installation and commissioning engineers
Technical support engineers
Symbol Conventions
The symbols that may be found in this document are defined as follows.
Symbol Description
Indicates an imminently hazardous situation which, if not
avoided, will result in death or serious injury.
Change History
Changes between document issues are cumulative. The latest document issue contains all the
changes made in earlier issues.
Issue 01 (2014-11-20)
This issue is used for first office application (FOA).
Issue 02 (2017-09-01)
1. Change the description of the signature verification procedure.
2. Upgrade the PGPVerify Tool to V100R001C00SPC310.
Issue 03 (2017-12-12)
1. Add handle suggestion when verify failed.
2. Upgrade the PGPVerify tool to V100R001C00SPC320.
Issue 04(2020-02-20)
Added verification guidance for OpenPGP key length of 4096.
Release V100R001C00SPC200:
1. This is the first version of PGPVerify tool, which offered verification function for PGP
signature.
Release V100R001C00SPC310:
1. Upgrade liberary openssl to version 1.1.0f;
2. Replace icon for applicatoin with UI under Windows OS;
3. Change UI style to fit Windows 7;
4. Show a confirm dialog when closing the application window.
Release V100R001C00SPC320:
1. Add version properities for PGPVerify tool under windows;
2. Add timestamp for PGPVerify tool under windows.
Contents
4 Gpg4Win (Windows).................................................................................................................. 20
4.1 Background .................................................................................................................................................... 20
4.2 Prerequisites ................................................................................................................................................... 20
4.2.1 Installing Gpg4Win ............................................................................................................................... 20
4.2.2 Obtaining the Public Key File ............................................................................................................... 23
4.2.3 Importing the Public Key ...................................................................................................................... 27
4.2.4 Verifying the Public Key ....................................................................................................................... 28
4.3 Verifying the Signature ................................................................................................................................... 29
6 FAQs .............................................................................................................................................. 44
6.1 The Application Scope for use Verification Tool? .......................................................................................... 44
1 OpenPGP Overview
OpenPGP is an open security protocol standard (RFC4880) that widely applies to data
encryption and signature. It has multiple commercial and non-commercial implementations,
including Pretty Good Privacy (PGP) and GNU Privacy Guard (GnuPG). GnuPG is
transplanted into multiple platforms, such as Linux and Windows and pre-installed in most
Linux versions.
OpenPGP includes an independent digital signature standard that differentiates itself from
other standards by the key storage and distribution method, message digest calculation
process, signature packet format, and verification process.
GNU Privacy Linux GnuPG is a free open-source GNC tool that implements
Guard (GnuPG) the OpenPGP standard defined in RFC4880. It is pre-
installed in most Linux versions.
Official website: http://www.gnupg.org
GNU Privacy Windows Gpg4Win is the official Windows version of GnuPG.
Guard for The function and usage of Gpg4Win are the same as
Windows those of GnuPG.
(Gpg4Win) Official website: http://www.gpg4win.org/
PGPVerify.exe Windows PGPVerify is a PGP simplified verification tool
developed by Huawei.
Official website:
http://support.huawei.com/carrier/digitalSignatureAction
1.The KEYS.txt file is the public key file when the OpenPGP key length is 2048. The KEYS4096.txt file is the
public key file when the OpenPGP key length is 4096.
2.Compared with KEYS.txt, KEYS4096.txt increases the key length and the length of the signature result,
improving security.
Notice:
Because websites such as Huawei Support cannot upload files without suffixes, the "KEYS" file is renamed
to "KEYS.txt" and the "KEYS4096" file is renamed to "KEYS4096.txt" when publishing.
3 GnuPG (Linux)
3.1 Background
GnuPG is a free open-source GNC tool that verifies OpenPGP signatures in the SUSE Linux
operating system.
Software packages and signature files are released together and stored in the same directory. A
software package corresponds to a signature file.
The signature files use the same file names as those used by software packages, with file
name extension asc. For example, if the software package name is V100R001C04.zip, the
corresponding verification file name is V100R001C04.zip.asc.
3.2 Prerequisites
3.2.1 Installing GnuPG
GnuPG is pre-installed in most Linux versions. Run the gpg –version command in the shell.
If the following command output is displayed, GnuPG is installed.
signsrv:~ # gpg --version
gpg (GnuPG) 2.0.9
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Home: ~/.gnupg
Supported algorithms:
Pubkey: RSA, ELG, DSA
Cipher: 3DES, CAST5, BLOWFISH, AES, AES192, AES256, TWOFISH
Hash: MD5, SHA1, RIPEMD160, SHA256, SHA384, SHA512, SHA224
Compression: Uncompressed, ZIP, ZLIB, BZIP2
If GnuPG is not installed in the current system, follow the guidance on the official website
(http://www.gnupg.org/) to install it.
Figure 3-1 Web page for downloading the public key file from http://support.huawei.com/carrier
Figure 3-2 Web page for downloading the public key file from
http://support.huawei.com/enterprise
Download the public key file from the terminal knowledge base at the following URL:
http://app.huawei.com/tkb/#!tservice/common/base/digit.html?resourceId=146680
To download the public key file from the terminal knowledge base, perform the following
steps:
Step 1 Access http://app.huawei.com/tkb/#!tservice/common/base/digit.html?resourceId=146680.
Figure 3-3 shows the displayed web page.
Figure 3-3 Web page for downloading the public key file from the terminal knowledge base
Step 2 Click Download to download the OpenPGP Signature Verification Guide.rar package.
If you have relevant permissions but an error is displayed, select the correct language.
Step 3 Decompress the downloaded OpenPGP Signature Verification Guide.rar package.
The KEYS.txt or KEYS4096.txt file is the public key file.
----End
Enter " OpenPGP signature key for Huawei software "in the String text box, and click" Search
for a key" to search for the public key.
Step 2 Click public key ID 27A74842 to check the details, as shown in Figure 3-6. If the public key
length is 4096, the corresponding ID is 6ADE4A56.
Step 3 Copy the public key information to a TXT file and name it as KEYS.txt. If the public key
length is 4096, save it as a KEYS4096.txt file.
----End
gpg: key 6ADE4A56: public key "OpenPGP signature key for Huawei software (created
on 15th Jun,2019) <[email protected]>" imported
gpg: Total number processed: 1
gpg: imported: 1 (RSA: 1)
Step 3 Run the following command to check the public key import result.
# gpg --fingerprint
Key fingerprint = E128 5E9D 7E7F 0DB0 A659 48AF FAAA 7A2E 6ADE 4A56
uid OpenPGP signature key for Huawei software (created on 15th Jun,2019)
<[email protected]>
----End
After verifying the preceding information, set the trust level for the key.
Step 2 Run the following command to set the trust level.
# gpg --edit-key " OpenPGP signature key for Huawei software (created on
30th Dec,2013) " trust
set the trust level as follows, If the public key length is 4096
#gpg --edit-key " OpenPGP signature key for Huawei software (created on
15th Jun,2019) " trust
The output resembles the following information. You need to enter 5 behind Your decision?
to indicate I trust ultimately and y behind you really want to set this key to ultimate trust?
(y/N).
gpg (GnuPG) 2.0.9; Copyright (C) 2008 Free Software Foundation, Inc.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
gpg: depth: 0 valid: 1 signed: 0 trust: 0-, 0q, 0n, 0m, 0f, 1u
pub 2048R/27A74824 created: 2013-12-30 expires: never usage: SC
trust: ultimate validity: ultimate
[ultimate] (1). OpenPGP signature key for Huawei software (created on 30th
Dec,2013) <[email protected]>
Please decide how far you trust this user to correctly verify other users' keys
(by looking at passports, checking fingerprints from different sources, etc.)
Your decision? 5
Do you really want to set this key to ultimate trust? (y/N) y
----End
gpg: Signature made Thu Jan 9 15:29:06 2014 CST using RSA key ID 27A74824
gpg: Good signature from "OpenPGP signature key for Huawei software (created on
30th Dec,2013) <[email protected]>"
RSA key ID in bold is 27A74824, and there is no WARNING, which means this signature is
published by Huawei.
The following output is displayed for key length of 4096:
pg: Signature made Mon Dec 30 12:16:07 2019 CST using RSA key ID 6ADE4A56
gpg: Good signature from "OpenPGP signature key for Huawei software (created on 15th
Jun,2019) <[email protected]>"
RSA key ID in bold is 6ADE4A56, and there is no WARNING, which means this signature is
published by Huawei.
If a version has multiple signature files to be verified, the version is considered secure only
when all the files pass the verification. If the verification result of a file is WARN or FAIL,
the version does not pass the verification and has security risks. In this case, try to solve
problem following the suggest action in table 3-1.
In this command, two hyphens precede verify.
4 Gpg4Win (Windows)
4.1 Background
Gpg4Win is a free open-source GNU tool that verifies OpenPGP signatures in Windows. The
function and usage of Gpg4Win are the same as those of GnuPG. For details, visit its official
website http://www.gpg4win.org/.
A software package and its corresponding signature file are stored in the same directory.
The signature files use the same file names as those used by software packages, with the file
name extension being asc. For example, if the software package name is V100R001C04.zip,
the corresponding verification file name is V100R001C04.zip.asc.
4.2 Prerequisites
4.2.1 Installing Gpg4Win
First download the install package as follows:
Step 1 Visit https://www.gpg4win.org/download.html.
Step 2 Click the download link in the red box shown in the preceding figure. (Maybe the latest
version is not 3.1.11 as in this document, but the download link does not change. In the
following steps, you can ignore the version of the installation package.)
Step 4 Click the download link in the red box to download the installation package.
----End
Figure 4-6 Web page for downloading the public key file from http://support.huawei.com/carrier
http://support.huawei.com/enterprise/en/tool/software-digital-signature-validation-
tool-%EF%BC%88pgp-verify%EF%BC%89-TL1000000054
The target web page may be displayed in Chinese. Click Worldwide on the top of the
web page to switch the language to English. Figure 4-7 shows the web page in English.
Click the version number in the Version list. Then click corresponding to the public
key file KEYS.txt or KEYS4096.txt to download the file.
Figure 4-7 Web page for downloading the public key file from
http://support.huawei.com/enterprise
Download the public key file from the terminal knowledge base at the following URL:
http://app.huawei.com/tkb/#!tservice/common/base/digit.html?resourceId=146680
To download the public key file from the terminal knowledge base, perform the following
steps:
Step 1 Access http://app.huawei.com/tkb/#!tservice/common/base/digit.html?resourceId=146680.
Figure 4-8 shows the displayed web page.
Figure 4-8 Web page for downloading the public key file from the terminal knowledge base
Step 2 Click Download to download the OpenPGP Signature Verification Guide.rar package.
If you have relevant permissions but an error is displayed, select the correct language.
Step 3 Decompress the downloaded OpenPGP Signature Verification Guide.rar package.
The KEYS.txt or KEYS4096.txt file is the public key file.
----End
Enter " OpenPGP signature key for Huawei software "in the String text box, and click" Search
for a key" to search for the public key.
Step 2 Click public key ID 27A74842 to check the details, as shown in Figure 4-11. If the public key
length is 4096, the corresponding ID is 6ADE4A56.
Step 3 Copy the public key information to a TXT file and name it as KEYS.txt. If the public key
length is 4096, save it as a KEYS4096.txt file.
----End
gpg: key 6ADE4A56: public key "OpenPGP signature key for Huawei software (created
on 15th Jun,2019) <[email protected]>" imported
gpg: Total number processed: 1
gpg: imported: 1 (RSA: 1)
Step 4 Run the following command to check the public key import result.
gpg --fingerprint
----End
After verifying the preceding information, set the trust level for the key.
Step 2 Run the following command to set the trust level.
#gpg --edit-key " OpenPGP signature key for Huawei software (created on
30th Dec,2013) " trust
set the trust level as follows, If the public key length is 4096
#gpg --edit-key " OpenPGP signature key for Huawei software (created on
15th Jun,2019) " trust
The output resembles the following information. You need to enter 5 behind Your decision?
to indicate I trust ultimately and y behind you really want to set this key to ultimate trust?
(y/N).
gpg (GnuPG) 2.0.9; Copyright (C) 2008 Free Software Foundation, Inc.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Please decide how far you trust this user to correctly verify other users' keys
(by looking at passports, checking fingerprints from different sources, etc.)
Your decision? 5
Do you really want to set this key to ultimate trust? (y/N) y
----End
RSA key ID in bold is the same as the public key ID. If no WARNING, public key expiry,
signature expiry, or public key revocation information is display, the signature is valid.
The following output is displayed for key length of 4096:
pgp: Signature made Mon Dec 30 12:16:07 2019 CST using RSA key ID 6ADE4A56
gpg: Good signature from "OpenPGP signature key for Huawei software (created on 15th
Jun,2019) <[email protected]>"
RSA key ID in bold is 6ADE4A56, and there is no WARNING, which means this signature is
published by Huawei.
If a version has multiple signature files to be verified, the version is considered secure only
when all the files pass the verification. If the verification result of a file is WARN or FAIL,
the version does not pass the verification and has security risks. In this case, try to solve
problem following the suggest action in table 4-1.
In this command, two hyphens precede verify.
5 PGPVerify (Windows&Linux)
5.1 Background
PGPVerify is a PGP simplified verification tool developed by Huawei. It runs on Windows 7,
Windows Server 2008, Windows 8, and Windows 10 platforms.
Software packages and signature files are stored in the same directory. A software package
corresponds to a verification file.
The signature files use the same file names as those used by software packages, with the file
name extension being .asc. For example, if the software package name is V100R001C04.zip,
the corresponding verification file name is V100R001C04.zip.asc.
5.2 Prerequisites
5.2.1 Obtaining PGPVerify
PGPVerify requires no installation. You can download it from the following websites.
http://support.huawei.com
Download PGPVerify from the following uniform resource locator (URL):
http://support.huawei.com/carrier/digitalSignatureAction
The target web page may be displayed in Chinese. Click English on the top of the web page
to switch the language to English.
http://support.huawei.com/enterprise
Download PGPVerify from the following uniform resource locator (URL):
http://support.huawei.com/enterprise/en/tool/software-digital-signature-validation-
tool-%EF%BC%88pgp-verify%EF%BC%89-TL1000000054
The target web page may be displayed in Chinese. First click the earth mark on the top of the
page, and then choose English to change the page’s language, finally you can download the
English document.
Figure 5-3 Web page for downloading PGPVerify from the terminal knowledge base
Step 2 Click Download to download the OpenPGP Signature Verification Guide.rar package.
If you have relevant permissions but an error is displayed, select the correct language.
Step 3 Decompress the downloaded OpenPGP Signature Verification Guide.rar package and
obtain the PGPVerify verification tool.
----End
The public key file is compressed in the same package as the verification tool. Therefore, the URL for
downloading the public key file is the same as that for downloading the verification tool. The public key
file is named KEYS.txt or KEYS4096.txt.
Enter " OpenPGP signature key for Huawei software "in the String text box, and click" Search
for a key" to search for the public key.
Step 2 Click public key ID 27A74842 to check the details, as shown in Figure 5-6. If the public key
length is 4096, the corresponding ID is 6ADE4A56.
Step 3 Copy the public key information to a TXT file and name it as KEYS.txt. If the public key
length is 4096, save it as a KEYS4096.txt file.
----End
when sign data lenth is 4096, please select KEYS4096.txt for the public key file.
If you have used this verification tool on the same computer before, the last key you selected
will be automatically reloaded when you use this tool once again.
Step 3 Verify files.
Verifying a single file
Click Single Verify and select the .asc signature verification file.
Verifying all files in the directory
Click Multiple Verify and select the C:\PGP\ directory. Figure 5-9 shows the
verification result.
If a version has multiple signature files to be verified, the version is considered secure only
when all files are highlighted in green ([PASS]) and all public key fingerprints are B1000AC3
8C41525A 19BDC087 99AD81DF 27A74824(when OpenPGP key length is 4096,
fingerprints are E1285E9D7E7F0DB0A65948AFFAAA7A2E6ADE4A56), which means
the signature is issued by Huawei. Otherwise, please obtain a new software package.
----End
C:\KEYS.txt is the public key, and C:\PGP\Tecal CH224.zip.asc is the signature file. If sign
data lenth is 4096, please select KEYS4096.txt for the public key file.
The following output is displayed for key length of 2048:
[PASS]:Good Signature. File path: C:\PGP\Tecal CH224.zip.asc, Public key
fingerprint: B1000AC3 8C41525A 19BDC087 99AD81DF 27A74824
[INFO]: Verify Complete.
C:\KEYS.txt is the public key, and C:\PGP is the directory in which signature files will be
verified. If sign data lenth is 4096, please select KEYS4096.txt for the public key file.
The following output is displayed:
[INFO]:Filter file in directory, please wait...
[WARN]:Can't find signature file, signed file position: C:\PGP\Tecal CH221.zip.
[WARN]:Can't find signed file, signature file position: C:\PGP\Tecal
CH222.zip.asc.
[FAIL]:Invalid Signature. File path: C:\PGP\Tecal CH223.zip.
[PASS]:Good Signature. File path: C:\PGP\Tecal CH224.zip, Public key fingerprint:
B1000AC3 8C41525A 19BDC087 99AD81DF 27A74824
If a version has multiple signature files to be verified, the version is considered secure only
when all items’ verification results are all PASS and all public key fingerprints are B1000AC3
8C41525A 19BDC087 99AD81DF 27A74824(when OpenPGP key length is 4096,
fingerprints are E1285E9D7E7F0DB0A65948AFFAAA7A2E6ADE4A56), which means
the signature is issued by Huawei. Otherwise, please obtain a new software package.
KEYS.txt is the public key, and scw.cab.asc is the signature file. If sign data lenth is 4096,
please select KEYS4096.txt for the public key file.
The following output is displayed for key length of 2048:
[PASS]:Good Signature. File path: scw.cab.asc, Public key fingerprint: 97399A82
CD5D7160 13D181FC 0D7AC54D F0B00048.
[INFO]: Verify Complete.
1. If a version has multiple signature files to be verified, the version is considered secure only
when all items’ verification results are PASS and all public key fingerprints are B1000AC3
8C41525A 19BDC087 99AD81DF 27A74824(when OpenPGP key length is 4096,
fingerprints are E1285E9D7E7F0DB0A65948AFFAAA7A2E6ADE4A56), which means
the signature is issued by Huawei. Otherwise, please obtain a new software package.
2. If the verify result is “Permission denied” in step 1, please add execution attribute to file by
executing “chmod u+x PGPVerify” first.
--End
6 FAQs
1. Right click title bar of tool window, and click “About” menu.
Command:
-k: public key.
-d: The directory which to be verified.
-f: The file which to be verified.
-l: Set log file.
Example:
PGPVerify -k KEYS -d file-directory
PGPVerify -k KEYS -f signed-file
Attention: The string “V100” is fixed for the version, and it won’t change for releases in
feature, so just use it as a version keyword here.
2. Show result as below (task V100R001C00SPC310 for example):
100.001.00.310
Figure 6-1 Web page for downloading the .asc file from http://support.huawei.com/carrier
Figure 6-2 Web page (in Chinese) for downloading the public key file or verification tools from
http://support.huawei.com
Download the public key file or verification tools from the following URL at
http://support.huawei.com/enterprise:
http://support.huawei.com/enterprise/en/tool/software-digital-signature-validation-
tool-%EF%BC%88pgp-verify%EF%BC%89-TL1000000054
The target web page may be displayed in Chinese. Click Worldwide on the top of the
web page to switch the language to English, as shown in Figure 6-3.
Click the version number in the Version list. Then click corresponding to the public
key file KEYS.txt or KEYS4096.txt to download the file. Download and decompress
VerificationTools.zip to obtain either of the signature verification tools PGPVerify and
Gpg4Win.
Figure 6-3 Web page (in Chinese) for downloading the public key file or verification tools from
http://support.huawei.com/enterprise
Download the public key file or verification tools from the terminal knowledge base at
the following URL:
http://app.huawei.com/tkb/#!tservice/common/base/digit.html?resourceId=146680
To download the public key file or verification tools from the terminal knowledge base,
perform the following steps:
Step 1 Access http://app.huawei.com/tkb/#!tservice/common/base/digit.html?resourceId=146680.
Figure 6-4 shows the displayed web page.
Figure 6-4 Web page for downloading the public key file or verification tools from the terminal
knowledge base
Step 2 Click Download to download the OpenPGP Signature Verification Guide.rar package.
If you have relevant permissions but an error is displayed, select the correct language.
Step 3 Decompress the downloaded OpenPGP Signature Verification Guide.rar package.
The KEYS.txt or KEYS4096.txt file is the public key file.
VerificationTools.zip contains the verification tools. You can decompress the package to
obtain the Gpg4Win and PGPVerify verification tools.
----End
New command:
PGPVerify.exe -k \\?\D:\KEYS.txt -f \\?\D:\testfile.txt
New command:
PGPVerify -k \\?\UNC\10.172.12.12\sharedir\KEYS.txt -f
\\?\UNC\10.172.12.12\sharedir\testfile.txt