1// 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_
7
8#include <stdint.h>
9
10#include "base/compiler_specific.h"
11#include "base/macros.h"
12#include "crypto/ec_signature_creator.h"
13
14namespace crypto {
15
16class ECSignatureCreatorImpl : public ECSignatureCreator {
17 public:
18  explicit ECSignatureCreatorImpl(ECPrivateKey* key);
19  ~ECSignatureCreatorImpl() override;
20
21  bool Sign(const uint8_t* data,
22            int data_len,
23            std::vector<uint8_t>* signature) override;
24
25  bool DecodeSignature(const std::vector<uint8_t>& der_sig,
26                       std::vector<uint8_t>* out_raw_sig) override;
27
28 private:
29  ECPrivateKey* key_;
30
31  DISALLOW_COPY_AND_ASSIGN(ECSignatureCreatorImpl);
32};
33
34}  // namespace crypto
35
36#endif  // CRYPTO_EC_SIGNATURE_CREATOR_IMPL_H_
37