Package gnu.java.security.key.dss

Examples of gnu.java.security.key.dss.DSSPublicKey


        // retrieve the same private key
        PrivateKey pk2 = (PrivateKey) kr1.getPrivateKey(ALIAS, KEY_PASSWORD);
        // check that private key is the same
        harness.check(pk2, pk1, "In-memory and original private key MUST be equal");
        // store a public key
        PublicKey k1 = new DSSPublicKey(Registry.ASN1_ENCODING_ID, p, q, g, y);
        kr1.putPublicKey(ALIAS, k1);
        // retrieve the same public key
        PublicKey k2 = kr1.getPublicKey(ALIAS);
        // check that public key is the same
        harness.check(k2, k1, "In-memory and original public key MUST be equal");
View Full Code Here


  public void test(TestHarness harness)
  {
    harness.checkPoint("TestOfDSSSignature");

    DSAPublicKey publicK = new DSSPublicKey(Registry.ASN1_ENCODING_ID, p, q, g, y);
    DSAPrivateKey privateK = new DSSPrivateKey(Registry.ASN1_ENCODING_ID, p, q, g, x);

    DSSSignature alice = new DSSSignature();
    DSSSignature bob = (DSSSignature) alice.clone();
View Full Code Here

        // retrieve the certificate
        Certificate[] chain2 = ks1.getCertificateChain(ALIAS);
        harness.check(Arrays.equals(chain2, chain1),
                      "In-memory and original certificate MUST be equal");
        // store a (public) key entry
        PublicKey k1 = new DSSPublicKey(Registry.ASN1_ENCODING_ID, p, q, g, y);
        ks1.setKeyEntry(ALIAS_DSA, k1, null, null);
        // retrieve the same (public) key-entry
        PublicKey k2 = (PublicKey) ks1.getKey(ALIAS_DSA, null);
        // check it's still the same
        harness.check(k2, k1, "In-memory and original public key MUST be equal");
View Full Code Here

  {
    BigInteger p = spec.getP();
    BigInteger q = spec.getQ();
    BigInteger g = spec.getG();
    BigInteger y = spec.getY();
    return new DSSPublicKey(Registry.X509_ENCODING_ID, p, q, g, y);
  }
View Full Code Here

                    if (prevKey == null)
                      throw new InvalidKeyException("DSA keys not chainable");
                    if (! (prevKey instanceof DSAPublicKey))
                      throw new InvalidKeyException("DSA keys not chainable");
                    dsa = ((DSAPublicKey) prevKey).getParams();
                    pubKey = new DSSPublicKey(Registry.X509_ENCODING_ID,
                                              dsa.getP(), dsa.getQ(),
                                              dsa.getG(),
                                              ((DSAPublicKey) pubKey).getY());
                  }
              }
View Full Code Here

TOP

Related Classes of gnu.java.security.key.dss.DSSPublicKey

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.