Class OdfOpenPgpCryptographyProvider
Provides the OdfOpenPgpCryptographyProvider API. 以 IOdfOpenPgpKeyProvider 為基礎,實作 ODF 1.3 OpenPGP 加密模式的
public sealed class OdfOpenPgpCryptographyProvider : IOdfCryptographyProvider
- Inheritance
-
OdfOpenPgpCryptographyProvider
- Implements
- Inherited Members
Constructors
OdfOpenPgpCryptographyProvider(IOdfOpenPgpKeyProvider)
Performs odf open pgp cryptography provider. 初始化 OdfOpenPgpCryptographyProvider 類別的新執行個體。
public OdfOpenPgpCryptographyProvider(IOdfOpenPgpKeyProvider keyProvider)
Parameters
keyProviderIOdfOpenPgpKeyProvider負責 Session Key 加解密的 OpenPGP 金鑰提供者
Exceptions
- ArgumentNullException
當
keyProvider為 null 時擲出
Methods
CanHandle(OdfEncryptionInfo)
Returns whether this instance is handle is allowed. 傳回是否可 Handle。
public bool CanHandle(OdfEncryptionInfo info)
Parameters
infoOdfEncryptionInfo加密資訊的詳細資料
Returns
Decrypt(byte[], OdfEncryptionInfo, OdfLoadOptions)
Performs the Decrypt operation. 執行 Decrypt 作業。
public byte[] Decrypt(byte[] ciphertext, OdfEncryptionInfo info, OdfLoadOptions loadOptions)
Parameters
ciphertextbyte[]要解密的密文位元組陣列
infoOdfEncryptionInfo用於解密的加密資訊
loadOptionsOdfLoadOptions載入文件的選項,包含金鑰或密碼
Returns
- byte[]
解密後的明文位元組陣列
Encrypt(byte[], string, OdfSaveOptions, out OdfEncryptionInfo)
Performs the Encrypt operation. 執行 Encrypt 作業。
public byte[] Encrypt(byte[] plaintext, string entryPath, OdfSaveOptions saveOptions, out OdfEncryptionInfo info)
Parameters
plaintextbyte[]要加密的明文位元組陣列
entryPathstring該封裝項目的路徑
saveOptionsOdfSaveOptions儲存文件的選項,包含金鑰或密碼
infoOdfEncryptionInfo輸出產生的加密資訊
Returns
- byte[]
加密後的密文位元組陣列