Package gnu.java.security.key.dss

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


    harness.checkPoint("TestOfGnuPrivateKeyring");
    try
      {
        GnuPrivateKeyring kr1 = new GnuPrivateKeyring();
        // store a private key
        PrivateKey pk1 = new DSSPrivateKey(Registry.ASN1_ENCODING_ID, p, q, g, x);
        kr1.putPrivateKey(ALIAS, pk1, KEY_PASSWORD);
        // 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");
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();

    byte[] message = "1 if by land, 2 if by sea...".getBytes();
View Full Code Here

        KeyStore ks1 = KeyStore.getInstance("gkr");
        harness.check(ks1 != null, "GKR-type KeyStore MUST be available");
        // load it with null i/o stream; i.e. create it
        ks1.load(null, STORE_PASSWORD);
        // store a (private) key-entry
        PrivateKey pk1 = new DSSPrivateKey(Registry.ASN1_ENCODING_ID, p, q, g, x);
        CertificateFactory x509Factory = CertificateFactory.getInstance("X.509");
        byte[] certificateBytes = SELF_SIGNED_CERT.getBytes("ASCII");
        ByteArrayInputStream bais = new ByteArrayInputStream(certificateBytes);
        Certificate c1 = x509Factory.generateCertificate(bais);
        Certificate[] chain1 = new Certificate[] { c1 };
View Full Code Here

  {
    BigInteger p = spec.getP();
    BigInteger q = spec.getQ();
    BigInteger g = spec.getG();
    BigInteger x = spec.getX();
    return new DSSPrivateKey(Registry.PKCS8_ENCODING_ID, p, q, g, x);
  }
View Full Code Here

TOP

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

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.