Пример #1
0
        /**
         * Generates client's verification message given the server's credentials
         * @param serverB The server's credentials
         * @return Client's verification message for the server
         * @throws CryptoException If server's credentials are invalid
         */
        public virtual BigInteger CalculateSecret(BigInteger serverB)
        {
            this.B = Srp6Utilities.ValidatePublicValue(N, serverB);
            this.u = Srp6Utilities.CalculateU(digest, N, pubA, B);
            this.S = CalculateS();

            return(S);
        }
Пример #2
0
        /**
         * Processes the client's credentials. If valid the shared secret is generated and returned.
         * @param clientA The client's credentials
         * @return A shared secret BigInteger
         * @throws CryptoException If client's credentials are invalid
         */
        public virtual BigInteger CalculateSecret(BigInteger clientA)
        {
            this.A = Srp6Utilities.ValidatePublicValue(N, clientA);
            this.u = Srp6Utilities.CalculateU(digest, N, A, pubB);
            this.S = CalculateS();

            return(S);
        }