View Source jose_jwa_pkcs1 (JOSE v1.11.9)

PKCS #1: RSA Cryptography Specifications Version 2.1 See RFC 3447: 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

Link to this function

decrypt_private(CipherText, RSAPrivateKey, Options)

View Source
Link to this function

eme_oaep_decode(Hash, EM, Label, K)

View Source
-spec eme_oaep_decode(Hash, EM, Label, K) -> M | error
                   when
                       Hash :: rsa_hash_fun(),
                       EM :: binary(),
                       Label :: binary(),
                       K :: integer(),
                       M :: binary().
Link to this function

eme_oaep_encode(Hash, DM, Label, Seed, K)

View Source
-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().
Link to this function

emsa_pkcs1_encode(Hash, Algorithm, Message, EMBits)

View Source
-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().
Link to this function

emsa_pss_encode(Hash, Message, EMBits)

View Source
-spec emsa_pss_encode(Hash, Message, EMBits) -> {ok, EM} | {error, Reason}
                   when
                       Hash :: rsa_hash_fun(),
                       Message :: binary(),
                       EMBits :: integer(),
                       EM :: binary(),
                       Reason :: term().
Link to this function

emsa_pss_encode(Hash, Message, Salt, EMBits)

View Source
-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().
Link to this function

emsa_pss_verify(Hash, Message, EM, EMBits)

View Source
-spec emsa_pss_verify(Hash, Message, EM, EMBits) -> boolean()
                   when
                       Hash :: rsa_hash_fun(),
                       Message :: binary(),
                       EM :: binary(),
                       EMBits :: integer().
Link to this function

emsa_pss_verify(Hash, Message, EM, SaltLen, EMBits)

View Source
-spec emsa_pss_verify(Hash, Message, EM, SaltLen, EMBits) -> boolean()
                   when
                       Hash :: rsa_hash_fun(),
                       Message :: binary(),
                       EM :: binary(),
                       SaltLen :: integer(),
                       EMBits :: integer().
Link to this function

encrypt_public(PlainText, RSAPublicKey, Options)

View Source
Link to this function

mgf1(Hash, Seed, MaskLen)

View Source
-spec mgf1(Hash, Seed, MaskLen) -> {ok, binary()} | {error, mask_too_long}
        when Hash :: rsa_hash_fun(), Seed :: binary(), MaskLen :: pos_integer().
Link to this function

rsaes_oaep_decrypt(Hash, CipherText, RSAPrivateKey)

View Source
-spec rsaes_oaep_decrypt(Hash, CipherText, RSAPrivateKey) -> PlainText
                      when
                          Hash :: rsa_hash_fun(),
                          CipherText :: binary(),
                          RSAPrivateKey :: rsa_private_key(),
                          PlainText :: binary().
Link to this function

rsaes_oaep_decrypt(Hash, CipherText, Label, RSAPrivateKey)

View Source
-spec rsaes_oaep_decrypt(Hash, CipherText, Label, RSAPrivateKey) -> PlainText
                      when
                          Hash :: rsa_hash_fun(),
                          CipherText :: binary(),
                          Label :: binary(),
                          RSAPrivateKey :: rsa_private_key(),
                          PlainText :: binary().
Link to this function

rsaes_oaep_encrypt(Hash, PlainText, RSAPublicKey)

View Source
-spec rsaes_oaep_encrypt(Hash, PlainText, RSAPublicKey) -> CipherText
                      when
                          Hash :: rsa_hash_fun(),
                          PlainText :: binary(),
                          RSAPublicKey :: rsa_public_key(),
                          CipherText :: binary().
Link to this function

rsaes_oaep_encrypt(Hash, PlainText, Label, RSAPublicKey)

View Source
-spec rsaes_oaep_encrypt(Hash, PlainText, Label, RSAPublicKey) -> CipherText
                      when
                          Hash :: rsa_hash_fun(),
                          PlainText :: binary(),
                          Label :: binary(),
                          RSAPublicKey :: rsa_public_key(),
                          CipherText :: binary().
Link to this function

rsaes_oaep_encrypt(Hash, PlainText, Label, Seed, RSAPublicKey)

View Source
-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().
Link to this function

rsaes_pkcs1_decrypt(CipherText, RSAPrivateKey)

View Source
-spec rsaes_pkcs1_decrypt(CipherText, RSAPrivateKey) -> PlainText
                       when
                           CipherText :: binary(),
                           RSAPrivateKey :: rsa_private_key(),
                           PlainText :: binary().
Link to this function

rsaes_pkcs1_encrypt(PlainText, RSAPublicKey)

View Source
-spec rsaes_pkcs1_encrypt(PlainText, RSAPublicKey) -> CipherText
                       when
                           PlainText :: binary(),
                           RSAPublicKey :: rsa_public_key(),
                           CipherText :: binary().
Link to this function

rsassa_pkcs1_sign(Hash, Message, RSAPrivateKey)

View Source
-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().
Link to this function

rsassa_pkcs1_sign(Hash, Algorithm, Message, RSAPrivateKey)

View Source
-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().
Link to this function

rsassa_pkcs1_verify(Hash, Message, Signature, RSAPublicKey)

View Source
-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().
Link to this function

rsassa_pss_sign(Hash, Message, RSAPrivateKey)

View Source
-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().
Link to this function

rsassa_pss_sign(Hash, Message, Salt, RSAPrivateKey)

View Source
-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().
Link to this function

rsassa_pss_verify(Hash, Message, Signature, RSAPublicKey)

View Source
-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().
Link to this function

sign(Message, DigestType, RSAPrivateKey, Options)

View Source
Link to this function

verify(Message, DigestType, Signature, RSAPublicKey, Options)

View Source