Advanced search certificate documents

View as MarkdownMarkdown

Set up your AI agent

Give your coding agent live access to the GroupDocs documentation and API reference through the GroupDocs Docs MCP server — no install, no API key. Learn more

claude mcp add --transport http groupdocs-docs https://docs.groupdocs.com/mcp

Also process documents locally

The GroupDocs.Signature MCP server lets your agent work with files on your machine; they are never uploaded. It needs the .NET 10 SDK or Docker.

claude mcp add groupdocs-signature -- dnx GroupDocs.Signature.Mcp --yes
Folders, licensing and more →

GroupDocs.Signature provides CertificateSearchOptions class to specify different options to search text data within the certificate documents. Please be aware that the search result will always be a list of MetadataSignature objects. GroupDocs.Signature reads each certificate property, such as SerialNumber, Issuer, Subject or Expiration, as a metadata entry, so every match returns the property name in getName() and its value in getValue(). The text is matched against the string form of each value; the serial number is read as a decimal number, not as a hexadecimal string.

Here are the steps to search for the values within the certificate document with GroupDocs.Signature:

This example shows how to make advanced search for text data within the certificate documents.

LoadOptions loadOptions = new LoadOptions();
loadOptions.setPassword("1234567890");

Signature signature = new Signature("certificate.pfx", loadOptions);
try
{
    CertificateSearchOptions options = new CertificateSearchOptions();
    // check the serial number (Java reads it as a decimal number)
    options.setText("12308567976323978183");
    // match by substring
    options.setMatchType(TextMatchType.Contains);

    // search for certificate data
    List<MetadataSignature> result = signature.search(MetadataSignature.class, options);
    if (result.size() > 0)
    {
        System.out.println("\nCertificate contains following search results");
        for (MetadataSignature temp : result)
        {
            System.out.println("\t\t-" + temp.getName() + " - " + temp.getValue());
        }
    }
    else
    {
        System.out.println("\nCertificate failed search process.");
    }
}
finally
{
    signature.dispose();
}

More resources

GitHub Examples

You may easily run the code above and see the feature in action in our GitHub examples:

Free Online Apps

Along with the full-featured Java library, we provide simple but powerful free online apps.

To sign PDF, Word, Excel, PowerPoint, and other documents you can use the online apps from the GroupDocs.Signature App Product Family.