Show / Hide Table of Contents

Class AsymmetricEncrypter

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

Constructors

| Improve this Doc View Source

AsymmetricEncrypter(KeyPair)

Instantiate with libsodium KeyPair

Declaration
public AsymmetricEncrypter(KeyPair kp)
Parameters
Type Name Description
KeyPair kp

key pair

| Improve this Doc View Source

AsymmetricEncrypter(Byte[])

instantiate with own private key only

Declaration
public AsymmetricEncrypter(byte[] privateKey)
Parameters
Type Name Description
System.Byte[] privateKey

private key

| Improve this Doc View Source

AsymmetricEncrypter(Byte[], Byte[])

Instantiate with private and public key

Declaration
public AsymmetricEncrypter(byte[] privateKey, byte[] publicKey)
Parameters
Type Name Description
System.Byte[] privateKey

private key

System.Byte[] publicKey

public key

| Improve this Doc View Source

AsymmetricEncrypter(String, String)

Instantiate with private and public key

Declaration
public AsymmetricEncrypter(string privateKey, string publicKey)
Parameters
Type Name Description
System.String privateKey

base64 encoded private key

System.String publicKey

base64 encoded public key

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)

decrypt and authenticate a cipher text

Declaration
public string Decrypt(string cipherText, string sendersPublicKey, string nonce)
Parameters
Type Name Description
System.String cipherText

encrypted message as base64 encoded string

System.String sendersPublicKey

public key of sender for authentication as base64 encoded string

System.String nonce

non-secret nonce as base64 encoded string

Returns
Type Description
System.String

decrypted plain text

| 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 for a given public key

Declaration
public EncryptedObjectPublicKeyBox Encrypt(BusinessObject plainObject, string publicKey)
Parameters
Type Name Description
BusinessObject plainObject

unencrypted Business Object

System.String publicKey

recipients public key

Returns
Type Description
EncryptedObjectPublicKeyBox

An encrypted Business Object

| Improve this Doc View Source

Encrypt(String, String)

Encrypt a plain text with a public key

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

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

System.String recipientsPublicKey

public key of receiver

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