/// <summary> /// Constructor set default implementations of classes, which will be /// initialed in the CryptobyCore class. /// </summary> /// <remarks> /// Constructor set default implementations of classes, which will be /// initialed in the CryptobyCore class. /// </remarks> public CryptobyClient() { this.setPrimTestArt("MillerRabin"); this.setPrimetestrounds(5); this.setUi("console"); this.setCryptSymArt("AES"); this.setCryptAsymArt("RSA"); this.setKeySymArt("SHA3"); this.setKeyAsymArt("RSA"); this.core = new CryptobyCore(this); }
public virtual void testGenPrivatePublicKey2048() { for (int i = 0; i < rounds; i++) { System.Console.Out.WriteLine("genKey2048bit"); int keySize = 2048; CryptobyClient client = new CryptobyClient(); CryptobyCore core = new CryptobyCore(client); KeyGenRSA instance = new KeyGenRSA(core); instance.initGenerator(keySize); string resultPriv = instance.getPrivateKey(); string resultPub = instance.getPublicKey(); byte[] publicKey = CryptobyHelper.hexStringToBytes(resultPub); byte[] privateKey = CryptobyHelper.hexStringToBytes(resultPriv); NUnit.Framework.Assert.IsTrue(publicKey.Length == 256); NUnit.Framework.Assert.IsTrue(privateKey.Length == 512); } }
/// <param name="core">Set a new Core object in application</param> public void setCore(CryptobyCore core) { this.core = core; }