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 ...
随机推荐
- 基于Spring Boot架构的前后端完全分离项目API路径问题
最近的一个项目采用前后端完全分离的架构,前端组件:vue + vue-router + vuex + element-ui + axios,后端组件:Spring Boot + MyBatis.之所以 ...
- Centos7环境下部署搭建discuz论坛
1.首先搭建lnmp环境 2.从官网复制git地址(https://gitee.com/ComsenzDiscuz/DiscuzX),在服务器上安装git命令 yum install git -y ...
- 创建Windows Service
基本参照使用C#创建Windows服务,添加了部分内容 目录 创建Windows Service 可视化管理Windows Service 调试 示例代码 创建Windows Service 选择C# ...
- c#内存泄漏分析
背景 给客户开发了一个WPF应用,每隔一段时间就会很卡,推测是内存泄漏引起.需要监测内存使用情况. 使用的工具 Ants Memory Profiler 百度网盘下载地址 使用教程 入门使用 参考文档 ...
- 【Codeforces627E】Orchestra(双指针_链表)
题目 Codeforces627E 翻译 好久没做英语阅读了,来爽一爽吧 ~ 描述 保罗是管弦乐队的成员.弦乐组安排在一个 \(r\times c\) 的矩形方格区域中,其中有 \(n\) 个中提琴手 ...
- Java开发笔记(一百四十二)JavaFX的对话框
JavaFX的对话框主要分为提示对话框和文件对话框两类,其中提示对话框又分作消息对话框.警告对话框.错误对话框.确认对话框四种.这四种对话框都使用Alert控件表达,并通过对话框类型加以区分,例如Al ...
- 第十届蓝桥杯大赛-特别数的和-C++
解法一(暴力获取): #include<stdio.h> #include<stdlib.h> int main(void) { int n; ; ; printf(" ...
- Delphi编码与签名【URL编码与解码,Base64编码与解码,MD5加密,HMAC-SHA1、HMAC-SHA224、HMAC-SHA256、HMAC-SHA384和HMAC-SHA512签名】
作者QQ:(648437169) 点击下载➨delphi编码与签名 [Delphi编码与签名]URL编码与解码,Base64编码与解码,MD5加密,HMAC-SHA1.HMAC-SHA224.HMAC ...
- Vue框架(二)——Vue指令(v-once指令、v-cloak指令、条件指令、v-pre指令、循环指令)、todolist案例、Vue实例(计算、监听)、组件、组件数据交互
Vue指令 1.v-once指令 单独使用,限制的标签内容一旦赋值,便不可被动更改(如果是输入框,可以主动修改) <!DOCTYPE html> <html lang=" ...
- Docker容器挂载文件(转载)
一.Docker pull 安装 Nginx 1.查看docker仓库中的 nginx 命令 # 使用 docker search 命令搜索存放在 Docker Hub 中的镜像 docker sea ...