JOSE.JWK

JWK stands for Json Web Key. This module parses the record definition in :jose_jwk and eases the transition between Erlang/Elixir.

It provides several utilities for creating/decoding key structs from files, pem representation, binary and etc. It also provides mechanisms for signing and verifying data.

Summary

Types

t :: %JOSE.JWK{fields: term, keys: term, kty: term}

Functions

block_decrypt(encrypted, jwk)
block_encrypt(plain_text, jwk)
block_encrypt(plain_text, jwe, jwk)
box_decrypt(encrypted, jwk)
box_encrypt(plain_text, jwk, my_private_jwk)
box_encrypt(plain_text, jwe, other_public_jwk, my_private_jwk)
from(jwk)
from(password, jwk)
from_binary(binary)
from_binary(password, binary)
from_file(file)
from_file(password, file)
from_map(map)
from_map(password, map)
from_pem(pem)

Generates a key from a pem representation (Privacy Enhanced Email) in binary.

from_pem(password, pem)

Same as from_pem/1 but with a password used to unlock it.

from_pem_file(file)

Generates a key from reading a pem representation from a file.

from_pem_file(password, file)

Same as from_pem_file/1 but with a password to unlock it.

from_record(jose_jwk)

Converts a :jose_jwk record into a JOSE.JWK.

sign(plain_text, jwk)
sign(plain_text, jws, jwk)
thumbprint(jwk)
thumbprint(digest_type, jwk)
to_binary(jwk)
to_binary(password, jwk)
to_binary(password, jwe, jwk)
to_file(file, jwk)
to_file(password, file, jwk)
to_file(password, file, jwe, jwk)
to_key(jwk)
to_map(jwk)
to_map(password, jwk)
to_map(password, jwe, jwk)
to_pem(jwk)
to_pem(password, jwk)
to_pem_file(file, jwk)
to_pem_file(password, file, jwk)
to_public(jwk)
to_public_key(jwk)
to_public_map(jwk)
to_record(jwk)

Converts a JOSE.JWK struct to a :jose_jwk record.

to_thumbprint_map(jwk)
verify(signed, jwk)