Package makwa

Examples of makwa.MakwaPrivateKey


  {
    /*
     * Check encoding and decoding of public and private keys.
     */
    modulus = MakwaPrivateKey.decodePublic(PUB2048);
    privKey = new MakwaPrivateKey(PRIV2048);
    check(modulus.equals(privKey.getModulus()));
    check(equals(privKey.exportPrivate(), PRIV2048));
    check(equals(privKey.exportPublic(), PUB2048));
    check(modulus.equals(MakwaPrivateKey.decodePublic(PUB2048)));

View Full Code Here


      }
    }
    if (size == 0) {
      usage();
    }
    MakwaPrivateKey pkey = MakwaPrivateKey.generate(size);
    if (textOut) {
      System.out.println("modulus = 0x"
        + pkey.getModulus().toString(16).toUpperCase());
    }
    if (outPub != null) {
      FileOutputStream out = new FileOutputStream(outPub);
      try {
        out.write(pkey.exportPublic());
      } finally {
        out.close();
      }
    }
    if (outPriv != null) {
      FileOutputStream out = new FileOutputStream(outPriv);
      try {
        out.write(pkey.exportPrivate());
      } finally {
        out.close();
      }
    }
  }
View Full Code Here

    } catch (NoSuchAlgorithmException nsae) {
      throw new MakwaException("no native SHA-256");
    }

    BigInteger mod = MakwaPrivateKey.decodePublic(PUB2048);
    MakwaPrivateKey pkey = new MakwaPrivateKey(PRIV2048);
    check(mod.equals(pkey.getModulus()));
    Makwa mpub = new Makwa(mod, Makwa.SHA256, false, 0, 1024);
    Makwa mpriv = new Makwa(pkey, Makwa.SHA256, false, 0, 1024);

    /*
     * Some KDF test vectors.
View Full Code Here

TOP

Related Classes of makwa.MakwaPrivateKey

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.