HPDFSignHeadlessCMS
function HPDFSignHeadlessCMS(Source: TStream; const ByteRange: array of Int64; const CertificatePEM, PrivateKeyPEM: SysUtils.TBytes; const Options: THPDFHeadlessCMSOptions): SysUtils.TBytes;
الدالة توقّع مدايات المصدر المصرح بها بشهادة PEM صريحة ومفتاح خاص PEM غير مشفر باستخدام OpenSSL 3، وتُعيد SignedData CMS بـ DER مع محتوى منفصل، وتستعيد موضع المصدر المملوك للمستدعي
The source is read incrementally through the same bounded BIO used by the verifier; PEM input and generated DER must fit MaxCMSBytes, and the signed ranges must fit MaxSignedBytes
RequireCAdES adds the ESS signing-certificate attribute during CMS generation; validate the result with an explicit trusted CA file when requiring CAdES verification
المفاتيح الخاصة تبقى مصفوفات بايتات مملوكة للمستدعي؛ وكائن مفتاح OpenSSL يفرّج بعد التوقيع، والدالة لا تنبثق سؤال كلمة سر مفتاح أبدًا
Encrypted PEM keys, certificate/key mismatches, invalid ranges, cancellation, runtime errors, and output-limit failures raise EHPDFHeadlessCMSError
هذه الدالة الأولية تولّد CMS فقط؛ وهي لا تنشئ حقل توقيع PDF ولا تحجز فضاء Contents في PDF ولا تنشر PDF موقعةً ولا تتصل بخدمة طوابع زمنية أو إبطال