aboutsummaryrefslogtreecommitdiffstats
path: root/src/cms/cms_enc.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2009-03-30 18:27:18 +0000
committerlloyd <[email protected]>2009-03-30 18:27:18 +0000
commit96d6eb6f29c55e16a37cf11899547886f735b065 (patch)
tree9f13901e9b44c98d58b2589c9b09c6a7443eb7cd /src/cms/cms_enc.cpp
parent3cc3dd72c5f87b76852a55c1f2d1821dba967d8c (diff)
Thomas Moschny passed along a request from the Fedora packagers which came
up during the Fedora submission review, that each source file include some text about the license. One handy Perl script later and each file now has the line Distributed under the terms of the Botan license after the copyright notices. While I was in there modifying every file anyway, I also stripped out the remainder of the block comments (lots of astericks before and after the text); this is stylistic thing I picked up when I was first learning C++ but in retrospect it is not a good style as the structure makes it harder to modify comments (with the result that comments become fewer, shorter and are less likely to be updated, which are not good things).
Diffstat (limited to 'src/cms/cms_enc.cpp')
-rw-r--r--src/cms/cms_enc.cpp46
1 files changed, 24 insertions, 22 deletions
diff --git a/src/cms/cms_enc.cpp b/src/cms/cms_enc.cpp
index 601fbc9b6..2413676d7 100644
--- a/src/cms/cms_enc.cpp
+++ b/src/cms/cms_enc.cpp
@@ -1,7 +1,9 @@
-/*************************************************
-* CMS Encoding Base Source File *
-* (C) 1999-2007 Jack Lloyd *
-*************************************************/
+/*
+* CMS Encoding Base
+* (C) 1999-2007 Jack Lloyd
+*
+* Distributed under the terms of the Botan license
+*/
#include <botan/cms_enc.h>
#include <botan/der_enc.h>
@@ -10,9 +12,9 @@
namespace Botan {
-/*************************************************
-* Setup the intitial layer of CMS data *
-*************************************************/
+/*
+* Setup the intitial layer of CMS data
+*/
void CMS_Encoder::set_data(const byte buf[], u32bit length)
{
if(data.has_items())
@@ -22,17 +24,17 @@ void CMS_Encoder::set_data(const byte buf[], u32bit length)
type = "CMS.DataContent";
}
-/*************************************************
-* Setup the intitial layer of CMS data *
-*************************************************/
+/*
+* Setup the intitial layer of CMS data
+*/
void CMS_Encoder::set_data(const std::string& str)
{
set_data((const byte*)str.c_str(), str.length());
}
-/*************************************************
-* Finalize and return the CMS encoded data *
-*************************************************/
+/*
+* Finalize and return the CMS encoded data
+*/
SecureVector<byte> CMS_Encoder::get_contents()
{
DER_Encoder encoder;
@@ -49,26 +51,26 @@ SecureVector<byte> CMS_Encoder::get_contents()
return encoder.get_contents();
}
-/*************************************************
-* Add a new layer of encapsulation *
-*************************************************/
+/*
+* Add a new layer of encapsulation
+*/
void CMS_Encoder::add_layer(const std::string& oid, DER_Encoder& new_layer)
{
data = new_layer.get_contents();
type = oid;
}
-/*************************************************
-* Return the PEM-encoded data *
-*************************************************/
+/*
+* Return the PEM-encoded data
+*/
std::string CMS_Encoder::PEM_contents()
{
return PEM_Code::encode(get_contents(), "PKCS7");
}
-/*************************************************
-* Make an EncapsulatedContentInfo *
-*************************************************/
+/*
+* Make an EncapsulatedContentInfo
+*/
SecureVector<byte> CMS_Encoder::make_econtent(const SecureVector<byte>& data,
const std::string& type)
{