c# - Creating RSA public/private key pair with Bouncy Castle or .Net RSACryptoServiceProvider -


so i've messed around bit .net's rsacryptoserviceprovider , bouncy castle able create rsa key pairs , later on x509 certificates.

i'm curious if knows if there's difference between these 2 codeblocks, think same thing, pure bouncy castle version takes longer finish.

.net bouncy castle:

private const int rsakeysize = 4096; public static asymmetriccipherkeypair getkeypairwithdotnet() {    using (rsacryptoserviceprovider rsaprovider = new rsacryptoserviceprovider(rsakeysize))    {       rsaparameters rsakeyinfo = rsaprovider.exportparameters(true);       return dotnetutilities.getrsakeypair(rsakeyinfo);    } } 

pure bouncy castle:

private const int rsakeysize = 4096; public static asymmetriccipherkeypair getkeypair() {    cryptoapirandomgenerator randomgenerator = new cryptoapirandomgenerator();    securerandom securerandom = new securerandom(randomgenerator);    var keygenerationparameters = new keygenerationparameters(securerandom, rsakeysize);     var keypairgenerator = new rsakeypairgenerator();    keypairgenerator.init(keygenerationparameters);    return keypairgenerator.generatekeypair(); } 


Comments

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -