Pdf - RevocationType
30 Sep 20261 minute to read
Public enum to define revocation validation mode for Long-Term Validation.
// Load the document
const document: PdfDocument = new PdfDocument(data);
// Access the PDF form
const form: PdfForm = document.form;
// Get an existing signature field
const field: PdfSignatureField = form.fieldAt(0) as PdfSignatureField;
// Get the signature
const signature: PdfSignature = field.getSignature();
// Create an LTV callback to fetch OCSP/CRL responses
async function longTermValidationCallback(url: string, requestBytes?: Uint8Array):
Promise<{ response: Uint8Array }> {
// Implement Long Term Validation response retrieval here
return new Uint8Array(); // Placeholder return
}
// Enable Long Term Validation using public certificates, revocation mode and callback
const ltvEnabled: boolean = await signature.enableLTV(publicCertificates, RevocationType.crl, longTermValidationCallback);
// Save the document
document.save('output.pdf');
// Destroy the document
document.destroy();-
crl- Validates revocation using CRL only. -
none- Does not perform revocation validation. -
ocsp- Validates revocation using OCSP only. -
ocspAndCrl- Validates revocation using both OCSP and CRL. -
ocspOrCrl- Validates revocation using either OCSP or CRL.