Class ExcelEncryption¶
Namespace: OfficeOpenXml
Assembly: EPPlus.dll
How and if the workbook is encrypted ExcelProtection ExcelSheetProtection
Inheritance¶
Inherited Members¶
object.Equals(object?, object?)
object.Equals(object?)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object?, object?)
object.ToString()
Properties¶
Algorithm¶
Algorithm used for encrypting the package. Default is AES 128-bit for standard and AES 256 for agile
Property Value¶
IsEncrypted¶
Is the package encrypted
Property Value¶
Password¶
The password used to encrypt the workbook.
Property Value¶
Version¶
The version of the encryption.
Property Value¶
Methods¶
DecryptPackage(Stream, string)¶
Decrypts a stream using the office encryption.
Parameters¶
stream Stream
The stream containing the encrypted package.
password string
The password to decrypt with
Returns¶
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¶
stream Stream
The stream containing the non-encrypted package.
password string
The password to encrypt with
encryptionVersion EncryptionVersion
The encryption version
algorithm EncryptionAlgorithm
The algorithm to use for the encryption
Returns¶
A MemoryStream containing the encypted package