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