Table of Contents

Interface IOdfOpenPgpKeyProvider

Namespace
OdfKit.Core
Assembly
OdfKit.dll

Defines the IOdfOpenPgpKeyProvider contract. 定義 ODF 1.3 OpenPGP 加密模式所需的 Session Key 加解密提供者。

public interface IOdfOpenPgpKeyProvider

Methods

DecryptSessionKey(byte[], string)

以本地私鑰解密 Session Key。

byte[] DecryptSessionKey(byte[] encryptedKeyPacket, string keyId)

Parameters

encryptedKeyPacket byte[]

加密後的金鑰封包位元組陣列

keyId string

目標私鑰識別碼,用於選取對應金鑰

Returns

byte[]

解密後的明文 Session Key 位元組陣列;若無對應私鑰請拋出例外

EncryptSessionKey(byte[], OdfOpenPgpRecipient)

以指定收件人的 OpenPGP 公鑰加密 Session Key。

byte[] EncryptSessionKey(byte[] sessionKey, OdfOpenPgpRecipient recipient)

Parameters

sessionKey byte[]

明文 Session Key 位元組陣列(32 位元組 AES-256 金鑰)

recipient OdfOpenPgpRecipient

收件人公鑰資訊

Returns

byte[]

加密後的 Session Key 位元組陣列