DECLARE_EXCEPTION_TYPE(Base, opensslError);
};
- // During initialization, FIPS_MODE and the antropy source are set.
- // And system certificates are loaded in the memory during initialization.
- // FIPS_MODE - ON, OFF(Default)
- // antropy source - /dev/random,/dev/urandom(Default)
- static int initialize();
-
static int createKeyPairRSA(const int size, // size in bits [1024, 2048, 4096]
KeyImpl &createdPrivateKey, // returned value ==> Key &createdPrivateKey,
KeyImpl &createdPublicKey); // returned value ==> Key &createdPublicKey
KeyImpl &createdPrivateKey, // returned value
KeyImpl &createdPublicKey); // returned value
- int createSignature(const KeyImpl &privateKey,
- const RawBuffer &message,
- const HashAlgorithm hashAlgo,
- const RSAPaddingAlgorithm padAlgo,
- RawBuffer &signature);
-
- int verifySignature(const KeyImpl &publicKey,
- const RawBuffer &message,
- const RawBuffer &signature,
- const HashAlgorithm hashAlgo,
- const RSAPaddingAlgorithm padAlgo);
-
private:
- const EVP_MD *getMdAlgo(const HashAlgorithm hashAlgo);
- int getRsaPadding(const RSAPaddingAlgorithm padAlgo);
-
- int signMessage(EVP_PKEY *privKey,
- const RawBuffer &message,
- const int rsa_padding,
- RawBuffer &signature);
- int digestSignMessage(EVP_PKEY *privKey,
- const RawBuffer &message,
- const EVP_MD *md_algo,
- const int rsa_padding,
- RawBuffer &signature);
-
- int verifyMessage(EVP_PKEY *pubKey,
- const RawBuffer &message,
- const RawBuffer &signature,
- const int rsa_padding);
- int digestVerifyMessage(EVP_PKEY *pubKey,
- const RawBuffer &message,
- const RawBuffer &signature,
- const EVP_MD *md_algo,
- const int rsa_padding);
};
} // namespace SW