Oid 类
参考地址:https://docs.microsoft.com/zh-cn/dotnet/api/system.security.cryptography.oid?redirectedfrom=MSDN&view=netframework-4.8
标题:Oid 类
表示加密对象标识符。 此类不能被继承。
using System; using System.Security.Cryptography; public class OidSample { public static void Main() { // Assign values to strings. string Value1 = "1.2.840.113549.1.1.1"; string Name1 = "3DES"; string Value2 = "1.3.6.1.4.1.311.20.2"; string InvalidName = "This name is not a valid name"; string InvalidValue = "1.1.1.1.1.1.1.1"; // Create new Oid objects using the specified values. // Note that the corresponding Value or Friendly Name property is automatically added to the object. Oid o1 = new Oid(Value1); Oid o2 = new Oid(Name1); // Create a new Oid object using the specified Value and Friendly Name properties. // Note that the two are not compared to determine if the Value is associated // with the Friendly Name. Oid o3 = new Oid(Value2, InvalidName); //Create a new Oid object using the specified Value. Note that if the value // is invalid or not known, no value is assigned to the Friendly Name property. Oid o4 = new Oid(InvalidValue); //Write out the property information of the Oid objects. Console.WriteLine("Oid1: Automatically assigned Friendly Name: {0}, {1}", o1.FriendlyName, o1.Value); Console.WriteLine("Oid2: Automatically assigned Value: {0}, {1}", o2.FriendlyName, o2.Value); Console.WriteLine("Oid3: Name and Value not compared: {0}, {1}", o3.FriendlyName, o3.Value); Console.WriteLine("Oid4: Invalid Value used: {0}, {1} {2}", o4.FriendlyName, o4.Value, Environment.NewLine); //Create an Oid collection and add several Oid objects. OidCollection oc = new OidCollection(); oc.Add(o1); oc.Add(o2); oc.Add(o3); Console.WriteLine("Number of Oids in the collection: {0}", oc.Count); Console.WriteLine("Is synchronized: {0} {1}", oc.IsSynchronized, Environment.NewLine); //Create an enumerator for moving through the collection. OidEnumerator oe = oc.GetEnumerator(); //You must execute a MoveNext() to get to the first item in the collection. oe.MoveNext(); // Write out Oids in the collection. Console.WriteLine("First Oid in collection: {0},{1}", oe.Current.FriendlyName,oe.Current.Value); oe.MoveNext(); Console.WriteLine("Second Oid in collection: {0},{1}", oe.Current.FriendlyName, oe.Current.Value); //Return index in the collection to the beginning. oe.Reset(); } }
OID value:1.3.14.3.2.26 sha1
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
2017-12-06 理解内存
2016-12-06 网络搜集-获取文件大小
2016-12-06 js获取文件大小