Documentation ¶
Index ¶
- Constants
- Variables
- type PrivateKey
- func (k *PrivateKey) Address() ids.ShortID
- func (k *PrivateKey) Bytes() []byte
- func (k *PrivateKey) MarshalJSON() ([]byte, error)
- func (k *PrivateKey) MarshalText() ([]byte, error)
- func (k *PrivateKey) PublicKey() *PublicKey
- func (k *PrivateKey) Sign(msg []byte) ([]byte, error)
- func (k *PrivateKey) SignHash(hash []byte) ([]byte, error)
- func (k *PrivateKey) String() string
- func (k *PrivateKey) ToECDSA() *stdecdsa.PrivateKey
- func (k *PrivateKey) UnmarshalJSON(b []byte) error
- func (k *PrivateKey) UnmarshalText(text []byte) error
- type PublicKey
- type RecoverCache
Constants ¶
View Source
const ( // SignatureLen is the number of bytes in a secp2561k recoverable signature SignatureLen = 65 // PrivateKeyLen is the number of bytes in a secp2561k recoverable private // key PrivateKeyLen = 32 // PublicKeyLen is the number of bytes in a secp2561k recoverable public key PublicKeyLen = 33 PrivateKeyPrefix = "PrivateKey-" )
Variables ¶
View Source
var (
ErrInvalidSig = errors.New("invalid signature")
)
Functions ¶
This section is empty.
Types ¶
type PrivateKey ¶
type PrivateKey struct {
// contains filtered or unexported fields
}
func NewPrivateKey ¶ added in v1.10.15
func NewPrivateKey() (*PrivateKey, error)
func TestKeys ¶
func TestKeys() []*PrivateKey
func ToPrivateKey ¶ added in v1.10.15
func ToPrivateKey(b []byte) (*PrivateKey, error)
func (*PrivateKey) Address ¶
func (k *PrivateKey) Address() ids.ShortID
func (*PrivateKey) Bytes ¶
func (k *PrivateKey) Bytes() []byte
func (*PrivateKey) MarshalJSON ¶
func (k *PrivateKey) MarshalJSON() ([]byte, error)
func (*PrivateKey) MarshalText ¶
func (k *PrivateKey) MarshalText() ([]byte, error)
func (*PrivateKey) PublicKey ¶
func (k *PrivateKey) PublicKey() *PublicKey
func (*PrivateKey) String ¶
func (k *PrivateKey) String() string
func (*PrivateKey) ToECDSA ¶
func (k *PrivateKey) ToECDSA() *stdecdsa.PrivateKey
ToECDSA returns the ecdsa representation of this private key
func (*PrivateKey) UnmarshalJSON ¶
func (k *PrivateKey) UnmarshalJSON(b []byte) error
func (*PrivateKey) UnmarshalText ¶
func (k *PrivateKey) UnmarshalText(text []byte) error
type PublicKey ¶
type PublicKey struct {
// contains filtered or unexported fields
}
func RecoverPublicKey ¶ added in v1.10.15
func RecoverPublicKeyFromHash ¶ added in v1.10.15
func ToPublicKey ¶ added in v1.10.15
func (*PublicKey) VerifyHash ¶
type RecoverCache ¶ added in v1.10.15
func (*RecoverCache) RecoverPublicKey ¶ added in v1.10.15
func (r *RecoverCache) RecoverPublicKey(msg, sig []byte) (*PublicKey, error)
func (*RecoverCache) RecoverPublicKeyFromHash ¶ added in v1.10.15
func (r *RecoverCache) RecoverPublicKeyFromHash(hash, sig []byte) (*PublicKey, error)
Click to show internal directories.
Click to hide internal directories.