Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,22 @@ public static Builder builder() {
@Override
public Path sign(Path file) {
try {
KeyStore keystore =
new KeyStoreBuilder()
.storetype(configuration().getStoreType())
.keystore(configuration().getKeystore())
.storepass(googleAccessToken())
.certfile(configuration().getCertificateChain().toFile())
.build();
KeyStoreBuilder keyStoreBuilder = new KeyStoreBuilder()
.storetype(configuration().getStoreType())
.keystore(configuration().getKeystore());
if (kmsCredentials!=null) {
keyStoreBuilder.storepass(googleAccessToken());
} else if (configuration().getStorePass() != null) {
keyStoreBuilder.storepass(configuration().getStorePass());
}
try {
if (configuration().getCertificateChain() != null) {
keyStoreBuilder.certfile(configuration().getCertificateChain().toFile());
}
} catch(IllegalArgumentException e){
// Ignore missing certficate chain;could be stored in keystore
}
KeyStore keystore =keyStoreBuilder.build();

AuthenticodeSigner signer =
new AuthenticodeSigner(keystore, configuration().getKeyAlias(), null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public class JSignerProperties {
private static final String JSIGN_DESCRIPTION = "windows.jsign.description";

private static final String JSIGN_STORETYPE = "windows.jsign.storetype";
private static final String JSIGN_STOREPASS = "windows.jsign.storepass";
private static final String JSIGN_KEYSTORE = "windows.jsign.keystore";
private static final String JSIGN_KEY_ALIAS = "windows.jsign.keyalias";
private static final String JSIGN_CERTCHAIN = "windows.jsign.certchain";
Expand Down Expand Up @@ -67,6 +68,10 @@ public String getStoreType() {
return propertiesReader.getString(JSIGN_STORETYPE);
}

public String getStorePass() {
return propertiesReader.getString(JSIGN_STOREPASS);
}

public String getKeystore() {
return propertiesReader.getString(JSIGN_KEYSTORE);
}
Expand Down