Virgil Security Crypto library  1.8.2
VirgilCMSContent.h
1 
37 #ifndef VIRGIL_CRYPTO_VIRGIL_CMS_CONTENT_H
38 #define VIRGIL_CRYPTO_VIRGIL_CMS_CONTENT_H
39 
40 #include <string>
41 
42 #include <virgil/crypto/VirgilByteArray.h>
43 #include <virgil/crypto/foundation/asn1/VirgilAsn1Compatible.h>
44 
45 namespace virgil { namespace crypto { namespace foundation { namespace cms {
46 
51 typedef enum {
52  VirgilCMSContentType_Data = 0,
53  VirgilCMSContentType_SignedData,
54  VirgilCMSContentType_EnvelopedData,
55  VirgilCMSContentType_DigestedData,
56  VirgilCMSContentType_EncryptedData,
57  VirgilCMSContentType_AuthenticatedData
58 } VirgilCMSContentType;
59 
65 public:
70  VirgilCMSContentType contentType;
75  virgil::crypto::VirgilByteArray content;
76 public:
89  virtual size_t asn1Write(
92  size_t childWrittenBytes = 0) const;
93 
96 public:
100  virtual ~VirgilCMSContent() throw();
101 
102 private:
106  static std::string contentTypeToOID(VirgilCMSContentType contentType);
107 
111  static VirgilCMSContentType oidToContentType(const std::string& oid);
112 };
113 
114 }}}}
115 
116 #endif /* VIRGIL_CRYPTO_VIRGIL_CMS_CONTENT_H */
This class provides methods for reading ASN.1 data structure.
Definition: VirgilAsn1Reader.h:53
This class provides interface that allow to save and restore object state in the ASN.1 structure.
Definition: VirgilAsn1Compatible.h:59
This class provides methods for writing ASN.1 data structure.
Definition: VirgilAsn1Writer.h:54
Definition: VirgilAsn1Compatible.h:46
virtual ~VirgilCMSContent()
Polymorphic destructor.
virgil::crypto::VirgilByteArray content
Associated data.
Definition: VirgilCMSContent.h:75
VirgilCMSContentType contentType
Indicates the type of the associated content.
Definition: VirgilCMSContent.h:70
virtual void asn1Read(virgil::crypto::foundation::asn1::VirgilAsn1Reader &asn1Reader)
Read object state from the reader.
Data object that represent CMS structure: ContentInfo.
Definition: VirgilCMSContent.h:64
virtual size_t asn1Write(virgil::crypto::foundation::asn1::VirgilAsn1Writer &asn1Writer, size_t childWrittenBytes=0) const
Write object state to the writer.