Contents · Forum Home · StreamSec Tools 4.1.5.363 documentation

StreamSec.DSI.CAPIExtKey

Classes, interfaces and records

classTCAPIIFPrivateKey

inherits from TExternalIFPrivateKey

The purpose of the class TCAPIIFPrivateKey is to serve as a wrapper for RSA keys stored in hardware CSPs.

function GetIdentifier: string; override; function GetKeySize: Integer; override;
These methods are used by the routines in MPIF.
function IFPrivateKeyOperation(aI: iDSInteger; var aJ: iDSInteger) : Boolean; override;
Returns the result of the inherited method.
function SignMsg(const aMsg : tBytes; aOffset, aCount : Integer; aHashAlgorithm : tHashAlgorithm; aMGFHashAlgorithm: tHashAlgorithm; aSaltLen : Cardinal; aEncoding : tSignEncoding; var aSign : tBytes; var aSignCount : Integer) : Boolean; override; function SignDigest(const aDigest : tBytes; aOffset, aCount : Integer; aHashAlgorithm : tHashAlgorithm; aMGFHashAlgorithm: tHashAlgorithm; aSaltLen : Cardinal; aEncoding : tSignEncoding; aNullMsg : Boolean; var aSign : tBytes; var aSignCount : Integer) : Boolean; override;
Returns the result of the inherited method.
function IFESDecryption(const aEMsg : tBytes; aEOffset, aECount : Integer; const aP : tBytes; aPOffset, aPCount : Integer; aHashAlgorithm : tHashAlgorithm; aMGFHashAlgorithm: tHashAlgorithm; aEncryptEncoding : tEncryptEncoding; var aMsg : tBytes; var aSuccess : Boolean) function Validate(APubl: iIFPublicKey): Boolean; override; constructor Create(ARaiseError: Boolean = False); reintroduce; destructor Destroy; override; function AcquireContext(const Container, Provider: AnsiString; ProvType: LongInt; Flags: LongInt): Boolean; overload;
CryptAcquireContext wrapper:
function AcquireContext(StoreHandle: DWORD): Boolean; overload; function GetUserKey(KeySpec: LongInt): Boolean;
CryptGetUserKey wrapper:
function ImportKey(const PKIdentifier; PKILen: Integer): Boolean; override;
ImportKey is called by TStreamSecII when the key is returned from a private key ring. This implementation does NOT call the CAPI routine with the same name. Instead it calls AcquireContext and GetUserKey.
function RetrPrivKey(var PrivKey: iIFPrivateKey): Boolean;
NOTE: The Retr... and Stor... methods are added for completeness only.
function RetrPublKey(var PublKey: iIFPublicKey): Boolean; function StorPrivKey(const PrivKey: iIFPrivateKey): Boolean; function StorPublKey(const PublKey: iIFPublicKey): Boolean; property Identifier: string read GetIdentifier;
Use Identifier to identify the key in a TStreamSecII private key ring. Identifier equals the comma separated text of the CAPI parameters.

Routines