コード例 #1
0
        public GenerateKeysDialog(Pkcs11Slot pkcs11Slot)
        {
            InitializeComponent();
            this.Icon = Properties.Resources.Pkcs11Admin;

            if (pkcs11Slot == null)
            {
                throw new ArgumentNullException("pkcs11Slot");
            }

            _pkcs11Slot = pkcs11Slot;

            List <CKK> asymKeyTypes = pkcs11Slot.GetGeneratableAsymmetricKeyTypes();

            foreach (CKK asymKeyType in asymKeyTypes)
            {
                ComboBoxKeyType.Items.Add(new ComboBoxKeyTypeItem(asymKeyType, ComboBoxKeyTypeItem.Kinds.Asymmetric));
            }

            List <CKK> symKeyTypes = pkcs11Slot.GetGeneratableSymmetricKeyTypes();

            foreach (CKK symKeyType in symKeyTypes)
            {
                ComboBoxKeyType.Items.Add(new ComboBoxKeyTypeItem(symKeyType, ComboBoxKeyTypeItem.Kinds.Symmetric));
            }
        }
コード例 #2
0
        public CreateObjectDialog(Pkcs11Slot pkcs11Slot, List <Tuple <ObjectAttribute, ClassAttribute> > objectAttributes)
        {
            InitializeComponent();
            this.Icon = Properties.Resources.Pkcs11Admin;

            if (pkcs11Slot == null)
            {
                throw new ArgumentNullException("pkcs11Slot");
            }

            if (objectAttributes == null)
            {
                throw new ArgumentNullException("objectAttributes");
            }

            _pkcs11Slot = pkcs11Slot;

            // Add items to ListView and set the tags
            foreach (Tuple <ObjectAttribute, ClassAttribute> objectAttribute in objectAttributes)
            {
                ListViewItem listViewItem = new ListViewItem();
                listViewItem.Tag     = objectAttribute.Item1;
                listViewItem.Checked = objectAttribute.Item2.CreateSetByDefault;
                ListViewAttributes.Items.Add(listViewItem);
            }

            ReloadListView();
        }
コード例 #3
0
        public EditObjectDialog(Pkcs11Slot pkcs11Slot, Pkcs11ObjectInfo pkcs11ObjectInfo)
        {
            InitializeComponent();
            this.Icon = Properties.Resources.Pkcs11Admin;

            if (pkcs11Slot == null)
            {
                throw new ArgumentNullException("pkcs11Slot");
            }

            if (pkcs11ObjectInfo == null)
            {
                throw new ArgumentNullException("pkcs11Objectinfo");
            }

            _pkcs11Slot       = pkcs11Slot;
            _pkcs11ObjectInfo = pkcs11ObjectInfo;
            AttributeModified = false;

            // Add items to ListView and set the tags
            foreach (IObjectAttribute objectAttribute in _pkcs11ObjectInfo.ObjectAttributes)
            {
                ListViewItem listViewItem = new ListViewItem();
                listViewItem.Tag = objectAttribute;
                ListViewAttributes.Items.Add(listViewItem);
            }

            ReloadListView();
        }
コード例 #4
0
ファイル: InitTokenDialog.cs プロジェクト: TSFO27/Pkcs11Admin
        public InitTokenDialog(Pkcs11Slot slot)
        {
            InitializeComponent();
            this.Icon = Properties.Resources.Pkcs11Admin;

            _slot = slot;

            UpdateStatusStrip();
        }
コード例 #5
0
ファイル: UriDialog.cs プロジェクト: sluckywhh/Pkcs11Admin
        public UriDialog(Pkcs11Library pkcs11Library, Pkcs11Slot pkcs11Slot, Pkcs11ObjectInfo pkcs11ObjectInfo)
        {
            InitializeComponent();
            this.Icon = Properties.Resources.Pkcs11Admin;

            _pkcs11Library    = pkcs11Library;
            _pkcs11Slot       = pkcs11Slot;
            _pkcs11ObjectInfo = pkcs11ObjectInfo;

            RefreshUri();
        }
コード例 #6
0
        public ReInitTokenDialog(Pkcs11Slot slot)
        {
            InitializeComponent();
            this.Icon = Properties.Resources.Pkcs11Admin;

            _slot = slot;

            TextBoxTokenLabel.Text = _slot.TokenInfo.Label;

            UpdateStatusStrip();
        }
コード例 #7
0
ファイル: ChangePinDialog.cs プロジェクト: watsug/Pkcs11Admin
        public ChangePinDialog(Pkcs11Slot slot, CKU userType)
        {
            InitializeComponent();
            this.Icon = Properties.Resources.Pkcs11Admin;

            _slot     = slot;
            _userType = userType;

            Text = ((_userType == CKU.CKU_USER) || (_userType == CKU.CKU_CONTEXT_SPECIFIC)) ? "Change user PIN" : "Change SO PIN";

            UpdateStatusStrip();
        }
コード例 #8
0
        public ProtectedInitTokenDialog(Pkcs11Slot slot)
        {
            InitializeComponent();
            this.Icon = Properties.Resources.Pkcs11Admin;

            _slot = slot;

            if (!slot.TokenInfo.TokenInitialized)
            {
                Text = "Initialize token/card";
            }
            else
            {
                Text = "Reinitialize token/card";
                TextBoxTokenLabel.Text = slot.TokenInfo.Label;
            }

            UpdateStatusStrip();
        }
コード例 #9
0
ファイル: CsrDialog.cs プロジェクト: sluckywhh/Pkcs11Admin
        public CsrDialog(Pkcs11Slot pkcs11Slot, Pkcs11KeyInfo privKeyInfo, Pkcs11KeyInfo pubKeyInfo)
        {
            InitializeComponent();
            this.Icon = Properties.Resources.Pkcs11Admin;

            if (pkcs11Slot == null)
            {
                throw new ArgumentNullException(nameof(pkcs11Slot));
            }

            if (privKeyInfo == null)
            {
                throw new ArgumentNullException(nameof(privKeyInfo));
            }

            _pkcs11Slot  = pkcs11Slot;
            _privKeyInfo = privKeyInfo;
            _pubKeyInfo  = pubKeyInfo;

            SetupComboBoxType();
        }