/
interface.go
34 lines (26 loc) · 1001 Bytes
/
interface.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
package identityprovider // import "berty.tech/go-ipfs-log/identityprovider"
import (
"berty.tech/go-ipfs-log/keystore"
crypto "github.com/libp2p/go-libp2p-core/crypto"
)
type CreateIdentityOptions struct {
IdentityKeysPath string
Type string
Keystore keystore.Interface
//Migrate func(*MigrateOptions) error
ID string
}
type Interface interface {
// GetID returns id of identity (to be signed by orbit-db public key).
GetID(*CreateIdentityOptions) (string, error)
// SignIdentity returns signature of OrbitDB public key signature.
SignIdentity(data []byte, id string) ([]byte, error)
// GetType returns the type for this identity provider.
GetType() string
// VerifyIdentity checks an identity.
VerifyIdentity(identity *Identity) error
// Sign will sign a value.
Sign(identity *Identity, bytes []byte) ([]byte, error)
// UnmarshalPublicKey will provide a crypto.PubKey from a key bytes.
UnmarshalPublicKey(data []byte) (crypto.PubKey, error)
}