crypto.ecc_save_key

crypto

ecc_save_key(key_obj, key_file) -> ok, err

Save an ECC key object to a file in JWK format

Serializes key_obj as an RFC 7517 P-256 JWK (kty, crv, x, y, d, and optional kid) and writes it to key_file.

Requires x, y, and private to be 32-byte raw binary strings. When public is present, it must equal "\4" .. x .. y. kid, when present, must be a string. Returns nil and a reason on invalid input or write failure.