Documentation ¶
Index ¶
- Constants
- Variables
- type KeyAlgorithmSetting
- type PrivateKey
- func GeneratePrivateKey(algorithm keyAlgorithm) (PrivateKey, error)
- func NewPrivateKeyED25518(path string) (PrivateKey, error)
- func NewPrivateKeyFromFile(path string, algorithm keyAlgorithm) (PrivateKey, error)
- func NewPrivateKeyFromPEM(content []byte, algorithm keyAlgorithm) (PrivateKey, error)
- func NewPrivateKeySECP256K1(path string) (PrivateKey, error)
- type PrivateKeyInternal
- type PublicKey
- func (v PublicKey) AccountHash() key.AccountHash
- func (v PublicKey) Bytes() []byte
- func (v PublicKey) Equals(target PublicKey) bool
- func (v *PublicKey) GobDecode(i []byte) error
- func (v PublicKey) GobEncode() ([]byte, error)
- func (v PublicKey) MarshalJSON() ([]byte, error)
- func (v *PublicKey) Scan(value interface{}) error
- func (v PublicKey) String() string
- func (v PublicKey) ToHex() string
- func (v *PublicKey) UnmarshalJSON(data []byte) error
- func (v PublicKey) Value() (driver.Value, error)
- func (v PublicKey) VerifyRawSignature(message []byte, sig []byte) error
- func (v PublicKey) VerifySignature(message []byte, sig []byte) error
- type PublicKeyInternal
- type PublicKeyList
Constants ¶
View Source
const ( ED25519 keyAlgorithm = 1 SECP256K1 keyAlgorithm = 2 )
Variables ¶
View Source
var ( ErrEmptySignature = errors.New("empty signature") ErrInvalidPublicKeyAlgo = errors.New("invalid public key algorithm") ErrInvalidSignature = errors.New("invalid signature") ErrEmptyPublicKey = errors.New("empty public key") )
View Source
var KeySettings = map[keyAlgorithm]KeyAlgorithmSetting{ ED25519: { // contains filtered or unexported fields }, SECP256K1: { // contains filtered or unexported fields }, }
Functions ¶
This section is empty.
Types ¶
type KeyAlgorithmSetting ¶
type KeyAlgorithmSetting struct {
// contains filtered or unexported fields
}
type PrivateKey ¶
type PrivateKey struct {
// contains filtered or unexported fields
}
func GeneratePrivateKey ¶
func GeneratePrivateKey(algorithm keyAlgorithm) (PrivateKey, error)
func NewPrivateKeyED25518 ¶
func NewPrivateKeyED25518(path string) (PrivateKey, error)
func NewPrivateKeyFromFile ¶
func NewPrivateKeyFromFile(path string, algorithm keyAlgorithm) (PrivateKey, error)
func NewPrivateKeyFromPEM ¶
func NewPrivateKeyFromPEM(content []byte, algorithm keyAlgorithm) (PrivateKey, error)
func NewPrivateKeySECP256K1 ¶
func NewPrivateKeySECP256K1(path string) (PrivateKey, error)
func (PrivateKey) PublicKey ¶
func (v PrivateKey) PublicKey() PublicKey
func (PrivateKey) RawSign ¶
func (v PrivateKey) RawSign(mes []byte) ([]byte, error)
RawSign returns raw bytes of signature to sign off chain data Deprecated: won't work with Casper node, use Sign method instead
func (PrivateKey) Sign ¶
func (v PrivateKey) Sign(msg []byte) ([]byte, error)
Sign creates a Casper compatible cryptographic signature, including the algorithm tag prefix
func (PrivateKey) ToPem ¶
func (v PrivateKey) ToPem() ([]byte, error)
type PrivateKeyInternal ¶
type PublicKey ¶
type PublicKey struct {
// contains filtered or unexported fields
}
func NewPublicKey ¶
func NewPublicKeyFromBytes ¶
func (PublicKey) AccountHash ¶
func (v PublicKey) AccountHash() key.AccountHash
func (PublicKey) MarshalJSON ¶
func (*PublicKey) UnmarshalJSON ¶
func (PublicKey) VerifyRawSignature ¶
VerifyRawSignature verifies message using raw signature Deprecated: won't work with Casper node, use VerifySignature method to achieve compatibility
type PublicKeyInternal ¶
type PublicKeyList ¶
type PublicKeyList []PublicKey
func (PublicKeyList) Contains ¶
func (p PublicKeyList) Contains(target PublicKey) bool
Click to show internal directories.
Click to hide internal directories.