1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef COMPONENTS_WEBCRYPTO_ALGORITHMS_RSA_SIGN_H_
6 #define COMPONENTS_WEBCRYPTO_ALGORITHMS_RSA_SIGN_H_
21 // Helper functions for doing RSA-SSA signing and verification
22 // (both PKCS1-v1_5 and PSS flavor).
24 // The salt length parameter is only relevant when the key is for RSA-PSS. In
25 // other cases it should be set to zero.
27 Status
RsaSign(const blink::WebCryptoKey
& key
,
28 unsigned int pss_salt_length_bytes
,
29 const CryptoData
& data
,
30 std::vector
<uint8_t>* buffer
);
32 Status
RsaVerify(const blink::WebCryptoKey
& key
,
33 unsigned int pss_salt_length_bytes
,
34 const CryptoData
& signature
,
35 const CryptoData
& data
,
36 bool* signature_match
);
38 } // namespace webcrypto
40 #endif // COMPONENTS_WEBCRYPTO_ALGORITHMS_RSA_SIGN_H_