// This file is part of the OWASP O2 Platform (http://www.owasp.org/index.php/OWASP_O2_Platform) and is released under the Apache 2.0 License (http://www.apache.org/licenses/LICENSE-2.0)
using System;
using System.IO;
using Org.BouncyCastle.Crypto;
using Org.BouncyCastle.Crypto.Generators;
using Org.BouncyCastle.Crypto.Parameters;
using Org.BouncyCastle.Math;
using Org.BouncyCastle.Bcpg;
using Org.BouncyCastle.Bcpg.OpenPgp;
using Org.BouncyCastle.Security;
using Org.BouncyCastle.Utilities.IO;
using O2.Kernel;
using O2.Kernel.ExtensionMethods;
using O2.DotNetWrappers.ExtensionMethods;
using O2.DotNetWrappers.Windows;
//O2Ref:itextsharp.dll
//O2Ref:O2_DotNetWrappers.dll
//O2Ref:O2_Kernel.dll
namespace O2.XRules.Database.APIs
{
// parts of these CreateKey methods are based on the examples from http://downloads.bouncycastle.org/csharp/bccrypto-net-1.6.1-src.zip
public class API_OpenPgp
{
public string PublicKey { get; set; }
public string PrivateKey { get; set; }
public string Identity { get; set; }
public string PassPhrase { get; set; }
public API_OpenPgp()
{
}
public static API_OpenPgp load(string file)
{
return file.deserialize<API_OpenPgp>();
}
}
public static class API_OpenPgp_ExtensionMethods
{
public static API_OpenPgp openPgp(this string pathToOpenPgpFile)
{
return pathToOpenPgpFile.load<API_OpenPgp>();
}
public static string save(this API_OpenPgp openPgp)