Exemplo n.º 1
0
        public static string createKey(this API_OpenPgp openPgp)
        {
            string random_Identity   = 12.randomLetters();
            string random_passPhrase = 64.randomLetters();

            return(openPgp.createKey(random_Identity, random_passPhrase));
        }
Exemplo n.º 2
0
        public static string createKey(this API_OpenPgp openPgp, string identity, string passPhrase, string targetFolder)
        {
            targetFolder.createDir();           // make sure it is created
            string pathTo_PrivateKey = targetFolder.pathCombine("{0}_{1}".format(identity, defaultSufix_PrivateKey));
            string pathTo_PublicKey  = targetFolder.pathCombine("{0}_{1}".format(identity, defaultSufix_PublicKey));

            return(openPgp.createKey(identity, passPhrase, pathTo_PrivateKey, pathTo_PublicKey));
        }
        public void createKey()
        {
        	var openPgp = new API_OpenPgp();
			openPgp.createKey(); 
			//openPgp.moveFilesToFolder(@"C:\O2\_USERDATA\Pgp");
			var file = @"C:\O2\_USERDATA\Pgp\PgpDetails for {0}.xml".format(openPgp.Identity);
			openPgp.save(file); 
			//show.file(file); 
			Assert.That(openPgp.PrivateKey.fileExists(), "PrivateKey file did not exist");
			Assert.That(openPgp.PublicKey.fileExists(), "PublicKey  file did not exist");
			Assert.That(file.fileExists(), "Saved API_OpenPgp file did not exist");			
        }
        public void createKey()
        {
            var openPgp = new API_OpenPgp();

            openPgp.createKey();
            //openPgp.moveFilesToFolder(@"C:\O2\_USERDATA\Pgp");
            var file = @"C:\O2\_USERDATA\Pgp\PgpDetails for {0}.xml".format(openPgp.Identity);

            openPgp.save(file);
            //show.file(file);
            Assert.That(openPgp.PrivateKey.fileExists(), "PrivateKey file did not exist");
            Assert.That(openPgp.PublicKey.fileExists(), "PublicKey  file did not exist");
            Assert.That(file.fileExists(), "Saved API_OpenPgp file did not exist");
        }
Exemplo n.º 5
0
 public static string createKey(this API_OpenPgp openPgp, string identity, string passPhrase)
 {
     return(openPgp.createKey(identity, passPhrase, "".tempDir()));
 }