Package org.apache.harmony.security.tests.support

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


     * @throws InvalidKeySpecException
     */
    public final void testTrustAnchorX500PrincipalPublicKeybyteArray04()
            throws Exception {

        PublicKey pk = new TestKeyPair(keyAlg).getPublic();

        X500Principal x500p = new X500Principal(validCaNameRfc2253);
        // sub testcase 1
        try {
            new TrustAnchor((X500Principal)null,
View Full Code Here


     * Expected: the same name must be returned by the method<br>
     *
     */
    public final void testGetCAPublicKey01() throws Exception {

        PublicKey pk = new TestKeyPair(keyAlg).getPublic();

        // sub testcase 1
        TrustAnchor ta =
            new TrustAnchor(validCaNameRfc2253, pk, null);
        assertEquals("equals1", pk, ta.getCAPublicKey());
View Full Code Here

     * Expected: the same name must be returned by the method<br>
     * @throws InvalidKeySpecException
     */
    public final void testGetCAName01() throws Exception {

        PublicKey pk = new TestKeyPair(keyAlg).getPublic();

        // sub testcase 1
        TrustAnchor ta =
            new TrustAnchor(validCaNameRfc2253, pk, null);
        assertEquals("equals1", validCaNameRfc2253, ta.getCAName());
View Full Code Here

     * Expected: <code>null</code> as return value<br>
     * @throws InvalidKeySpecException
     */
    public final void testGetTrustedCer02() throws Exception {

        PublicKey pk = new TestKeyPair(keyAlg).getPublic();

        // sub testcase 1
        TrustAnchor ta =
            new TrustAnchor(validCaNameRfc2253, pk, null);
        assertNull("null1", ta.getTrustedCert());
View Full Code Here

     * by the method<br>
     * @throws InvalidKeySpecException
     */
    public final void testGetCA01() throws Exception {

        PublicKey pk = new TestKeyPair(keyAlg).getPublic();

        // sub testcase 1
        TrustAnchor ta =
            new TrustAnchor(validCaNameRfc2253, pk, null);
        X500Principal ca = ta.getCA();
View Full Code Here

          sig = Signature.getInstance("SHA1withDSA");   
      } catch (NoSuchAlgorithmException e) {
        fail(e.toString());
      }
      try {
      tkp = new TestKeyPair("DSA");
    } catch (NoSuchAlgorithmException e1) {
      fail(e1.toString());
    }
      prop = new Properties();
      prop.put("aaa", "bbb");
View Full Code Here

    p1 = new MyProvider1();
    p2 = new MyProvider2();
    Security.insertProviderAt(p1, 1);
    Security.insertProviderAt(p2, 1);
    try {
      tkp = new TestKeyPair("DSA");
    } catch (NoSuchAlgorithmException e) {
      e.printStackTrace();
      noKey = true;
      return;
    }
View Full Code Here

        defaultProviderName = (DEFSupported ? defaultProvider.getName() : null);
    }

    private void createKeys() throws Exception {
        if (!initKeys) {
            TestKeyPair tkp = new TestKeyPair(defaultAlgorithm);
            privKey = tkp.getPrivate();
            publKey = tkp.getPublic();
            initKeys = true;
        }

    }
View Full Code Here

    p1 = new MyProvider1();
    p2 = new MyProvider2();
    Security.insertProviderAt(p1, 1);
    Security.insertProviderAt(p2, 1);
    try {
      tkp = new TestKeyPair("DSA");
    } catch (NoSuchAlgorithmException e) {
      e.printStackTrace();
      noKey = true;
      return;
    }
View Full Code Here

        defaultProviderName = (DEFSupported ? defaultProvider.getName() : null);
    }

    private void createKeys() throws Exception {
        if (!initKeys) {
            TestKeyPair tkp = new TestKeyPair(defaultAlgorithm);
            privKey = tkp.getPrivate();
            publKey = tkp.getPublic();
            initKeys = true;
        }

    }
View Full Code Here

TOP

Related Classes of org.apache.harmony.security.tests.support.TestKeyPair

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.