THotPDF.AddPubKeyAgreementRecipientWithSecret 方法

声明

procedure AddPubKeyAgreementRecipientWithSecret(
  const CertificateDER: array of byte;
  Permissions: THPDFProtectOptions; Scheme: THPDFPubKeyAgreementScheme;
  const OriginatorPublicKey, OriginatorPrivateScalar,
  OwnPublicPoint: array of byte);

行为

一个便利封装:无需外部 ECDH 工具,直接在进程内从发起方私钥标量算出共享密钥——X25519 和 X448 使用内置的可移植 ladder 实现,NIST 曲线则经 CNG 完成 OriginatorPublicKey 是发起方公钥,Montgomery 系列方案下由 HPDFX25519PublicFromScalar 和 HPDFX448PublicFromScalar 推导;OwnPublicPoint 是发起方未压缩的 0x04||X||Y 点,仅 NIST 曲线需要

另请参阅 AddPubSecAgreementKeyMaterial、现代签名提供程序