Discuss this help topic in SecureBlackbox Forum
Generates new certificate with defined algorithm and key length or new certificate on the basis of information contained in TElCertificateRequest class instance.
Declaration
Parameters
Values:
The following algorithms may be used as public key algorithms:
|
|
Description
This method causes
TElX509CertificateEx object
to generate a new certificate based on specified security algorithm.
Specify the length of the resulting key(s) using
DwordsInEncryptKey parameter.
All data of the generated certificate will be accessible via object properties an methods.
Before calling Generate you need to set
ValidFrom and
ValidTo properties.
Generate method can be used to generate self-signed certificates or certificates signed by Certificate Authority.
If you generate certificate signed by Certificate Authority, you need to call
SetCACertificate and
SetCAPrivateKey methods to specify certificate and private key of the issuer (CA).
If certificate by request is generated, this method causes
TElX509CertificateEx object to generate a new certificate based on
specified certificate request object and current certificate private key.
Certificate request object contains subject information, such as Subject name and public key.
The newly created certificate is signed by current TElX509CertificateEx private key
and put to Certificate object.
Certificate request doesn't contain validity period and extensions, so when you need generate new certificate by request before calling Generate you need to set
ValidFrom,
ValidTo and
Extensions properties of
Certificate as needed.
Also, you can setup SubjectRDN of the certificate manually (possibly, by copying the values from the Request and altering SubjectRDN after that) and set CopySubjectFromRequest to false to preserve the contents of SubjectRDN that you have set.
Note, that for self-signed certififcates an instance of
TElX509CertificateEx class,
whose Generate method is called, should have a Private Key.
If the private key is absent, TElCertificateException is raised.