Add FPDFSignatureObj_GetSubFilter() API

This follows the same pattern as FPDFSignatureObj_GetByteRange(), so the
client has to call this function twice, but allocation of the buffer
happens outside pdfium.

The buffer format is documented to be NUL-terminated ASCII, since the
PDF reference gives examples on how the SubFilter should be named, and
all of them are ASCII, so probably UTF-8 or UTF-16 would be an overkill
here.

Change-Id: I3a9b360f219578745ea501cbdfb39a117ca5f2bc
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/71970
Commit-Queue: Miklos V <vmiklos@collabora.co.uk>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
diff --git a/public/fpdf_signature.h b/public/fpdf_signature.h
index 439226d..1dc582e 100644
--- a/public/fpdf_signature.h
+++ b/public/fpdf_signature.h
@@ -75,6 +75,25 @@
                               int* buffer,
                               unsigned long length);
 
+// Experimental API.
+// Function: FPDFSignatureObj_GetSubFilter
+//          Get the encoding of the value of a signature object.
+// Parameters:
+//          signature   -   Handle to the signature object. Returned by
+//                          FPDF_GetSignatureObject().
+//          buffer      -   The address of a buffer that receives the encoding.
+//          length      -   The size, in bytes, of |buffer|.
+// Return value:
+//          Returns the number of bytes in the encoding name (including the
+//          trailing NUL character) on success, 0 on error.
+//
+// The |buffer| is always encoded in 7-bit ASCII. If |length| is less than the
+// returned length, or |buffer| is NULL, |buffer| will not be modified.
+FPDF_EXPORT unsigned long FPDF_CALLCONV
+FPDFSignatureObj_GetSubFilter(FPDF_SIGNATURE signature,
+                              char* buffer,
+                              unsigned long length);
+
 #ifdef __cplusplus
 }  // extern "C"
 #endif  // __cplusplus