Skip to content

Commit

Permalink
Merge pull request #30 from yandex-qatools/sign_default_constr
Browse files Browse the repository at this point in the history
return back default sign
  • Loading branch information
lanwen committed Jun 3, 2016
2 parents ee8bb71 + b24df9f commit 2c09e7e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@
*/
public class Signer {

public Signer() {
this.privateKey = new File(populated().getKeyPath());
this.certificates = new ArrayList<>(Collections.singletonList(new File(populated().getCertPath())));
this.rootCA = new ArrayList<>(Collections.singletonList(new File(populated().getCertPath())));
}

public Signer(String privateKeyPath, List<String> certificatePaths, List<String> rootCAPaths) {
this.privateKey = new File(privateKeyPath);
this.certificates = new ArrayList<>(certificatePaths.stream().map(File::new).collect(Collectors.toList()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,7 @@ public void shouldSignWithSelfSignedCert() throws Exception {
System.setProperty(JuseppeEnvVars.JuseppeEnvEnum.JUSEPPE_PRIVATE_KEY_PATH.mapping(), key.getAbsolutePath());
System.setProperty(JuseppeEnvVars.JuseppeEnvEnum.JUSEPPE_CERT_PATH.mapping(), cert.getAbsolutePath());

Signature sign = new Signer(
populated().getKeyPath(),
singletonList(populated().getCertPath()),
singletonList(populated().getCertPath())
).sign(new UpdateSite());
Signature sign = new Signer().sign(new UpdateSite());

assertThat("sign", sign.getCorrectSignature(), notNullValue());
assertThat("digest", sign.getCorrectDigest(), notNullValue());
Expand Down

0 comments on commit 2c09e7e

Please sign in to comment.