Documentation ¶
Index ¶
- Constants
- type PrivateKey
- type PublicKey
- func (p PublicKey) Key() (*btcec.PublicKey, error)
- func (p PublicKey) MarshalBinary() ([]byte, error)
- func (p PublicKey) MarshalJSON() ([]byte, error)
- func (p PublicKey) String() string
- func (p PublicKey) ToHex() string
- func (p *PublicKey) UnmarshalBinary(data []byte) (err error)
- func (a PublicKey) UnmarshalBinarySize() int
- func (p *PublicKey) UnmarshalJSON(data []byte) error
- type Signature
- func (a Signature) MarshalBinary() ([]byte, error)
- func (a Signature) MarshalJSON() ([]byte, error)
- func (s Signature) PublicKey(hash []byte) (PublicKey, error)
- func (s Signature) String() string
- func (a *Signature) UnmarshalBinary(data []byte) error
- func (a *Signature) UnmarshalBinarySize() int
- func (a *Signature) UnmarshalJSON(data []byte) (err error)
- func (s Signature) Verify(hash []byte, pubKey PublicKey) bool
Constants ¶
View Source
const PublicKeyPrefix = "EOS"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PrivateKey ¶
type PrivateKey struct {
// contains filtered or unexported fields
}
func NewDeterministicPrivateKey ¶
func NewDeterministicPrivateKey(randSource io.Reader) (*PrivateKey, error)
func NewPrivateKey ¶
func NewPrivateKey(wif string) (*PrivateKey, error)
func NewRandomPrivateKey ¶
func NewRandomPrivateKey() (*PrivateKey, error)
func (*PrivateKey) PublicKey ¶
func (p *PrivateKey) PublicKey() PublicKey
func (*PrivateKey) Sign ¶
func (p *PrivateKey) Sign(hash []byte) (Signature, error)
Sign signs a 32 bytes SHA256 hash..
func (*PrivateKey) String ¶
func (p *PrivateKey) String() string
type PublicKey ¶
type PublicKey []byte
func MustNewPublicKey ¶
func NewPublicKey ¶
func (PublicKey) MarshalBinary ¶
func (PublicKey) MarshalJSON ¶
func (*PublicKey) UnmarshalBinary ¶
func (PublicKey) UnmarshalBinarySize ¶
func (*PublicKey) UnmarshalJSON ¶
type Signature ¶
type Signature []byte
Signature represents a signature for some hash
func NewSignature ¶
func (Signature) MarshalBinary ¶
func (Signature) MarshalJSON ¶
func (Signature) PublicKey ¶
PublicKey retrieves the public key, but requires the payload.. that's the way to validate the signature. Use Verify() if you only want to validate.
func (*Signature) UnmarshalBinary ¶
func (*Signature) UnmarshalBinarySize ¶
func (*Signature) UnmarshalJSON ¶
Click to show internal directories.
Click to hide internal directories.