コード例 #1
0
 // XXX if ever using ecc change this to include that.
 internal static string getHashfunction(ParameterSet pSet)
 {
   if (pSet.Name == "1.3.6.1.4.1.311.75.1.1.0")
   {
     return "1.3.14.3.2.26"; // sha-1
   }
   else
   {
     return "2.16.840.1.101.3.4.2.1"; //sha-256
   }
 }
コード例 #2
0
 public DeviceManager(SmartCardParams smartCardParams, ParameterSet parameterSet, bool useVirtualDevice = true)
 {
   this.UseVirtualDevice = useVirtualDevice;
   this.parameterSet = parameterSet;
   if (smartCardParams == null)
   {
     this.smartCardParam = new SmartCardParams("1234", 1, 0, 1);
   }
   else
   {
     this.smartCardParam = smartCardParams;
   }
 }
コード例 #3
0
    private void InitDevice(ParameterSet set)
    {

      if (device == null)
      {
        if (UseVirtualDevice)
        {
          device = new VirtualDevice(set, new BigInteger(1, deviceSecret));
        }
        else
        {
          // use a smartcard
          device = new SmartCardDevice(set.Group, set.Gd, smartCardParam);
        }
        Gq = set.Group;
        HashFunctionOID = SecurityLevelUtils.getHashfunction(set);
        hash = new HashFunction(HashFunctionOID);
        Gd = set.Gd;
      }
    }
コード例 #4
0
 /// <summary>
 /// Constructs a new VirtualDevice instance.
 /// </summary>
 /// <param name="parameterSet">The parameter set.</param>
 /// <param name="xd">The device private key.</param>
 /// <param name="preGenWdPrime">The pregenerated w_d prime value (for one presentation)</param>
 public VirtualDevice(ParameterSet parameterSet, FieldZqElement xd, FieldZqElement preGenWdPrime)
     : this(parameterSet.Group, parameterSet.Gd, FieldZq.CreateFieldZq(parameterSet.Group.Q), xd, preGenWdPrime)
 {
 }
コード例 #5
0
 /// <summary>
 /// Constructs a new VirtualDevice instance.
 /// </summary>
 /// <param name="parameterSet">The parameter set.</param>
 /// <param name="xd">The device private key.</param>
 public VirtualDevice(ParameterSet parameterSet, FieldZqElement xd)
     : this(parameterSet, xd, null)
 { }
コード例 #6
0
 /// <summary>
 /// Constructs a new VirtualDevice instance.
 /// </summary>
 /// <param name="parameterSet">The parameter set.</param>
 public VirtualDevice(ParameterSet parameterSet)
     : this(parameterSet, null, null)
 { }
コード例 #7
0
ファイル: VirtualDevice.cs プロジェクト: Eurodocs/p2abcengine
 /// <summary>
 /// Constructs a new VirtualDevice instance.
 /// </summary>
 /// <param name="parameterSet">The parameter set.</param>
 /// <param name="xd">The device private key.</param>
 /// <param name="preGenWdPrime">The pregenerated w_d prime value (for one presentation)</param>
 public VirtualDevice(ParameterSet parameterSet, FieldZqElement xd, FieldZqElement preGenWdPrime)
     : this(parameterSet.Group, parameterSet.Gd, FieldZq.CreateFieldZq(parameterSet.Group.Q), xd, preGenWdPrime)
 {
 }
コード例 #8
0
ファイル: VirtualDevice.cs プロジェクト: Eurodocs/p2abcengine
 /// <summary>
 /// Constructs a new VirtualDevice instance.
 /// </summary>
 /// <param name="parameterSet">The parameter set.</param>
 /// <param name="xd">The device private key.</param>
 public VirtualDevice(ParameterSet parameterSet, FieldZqElement xd)
     : this(parameterSet, xd, null)
 {
 }
コード例 #9
0
ファイル: VirtualDevice.cs プロジェクト: Eurodocs/p2abcengine
 /// <summary>
 /// Constructs a new VirtualDevice instance.
 /// </summary>
 /// <param name="parameterSet">The parameter set.</param>
 public VirtualDevice(ParameterSet parameterSet)
     : this(parameterSet, null, null)
 {
 }