public static GenerateDHKeyPair ( SecureRandom random, DHParameters dhParams ) : AsymmetricCipherKeyPair | ||
random | SecureRandom | |
dhParams | DHParameters | |
return | AsymmetricCipherKeyPair |
public static DHPrivateKeyParameters GenerateEphemeralServerKeyExchange(SecureRandom random, DHParameters dhParams, Stream output) { AsymmetricCipherKeyPair asymmetricCipherKeyPair = TlsDHUtilities.GenerateDHKeyPair(random, dhParams); DHPublicKeyParameters publicKey = (DHPublicKeyParameters)asymmetricCipherKeyPair.Public; new ServerDHParams(publicKey).Encode(output); return((DHPrivateKeyParameters)asymmetricCipherKeyPair.Private); }
public static DHPrivateKeyParameters GenerateEphemeralClientKeyExchange(SecureRandom random, DHParameters dhParams, Stream output) { AsymmetricCipherKeyPair asymmetricCipherKeyPair = TlsDHUtilities.GenerateDHKeyPair(random, dhParams); DHPublicKeyParameters dHPublicKeyParameters = (DHPublicKeyParameters)asymmetricCipherKeyPair.Public; TlsDHUtilities.WriteDHParameter(dHPublicKeyParameters.Y, output); return((DHPrivateKeyParameters)asymmetricCipherKeyPair.Private); }
protected virtual AsymmetricCipherKeyPair GenerateDHKeyPair(DHParameters dhParams) { return(TlsDHUtilities.GenerateDHKeyPair(context.SecureRandom, dhParams)); }