-
Notifications
You must be signed in to change notification settings - Fork 24
/
result.go
40 lines (33 loc) · 1.14 KB
/
result.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// Copyright (c) 2020-2021, Sylabs Inc. All rights reserved.
// This software is licensed under a 3-clause BSD license. Please consult the LICENSE.md file
// distributed with the sources of this project regarding your rights to use or distribute this
// software.
package integrity
import (
"github.com/ProtonMail/go-crypto/openpgp"
"github.com/hpcng/sif/v2/pkg/sif"
)
// VerifyResult describes the results of an individual signature validation.
type VerifyResult struct {
sig sif.Descriptor
verified []sif.Descriptor
e *openpgp.Entity
err error
}
// Signature returns the signature object associated with the result.
func (r VerifyResult) Signature() sif.Descriptor {
return r.sig
}
// Verified returns the data objects that were verified.
func (r VerifyResult) Verified() []sif.Descriptor {
return r.verified
}
// Entity returns the signing entity, or nil if the signing entity could not be determined.
func (r VerifyResult) Entity() *openpgp.Entity {
return r.e
}
// Error returns an error describing the reason verification failed, or nil if verification was
// successful.
func (r VerifyResult) Error() error {
return r.err
}