WAX Unity Web3 Suite
EosSharp
EosSharp
  • Getting Started
  • Installation
  • Examples
    • Configuration
    • Create Transaction
    • CustomSignProvider
    • CombinedSignersProvider
  • API Docs
    • API Read Methods
      • GetInfo
      • GetAccount
      • GetBlock
      • GetTableRows
      • GetTableByScope
    • Eos
    • HttpHandler
    • Core
      • Api.v1
        • Abi
        • AbiAction
        • AbiBinToJsonRequest
        • AbiBinToJsonResponse
        • AbiField
        • AbiJsonToBinRequest
        • AbiJsonToBinResponse
        • AbiRicardianClause
        • AbiStruct
        • AbiTable
        • AbiType
        • Action
        • ActionTrace
        • ActivedProtocolFeatures
        • Authority
        • AuthorityAccount
        • AuthorityKey
        • AuthorityWait
        • BlockHeader
        • CurrencyStat
        • DetailedTransaction
        • EosApi
        • ExtendedAsset
        • Extension
        • GetAbiRequest
        • GetAbiResponse
        • GetAccountRequest
        • GetAccountResponse
        • GetActionsRequest
        • GetActionsResponse
        • GetBlockHeaderStateRequest
        • GetBlockHeaderStateResponse
        • GetBlockRequest
        • GetBlockResponse
        • GetCodeRequest
        • GetCodeResponse
        • GetControlledAccountsRequest
        • GetControlledAccountsResponse
        • GetCurrencyBalanceRequest
        • GetCurrencyBalanceResponse
        • GetCurrencyStatsRequest
        • GetCurrencyStatsResponse
        • GetInfoResponse
        • GetKeyAccountsRequest
        • GetKeyAccountsResponse
        • GetProducerScheduleResponse
        • GetProducersRequest
        • GetProducersResponse
        • GetRawAbiRequest
        • GetRawAbiResponse
        • GetRawCodeAndAbiRequest
        • GetRawCodeAndAbiResponse
        • GetRequiredKeysRequest
        • GetRequiredKeysResponse
        • GetScheduledTransactionsRequest
        • GetScheduledTransactionsResponse
        • GetTableByScopeRequest
        • GetTableByScopeResponse
        • GetTableRowsRequest
        • GetTableRowsResponse
        • GetTransactionRequest
        • GetTransactionResponse
        • GlobalAction
        • Merkle
        • PackedTransaction
        • Permission
        • PermissionLevel
        • ProcessedTransaction
        • Producer
        • PushTransactionRequest
        • PushTransactionResponse
        • Receipt
        • RefundRequest
        • Resource
        • Schedule
        • ScheduleProducers
        • ScheduledTransaction
        • SelfDelegatedBandwidth
        • SignedBlockHeader
        • Symbol
        • TableByScopeResultRow
        • TotalResources
        • Transaction
        • TransactionReceipt
        • Variant
        • VoterInfo
      • DataAttributes
        • AbiFieldTypeAttribute
      • EosBase
      • EosConfigurator
      • Exceptions
        • ApiError
        • ApiErrorDetail
        • ApiErrorException
        • ApiException
      • Helpers
        • CryptoHelper
          • KeyPair
        • SerializationHelper
      • Interfaces
        • IHttpHandler
        • ISignProvider
      • EosSharp
        • AbiSerializationProvider
        • CombinedSignersProvider
        • DefaultSignProvider
        • IAbiSerializationProvider
      • SignedTransaction
Powered by GitBook
On this page
  • Summary
  • Members
Edit on GitHub
  1. API Docs
  2. Core
  3. Helpers

CryptoHelper

Helper class with crypto functions.

Summary

Members
Descriptions

KeyPair with a private and public key.

Generate a new key pair based on a key type.

Get private key bytes without is checksum.

Convert byte array to encoded public key string.

Convert byte array to encoded private key string.

Convert byte array to encoded signature string.

Convert encoded public key to byte array.

Convert encoded public key to byte array.

Convert encoded signature to byte array.

Convert Pub/Priv key or signature to byte array.

Convert key byte array to encoded generic key.

It takes a 32 byte key and a 16 byte IV, and uses them to encrypt a string

It decrypts the ciphertext using the keyBytes.

It takes a string, a key, and an IV, and returns an encrypted byte array.

It takes a byte array of ciphertext, a byte array of key, and a byte array of IV, and returns a string of plaintext.

Members

KeyPair with a private and public key.

Generate a new key pair based on a key type.

Parameters

  • keyType Optional key type. (sha256x2, R1)

Returns

key pair

Get private key bytes without is checksum.

Parameters

  • privateKey private key

Returns

byte array

Convert byte array to encoded public key string.

Parameters

  • keyBytes public key bytes

  • keyType Optional key type. (sha256x2, R1, K1)

  • prefix Optional prefix to public key

Returns

encoded public key

Convert byte array to encoded private key string.

Parameters

  • keyBytes public key bytes

  • keyType Optional key type. (sha256x2, R1, K1)

  • prefix Optional prefix to public key

Returns

encoded private key

Convert byte array to encoded signature string.

Parameters

  • signBytes signature bytes

  • keyType Optional key type. (sha256x2, R1, K1)

  • prefix Optional prefix to public key

Returns

encoded signature

Convert encoded public key to byte array.

Parameters

  • key encoded public key

  • prefix Optional prefix on key

Returns

public key bytes

Convert encoded public key to byte array.

Parameters

  • key encoded public key

  • prefix Optional prefix on key

Returns

public key bytes

Convert encoded signature to byte array.

Parameters

  • sign encoded signature

Returns

signature bytes

Convert Pub/Priv key or signature to byte array.

Parameters

  • key generic key

  • size Key size

  • keyType Optional key type. (sha256x2, R1, K1)

Returns

key bytes

Convert key byte array to encoded generic key.

Parameters

  • key key byte array

  • keyType Key type. (sha256x2, R1, K1)

  • prefix Optional prefix

Returns

It takes a 32 byte key and a 16 byte IV, and uses them to encrypt a string

Parameters

  • keyBytes The key used to encrypt the data.

  • plainText The text to be encrypted.

Returns

The encrypted text.

It decrypts the ciphertext using the keyBytes.

Parameters

  • keyBytes The key used to encrypt the data.

  • cipherText The encrypted text

Returns

The decrypted string.

It takes a string, a key, and an IV, and returns an encrypted byte array.

Parameters

  • plainText The text to be encrypted.

  • Key The key used to encrypt the data.

  • IV The initialization vector is a random number that is used to encrypt the first block of text in the data. This number is then used in the decryption of the data.

Returns

The encrypted bytes from the memory stream.

It takes a byte array of ciphertext, a byte array of key, and a byte array of IV, and returns a string of plaintext.

Parameters

  • cipherText The encrypted string.

  • Key The key used to encrypt the data.

  • IV The initialization vector. This is a random string of bytes that is used to initialize the encryption algorithm. It is used to ensure that the same plaintext will not always produce the same ciphertext.

Returns

The decrypted string.

PreviousHelpersNextKeyPair

Last updated 2 years ago

class

public static (string keyType)

public static byte[] (string privateKey)

public static string (byte[] keyBytes, string keyType, string prefix)

public static string (byte[] keyBytes, string keyType, string prefix)

public static string (byte[] signBytes, string keyType, string prefix)

public static byte[] (string key, string prefix)

public static byte[] (string key)

public static byte[] (string sign)

public static byte[] (string key, int size, string keyType)

public static string (byte[] key, string keyType, string prefix)

public static byte[] (byte[] keyBytes, string plainText)

public static string (byte[] keyBytes, byte[] cipherText)

public static byte[] (string plainText, byte[] Key, byte[] IV)

public static string (byte[] cipherText, byte[] Key, byte[] IV)

class

public static (string keyType)

public static byte[] (string privateKey)

public static string (byte[] keyBytes, string keyType, string prefix)

public static string (byte[] keyBytes, string keyType, string prefix)

public static string (byte[] signBytes, string keyType, string prefix)

public static byte[] (string key, string prefix)

public static byte[] (string key)

public static byte[] (string sign)

public static byte[] (string key, int size, string keyType)

public static string (byte[] key, string keyType, string prefix)

public static byte[] (byte[] keyBytes, string plainText)

public static string (byte[] keyBytes, byte[] cipherText)

public static byte[] (string plainText, byte[] Key, byte[] IV)

public static string (byte[] cipherText, byte[] Key, byte[] IV)

KeyPair
KeyPair
GenerateKeyPair
GetPrivateKeyBytesWithoutCheckSum
PubKeyBytesToString
PrivKeyBytesToString
SignBytesToString
PubKeyStringToBytes
PrivKeyStringToBytes
SignStringToBytes
StringToKey
KeyToString
AesEncrypt
AesDecrypt
EncryptStringToBytes_Aes
DecryptStringFromBytes_Aes
KeyPair
KeyPair
GenerateKeyPair
GetPrivateKeyBytesWithoutCheckSum
PubKeyBytesToString
PrivKeyBytesToString
SignBytesToString
PubKeyStringToBytes
PrivKeyStringToBytes
SignStringToBytes
StringToKey
KeyToString
AesEncrypt
AesDecrypt
EncryptStringToBytes_Aes
DecryptStringFromBytes_Aes