code: func (priv *PrivateKey) Validate() error {
  	if err := checkPub(&priv.PublicKey); err != nil {
  		return err
  	}
  
  	// Check that Πprimes == n.
  	modulus := new(big.Int).Set(bigOne)
  	for _, prime := range priv.Primes {
  		// Any primes ≤ 1 will cause divide-by-zero panics later.
  		if prime.Cmp(bigOne) <= 0 {
  			return errors.New("crypto/rsa: invalid prime value")
  		}
  		modulus.Mul(modulus, prime)
  	}
  	if modulus.Cmp(priv.N) != 0 {
  		return errors.New("crypto/rsa: invalid modulus")
  	}
  
  	// Check that de ≡ 1 mod p-1, for each prime.
  	// This implies that e is coprime to each p-1 as e has a multiplicative
  	// inverse. Therefore e is coprime to lcm(p-1,q-1,r-1,...) =
  	// exponent(ℤ/nℤ). It also implies that a^de ≡ a mod p as a^(p-1) ≡ 1
  	// mod p. Thus a^de ≡ a mod n for all a coprime to n, as required.
  	congruence := new(big.Int)
  	de := new(big.Int).SetInt64(int64(priv.E))
  	de.Mul(de, priv.D)
  	for _, prime := range priv.Primes {
  		pminus1 := new(big.Int).Sub(prime, bigOne)
  		congruence.Mod(de, pminus1)
  		if congruence.Cmp(bigOne) != 0 {
  			return errors.New("crypto/rsa: invalid exponents")
  		}
  	}
  	return nil
  }
docs: // Validate performs basic sanity checks on the key.
  // It returns nil if the key is valid, or else an error describing a problem.