Discuss this help topic in SecureBlackbox Forum
Generate a key on the hardware device
The connection between the application and a security token is represented by a TElPKCS11SessionInfo object from the Session list of the TElPKCS11CertStorage component.
First, set up your TElPKCS11CertStorage component and open a session to the token as described in the corresponding how-to article. Then pass a reference to the session's crypto provider (CryptoProvider property) to the constructor of the key material, e.g., TElRSAKeyMaterial.
Code example:
var
KM : TElRSAKeyMaterial;
begin
KM := TElRSAKeyMaterial.Create(Session.CryptoProvider);
try
KM.KeyID := '000001';
KM.KeySubject := #$30#$00;
KM.Generate(1024);
finally
FreeAndNil(KM);
end;