github.com/stafiprotocol/go-substrate-rpc-client@v1.4.7/subkey/keypair.go (about) 1 package subkey 2 3 // PublicKey can verify and be converted to SS58 addresses 4 type PublicKey interface { 5 Verifier 6 7 // Public returns the pub key in bytes. 8 Public() []byte 9 10 // AccountID returns the accountID for this key 11 AccountID() []byte 12 13 // SS58Address returns the Base58 public key with checksum and network identifier. 14 SS58Address(network uint16) string 15 } 16 17 // KeyPair can sign, verify using a seed and public key 18 type KeyPair interface { 19 Signer 20 PublicKey 21 22 // Seed returns the seed of the pair 23 Seed() []byte 24 } 25 26 // Signer signs the message and returns the signature. 27 type Signer interface { 28 Sign(msg []byte) ([]byte, error) 29 } 30 31 // Verifier verifies the signature. 32 type Verifier interface { 33 Verify(msg []byte, signature []byte) bool 34 }