Discuss this help topic in SecureBlackbox Forum

TElPKCS11CertStorage.AddKey

TElPKCS11CertStorage     See also     


Filter: C#  VB.NET  Pascal  C++  PHP  Java  


Adds keys to the storage.

Declaration

[C#]
    int AddKey(int SessionIndex, TElKeyMaterial KeyMaterial, bool CopyPrivateKey, bool Exportable, byte[] ID, byte[] KeyLabel);
    int AddKey(TElKeyMaterial KeyMaterial, bool CopyPrivateKey, bool Exportable, byte[] ID, byte[] KeyLabel);

[VB.NET]
    Function AddKey(ByVal SessionIndex As Integer, ByVal KeyMaterial As TElKeyMaterial, ByVal CopyPrivateKey As Boolean, ByVal Exportable As Boolean, ByVal ID As Byte(), ByVal KeyLabel As Byte()) As Integer
    Function AddKey(ByVal KeyMaterial As TElKeyMaterial, ByVal CopyPrivateKey As Boolean, ByVal Exportable As Boolean, ByVal ID As Byte(), ByVal KeyLabel As Byte()) As Integer

[Pascal]
    function AddKey(SessionIndex : integer; KeyMaterial: TElKeyMaterial; CopyPrivateKey: boolean = True; Exportable: boolean = False; const ID: ByteArray = nil; const KeyLabel: ByteArray = nil): integer;
    function AddKey(KeyMaterial: TElKeyMaterial; CopyPrivateKey: boolean = True; Exportable: boolean = False; const ID: ByteArray = nil; const KeyLabel: ByteArray = nil): integer;

[C++]
    int32_t AddKey(int32_t SessionIndex, TElKeyMaterial &KeyMaterial, bool CopyPrivateKey, bool Exportable, const std::vector<uint8_t> &ID, const std::vector<uint8_t> &KeyLabel);
    int32_t AddKey(int32_t SessionIndex, TElKeyMaterial *KeyMaterial, bool CopyPrivateKey, bool Exportable, const std::vector<uint8_t> &ID, const std::vector<uint8_t> &KeyLabel);
    int32_t AddKey(TElKeyMaterial &KeyMaterial, bool CopyPrivateKey, bool Exportable, const std::vector<uint8_t> &ID, const std::vector<uint8_t> &KeyLabel);
    int32_t AddKey(TElKeyMaterial *KeyMaterial, bool CopyPrivateKey, bool Exportable, const std::vector<uint8_t> &ID, const std::vector<uint8_t> &KeyLabel);

[PHP]
    integer AddKey(integer $SessionIndex, TElKeyMaterial $KeyMaterial, bool $CopyPrivateKey, bool $Exportable, array of byte|string|NULL $ID, array of byte|string|NULL $KeyLabel)
    integer AddKey(TElKeyMaterial $KeyMaterial, bool $CopyPrivateKey, bool $Exportable, array of byte|string|NULL $ID, array of byte|string|NULL $KeyLabel)

[Java]
    int addKey(TElKeyMaterial KeyMaterial, boolean CopyPrivateKey, boolean Exportable, byte[] ID, byte[] KeyLabel);
    int addKey(int SessionIndex, TElKeyMaterial KeyMaterial, boolean CopyPrivateKey, boolean Exportable, byte[] ID, byte[] KeyLabel);

Parameters

  • KeyMaterial - contains the key to be added
  • CopyPrivateKey - specifies if private part of the key should be added
    Default value is True
  • SessionIndex - index of the session in the list
  • Exportable - True - private key will be marked as exportable,
    False - private key will not be marked as exportable
  • ID - contains key ID
  • KeyLabel - contains key label

Return value

    Index of the newly added key in the list.

Description

    Use this method to add a key to the cryptotoken storage.

See also:     Keys     KeyIDs     RemoveKey    

Discuss this help topic in SecureBlackbox Forum