Skip to content

How to sign a digest generated by signtool /dg #199

Answered by ebourg
liammacisaac asked this question in Q&A
Discussion options

You must be logged in to vote

Implementing .dig signing shouldn't be difficult, you just have to implement the Signable interface and add a SignableProvider for .dig files. That's a bit a degenerated case because the file doesn't really contain the signature, and the signature isn't a full PKCS7 message, but that could work.

If your REST API is in Java you can also use the Jsign API instead of the command line tool. You can use the JCA provider with the standard Java crypto classes like this:

Provider provider = new JsignJcaProvider();
KeyStore keystore = KeyStore.getInstance(YUBIKEY.name(), provider);
keystore.load(null, accessToken);

PrivateKey key = (PrivateKey) keystore.getKey(alias, null);

Signature signature = S…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@liammacisaac
Comment options

Answer selected by liammacisaac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants