Example #1
0
 public TlsSrpKeyExchange(int keyExchange, IList supportedSignatureAlgorithms, byte[] identity,
                          TlsSrpLoginParameters loginParameters)
     :   base(keyExchange, supportedSignatureAlgorithms)
 {
     this.mTlsSigner   = CreateSigner(keyExchange);
     this.mIdentity    = identity;
     this.mSrpServer   = new Srp6Server();
     this.mSrpGroup    = loginParameters.Group;
     this.mSrpVerifier = loginParameters.Verifier;
     this.mSrpSalt     = loginParameters.Salt;
 }
Example #2
0
        public override int GetSelectedCipherSuite()
        {
            int cipherSuite = base.GetSelectedCipherSuite();

            if (TlsSrpUtilities.IsSrpCipherSuite(cipherSuite))
            {
                if (mSrpIdentity != null)
                {
                    this.mLoginParameters = mSrpIdentityManager.GetLoginParameters(mSrpIdentity);
                }

                if (mLoginParameters == null)
                {
                    throw new TlsFatalAlert(AlertDescription.unknown_psk_identity);
                }
            }

            return(cipherSuite);
        }