| LicenseSpring .Net SDK 8.1.0 Easily add Software Licensing to your application

Loading...
Searching...
No Matches
Public Member Functions | Properties | List of all members
LicenseSpring.CryptoProvider Class Reference

Default CryptoProvider class, implements `ICryptoProvider` interface. More...

Inheritance diagram for LicenseSpring.CryptoProvider:

## Public Member Functions
| CryptoProvider ()
| CryptoProvider constructor.
| CryptoProvider (IConfiguration config)
| CryptoProvider constructor, initialize object with data from Configuration.
| CryptoProvider (string key, string salt=null)
| CryptoProvider constructor, initialize object with given key and salt.
string | Decrypt (string encryptedData)
string | Encrypt (string text)

## Properties
string | Key`[get, set]`
| Cryptographic key.
string | Salt`[get, set]`
| Cryptographic salt.
Properties inherited from LicenseSpring.ICryptoProvider

## Detailed Description

Default CryptoProvider class, implements `ICryptoProvider` interface.

## Constructor & Destructor Documentation

## ◆ CryptoProvider() [1/2]

LicenseSpring.CryptoProvider.CryptoProvider | ( | IConfiguration | config | ) |

CryptoProvider constructor, initialize object with data from Configuration.

Parameters

  config | LicenseSpring Configuration

## ◆ CryptoProvider() [2/2]

LicenseSpring.CryptoProvider.CryptoProvider | ( | string | key,
|  | string | salt = `null`
| ) |  |

CryptoProvider constructor, initialize object with given key and salt.

Parameters

  key | Cryptographic key
  salt | Cryptographic salt (optional), if not set default salt will be used.

## Member Function Documentation

## ◆ Decrypt()

string LicenseSpring.CryptoProvider.Decrypt | ( | string | encryptedData | ) |

Decrypt given string.

Parameters

  inputString | The encrypted payload previously produced by Encrypt(string), supplied back byte-for-byte.

Returns
  Decrypted string

Exceptions

  System.ArgumentNullException | In case input data is null or empty or Key property is not set.
  System.IO.InvalidDataException | In case input data is damaged or cannot be read
  System.InvalidOperationException | In case the method was called without prior setting the Key property.

Implements LicenseSpring.ICryptoProvider.

## ◆ Encrypt()

string LicenseSpring.CryptoProvider.Encrypt | ( | string | text | ) |

Encrypt given string.

Parameters

  inputString | String to encrypt

Returns
  The encrypted payload. Depending on the provider this may be an opaque binary byte container rather than printable text; if you persist it, preserve it byte-for-byte (see ILicenseStorage).

Exceptions

  System.InvalidOperationException | In case the method was called without prior setting the Key property.

Implements LicenseSpring.ICryptoProvider.

## Property Documentation

## ◆ Key

string LicenseSpring.CryptoProvider.Key
| get set

Cryptographic key.

Implements LicenseSpring.ICryptoProvider.

## ◆ Salt

string LicenseSpring.CryptoProvider.Salt
| get set

Cryptographic salt.

Implements LicenseSpring.ICryptoProvider.

The documentation for this class was generated from the following file:

- CryptoProvider.cs