Quantcast
Channel: Common Language Runtime Internals and Architecture forum
Viewing all articles
Browse latest Browse all 1710

How to decode a ASN.1 in C#

$
0
0

Hi, how can I decode an ASN.1 cipher?

There is a code that encodes in ASN.1. And I do not know how to decode

If someone knows how to do this in C ++. You can drop the code in this language too.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Security.Cryptography;


namespace Clipher_Ans_1
{
    class Program
    {
        static void Main(string[] args)
        {

          
            Console.WriteLine("Write text");
            string str = (Console.ReadLine());
            byte[] bytes = new byte[str.Length];
            bytes = Encoding.Default.GetBytes(str);
            AsnEncodedData asndata = new AsnEncodedData(bytes);
            Console.WriteLine(asndata.Format(true)); 

            Console.WriteLine("___________\n");



        }
    }
}






Viewing all articles
Browse latest Browse all 1710

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>