Examples of MySignature1


Examples of org.apache.harmony.security.tests.support.MySignature1

  /*
   * Class under test for void update(byte)
   */
  public void testUpdatebyte() throws Exception {
    MySignature1 s = new MySignature1("ABC");
    try {
      s.update((byte)1);
      fail("No expected SignatureException");
    } catch (SignatureException e) {   
    }

    s.initVerify(new MyPublicKey());
        s.update((byte) 1);
        s.initSign(new MyPrivateKey());
        s.update((byte) 1);

        assertEquals("state", Signature.SIGN, s.getState());
        assertTrue("update() failed", s.runEngineUpdate1);
  }
View Full Code Here

Examples of org.apache.harmony.security.tests.support.MySignature1

  /*
   * Class under test for void update(byte[])
   */
  public void testUpdatebyteArray() throws Exception {
    MySignature1 s = new MySignature1("ABC");
    byte[] b = {1, 2, 3, 4};
    try {
      s.update(b);
      fail("No expected SignatureException");
    } catch (SignatureException e) {   
    }

    s.initVerify(new MyPublicKey());
        s.update(b);
        s.initSign(new MyPrivateKey());
        s.update(b);

        assertEquals("state", Signature.SIGN, s.getState());
        assertTrue("update() failed", s.runEngineUpdate2);
  }
View Full Code Here

Examples of org.apache.harmony.security.tests.support.MySignature1

  /*
   * Class under test for void update(byte[], int, int)
   */
  public void testUpdatebyteArrayintint() throws Exception {
    MySignature1 s = new MySignature1("ABC");
    byte[] b = {1, 2, 3, 4};
    try {
      s.update(b, 0, 3);
      fail("No expected SignatureException");
    } catch (SignatureException e) {   
    }

    s.initVerify(new MyPublicKey());
        s.update(b, 0, 3);
        s.initSign(new MyPrivateKey());
        s.update(b, 0, 3);

        assertEquals("state", Signature.SIGN, s.getState());
        assertTrue("update() failed", s.runEngineUpdate2);
  }
View Full Code Here

Examples of org.apache.harmony.security.tests.support.MySignature1

  /*
   * Class under test for void setParameter(String, Object)
   */
  public void testSetParameterStringObject() {
    MySignature1 s = new MySignature1("ABC");
    s.setParameter("aaa", new Object());
  }
View Full Code Here

Examples of org.apache.harmony.security.tests.support.MySignature1

  /*
   * Class under test for void setParameter(AlgorithmParameterSpec)
   */
  public void testSetParameterAlgorithmParameterSpec() throws InvalidAlgorithmParameterException {
    MySignature1 s = new MySignature1("ABC");
    try {
      s.setParameter((java.security.spec.AlgorithmParameterSpec)null);
      fail("No expected UnsupportedOperationException");
    } catch (UnsupportedOperationException e){ 
    }
  }
View Full Code Here

Examples of org.apache.harmony.security.tests.support.MySignature1

    } catch (UnsupportedOperationException e){ 
    }
  }

  public void testGetParameter() {
    MySignature1 s = new MySignature1("ABC");
        s.getParameter("aaa");
  }
View Full Code Here

Examples of org.apache.harmony.security.tests.support.MySignature1

  /*
   * Class under test for int sign(byte[], int, int)
   */
  public void testSignbyteArrayintint() throws Exception {
    MySignature1 s = new MySignature1("ABC");
    byte[] b = new byte[8];
    try {
      s.sign(b, 0, 5);
      fail("No expected SignatureException 1");
    } catch (SignatureException e) {   
    }
   
        s.initVerify(new MyPublicKey());
   
    try {
      s.sign(b, 0, 5);
      fail("No expected SignatureException 1");
    } catch (SignatureException e) {   
    }
   
        s.initSign(new MyPrivateKey());
        s.sign(b, 0, 5);
        assertEquals("state", Signature.SIGN, s.getState());
        assertTrue("sign() failed", s.runEngineSign);
  }
View Full Code Here

Examples of org.apache.harmony.security.tests.support.MySignature1

  /*
   * Class under test for String toString()
   */
  public void testToString() {
        MySignature1 s = new MySignature1("ABC");
        assertEquals("toString() failed", "SIGNATURE ABC state: UNINITIALIZED",
                s.toString());
    }
View Full Code Here

Examples of org.apache.harmony.security.tests.support.MySignature1

  /*
   * Class under test for void initVerify(Certificate)
   */
  public void testInitVerifyCertificate() throws InvalidKeyException {
    MySignature1 s = new MySignature1("ABC");

        s.initVerify(new MyCertificate());
        assertEquals("state", Signature.VERIFY, s.getState());
        assertTrue("initVerify() failed", s.runEngineInitVerify);
  }
View Full Code Here

Examples of org.apache.harmony.security.tests.support.MySignature1

  /*
   * Class under test for void initSign(PrivateKey)
   */
  public void testInitSignPrivateKey() throws InvalidKeyException {
    MySignature1 s = new MySignature1("ABC");

        s.initSign(new MyPrivateKey());
        assertEquals("state", Signature.SIGN, s.getState());
        assertTrue("initSign() failed", s.runEngineInitSign);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.