验证MongoDB软件包的完整性
最后更新于
curl -LO https://fastdl.mongodb.org/osx/mongodb-macos-x86_64-4.2.8.tgz.sigcurl -LO https://www.mongodb.org/static/pgp/server-4.2.asc
gpg --import server-4.2.ascgpg: key 4B7C549A058F8B6B: "MongoDB 4.2 Release Signing Key <packaging@mongodb.com>" imported
gpg: Total number processed: 1
gpg: imported: 1gpg --verify mongodb-macos-x86_64-4.2.8.tgz.sig mongodb-macos-x86_64-4.2.8.tgzgpg: Signature made Wed Jun 5 03:17:20 2019 EDT
gpg: using RSA key 4B7C549A058F8B6B
gpg: Good signature from "MongoDB 4.2 Release Signing Key <packaging@mongodb.com>" [unknown]gpg: WARNING: This key is not certified with a trusted signature!
gpg: There is no indication that the signature belongs to the owner.
Primary key fingerprint: E162 F504 A20C DF15 827F 718D 4B7C 549A 058F 8B6Bgpg: Can't check signature: public key not foundcurl -LO https://fastdl.mongodb.org/osx/mongodb-macos-x86_64-4.2.8.tgzcurl -LO https://fastdl.mongodb.org/osx/mongodb-macos-x86_64-4.2.8.tgz.sha256shasum -c mongodb-macos-x86_64-4.2.8.tgz.sha256mongodb-macos-x86_64-4.2.8.tgz: OK$sigHash = (Get-Content $Env:HomePath\Downloads\mongodb-win32-x86_64-2012plus-4.2.8-signed.msi.sha256 | Out-String).SubString(0,64).ToUpper(); `
$fileHash = (Get-FileHash $Env:HomePath\Downloads\mongodb-win32-x86_64-2012plus-4.2.8-signed.msi).Hash.Trim(); `
echo $sigHash; echo $fileHash; `
$sigHash -eq $fileHashAF5AF79EFE540DCDDC2825A396C71FCFC4FEB463BC9CADDCCDE20AD126321CCC
AF5AF79EFE540DCDDC2825A396C71FCFC4FEB463BC9CADDCCDE20AD126321CCC
True