Opc.Ua.CertificateFactory.CreateCertificate C# (CSharp) Method

CreateCertificate() public static method

Creates a self signed application instance certificate.
public static CreateCertificate ( string storeType, string storePath, string applicationUri, string applicationName, string subjectName = null, IList serverDomainNames = null, ushort keySize = defaultKeySize, ushort lifetimeInMonths = defaultLifeTime, ushort hashSizeInBits = defaultHashSize ) : X509Certificate2
storeType string Type of certificate store (Directory) .
storePath string The store path (syntax depends on storeType).
applicationUri string The application uri (created if not specified).
applicationName string Name of the application (optional if subjectName is specified).
subjectName string The subject used to create the certificate (optional if applicationName is specified).
serverDomainNames IList
keySize ushort Size of the key (1024, 2048 or 4096).
lifetimeInMonths ushort The lifetime of the key in months.
hashSizeInBits ushort The hash size in bits.
return X509Certificate2
        public static X509Certificate2 CreateCertificate(
            string storeType,
            string storePath,
            string applicationUri,
            string applicationName,
            string subjectName = null,
            IList<string> serverDomainNames = null,
            ushort keySize = defaultKeySize,
            ushort lifetimeInMonths = defaultLifeTime,
            ushort hashSizeInBits = defaultHashSize
            )
        {
            return CreateCertificate(
                storeType,
                storePath,
                null,
                applicationUri,
                applicationName,
                subjectName,
                serverDomainNames,
                keySize,
                DateTime.UtcNow,
                lifetimeInMonths,
                hashSizeInBits,
                false,
                null
                );
        }

Same methods

CertificateFactory::CreateCertificate ( string storeType, string storePath, string password, string applicationUri, string applicationName, string subjectName, IList domainNames, ushort keySize, DateTime startTime, ushort lifetimeInMonths, ushort hashSizeInBits, bool isCA, X509Certificate2 issuerCAKeyCert ) : X509Certificate2