github.com/unicornultrafoundation/go-u2u@v1.0.0-rc1.0.20240205080301-e74a83d3fadc/valkeystore/keystore.go (about)

     1  package valkeystore
     2  
     3  import (
     4  	"github.com/unicornultrafoundation/go-u2u/native/validatorpk"
     5  	"github.com/unicornultrafoundation/go-u2u/valkeystore/encryption"
     6  )
     7  
     8  type RawKeystoreI interface {
     9  	Has(pubkey validatorpk.PubKey) bool
    10  	Add(pubkey validatorpk.PubKey, key []byte, auth string) error
    11  	Get(pubkey validatorpk.PubKey, auth string) (*encryption.PrivateKey, error)
    12  }
    13  
    14  type KeystoreI interface {
    15  	RawKeystoreI
    16  	Unlock(pubkey validatorpk.PubKey, auth string) error
    17  	Unlocked(pubkey validatorpk.PubKey) bool
    18  	GetUnlocked(pubkey validatorpk.PubKey) (*encryption.PrivateKey, error)
    19  }