Documentation

Hale.Jose.Crypto.JOSE.FFI

@[extern hale_jose_hmac]
opaque Crypto.JOSE.FFI.hmac (key data : ByteArray) (algorithm : UInt8) :

Compute HMAC using the specified SHA algorithm. algorithm: 0=SHA256, 1=SHA384, 2=SHA512

@[extern hale_jose_rsa_verify]
opaque Crypto.JOSE.FFI.rsaVerify (pubkeyDer data signature : ByteArray) (algorithm usePss : UInt8) :

Verify an RSA signature. Returns 1 if valid, 0 if invalid. algorithm: 0=SHA256, 1=SHA384, 2=SHA512 usePss: 1 for PSS padding, 0 for PKCS1v15

@[extern hale_jose_ec_verify]
opaque Crypto.JOSE.FFI.ecVerify (pubkeyDer data signature : ByteArray) (algorithm : UInt8) :

Verify an EC signature. Returns 1 if valid, 0 if invalid. algorithm: 0=SHA256/P-256, 1=SHA384/P-384, 2=SHA512/P-521

@[extern hale_jose_rsa_pubkey_from_components]

Build an RSA public key from modulus (n) and exponent (e). Returns DER-encoded public key.

@[extern hale_jose_ec_pubkey_from_components]

Build an EC public key from curve and coordinates. Returns DER-encoded public key. crv: 0=P-256, 1=P-384, 2=P-521

@[extern hale_jose_base64url_decode]

Decode base64url-encoded data.

@[extern hale_jose_base64url_encode]

Encode data as base64url.