Skip to content

Add AddSignerInfo - #15

Closed
hamano wants to merge 1 commit into
fullsailor:masterfrom
hamano:add_signer_info
Closed

Add AddSignerInfo#15
hamano wants to merge 1 commit into
fullsailor:masterfrom
hamano:add_signer_info

Conversation

@hamano

@hamano hamano commented Mar 28, 2017

Copy link
Copy Markdown

Hi,
I'm trying to sign with PKCS11 API and format to CMS.
The interface sd.AddSigner(cert, pkey, config) isn't allow to sign with hardware token.
I just add new interface AddSignerInfo(cert, signerInfo)
also I published SignerInfo struct and Cert2issuerAndSerial()

Usage:

toBeSigned, _ := pkcs7.NewSignedData(content)
attrs, hashed, _ := toBeSigned.HashAttributes(crypto.SHA1, pkcs7.SignerInfoConfig{})
sigunature := SignWithHardwareToken(crypto.SHA1, hashed)
signerInfo := pkcs7.SignerInfo{
    Version:                   1,
    AuthenticatedAttributes:   attrs,
    EncryptedDigest:           signature,
    ...
}
toBeSigned.AddSignerInfo(cert, signerInfo)

Thank you.

@jvehent

jvehent commented Jul 5, 2017

Copy link
Copy Markdown
Contributor

Fwiw, I tried merging this patch on mozilla-services/pkcs7, but it conflicts with the rewrite from #14.

@hamano

hamano commented Apr 28, 2018

Copy link
Copy Markdown
Author

@jvehent mozilla-services/pkcs7 already support HSM, so no need to merge the patch.
I'm going to use mozilla-services/pkcs7 thanks!

@hamano hamano closed this Apr 28, 2018
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