Example #1
0
        //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();
            }
        }
Example #2
0
        //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();
            }
        }
Example #3
0
 public PGPSecretKey()
 {
     Key = new TElPGPSecretKey();
 }
Example #4
0
 public PGPSecretKey(TElPGPSecretKey key)
 {
     Key = key;
 }