View Source jose_jwa_pkcs1 (JOSE v1.11.10)
https://tools.ietf.org/html/rfc3447
Summary
Types
-type rsa_digest_type() :: md5 | sha | sha224 | sha256 | sha384 | sha512.
-type rsa_hash_fun() :: rsa_digest_type() | {hmac, rsa_digest_type(), iodata()} | fun((iodata()) -> binary()).
-type rsa_private_key() :: #'RSAPrivateKey'{}.
-type rsa_public_key() :: #'RSAPublicKey'{}.
Functions
-spec eme_oaep_decode(Hash, EM, Label, K) -> M | error when Hash :: rsa_hash_fun(), EM :: binary(), Label :: binary(), K :: integer(), M :: binary().
-spec eme_oaep_encode(Hash, DM, Label, Seed, K) -> {ok, EM} | {error, Reason} when Hash :: rsa_hash_fun(), DM :: binary(), Label :: binary(), Seed :: binary(), K :: integer(), EM :: binary(), Reason :: term().
-spec eme_pkcs1_decode(EM, K) -> M | error when EM :: binary(), K :: integer(), M :: binary().
-spec eme_pkcs1_encode(DM, K) -> {ok, EM} | {error, Reason}
when DM :: binary(), K :: integer(), EM :: binary(), Reason :: term().
-spec emsa_pkcs1_encode(Hash, Algorithm, Message, EMBits) -> {ok, EM} | {error, Reason} when Hash :: rsa_hash_fun(), Algorithm :: md5 | sha | sha1 | sha256 | sha384 | sha512 | binary(), Message :: binary(), EMBits :: integer(), EM :: binary(), Reason :: term().
-spec emsa_pss_encode(Hash, Message, EMBits) -> {ok, EM} | {error, Reason} when Hash :: rsa_hash_fun(), Message :: binary(), EMBits :: integer(), EM :: binary(), Reason :: term().
-spec emsa_pss_encode(Hash, Message, Salt, EMBits) -> {ok, EM} | {error, Reason} when Hash :: rsa_hash_fun(), Message :: binary(), Salt :: binary() | integer(), EMBits :: integer(), EM :: binary(), Reason :: term().
-spec emsa_pss_verify(Hash, Message, EM, EMBits) -> boolean() when Hash :: rsa_hash_fun(), Message :: binary(), EM :: binary(), EMBits :: integer().
-spec emsa_pss_verify(Hash, Message, EM, SaltLen, EMBits) -> boolean() when Hash :: rsa_hash_fun(), Message :: binary(), EM :: binary(), SaltLen :: integer(), EMBits :: integer().
-spec mgf1(Hash, Seed, MaskLen) -> {ok, binary()} | {error, mask_too_long} when Hash :: rsa_hash_fun(), Seed :: binary(), MaskLen :: pos_integer().
-spec rsaes_oaep_decrypt(Hash, CipherText, RSAPrivateKey) -> PlainText when Hash :: rsa_hash_fun(), CipherText :: binary(), RSAPrivateKey :: rsa_private_key(), PlainText :: binary().
-spec rsaes_oaep_decrypt(Hash, CipherText, Label, RSAPrivateKey) -> PlainText when Hash :: rsa_hash_fun(), CipherText :: binary(), Label :: binary(), RSAPrivateKey :: rsa_private_key(), PlainText :: binary().
-spec rsaes_oaep_encrypt(Hash, PlainText, RSAPublicKey) -> CipherText when Hash :: rsa_hash_fun(), PlainText :: binary(), RSAPublicKey :: rsa_public_key(), CipherText :: binary().
-spec rsaes_oaep_encrypt(Hash, PlainText, Label, RSAPublicKey) -> CipherText when Hash :: rsa_hash_fun(), PlainText :: binary(), Label :: binary(), RSAPublicKey :: rsa_public_key(), CipherText :: binary().
-spec rsaes_oaep_encrypt(Hash, PlainText, Label, Seed, RSAPublicKey) -> CipherText when Hash :: rsa_hash_fun(), PlainText :: binary(), Label :: binary(), Seed :: binary(), RSAPublicKey :: rsa_public_key(), CipherText :: binary().
-spec rsaes_pkcs1_decrypt(CipherText, RSAPrivateKey) -> PlainText when CipherText :: binary(), RSAPrivateKey :: rsa_private_key(), PlainText :: binary().
-spec rsaes_pkcs1_encrypt(PlainText, RSAPublicKey) -> CipherText when PlainText :: binary(), RSAPublicKey :: rsa_public_key(), CipherText :: binary().
-spec rsassa_pkcs1_sign(Hash, Message, RSAPrivateKey) -> {ok, Signature} | {error, Reason} when Hash :: rsa_hash_fun(), Message :: binary(), RSAPrivateKey :: rsa_private_key(), Signature :: binary(), Reason :: term().
-spec rsassa_pkcs1_sign(Hash, Algorithm, Message, RSAPrivateKey) -> {ok, Signature} | {error, Reason} when Hash :: rsa_hash_fun(), Algorithm :: md5 | sha | sha1 | sha256 | sha384 | sha512 | binary(), Message :: binary(), RSAPrivateKey :: rsa_private_key(), Signature :: binary(), Reason :: term().
-spec rsassa_pkcs1_verify(Hash, Message, Signature, RSAPublicKey) -> boolean() when Hash :: rsa_hash_fun(), Message :: binary(), Signature :: binary(), RSAPublicKey :: rsa_public_key().
Link to this function
rsassa_pkcs1_verify(Hash, Algorithm, Message, Signature, RSAPublicKey)
View Source-spec rsassa_pkcs1_verify(Hash, Algorithm, Message, Signature, RSAPublicKey) -> boolean() when Hash :: rsa_hash_fun(), Algorithm :: md5 | sha | sha1 | sha256 | sha384 | sha512 | binary(), Message :: binary(), Signature :: binary(), RSAPublicKey :: rsa_public_key().
-spec rsassa_pss_sign(Hash, Message, RSAPrivateKey) -> {ok, Signature} | {error, Reason} when Hash :: rsa_hash_fun(), Message :: binary(), RSAPrivateKey :: rsa_private_key(), Signature :: binary(), Reason :: term().
-spec rsassa_pss_sign(Hash, Message, Salt, RSAPrivateKey) -> {ok, Signature} | {error, Reason} when Hash :: rsa_hash_fun(), Message :: binary(), Salt :: binary() | integer(), RSAPrivateKey :: rsa_private_key(), Signature :: binary(), Reason :: term().
-spec rsassa_pss_verify(Hash, Message, Signature, RSAPublicKey) -> boolean() when Hash :: rsa_hash_fun(), Message :: binary(), Signature :: binary(), RSAPublicKey :: rsa_public_key().
Link to this function
rsassa_pss_verify(Hash, Message, Signature, SaltLen, RSAPublicKey)
View Source-spec rsassa_pss_verify(Hash, Message, Signature, SaltLen, RSAPublicKey) -> boolean() when Hash :: rsa_hash_fun(), Message :: binary(), Signature :: binary(), SaltLen :: integer(), RSAPublicKey :: rsa_public_key().