5.104. kink/tls/KEY_PAIR_SET

5.104.1. type key_pair_set

A key_pair_set contains a collection of pairs of a private key, a public key, and its certificate.

5.104.2. KEY_PAIR_SET.is?(Val)

`is?` returns whether `Val` is a key_pair_set val.

5.104.3. KEY_PAIR_SET.read_pkcs12(Bin Password ...[$config={}])

`read_pkcs12` reads a `key_pair_set` from `Bin` in PKCS #12 format, which is defined in RFC 7292.

Config methods:

• C.on_success($success): default = VAL.identity

• C.on_error($error): default = {(:Exc) Exc.raise }

• C.on_wrong_password($wrong_password): default = a fun which tail-calls $error

If a `key_pair_set` is successfully read, `read_pkcs12` tail-calls $success with the `key_pair_set`.

If the password is wrong, `read_pkcs12` tail-calls $wrong_password

If an error occurs while reading the bin, `read_pkcs12` tail-calls $error with an `exception`.

Preconditions

• `Bin` must be a `bin`

• `Password` must be a `str`

• $success must be a fun which takes a `key_pair_set`

• $error must be a fun which takes an `exception`

• $wrong_password must be a fun which takes no arg

5.104.4. KEY_PAIR_SET.empty

`empty` returns a key_pair_set which has no key pairs.