All pastes #413284 Raw Edit

dsa

public java v1 · immutable
#413284 ·published 2007-03-28 09:06 UTC
rendered paste body
		// decode the received public key and get paramaters from it.		PublicKey serverPublicKey  = decodePublicKey(serverPubKeyEnc);        DHParameterSpec dhParams = ((DHPublicKey)serverPublicKey).getParams();                // Generate public/private keypair with given paramaters.        KeyPair clientKpair = StealthNetKeyAgreement.generateKeyPair(dhParams);                // Create key agreement and initialise private key.        KeyAgreement clientKeyAgree = KeyAgreement.getInstance("DH");        clientKeyAgree.init(clientKpair.getPrivate());        // Send encoded public key other party        byte[] clientPubKeyEnc = clientKpair.getPublic().getEncoded();        try {			rawOut.write(clientPubKeyEnc);			rawOut.flush();		} catch (IOException ioe) {			ioe.toString();		}