CSP,全名为"加密服务提供者(Cryptographic Service Provider)",是微软定义的一套password服务API.眼下经常使用的password规范或者标准有3套:CSP,PKCS#11和国密标准. 前两者主要是为RSA算法提供服务,当然PKCS#11最新的扩展也開始支持ECC算法.而国家password管理制定的国密标准.主要提供SM2(实际上也是ECC)服务,当然国密标准同一时候支持RSA.只是大多数情况下RSA的应用还是使用CSP和PKCS#11来实现…
当我不经意间在 Twitter 页面 view source 后,发现了惊喜. <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <title>Twitter</title> <style> body { background-color: #ffffff; font-family: sans-serif…
本文参考 本篇文章参考自<Effective Java>第三版第三条"Enforce the singleton property with a private constructor or an enum type" 原文的不足之处 原文给的示例代码比较简单,提供的是一种饿汉式的单例模式 // Singleton with public final field public class Elvis {     public static final Elvis INSTA…
枚举扩展方法 /// <summary> /// 扩展方法,获得枚举的Description /// </summary> /// <param name="value">枚举值</param> /// <param name="nameInstend">当枚举没有定义DescriptionAttribute,是否用枚举名代替,默认使用</param> /// <returns>枚举…
1.定义枚举类型 public enum Test { 男 = , 女 = } 2.获取枚举值 public void EnumsAction() { var s = Test.男;//男 var a = Test.男.ToString();//"男" ;//女 var x = (Test)Enum.Parse(typeof(Test), "男");//男 var x2 = Enum.Parse(typeof(Test), "男");//男 );…
1. spring整合struts的基本操作见我的上一篇博文:https://www.cnblogs.com/wyhluckdog/p/10140588.html,这里面将spring与struts2框架整合起来,并且实现了action获取service,说明spring与struts2框架已经建立联系,互通了,但是这种使用web工厂的方式太麻烦了,在开发中并不会使用这种方法,所以我就要介绍spring整合struts2框架的另外一种方法.目前有两种方法,现在介绍第一种方式,第二种方式见我的下一…
JAVA枚举相对来说比.NET的枚举功能强大,感觉就像是一种简化版的类对象,可以有构造方法,可以重载,可以继承接口等等,但不能继承类,JAVA枚举在实际开发中应用相当频繁,以下几个封装方法在实际开发中可能用到,希望对新手有些帮助. 首先,新建一个枚举接口,为保证所有继承此接口的枚举value及description一致,便于开发使用,枚举统一接口如下. public interface EnumCommon { public int getValue(); public String getDe…
枚举类为: public enum OrderStatusEnum implements CondeEnum{ NEW(0, "新订单"), FINISHED(1, "完结"), CANCLE(2, "取消"); private Integer code; private String msg; OrderStatusEnum(Integer code, String msg) { this.code = code; this.msg = msg…
枚举 package com.meeno.boot.oa.employee.enums; import com.alibaba.fastjson.annotation.JSONType; import com.meeno.boot.oa.common.BaseEnum; import com.meeno.boot.oa.common.json.EnumSerializer; import com.meeno.boot.oa.common.json.EnumDeserializer; /** *…
获取: Type type = typeof(ParamServiceType); var values = Enum.GetValues(type); ; i < values.Length; i++) { var v = values.GetValue(i); var member = type.GetMember(v.ToString()); DescriptionAttribute des = (DescriptionAttribute)System.Attribute.GetCusto…