Versions in this module Expand all Collapse all v0 v0.4.0 May 7, 2024 Changes in this version + var ErrNoPGPSignature = errors.New("no supported PGP signature packet found") + var ErrTrailingGarbage = errors.New("trailing garbage after PGP signature packet") + type KeyNotFoundError struct + Fingerprint []byte + KeyID uint64 + func (e KeyNotFoundError) Error() string type Signature + KeyFingerprint []byte + PrimaryName string v0.3.0 Jan 26, 2024 Changes in this version + const CONFLICTFLAGS + const CONFLICTNAME + const CONFLICTVERSION + const HASH_HAVAL_5_160 + const HASH_MD2 + const HASH_MD5 + const HASH_RIPEMD160 + const HASH_SHA1 + const HASH_SHA224 + const HASH_SHA256 + const HASH_SHA384 + const HASH_SHA512 + const HASH_TIGER192 + const PAYLOADDIGEST + const PAYLOADDIGESTALGO + const SIG_LONGSIGSIZE + const SIG_SHA256 v0.2.0 Apr 8, 2021 Changes in this version + const CHANGELOGNAME + const CHANGELOGTEXT + const CHANGELOGTIME + type HeaderRange struct + End int + Start int type RpmHeader + func (hdr *RpmHeader) GetRange() HeaderRange + func (hdr *RpmHeader) GetUint32s(tag int) ([]uint32, error) + func (hdr *RpmHeader) GetUint64s(tag int) ([]uint64, error) v0.1.1 Jun 12, 2020 v0.1.0 Jun 12, 2020 Changes in this version + const ARCH + const ARCHIVESIZE + const BASENAMES + const BLINKHDRID + const BLINKNEVRA + const BLINKPKGID + const BUGURL + const BUILDHOST + const BUILDTIME + const CHANGELOG + const DESCRIPTION + const DIRINDEXES + const DIRNAMES + const DISTRIBUTION + const ENCODING + const EPOCH + const FILECAPS + const FILECOLORS + const FILEDEVICES + const FILEDIGESTALGO + const FILEDIGESTS + const FILEFLAGS + const FILEGROUPNAME + const FILEINODES + const FILELINKTOS + const FILEMODES + const FILEMTIMES + const FILERDEVS + const FILESIZES + const FILEUSERNAME + const FILEVERIFYFLAGS + const FLINKHDRID + const FLINKNEVRA + const FLINKPKGID + const GIF + const GROUP + const ICON + const LICENSE + const LONGFILESIZES + const LONGSIZE + const NAME + const OBSOLETEFLAGS + const OBSOLETENAME + const OBSOLETEVERSION + const OLDFILENAMES + const OS + const PACKAGER + const PATCH + const PAYLOADCOMPRESSOR + const PAYLOADFORMAT + const PGPHASHALGO_HAVAL_5_160 + const PGPHASHALGO_MD2 + const PGPHASHALGO_MD5 + const PGPHASHALGO_RIPEMD160 + const PGPHASHALGO_SHA1 + const PGPHASHALGO_SHA224 + const PGPHASHALGO_SHA256 + const PGPHASHALGO_SHA384 + const PGPHASHALGO_SHA512 + const PGPHASHALGO_TIGER192 + const POSTIN + const POSTINPROG + const POSTUN + const POSTUNPROG + const PREIN + const PREINPROG + const PREUN + const PREUNPROG + const PROVIDEFLAGS + const PROVIDENAME + const PROVIDEVERSION + const RELEASE + const REQUIREFLAGS + const REQUIRENAME + const REQUIREVERSION + const RPMFILE_CONFIG + const RPMFILE_DOC + const RPMFILE_EXCLUDE + const RPMFILE_GHOST + const RPMFILE_ICON + const RPMFILE_LICENSE + const RPMFILE_MISSINGOK + const RPMFILE_NONE + const RPMFILE_NOREPLACE + const RPMFILE_POLICY + const RPMFILE_PUBKEY + const RPMFILE_README + const RPMFILE_SPECFILE + const RPMFILE_UNPATCHED + const RPMSENSE_ANY + const RPMSENSE_EQUAL + const RPMSENSE_GREATER + const RPMSENSE_LESS + const RPMSENSE_TRIGGERIN + const RPMSENSE_TRIGGERPOSTUN + const RPMSENSE_TRIGGERPREIN + const RPMSENSE_TRIGGERUN + const RPMTAG_HEADERIMMUTABLE + const RPMTAG_HEADERREGIONS + const RPMTAG_HEADERSIGNATURES + const RPMVERIFY_CAPS + const RPMVERIFY_CONTEXTS + const RPMVERIFY_FILEDIGEST + const RPMVERIFY_FILESIZE + const RPMVERIFY_GROUP + const RPMVERIFY_LINKTO + const RPMVERIFY_MD5 + const RPMVERIFY_MODE + const RPMVERIFY_MTIME + const RPMVERIFY_NONE + const RPMVERIFY_RDEV + const RPMVERIFY_USER + const RPMVERSION + const RPM_BIN_TYPE + const RPM_CHAR_TYPE + const RPM_I18NSTRING_TYPE + const RPM_INT16_TYPE + const RPM_INT32_TYPE + const RPM_INT64_TYPE + const RPM_INT8_TYPE + const RPM_NULL_TYPE + const RPM_STRING_ARRAY_TYPE + const RPM_STRING_TYPE + const SIG_BASE + const SIG_DSA + const SIG_GPG + const SIG_LONGARCHIVESIZE + const SIG_LONGSIZE + const SIG_MD5 + const SIG_PAYLOADSIZE + const SIG_PGP + const SIG_RESERVEDSPACE + const SIG_RSA + const SIG_SHA1 + const SIG_SIZE + const SIZE + const SOURCE + const SOURCERPM + const SUMMARY + const TRIGGERFLAGS + const TRIGGERINDEX + const TRIGGERNAME + const TRIGGERPREIN + const TRIGGERSCRIPTPROG + const TRIGGERSCRIPTS + const TRIGGERVERSION + const URL + const VCS + const VENDOR + const VERIFYSCRIPT + const VERIFYSCRIPTPROG + const VERSION + const XPM + var R_ALPHA = regexp.MustCompile(`^([a-zA-Z]+)(.*)$`) + var R_NONALNUMTILDE = regexp.MustCompile(`^([^a-zA-Z0-9~]*)(.*)$`) + var R_NUM = regexp.MustCompile(`^([\d]+)(.*)$`) + func GetFileAlgoName(algo int) string + func NEVRAcmp(a NEVRA, b NEVRA) int + func Vercmp(first, second string) int + func Verify(stream io.Reader, knownKeys openpgp.EntityList) (header *RpmHeader, sigs []*Signature, err error) + type FileInfo interface + Device func() int + Digest func() string + Flags func() int + GroupName func() string + Inode func() int + Linkname func() string + Mode func() int + Mtime func() int + Name func() string + Size func() int64 + UserName func() string + type NEVRA struct + Arch string + Epoch string + Name string + Release string + Version string + func (nevra *NEVRA) String() string + type NEVRASlice []NEVRA + func (s NEVRASlice) Len() int + func (s NEVRASlice) Less(i, j int) bool + func (s NEVRASlice) Sort() + func (s NEVRASlice) Swap(i, j int) + type NoSuchTagError struct + Tag int + func NewNoSuchTagError(tag int) NoSuchTagError + func (err NoSuchTagError) Error() string + type PayloadReader interface + IsLink func() bool + Next func() (FileInfo, error) + Read func([]byte) (int, error) + type Rpm struct + Header *RpmHeader + func ReadRpm(f io.Reader) (*Rpm, error) + func (rpm *Rpm) ExpandPayload(dest string) error + func (rpm *Rpm) PayloadReader() (*cpio.Reader, error) + func (rpm *Rpm) PayloadReaderExtended() (PayloadReader, error) + type RpmHeader struct + func ReadHeader(f io.Reader) (*RpmHeader, error) + func RewriteWithSignatures(infile *os.File, outpath string, sigPgp, sigRsa []byte) (*RpmHeader, error) + func SignRpmFile(infile *os.File, outpath string, key *packet.PrivateKey, ...) (header *RpmHeader, err error) + func SignRpmStream(stream io.Reader, key *packet.PrivateKey, opts *SignatureOptions) (header *RpmHeader, err error) + func (hdr *RpmHeader) DumpSignatureHeader(sameSize bool) ([]byte, error) + func (hdr *RpmHeader) Get(tag int) (interface{}, error) + func (hdr *RpmHeader) GetBytes(tag int) ([]byte, error) + func (hdr *RpmHeader) GetFiles() ([]FileInfo, error) + func (hdr *RpmHeader) GetInt(tag int) (int, error) + func (hdr *RpmHeader) GetInts(tag int) ([]int, error) + func (hdr *RpmHeader) GetNEVRA() (*NEVRA, error) + func (hdr *RpmHeader) GetString(tag int) (string, error) + func (hdr *RpmHeader) GetStrings(tag int) ([]string, error) + func (hdr *RpmHeader) GetUint64Fallback(intTag, longTag int) (uint64, error) + func (hdr *RpmHeader) HasTag(tag int) bool + func (hdr *RpmHeader) InstalledSize() (int64, error) + func (hdr *RpmHeader) OriginalSignatureHeaderSize() int + func (hdr *RpmHeader) PayloadSize() (int64, error) + type Signature struct + CreationTime time.Time + Hash crypto.Hash + HeaderOnly bool + KeyId uint64 + Signer *openpgp.Entity + type SignatureOptions struct + CreationTime time.Time + Hash crypto.Hash + type VersionSlice []string + func (vs VersionSlice) Len() int + func (vs VersionSlice) Less(i, j int) bool + func (vs VersionSlice) Swap(i, j int)