signmsg.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*############################################################################
  2. # Copyright 2016 Intel Corporation
  3. #
  4. # Licensed under the Apache License, Version 2.0 (the "License");
  5. # you may not use this file except in compliance with the License.
  6. # You may obtain a copy of the License at
  7. #
  8. # http://www.apache.org/licenses/LICENSE-2.0
  9. #
  10. # Unless required by applicable law or agreed to in writing, software
  11. # distributed under the License is distributed on an "AS IS" BASIS,
  12. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. # See the License for the specific language governing permissions and
  14. # limitations under the License.
  15. ############################################################################*/
  16. /*!
  17. * \file
  18. * \brief Message signing interface.
  19. */
  20. #ifndef EXAMPLE_SIGNMSG_SRC_SIGNMSG_H_
  21. #define EXAMPLE_SIGNMSG_SRC_SIGNMSG_H_
  22. #include "epid/member/api.h"
  23. #include "epid/common/file_parser.h"
  24. /// Check if opaque data blob containing CA certificate is authorized
  25. bool IsCaCertAuthorizedByRootCa(void const* data, size_t size);
  26. /// Create Intel(R) EPID signature of message
  27. EpidStatus SignMsg(void const* msg, size_t msg_len, void const* basename,
  28. size_t basename_len, unsigned char const* signed_sig_rl,
  29. size_t signed_sig_rl_size,
  30. unsigned char const* signed_pubkey,
  31. size_t signed_pubkey_size, unsigned char const* priv_key,
  32. size_t privkey_size, HashAlg hash_alg,
  33. MemberPrecomp* member_precomp, bool member_precomp_is_input,
  34. EpidSignature** sig, size_t* sig_len,
  35. EpidCaCertificate const* cacert);
  36. #endif // EXAMPLE_SIGNMSG_SRC_SIGNMSG_H_