Enumeration

enum CertificateVerifyMode

public enum CertificateVerifyMode {
    | CustomCA(Array<X509Certificate>)
    | Default
    | TrustAll
}

Description: Represents the processing mode for certificate verification.

Note:

In CustomCA mode, the certificate path can be defined by a user. This mode applies to the scenario where the user certificate cannot be set to the system certificate.
In the certificate authentication mode, after a TCP connection is established, the client and server can exchange certificates. In default mode, the system certificate is used.
In the development and test phase, the TrustAll mode can be used. In this mode, the local end does not verify the peer certificate. In this mode, the local end trusts any connection object. This mode is used only in the development and test phase.

CustomCA(Array<X509Certificate>)

CustomCA(Array<X509Certificate>)

Description: Indicates that the verification is performed according to the provided CA list.

Default

Default

Description: Indicates the default verification mode. The certificate is verified according to the system CA.

TrustAll

TrustAll

Description: Indicates that all certificates are trusted.

enum SignatureAlgorithm

public enum SignatureAlgorithm <: ToString & Equatable<SignatureAlgorithm> {
    | SignatureAndHashAlgorithm(SignatureType, HashType)
    | SignatureScheme(SignatureSchemeType)
}

Description: Represents the signature algorithm type. The signature algorithm is used to guarantee the identity authentication, integrity, and authenticity of transmitted data.

Parent Type:

SignatureAndHashAlgorithm(SignatureType, HashType)

SignatureAndHashAlgorithm(SignatureType, HashType)

Description: Indicates which signature and hash algorithm pair are used for digital signature. In TLS 1.2 and later versions, the signature and hash algorithm types are included in the current type.

SignatureScheme(SignatureSchemeType)

SignatureScheme(SignatureSchemeType)

Description: Represents the signature scheme which is recommended in the industry in TLS 1.3 and later versions.

func toString()

public func toString():String

Description: Converts the current instance to the string representation of the signature algorithm.

Returns:

  • String: name of the signature algorithm

operator func !=(SignatureAlgorithm)

public operator func !=(other: SignatureAlgorithm) : Bool

Description: Checks whether two signature algorithm types are different.

Parameters:

Returns:

  • Bool: If the two signature algorithm types are different, true is returned. Otherwise, false is returned.

operator func ==(SignatureAlgorithm)

public operator func ==(other: SignatureAlgorithm) : Bool

Description: Checks whether two signature algorithm types are the same

Parameters:

Returns:

  • Bool: If the two signature algorithm types are the same, true is returned. Otherwise, false is returned.

enum SignatureSchemeType

public enum SignatureSchemeType <: ToString & Equatable<SignatureSchemeType> {
    | RSA_PKCS1_SHA256
    | RSA_PKCS1_SHA384
    | RSA_PKCS1_SHA512
    | ECDSA_SECP256R1_SHA256
    | ECDSA_SECP384R1_SHA384
    | ECDSA_SECP521R1_SHA512
    | RSA_PSS_RSAE_SHA256
    | RSA_PSS_RSAE_SHA384
    | RSA_PSS_RSAE_SHA512
    | ED25519
    | ED448
    | RSA_PSS_PSS_SHA256
    | RSA_PSS_PSS_SHA384
    | RSA_PSS_PSS_SHA512
}

Description: Represents the encryption algorithm type, which is used to guarantee the security and privacy of network communication.

Parent Type:

ECDSA_SECP256R1_SHA256

ECDSA_SECP256R1_SHA256

Description: Creates an enumeration instance of the ECDSA_SECP256R1_SHA256 type, indicating that the encryption algorithm type is ECDSA_SECP256R1_SHA256.

ECDSA_SECP384R1_SHA384

ECDSA_SECP384R1_SHA384

Description: Creates an enumeration instance of the ECDSA_SECP384R1_SHA384 type, indicating that the encryption algorithm type is ECDSA_SECP384R1_SHA384.

ECDSA_SECP521R1_SHA512

ECDSA_SECP521R1_SHA512

Description: Creates an enumeration instance of the ECDSA_SECP521R1_SHA512 type, indicating that the encryption algorithm type is ECDSA_SECP521R1_SHA512.

ED25519

ED25519

Description: Creates an enumeration instance of the ED25519 type, indicating that the encryption algorithm type is ED25519.

ED448

ED448

Description: Creates an enumeration instance of the ED448 type, indicating that the encryption algorithm type is ED448.

RSA_PKCS1_SHA256

RSA_PKCS1_SHA256

Description: Creates an enumeration instance of the RSA_PKCS1_SHA256 type, indicating that the encryption algorithm type is RSA_PKCS1_SHA256.

RSA_PKCS1_SHA384

RSA_PKCS1_SHA384

Description: Creates an enumeration instance of the RSA_PKCS1_SHA384 type, indicating that the encryption algorithm type is RSA_PKCS1_SHA384.

RSA_PKCS1_SHA512

RSA_PKCS1_SHA512

Description: Creates an enumeration instance of the RSA_PKCS1_SHA512 type, indicating that the encryption algorithm type is RSA_PKCS1_SHA512.

RSA_PSS_PSS_SHA256

RSA_PSS_PSS_SHA256

Description: Creates an enumeration instance of the RSA_PSS_PSS_SHA256 type, indicating that the encryption algorithm type is RSA_PSS_PSS_SHA256.

RSA_PSS_PSS_SHA384

RSA_PSS_PSS_SHA384

Description: Creates an enumeration instance of the RSA_PSS_PSS_SHA384 type, indicating that the encryption algorithm type is RSA_PSS_PSS_SHA384.

RSA_PSS_PSS_SHA512

RSA_PSS_PSS_SHA512

Description: Creates an enumeration instance of the RSA_PSS_PSS_SHA512 type, indicating that the encryption algorithm type is RSA_PSS_PSS_SHA512.

RSA_PSS_RSAE_SHA256

RSA_PSS_RSAE_SHA256

Description: Creates an enumeration instance of the RSA_PSS_RSAE_SHA256 type, indicating that the encryption algorithm type is RSA_PSS_RSAE_SHA256.

RSA_PSS_RSAE_SHA384

RSA_PSS_RSAE_SHA384

Description: Creates an enumeration instance of the RSA_PSS_RSAE_SHA384 type, indicating that the encryption algorithm type is RSA_PSS_RSAE_SHA384.

RSA_PSS_RSAE_SHA512

RSA_PSS_RSAE_SHA512

Description: Creates an enumeration instance of the RSA_PSS_RSAE_SHA512 type, indicating that the encryption algorithm type is RSA_PSS_RSAE_SHA512.

func toString()

public func toString(): String

Description: Specifies the string representation of an encryption algorithm type.

For example, the string identification of RSA_PKCS1_SHA256 is "rsa_pkcs1_sha256".

Returns:

  • String: the string representation of the encryption algorithm type

operator func !=(SignatureSchemeType)

public operator func !=(other: SignatureSchemeType): Bool

Description: Checks whether two encryption algorithm types are different.

Parameters:

Returns:

  • Bool: If the two encryption algorithm types are different, true is returned. Otherwise, false is returned.

operator func ==(SignatureSchemeType)

public operator func ==(other: SignatureSchemeType): Bool

Description: Checks whether two encryption algorithm types are the same.

Parameters:

Returns:

  • Bool: If the two encryption algorithm types are the same, true is returned. Otherwise, false is returned.

enum SignatureType

public enum SignatureType <: ToString & Equatable<SignatureType> {
    | DSA
    | ECDSA
    | RSA
}

Description: Represents the signature algorithm type, which is used for authenticity authentication. For details, see RFC5246 7.4.1.4.1.

Parent Type:

DSA

DSA

Description: Creates an enumeration instance of the DSA type, indicating that the digital signature algorithm is used.

ECDSA

ECDSA

Description: Creates an enumeration instance of the ECDSA type, indicating that the elliptic curve digital signature algorithm is used.

RSA

RSA

Description: Creates an enumeration instance of the RSA type, indicating that the RSA encryption algorithm is used.

func toString()

public func toString(): String

Description: Converts the current instance to the string representation of the signature algorithm.

Returns:

  • String: name of the signature algorithm

operator func !=(SignatureType)

public operator func !=(other: SignatureType) : Bool

Description: Checks whether two signature algorithms are different.

Parameters:

  • other: SignatureType: the other signature algorithm type to be compared with

Returns:

  • Bool: If the two signature algorithm types are different, true is returned. Otherwise, false is returned.

operator func ==(SignatureType)

public operator func ==(other: SignatureType) : Bool

Description: Checks whether two signature algorithms are the same.

Parameters:

  • other: SignatureType: the other signature algorithm type to be compared with

Returns:

  • Bool: If the two signature algorithm types are the same, true is returned. Otherwise, false is returned.

enum TlsClientIdentificationMode

public enum TlsClientIdentificationMode {
    | Disabled
    | Optional
    | Required
}

Description: Represents the mode for the server to authenticate the client certificate.

Disabled

Disabled

Description: Indicates that the server does not verify the client certificate, and the client does not need to send the certificate and public key, that is, one-way authentication.

Optional

Optional

Description: Indicates that the server verifies the client certificate, but the client does not need to provide the certificate and public key. This mode is one-way authentication. If the client provides the certificate and public key, it is the two-way authentication mode.

Required

Required

Description: Indicates that the server verifies the client certificate and requires the client to provide the certificate and public key, that is, two-way authentication.

enum TlsVersion

public enum TlsVersion <: ToString {
    | V1_2
    | V1_3
    | Unknown
}

Description: Represents the TLS protocol version.

Parent Type:

Unknown

Unknown

Description: Represents an unknown protocol version.

V1_2

V1_2

Description: Represents TLS 1.2.

V1_3

V1_3

Description: Represents TLS 1.3.

func toString()

public override func toString(): String

Description: Returns the string representation of the current TlsVersion.

Returns: