internal static BCryptKey Generate(string algName, uint numBits) { var alg = new BCryptAlgorithm(algName); var key = alg.GenerateKeyPair(numBits); alg.Close(); return(key); }