Documentation ¶
Index ¶
- Constants
- func Ripemd160checksumHashCurve(in []byte, curve CurveID) []byte
- type CurveID
- type PrivateKey
- func (p *PrivateKey) MarshalJSON() ([]byte, error)
- func (p *PrivateKey) PublicKey() PublicKey
- func (it *PrivateKey) Save(filename string) error
- func (p *PrivateKey) Sign(hash []byte) (out Signature, err error)
- func (p *PrivateKey) String() string
- func (p *PrivateKey) UnmarshalJSON(v []byte) (err error)
- type PublicKey
- type Signature
Constants ¶
View Source
const ( CurveK1 = CurveID(iota) CurveR1 )
View Source
const PrivateKeyPrefix = "PVT_"
View Source
const PublicKeyK1Prefix = "PUB_K1_"
View Source
const PublicKeyPrefix = "PUB_"
View Source
const PublicKeyPrefixCompat = "EVT"
View Source
const PublicKeyR1Prefix = "PUB_R1_"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type PrivateKey ¶
type PrivateKey struct { Curve CurveID // contains filtered or unexported fields }
func LoadPrivateKey ¶
func LoadPrivateKey(filename string) (*PrivateKey, error)
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) MarshalJSON ¶
func (p *PrivateKey) MarshalJSON() ([]byte, error)
func (*PrivateKey) PublicKey ¶
func (p *PrivateKey) PublicKey() PublicKey
func (*PrivateKey) Save ¶
func (it *PrivateKey) Save(filename string) error
func (*PrivateKey) Sign ¶
func (p *PrivateKey) Sign(hash []byte) (out Signature, err error)
Sign signs a 32 bytes SHA256 hash..
func (*PrivateKey) String ¶
func (p *PrivateKey) String() string
func (*PrivateKey) UnmarshalJSON ¶
func (p *PrivateKey) UnmarshalJSON(v []byte) (err error)
type PublicKey ¶
func MustNewPublicKey ¶
func NewPublicKey ¶
func NewPublicKeyFromData ¶
func (PublicKey) MarshalJSON ¶
func (*PublicKey) UnmarshalJSON ¶
type Signature ¶
type Signature struct { Curve CurveID Content []byte // the Compact signature as bytes // contains filtered or unexported fields }
Signature represents a signature for some hash
func NewSignature ¶
func NewSignatureFromData ¶
func (Signature) MarshalJSON ¶
func (*Signature) UnmarshalJSON ¶
Click to show internal directories.
Click to hide internal directories.