-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathextended.go
40 lines (28 loc) · 1.31 KB
/
extended.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
package truststores
import (
"errors"
"github.com/safing/jess"
)
// ErrNotSupportedByTrustStore is returned by trust stores if they do not
// support certain actions.
var ErrNotSupportedByTrustStore = errors.New("action not supported by trust store")
// ExtendedTrustStore holds a set of trusted Signets, Recipients and Envelopes.
type ExtendedTrustStore interface {
jess.TrustStore
// GetSignet returns the Signet with the given ID.
// GetSignet(id string, recipient bool) (*Signet, error)
// StoreSignet stores a Signet.
StoreSignet(signet *jess.Signet) error
// DeleteSignet deletes the Signet or Recipient with the given ID.
DeleteSignet(id string, recipient bool) error
// SelectSignets returns a selection of the signets in the trust store. Results are filtered by tool/algorithm and whether it you're looking for a signet (private key) or a recipient (public key).
SelectSignets(filter uint8, schemes ...string) ([]*jess.Signet, error)
// GetEnvelope returns the Envelope with the given name.
GetEnvelope(name string) (*jess.Envelope, error)
// StoreEnvelope stores an Envelope.
StoreEnvelope(envelope *jess.Envelope) error
// DeleteEnvelope deletes the Envelope with the given name.
DeleteEnvelope(name string) error
// AllEnvelopes returns all envelopes.
AllEnvelopes() ([]*jess.Envelope, error)
}