validate

fun validate(trustedCAs: Collection<Certificate>? = null)

Validate the message.

Passing a collection of trustedCAs will also verify:

  • That there's a valid path between the sender's certificate and one of the trustedCAs.

  • That, if the recipient address is private, the sender's issuer is the recipient itself.

If there are no trusted CAs, avoid setting trustedCAs to an empty collection as that will always cause validation to fail. This is intentional: We won't try to guess whether you made a mistake or really meant to skip authorization checks.

Parameters

trustedCAs

The trusted CAs (if any); an empty set will always fail validation

Throws

If the message was never (or is no longer) valid