Documentation ¶
Index ¶
- func RandomUint64() uint64
- type Hash
- func (key *Hash) Decode(str string) (err error)
- func (key *Hash) Encode() string
- func (Hash) FromData(data []byte) Hash
- func (Hash) FromString(raw string) (Hash, error)
- func (key Hash) MarshalJSON() ([]byte, error)
- func (key *Hash) MarshalText() (text []byte, err error)
- func (key *Hash) MarshalYAML() (interface{}, error)
- func (key *Hash) Scan(src interface{}) error
- func (key *Hash) String() string
- func (key *Hash) UnmarshalJSON(data []byte) error
- func (key *Hash) UnmarshalText(text []byte) error
- func (key *Hash) UnmarshalYAML(unmarshal func(interface{}) error) error
- func (key Hash) Value() (driver.Value, error)
- type KeyPair
- func (KeyPair) FromSecret(secretKey SecretKey) KeyPair
- func (KeyPair) FromSecretString(secretKeyStr string) (KeyPair, error)
- func (KeyPair) New(key PublicKey, secretKey SecretKey) KeyPair
- func (kp *KeyPair) PublicKey() PublicKey
- func (KeyPair) Random() KeyPair
- func (kp *KeyPair) SecretKey() *SecretKey
- func (kp KeyPair) Sign(data []byte) Signature
- func (kp KeyPair) Verify(data []byte, signature Signature) bool
- type PublicKey
- func (key *PublicKey) Decode(str string) (err error)
- func (key *PublicKey) Encode() string
- func (PublicKey) FromString(raw string) (PublicKey, error)
- func (key PublicKey) MarshalJSON() ([]byte, error)
- func (key *PublicKey) MarshalText() (text []byte, err error)
- func (key *PublicKey) MarshalYAML() (interface{}, error)
- func (PublicKey) New(raw ed25519.PublicKey) PublicKey
- func (key *PublicKey) Scan(src interface{}) error
- func (key *PublicKey) String() string
- func (key *PublicKey) ToPublic() ed25519.PublicKey
- func (key *PublicKey) UnmarshalJSON(data []byte) error
- func (key *PublicKey) UnmarshalText(text []byte) error
- func (key *PublicKey) UnmarshalYAML(unmarshal func(interface{}) error) error
- func (key PublicKey) Value() (driver.Value, error)
- func (key *PublicKey) Verify(data []byte, signature Signature) bool
- type SecretKey
- func (key *SecretKey) Decode(str string) (err error)
- func (key *SecretKey) Encode() string
- func (SecretKey) FromString(raw string) (SecretKey, error)
- func (key *SecretKey) GetPublic() PublicKey
- func (key SecretKey) MarshalJSON() ([]byte, error)
- func (key *SecretKey) MarshalText() (text []byte, err error)
- func (key *SecretKey) MarshalYAML() (interface{}, error)
- func (SecretKey) New(raw ed25519.PrivateKey) SecretKey
- func (key *SecretKey) Scan(src interface{}) error
- func (key *SecretKey) Sign(data []byte) Signature
- func (key *SecretKey) String() string
- func (key *SecretKey) ToPrivate() ed25519.PrivateKey
- func (key *SecretKey) UnmarshalJSON(data []byte) error
- func (key *SecretKey) UnmarshalText(text []byte) error
- func (key *SecretKey) UnmarshalYAML(unmarshal func(interface{}) error) error
- func (key SecretKey) Value() (driver.Value, error)
- type Signature
- func (key *Signature) Decode(str string) error
- func (key *Signature) Encode() string
- func (Signature) FromString(raw string) (Signature, error)
- func (key Signature) MarshalJSON() ([]byte, error)
- func (key *Signature) MarshalText() (text []byte, err error)
- func (key *Signature) MarshalYAML() (interface{}, error)
- func (key *Signature) Scan(src interface{}) error
- func (key *Signature) String() string
- func (key *Signature) UnmarshalJSON(data []byte) error
- func (key *Signature) UnmarshalText(text []byte) error
- func (key *Signature) UnmarshalYAML(unmarshal func(interface{}) error) error
- func (key Signature) Value() (driver.Value, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RandomUint64 ¶
func RandomUint64() uint64
Types ¶
type Hash ¶
Hash is a type-wrapper for exonum.Hash; hex-encoded result of the SHA256. Wrappers implements
func (Hash) FromString ¶
FromString returns new `Hash` decoded from hex string.
func (Hash) MarshalJSON ¶
MarshalJSON convert `Hash` into hex string and than into json.
func (*Hash) MarshalText ¶ added in v0.6.0
MarshalText convert `Hash` into hex string and than into textual representation.
func (*Hash) MarshalYAML ¶ added in v0.6.0
MarshalYAML convert `Hash` into hex string and than into yaml.
func (*Hash) UnmarshalJSON ¶
UnmarshalJSON unmarshal `Hash` from json as a hex string and `Decode`.
func (*Hash) UnmarshalText ¶ added in v0.6.0
UnmarshalText unmarshal `Hash` from textual representation as a hex string and `Decode`.
func (*Hash) UnmarshalYAML ¶ added in v0.6.0
UnmarshalYAML unmarshal `Hash` from yaml as a hex string and `Decode`.
type KeyPair ¶
type KeyPair struct {
// contains filtered or unexported fields
}
func (KeyPair) FromSecret ¶
func (KeyPair) FromSecretString ¶ added in v0.6.0
type PublicKey ¶
PublicKey wrapper on top of `exonum.PublicKey` and `ed25519.PublicKey`
func (PublicKey) FromString ¶
FromString returns new `PublicKey` decoded from hex string.
func (PublicKey) MarshalJSON ¶
MarshalJSON convert `PublicKey` into hex string and than into json.
func (*PublicKey) MarshalText ¶ added in v0.6.0
MarshalText convert `PublicKey` into hex string and than into textual representation.
func (*PublicKey) MarshalYAML ¶ added in v0.6.0
MarshalYAML convert `PublicKey` into hex string and than into yaml.
func (*PublicKey) UnmarshalJSON ¶
UnmarshalJSON unmarshal `PublicKey` from json as a hex string and `Decode`.
func (*PublicKey) UnmarshalText ¶ added in v0.6.0
UnmarshalText unmarshal `PublicKey` from textual representation as a hex string and `Decode`.
func (*PublicKey) UnmarshalYAML ¶ added in v0.6.0
UnmarshalYAML unmarshal `PublicKey` from yaml as a hex string and `Decode`.
type SecretKey ¶
SecretKey wrapper on top of `exonum.SecretKey` and `ed25519.PrivateKey`
func (SecretKey) FromString ¶
FromString returns new `SecretKey` decoded from hex string.
func (SecretKey) MarshalJSON ¶
MarshalJSON convert `SecretKey` into hex string and than into json.
func (*SecretKey) MarshalText ¶ added in v0.6.0
MarshalText convert `SecretKey` into hex string and than into textual representation.
func (*SecretKey) MarshalYAML ¶ added in v0.6.0
MarshalYAML convert `SecretKey` into hex string and than into yaml.
func (SecretKey) New ¶
func (SecretKey) New(raw ed25519.PrivateKey) SecretKey
New returns new `SecretKey`.
func (*SecretKey) ToPrivate ¶
func (key *SecretKey) ToPrivate() ed25519.PrivateKey
ToPrivate cast `key` to `ed25519.PrivateKey`.
func (*SecretKey) UnmarshalJSON ¶
UnmarshalJSON unmarshal `SecretKey` from json as a hex string and `Decode`.
func (*SecretKey) UnmarshalText ¶ added in v0.6.0
UnmarshalText unmarshal `SecretKey` from textual representation as a hex string and `Decode`.
func (*SecretKey) UnmarshalYAML ¶ added in v0.6.0
UnmarshalYAML unmarshal `SecretKey` from yaml as a hex string and `Decode`.
type Signature ¶
type Signature []byte
func (Signature) FromString ¶
FromString returns new `Signature` decoded from hex string.
func (Signature) MarshalJSON ¶
MarshalJSON convert `Signature` into hex string and than into json.
func (*Signature) MarshalText ¶ added in v0.6.0
MarshalText convert `Signature` into hex string and than into textual representation.
func (*Signature) MarshalYAML ¶ added in v0.6.0
MarshalYAML convert `Signature` into hex string and than into yaml.
func (*Signature) UnmarshalJSON ¶
UnmarshalJSON unmarshal `Signature` from json as a hex string and `Decode`.
func (*Signature) UnmarshalText ¶ added in v0.6.0
UnmarshalText unmarshal `Signature` from textual representation as a hex string and `Decode`.
func (*Signature) UnmarshalYAML ¶ added in v0.6.0
UnmarshalYAML unmarshal `Signature` from yaml as a hex string and `Decode`.