Skip to content

Add validation function for raw signatures#284

Merged
josephnoir merged 14 commits into
apple:mainfrom
josephnoir:validate-any-signatures
Nov 27, 2025
Merged

Add validation function for raw signatures#284
josephnoir merged 14 commits into
apple:mainfrom
josephnoir:validate-any-signatures

Conversation

@josephnoir

Copy link
Copy Markdown
Contributor

Motivation

Signatures can be performed on any kind of data, e.g., to prove ownership of the private key for a given certificate. This data usually comes as a blob of bytes.

Modification

Add a signature verification function that operates on bytes represented by the DataProtocol. The bytes are converted to the signature type matching the key and share an implementation with the verification function for Certificate.Signature.

Result

Easy validation of signatures represented as bytes.

Motivation:

Keys can be used to sign arbitrary data. Validating those signatures is
currently not straight forward.

Modifications:

Introduce an isValidSignature overload that works with any input bytes.
Add tests to verify that it works.

Results:

A new API to validate signatures represented as bytes.
@josephnoir josephnoir added the 🆕 semver/minor Adds new public API. label Nov 18, 2025
Comment thread Sources/X509/Signature.swift Outdated
Comment thread Sources/X509/Signature.swift Outdated
Comment thread Sources/X509/Signature.swift Outdated
Comment thread Sources/X509/Signature.swift Outdated
Comment thread Sources/X509/Signature.swift Outdated
Comment thread Sources/X509/Signature.swift Outdated
Comment thread Sources/X509/Signature.swift Outdated
Comment thread Sources/X509/Signature.swift Outdated
@josephnoir josephnoir requested a review from Lukasa November 19, 2025 09:25
@josephnoir

Copy link
Copy Markdown
Contributor Author

Thank you for the review! I integrated your suggestions.

@josephnoir josephnoir merged commit 133a347 into apple:main Nov 27, 2025
46 checks passed
@josephnoir josephnoir deleted the validate-any-signatures branch November 28, 2025 08:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🆕 semver/minor Adds new public API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants