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
Oid 类的更多相关文章
- Java类的继承与多态特性-入门笔记
相信对于继承和多态的概念性我就不在怎么解释啦!不管你是.Net还是Java面向对象编程都是比不缺少一堂课~~Net如此Java亦也有同样的思想成分包含其中. 继承,多态,封装是Java面向对象的3大特 ...
- 基于php的snmp管理端开发
一.系统环境: 操作系统:CentOS 5.4 内核:Linux_2.6 编译环境:gcc 4.1.2 代码版本:php-5.2.8.tar ...
- MongoDB框架Jongo的使用介绍
1.Jongo可以用来做什么? Jongo框架的目的是使在MongoDB中可以直接使用的查询Shell可以直接在Java中使用.在官网首页有一个非常简洁的例子: SHELL:这种查询方式是Mo ...
- Hibernate持久化类属性映射
Hibernate充当应用程序和数据库之间的中间件,实现二者之间的交互操作,他对JDBC进行了封装,以完全面向对象的方式来操作数据. 适用于有多个数据源的情况下,不必去考虑不同数据源的操作差异. Hi ...
- Hibernate的持久化类状态
Hibernate的持久化类状态 持久化类:就是一个实体类 与 数据库表建立了映射. Hibernate为了方便管理持久化类,将持久化类分成了三种状态. 瞬时态 transient (临时态):持久化 ...
- Json工具类,实现了反射将整个Object转换为Json对象的功能,支持Hibernate的延迟加
package com.aherp.framework.util; import java.lang.reflect.Array;import java.lang.reflect.Method;imp ...
- OID,主键生成策略,PO VO DTO,get和load区别,脏检查,快照,java对象的三种状态
主键生成策略 sequence 数据库端 native 数据库端 uuid 程序端 自动赋值 生成的是一个32位的16进制数 实体类需把ID改成String 类型 assigned 程序端 需手 ...
- 06.Hibernate实体类生命周期
前言:Session接口是Hibernate向应用程序提供的操作数据库的主要接口,它提供了基本的增删查改方法,而且Session具有一个缓存它是Hibernate的一级缓存.站在持久化层的角度 ...
- 1.1Hibernate持久化类和Hibernate持久化对象状态
一.持久化对象po类 1.po定义 PO,是Persistent Object的缩写,是持久化类.PO是由PO=POJO+hbm映射配置组成. 2.通俗理解 PO类即持久化类,其实就是一个普通的Jav ...
随机推荐
- IDEA中类文件显示J,IDEA Unable to import maven project: See logs for details
今天用了下lemon清理了下垃圾后,IDEA打开项目类文件图标由C变为J,在IDEA右侧的Maven Project中点击刷新提示IDEA Unable to import maven project ...
- Kubernetes 使用 Weave Scope 监控集群(十七)
目录 一.安装 二.使用 Scope 2.1.拓扑结构 2.2.在线操作 2.3.强大的搜索功能 创建 Kubernetes 集群并部署容器化应用只是第一步.一旦集群运行起来,我们需要确保一起正常,所 ...
- UE4 移动物体的几种方法
转自:https://dawnarc.com/2016/06/ue4%E7%A7%BB%E5%8A%A8%E7%89%A9%E4%BD%93%E7%9A%84%E5%87%A0%E7%A7%8D%E6 ...
- socket-02
# -- coding: utf-8 -- _author__ = "HuaQiang Yan" import socket def handle_request(client): ...
- OpenLDAP + phpLDAPadmin
一.基础设置 1.1 环境说明 Centos 7.5 openldap 1.2 关闭防火墙和selinux setenforce sed -i 's/SELINUX=enforcing/SELINUX ...
- 香农的伟大论文《A Symbolic Analysis of Relay and Switching Circuits》
香农在1938年发表的伟大论文A Symbolic Analysis of Relay and Switching Circuits(<对继电器和开关电路中的符号分析>)将开关.继电器.二 ...
- oracle 在列名后的 (+)是什么意思,如何转换为mysql
外连接的意思select *from a,bwhere a.id=b.id(+)意思就是返回a,b中匹配的行 和 a中有但是b中没有的行. 参考https://www.cnblogs.com/Aaro ...
- 测试函数——python编程从入门到实践
测试函数 学习测试,得有测试的代码.下面是一个简单的函数: name_function.py def get_formatted_name(first, last): ""&quo ...
- Redis Cluster: (error) MOVED
I have a Redis cluster with the following nodes: 192.168.0.14:6379 master (slots from 0 to 16383) ...
- Spring AOP 创建Advice 定义pointcut、advisor
前面定义的advice都是直接植入到代理接口的执行之前和之后,或者在异常发生时,事实上,还可以对植入的时机定义的更细. Pointcut定义了advice的应用时机,在Spring中pointcutA ...