Documentation ¶
Index ¶
- Variables
- type Config
- type IgnoreWatermark
- type InMemoryWatermark
- type PublicKey
- type SignInterceptor
- type SignInterceptorOptions
- type Signatory
- func (s *Signatory) GetPublicKey(ctx context.Context, keyHash string) (*PublicKey, error)
- func (s *Signatory) Import(ctx context.Context, importerName string, secretKey string, ...) (*PublicKey, error)
- func (s *Signatory) ListPublicKeys(ctx context.Context) ([]*PublicKey, error)
- func (s *Signatory) Ready(ctx context.Context) (bool, error)
- func (s *Signatory) Sign(ctx context.Context, keyHash string, message []byte) (string, error)
- func (s *Signatory) Unlock(ctx context.Context) error
- type Watermark
Constants ¶
This section is empty.
Variables ¶
var ( // ErrVaultNotFound error return when a vault is not found ErrVaultNotFound = errors.Wrap(stderr.New("This key not found in any vault"), http.StatusNotFound) // ErrNotSafeToSign error returned when an operation is a potential duplicate ErrNotSafeToSign = errors.Wrap(stderr.New("Not safe to sign"), http.StatusForbidden) )
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Policy config.TezosConfig Vaults map[string]*config.VaultConfig Interceptor SignInterceptor Watermark Watermark Logger log.FieldLogger }
Config represents Signatory configuration
type IgnoreWatermark ¶
type IgnoreWatermark struct { }
IgnoreWatermark watermark that do not validation and return true
func NewIgnoreWatermark ¶
func NewIgnoreWatermark() *IgnoreWatermark
NewIgnoreWatermark create a new ignore watermark
func (*IgnoreWatermark) IsSafeToSign ¶
func (w *IgnoreWatermark) IsSafeToSign(pkh string, msg tezos.UnsignedMessage) bool
IsSafeToSign always return true
type InMemoryWatermark ¶
type InMemoryWatermark struct {
// contains filtered or unexported fields
}
InMemoryWatermark keep previous operation in memory
func NewInMemoryWatermark ¶
func NewInMemoryWatermark() *InMemoryWatermark
NewInMemoryWatermark create a new Memory watermark
func (*InMemoryWatermark) IsSafeToSign ¶
func (w *InMemoryWatermark) IsSafeToSign(pkh string, msg tezos.UnsignedMessage) bool
IsSafeToSign return true if this msgID is safe to sign
type PublicKey ¶
type PublicKey struct { PublicKey string PublicKeyHash string VaultName string ID string Policy *config.TezosPolicy }
PublicKey contains base58 encoded public key with its hash
type SignInterceptor ¶
type SignInterceptor func(opt *SignInterceptorOptions, sing func() error) error
SignInterceptor is an observer function for signing request
type SignInterceptorOptions ¶
SignInterceptorOptions contains SignInterceptor arguments to avoid confusion
type Signatory ¶
type Signatory struct {
// contains filtered or unexported fields
}
Signatory is a struct coordinate signatory action and select vault according to the key being used
func NewSignatory ¶
NewSignatory returns Signatory instance
func (*Signatory) GetPublicKey ¶
GetPublicKey retrieve the public key from a vault
func (*Signatory) Import ¶
func (s *Signatory) Import(ctx context.Context, importerName string, secretKey string, passCB tezos.PassphraseFunc, opt utils.Options) (*PublicKey, error)
Import a keyPair inside the vault
func (*Signatory) ListPublicKeys ¶
ListPublicKeys retrieve the list of all public keys supported by the current configuration