Capy-Bearer Documentation

crypto_operation

host call

Capy

function crypto_operation(request : dval) dval

Description

crypto_operation() runs an ES256 operation from a DValue request.

Set algorithm to "ES256". Set operation to "key_generate", "jwt_sign", "cbor_decode", "cose_es256_parse", or "es256_verify".

The function validates the request before it runs the operation. It returns {ok: false, error: "invalid_request"} for an invalid request.

Parameters

request : an ES256 operation request map

Return Values

A response map with ok. A failed operation also has error.

Example

Capy

var result := crypto_operation({operation: "cbor_decode", algorithm: "ES256", cbor_base64url: "ggFiaGk"})
print(result.ok, "\n")