public RutokenPkcs11LibraryFactory() { if (Platform.NativeULongSize == 4) { if (Platform.StructPackingSize == 0) { _factory = new HighLevelAPI40.Factories.RutokenPkcs11LibraryFactory(); } else { _factory = new HighLevelAPI41.Factories.RutokenPkcs11LibraryFactory(); } } else { if (Platform.StructPackingSize == 0) { _factory = new HighLevelAPI80.Factories.RutokenPkcs11LibraryFactory(); } else { _factory = new HighLevelAPI81.Factories.RutokenPkcs11LibraryFactory(); } } }
/// <summary> /// Initializes new instance of Pkcs11Factories class with custom or default factories /// </summary> /// <param name="pkcs11LibraryFactory">Custom factory for creation of IPkcs11Library 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(IPkcs11LibraryFactory pkcs11LibraryFactory, ISlotFactory slotFactory, ISessionFactory sessionFactory, IObjectAttributeFactory objectAttributeFactory, IObjectHandleFactory objectHandleFactory, IMechanismFactory mechanismFactory, IMechanismParamsFactory mechanismParamsFactory) { _pkcs11LibraryFactory = (pkcs11LibraryFactory != null) ? pkcs11LibraryFactory : new Pkcs11LibraryFactory(); _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(); }
/// <summary> /// Initializes new instance of Pkcs11Factories class with default factories /// </summary> public Pkcs11InteropFactories() { _pkcs11LibraryFactory = new Pkcs11LibraryFactory(); _slotFactory = new SlotFactory(); _sessionFactory = new SessionFactory(); _objectAttributeFactory = new ObjectAttributeFactory(); _objectHandleFactory = new ObjectHandleFactory(); _mechanismFactory = new MechanismFactory(); _mechanismParamsFactory = new MechanismParamsFactory(); }