docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class SecureParameterExtensions

    Extensions to NetworkSettings for secure parameters.

    Inheritance
    object
    SecureParameterExtensions
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Unity.Networking.Transport.TLS
    Assembly: Unity.Networking.Transport.dll
    Syntax
    public static class SecureParameterExtensions

    Methods

    GetSecureParameters(ref NetworkSettings)

    Get the security parameters structure from the given network settings.

    Declaration
    public static SecureNetworkProtocolParameter GetSecureParameters(this ref NetworkSettings settings)
    Parameters
    Type Name Description
    NetworkSettings settings

    Settings to get the parameters from.

    Returns
    Type Description
    SecureNetworkProtocolParameter

    Security parameters structure.

    WithSecureClientParameters(ref NetworkSettings, string)

    Set client security parameters (for WebSocket usage).

    Declaration
    public static ref NetworkSettings WithSecureClientParameters(this ref NetworkSettings settings, string serverName)
    Parameters
    Type Name Description
    NetworkSettings settings

    Settings to modify.

    string serverName

    Hostname of the server to connect to.

    Returns
    Type Description
    NetworkSettings

    Modified network settings.

    WithSecureClientParameters(ref NetworkSettings, string, string)

    Set client security parameters (server authentication only).

    Declaration
    public static ref NetworkSettings WithSecureClientParameters(this ref NetworkSettings settings, string caCertificate, string serverName)
    Parameters
    Type Name Description
    NetworkSettings settings

    Settings to modify.

    string caCertificate

    CA certificate that signed the server's certificate (PEM format).

    string serverName

    Common name (CN) in the server certificate.

    Returns
    Type Description
    NetworkSettings

    Modified network settings.

    WithSecureClientParameters(ref NetworkSettings, string, string, string, string)

    Set client security parameters (for client authentication).

    Declaration
    public static ref NetworkSettings WithSecureClientParameters(this ref NetworkSettings settings, string certificate, string privateKey, string caCertificate, string serverName)
    Parameters
    Type Name Description
    NetworkSettings settings

    Settings to modify.

    string certificate

    Client's certificate (PEM format).

    string privateKey

    Client's private key (PEM format).

    string caCertificate

    CA certificate that signed the server's certificate (PEM format).

    string serverName

    Common name (CN) in the server certificate.

    Returns
    Type Description
    NetworkSettings

    Modified network settings.

    WithSecureClientParameters(ref NetworkSettings, ref FixedString4096Bytes, ref FixedString4096Bytes, ref FixedString4096Bytes, ref FixedString512Bytes)

    Set client security parameters (for client authentication).

    Declaration
    public static ref NetworkSettings WithSecureClientParameters(this ref NetworkSettings settings, ref FixedString4096Bytes certificate, ref FixedString4096Bytes privateKey, ref FixedString4096Bytes caCertificate, ref FixedString512Bytes serverName)
    Parameters
    Type Name Description
    NetworkSettings settings

    Settings to modify.

    FixedString4096Bytes certificate

    Client's certificate (PEM format).

    FixedString4096Bytes privateKey

    Client's private key (PEM format).

    FixedString4096Bytes caCertificate

    CA certificate that signed the server's certificate (PEM format).

    FixedString512Bytes serverName

    Common name (CN) in the server certificate.

    Returns
    Type Description
    NetworkSettings

    Modified network settings.

    WithSecureClientParameters(ref NetworkSettings, ref FixedString4096Bytes, ref FixedString512Bytes)

    Set client security parameters (server authentication only).

    Declaration
    public static ref NetworkSettings WithSecureClientParameters(this ref NetworkSettings settings, ref FixedString4096Bytes caCertificate, ref FixedString512Bytes serverName)
    Parameters
    Type Name Description
    NetworkSettings settings

    Settings to modify.

    FixedString4096Bytes caCertificate

    CA certificate that signed the server's certificate (PEM format).

    FixedString512Bytes serverName

    Common name (CN) in the server certificate.

    Returns
    Type Description
    NetworkSettings

    Modified network settings.

    WithSecureClientParameters(ref NetworkSettings, ref FixedString512Bytes)

    Set client security parameters (for WebSocket usage).

    Declaration
    public static ref NetworkSettings WithSecureClientParameters(this ref NetworkSettings settings, ref FixedString512Bytes serverName)
    Parameters
    Type Name Description
    NetworkSettings settings

    Settings to modify.

    FixedString512Bytes serverName

    Hostname of the server to connect to.

    Returns
    Type Description
    NetworkSettings

    Modified network settings.

    WithSecureClientParameters(ref NetworkSettings, ref FixedPEMString, ref FixedString512Bytes)

    Set client security parameters (server authentication only).

    Declaration
    public static ref NetworkSettings WithSecureClientParameters(this ref NetworkSettings settings, ref FixedPEMString caCertificate, ref FixedString512Bytes serverName)
    Parameters
    Type Name Description
    NetworkSettings settings

    Settings to modify.

    FixedPEMString caCertificate

    CA certificate that signed the server's certificate (PEM format).

    FixedString512Bytes serverName

    Common name (CN) in the server certificate.

    Returns
    Type Description
    NetworkSettings

    Modified network settings.

    WithSecureClientParameters(ref NetworkSettings, ref FixedPEMString, ref FixedPEMString, ref FixedPEMString, ref FixedString512Bytes)

    Set client security parameters (for client authentication).

    Declaration
    public static ref NetworkSettings WithSecureClientParameters(this ref NetworkSettings settings, ref FixedPEMString certificate, ref FixedPEMString privateKey, ref FixedPEMString caCertificate, ref FixedString512Bytes serverName)
    Parameters
    Type Name Description
    NetworkSettings settings

    Settings to modify.

    FixedPEMString certificate

    Client's certificate (PEM format).

    FixedPEMString privateKey

    Client's private key (PEM format).

    FixedPEMString caCertificate

    CA certificate that signed the server's certificate (PEM format).

    FixedString512Bytes serverName

    Common name (CN) in the server certificate.

    Returns
    Type Description
    NetworkSettings

    Modified network settings.

    WithSecureServerParameters(ref NetworkSettings, string, string)

    Set server security parameters (server authentication only).

    Declaration
    public static ref NetworkSettings WithSecureServerParameters(this ref NetworkSettings settings, string certificate, string privateKey)
    Parameters
    Type Name Description
    NetworkSettings settings

    Settings to modify.

    string certificate

    Server's certificate chain (PEM format).

    string privateKey

    Server's private key (PEM format).

    Returns
    Type Description
    NetworkSettings

    Modified network settings.

    WithSecureServerParameters(ref NetworkSettings, string, string, string, string, SecureClientAuthPolicy)

    Set server security parameters (for client authentication).

    Declaration
    public static ref NetworkSettings WithSecureServerParameters(this ref NetworkSettings settings, string certificate, string privateKey, string caCertificate, string clientName, SecureClientAuthPolicy clientAuthenticationPolicy = SecureClientAuthPolicy.Required)
    Parameters
    Type Name Description
    NetworkSettings settings

    Settings to modify.

    string certificate

    Server's certificate chain (PEM format).

    string privateKey

    Server's private key (PEM format).

    string caCertificate

    CA certificate that signed the client certificates (PEM format).

    string clientName

    Common name (CN) in the client certificates.

    SecureClientAuthPolicy clientAuthenticationPolicy

    Client authentication policy.

    Returns
    Type Description
    NetworkSettings

    Modified network settings.

    WithSecureServerParameters(ref NetworkSettings, ref FixedString4096Bytes, ref FixedString4096Bytes)

    Set server security parameters (server authentication only).

    Declaration
    public static ref NetworkSettings WithSecureServerParameters(this ref NetworkSettings settings, ref FixedString4096Bytes certificate, ref FixedString4096Bytes privateKey)
    Parameters
    Type Name Description
    NetworkSettings settings

    Settings to modify.

    FixedString4096Bytes certificate

    Server's certificate chain (PEM format).

    FixedString4096Bytes privateKey

    Server's private key (PEM format).

    Returns
    Type Description
    NetworkSettings

    Modified network settings.

    WithSecureServerParameters(ref NetworkSettings, ref FixedString4096Bytes, ref FixedString4096Bytes, ref FixedString4096Bytes, ref FixedString512Bytes, SecureClientAuthPolicy)

    Set server security parameters (for client authentication).

    Declaration
    public static ref NetworkSettings WithSecureServerParameters(this ref NetworkSettings settings, ref FixedString4096Bytes certificate, ref FixedString4096Bytes privateKey, ref FixedString4096Bytes caCertificate, ref FixedString512Bytes clientName, SecureClientAuthPolicy clientAuthenticationPolicy = SecureClientAuthPolicy.Required)
    Parameters
    Type Name Description
    NetworkSettings settings

    Settings to modify.

    FixedString4096Bytes certificate

    Server's certificate chain (PEM format).

    FixedString4096Bytes privateKey

    Server's private key (PEM format).

    FixedString4096Bytes caCertificate

    CA certificate that signed the client certificates (PEM format).

    FixedString512Bytes clientName

    Common name (CN) in the client certificates.

    SecureClientAuthPolicy clientAuthenticationPolicy

    Client authentication policy.

    Returns
    Type Description
    NetworkSettings

    Modified network settings.

    WithSecureServerParameters(ref NetworkSettings, ref FixedPEMString, ref FixedPEMString)

    Set server security parameters (server authentication only).

    Declaration
    public static ref NetworkSettings WithSecureServerParameters(this ref NetworkSettings settings, ref FixedPEMString certificate, ref FixedPEMString privateKey)
    Parameters
    Type Name Description
    NetworkSettings settings

    Settings to modify.

    FixedPEMString certificate

    Server's certificate chain (PEM format).

    FixedPEMString privateKey

    Server's private key (PEM format).

    Returns
    Type Description
    NetworkSettings

    Modified network settings.

    WithSecureServerParameters(ref NetworkSettings, ref FixedPEMString, ref FixedPEMString, ref FixedPEMString, ref FixedString512Bytes, SecureClientAuthPolicy)

    Set server security parameters (for client authentication).

    Declaration
    public static ref NetworkSettings WithSecureServerParameters(this ref NetworkSettings settings, ref FixedPEMString certificate, ref FixedPEMString privateKey, ref FixedPEMString caCertificate, ref FixedString512Bytes clientName, SecureClientAuthPolicy clientAuthenticationPolicy = SecureClientAuthPolicy.Required)
    Parameters
    Type Name Description
    NetworkSettings settings

    Settings to modify.

    FixedPEMString certificate

    Server's certificate chain (PEM format).

    FixedPEMString privateKey

    Server's private key (PEM format).

    FixedPEMString caCertificate

    CA certificate that signed the client certificates (PEM format).

    FixedString512Bytes clientName

    Common name (CN) in the client certificates.

    SecureClientAuthPolicy clientAuthenticationPolicy

    Client authentication policy.

    Returns
    Type Description
    NetworkSettings

    Modified network settings.

    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)