Show / Hide Table of Contents

Class SymmetricEncrypter

Inheritance
System.Object
Encrypter
SymmetricEncrypter
Inherited Members
Encrypter._logger
Namespace: BO4E.Extensions.Encryption
Assembly: BO4E-dotnet.Extensions.Encryption.dll
Syntax
public class SymmetricEncrypter : Encrypter

Constructors

| Improve this Doc View Source

SymmetricEncrypter(Byte[])

pass the secret encryption key to the constructor

Declaration
public SymmetricEncrypter(byte[] secretKey)
Parameters
Type Name Description
System.Byte[] secretKey

secret key

| Improve this Doc View Source

SymmetricEncrypter(String)

pass the secret key as base64 encoded string to the constructor

Declaration
public SymmetricEncrypter(string secretKey)
Parameters
Type Name Description
System.String secretKey

secret key as base64 encoded string

Methods

| Improve this Doc View Source

Decrypt(EncryptedObject)

Declaration
public override BusinessObject Decrypt(EncryptedObject encryptedObject)
Parameters
Type Name Description
EncryptedObject encryptedObject
Returns
Type Description
BusinessObject
Overrides
Encrypter.Decrypt(EncryptedObject)
| Improve this Doc View Source

Decrypt(String, String, String)

Declaration
public string Decrypt(string cipherText, string associatedData, string nonceString)
Parameters
Type Name Description
System.String cipherText
System.String associatedData
System.String nonceString
Returns
Type Description
System.String
| Improve this Doc View Source

Decrypt<T>(EncryptedObject)

Declaration
public override T Decrypt<T>(EncryptedObject encryptedObject)
    where T : BusinessObject
Parameters
Type Name Description
EncryptedObject encryptedObject
Returns
Type Description
T
Type Parameters
Name Description
T
Overrides
Encrypter.Decrypt<T>(EncryptedObject)
| Improve this Doc View Source

Dispose()

Declaration
public override void Dispose()
Overrides
Encrypter.Dispose()
| Improve this Doc View Source

Encrypt(BusinessObject, String)

Encrypt a Business Object

Declaration
public EncryptedObjectAEAD Encrypt(BusinessObject plainObject, string associatedDataString)
Parameters
Type Name Description
BusinessObject plainObject

unencrypted Business Object

System.String associatedDataString
Returns
Type Description
EncryptedObjectAEAD

an encrypted Business Object

| Improve this Doc View Source

Encrypt(String, String)

Encrypt a given plain text and add associated data.

Declaration
public (string, string) Encrypt(string plainText, string associatedDataString)
Parameters
Type Name Description
System.String plainText

UTF-8 encoded string containing the plain text to be encrypted

System.String associatedDataString

max. 16 character long string (not secret)

Returns
Type Description
System.ValueTuple<System.String, System.String>

Tuple of (cipherText, nonce); both as base64 encoded string

| Improve this Doc View Source

Finalize()

Declaration
protected void Finalize()

Extension Methods

BusinessObjectExtensions.DeepClone<T>(T)
COMExtensions.DeepClone<T>(T)
  • Improve this Doc
  • View Source
Back to top Generated by DocFX