ContentCryptoMaterial.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /*
  2. * Copyright 2009-2017 Alibaba Cloud All rights reserved.
  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. #pragma once
  17. #include <alibabacloud/oss/Export.h>
  18. #include <alibabacloud/oss/Types.h>
  19. namespace AlibabaCloud
  20. {
  21. namespace OSS
  22. {
  23. class ALIBABACLOUD_OSS_EXPORT ContentCryptoMaterial
  24. {
  25. public:
  26. ContentCryptoMaterial();
  27. ~ContentCryptoMaterial();
  28. std::string Tag() const { return "Material"; }
  29. const ByteBuffer& ContentKey() const { return contentKey_; }
  30. const ByteBuffer& ContentIV() const { return contentIV_; }
  31. const std::string& CipherName() const { return cipherName_; }
  32. const std::string& KeyWrapAlgorithm() const { return keyWrapAlgorithm_; }
  33. const std::map<std::string, std::string>& Description() const { return description_; }
  34. const ByteBuffer& EncryptedContentKey() const { return encryptedContentKey_; }
  35. const ByteBuffer& EncryptedContentIV() const { return encryptedContentIV_; }
  36. const std::string& MagicNumber() const { return magicNumber_; }
  37. void setContentKey(const ByteBuffer& key) { contentKey_ = key; }
  38. void setContentIV(const ByteBuffer& iv) { contentIV_ = iv; }
  39. void setCipherName(const std::string& name) { cipherName_ = name; }
  40. void setKeyWrapAlgorithm(const std::string& algo) { keyWrapAlgorithm_ = algo; }
  41. void setDescription(const std::map<std::string, std::string>& desc) { description_ = desc; }
  42. void setEncryptedContentKey(const ByteBuffer& key) { encryptedContentKey_ = key; }
  43. void setEncryptedContentIV(const ByteBuffer& iv) { encryptedContentIV_ = iv; }
  44. void setMagicNumber(const std::string& value) { magicNumber_ = value; }
  45. private:
  46. ByteBuffer contentKey_;
  47. ByteBuffer contentIV_;
  48. std::string cipherName_;
  49. std::string keyWrapAlgorithm_;
  50. std::map<std::string, std::string> description_;
  51. ByteBuffer encryptedContentKey_;
  52. ByteBuffer encryptedContentIV_;
  53. std::string magicNumber_;
  54. };
  55. }
  56. }