Class CryptoProvider
Provides real crypto functionality that work on .NET Framework and .NET Core.
Inheritance
CryptoProvider
Assembly: MetaClient.dll
public sealed class CryptoProvider : ICryptoProvider
Constructors
Declaration
public CryptoProvider([CanBeNull] CryptoProvider.RandomProvider sourceOfRandom = null)
Parameters
Type |
Name |
Description |
CryptoProvider.RandomProvider |
sourceOfRandom |
An optional hook to modify where entropy is sourced from. If null , a
secure PRNG will be used.
|
Methods
Declaration
public byte[] DecryptAes(byte[] data, byte[] key, byte[] iv, bool usePadding)
Parameters
Returns
Declaration
public byte[] DecryptRsa(byte[] cipherText, byte[] key)
Parameters
Type |
Name |
Description |
Byte[] |
cipherText |
|
Byte[] |
key |
|
Returns
Declaration
public byte[] EncryptAes(byte[] data, byte[] key, byte[] iv, bool usePadding)
Parameters
Returns
Declaration
public byte[] EncryptRsa(byte[] data, byte[] key)
Parameters
Type |
Name |
Description |
Byte[] |
data |
|
Byte[] |
key |
|
Returns
Declaration
public byte[] GenerateBytes(int count)
Parameters
Type |
Name |
Description |
Int32 |
count |
|
Returns
Declaration
public RsaKeyPair GenerateRsaKeyPair()
Returns
Declaration
public byte[] HmacSha256(byte[] key, byte[] data)
Parameters
Type |
Name |
Description |
Byte[] |
key |
|
Byte[] |
data |
|
Returns
Declaration
public bool IsRsaPrivateKey(byte[] key)
Parameters
Type |
Name |
Description |
Byte[] |
key |
|
Returns
Declaration
public byte[] Pbkdf2HmacSha256(string password, byte[] salt, int iterations, int keyLength)
Parameters
Returns
Declaration
public byte[] Sha1(byte[] data)
Parameters
Type |
Name |
Description |
Byte[] |
data |
|
Returns
Declaration
public byte[] Sha256(byte[] data)
Parameters
Type |
Name |
Description |
Byte[] |
data |
|
Returns
Declaration
public byte[] SignRsa(byte[] data, byte[] key)
Parameters
Type |
Name |
Description |
Byte[] |
data |
|
Byte[] |
key |
|
Returns
Declaration
public bool VerifyRsa(byte[] data, byte[] signature, byte[] key)
Parameters
Type |
Name |
Description |
Byte[] |
data |
|
Byte[] |
signature |
|
Byte[] |
key |
|
Returns
Implements