Table of Contents

Interface IOdfCryptographyProvider

Namespace
OdfKit.Core
Assembly
OdfKit.dll

Defines the IOdfCryptographyProvider contract. 定義 ODF 文件加密與解密操作的密碼學提供者介面。

public interface IOdfCryptographyProvider

Methods

CanHandle(OdfEncryptionInfo)

確定此提供者是否能夠處理指定的加密資訊。

bool CanHandle(OdfEncryptionInfo info)

Parameters

info OdfEncryptionInfo

加密資訊的詳細資料

Returns

bool

若可以處理,則為 true ;否則為 false

Decrypt(byte[], OdfEncryptionInfo, OdfLoadOptions)

使用指定的加密資訊與載入選項解密檔案內容。

byte[] Decrypt(byte[] ciphertext, OdfEncryptionInfo info, OdfLoadOptions loadOptions)

Parameters

ciphertext byte[]

要解密的密文位元組陣列

info OdfEncryptionInfo

用於解密的加密資訊

loadOptions OdfLoadOptions

載入文件的選項,包含金鑰或密碼

Returns

byte[]

解密後的明文位元組陣列

Encrypt(byte[], string, OdfSaveOptions, out OdfEncryptionInfo)

加密指定的明文內容,並產生對應的加密資訊。

byte[] Encrypt(byte[] plaintext, string entryPath, OdfSaveOptions saveOptions, out OdfEncryptionInfo info)

Parameters

plaintext byte[]

要加密的明文位元組陣列

entryPath string

該封裝項目的路徑

saveOptions OdfSaveOptions

儲存文件的選項,包含金鑰或密碼

info OdfEncryptionInfo

輸出產生的加密資訊

Returns

byte[]

加密後的密文位元組陣列