proxygen
JavaCryptoFactory.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2018-present, Facebook, Inc.
3  * All rights reserved.
4  *
5  * This source code is licensed under the BSD-style license found in the
6  * LICENSE file in the root directory of this source tree.
7  */
8 
9 #pragma once
10 
12 #include <fizz/protocol/Factory.h>
13 
14 namespace fizz {
15 
19 class JavaCryptoFactory : public Factory {
20  public:
21  ~JavaCryptoFactory() override = default;
22 
23  std::shared_ptr<PeerCert> makePeerCert(Buf certData) const override {
24  if (certData->empty()) {
25  throw std::runtime_error("empty peer cert");
26  }
27 
28  return std::make_unique<JavaCryptoPeerCert>(std::move(certData));
29  }
30 };
31 } // namespace fizz
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
Definition: Actions.h:16
std::shared_ptr< PeerCert > makePeerCert(Buf certData) const override
std::unique_ptr< folly::IOBuf > Buf
Definition: Types.h:22
~JavaCryptoFactory() override=default