public static CalculateDHBasicAgreement ( DHPublicKeyParameters publicKey, DHPrivateKeyParameters privateKey ) : byte[] | ||
publicKey | DHPublicKeyParameters | |
privateKey | DHPrivateKeyParameters | |
return | byte[] |
protected virtual byte[] GenerateOtherSecret(int pskLength) { if (this.mKeyExchange == KeyExchangeAlgorithm.DHE_PSK) { if (mDHAgreePrivateKey != null) { return(TlsDHUtilities.CalculateDHBasicAgreement(mDHAgreePublicKey, mDHAgreePrivateKey)); } throw new TlsFatalAlert(AlertDescription.internal_error); } if (this.mKeyExchange == KeyExchangeAlgorithm.ECDHE_PSK) { if (mECAgreePrivateKey != null) { return(TlsEccUtilities.CalculateECDHBasicAgreement(mECAgreePublicKey, mECAgreePrivateKey)); } throw new TlsFatalAlert(AlertDescription.internal_error); } if (this.mKeyExchange == KeyExchangeAlgorithm.RSA_PSK) { return(this.mPremasterSecret); } return(new byte[pskLength]); }
protected virtual byte[] GenerateOtherSecret(int pskLength) { if (this.mKeyExchange == 14) { if (this.mDHAgreePrivateKey != null) { return(TlsDHUtilities.CalculateDHBasicAgreement(this.mDHAgreePublicKey, this.mDHAgreePrivateKey)); } throw new TlsFatalAlert(80); } else if (this.mKeyExchange == 24) { if (this.mECAgreePrivateKey != null) { return(TlsEccUtilities.CalculateECDHBasicAgreement(this.mECAgreePublicKey, this.mECAgreePrivateKey)); } throw new TlsFatalAlert(80); } else { if (this.mKeyExchange == 15) { return(this.mPremasterSecret); } return(new byte[pskLength]); } }
public override byte[] GeneratePremasterSecret() { if (this.mAgreementCredentials != null) { return(this.mAgreementCredentials.GenerateAgreement(this.mDHAgreePublicKey)); } if (this.mDHAgreePrivateKey == null) { throw new TlsFatalAlert(80); } return(TlsDHUtilities.CalculateDHBasicAgreement(this.mDHAgreePublicKey, this.mDHAgreePrivateKey)); }
public override byte[] GeneratePremasterSecret() { if (mAgreementCredentials != null) { return(mAgreementCredentials.GenerateAgreement(mDHAgreePublicKey)); } if (mDHAgreePrivateKey != null) { return(TlsDHUtilities.CalculateDHBasicAgreement(mDHAgreePublicKey, mDHAgreePrivateKey)); } throw new TlsFatalAlert(AlertDescription.internal_error); }
protected virtual byte[] GenerateOtherSecret(int pskLength) { if (this.keyExchange == KeyExchangeAlgorithm.DHE_PSK) { return(TlsDHUtilities.CalculateDHBasicAgreement(dhAgreeServerPublicKey, dhAgreeClientPrivateKey)); } if (this.keyExchange == KeyExchangeAlgorithm.RSA_PSK) { return(this.premasterSecret); } return(new byte[pskLength]); }
protected virtual byte[] CalculateDHBasicAgreement(DHPublicKeyParameters publicKey, DHPrivateKeyParameters privateKey) { return(TlsDHUtilities.CalculateDHBasicAgreement(publicKey, privateKey)); }