Documentation ¶
Overview ¶
SPDX-License-Identifier: ISC Copyright (c) 2014-2020 Bitmark Inc. Use of this source code is governed by an ISC license that can be found in the LICENSE file.
SPDX-License-Identifier: ISC Copyright (c) 2014-2020 Bitmark Inc. Use of this source code is governed by an ISC license that can be found in the LICENSE file.
SPDX-License-Identifier: ISC Copyright (c) 2014-2020 Bitmark Inc. Use of this source code is governed by an ISC license that can be found in the LICENSE file.
Index ¶
- Constants
- Variables
- func ValidateAccountNumber(accountNumber string) (err error)
- func Verify(accountNumber string, message, signature []byte) error
- type Account
- type AccountV1
- func (acct *AccountV1) AccountNumber() string
- func (acct *AccountV1) Bytes() []byte
- func (acct *AccountV1) Network() sdk.Network
- func (acct *AccountV1) RecoveryPhrase(lang language.Tag) ([]string, error)
- func (acct *AccountV1) Seed() string
- func (acct *AccountV1) Sign(message []byte) []byte
- func (acct AccountV1) Version() Version
- type AccountV2
- func (acct *AccountV2) AccountNumber() string
- func (acct *AccountV2) Bytes() []byte
- func (acct *AccountV2) Network() sdk.Network
- func (acct *AccountV2) RecoveryPhrase(lang language.Tag) ([]string, error)
- func (acct *AccountV2) Seed() string
- func (acct *AccountV2) Sign(message []byte) []byte
- func (acct AccountV2) Version() Version
- type AsymmetricKey
- type AuthKey
- type ED25519AuthKey
- type EncrKey
- type NaclBoxEncrKey
- func (n NaclBoxEncrKey) Algorithm() int
- func (n NaclBoxEncrKey) Decrypt(ciphertext []byte, peerPublicKey []byte) ([]byte, error)
- func (n NaclBoxEncrKey) Encrypt(plaintext []byte, peerPublicKey []byte) ([]byte, error)
- func (n NaclBoxEncrKey) PrivateKeyBytes() []byte
- func (n NaclBoxEncrKey) PublicKeyBytes() []byte
- type Version
Constants ¶
View Source
const ( ChecksumLength = 4 Base58AccountNumberLength = 37 )
View Source
const ( AlgEd25519 = 1 AlgNaclBox = 2 )
Variables ¶
Functions ¶
func ValidateAccountNumber ¶
Types ¶
type Account ¶
type Account interface { Version() Version Network() sdk.Network Seed() string RecoveryPhrase(language.Tag) ([]string, error) AccountNumber() string Bytes() []byte Sign(message []byte) (signature []byte) }
func FromRecoveryPhrase ¶
type AccountV1 ¶
func NewAccountV1 ¶
func (*AccountV1) AccountNumber ¶
func (*AccountV1) RecoveryPhrase ¶
type AccountV2 ¶
func NewAccountV2 ¶
func (*AccountV2) AccountNumber ¶
func (*AccountV2) RecoveryPhrase ¶
type AsymmetricKey ¶
type AuthKey ¶
type AuthKey interface { AsymmetricKey Sign(message []byte) (signature []byte) }
func NewAuthKey ¶
type ED25519AuthKey ¶
type ED25519AuthKey struct {
// contains filtered or unexported fields
}
func (ED25519AuthKey) Algorithm ¶
func (e ED25519AuthKey) Algorithm() int
func (ED25519AuthKey) PrivateKeyBytes ¶
func (e ED25519AuthKey) PrivateKeyBytes() []byte
func (ED25519AuthKey) PublicKeyBytes ¶
func (e ED25519AuthKey) PublicKeyBytes() []byte
func (ED25519AuthKey) Sign ¶
func (e ED25519AuthKey) Sign(message []byte) []byte
type EncrKey ¶
type EncrKey interface { AsymmetricKey Encrypt(plaintext []byte, peerPublicKey []byte) (ciphertext []byte, err error) Decrypt(ciphertext []byte, peerPublicKey []byte) (plaintext []byte, err error) }
func NewEncrKey ¶
type NaclBoxEncrKey ¶
type NaclBoxEncrKey struct {
// contains filtered or unexported fields
}
func (NaclBoxEncrKey) Algorithm ¶
func (n NaclBoxEncrKey) Algorithm() int
func (NaclBoxEncrKey) Decrypt ¶
func (n NaclBoxEncrKey) Decrypt(ciphertext []byte, peerPublicKey []byte) ([]byte, error)
func (NaclBoxEncrKey) Encrypt ¶
func (n NaclBoxEncrKey) Encrypt(plaintext []byte, peerPublicKey []byte) ([]byte, error)
func (NaclBoxEncrKey) PrivateKeyBytes ¶
func (n NaclBoxEncrKey) PrivateKeyBytes() []byte
func (NaclBoxEncrKey) PublicKeyBytes ¶
func (n NaclBoxEncrKey) PublicKeyBytes() []byte
Click to show internal directories.
Click to hide internal directories.