NewOrbit / NewOrbit.Azure.KeyVault.Encryption

Helpers for encrypting and signing stuff using Azure Key Vault
0 stars 0 forks source link

API Design #5

Open flytzen opened 2 years ago

flytzen commented 2 years ago

The API should be similar to the following:

public Encryptor Encrypt(string data, Encoding ...);
public Encryptor Encrypt(byte[] data);
public Encryptor Encrypt(ReadOnlySpan<byte> data);
public Encryptor Encrypt(Stream data);

the Encryptor object would then have methods similar to the following:

public string ToBase64String();
public byte ToByteArray();
public Memory<Byte> ToMemory(); ????
public void ToStream(Stream output);

...and similar for decryption. Should give it a nice, clean API without having to worry about all the conversions and all that.