@Test public void testSign() throws Exception { File sourceFile = new File("target/test-classes/wineyes.exe"); File targetFile = new File("target/test-classes/wineyes-signed.exe"); FileUtils.copyFile(sourceFile, targetFile); PEFile peFile = new PEFile(targetFile); PESigner signer = new PESigner(getKeyStore(), ALIAS, PRIVATE_KEY_PASSWORD) .withTimestamping(false) .withProgramName("WinEyes") .withProgramURL("http: signer.sign(peFile); peFile = new PEFile(targetFile); List<CMSSignedData> signatures = peFile.getSignatures(); assertNotNull(signatures); assertEquals(1, signatures.size()); CMSSignedData signature = signatures.get(0); assertNotNull(signature); assertNull(signature.getSignerInfos().iterator().next().getSignedAttributes().get(CMSAttributes.signingTime)); peFile.printInfo(System.out); }
public void sign(PEFile file) throws Exception { super.sign(file); }
PESigner extends AuthenticodeSigner { public void sign(PEFile file) throws Exception { super.sign(file); } }
PESigner extends AuthenticodeSigner { public void sign(PEFile file) throws Exception { super.sign(file); } PESigner(Certificate[] chain, PrivateKey privateKey);  PESigner(KeyStore keystore, String alias, String password); }
PESigner extends AuthenticodeSigner { public void sign(PEFile file) throws Exception { super.sign(file); } PESigner(Certificate[] chain, PrivateKey privateKey);  PESigner(KeyStore keystore, String alias, String password); PESigner withProgramName(String programName); PESigner withProgramURL(String programURL); PESigner withSignaturesReplaced(boolean replace); PESigner withTimestamping(boolean timestamping); PESigner withTimestampingMode(TimestampingMode tsmode); PESigner withTimestampingAutority(String url); PESigner withTimestampingAutority(String... urls); PESigner withTimestampingAuthority(String url); PESigner withTimestampingAuthority(String... urls); PESigner withTimestamper(Timestamper timestamper); PESigner withTimestampingRetries(int timestampingRetries); PESigner withTimestampingRetryWait(int timestampingRetryWait); PESigner withDigestAlgorithm(DigestAlgorithm algorithm); PESigner withSignatureAlgorithm(String signatureAlgorithm); PESigner withSignatureAlgorithm(String signatureAlgorithm, String signatureProvider); PESigner withSignatureAlgorithm(String signatureAlgorithm, Provider signatureProvider); PESigner withSignatureProvider(Provider signatureProvider); void sign(PEFile file); }
PESigner extends AuthenticodeSigner { public void sign(PEFile file) throws Exception { super.sign(file); } PESigner(Certificate[] chain, PrivateKey privateKey);  PESigner(KeyStore keystore, String alias, String password); PESigner withProgramName(String programName); PESigner withProgramURL(String programURL); PESigner withSignaturesReplaced(boolean replace); PESigner withTimestamping(boolean timestamping); PESigner withTimestampingMode(TimestampingMode tsmode); PESigner withTimestampingAutority(String url); PESigner withTimestampingAutority(String... urls); PESigner withTimestampingAuthority(String url); PESigner withTimestampingAuthority(String... urls); PESigner withTimestamper(Timestamper timestamper); PESigner withTimestampingRetries(int timestampingRetries); PESigner withTimestampingRetryWait(int timestampingRetryWait); PESigner withDigestAlgorithm(DigestAlgorithm algorithm); PESigner withSignatureAlgorithm(String signatureAlgorithm); PESigner withSignatureAlgorithm(String signatureAlgorithm, String signatureProvider); PESigner withSignatureAlgorithm(String signatureAlgorithm, Provider signatureProvider); PESigner withSignatureProvider(Provider signatureProvider); void sign(PEFile file);  }