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 a `bin` in PKCS #12 format, which is defined in RFC 7292.

Preconditions

• `Bin` must be a `bin`

• `Password` must be a `str`

• $config must be a fun which takes a config val

Config val methods

• C.on_success($success): uses $success as the success cont. $success must be a fun which takes a key_pair_set val. The default success cont is VAL.identity.

• C.on_wrong_password($wrong_password): uses $wrong_password as the wrong-password cont. $wrong_password must be a fun which takes no arg. The default wrong-password cont is a fun which tail-calls the error cont.

• C.on_error($error): uses $error as the error cont. $error must be a fun which takes a `str` val. The default error cont is a fun which raises an exception.

Result

If read_pkcs12 successfully reads a key_pair_set, it tail-calls the success cont with the key_pair_set.

If the password is wrong, read_pkcs12 tail-calls the wrong-password cont.

If an error occurs while reading the bin, read_pkcs12 tail-calls the error cont with a `str` as the error message.

5.104.4. KEY_PAIR_SET.empty

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