scclib
Stable Cloud Computing C++ Library
|
RSASSA-PSS https://tools.ietf.org/html/rfc8017#section-8.1 Notes on use in x.509: https://tools.ietf.org/html/rfc4055#section-3. More...
#include <rsa.h>
Public Types | |
enum class | HashType { md5 , sha1 , sha224 , sha256 , sha384 , sha512 } |
Static Public Member Functions | |
static int | size (const RsaPublicKey &k) |
Size of signature in bytes. | |
static void | sign (const void *, int, void *, int, const RsaPrivateKey &, PssSignature::HashType, int=0) |
Sign the signature using a private key. More... | |
static void | sign (const void *loc, int len, std::vector< char > &sig, const RsaPrivateKey &key, PssSignature::HashType hash, int salt_len=0) |
static bool | verify (const void *, int, const void *, int, const RsaPublicKey &, PssSignature::HashType) |
Verify the signature using a public key. More... | |
static bool | verify (const void *loc, int len, const std::vector< char > &sig, const RsaPublicKey &key, PssSignature::HashType hash) |
RSASSA-PSS https://tools.ietf.org/html/rfc8017#section-8.1 Notes on use in x.509: https://tools.ietf.org/html/rfc4055#section-3.
rsa_pss_rsae_sha256 is a required signature type for tls1_3.
|
static |
Sign the signature using a private key.
loc | Message buffer |
len | Message buffer size |
sig_loc | Signature buffer |
sig_len | Signature buffer size, must be the size returned by size(). |
key | Private RSA key |
hash | Hash type |
salt_len | Length of randomly generated salt |
Throws exception on parameter error.
According to https://tools.ietf.org/html/rfc3447, "Typical salt lengths in octets are hLen (the length of the output of the hash function Hash) and 0".
|
static |