Contents · Forum Home · StreamSec Tools 4.1.5.363 documentation

methodTsmPrivateKeyRingComponent.CreateKeyPair

function CreateKeyPair(const DstCert: iCertificate; const Algorithm: ObjectIdentifier; ABitSize: Integer; const CurveOID: ObjectIdentifierString = ''; Exportable: Boolean = False; SaveSeed: Boolean = False): Boolean; overload;
Generates a fresh key pair for a new certificate: writes the public part into DstCert's SubjectPublicKeyInfo and stores the matching private key in the ring. Use this when self-issuing or building a CSR/certificate in code (RSA, DSA/DH, EC, ML-DSA or ML-KEM, selected by the Algorithm OID). ABitSize sizes IF/DL keys; CurveOID selects the EC curve; Exportable allows later export of the private key; SaveSeed keeps the ML-DSA/ML-KEM seed. Returns True on success. This overload simply forwards DstCert.SubjectPublicKeyInfo to the one below.
function CreateKeyPair(const DstCert: iSubjectPublicKeyInfo; const Algorithm: ObjectIdentifier; ABitSize: Integer; const CurveOID: ObjectIdentifierString = ''; Exportable: Boolean = False; SaveSeed: Boolean = False): Boolean; overload;
As above, but takes the SubjectPublicKeyInfo directly. This is the overload that actually creates the key pair, dispatching on the Algorithm OID to the IF/DL/EC/ML-DSA/ML-KEM key generators of the underlying ring.