mirror of
https://github.com/bitwarden/mobile
synced 2026-01-07 19:13:19 +00:00
attachments page with upload/delete
This commit is contained in:
@@ -260,6 +260,26 @@ namespace Bit.App.Services
|
||||
return Crypto.AesCbcEncrypt(plainBytes, key);
|
||||
}
|
||||
|
||||
public byte[] EncryptToBytes(byte[] plainBytes, SymmetricCryptoKey key = null)
|
||||
{
|
||||
if(key == null)
|
||||
{
|
||||
key = EncKey ?? Key;
|
||||
}
|
||||
|
||||
if(key == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(key));
|
||||
}
|
||||
|
||||
if(plainBytes == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(plainBytes));
|
||||
}
|
||||
|
||||
return Crypto.AesCbcEncryptToBytes(plainBytes, key);
|
||||
}
|
||||
|
||||
public string Decrypt(CipherString encyptedValue, SymmetricCryptoKey key = null)
|
||||
{
|
||||
try
|
||||
|
||||
Reference in New Issue
Block a user