Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/

API Reference

Class

OfficeContentSafetyInputGuard

Namespace OfficeIMO.ContentSafety
Assembly OfficeIMO.Core
Modifiers static

Applies encoded and package-expansion limits before format parsers allocate decoded content.

Inheritance

  • Object
  • OfficeContentSafetyInputGuard

Methods

ReadAllBytes 2 overloads
public static Byte[] ReadAllBytes(String filePath, OfficeContentSafetyOptions options, Boolean inspectZipPackage = false) #
Returns: Byte[]

Reads a file only after validating its encoded length and, when applicable, ZIP package metadata.

Parameters

filePath System.String requiredposition: 0
options OfficeIMO.ContentSafety.OfficeContentSafetyOptions requiredposition: 1
inspectZipPackage System.Boolean = false optionalposition: 2
public static Byte[] ReadAllBytes(String filePath, OfficeContentSafetyOptions options, Boolean inspectZipPackage, CancellationToken cancellationToken) #
Returns: Byte[]

Reads a file only after validating its encoded length and, when applicable, ZIP package metadata, while observing cancellation between bounded input chunks.

Parameters

filePath System.String requiredposition: 0
options OfficeIMO.ContentSafety.OfficeContentSafetyOptions requiredposition: 1
inspectZipPackage System.Boolean requiredposition: 2
cancellationToken System.Threading.CancellationToken requiredposition: 3
public static String ReadUtf8Text(String filePath, OfficeContentSafetyOptions options) #
Returns: String

Reads a BOM-aware UTF-8 text file through the encoded-input guard.

Parameters

filePath System.String requiredposition: 0
options OfficeIMO.ContentSafety.OfficeContentSafetyOptions requiredposition: 1
public static Void ValidateBytes(Byte[] input, OfficeContentSafetyOptions options, Boolean inspectZipPackage = false) #
Returns: Void

Validates already-buffered input before a parser or package loader is invoked.

Parameters

input System.Byte[] requiredposition: 0
options OfficeIMO.ContentSafety.OfficeContentSafetyOptions requiredposition: 1
inspectZipPackage System.Boolean = false optionalposition: 2
public static Void ValidateText(String text, OfficeContentSafetyOptions options) #
Returns: Void

Validates an in-memory text input before HTML or other text parsers are invoked.

Parameters

text System.String requiredposition: 0
options OfficeIMO.ContentSafety.OfficeContentSafetyOptions requiredposition: 1