const MIN_HMAC_KEY_BYTES
pub const MIN_HMAC_KEY_BYTES = 32Purpose
Constant MIN_HMAC_KEY_BYTES, defining protocol or algorithm parameters.
#crypto/jwtXU-CT-USE: fixed-shape-only HS256 tag equality uses crypto/subtle; asymmetric JWS algorithms remain variable-time. Compact JWS (JWT, RFC 7515 / RFC 7519) signing and verification HS256 (HMAC-SHA256) ES256 (ECDSA P-256 SHA-256, raw 64-byte R||S) RS256 (RSA PKCS#1 v1.5 SHA-256) EdDSA (Ed25519) Explicit algorithm verification prevents `alg: "none"` or algorithm confusion.
const MIN_HMAC_KEY_BYTESpub const MIN_HMAC_KEY_BYTES = 32Constant MIN_HMAC_KEY_BYTES, defining protocol or algorithm parameters.
validate_claims_timepub fn validate_claims_time(claims_json &string, now_sec int, leeway_sec int) intvalidate_claims_time enforces RFC 7519 exp and nbf claims when present. Throws on failure; handle the error or propagate it to the caller.
claims_json &stringnow_sec intleeway_sec intint — a value of this type
sign_es256pub fn sign_es256(private_key &string, team_id string, key_id string, iat_sec int) stringsign_es256 builds an APNs provider JWT. private_key is the 32-byte P-256 scalar. Throws on failure; handle the error or propagate it to the caller.
private_key &stringteam_id stringkey_id stringiat_sec intstring — result string
sign_es256_claimspub fn sign_es256_claims(private_key &string, key_id string, claims_json string) stringSign es256 claims. Throws on failure; handle the error or propagate it to the caller.
private_key &stringkey_id stringclaims_json stringstring — result string
verify_es256pub fn verify_es256(token string, public_key &string) stringVerify es256. Throws on failure; handle the error or propagate it to the caller.
token stringpublic_key &stringstring — result string
sign_hs256pub fn sign_hs256(secret &string, claims_json string) stringSign hs256. Throws on failure; handle the error or propagate it to the caller.
secret &stringclaims_json stringstring — result string
verify_hs256pub fn verify_hs256(token string, secret &string) stringVerify hs256. Throws on failure; handle the error or propagate it to the caller.
token stringsecret &stringstring — result string
sign_rs256pub fn sign_rs256(private_key &rsa.PrivateKey, key_id string, claims_json string) stringSign rs256. Throws on failure; handle the error or propagate it to the caller.
private_key &rsa.PrivateKeykey_id stringclaims_json stringstring — result string
verify_rs256pub fn verify_rs256(token string, public_key &rsa.PublicKey) stringVerify rs256. Throws on failure; handle the error or propagate it to the caller.
token stringpublic_key &rsa.PublicKeystring — result string
sign_eddsapub fn sign_eddsa(private_key &string, key_id string, claims_json string) stringSign eddsa. Throws on failure; handle the error or propagate it to the caller.
private_key &stringkey_id stringclaims_json stringstring — result string
verify_eddsapub fn verify_eddsa(token string, public_key &string) stringVerify eddsa. Throws on failure; handle the error or propagate it to the caller.
token stringpublic_key &stringstring — result string