Skip to main content

sign_cdp_jwt

Function sign_cdp_jwt 

Source
pub fn sign_cdp_jwt(
    api_key: &str,
    pem_secret: &str,
    accept: &Value,
) -> Result<String, Box<dyn Error>>
Expand description

0.6.2 — CDP-JWT (ES256/P-256) signer. Uses the p256 crate (added to dependencies). Pure Rust; no openssl FFI. Header: {alg:‘ES256’, kid:<api_key>, typ:‘JWT’, nonce:}. Payload: {sub:<api_key>, iss:‘cdp’, nbf:, exp:<now+120>, uri:‘POST dispatch.wave.online’, claim:}. p256’s ECDSA signer returns r||s as a Signature; we serialize to raw 32+32 (IEEE P-1363) — the JWS ES256 spec representation — then base64url-encode the three parts.