Пример #1
0
 /// <summary>
 /// Initializes a new instance of the MechanismFactory class
 /// </summary>
 public MechanismFactory()
 {
     if (Platform.NativeULongSize == 4)
     {
         if (Platform.StructPackingSize == 0)
         {
             _factory = new HighLevelAPI40.Factories.MechanismFactory();
         }
         else
         {
             _factory = new HighLevelAPI41.Factories.MechanismFactory();
         }
     }
     else
     {
         if (Platform.StructPackingSize == 0)
         {
             _factory = new HighLevelAPI80.Factories.MechanismFactory();
         }
         else
         {
             _factory = new HighLevelAPI81.Factories.MechanismFactory();
         }
     }
 }
Пример #2
0
 /// <summary>
 /// Initializes new instance of Pkcs11Factories class with custom or default factories
 /// </summary>
 /// <param name="pkcs11Factory">Custom factory for creation of IPkcs11 instances or null for the default factory</param>
 /// <param name="slotFactory">Custom factory for creation of ISlot instances or null for the default factory</param>
 /// <param name="sessionFactory">Custom factory for creation of ISession instances or null for the default factory</param>
 /// <param name="objectAttributeFactory">Custom factory for creation of IObjectAttribute instances or null for the default factory</param>
 /// <param name="objectHandleFactory">Custom factory for creation of IObjectHandle instances or null for the default factory</param>
 /// <param name="mechanismFactory">Custom factory for creation of IMechanism instances or null for the default factory</param>
 /// <param name="mechanismParamsFactory">Custom factory for creation of IMechanismParams instances or null for the default factory</param>
 public Pkcs11InteropFactories(IPkcs11Factory pkcs11Factory, ISlotFactory slotFactory, ISessionFactory sessionFactory, IObjectAttributeFactory objectAttributeFactory, IObjectHandleFactory objectHandleFactory, IMechanismFactory mechanismFactory, IMechanismParamsFactory mechanismParamsFactory)
 {
     _pkcs11Factory          = (pkcs11Factory != null) ? pkcs11Factory : new Pkcs11Factory();
     _slotFactory            = (slotFactory != null) ? slotFactory : new SlotFactory();
     _sessionFactory         = (sessionFactory != null) ? sessionFactory : new SessionFactory();
     _objectAttributeFactory = (objectAttributeFactory != null) ? objectAttributeFactory : new ObjectAttributeFactory();
     _objectHandleFactory    = (objectHandleFactory != null) ? objectHandleFactory : new ObjectHandleFactory();
     _mechanismFactory       = (mechanismFactory != null) ? mechanismFactory : new MechanismFactory();
     _mechanismParamsFactory = (mechanismParamsFactory != null) ? mechanismParamsFactory : new MechanismParamsFactory();
 }
Пример #3
0
 /// <summary>
 /// Initializes new instance of Pkcs11Factories class with default factories
 /// </summary>
 public Pkcs11InteropFactories()
 {
     _pkcs11Factory          = new Pkcs11Factory();
     _slotFactory            = new SlotFactory();
     _sessionFactory         = new SessionFactory();
     _objectAttributeFactory = new ObjectAttributeFactory();
     _objectHandleFactory    = new ObjectHandleFactory();
     _mechanismFactory       = new MechanismFactory();
     _mechanismParamsFactory = new MechanismParamsFactory();
 }