Examples of DSASignature


Examples of freenet.crypt.DSASignature

                }
               
                // Is there an old DSA sig?
                if(isDSAsigPresent) {
                    fs.putSingle("sig", signature);
                    verifyDSA = DSA.verify(peerPubKey, new DSASignature(signature), new BigInteger(1, SHA256.digest(toVerifyDSA)), false);
                }

                // If there is no signature, FAIL
                // If there is an ECDSA signature, and it doesn't verify, FAIL
                // If there is a DSA signature, and it doesn't verify, FAIL
View Full Code Here

Examples of freenet.crypt.DSASignature

    try{
      byte[] ref = mySignedReference.getBytes("UTF-8");
      BigInteger m = new BigInteger(1, SHA256.digest(ref));
      if(logMINOR) Logger.minor(this, "m = "+m.toString(16));
      DSASignature _signature = DSA.sign(cryptoGroup, privKey, m, random);
      if(logMINOR && !DSA.verify(pubKey, _signature, m, false))
        throw new NodeInitException(NodeInitException.EXIT_EXCEPTION_TO_DEBUG, mySignedReference);
      return _signature;
    } catch(UnsupportedEncodingException e){
      throw new NodeInitException(NodeInitException.EXIT_CRAPPY_JVM, "Impossible: JVM doesn't support UTF-8");
View Full Code Here

Examples of freenet.crypt.DSASignature

  }

  /** Sign a hash */
  byte[] sign(byte[] hash) {
        byte[] sig = new byte[Node.SIGNATURE_PARAMETER_LENGTH*2];
        DSASignature s = DSA.sign(cryptoGroup, privKey, new NativeBigInteger(1, hash), random);
        System.arraycopy(s.getRBytes(Node.SIGNATURE_PARAMETER_LENGTH), 0, sig, 0, Node.SIGNATURE_PARAMETER_LENGTH);
        System.arraycopy(s.getSBytes(Node.SIGNATURE_PARAMETER_LENGTH), 0, sig, Node.SIGNATURE_PARAMETER_LENGTH, Node.SIGNATURE_PARAMETER_LENGTH);
    return sig;
  }
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.