-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Preparations for future upstream OTP crypto changes
* Improved detection of AES CBC, ECB, and GCM support. * Improved detection of RSAES-OAEP, RSAES-PKCS1-v1_5, RSASSA-PKCS1-v1_5, and RSASSA-PSS support. * Implemented fallback RSAES-PKCS1-v1_5 and RSASSA-PKCS1-v1_5 algorithms. * Improved selection of encryptor for oct keys. * Improved algorithm support detection for jose_jwa.
- Loading branch information
1 parent
b5c8082
commit 853c5d4
Showing
18 changed files
with
925 additions
and
331 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,26 @@ | ||
defmodule JOSE.JWA do | ||
|
||
# API | ||
def block_cipher(cipher), do: :jose_jwa.block_cipher(cipher) | ||
# Crypto API | ||
def block_decrypt(cipher, key, cipher_text), do: :jose_jwa.block_decrypt(cipher, key, cipher_text) | ||
def block_decrypt(cipher, key, iv, cipher_text), do: :jose_jwa.block_decrypt(cipher, key, iv, cipher_text) | ||
def block_encrypt(cipher, key, plain_text), do: :jose_jwa.block_encrypt(cipher, key, plain_text) | ||
def block_encrypt(cipher, key, iv, plain_text), do: :jose_jwa.block_encrypt(cipher, key, iv, plain_text) | ||
# Public Key API | ||
def decrypt_private(cipher_text, private_key, options), do: :jose_jwa.decrypt_private(cipher_text, private_key, options) | ||
def encrypt_public(plain_text, public_key, options), do: :jose_jwa.encrypt_public(plain_text, public_key, options) | ||
def sign(message, digest_type, private_key, options), do: :jose_jwa.sign(message, digest_type, private_key, options) | ||
def verify(message, digest_type, signature, public_key, options), do: :jose_jwa.verify(message, digest_type, signature, public_key, options) | ||
# API | ||
def block_cipher(cipher), do: :jose_jwa.block_cipher(cipher) | ||
def crypto_ciphers(), do: :jose_jwa.crypto_ciphers() | ||
def crypto_fallback(), do: :jose_jwa.crypto_fallback() | ||
def crypto_fallback(boolean), do: :jose_jwa.crypto_fallback(boolean) | ||
def crypto_supports(), do: :jose_jwa.crypto_supports() | ||
def constant_time_compare(a, b), do: :jose_jwa.constant_time_compare(a, b) | ||
def ec_key_mode(), do: :jose_jwa.ec_key_mode() | ||
def is_native_cipher(cipher), do: :jose_jwa.is_native_cipher(cipher) | ||
def is_rsa_padding_supported(rsa_padding), do: :jose_jwa.is_rsa_padding_supported(rsa_padding) | ||
def is_signer_supported(signer), do: :jose_jwa.is_signer_supported(signer) | ||
def is_block_cipher_supported(cipher), do: :jose_jwa.is_block_cipher_supported(cipher) | ||
def is_rsa_crypt_supported(padding), do: :jose_jwa.is_rsa_crypt_supported(padding) | ||
def is_rsa_sign_supported(padding), do: :jose_jwa.is_rsa_sign_supported(padding) | ||
def supports(), do: :jose_jwa.supports() | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
%{"base64url": {:hex, :base64url, "0.0.1"}, | ||
"cutkey": {:git, "git://github.com/potatosalad/cutkey.git", "00e3ce92da8360c2c943ad0431b54cb710d6d454", []}, | ||
"earmark": {:hex, :earmark, "0.1.17"}, | ||
"ex_doc": {:hex, :ex_doc, "0.9.0"}, | ||
"jsx": {:hex, :jsx, "2.7.1"}, | ||
"jiffy": {:git, "git://github.com/davisp/jiffy.git", "66594cf6f4dc7ecdd17f742d103e55437edea972", []}, | ||
"jsone": {:hex, :jsone, "1.2.0"}, | ||
"jsx": {:hex, :jsx, "2.7.2"}, | ||
"poison": {:hex, :poison, "1.5.0"}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.