getOrThrow

Extract Did and key id or throw with contextual IllegalStateException (convenience for examples/tests).


Unwraps KeyIdResult.Success or throws IllegalStateException carrying the failure reason.


Extract the credential from a successful VerificationResult, or throw with detailed error.

Example:

val verification = trustWeave.verify { credential(cred) }.getOrThrow()

Throws

with detailed error message if verification failed


Extract the DID and document from a successful DidCreationResult, or throw with detailed error.

Example:

val (did, document) = trustWeave.createDid { method("key") }.getOrThrow()

Throws

with detailed error message if DID creation failed


Extract the wallet from a successful WalletCreationResult, or throw with detailed error.

Example:

val wallet = trustWeave.wallet { holderDid(did) }.getOrThrow()

Throws

with detailed error message if wallet creation failed


Unwrap a successful presentation or throw TrustWeaveException.InvalidState with stable code values (PRESENTATION_ADAPTER_NOT_READY, PRESENTATION_INVALID_REQUEST, PRESENTATION_ADAPTER_ERROR).