aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/asn1/alg_id.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/asn1/alg_id.cpp')
-rw-r--r--src/lib/asn1/alg_id.cpp22
1 files changed, 6 insertions, 16 deletions
diff --git a/src/lib/asn1/alg_id.cpp b/src/lib/asn1/alg_id.cpp
index 7d476a225..75ea78c18 100644
--- a/src/lib/asn1/alg_id.cpp
+++ b/src/lib/asn1/alg_id.cpp
@@ -16,32 +16,24 @@ namespace Botan {
* Create an AlgorithmIdentifier
*/
AlgorithmIdentifier::AlgorithmIdentifier(const OID& alg_id,
- const std::vector<byte>& param)
- {
- oid = alg_id;
- parameters = param;
- }
+ const std::vector<byte>& param) : oid(alg_id), parameters(param)
+ {}
/*
* Create an AlgorithmIdentifier
*/
AlgorithmIdentifier::AlgorithmIdentifier(const std::string& alg_id,
- const std::vector<byte>& param)
- {
- oid = OIDS::lookup(alg_id);
- parameters = param;
- }
+ const std::vector<byte>& param) : oid(OIDS::lookup(alg_id)), parameters(param)
+ {}
/*
* Create an AlgorithmIdentifier
*/
AlgorithmIdentifier::AlgorithmIdentifier(const OID& alg_id,
- Encoding_Option option)
+ Encoding_Option option) : oid(alg_id), parameters()
{
const byte DER_NULL[] = { 0x05, 0x00 };
- oid = alg_id;
-
if(option == USE_NULL_PARAM)
parameters += std::pair<const byte*, size_t>(DER_NULL, sizeof(DER_NULL));
}
@@ -50,12 +42,10 @@ AlgorithmIdentifier::AlgorithmIdentifier(const OID& alg_id,
* Create an AlgorithmIdentifier
*/
AlgorithmIdentifier::AlgorithmIdentifier(const std::string& alg_id,
- Encoding_Option option)
+ Encoding_Option option) : oid(OIDS::lookup(alg_id)), parameters()
{
const byte DER_NULL[] = { 0x05, 0x00 };
- oid = OIDS::lookup(alg_id);
-
if(option == USE_NULL_PARAM)
parameters += std::pair<const byte*, size_t>(DER_NULL, sizeof(DER_NULL));
}