Show / Hide Table of Contents

Class CryptoProvider

Provides real crypto functionality that work on .NET Framework and .NET Core.

Inheritance
Object
CryptoProvider
Implements
ICryptoProvider
Inherited Members
Object.Equals(Object)
Object.Equals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Object.ReferenceEquals(Object, Object)
Object.ToString()
Namespace: PKWARE.Smartcrypt.MetaClient
Assembly: MetaClient.dll
Syntax
public sealed class CryptoProvider : ICryptoProvider

Constructors

CryptoProvider(CryptoProvider.RandomProvider)

Initializes a new instance of the CryptoProvider class.

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

DecryptAes(Byte[], Byte[], Byte[], Boolean)

Declaration
public byte[] DecryptAes(byte[] data, byte[] key, byte[] iv, bool usePadding)
Parameters
Type Name Description
Byte[] data
Byte[] key
Byte[] iv
Boolean usePadding
Returns
Type Description
Byte[]

DecryptRsa(Byte[], Byte[])

Declaration
public byte[] DecryptRsa(byte[] cipherText, byte[] key)
Parameters
Type Name Description
Byte[] cipherText
Byte[] key
Returns
Type Description
Byte[]

EncryptAes(Byte[], Byte[], Byte[], Boolean)

Declaration
public byte[] EncryptAes(byte[] data, byte[] key, byte[] iv, bool usePadding)
Parameters
Type Name Description
Byte[] data
Byte[] key
Byte[] iv
Boolean usePadding
Returns
Type Description
Byte[]

EncryptRsa(Byte[], Byte[])

Declaration
public byte[] EncryptRsa(byte[] data, byte[] key)
Parameters
Type Name Description
Byte[] data
Byte[] key
Returns
Type Description
Byte[]

GenerateBytes(Int32)

Declaration
public byte[] GenerateBytes(int count)
Parameters
Type Name Description
Int32 count
Returns
Type Description
Byte[]

GenerateRsaKeyPair()

Declaration
public RsaKeyPair GenerateRsaKeyPair()
Returns
Type Description
RsaKeyPair

HmacSha256(Byte[], Byte[])

Declaration
public byte[] HmacSha256(byte[] key, byte[] data)
Parameters
Type Name Description
Byte[] key
Byte[] data
Returns
Type Description
Byte[]

IsRsaPrivateKey(Byte[])

Declaration
public bool IsRsaPrivateKey(byte[] key)
Parameters
Type Name Description
Byte[] key
Returns
Type Description
Boolean

Pbkdf2HmacSha256(String, Byte[], Int32, Int32)

Declaration
public byte[] Pbkdf2HmacSha256(string password, byte[] salt, int iterations, int keyLength)
Parameters
Type Name Description
String password
Byte[] salt
Int32 iterations
Int32 keyLength
Returns
Type Description
Byte[]

Sha1(Byte[])

Declaration
public byte[] Sha1(byte[] data)
Parameters
Type Name Description
Byte[] data
Returns
Type Description
Byte[]

Sha256(Byte[])

Declaration
public byte[] Sha256(byte[] data)
Parameters
Type Name Description
Byte[] data
Returns
Type Description
Byte[]

SignRsa(Byte[], Byte[])

Declaration
public byte[] SignRsa(byte[] data, byte[] key)
Parameters
Type Name Description
Byte[] data
Byte[] key
Returns
Type Description
Byte[]

VerifyRsa(Byte[], Byte[], Byte[])

Declaration
public bool VerifyRsa(byte[] data, byte[] signature, byte[] key)
Parameters
Type Name Description
Byte[] data
Byte[] signature
Byte[] key
Returns
Type Description
Boolean

Implements

ICryptoProvider
Back to top Copyright © 2018 PKWARE, Inc.