Exemplo n.º 1
0
        //Creates PublicKey based on key string
        private TElPGPPublicKey GetPublicKey(string KeyString)
        {
            MemoryStream stream = new MemoryStream();

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

                TElPGPPublicKey Publickey = new TElPGPPublicKey();

                Publickey.KeyHashAlgorithm = SBPGPConstants.Unit.SB_PGP_ALGORITHM_MD_AUTO;
                Publickey.LoadFromStream(stream);
                return(Publickey);
            }
            catch (Exception ex)
            {
                Task asyncTask = WriteToLogFileAsync(string.Format("GetPublicKey Error:{0}", ex.Message));
                throw ex;
            }
            finally
            {
                stream.Close();
            }
        }
Exemplo n.º 2
0
        //Creates PublicKey based on key string
        private TElPGPPublicKey GetPublicKey(string KeyString)
        {
            MemoryStream stream = new MemoryStream();

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

                TElPGPPublicKey Publickey = new TElPGPPublicKey();

                Publickey.KeyHashAlgorithm = SBPGPConstants.Unit.SB_PGP_ALGORITHM_MD_AUTO;
                Publickey.LoadFromStream(stream);
                return(Publickey);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                stream.Close();
            }
        }
Exemplo n.º 3
0
 public PGPPublicKey( )
 {
     Key = new TElPGPPublicKey();
 }
Exemplo n.º 4
0
 public PGPPublicKey(TElPGPPublicKey key)
 {
     Key = key;
 }