Package mykeynote.keynote

Examples of mykeynote.keynote.KeyNoteCL


    MyKeyNoteProtocol.config = config;
    MyKeyNoteProtocol.report = report;
    this.unique = unique;
    in = read;
    out = print;
    cl = new KeyNoteCL(config, report);
  }
View Full Code Here


    }
  }
 
 
  public void testSign(){
    KeyNoteCL cl = new KeyNoteCL(config, report);
   
    File base = new File(new File("mykeynote", "junit"), "keynote");
   
    File fileToSign = new File(base, "test-assertion1");
    File outputFile = new File(base, "test-assertion1-signed.out");
    File okFile = new File(base, "test-assertion1-signed.ok");
    File keyFile = new File(base, "test.key.pem");
    String i = "100";
    try {
      cl.sign(i, report, fileToSign, keyFile,outputFile);
    } catch (FileNotFoundException e) {
      assertNull(e);
    } catch (InterruptedException e) {
      assertNull(e);
    } catch (IOException e) {
View Full Code Here

      assertNull(e);
    }
   
   
   
    KeyNoteCL cl = new KeyNoteCL(config, report);
 
    try {
      cl.sigVerify("101", fileToOk);
    } catch (InterruptedException e) {
      assertNull(e);
    } catch (KeyNoteCLException e) {
      assertNull(e);
    } catch (SignatureVerificationException e) {
      assertNull(e);
    } catch (UnknownCLException e) {
      assertNull(e);
    } catch (SyntaxError e) {
      assertNull(e);
    } catch (IOException e) {
      assertNull(e);
    }

   
   
    boolean assertExceptionHit = false;
   
    //This test should failwith a syntax error
    try {
      cl.sigVerify("100", syntaxErrorFile);
    } catch (InterruptedException e) {
      assertNull(e);
    } catch (KeyNoteCLException e) {
      assertNull(e);
    } catch (SignatureVerificationException e) {
      assertNull(e);
    } catch (UnknownCLException e) {
      assertNull(e);
    } catch (SyntaxError e) {
      assertExceptionHit = true;
    } catch (IOException e) {
      assertNull(e);
    }

    assertTrue(assertExceptionHit);
    assertExceptionHit = false;
   
    try {
      cl.sigVerify("100", falseSignatureFile);
    } catch (InterruptedException e) {
      assertNull(e);
    } catch (KeyNoteCLException e) {
      assertNull(e);
    } catch (SignatureVerificationException e) {
View Full Code Here

  }
 
  public void testVerify(){
    KeyNoteCommon knc = new KeyNoteCommon();
    File resourceToTest = new File(base, "resource1");
    KeyNoteCL cl = new KeyNoteCL(config, report);
    String unique = "100";
    File environmentFile = null;
    File returnValueFile = null;
    try {
      environmentFile = knc.getEnvironmentFile(unique, report, resourceToTest, false);
      returnValueFile = knc.getReturnValueFile(unique, report, resourceToTest, false);
    } catch (FileNotFoundException e1) {
      assertNull(e1);
    }
   
    File assertionFile = new File(base, "resource1.ass");
    File key = new File(base, "key10");
    String answer = "";
    try {
      answer = cl.verify(unique, environmentFile, returnValueFile, assertionFile, key);
    } catch (KeyNoteCLProcessCreationException e) {
      assertNotNull(e);
    } catch (KeyNoteCLException e) {
      assertNotNull(e);
    } catch (InterruptedException e) {
View Full Code Here

        return false;
      if(getEnv(true))
        return false;
      if(getResource(true))
        return false;
      KeyNoteCL cl = new KeyNoteCL(config, report);
      try {
        //knt.verify(unique, resourceSearched, credFrom, credTo);
       
        //TODO the resourceSearched File should be some other...
        //TODO the key shoule point to the real file
        cl.verify(unique, report, new File(resourceSearched), new File(key));
      } catch (InterruptedException e) {
        allowError = false;
        return false;
      } catch (IOException e) {
        return false;
View Full Code Here

TOP

Related Classes of mykeynote.keynote.KeyNoteCL

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.