Exemplo n.º 1
0
        public void EncryptPCID(string strLocalPCID, ref System.IO.MemoryStream outDataStream)
        {
            //armdgpub.ky(PEM)
            String strIndgKey = "-----BEGIN PUBLIC KEY-----\r\n" +
                                "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDCm/m84KAVfQsucQZIBu1ODHQv\r\n" +
                                "WqZbCzSkLxUew+vNgwAiETvaePb5Oqvylhau4uzxg1ejssZurPg78Zn54P+2Vz2v\r\n" +
                                "8YkNywkaCqfqLway28j2pn+w/8x+GimoSb2v9CzV0ZzHwKcgSxXDwHVAvWjH0W73\r\n" +
                                "piTowb8nYDdfVUksGQIDAQAB\r\n" +
                                "-----END PUBLIC KEY-----\r\n";

            logutil.CDecrypt       decDiag       = new logutil.CDecrypt();
            System.IO.MemoryStream inDataStream  = new System.IO.MemoryStream(System.Text.Encoding.ASCII.GetBytes(strLocalPCID));
            System.IO.MemoryStream indgKeyStream = new System.IO.MemoryStream(System.Text.Encoding.ASCII.GetBytes(strIndgKey));
            decDiag.SetInputOutputDataStream(indgKeyStream, inDataStream, ref outDataStream);
            decDiag.EncryptDataStream();
        }