Contents · Forum Home · StreamSec Tools 4.1.5.363 documentation

StreamSec.DSI.ArithComp

Classes, interfaces and records

classeMPArithCompError

inherits from Exception

(no public members)

classTstRSAPublicKey — component reference

inherits from TstCustomMPKey

implements iGetRSAKey, iIFPublicKey

constructor Create(aOwner: TComponent); override;
Applications place an RSA public key on either side of a connection: a TLS/SSH client uses one to hold a peer's (server's) verification/encryption key, while a server-side component holds it to represent a client certificate's key for mTLS verification; there is no client/server-specific behavior in this class itself. » member page
function Encrypt(const aData : AnsiString; const aP : AnsiString = ''; aEncFormat : tStringFormat = sfBinary; aDataFormat: tStringFormat = sfBinary; aPFormat : tStringFormat = sfBinary) : AnsiString; overload;
RSAES-OAEP/PKCS#1v1.5 encryption to this component's public key (selected via EncryptEncoding); an application calls this to encrypt data/a key for the holder of the matching private key, e.g. wrapping a content-encryption key for CMS EnvelopedData/PKCS#12. » member page
function Encrypt(const aData : iSecretKey; const aP : AnsiString = ''; aEncFormat : tStringFormat = sfBinary; aPFormat : tStringFormat = sfBinary) : AnsiString; overload;
Overload taking an iSecretKey (e.g. a freshly generated content-encryption key) directly, avoiding an intermediate AnsiString copy of the secret. » member page
function VerifySignature(const aSignedData: AnsiString; const aSignature : AnsiString; aSignFormat: tStringFormat = sfBinary) : Boolean; overload;
RSA signature verification (PSS/PKCS#1v1.5, per SignEncoding) using this component's public key; an application calls this to check a signature received from the private-key holder, e.g. verifying a peer certificate's signature or a signed protocol message. » member page
function VerifySignature(aSignedData: TStream; const aSignature : AnsiString; aSignFormat: tStringFormat = sfBinary) : Boolean; overload;
Stream overload of VerifySignature; digests aSignedData with DigestAlgorithm before verifying, so an application can verify large data without loading it all into memory. » member page
function VerifySignedDigest(const aDigest : AnsiString; const aSignature : AnsiString; aDigestFormat: tStringFormat = sfBinary; aSignFormat : tStringFormat = sfBinary; aNullMsg : Boolean = False) : Boolean;
Verifies a signature over an already-computed digest (aDigest) instead of raw data; used when an application (or a higher-level protocol unit) has already hashed the message itself. » member page
function LoadPublicKeyFromStream(const aIdentifier: OctetString; aStrm : TStream) : Boolean; override;
Loads a public key from aStrm and checks it is the SAME key (matching modulus/exponent) as this component's current public key, rather than replacing it; used to sanity-check a key found elsewhere (e.g. inside a certificate) against an already-configured component. » member page
procedure SavePublicKey;
Persists the current public key to PublicKeyFileName using PublicKeyFormat; an application calls this after SetPublicKey/GenerateNewKeys to write the key out for later reuse. » member page
procedure SavePublicKeyToStream(aStrm: TStream; const aIntf: TGUID); override;
Low-level stream save used by the key-manager/format-list machinery (and directly by protocol code that needs a specific wire format): aIntf selects which key-format encoder to use instead of the component's configured PublicKeyFormat, e.g. the SSH client passes an SSH-protocol-format GUID here to get the ssh-rsa wire blob rather than PEM/DER. » member page
procedure SetPublicKey(const aPubl: iIFPublicKey);
Injects an already-obtained iIFPublicKey (e.g. extracted from a certificate or received from a peer) into this component, so its Encrypt/VerifySignature methods can be used without loading a key file. » member page
procedure SuggestRequiredUnits(aProc: tGetStringMethod); override;
Design-time/IDE helper: reports the implementation units this component needs in the project's uses clause -- the RSA/IFC engine (stAes, stDrbgAesCtr, StreamSec.DSI.IFC) plus the units implementing the selected DigestAlgorithm and MGFHashAlgorithm; an application does not need to call this at runtime. » member page
property EncodingRange: Integer read GetEncodingRange;
Maximum plaintext length, in bytes, that Encrypt can accept for the current key size, digest and EncryptEncoding; applications use this to size data before calling Encrypt. » member page
property Enabled;
Enables/loads the key (True) or clears it (False); an application normally does not set this directly, it is driven by assigning PublicKeyFileName or SetPublicKey. » member page
property EnabledDesignTime;
Whether Enabled auto-activates at design time in the IDE; rarely touched by application code. » member page
property EnabledRunTime;
Whether Enabled auto-activates at run time; an application can set this False to defer loading the key file until it explicitly sets Enabled/PublicKeyFileName itself. » member page
property PublicKeyFormat: tDSIIFPublicKeyFormatList read fPublicKeyFormat write SetPublicKeyFormat;
Selects which on-disk/stream public-key format(s) (e.g. PEM, DER, PKCS#1) this component accepts when loading via PublicKeyFileName; an application picks the format matching its key files. » member page
property PublicKeyFileName;
Path to a file holding the public key; setting this loads the key immediately (subject to EnabledDesignTime/EnabledRunTime) -- the common way an application supplies a peer's public key. » member page
property SignEncoding: tSignEncoding read fSignEncoding write SetSignEncoding default seEMSA4;
Signature padding scheme (PSS vs PKCS#1 v1.5) used by VerifySignature/VerifySignedDigest; an application must match whatever the signer (client or server, per the protocol) used. » member page
property DigestAlgorithm: tHashAlgorithm read fDigestAlgorithm write SetDigestAlgorithm default haSHA256;
Hash algorithm used both for signature verification and (together with MGFHashAlgorithm) for OAEP encryption; must match the value used by the private-key holder. Defaults to SHA-256 (NIST disallows SHA-1 for generating signatures). » member page
property MGFHashAlgorithm: tHashAlgorithm read fMGFHashAlgorithm write SetMGFHashAlgorithm default haSHA256;
Mask-generation-function hash for PSS signatures and OAEP encryption; normally left at its default (SHA-256) unless interoperating with a peer that mandates a specific MGF hash. » member page
property SaltLen: Cardinal read FSaltLen write SetSaltLen default 32;
PSS salt length, in bytes, used by VerifySignature/VerifySignedDigest when SignEncoding is PSS-based; must match the salt length the signer used. Defaults to 32, the SHA-256 length. » member page
property EncryptEncoding: tEncryptEncoding read fEncryptEncoding write SetEncryptEncoding default eeEME1;
Encryption padding scheme (OAEP vs PKCS#1 v1.5) used by Encrypt; an application selects this to match what the corresponding Decrypt (private-key) side expects. » member page

classTstRSAKey — component reference

inherits from TstRSAPublicKey

implements iIFPrivateKey

constructor Create(AOwner: TComponent); override;
The private-key counterpart of TstRSAPublicKey: applications use this on whichever side of a connection holds the RSA private key -- typically the server (TLS server certificate key, SSH/Snip host key) but equally a client doing RSA-based mTLS. » member page
function Decrypt(const aEData : AnsiString; const aP : AnsiString = ''; aEncFormat : tStringFormat = sfBinary; aDataFormat: tStringFormat = sfBinary; aPFormat : tStringFormat = sfBinary) : AnsiString; overload;
RSA decryption (inverse of TstRSAPublicKey.Encrypt) using this component's private key; an application calls this to recover data/a key that a peer encrypted to its public key. » member page
procedure Decrypt(const aEData : AnsiString; out aData : iSecretKey; const aP : AnsiString = ''; aEncFormat : tStringFormat = sfBinary; aPFormat : tStringFormat = sfBinary); overload;
Overload returning the decrypted data as an iSecretKey rather than an AnsiString, so a recovered content-encryption key/shared secret can be wiped via ProtectClear-aware handling. » member page
function GenerateSignature(const aSignedData: OctetString; aSignFormat: tStringFormat = sfBinary) : AnsiString; overload;
Signs aSignedData with this component's private key; an application calls this to produce e.g. a CertificateVerify/CMS SignerInfo signature or a self-signed certificate signature. » member page
function GenerateSignature(aSignedData: TStream; aSignFormat: tStringFormat = sfBinary) : AnsiString; overload;
Stream overload of GenerateSignature; digests aSignedData with DigestAlgorithm before signing, so an application can sign large data without loading it all into memory. » member page
function GenerateSignatureDigest(const aDigest : AnsiString; aDigestFormat: tStringFormat = sfBinary; aSignFormat : tStringFormat = sfBinary; aNullMsg : Boolean = False) : AnsiString;
Signs an already-computed digest instead of raw data; used when the caller (application or higher-level protocol code) has already hashed the message itself. » member page
procedure GenerateNewKeys(aBitSize: Cardinal; aSave: Boolean = True);
Generates a fresh RSA keypair of aBitSize bits (honoring KeyGenerationKind) and, if aSave is True, immediately persists it via SavePrivateKey/SavePublicKey; an application calls this to provision a new host key or client certificate key pair. » member page
procedure SavePrivateKey;
Persists the current private key to PrivateKeyFileName (encrypted with PrivateKeyPassword, per PrivateKeyFormat); an application calls this after GenerateNewKeys/SetPrivateKey. » member page
procedure SavePrivateKeyToStream(aStrm: TStream; const aIntf: TGUID); override;
Low-level stream save counterpart of SavePublicKeyToStream (see TstRSAPublicKey): aIntf picks the key-format encoder, letting protocol code request a specific wire format instead of PrivateKeyFormat. » member page
procedure SetPrivateKey(const aPriv: iIFPrivateKey);
Injects an already-obtained iIFPrivateKey (e.g. loaded elsewhere or from a keyring) into this component, so its Decrypt/GenerateSignature methods can be used directly. » member page
property KeyGenerationKind: tIFKeyGenerationKind read fKeyGenerationKind write SetKeyGenerationKind;
Constraints applied when GenerateNewKeys creates a key (e.g. exportable, provable prime generation); an application tunes this before calling GenerateNewKeys, not afterwards. » member page
property PrivateKeyFormat: tDSIIFPrivateKeyFormatList read fPrivateKeyFormat write SetPrivateKeyFormat;
Selects which on-disk/stream private-key format(s) (e.g. PEM, PKCS#8, PVK) this component accepts/produces via PrivateKeyFileName/SavePrivateKey. » member page
property PrivateKeyFileName;
Path to a file holding the (normally encrypted) private key; setting this loads the key -- the common way an application supplies its own host/client key material. » member page
property PrivateKeyPassword;
Password protecting the on-disk private key; required before PrivateKeyFileName/SavePrivateKey will succeed for password-based formats. » member page
property OnPassword;
Fired when a password is needed to decrypt the private key file; an application handles this to prompt the user or supply a stored credential instead of setting PrivateKeyPassword up front. » member page
property OnTerminate;
Fired periodically during long-running key generation so an application can offer a cancel option; setting aTerminate to True in the handler aborts GenerateNewKeys. » member page

classTstDSSPublicKey — component reference

inherits from TstCustomMPKey

implements iGetDSSKey, iDLPublicKey

constructor Create(aOwner: TComponent); override;
DSA (classic Digital Signature Algorithm) public-key component; an application uses this to hold a peer's/CA's DSA verification key, e.g. when validating a legacy DSA-signed certificate or CMS SignerInfo. No client/server-specific behavior in this class itself. » member page
function VerifySignature(const aSignedData: AnsiString; const aSignature : AnsiString; aSignFormat: tStringFormat = sfBinary) : Boolean; overload;
Verifies a DSA signature over aSignedData against this component's public key. » member page
function VerifySignature(aSignedData: TStream; const aSignature : AnsiString; aSignFormat: tStringFormat = sfBinary) : Boolean; overload;
Stream overload; digests aSignedData with DigestAlgorithm before verifying. » member page
function VerifySignedDigest(const aDigest : AnsiString; const aSignature : AnsiString; aDigestFormat: tStringFormat = sfBinary; aSignFormat : tStringFormat = sfBinary; aNullMsg : Boolean = False) : Boolean;
Verifies a DSA signature over an already-computed digest instead of raw data. » member page
function LoadPublicKeyFromStream(const aIdentifier: OctetString; aStrm : TStream) : Boolean; override;
Loads a public key from aStrm and checks it matches this component's current key, rather than replacing it; used to sanity-check a key found elsewhere against an already-configured component. » member page
procedure SavePublicKey;
Persists the current public key to PublicKeyFileName using PublicKeyFormat. » member page
procedure SavePublicKeyToStream(aStrm: TStream; const aIntf: TGUID); override;
See TstRSAPublicKey.SavePublicKeyToStream: low-level stream save keyed by aIntf, used by the key-format/key-manager machinery rather than typical application code. » member page
procedure SetPublicKey(const aPubl: iDLPublicKey);
Injects an already-obtained iDLPublicKey (e.g. extracted from a certificate) into this component. » member page
procedure SuggestRequiredUnits(aProc: tGetStringMethod); override;
Reports the units an application must add to its uses clause for the selected key formats and DigestAlgorithm (adds stAes, stDrbgAesCtr, StreamSec.DSI.FFC and the hash unit for DigestAlgorithm). A design-time helper for the IDE component editor; not called by application code. » member page
property Enabled;
Enables/loads the key (True) or clears it (False); normally driven indirectly via PublicKeyFileName or SetPublicKey rather than set directly. » member page
property EnabledDesignTime;
Whether Enabled auto-activates at design time; rarely touched by application code. » member page
property EnabledRunTime;
Whether Enabled auto-activates at run time; an application can set this False to defer loading until it explicitly enables the key. » member page
property PublicKeyFormat: tDSIDLPublicKeyFormatList read fPublicKeyFormat write SetPublicKeyFormat;
Selects which on-disk/stream public-key format(s) this component accepts via PublicKeyFileName. » member page
property PublicKeyFileName;
Path to a file holding the public key; setting this loads the key -- the usual way an application supplies a peer's DSA public key. » member page
property DigestAlgorithm: tHashAlgorithm read fDigestAlgorithm write SetDigestAlgorithm default haSHA256;
Hash algorithm used for signature verification; must match what the signer used. Defaults to SHA-256. » member page
property DEREncode: Boolean read fDEREncode write SetDEREncode;
When True, VerifySignature/VerifySignedDigest expect the DER SEQUENCE(r,s) signature encoding; when False, the raw fixed-length r||s encoding is expected instead (e.g. as used by SSH). An application must set this to match the wire format of the protocol in use. » member page

classTstDSSKey — component reference

inherits from TstDSSPublicKey

implements iDLPrivateKey

function GenerateSignature(const aSignedData: AnsiString; aSignFormat: tStringFormat = sfBinary) : AnsiString; overload;
Signs aSignedData with this component's DSA private key; an application calls this on whichever side holds the private key (a signer, e.g. a CA or an SSH host). » member page
function GenerateSignature(aSignedData: TStream; aSignFormat: tStringFormat = sfBinary) : AnsiString; overload;
Stream overload; digests aSignedData with DigestAlgorithm before signing. » member page
function GenerateSignatureDigest(const aDigest : AnsiString; aDigestFormat: tStringFormat = sfBinary; aSignFormat : tStringFormat = sfBinary; aNullMsg : Boolean = False) : AnsiString;
Signs an already-computed digest instead of raw data. » member page
procedure GenerateNewKeys(aBitSize: Cardinal; aSave: Boolean = True);
Generates a fresh DSA keypair with aBitSize-bit modulus and, if aSave is True, persists it via SavePrivateKey/SavePublicKey. » member page
procedure SavePrivateKey;
Persists the current private key to PrivateKeyFileName (encrypted with PrivateKeyPassword). » member page
procedure SavePrivateKeyToStream(aStrm: TStream; const aIntf: TGUID); override;
See TstRSAKey.SavePrivateKeyToStream: low-level stream save keyed by aIntf, used by the key-format/key-manager machinery rather than typical application code. » member page
procedure SetPrivateKey(const aPriv: iDLPrivateKey);
Injects an already-obtained iDLPrivateKey into this component. » member page
property PrivateKeyFormat: tDSIDLPrivateKeyFormatList read fPrivateKeyFormat write SetPrivateKeyFormat;
Selects which on-disk/stream private-key format(s) this component accepts/produces. » member page
property PrivateKeyFileName;
Path to a file holding the (normally encrypted) private key; setting this loads the key. » member page
property PrivateKeyPassword;
Password protecting the on-disk private key. » member page
property OnPassword;
Fired when a password is needed to decrypt the private key file. » member page
property OnTerminate;
Fired periodically during GenerateNewKeys so an application can offer a cancel option. » member page

classTstECDSAPublicKey — component reference

inherits from TstCustomMPKey

implements iGetECDSAKey, iDLPublicKey

constructor Create(aOwner: TComponent); override;
ECDSA public-key component (RFC 5656/5480 elliptic-curve DSA); an application uses this to hold a peer's/CA's ECDSA verification key -- e.g. a TLS/SSH client validating a server's ECDSA certificate/host key, or an SSH server validating a client's ECDSA user-authentication key. No client/server split in this class itself; either side may hold either role. » member page
function VerifySignature(const aSignedData: AnsiString; const aSignature : AnsiString; aSignFormat: tStringFormat = sfBinary) : Boolean; overload;
Verifies an ECDSA signature over aSignedData against this component's public key. » member page
function VerifySignature(aSignedData: TStream; const aSignature : AnsiString; aSignFormat: tStringFormat = sfBinary) : Boolean; overload;
Stream overload; digests aSignedData with DigestAlgorithm before verifying. » member page
function VerifySignedDigest(const aDigest : AnsiString; const aSignature : AnsiString; aDigestFormat: tStringFormat = sfBinary; aSignFormat : tStringFormat = sfBinary; aNullMsg : Boolean = False) : Boolean;
Verifies an ECDSA signature over an already-computed digest instead of raw data. » member page
function LoadPublicKeyFromStream(const aIdentifier: OctetString; aStrm : TStream) : Boolean; override;
Loads a public key from aStrm and checks it matches this component's current key, rather than replacing it. » member page
procedure SavePublicKey;
Persists the current public key to PublicKeyFileName using PublicKeyFormat. » member page
procedure SavePublicKeyToStream(aStrm: TStream; const aIntf: TGUID); override;
See TstRSAPublicKey.SavePublicKeyToStream: low-level stream save keyed by aIntf, used by the key-format/key-manager machinery rather than typical application code. » member page
procedure SetPublicKey(const aPubl: iDLPublicKey);
Injects an already-obtained iDLPublicKey (e.g. extracted from a certificate) into this component. » member page
procedure SuggestRequiredUnits(aProc: tGetStringMethod); override;
Reports (via aProc) the runtime units this component needs linked in -- stAes, stDrbgAesCtr, StreamSec.DSI.ECC and the unit implementing DigestAlgorithm; used by the design-time uses-clause helper, not normally called by application code. » member page
property Enabled;
Enables/loads the key (True) or clears it (False); normally driven indirectly via PublicKeyFileName or SetPublicKey. » member page
property EnabledDesignTime;
Whether Enabled auto-activates at design time; rarely touched by application code. » member page
property EnabledRunTime;
Whether Enabled auto-activates at run time. » member page
property PublicKeyFormat: tDSIDLPublicKeyFormatList read fPublicKeyFormat write SetPublicKeyFormat;
Selects which on-disk/stream public-key format(s) this component accepts via PublicKeyFileName. » member page
property PublicKeyFileName;
Path to a file holding the public key; setting this loads the key. » member page
property DigestAlgorithm: tHashAlgorithm read fDigestAlgorithm write SetDigestAlgorithm default haSHA256;
Hash algorithm used for signature verification; must match what the signer used. Defaults to SHA-256. » member page
property DEREncode: Boolean read fDEREncode write SetDEREncode;
When True, VerifySignature/VerifySignedDigest expect the DER SEQUENCE(r,s) signature encoding (as used by X.509/TLS); when False, the raw fixed-length r||s encoding is expected instead (as used by SSH's ecdsa-sha2-nistp* host-key signatures). An application must set this to match the wire format of the protocol in use. » member page

classTstECDSAKey — component reference

inherits from TstECDSAPublicKey

implements iDLPrivateKey

function GenerateSignature(const aSignedData: AnsiString; aSignFormat: tStringFormat = sfBinary) : AnsiString; overload;
Signs aSignedData with this component's ECDSA private key; used, e.g., as an SSH host key (TsnipServer.ECDSAKey in StreamSec.Snip.Server) or an SSH public-key client-auth key, and more generally wherever an ECDSA signature is produced (certificate/CMS signing). » member page
function GenerateSignature(aSignedData: TStream; aSignFormat: tStringFormat = sfBinary) : AnsiString; overload;
Stream overload; digests aSignedData with DigestAlgorithm before signing. » member page
function GenerateSignatureDigest(const aDigest : AnsiString; aDigestFormat: tStringFormat = sfBinary; aSignFormat : tStringFormat = sfBinary; aNullMsg : Boolean = False) : AnsiString;
Signs an already-computed digest instead of raw data. » member page
procedure GenerateNewKeys(aCurve: ObjectIdentifier; aSave: Boolean = True);
Generates a fresh ECDSA keypair on curve aCurve (an OID, e.g. secp256r1/secp384r1) and, if aSave is True, persists it via SavePrivateKey/SavePublicKey; an application calls this to provision a new host key or certificate key pair for a chosen curve. » member page
procedure SavePrivateKey;
Persists the current private key to PrivateKeyFileName (encrypted with PrivateKeyPassword). » member page
procedure SavePrivateKeyToStream(aStrm: TStream; const aIntf: TGUID); override;
See TstRSAKey.SavePrivateKeyToStream: low-level stream save keyed by aIntf, used by the key-format/key-manager machinery rather than typical application code. » member page
procedure SetPrivateKey(const aPriv: iDLPrivateKey);
Injects an already-obtained iDLPrivateKey into this component. » member page
property PrivateKeyFormat: tDSIDLPrivateKeyFormatList read fPrivateKeyFormat write SetPrivateKeyFormat;
Selects which on-disk/stream private-key format(s) this component accepts/produces. » member page
property PrivateKeyFileName;
Path to a file holding the (normally encrypted) private key; setting this loads the key. » member page
property PrivateKeyPassword;
Password protecting the on-disk private key. » member page
property OnPassword;
Fired when a password is needed to decrypt the private key file. » member page

classTstMLDSAPublicKey — component reference

inherits from TstCustomMPKey

implements iGetMLDSAKey, iMLDSAPublicKey

constructor Create(aOwner: TComponent); override;
ML-DSA (FIPS 204, post-quantum lattice signature) public-key component; an application uses this to hold a peer's/CA's ML-DSA verification key, e.g. validating a PQ or hybrid TLS 1.3/CMS/PKIX signature from either a client or a server certificate. » member page
function VerifySignature(const aSignedData: AnsiString; const aSignature : AnsiString; aSignFormat: tStringFormat = sfBinary) : Boolean; overload;
Verifies an ML-DSA signature (Hash-ML-DSA or Pure-ML-DSA depending on DigestAlgorithm) over aSignedData. » member page
function VerifySignature(const aSignedData: AnsiString; const aCtx : AnsiString; const aSignature : AnsiString; aSignFormat: tStringFormat = sfBinary) : Boolean; overload;
Overload accepting an explicit application context aCtx (FIPS 204 ctx string, at most 255 bytes), used when the protocol/application binds signatures to a specific context string. » member page
function VerifySignature(aSignedData: TStream; const aSignature : AnsiString; aSignFormat: tStringFormat = sfBinary) : Boolean; overload;
Stream overload. When DigestAlgorithm is haNull the whole stream is read and verified as-is (pure ML-DSA over the raw message); otherwise aSignedData is first digested with DigestAlgorithm and that digest is verified (the pre-hash variant). » member page
function VerifySignedDigest(const aDigest : AnsiString; const aSignature : AnsiString; aDigestFormat: tStringFormat = sfBinary; aSignFormat : tStringFormat = sfBinary) : Boolean; overload;
Verifies an ML-DSA signature over an already-computed digest instead of raw data. » member page
function VerifySignedDigest(const aDigest : AnsiString; const aCtx : AnsiString; const aSignature : AnsiString; aDigestFormat: tStringFormat = sfBinary; aCtxFormat : tStringFormat = sfBinary; aSignFormat : tStringFormat = sfBinary) : Boolean; overload;
Overload with an explicit application context aCtx; see the VerifySignature aCtx overload. » member page
function LoadPublicKeyFromStream(const aIdentifier: OctetString; aStrm : TStream) : Boolean; override;
Loads a public key from aStrm and checks it matches this component's current key, rather than replacing it. » member page
procedure SavePublicKey;
Persists the current public key to PublicKeyFileName using PublicKeyFormat. » member page
procedure SavePublicKeyToStream(aStrm: TStream; const aIntf: TGUID); override;
See TstRSAPublicKey.SavePublicKeyToStream: low-level stream save keyed by aIntf, used by the key-format/key-manager machinery rather than typical application code. » member page
procedure SetPublicKey(const aPubl: iMLDSAPublicKey);
Injects an already-obtained iMLDSAPublicKey (e.g. extracted from a certificate) into this component. » member page
procedure SuggestRequiredUnits(aProc: tGetStringMethod); override;
Reports the runtime units this component pulls in (stAes, stDrbgAesCtr, stSHA3, StreamSec.DSI.MLC, plus the unit implementing the current DigestAlgorithm) so the IDE's uses-clause manager can add them; not called from application code. » member page
property Enabled;
Enables/loads the key (True) or clears it (False); normally driven indirectly via PublicKeyFileName or SetPublicKey. » member page
property EnabledDesignTime;
Whether Enabled auto-activates at design time; rarely touched by application code. » member page
property EnabledRunTime;
Whether Enabled auto-activates at run time. » member page
property PublicKeyFormat: tDSIMLDSAPublicKeyFormatList read fPublicKeyFormat write SetPublicKeyFormat;
Selects which on-disk/stream public-key format(s) this component accepts via PublicKeyFileName. » member page
property PublicKeyFileName;
Path to a file holding the public key; setting this loads the key. » member page
property DigestAlgorithm: tHashAlgorithm read fDigestAlgorithm write SetDigestAlgorithm default haNull;
Set property DigestAlgorithm to haNull, to use the Pure-ML-DSA algorithm from FIPS 204. Set any defined and implemented hash algorithm to instead use the Hash-ML-DSA algorithm. An application picks this to match whichever variant (Pure vs Hash) the signer (client or server) used -- e.g. as negotiated in a TLS 1.3 signature_algorithms extension. » member page

classTstMLDSAKey — component reference

inherits from TstMLDSAPublicKey

implements iMLDSAPrivateKey

function GenerateSignature(const aSignedData: AnsiString; aSignFormat: tStringFormat = sfBinary) : AnsiString; overload;
Signs aSignedData with this component's ML-DSA private key; an application calls this on whichever side (client or server) holds the PQ/hybrid signing key, e.g. for a TLS 1.3 CertificateVerify or a CMS SignerInfo. » member page
function GenerateSignature(const aSignedData: AnsiString; aCtx : AnsiString; aSignFormat: tStringFormat = sfBinary) : AnsiString; overload;
Overload taking an explicit application context aCtx; see the matching VerifySignature overload on TstMLDSAPublicKey. » member page
function GenerateSignature(aSignedData: TStream; aSignFormat: tStringFormat = sfBinary) : AnsiString; overload;
Stream overload. When DigestAlgorithm is haNull the whole stream is read and signed as-is (pure ML-DSA over the raw message); otherwise aSignedData is first digested with DigestAlgorithm and that digest is signed (the pre-hash variant). » member page
function GenerateSignatureDigest(const aDigest : AnsiString; aDigestFormat: tStringFormat = sfBinary; aSignFormat : tStringFormat = sfBinary) : AnsiString; overload;
Signs an already-computed digest instead of raw data. » member page
function GenerateSignatureDigest(const aDigest : AnsiString; const aCtx : AnsiString; aDigestFormat: tStringFormat = sfBinary; aCtxFormat : tStringFormat = sfBinary; aSignFormat : tStringFormat = sfBinary) : AnsiString; overload;
Overload with an explicit application context aCtx. » member page
procedure GenerateNewKeys(aBitSize: tMLDSASize; aSave: Boolean = True);
Generates a fresh ML-DSA keypair of the given FIPS 204 parameter set (aBitSize, e.g. ML-DSA-65) and, if aSave is True, persists it via SavePrivateKey/SavePublicKey. » member page
procedure SavePrivateKey;
Persists the current private key to PrivateKeyFileName (encrypted with PrivateKeyPassword). » member page
procedure SavePrivateKeyToStream(aStrm: TStream; const aIntf: TGUID); override;
See TstRSAKey.SavePrivateKeyToStream: low-level stream save keyed by aIntf, used by the key-format/key-manager machinery rather than typical application code. » member page
procedure SetPrivateKey(const aPriv: iMLDSAPrivateKey);
Injects an already-obtained iMLDSAPrivateKey into this component. » member page
property UseVerbosePrivateKeyFormat: Boolean read GetUseVerbosePrivateKeyFormat write SetUseVerbosePrivateKeyFormat default True;
Selects the verbose (human-readable, larger) vs compact private-key encoding when saving; an application would only turn this off to save space, trading off inspectability. Full description »
property PrivateKeyFormat: tDSIMLDSAPrivateKeyFormatList read fPrivateKeyFormat write SetPrivateKeyFormat;
Selects which on-disk/stream private-key format(s) this component accepts/produces. » member page
property PrivateKeyFileName;
Path to a file holding the (normally encrypted) private key; setting this loads the key. » member page
property PrivateKeyPassword;
Password protecting the on-disk private key. » member page
property OnPassword;
Fired when a password is needed to decrypt the private key file. » member page
property OnTerminate;
Inherited cancel-poll hook (invoked via GetTerminate). It is not exercised by ML-DSA GenerateNewKeys, which performs a single one-shot lattice DSAKeyGen with no iterative polling, so assigning a handler here has no effect on key generation for this component. » member page

classTstMLKEMPublicKey — component reference

inherits from TstCustomMPKey

implements iGetMLKEMKey, iMLKEMPublicKey

constructor Create(aOwner: TComponent); override;
ML-KEM (FIPS 203) public-key/encapsulation-key component; an application uses this to hold a peer's ML-KEM encapsulation key and produce a shared secret + ciphertext against it via Encapsulate. Full description »
function Encapsulate(out aSharedSecretKey : iSecretKey; aCipherTextFormat: tStringFormat = sfBinary) : AnsiString;
The function Encapsulate corresponds to Algorithm 20 ML-KEM.Encaps from FIPS 203. The input ML-KEM encapsulation key is used together with an approved random generator, to generate a Shared Secret Key, and a cipher text of this shared secret. Full description »
function LoadPublicKeyFromStream(const aIdentifier: OctetString; aStrm : TStream) : Boolean; override;
Loads a public key from aStrm and checks it matches this component's current key, rather than replacing it. » member page
procedure SavePublicKey;
Persists the current public key to PublicKeyFileName using PublicKeyFormat. » member page
procedure SavePublicKeyToStream(aStrm: TStream; const aIntf: TGUID); override;
See TstRSAPublicKey.SavePublicKeyToStream: low-level stream save keyed by aIntf, used by the key-format/key-manager machinery rather than typical application code. » member page
procedure SetPublicKey(const aPubl: iMLKEMPublicKey);
Injects an already-obtained iMLKEMPublicKey (e.g. one decoded from a peer's certificate or key store) into this component. » member page
procedure SuggestRequiredUnits(aProc: tGetStringMethod); override;
Design-time helper: reports the runtime units this component depends on (stAes, stDrbgAesCtr, stSHA3, StreamSec.DSI.MLC) so the IDE can add them to a project's uses clause; not called by ordinary application code. » member page
property Enabled;
Enables/loads the key (True) or clears it (False); normally driven indirectly via PublicKeyFileName or SetPublicKey. » member page
property EnabledDesignTime;
Whether Enabled auto-activates at design time; rarely touched by application code. » member page
property EnabledRunTime;
Whether Enabled auto-activates at run time. » member page
property PublicKeyFormat: tDSIMLKEMPublicKeyFormatList read fPublicKeyFormat write SetPublicKeyFormat;
Selects which on-disk/stream public-key format(s) this component accepts via PublicKeyFileName. » member page
property PublicKeyFileName;
Path to a file holding the public key; setting this loads the key. » member page

classTstMLKEMKey — component reference

inherits from TstMLKEMPublicKey

implements iMLKEMPrivateKey

function Decapsulate(const aCipherText : AnsiString; aCipherTextFormat: tStringFormat = sfBinary) : iSecretKey;
The function Decapsulate corresponds to Algorithm 21 ML-KEM.Decaps from FIPS 203. The input ML-KEM decapsulation key is used to extract a Shared Secret Key from a cipher text of this shared secret. Full description »
procedure GenerateNewKeys(aBitSize: tMLKEMSize; aSave: Boolean = True);
Generates a fresh ML-KEM keypair of the given FIPS 203 parameter set (aBitSize, e.g. ML-KEM-768) and, if aSave is True, persists it via SavePrivateKey/SavePublicKey. » member page
procedure SavePrivateKey;
Persists the current private key to PrivateKeyFileName (encrypted with PrivateKeyPassword). » member page
procedure SavePrivateKeyToStream(aStrm: TStream; const aIntf: TGUID); override;
See TstRSAKey.SavePrivateKeyToStream: low-level stream save keyed by aIntf, used by the key-format/key-manager machinery rather than typical application code. » member page
procedure SetPrivateKey(const aPriv: iMLKEMPrivateKey);
Injects an already-obtained iMLKEMPrivateKey into this component. » member page
property UseVerbosePrivateKeyFormat: Boolean read GetUseVerbosePrivateKeyFormat write SetUseVerbosePrivateKeyFormat default True;
Selects the verbose (human-readable, larger) vs compact private-key encoding when saving. Like TstMLDSAKey.UseVerbosePrivateKeyFormat, this forwards to the same shared ML-DSA/ML-KEM pool flag, so it is process-wide rather than per-component. » member page
property PrivateKeyFormat: tDSIMLKEMPrivateKeyFormatList read fPrivateKeyFormat write SetPrivateKeyFormat;
Selects which on-disk/stream private-key format(s) this component accepts/produces. » member page
property PrivateKeyFileName;
Path to a file holding the (normally encrypted) private key; setting this loads the key. » member page
property PrivateKeyPassword;
Password protecting the on-disk private key. » member page
property OnPassword;
Fired when a password is needed to decrypt the private key file. » member page
property OnTerminate;
Inherited cancel-poll hook (invoked via GetTerminate). Like TstMLDSAKey.OnTerminate it is not exercised by ML-KEM GenerateNewKeys, which performs a single one-shot lattice KEMKeyGen with no iterative polling, so assigning a handler here has no effect on key generation. » member page

classTstCompositeMLKEMPublicKey — component reference

inherits from TstCustomMPKey

implements iGetCompositeMLKEMKey, iCompositeMLKEMPublicKey

constructor Create(aOwner: TComponent); override;
Composite-ML-KEM (draft-ietf-lamps-pq-composite-kem) public-key component pairing a traditional key (RSA-OAEP, ECDH P-256/384/521, X25519 or X448) with ML-KEM; an application uses this where a single KEM key must combine classical and post-quantum security -- currently this is a CMS KEMRecipientI... Full description »
function Encapsulate(out aSharedSecretKey : iSecretKey; aCipherTextFormat: tStringFormat = sfBinary) : AnsiString;
Composite-ML-KEM.Encaps (draft-ietf-lamps-pq-composite-kem): produces a shared secret (returned in aSharedSecretKey) -- 32 bytes for the PKIX/CMS composite algorithms, whose combiner is SHA3-256 -- and the composite ciphertext (the return value), to be sent to the owner of the corresponding compo... Full description »
function LoadPublicKeyFromStream(const aIdentifier: OctetString; aStrm : TStream) : Boolean; override;
Loads a public key from aStrm and checks it matches this component's current key, rather than replacing it. » member page
procedure SavePublicKey;
Persists the current public key to PublicKeyFileName using PublicKeyFormat. » member page
procedure SavePublicKeyToStream(aStrm: TStream; const aIntf: TGUID); override;
See TstRSAPublicKey.SavePublicKeyToStream: low-level stream save keyed by aIntf, used by the key-format/key-manager machinery rather than typical application code. » member page
procedure SetPublicKey(const aPubl: iCompositeMLKEMPublicKey);
Injects an already-obtained iCompositeMLKEMPublicKey into this component. » member page
procedure SuggestRequiredUnits(aProc: tGetStringMethod); override;
Design-time helper: reports the runtime units this component needs (stAesNI, stDrbgAesCtr, stSHA3 and StreamSec.DSI.CompositeKEM) so the IDE can add them to the project's uses clause; not called by application code. » member page
property Enabled;
Enables/loads the key (True) or clears it (False); normally driven indirectly via PublicKeyFileName or SetPublicKey. » member page
property EnabledDesignTime;
Whether Enabled auto-activates at design time; rarely touched by application code. » member page
property EnabledRunTime;
Whether Enabled auto-activates at run time. » member page
property PublicKeyFormat: tDSICompositeMLKEMPublicKeyFormatList read fPublicKeyFormat write SetPublicKeyFormat;
Selects which on-disk/stream public-key format(s) this component accepts via PublicKeyFileName. » member page
property PublicKeyFileName;
Path to a file holding the public key; setting this loads the key. » member page

classTstCompositeMLKEMKey — component reference

inherits from TstCompositeMLKEMPublicKey

implements iCompositeMLKEMPrivateKey

function Decapsulate(const aCipherText : AnsiString; aCipherTextFormat: tStringFormat = sfBinary) : iSecretKey;
Composite-ML-KEM.Decaps: recovers the shared secret from the composite ciphertext (32 bytes for the PKIX/CMS composite algorithms, whose combiner is SHA3-256). An application calls this on the recipient side of a CMS KEMRecipientInfo (the role is fixed by sender/recipient, not by client/server) to unwrap a content-encryption key that was encapsulated to this component's public key. » member page
procedure GenerateNewKeys(aAlg: tCompositeMLKEMAlg; aSave: Boolean = True);
Generates a fresh composite ML-KEM keypair for aAlg (which combines an ML-KEM parameter set with a traditional algorithm -- RSA-OAEP or an ECDH/X curve -- per draft-ietf-lamps-pq-composite-kem) and, if aSave is True, persists it via SavePrivateKey/SavePublicKey. » member page
procedure SavePrivateKey;
Persists the current private key to PrivateKeyFileName (encrypted with PrivateKeyPassword). » member page
procedure SavePrivateKeyToStream(aStrm: TStream; const aIntf: TGUID); override;
See TstRSAKey.SavePrivateKeyToStream: low-level stream save keyed by aIntf, used by the key-format/key-manager machinery rather than typical application code. » member page
procedure SetPrivateKey(const aPriv: iCompositeMLKEMPrivateKey);
Injects an already-obtained iCompositeMLKEMPrivateKey into this component. » member page
property PrivateKeyFormat: tDSICompositeMLKEMPrivateKeyFormatList read fPrivateKeyFormat write SetPrivateKeyFormat;
Selects which on-disk/stream private-key format(s) this component accepts/produces. » member page
property PrivateKeyFileName;
Path to a file holding the (normally encrypted) private key; setting this loads the key. » member page
property PrivateKeyPassword;
Password protecting the on-disk private key. » member page
property OnPassword;
Fired when a password is needed to decrypt the private key file. » member page
property OnTerminate;
Fired periodically during GenerateNewKeys so an application can offer a cancel option. » member page

classTstCompositeMLDSAPublicKey — component reference

inherits from TstCustomMPKey

implements iGetCompositeMLDSAKey, iCompositeMLDSAPublicKey

constructor Create(aOwner: TComponent); override;
Composite-ML-DSA (draft-ietf-lamps-pq-composite-sigs) public-key component pairing a traditional (RSA/ECDSA/EdDSA) key with ML-DSA; an application uses this to hold a peer's/CA's hybrid verification key, e.g. when validating a composite-ML-DSA-signed X.509 certificate/CRL or CMS SignerInfo. Full description »
function VerifySignature(const aSignedData: AnsiString; const aSignature : AnsiString; aSignFormat: tStringFormat = sfBinary) : Boolean; overload;
Composite-ML-DSA.Verify (draft-ietf-lamps-pq-composite-sigs) with an optional application context aCtx (at most 255 bytes; the empty context in the first overload). An application calls this to check a hybrid signature, e.g. over a certificate/CRL TBS or a CMS SignerInfo signed by the corresponding composite ML-DSA private key. » member page
function VerifySignature(const aSignedData: AnsiString; const aCtx : AnsiString; const aSignature : AnsiString; aSignFormat: tStringFormat = sfBinary) : Boolean; overload;
Overload taking an explicit application context aCtx; see the base overload above. » member page
function LoadPublicKeyFromStream(const aIdentifier: OctetString; aStrm : TStream) : Boolean; override;
Loads a public key from aStrm and checks it matches this component's current key, rather than replacing it. » member page
procedure SavePublicKey;
Persists the current public key to PublicKeyFileName using PublicKeyFormat. » member page
procedure SavePublicKeyToStream(aStrm: TStream; const aIntf: TGUID); override;
See TstRSAPublicKey.SavePublicKeyToStream: low-level stream save keyed by aIntf, used by the key-format/key-manager machinery rather than typical application code. » member page
procedure SetPublicKey(const aPubl: iCompositeMLDSAPublicKey);
Injects an already-obtained iCompositeMLDSAPublicKey into this component. » member page
procedure SuggestRequiredUnits(aProc: tGetStringMethod); override;
Design-time helper: reports the units this component needs at runtime (stSHA3 and StreamSec.DSI.CompositeSig) so the IDE can add them to the project's uses clause. » member page
property Enabled;
Enables/loads the key (True) or clears it (False); normally driven indirectly via PublicKeyFileName or SetPublicKey. » member page
property EnabledDesignTime;
Whether Enabled auto-activates at design time; rarely touched by application code. » member page
property EnabledRunTime;
Whether Enabled auto-activates at run time. » member page
property PublicKeyFormat: tDSICompositeMLDSAPublicKeyFormatList read fPublicKeyFormat write SetPublicKeyFormat;
Selects which on-disk/stream public-key format(s) this component accepts via PublicKeyFileName. » member page
property PublicKeyFileName;
Path to a file holding the public key; setting this loads the key. » member page

classTstCompositeMLDSAKey — component reference

inherits from TstCompositeMLDSAPublicKey

implements iCompositeMLDSAPrivateKey

function GenerateSignature(const aSignedData: AnsiString; aSignFormat: tStringFormat = sfBinary) : AnsiString; overload;
Composite-ML-DSA.Sign (empty application context) with the hybrid private key; an application calls this to produce a composite ML-DSA signature, e.g. over a certificate/CRL TBS or a CMS SignerInfo pairing a traditional and an ML-DSA key. (Not wired into the TLS 1.3 handshake.) » member page
function GenerateSignature(const aSignedData: AnsiString; aCtx : AnsiString; aSignFormat: tStringFormat = sfBinary) : AnsiString; overload;
Overload taking an explicit application context aCtx; see the base overload above. » member page
procedure GenerateNewKeys(aAlg: tCompositeMLDSAAlg; aSave: Boolean = True);
Generates a fresh composite ML-DSA keypair for aAlg (an ML-DSA parameter set combined with a traditional algorithm/curve) and, if aSave is True, persists it via SavePrivateKey/SavePublicKey. » member page
procedure SavePrivateKey;
Persists the current private key to PrivateKeyFileName (encrypted with PrivateKeyPassword). » member page
procedure SavePrivateKeyToStream(aStrm: TStream; const aIntf: TGUID); override;
See TstRSAKey.SavePrivateKeyToStream: low-level stream save keyed by aIntf, used by the key-format/key-manager machinery rather than typical application code. » member page
procedure SetPrivateKey(const aPriv: iCompositeMLDSAPrivateKey);
Injects an already-obtained iCompositeMLDSAPrivateKey into this component. » member page
property PrivateKeyFormat: tDSICompositeMLDSAPrivateKeyFormatList read fPrivateKeyFormat write SetPrivateKeyFormat;
Selects which on-disk/stream private-key format(s) this component accepts/produces. » member page
property PrivateKeyFileName;
Path to a file holding the (normally encrypted) private key; setting this loads the key. » member page
property PrivateKeyPassword;
Password protecting the on-disk private key. » member page
property OnPassword;
Fired when a password is needed to decrypt the private key file. » member page
property OnTerminate;
Fired periodically during GenerateNewKeys so an application can offer a cancel option. » member page

classTstEdDSAPublicKey — component reference

inherits from TstCustomMPKey

implements iGetEdDSAKey, iDLPublicKey

EdDSA (RFC 8032/8410: Ed25519/Ed448). EdDSA keys are iDLPublicKey, but they sign/verify through the EdDSA pool (GetDSIED), never through GetDSIEC; the signature is the raw RFC 8032 R||S (no DER) and there is no pre-hash.

constructor Create(aOwner: TComponent); override;
An application uses this to hold a peer's/CA's Ed25519 or Ed448 verification key, e.g. validating an EdDSA TLS 1.3/SSH/CMS signature from either a client or a server certificate or host key; no client/server-specific behavior in this class itself. » member page
function VerifySignature(const aSignedData: AnsiString; const aSignature : AnsiString; aSignFormat: tStringFormat = sfBinary) : Boolean;
Verifies the raw RFC 8032 R||S EdDSA signature over aSignedData against this component's public key; there is no separate digest step (EdDSA hashes the message internally). » member page
function LoadPublicKeyFromStream(const aIdentifier: OctetString; aStrm : TStream) : Boolean; override;
Loads a public key from aStrm and checks it matches this component's current key, rather than replacing it. » member page
procedure SavePublicKey;
Persists the current public key to PublicKeyFileName using PublicKeyFormat. » member page
procedure SavePublicKeyToStream(aStrm: TStream; const aIntf: TGUID); override;
See TstRSAPublicKey.SavePublicKeyToStream: low-level stream save keyed by aIntf, used by the key-format/key-manager machinery rather than typical application code. » member page
procedure SetPublicKey(const aPubl: iDLPublicKey);
Injects an already-obtained iDLPublicKey (e.g. extracted from a certificate or an SSH ssh-ed25519 host key) into this component. » member page
procedure SuggestRequiredUnits(aProc: tGetStringMethod); override;
Design-time helper: reports the runtime units this component needs (stSHA512, stSHA3, StreamSec.DSI.CurveEdArith and StreamSec.DSI.EdDSA) so the IDE can add them to the project's uses clause; not called by application code. » member page
property Enabled;
Enables/loads the key (True) or clears it (False); normally driven indirectly via PublicKeyFileName or SetPublicKey. » member page
property EnabledDesignTime;
Whether Enabled auto-activates at design time; rarely touched by application code. » member page
property EnabledRunTime;
Whether Enabled auto-activates at run time. » member page
property PublicKeyFormat: tDSIDLPublicKeyFormatList read fPublicKeyFormat write SetPublicKeyFormat;
Selects which on-disk/stream public-key format(s) this component accepts via PublicKeyFileName. » member page
property PublicKeyFileName;
Path to a file holding the public key; setting this loads the key. » member page

classTstEdDSAKey — component reference

inherits from TstEdDSAPublicKey

implements iDLPrivateKey

function GenerateSignature(const aSignedData: AnsiString; aSignFormat: tStringFormat = sfBinary) : AnsiString;
Signs aSignedData with this component's Ed25519/Ed448 private key; used as an SSH ssh-ed25519 host key (see StreamSec.SSH.* host-key wiring) or a TLS/CMS EdDSA signing key on either the client or server side. » member page
procedure GenerateNewKeys(aCurve: ObjectIdentifier; aSave: Boolean = True);
aCurve must be id_Ed25519 or id_Ed448 Generates a fresh EdDSA keypair on the given curve and, if aSave is True, persists it via SavePrivateKey/SavePublicKey; an application calls this to provision a new Ed25519/Ed448 host key or signing key. » member page
procedure SavePrivateKey;
Persists the current private key to PrivateKeyFileName (encrypted with PrivateKeyPassword). » member page
procedure SavePrivateKeyToStream(aStrm: TStream; const aIntf: TGUID); override;
See TstRSAKey.SavePrivateKeyToStream: low-level stream save keyed by aIntf, used by the key-format/key-manager machinery rather than typical application code. » member page
procedure SetPrivateKey(const aPriv: iDLPrivateKey);
Injects an already-obtained iDLPrivateKey into this component. » member page
property PrivateKeyFormat: tDSIDLPrivateKeyFormatList read fPrivateKeyFormat write SetPrivateKeyFormat;
Selects which on-disk/stream private-key format(s) this component accepts/produces. » member page
property PrivateKeyFileName;
Path to a file holding the (normally encrypted) private key; setting this loads the key. » member page
property PrivateKeyPassword;
Password protecting the on-disk private key. » member page
property OnPassword;
Fired when a password is needed to decrypt the private key file. » member page
property OnTerminate;
Fired periodically during GenerateNewKeys so an application can offer a cancel option. » member page

classTstSLHDSAPublicKey — component reference

inherits from TstCustomMPKey

implements iGetSLHDSAKey, iSLHDSAPublicKey

SLH-DSA (FIPS 205 / SPHINCS+). Keys carry iSLHDSAPublicKey/iSLHDSAPrivateKey and sign/verify through the SLH-DSA pool (GetDSISLH); the signature is the raw FIPS 205 signature (no DER) and there is no pre-hash. An optional application context (<=255 bytes) may be supplied.

constructor Create(aOwner: TComponent); override;
An application uses this to hold a peer's/CA's SLH-DSA verification key, e.g. validating a stateless-hash-based PQ signature from either a client or server certificate; no client/server-specific behavior in this class itself. » member page
function VerifySignature(const aSignedData: AnsiString; const aSignature : AnsiString; aSignFormat: tStringFormat = sfBinary) : Boolean; overload;
Verifies the raw FIPS 205 signature over aSignedData against this component's public key. » member page
function VerifySignature(const aSignedData: AnsiString; const aCtx : AnsiString; const aSignature : AnsiString; aSignFormat: tStringFormat = sfBinary) : Boolean; overload;
Overload taking an explicit application context aCtx (at most 255 bytes). » member page
function LoadPublicKeyFromStream(const aIdentifier: OctetString; aStrm : TStream) : Boolean; override;
Loads a public key from aStrm and checks it matches this component's current key, rather than replacing it. » member page
procedure SavePublicKey;
Persists the current public key to PublicKeyFileName using PublicKeyFormat. » member page
procedure SavePublicKeyToStream(aStrm: TStream; const aIntf: TGUID); override;
See TstRSAPublicKey.SavePublicKeyToStream: low-level stream save keyed by aIntf, used by the key-format/key-manager machinery rather than typical application code. » member page
procedure SetPublicKey(const aPubl: iSLHDSAPublicKey);
Injects an already-obtained iSLHDSAPublicKey (e.g. extracted from a certificate) into this component. » member page
procedure SuggestRequiredUnits(aProc: tGetStringMethod); override;
Design-time helper: reports the units this component needs at runtime (stSHA256, stSHA512, stSHA3 and StreamSec.DSI.SLHDSA) so the IDE can add them to the project's uses clause; not normally called by application code. » member page
property Enabled;
Enables/loads the key (True) or clears it (False); normally driven indirectly via PublicKeyFileName or SetPublicKey. » member page
property EnabledDesignTime;
Whether Enabled auto-activates at design time; rarely touched by application code. » member page
property EnabledRunTime;
Whether Enabled auto-activates at run time. » member page
property PublicKeyFormat: tDSISLHDSAPublicKeyFormatList read fPublicKeyFormat write SetPublicKeyFormat;
Selects which on-disk/stream public-key format(s) this component accepts via PublicKeyFileName. » member page
property PublicKeyFileName;
Path to a file holding the public key; setting this loads the key. » member page

classTstSLHDSAKey — component reference

inherits from TstSLHDSAPublicKey

implements iSLHDSAPrivateKey

function GenerateSignature(const aSignedData: AnsiString; aSignFormat: tStringFormat = sfBinary) : AnsiString; overload;
Signs aSignedData with this component's SLH-DSA private key; an application calls this on whichever side holds the PQ signing key, e.g. a certificate or CMS signer using SLH-DSA. » member page
function GenerateSignature(const aSignedData: AnsiString; aCtx : AnsiString; aSignFormat: tStringFormat = sfBinary) : AnsiString; overload;
Overload taking an explicit application context aCtx. » member page
procedure GenerateNewKeys(aAlg: tSLHDSAAlg; aSave: Boolean = True);
aAlg selects the SLH-DSA parameter set, e.g. slhSHA2_128f / slhSHAKE_256s. Generates a fresh SLH-DSA keypair for aAlg and, if aSave is True, persists it via SavePrivateKey/SavePublicKey; note SLH-DSA key generation/signing is comparatively slow, so an application may want to run this off the UI thread. » member page
procedure SavePrivateKey;
Persists the current private key to PrivateKeyFileName (encrypted with PrivateKeyPassword). » member page
procedure SavePrivateKeyToStream(aStrm: TStream; const aIntf: TGUID); override;
See TstRSAKey.SavePrivateKeyToStream: low-level stream save keyed by aIntf, used by the key-format/key-manager machinery rather than typical application code. » member page
procedure SetPrivateKey(const aPriv: iSLHDSAPrivateKey);
Injects an already-obtained iSLHDSAPrivateKey into this component. » member page
property PrivateKeyFormat: tDSISLHDSAPrivateKeyFormatList read fPrivateKeyFormat write SetPrivateKeyFormat;
Selects which on-disk/stream private-key format(s) this component accepts/produces. » member page
property PrivateKeyFileName;
Path to a file holding the (normally encrypted) private key; setting this loads the key. » member page
property PrivateKeyPassword;
Password protecting the on-disk private key. » member page
property OnPassword;
Fired when a password is needed to decrypt the private key file. » member page
property OnTerminate;
Fired periodically during GenerateNewKeys so an application can offer a cancel option. » member page

Routines