Skip to content

fix: parse PEM cert chain to DER in RemoteSigner construction#2075

Open
trufo-ai wants to merge 1 commit into
contentauth:mainfrom
trufo-ai:byh/remote-signer-pem-der
Open

fix: parse PEM cert chain to DER in RemoteSigner construction#2075
trufo-ai wants to merge 1 commit into
contentauth:mainfrom
trufo-ai:byh/remote-signer-pem-der

Conversation

@trufo-ai
Copy link
Copy Markdown

The Remote variant of SignerSettings::c2pa_signer() was passing the raw PEM string bytes as a single cert blob, rather than parsing individual PEM certificates into DER. This caused two issues:

  1. certs contained raw PEM text instead of DER-encoded certificates
  2. reserve_size was based on PEM text length rather than DER cert sizes

Parse the PEM cert chain with pem::parse_many() to extract individual DER-encoded certificates, matching the behavior of the Local variant which uses create_signer::from_keys() for proper PEM handling.

Changes in this pull request

Give a narrative description of what has been changed.

Checklist

  • This PR represents a single feature, fix, or change.
  • All applicable changes have been documented.
  • Any TO DO items (or similar) have been entered as GitHub issues and the link to that issue has been included in a comment.

The Remote variant of SignerSettings::c2pa_signer() was passing the raw
PEM string bytes as a single cert blob, rather than parsing individual
PEM certificates into DER. This caused two issues:

1. certs contained raw PEM text instead of DER-encoded certificates
2. reserve_size was based on PEM text length rather than DER cert sizes

Parse the PEM cert chain with pem::parse_many() to extract individual
DER-encoded certificates, matching the behavior of the Local variant
which uses create_signer::from_keys() for proper PEM handling.
@trufo-ai trufo-ai closed this Apr 20, 2026
@trufo-ai
Copy link
Copy Markdown
Author

need to sign the CLA

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant