Defines a cryptography service.
Cryptography configuration options.
public CryptographyOptions Options { get; }
Compares a plain text input with a computed hash.
public Boolean CompareHash(plaintext, hashedtext)
true if the hash matches, otherwhise false.
Name | Type | Summary |
---|---|---|
plaintext | Byte[] | The input to compare with the hash. |
hashedtext | Byte[] | The hash value to compare the input value. to |
Compares a plain text input with a computed hash.
public Boolean CompareHash(provider, plaintext, hashedtext)
true if the hash matches, otherwhise false.
Name | Type | Summary |
---|---|---|
provider | IHashProvider | The HashProvider used to compare. |
plaintext | Byte[] | The input to compare with the hash. |
hashedtext | Byte[] | The hash value to compare with the input value. |
Compares a plain text input with a computed hash.
public Boolean CompareHash(provider, plaintext, hashedtext)
true if the hash matches, otherwhise false.
Name | Type | Summary |
---|---|---|
provider | IHashProvider | The HashProvider used to compare. |
plaintext | String | The input to compare with the hash. |
hashedtext | String | The hash value to compare with the input value. |
Compares a plain text input with a computed hash.
public Boolean CompareHash(plaintext, hashedtext)
true if the hash matches, otherwhise false.
Name | Type | Summary |
---|---|---|
plaintext | String | The input to compare with the hash. |
hashedtext | String | The hash value to compare with the input value. |
Compute the hash value of plain text.
public Byte[] ComputeHash(plaintext)
The computed hash value.
Name | Type | Summary |
---|---|---|
plaintext | Byte[] | The input to compute the hash for. |
Compute the hash value of plain text.
public Byte[] ComputeHash(provider, plaintext)
The computed hash value.
Name | Type | Summary |
---|---|---|
provider | IHashProvider | The HashProvider used to compute the hash. |
plaintext | Byte[] | The input to compute the hash for. |
Computes the hash for the specified stream.
public Byte[] ComputeHash(provider, stream)
A hash code for the specified stream.
Name | Type | Summary |
---|---|---|
provider | IHashProvider | An IHashProvider. |
stream | Stream | The stream to be hashed. |
Compute the hash value of plain text.
public Byte[] ComputeHash(provider, plaintext)
The computed hash value.
Name | Type | Summary |
---|---|---|
provider | IHashProvider | The HashProvider used to compute the hash. |
plaintext | String | The input to compute the hash for. |
Computes the hash for the specified stream.
public Byte[] ComputeHash(stream)
The computed hash value.
Name | Type | Summary |
---|---|---|
stream | Stream | A Stream to compute it's hash. |
Computes the hash value of plain text.
public Byte[] ComputeHash(plaintext)
The computed hash value.
Name | Type | Summary |
---|---|---|
plaintext | String | The input to compute the hash for. |
Decrypts a secret.
public Byte[] Decrypt(ciphertext)
Name | Type | Summary |
---|---|---|
ciphertext | Byte[] | The cipher text to decrypt. |
Type | Summary |
---|---|
CryptographyException | Thrown when an error occurs while transforming the data. |
Decrypts a secret using a specified ISymmetricProvider.
public Byte[] Decrypt(provider, ciphertext)
Name | Type | Summary |
---|---|---|
provider | ISymmetricProvider | The symetric provider to use. |
ciphertext | Byte[] | The cipher text to decrypt. |
Type | Summary |
---|---|
CryptographyException | Thrown when an error occurs while transforming the data. |
Decrypts a ciphered stream using the specified ISymmetricProvider.
public Void Decrypt(provider, source, destination)
Name | Type | Summary |
---|---|---|
provider | ISymmetricProvider | The symmetric provider. |
source | Stream | The source stream to decrypt. |
destination | Stream | The destination stream where the plain text result should be written. |
Type | Summary |
---|---|
CryptographyException | Thrown when an error occurs while transforming the data. |
Decrypts a ciphered text using a specified ISymmetricProvider.
public Byte[] Decrypt(provider, ciphertext)
Name | Type | Summary |
---|---|---|
provider | ISymmetricProvider | The symmetric provider. |
ciphertext | String | The cipher text to decrypt. |
Type | Summary |
---|---|
CryptographyException | Thrown when an error occurs while transforming the data. |
Decrypts a ciphered stream.
public Void Decrypt(source, destination)
Name | Type | Summary |
---|---|---|
source | Stream | The source stream to decrypt. |
destination | Stream | The destination stream where the plain text result should be written. |
Type | Summary |
---|---|
CryptographyException | Thrown when an error occurs while transforming the data. |
Decrypts a ciphered text.
public Byte[] Decrypt(ciphertext)
Name | Type | Summary |
---|---|---|
ciphertext | String | The cipher text to decrypt. |
Type | Summary |
---|---|
CryptographyException | Thrown when an error occurs while transforming the data. |
Decrypts a base 64 encoded ciphered text.
public String DecryptFromBase64String(cipheredtext)
If cipheredtext is null or empty, null is returned.
Name | Type | Summary |
---|---|---|
cipheredtext | String | Ciphered text to be decrypted. |
Type | Summary |
---|---|
CryptographyException | Thrown when an error occurs while transforming the data. |
Encrypts a secret.
public Byte[] Encrypt(plaintext)
Name | Type | Summary |
---|---|---|
plaintext | Byte[] | The input to encrypt. |
Type | Summary |
---|---|
CryptographyException | Thrown when an error occurs while transforming the data. |
Encrypts a secret using a specified ISymmetricProvider.
public Byte[] Encrypt(provider, plaintext)
Name | Type | Summary |
---|---|---|
provider | ISymmetricProvider | The symmetric provider. |
plaintext | Byte[] | The input to encrypt. |
Type | Summary |
---|---|
CryptographyException | Thrown when an error occurs while transforming the data. |
Encrypts the secret in source into destination using the specified ISymmetricProvider.
public Void Encrypt(provider, source, destination)
Name | Type | Summary |
---|---|---|
provider | ISymmetricProvider | The symmetric provider. |
source | Stream | The source stream to encrypt. |
destination | Stream | The destination stream where the ciphered text should be written. |
Type | Summary |
---|---|
CryptographyException | Thrown when an error occurs while transforming the data. |
Encrypts a secret using a specified ISymmetricProvider.
public Byte[] Encrypt(provider, plaintext)
Name | Type | Summary |
---|---|---|
provider | ISymmetricProvider | The symmetric provider. |
plaintext | String | The input to encrypt. |
Type | Summary |
---|---|
CryptographyException | Thrown when an error occurs while transforming the data. |
Encrypts the secret in source into destination.
public Void Encrypt(source, destination)
Name | Type | Summary |
---|---|---|
source | Stream | The source stream to encrypt. |
destination | Stream | The destination stream where the cipher text should be written. |
Type | Summary |
---|---|
CryptographyException | Thrown when an error occurs while transforming the data. |
Encrypts a secret.
public Byte[] Encrypt(plaintext)
Name | Type | Summary |
---|---|---|
plaintext | String | A secret to be encrypted. |
Type | Summary |
---|---|
CryptographyException | Thrown when an error occurs while transforming the data. |
Encrypts a secret and returns the encryption as a Base 64 string.
public String EncryptToBase64String(plaintext)
If plaintext is null or empty, null is returned.
Name | Type | Summary |
---|---|---|
plaintext | String | A secret to be encrypted. |
Type | Summary |
---|---|
CryptographyException | Thrown when an error occurs while transforming the data. |
In this document