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

itext7 support sm3withsm2 signature #85

Closed
wants to merge 0 commits into from

Conversation

HankoZhou
Copy link

SM2 signature is used by more and more use in China, and BouncyCastle has also supported SM2/SM3 algorithm. It is hoped that iText can also support SM2 signature.
At present, there are several ways of PDF signature. I implement mode 2 and mode 3. At present, I submit mode 2.

mode1: RSA: original - > sha256withrsa - > pkcs#7
mode2: SM2: original - > sm3withsm2 - > pkcs#7
mode3: SM2: original - > sm3withsm2 - > gb38540

@michaeldemey michaeldemey self-assigned this Feb 2, 2023
@michaeldemey
Copy link
Contributor

Hi,

Thank you for your patience in our handling of this PR. I do think this PR looks very interesting, but there's a few steps we need to go over before we can get this merged.

As a first step, can you squash all your commits into one commit? Makes it easier for us to review this and rebase/handle conflicts.

Kind regards,
Michaël.

@michaeldemey
Copy link
Contributor

I'm trying to reopen this PR, but I can't because there are no new commits. Could you look into getting your code into the PR?

@AnhelinaM
Copy link
Contributor

Hello @HankoZhou! I have created a sample code using 8.0.3-SNAPSHOT itext version, but we cannot validate SM3WithSM2 signature, could you please take a look at the sample code and the output pdf in the archive I attached to check if it's ok?
SM3WithSM2Sample.zip

P.S. I used tongsuo tool to create private key and certificate for that sample, but it would be great if you could share other ways to create such a certificate and maybe tools for validating SM3WithSM2 PDF signatures 🙂

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.

3 participants