Skip to content

Add SigningTimestamp property to AuthenticodeInfo - #390

Merged
secana merged 1 commit into
secana:mainfrom
tibel:feature/authenticode-signing-timestamp
Apr 30, 2026
Merged

secana merged 1 commit into
secana:mainfrom
tibel:feature/authenticode-signing-timestamp

Conversation

@tibel

@tibel tibel commented Apr 30, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a DateTimeOffset? SigningTimestamp property to AuthenticodeInfo that extracts the Authenticode signing timestamp from PE files.

Details

  • Supports RFC 3161 timestamp counter-signatures (OID 1.3.6.1.4.1.311.3.3.1) — parses TSTInfo ASN.1 to extract genTime
  • Supports legacy Authenticode counter-signatures (OID 1.2.840.113549.1.9.6) — reads signing-time from CounterSignerInfos
  • Refactors AuthenticodeInfo to decode PKCS#7 SignedCms once into a shared field, eliminating 3x redundant decoding
  • Resilient to malformed data — all parsing is wrapped in exception handling

Usage

var peFile = new PeFile("signed.exe");
var timestamp = peFile.AuthenticodeInfo?.SigningTimestamp;
// Returns DateTimeOffset? (UTC) or null if not timestamped

Tests

- SigningTimestamp_SignedBinary_ReturnsTimestamp — RFC 3161 path
- SigningTimestamp_LegacyCounterSignature_ReturnsTimestamp — legacy path
- SigningTimestamp_UnsignedBinary_ReturnsNull

Extract the Authenticode signing timestamp from PE files by parsing RFC 3161 counter-signatures (OID 1.3.6.1.4.1.311.3.3.1) and legacy Authenticode counter-signatures (OID 1.2.840.113549.1.9.6).

Also refactors AuthenticodeInfo to decode PKCS#7 SignedCms once and share it across methods, eliminating redundant decoding.
@secana
secana merged commit 600f21a into secana:main Apr 30, 2026
5 checks passed
@secana

secana commented Apr 30, 2026

Copy link
Copy Markdown
Owner

@tibel Very welcome addition. Thanks alot. A new release is on its way.

@tibel
tibel deleted the feature/authenticode-signing-timestamp branch May 1, 2026 05:27
secana added a commit to secana/PeNet-Analyzer that referenced this pull request May 7, 2026
Updated [PeNet](https://github.com/secana/PeNet) from 6.0.0 to 6.1.1.

<details>
<summary>Release notes</summary>

_Sourced from [PeNet's
releases](https://github.com/secana/PeNet/releases)._

## 6.1.1

## What's Changed
* Avoid IRawFile.ToArray() to reduce memory allocations by @​tibel in
secana/PeNet#391


**Full Changelog**:
secana/PeNet@v6.1.0...v6.1.1

## 6.1.0

## What's Changed
* Bump Microsoft.SourceLink.GitHub from 8.0.0 to 10.0.102 by
@​dependabot[bot] in secana/PeNet#373
* Bump Microsoft.SourceLink.GitHub from 10.0.102 to 10.0.103 by
@​dependabot[bot] in secana/PeNet#374
* Bump System.Security.Cryptography.Pkcs from 10.0.2 to 10.0.3 by
@​dependabot[bot] in secana/PeNet#375
* Bump Microsoft.NET.Test.Sdk from 18.0.1 to 18.3.0 by @​dependabot[bot]
in secana/PeNet#377
* Bump Microsoft.SourceLink.GitHub from 10.0.103 to 10.0.200 by
@​dependabot[bot] in secana/PeNet#378
* Bump System.Security.Cryptography.Pkcs from 10.0.3 to 10.0.4 by
@​dependabot[bot] in secana/PeNet#379
* Bump System.Security.Cryptography.Pkcs from 10.0.4 to 10.0.5 by
@​dependabot[bot] in secana/PeNet#381
* Bump Microsoft.SourceLink.GitHub from 10.0.200 to 10.0.201 by
@​dependabot[bot] in secana/PeNet#380
* Bump dependabot/fetch-metadata from 2.5.0 to 3.0.0 by
@​dependabot[bot] in secana/PeNet#382
* Bump Microsoft.NET.Test.Sdk from 18.3.0 to 18.4.0 by @​dependabot[bot]
in secana/PeNet#383
* Bump Microsoft.SourceLink.GitHub from 10.0.201 to 10.0.202 by
@​dependabot[bot] in secana/PeNet#384
* Bump System.Security.Cryptography.Pkcs from 10.0.5 to 10.0.6 by
@​dependabot[bot] in secana/PeNet#385
* Bump Microsoft.SourceLink.GitHub from 10.0.202 to 10.0.203 by
@​dependabot[bot] in secana/PeNet#386
* Bump dependabot/fetch-metadata from 3.0.0 to 3.1.0 by
@​dependabot[bot] in secana/PeNet#388
* Bump System.Security.Cryptography.Pkcs from 10.0.6 to 10.0.7 by
@​dependabot[bot] in secana/PeNet#387
* Bump Microsoft.NET.Test.Sdk from 18.4.0 to 18.5.1 by @​dependabot[bot]
in secana/PeNet#389
* Add SigningTimestamp property to AuthenticodeInfo by @​tibel in
secana/PeNet#390

## New Contributors
* @​tibel made their first contribution in
secana/PeNet#390

**Full Changelog**:
secana/PeNet@v6.0.0...v6.1.0

Commits viewable in [compare
view](secana/PeNet@v6.0.0...v6.1.1).
</details>

[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=PeNet&package-manager=nuget&previous-version=6.0.0&new-version=6.1.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>
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.

2 participants