blob: 21614f8201d87ce4a5adaf715037b1241787a697 [file] [log] [blame]
[email protected]6b2e61f2012-02-28 08:06:541// Copyright (c) 2012 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.
4
5#ifndef CRYPTO_EC_SIGNATURE_CREATOR_IMPL_H_
6#define CRYPTO_EC_SIGNATURE_CREATOR_IMPL_H_
[email protected]6b2e61f2012-02-28 08:06:547
avidd373b8b2015-12-21 21:34:438#include <stdint.h>
9
[email protected]6b2e61f2012-02-28 08:06:5410#include "base/compiler_specific.h"
avidd373b8b2015-12-21 21:34:4311#include "base/macros.h"
[email protected]6b2e61f2012-02-28 08:06:5412#include "crypto/ec_signature_creator.h"
13
14namespace crypto {
15
16class ECSignatureCreatorImpl : public ECSignatureCreator {
17 public:
18 explicit ECSignatureCreatorImpl(ECPrivateKey* key);
dcheng0db63a92014-12-22 23:40:2119 ~ECSignatureCreatorImpl() override;
[email protected]6b2e61f2012-02-28 08:06:5420
avidd373b8b2015-12-21 21:34:4321 bool Sign(const uint8_t* data,
dcheng0db63a92014-12-22 23:40:2122 int data_len,
avidd373b8b2015-12-21 21:34:4323 std::vector<uint8_t>* signature) override;
[email protected]6b2e61f2012-02-28 08:06:5424
avidd373b8b2015-12-21 21:34:4325 bool DecodeSignature(const std::vector<uint8_t>& der_sig,
26 std::vector<uint8_t>* out_raw_sig) override;
[email protected]7c3090a02012-09-19 15:11:3327
[email protected]6b2e61f2012-02-28 08:06:5428 private:
29 ECPrivateKey* key_;
[email protected]6b2e61f2012-02-28 08:06:5430
31 DISALLOW_COPY_AND_ASSIGN(ECSignatureCreatorImpl);
32};
33
34} // namespace crypto
35
36#endif // CRYPTO_EC_SIGNATURE_CREATOR_IMPL_H_