Virgil Security Crypto library  2.6.3
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 "../../VirgilByteArray.h"
43 #include "../asn1/VirgilAsn1Compatible.h"
44 
45 namespace virgil { namespace crypto { namespace foundation { namespace cms {
46 
52 public:
57  enum class Type {
58  Data = 0,
59  SignedData,
60  EnvelopedData,
61  DigestedData,
62  EncryptedData,
63  AuthenticatedData,
64  SignedAndEnvelopedData,
65  DataWithAttributes,
66  EncryptedPrivateKeyInfo
67  };
68 
79 public:
92  virtual size_t asn1Write(
95  size_t childWrittenBytes = 0) const;
96 
99 private:
103  static std::string contentTypeToOID(VirgilCMSContent::Type contentType);
104 
108  static VirgilCMSContent::Type oidToContentType(const std::string& oid);
109 };
110 
111 }}}}
112 
113 #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
Root namespace for all Virgil Security libraries.
Definition: VirgilAsn1Compatible.h:46
std::vector< unsigned char > VirgilByteArray
This type represents a sequence of bytes.
Definition: VirgilByteArray.h:50
virgil::crypto::VirgilByteArray content
Associated data.
Definition: VirgilCMSContent.h:78
VirgilCMSContent::Type contentType
Indicates the type of the associated content.
Definition: VirgilCMSContent.h:73
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:51
virtual size_t asn1Write(virgil::crypto::foundation::asn1::VirgilAsn1Writer &asn1Writer, size_t childWrittenBytes=0) const
Write object state to the writer.
Type
Enumeration of possible CMS Content Types.
Definition: VirgilCMSContent.h:57