Visual Basic (Usage) | ![]() |
---|---|
Dim applicationUri As String Dim applicationName As String Dim subjectName As String Dim domainNames As IList(Of String) Dim keySize As UShort Dim lifetimeInMonths As UShort Dim value As X509Certificate2 value = CertificateFactory.CreateCertificate(applicationUri, applicationName, subjectName, domainNames, keySize, lifetimeInMonths) |
C# | |
---|---|
public static X509Certificate2 CreateCertificate( string applicationUri, string applicationName, string subjectName, IList<string> domainNames, ushort keySize, ushort lifetimeInMonths ) |
Parameters
- applicationUri
- The application uri (created if not specified).
- applicationName
- Name of the application (optional if subjectName is specified).
- subjectName
- The subject used to create the certificate (optional if applicationName is specified).
- domainNames
- The domain names that can be used to access the server machine (defaults to local computer name if not specified).
- keySize
- Size of the key (1024, 2048 or 4096).
- lifetimeInMonths
- The lifetime of the key in months.
Return Value
The certificate with a private key.Target Platforms: Windows 7/8/10, Windows Server 2003/2008/2012/2015, .NET4.x