Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support of p7s files #163

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

d1vory
Copy link

@d1vory d1vory commented Oct 12, 2023

Added support of signed files, that come in format of .p7s. Magic bytes for recognizing were taken from go library

bytearray([0x30, 0x83]), bytearray([0x30, 0x84])
]
signed_data_match = bytearray([0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x07])
for i, match in enumerate(start_header):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is parsed ASN1 file which may be a different length. Check possibly samples here: https://lapo.it/asn1js/
full OID may be checked too for x30:x82:
contentType ContentType OBJECT IDENTIFIER 1.2.840.113549.1.7.2 signedData (PKCS #7)

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