コード例 #1
0
ファイル: Form1.cs プロジェクト: ritikaadit2/PGPEncrypter
        //Creates PrivateKey based on key string
        private TElPGPSecretKey GetPrivateKey(string KeyString)
        {
            MemoryStream stream = new MemoryStream();

            try
            {
                byte[] byteArray = Encoding.ASCII.GetBytes(KeyString);
                stream = new MemoryStream(byteArray);

                TElPGPSecretKey PrivateKey = new TElPGPSecretKey();
                PrivateKey.KeyHashAlgorithm = SBPGPConstants.Unit.SB_PGP_ALGORITHM_MD_AUTO;
                PrivateKey.LoadFromStream(stream);
                return(PrivateKey);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                stream.Close();
            }
        }
コード例 #2
0
ファイル: Form1.cs プロジェクト: taleleuma/PGPEncrypter
        //Creates PrivateKey based on key string
        private TElPGPSecretKey GetPrivateKey(string KeyString)
        {
            MemoryStream stream = new MemoryStream();

            try
            {
                byte[] byteArray = Encoding.ASCII.GetBytes(KeyString);
                stream = new MemoryStream(byteArray);

                TElPGPSecretKey PrivateKey = new TElPGPSecretKey();
                PrivateKey.KeyHashAlgorithm = SBPGPConstants.Unit.SB_PGP_ALGORITHM_MD_AUTO;
                PrivateKey.LoadFromStream(stream);
                return(PrivateKey);
            }
            catch (Exception ex)
            {
                Task asyncTask = WriteToLogFileAsync(string.Format("GetPrivateKey Error:{0}", ex.Message));
                throw ex;
            }
            finally
            {
                stream.Close();
            }
        }
コード例 #3
0
ファイル: PGPKeys.cs プロジェクト: agglerithm/CJRFTP
 public PGPSecretKey()
 {
     Key = new TElPGPSecretKey();
 }
コード例 #4
0
ファイル: PGPKeys.cs プロジェクト: agglerithm/CJRFTP
 public PGPSecretKey(TElPGPSecretKey key)
 {
     Key = key;
 }