Documentation ¶
Index ¶
Constants ¶
View Source
const DirName = ".store"
DirName is the storage directory name
View Source
const ( // SignatureChallenge byte iota SignatureChallenge = iota )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Challenge ¶
Challenge interface
func NewSignatureChallenge ¶
func NewSignatureChallenge(addresses []string, coinFamily CoinFamily) Challenge
NewSignatureChallenge creates a new signature challenge from a slice of addresses
func ReadChallenge ¶
func ReadChallenge(data []byte, coinFamily CoinFamily) Challenge
ReadChallenge reads a challenge from bytes
type CoinFamily ¶
type CoinFamily uint8
CoinFamily is an enum to describe the family of coin
const ( // BitcoinFamily type (btc, ltc, bcy,doge ...) BitcoinFamily CoinFamily = iota // EthereumFamily type (eth, beth...)s EthereumFamily // UnknownCoinFamily for error purpose UnknownCoinFamily )
func CoinPrefixToCoinFamily ¶
func CoinPrefixToCoinFamily(coinPrefix string) CoinFamily
CoinPrefixToCoinFamily convert a coin family to a prefix
type FileStore ¶
type FileStore struct{}
FileStore saves key data in files under a given directory
type Hold ¶
type Hold struct {
// contains filtered or unexported fields
}
Hold holds the keys and handles their lifecycle. Decrypts the private key just for the time of computing a signature.
type KeyHold ¶
type KeyHold interface { // Creates and keeps a new key pair. Unlocking it to produce a signature will require that the data // to sign pass the provided challenge. NewKey(challenge Challenge, prefix byte) (addr string, err error) // For a given source address and data that should pass the challenge provided when address keys were // created, signs that data. Sign(addr string, data []byte) }
KeyHold interface
type Signer ¶
type Signer interface { NewKey() (pub, priv []byte, err error) Sign(private, data []byte) ([]byte, error) }
Signer interface
type SigningHandler ¶
type SigningHandler struct {
// contains filtered or unexported fields
}
SigningHandler signing handler
func (*SigningHandler) ServeHTTP ¶
func (sh *SigningHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
Click to show internal directories.
Click to hide internal directories.