types

package
v0.3.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 23, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AddressLastVersion = 0x00
)
View Source
const (
	// EncryptedPrivateKeyLastVersion is the last version of the encrypted private key.
	EncryptedPrivateKeyLastVersion = 0x00
)
View Source
const (
	PublicKeyLastVersion = 0x00
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Address

type Address struct {
	*object.Object
}

Address wraps the Object type to provide additional functionalities.

func NewAddressFromPublicKey

func NewAddressFromPublicKey(pubKey *PublicKey) *Address

NewAddressFromPublicKey creates a new Address from a given PublicKey.

func (*Address) MarshalBinary

func (a *Address) MarshalBinary() ([]byte, error)

MarshalBinary overloads the BinaryMarshaler interface for Address.

func (*Address) MarshalText

func (a *Address) MarshalText() ([]byte, error)

MarshalText overloads the TextMarshaler interface for Address.

func (Address) MarshalYAML

func (a Address) MarshalYAML() (interface{}, error)

Custom YAML marshaller for Address

func (*Address) UnmarshalBinary

func (a *Address) UnmarshalBinary(data []byte) error

UnmarshalBinary overloads the BinaryUnmarshaler interface for Address.

func (*Address) UnmarshalText

func (a *Address) UnmarshalText(text []byte) error

UnmarshalText overloads the TextUnmarshaler interface for Address.

func (*Address) UnmarshalYAML

func (a *Address) UnmarshalYAML(unmarshal func(interface{}) error) error

Custom YAML unmarshaller for Address

type EncryptedPrivateKey

type EncryptedPrivateKey struct {
	*object.Object
}

func (*EncryptedPrivateKey) HasAccess

func (e *EncryptedPrivateKey) HasAccess(password *memguard.LockedBuffer, salt, nonce []byte) bool

HasAccess returns true if the password is valid for the account. It destroys the password.

func (*EncryptedPrivateKey) MarshalBinary

func (e *EncryptedPrivateKey) MarshalBinary() ([]byte, error)

MarshalBinary overloads the BinaryMarshaler interface for EncryptedPrivateKey.

func (*EncryptedPrivateKey) MarshalText

func (e *EncryptedPrivateKey) MarshalText() ([]byte, error)

MarshalText overloads the TextMarshaler interface for EncryptedPrivateKey.

func (EncryptedPrivateKey) MarshalYAML

func (e EncryptedPrivateKey) MarshalYAML() (interface{}, error)

Custom YAML marshaller for EncryptedPrivateKey

func (*EncryptedPrivateKey) PrivateKeyBytesInClear

func (e *EncryptedPrivateKey) PrivateKeyBytesInClear(password *memguard.LockedBuffer, salt, nonce []byte) (*memguard.LockedBuffer, error)

func (*EncryptedPrivateKey) PrivateKeyTextInClear

func (e *EncryptedPrivateKey) PrivateKeyTextInClear(password *memguard.LockedBuffer, salt, nonce []byte) (*memguard.LockedBuffer, error)

PrivateKeyTextInClear returns the private key in clear. Password is destroyed.

func (*EncryptedPrivateKey) PublicKey

func (e *EncryptedPrivateKey) PublicKey(password *memguard.LockedBuffer, salt, nonce []byte) (*PublicKey, error)

PublicKey returns the public key corresponding to the private key. Password is destroyed.

func (*EncryptedPrivateKey) Sign

func (e *EncryptedPrivateKey) Sign(password *memguard.LockedBuffer, salt, nonce, data []byte) ([]byte, error)

Sign signs the given data using the private key. Password is destroyed.

func (*EncryptedPrivateKey) SignWithPrivateKey

func (e *EncryptedPrivateKey) SignWithPrivateKey(privateKey *memguard.LockedBuffer, data []byte) []byte

SignWithPrivateKey signs the given data using the private key. Private key is destroyed.

func (*EncryptedPrivateKey) UnmarshalBinary

func (e *EncryptedPrivateKey) UnmarshalBinary(data []byte) error

UnmarshalBinary overloads the BinaryUnmarshaler interface for EncryptedPrivateKey.

func (*EncryptedPrivateKey) UnmarshalText

func (e *EncryptedPrivateKey) UnmarshalText(text []byte) error

UnmarshalText overloads the TextUnmarshaler interface for EncryptedPrivateKey.

func (*EncryptedPrivateKey) UnmarshalYAML

func (e *EncryptedPrivateKey) UnmarshalYAML(unmarshal func(interface{}) error) error

Custom YAML unmarshaller for EncryptedPrivateKey

type PublicKey

type PublicKey struct {
	*object.Object
}

func (*PublicKey) MarshalBinary

func (p *PublicKey) MarshalBinary() ([]byte, error)

MarshalBinary overloads the BinaryMarshaler interface for PublicKey.

func (*PublicKey) MarshalText

func (p *PublicKey) MarshalText() ([]byte, error)

MarshalText overloads the TextMarshaler interface for PublicKey.

func (PublicKey) MarshalYAML

func (p PublicKey) MarshalYAML() (interface{}, error)

Custom YAML marshaller for PublicKey

func (*PublicKey) UnmarshalBinary

func (p *PublicKey) UnmarshalBinary(data []byte) error

UnmarshalBinary overloads the BinaryUnmarshaler interface for PublicKey.

func (*PublicKey) UnmarshalText

func (p *PublicKey) UnmarshalText(text []byte) error

UnmarshalText overloads the TextUnmarshaler interface for PublicKey.

func (*PublicKey) UnmarshalYAML

func (pk *PublicKey) UnmarshalYAML(unmarshal func(interface{}) error) error

Custom YAML unmarshaller for PublicKey

func (*PublicKey) VerifySignature

func (p *PublicKey) VerifySignature(data, signature []byte) bool

Directories

Path Synopsis
Package object provides functionalities for handling different types of Massa objects.
Package object provides functionalities for handling different types of Massa objects.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL