# OfficePackageSecurityOptions

Resource limits and active-content policy applied before a document loader opens a package.

Class 

`OfficeIMO`

**Namespace**

`OfficeIMO`

**Assembly**

`OfficeIMO.Core`

**Source revision**

`ba882f6b0d07` with working tree changes

**Source**

[OfficePackageSecurity.cs:66](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Documents/OfficePackageSecurity.cs#L66)

**Modifiers**

sealed

Resource limits and active-content policy applied before a document loader opens a package.

## Inheritance

- object
- OfficePackageSecurityOptions

## Usage

Explore 5 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

### Returned or exposed by 3

- Property [DocumentLoadOptions.PackageSecurity](/api/core/officeimo-documentloadoptions/#property-packagesecurity)
- Property [OfficePackageSecurityOptions.SecureDefaults](/api/core/officeimo-officepackagesecurityoptions/#property-securedefaults)
- Property [OfficePackageSecurityOptions.UntrustedDefaults](/api/core/officeimo-officepackagesecurityoptions/#property-untrusteddefaults)

### Accepted by parameters 2

- Method [OfficePackageSecurityInspector.Inspect](/api/core/officeimo-officepackagesecurityinspector/#method-inspect-byte-officeimo-officepackagesecurityoptions) parameter `options`
- Method [OfficePackageSecurityInspector.Validate](/api/core/officeimo-officepackagesecurityinspector/#method-validate-byte-officeimo-officepackagesecurityoptions) parameter `options`

Filter members 

Show inherited

## Constructors

`public OfficePackageSecurityOptions()` [#](#constructor-ctor)

[OfficePackageSecurity.cs:66](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Documents/OfficePackageSecurity.cs#L66)

## Inherited Methods

`public virtual bool Equals(object? obj)` [#](#method-equals-object)

Inherited from object

Parameters

**obj object? required**

Returns

`bool`

`public virtual int GetHashCode()` [#](#method-gethashcode)

Inherited from object

Returns

`int`

`public Type GetType()` [#](#method-gettype)

Inherited from object

Returns

`Type`

`public virtual string? ToString()` [#](#method-tostring)

Inherited from object

Returns

`string?`

## Properties

`public long MaxPackageBytes { get; set; }` [#](#property-maxpackagebytes)

[OfficePackageSecurity.cs:66](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Documents/OfficePackageSecurity.cs#L66)

Maximum complete source size. Defaults to 512 MiB.

`public int MaxPartCount { get; set; }` [#](#property-maxpartcount)

[OfficePackageSecurity.cs:69](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Documents/OfficePackageSecurity.cs#L69)

Maximum number of raw ZIP entries (including directories) or compound directory entries. Defaults to 10,000.

`public int MaxRelationships { get; set; }` [#](#property-maxrelationships)

[OfficePackageSecurity.cs:72](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Documents/OfficePackageSecurity.cs#L72)

Maximum number of relationship records across all parts. Defaults to 10,000.

`public long MaxPartUncompressedBytes { get; set; }` [#](#property-maxpartuncompressedbytes)

[OfficePackageSecurity.cs:75](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Documents/OfficePackageSecurity.cs#L75)

Maximum uncompressed size of one part. Defaults to 256 MiB.

`public long MaxXmlCharactersInPart { get; set; }` [#](#property-maxxmlcharactersinpart)

[OfficePackageSecurity.cs:78](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Documents/OfficePackageSecurity.cs#L78)

Maximum XML characters parsed from one package metadata part. Defaults to 256 MiB.

`public long MaxTotalUncompressedBytes { get; set; }` [#](#property-maxtotaluncompressedbytes)

[OfficePackageSecurity.cs:81](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Documents/OfficePackageSecurity.cs#L81)

Maximum aggregate uncompressed part size. Defaults to 1 GiB.

`public double MaxCompressionRatio { get; set; }` [#](#property-maxcompressionratio)

[OfficePackageSecurity.cs:84](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Documents/OfficePackageSecurity.cs#L84)

Maximum uncompressed-to-compressed ratio for a non-empty ZIP part. Defaults to 1,000.

`public OfficePackageContentPolicy Macros { get; set; }` [#](#property-macros)

[OfficePackageSecurity.cs:87](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Documents/OfficePackageSecurity.cs#L87)

Policy for VBA projects.

`public OfficePackageContentPolicy EmbeddedPayloads { get; set; }` [#](#property-embeddedpayloads)

[OfficePackageSecurity.cs:90](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Documents/OfficePackageSecurity.cs#L90)

Policy for embedded OLE objects and package payloads.

`public OfficePackageContentPolicy ActiveX { get; set; }` [#](#property-activex)

[OfficePackageSecurity.cs:93](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Documents/OfficePackageSecurity.cs#L93)

Policy for ActiveX controls.

`public OfficePackageContentPolicy ExternalRelationships { get; set; }` [#](#property-externalrelationships)

[OfficePackageSecurity.cs:96](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Documents/OfficePackageSecurity.cs#L96)

Policy for relationships whose target mode is external.

`public static OfficePackageSecurityOptions SecureDefaults { get; }` [#](#property-securedefaults)

[OfficePackageSecurity.cs:99](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Documents/OfficePackageSecurity.cs#L99)

Creates structural package-bomb limits while retaining active-content compatibility.

`public static OfficePackageSecurityOptions UntrustedDefaults { get; }` [#](#property-untrusteddefaults)

[OfficePackageSecurity.cs:102](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Documents/OfficePackageSecurity.cs#L102)

Creates structural limits and rejects active, embedded, and externally linked content.

<!-- PowerForge markdown artifact sha256:667C7027D1E7A27473D87B1122EA525B34517AF69EFDFD574469AD49B515BFCA -->
