Show / Hide Table of Contents

Class EncryptionServiceExtensions

An encryption service extensions.

Inheritance
System.Object
EncryptionServiceExtensions
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Kephas.Cryptography
Assembly: Kephas.Core.dll
Syntax
public static class EncryptionServiceExtensions

Methods

| Improve this Doc View Source

Decrypt(IEncryptionService, Byte[], IEncryptionContext)

Decrypts the input bytes and returns the decrypted bytes.

Declaration
public static byte[] Decrypt(this IEncryptionService encryptionService, byte[] input, IEncryptionContext context = null)
Parameters
Type Name Description
IEncryptionService encryptionService

The encryption service to act on.

System.Byte[] input

The input bytes.

IEncryptionContext context

The encryption context (optional).

Returns
Type Description
System.Byte[]

The decrypted bytes.

| Improve this Doc View Source

Decrypt(IEncryptionService, String, IEncryptionContext)

Decrypts the input string and returns the decrypted string.

Declaration
public static string Decrypt(this IEncryptionService encryptionService, string input, IEncryptionContext context = null)
Parameters
Type Name Description
IEncryptionService encryptionService

The encryption service to act on.

System.String input

The Base64 encoded input string.

IEncryptionContext context

The encryption context (optional).

Returns
Type Description
System.String

A promise of the decrypted string.

| Improve this Doc View Source

DecryptAsync(IEncryptionService, Byte[], IEncryptionContext, CancellationToken)

Decrypts the input bytes and returns a promise of the decrypted bytes.

Declaration
public static Task<byte[]> DecryptAsync(this IEncryptionService encryptionService, byte[] input, IEncryptionContext context = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
IEncryptionService encryptionService

The encryption service to act on.

System.Byte[] input

The input bytes.

IEncryptionContext context

The encryption context (optional).

System.Threading.CancellationToken cancellationToken

The cancellation token (optional).

Returns
Type Description
System.Threading.Tasks.Task<System.Byte[]>

A promise of a decrypted bytes.

| Improve this Doc View Source

DecryptAsync(IEncryptionService, String, IEncryptionContext, CancellationToken)

Decrypts the input Base64 encoded string and returns a promise of the decrypted string.

Declaration
public static Task<string> DecryptAsync(this IEncryptionService encryptionService, string input, IEncryptionContext context = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
IEncryptionService encryptionService

The encryption service to act on.

System.String input

The Base64 encoded input string.

IEncryptionContext context

The encryption context (optional).

System.Threading.CancellationToken cancellationToken

The cancellation token (optional).

Returns
Type Description
System.Threading.Tasks.Task<System.String>

A promise of a decrypted string.

| Improve this Doc View Source

Encrypt(IEncryptionService, Byte[], IEncryptionContext)

Encrypts the input bytes and returns the encrypted bytes.

Declaration
public static byte[] Encrypt(this IEncryptionService encryptionService, byte[] input, IEncryptionContext context = null)
Parameters
Type Name Description
IEncryptionService encryptionService

The encryption service to act on.

System.Byte[] input

The input bytes.

IEncryptionContext context

The encryption context (optional).

Returns
Type Description
System.Byte[]

The encrypted bytes.

| Improve this Doc View Source

Encrypt(IEncryptionService, String, IEncryptionContext)

Encrypts the input string and returns the encrypted string (Base64 encoded).

Declaration
public static string Encrypt(this IEncryptionService encryptionService, string input, IEncryptionContext context = null)
Parameters
Type Name Description
IEncryptionService encryptionService

The encryption service to act on.

System.String input

The input string.

IEncryptionContext context

The encryption context (optional).

Returns
Type Description
System.String

The Base64 encoded encrypted bytes.

| Improve this Doc View Source

EncryptAsync(IEncryptionService, Byte[], IEncryptionContext, CancellationToken)

Encrypts the input bytes and returns a promise of the encrypted bytes.

Declaration
public static Task<byte[]> EncryptAsync(this IEncryptionService encryptionService, byte[] input, IEncryptionContext context = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
IEncryptionService encryptionService

The encryption service to act on.

System.Byte[] input

The input bytes.

IEncryptionContext context

The encryption context (optional).

System.Threading.CancellationToken cancellationToken

The cancellation token (optional).

Returns
Type Description
System.Threading.Tasks.Task<System.Byte[]>

A promise of the encrypted bytes.

| Improve this Doc View Source

EncryptAsync(IEncryptionService, String, IEncryptionContext, CancellationToken)

Encrypts the input string and returns a promise of the encrypted string (Base64 encoded).

Declaration
public static Task<string> EncryptAsync(this IEncryptionService encryptionService, string input, IEncryptionContext context = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
IEncryptionService encryptionService

The encryption service to act on.

System.String input

The input string.

IEncryptionContext context

The encryption context (optional).

System.Threading.CancellationToken cancellationToken

The cancellation token (optional).

Returns
Type Description
System.Threading.Tasks.Task<System.String>

A promise of the encrypted bytes (Base64 encoded).

  • Improve this Doc
  • View Source
Back to top Generated by DocFX