Documentation ¶
Index ¶
- Constants
- Variables
- func Base58Decode(str string) ([]byte, error)
- func Base58Encode(bz []byte) string
- func Base64Decode(str string) ([]byte, error)
- func Base64Encode(bz []byte) string
- func GenerateChallenge() (challenge protocol.URLEncodedBase64, err error)
- func HexDecode(str string) ([]byte, error)
- func HexEncode(bz []byte) string
- func NewSNRCoins(amt int) sdk.Coins
- func NewUSNRCoins(amt int) sdk.Coins
- type AccountData
- type Algo
- type CoinType
- type EncryptionKey
- type KeyType
- type PubKey
- func NewEd25519PubKey(bz []byte) *PubKey
- func NewPubKey(bz []byte, kt KeyType) *PubKey
- func NewRSAPubKey(bz []byte) *PubKey
- func NewSecp256k1PubKey(pk *secp256k1.PubKey) *PubKey
- func NewWebAuthnPubKey(bz []byte) *PubKey
- func PubKeyFromBytes(bz []byte) (*PubKey, error)
- func PubKeyFromDID(did string) (*PubKey, error)
- type Secp256k1PubKey
Constants ¶
const BTCCoinType = types.CoinType_CoinType_BITCOIN
BTCCoinType is the CoinType for Bitcoin.
const COSMOSCoinType = types.CoinType_CoinType_COSMOS
COSMOSCoinType is the CoinType for Cosmos.
const (
// ChallengeLength - Length of bytes to generate for a challenge
ChallengeLength = 32
)
const DOGECoinType = types.CoinType_CoinType_DOGE
DOGECoinType is the CoinType for Dogecoin.
const ETHCoinType = types.CoinType_CoinType_ETHEREUM
ETHCoinType is the CoinType for Ethereum.
const Ed25519KeyType = types.KeyType_KeyType_ED25519_VERIFICATION_KEY_2018
Ed25519KeyType is the key type for ed25519.
const FILCoinType = types.CoinType_CoinType_FILECOIN
FILCoinType is the CoinType for Filecoin.
const HNSCoinType = types.CoinType_CoinType_HNS
HNSCoinType is the CoinType for Handshake.
const LTCCoinType = types.CoinType_CoinType_LITECOIN
LTCCoinType is the CoinType for Litecoin.
const RSAKeyType = types.KeyType_KeyType_RSA_VERIFICATION_KEY_2018
RSAKeyType is the key type for RSA.
const SOLCoinType = types.CoinType_CoinType_SOLANA
SOLCoinType is the CoinType for Solana.
const SONRCoinType = types.CoinType_CoinType_SONR
SONRCoinType is the CoinType for Sonr.
const Secp256k1KeyType = types.KeyType_KeyType_ECDSA_SECP256K1_VERIFICATION_KEY_2019
Secp256k1KeyType is the key type for secp256k1.
const TestCoinType = types.CoinType_CoinType_TESTNET
TestCoinType is the CoinType for Testnet.
const WebAuthnKeyType = types.KeyType_KeyType_WEB_AUTHN_AUTHENTICATION_2018
WebAuthnKeyType is the key type for WebAuthn.
const XRPCoinType = types.CoinType_CoinType_XRP
XRPCoinType is the CoinType for XRP.
Variables ¶
var AllCoinTypes = types.AllCoinTypes
AllCoinTypes is a slice of all CoinTypes.
Functions ¶
func Base58Decode ¶ added in v0.6.26
Base58Decode takes a base68 encoded string and returns a byte array.
func Base58Encode ¶ added in v0.6.26
Base58Encode takes a byte array and returns a base68 encoded string.
func Base64Decode ¶ added in v0.6.26
Base64Decode takes a base64 encoded string and returns a byte array.
func Base64Encode ¶ added in v0.6.26
Base64Encode takes a byte array and returns a base64 encoded string.
func GenerateChallenge ¶ added in v0.7.3
func GenerateChallenge() (challenge protocol.URLEncodedBase64, err error)
GenerateChallenge creates a new challenge that should be signed and returned by the authenticator. The spec recommends using at least 16 bytes with 100 bits of entropy. We use 32 bytes.
func NewSNRCoins ¶ added in v0.7.3
NewSNRCoins returns a new sdk.Coins object with the given amount of SNR.
func NewUSNRCoins ¶ added in v0.7.3
NewUSNRCoins returns a new sdk.Coins object with the given amount of USNR.
Types ¶
type AccountData ¶ added in v0.7.3
type AccountData = crypto.AccountData
AccountData is the data that is returned by the keygen process. It contains the address, the algorithm used to generate the key pair and the public key.
func NewDefaultAccountData ¶ added in v0.7.3
func NewDefaultAccountData(cointype CoinType, publicKey *PubKey) (*AccountData, error)
NewDefaultAccountData creates a new AccountData with the default values.
type CoinType ¶ added in v0.3.1
CoinType is a type alias for types.CoinType in pkg/crypto/internal/types.
func CoinTypeFromAddrPrefix ¶ added in v0.4.3
CoinTypeFromAddrPrefix returns the CoinType from the public key address prefix (btc, eth).
func CoinTypeFromBipPath ¶ added in v0.4.3
CoinTypeFromBipPath returns the CoinType from the BIP Path (0, 60).
func CoinTypeFromDidMethod ¶ added in v0.4.3
CoinTypeFromDidMethod returns the CoinType from the DID Method (btc, eth).
func CoinTypeFromName ¶ added in v0.4.3
CoinTypeFromName returns the CoinType from the Blockchain name (Bitcoin, Ethereum).
func CoinTypeFromTicker ¶ added in v0.4.3
CoinTypeFromTicker returns the CoinType from the tokens Ticker (BTC, ETH).
type EncryptionKey ¶ added in v0.7.3
type EncryptionKey interface { // Bytes returns the bytes of the encryption key Bytes() []byte // Encrypt encrypts the message with the encryption key Encrypt(msg []byte) ([]byte, error) // Decrypt decrypts the message with the encryption key Decrypt(msg []byte) ([]byte, error) }
EncryptionKey is an interface for encryption keys
type KeyType ¶ added in v0.3.1
KeyType is a type alias for types.KeyType in pkg/crypto/internal/types.
type PubKey ¶
PubKey is a type alias for types.PubKey in pkg/crypto/internal/types.
func NewEd25519PubKey ¶ added in v0.3.1
NewEd25519PubKey takes a byte array of raw public key bytes and returns a PubKey.
func NewRSAPubKey ¶ added in v0.3.1
NewRSAPubKey takes a byte array of raw public key bytes and returns a PubKey.
func NewSecp256k1PubKey ¶ added in v0.3.1
NewSecp256k1PubKey takes a hex string and returns a PubKey
func NewWebAuthnPubKey ¶ added in v0.3.1
NewWebAuthnPubKey takes a byte array of raw public key bytes and returns a PubKey.
func PubKeyFromBytes ¶ added in v0.3.1
PubKeyFromBytes takes a byte array and returns a PubKey
func PubKeyFromDID ¶ added in v0.3.1
PubKeyFromDID takes a string of a DID, decodes it from base58, unmarshals it into a PubKey, and returns the PubKey
type Secp256k1PubKey ¶ added in v0.7.3
Secp256k1PubKey is a type alias for secp256k1.PubKey in pkg/crypto/keys/secp256k1.