Documentation ¶
Index ¶
Constants ¶
View Source
const ( PrivKeyLen = 64 PubKeyLen = 32 SeedLen = 32 AddressLen = 20 SigLen = 64 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PrivateKey ¶
type PrivateKey struct {
// contains filtered or unexported fields
}
func NewPrivateKey ¶
func NewPrivateKey() PrivateKey
func NewPrivateKeyFromBytes ¶
func NewPrivateKeyFromBytes(b []byte) PrivateKey
func NewPrivateKeyFromSeed ¶
func NewPrivateKeyFromSeed(seed []byte) PrivateKey
func NewPrivateKeyFromString ¶
func NewPrivateKeyFromString(str string) PrivateKey
NewPrivateKeyFromString creates a new PrivateKey from a hexadecimal string representation of the private key seed.
The input string must be exactly 64 hexadecimal characters (32 bytes) long, representing the 32-byte private key seed. If the input string is not valid hex or the length is incorrect, the function will log a fatal error.
This function is useful for deserializing a private key from a string representation, such as when reading from a configuration file or other storage.
func (PrivateKey) Bytes ¶
func (p PrivateKey) Bytes() []byte
func (PrivateKey) Public ¶
func (p PrivateKey) Public() PublicKey
func (PrivateKey) Sign ¶
func (p PrivateKey) Sign(msg []byte) Signature
type PublicKey ¶
type PublicKey struct {
// contains filtered or unexported fields
}
func NewPublicKeyFromBytes ¶
type Signature ¶
type Signature struct {
// contains filtered or unexported fields
}
func NewSignatureFromBytes ¶
Click to show internal directories.
Click to hide internal directories.