github.com/Finschia/finschia-sdk@v0.48.1/crypto/types/types.go (about)

     1  package types
     2  
     3  import (
     4  	occrypto "github.com/Finschia/ostracon/crypto"
     5  	proto "github.com/gogo/protobuf/proto"
     6  )
     7  
     8  // PubKey defines a public key and extends proto.Message.
     9  type PubKey interface {
    10  	proto.Message
    11  
    12  	Address() Address
    13  	Bytes() []byte
    14  	VerifySignature(msg []byte, sig []byte) bool
    15  	Equals(PubKey) bool
    16  	Type() string
    17  }
    18  
    19  // LedgerPrivKey defines a private key that is not a proto message. For now,
    20  // LedgerSecp256k1 keys are not converted to proto.Message yet, this is why
    21  // they use LedgerPrivKey instead of PrivKey. All other keys must use PrivKey
    22  // instead of LedgerPrivKey.
    23  // TODO https://github.com/cosmos/cosmos-sdk/issues/7357.
    24  type LedgerPrivKey interface {
    25  	Bytes() []byte
    26  	Sign(msg []byte) ([]byte, error)
    27  	PubKey() PubKey
    28  	Equals(LedgerPrivKey) bool
    29  	Type() string
    30  }
    31  
    32  // PrivKey defines a private key and extends proto.Message. For now, it extends
    33  // LedgerPrivKey (see godoc for LedgerPrivKey). Ultimately, we should remove
    34  // LedgerPrivKey and add its methods here directly.
    35  // TODO https://github.com/cosmos/cosmos-sdk/issues/7357.
    36  type PrivKey interface {
    37  	proto.Message
    38  	LedgerPrivKey
    39  }
    40  
    41  type (
    42  	Address = occrypto.Address
    43  )