Class ExcelEncryption
- Namespace
- OfficeOpenXml
- Assembly
- EPPlus.dll
How and if the workbook is encrypted ExcelProtection ExcelSheetProtection
public class ExcelEncryption
- Inheritance
-
ExcelEncryption
- Inherited Members
Properties
Algorithm
Algorithm used for encrypting the package. Default is AES 128-bit for standard and AES 256 for agile
public EncryptionAlgorithm Algorithm { get; set; }
Property Value
IsEncrypted
Is the package encrypted
public bool IsEncrypted { get; set; }
Property Value
Password
The password used to encrypt the workbook.
public string Password { get; set; }
Property Value
Version
The version of the encryption.
public EncryptionVersion Version { get; set; }
Property Value
Methods
DecryptPackage(Stream, string)
Decrypts a stream using the office encryption.
public static MemoryStream DecryptPackage(Stream stream, string password)
Parameters
streamStreamThe stream containing the encrypted package.
passwordstringThe password to decrypt with
Returns
- MemoryStream
A memorystream with the encypted package
EncryptPackage(Stream, string, EncryptionVersion, EncryptionAlgorithm)
Encrypts a stream using the office encryption.
public static MemoryStream EncryptPackage(Stream stream, string password, EncryptionVersion encryptionVersion = EncryptionVersion.Agile, EncryptionAlgorithm algorithm = EncryptionAlgorithm.AES256)
Parameters
streamStreamThe stream containing the non-encrypted package.
passwordstringThe password to encrypt with
encryptionVersionEncryptionVersionThe encryption version
algorithmEncryptionAlgorithmThe algorithm to use for the encryption
Returns
- MemoryStream
A MemoryStream containing the encypted package