如何在C#中解码ASN.1 [英] How to decode a ASN.1 in C#

查看:163
本文介绍了如何在C#中解码ASN.1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何解码ASN.1密码?

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

如果有人知道如何在C ++中执行此操作。你也可以用这种语言删除代码。

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("Введите текст который нужно зашифровать");
            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));  //данные будут выводиться на экран в кодировке ASN.1.

            Console.WriteLine("___________\n");



        }
    }
}




推荐答案

我该如何解码ASN.1密码?

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

有一个代码在ASN.1中编码。而且我不知道如何解码

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

如果有人知道如何在C ++中执行此操作。你也可以用这种语言删除代码。

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");



        }
    }
}


这篇关于如何在C#中解码ASN.1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆