neon/testing

Types

Test certificate data for one side of a connection.

pub type CertData {
  CertData(
    cert: BitArray,
    key: ssl.PrivateKey,
    cacerts: List(BitArray),
  )
}

Constructors

  • CertData(
      cert: BitArray,
      key: ssl.PrivateKey,
      cacerts: List(BitArray),
    )

Supported EC curves for test certificates.

pub type EcCurve {
  Secp256r1
  Secp384r1
  Secp521r1
}

Constructors

  • Secp256r1
  • Secp384r1
  • Secp521r1

Key algorithm for test certificate generation.

pub opaque type KeyType

Test certificate data for both server and client.

pub type PkixTestData {
  PkixTestData(server: CertData, client: CertData)
}

Constructors

Values

pub fn ec(curve: EcCurve) -> KeyType

Creates a key type for EC with the given named curve.

pub fn pkix_test_data(
  key_type: KeyType,
  server_name: String,
) -> PkixTestData

Generates test certificate data for the given key type.

The server_name parameter sets the dNSName in the server’s peer certificate. Use this same name as the SNI hostname when connecting with verify_peer so the hostname check passes.

pub fn rsa(size: Int) -> KeyType

Creates a key type for RSA with the given bit size.

Search Document