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