forked from vedhavyas/go-subkey
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkeypair.go
More file actions
34 lines (26 loc) · 745 Bytes
/
keypair.go
File metadata and controls
34 lines (26 loc) · 745 Bytes
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 subkey
// PublicKey can verify and be converted to SS58 addresses
type PublicKey interface {
Verifier
// Public returns the pub key in bytes.
Public() []byte
// AccountID returns the accountID for this key
AccountID() []byte
// SS58Address returns the Base58 public key with checksum and network identifier.
SS58Address(network uint16) string
}
// KeyPair can sign, verify using a seed and public key
type KeyPair interface {
Signer
PublicKey
// Seed returns the seed of the pair
Seed() []byte
}
// Signer signs the message and returns the signature.
type Signer interface {
Sign(msg []byte) ([]byte, error)
}
// Verifier verifies the signature.
type Verifier interface {
Verify(msg []byte, signature []byte) bool
}