Interface IOdfCryptographyProvider
Defines the IOdfCryptographyProvider contract. 定義 ODF 文件加密與解密操作的密碼學提供者介面。
public interface IOdfCryptographyProvider
Methods
CanHandle(OdfEncryptionInfo)
確定此提供者是否能夠處理指定的加密資訊。
bool CanHandle(OdfEncryptionInfo info)
Parameters
infoOdfEncryptionInfo加密資訊的詳細資料
Returns
Decrypt(byte[], OdfEncryptionInfo, OdfLoadOptions)
使用指定的加密資訊與載入選項解密檔案內容。
byte[] Decrypt(byte[] ciphertext, OdfEncryptionInfo info, OdfLoadOptions loadOptions)
Parameters
ciphertextbyte[]要解密的密文位元組陣列
infoOdfEncryptionInfo用於解密的加密資訊
loadOptionsOdfLoadOptions載入文件的選項,包含金鑰或密碼
Returns
- byte[]
解密後的明文位元組陣列
Encrypt(byte[], string, OdfSaveOptions, out OdfEncryptionInfo)
加密指定的明文內容,並產生對應的加密資訊。
byte[] Encrypt(byte[] plaintext, string entryPath, OdfSaveOptions saveOptions, out OdfEncryptionInfo info)
Parameters
plaintextbyte[]要加密的明文位元組陣列
entryPathstring該封裝項目的路徑
saveOptionsOdfSaveOptions儲存文件的選項,包含金鑰或密碼
infoOdfEncryptionInfo輸出產生的加密資訊
Returns
- byte[]
加密後的密文位元組陣列