![]() |
Gray C++ Libraries
0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
|
#include <cKeyRSA.h>
Public Member Functions | |
cKeyRSASignOptions (SSL_Hash_TYPE eHashType=SSL_Hash_SHA1, size_t nSizeSalt=20) noexcept | |
HRESULT | ReadHashAlg (const cASNBuf &alg) |
HRESULT | ReadRsaSsaPssParams (const cASNBuf ¶ms, OUT SSL_Hash_TYPE &eSignHashType) |
Public Attributes | |
SSL_Hash_TYPE | m_eHashTypeMGF1 |
int | m_nSizeSaltExpected |
Options for RSASSA-PSS signature verification. See VerifySignatureV21()
|
inlinenoexcept |
HashAlgorithm ::= AlgorithmIdentifier
AlgorithmIdentifier ::= SEQUENCE { algorithm OBJECT IDENTIFIER, parameters ANY DEFINED BY algorithm OPTIONAL }
For HashAlgorithm, parameters MUST be nullptr or absent. Make sure we got a SEQUENCE and setup bounds
HRESULT GrayLib::cKeyRSASignOptions::ReadRsaSsaPssParams | ( | const cASNBuf & | params, |
OUT SSL_Hash_TYPE & | eSignHashType | ||
) |
RSASSA-PSS-params ::= SEQUENCE { hashAlgorithm [0] HashAlgorithm DEFAULT sha1Identifier, maskGenAlgorithm [1] MaskGenAlgorithm DEFAULT mgf1SHA1Identifier, saltLength [2] INTEGER DEFAULT 20, trailerField [3] INTEGER DEFAULT 1 } – Note that the tags in this Sequence are explicit.
RFC 4055 (which defines use of RSASSA-PSS in PKIX) states that the value of trailerField MUST be 1, and PKCS#1 v2.2 doesn't even define any other option. Enforce this at parsing time.
SSL_Hash_TYPE GrayLib::cKeyRSASignOptions::m_eHashTypeMGF1 |
int GrayLib::cKeyRSASignOptions::m_nSizeSaltExpected |