const chunk_t ASN1_INTEGER_2 = chunk_from_chars(0x02, 0x01, 0x02);
/*
- * Defined in header.
+ * Described in header
+ */
+chunk_t asn1_algorithmIdentifier_params(int oid, chunk_t params)
+{
+ return asn1_wrap(ASN1_SEQUENCE, "mm", asn1_build_known_oid(oid), params);
+}
+
+/*
+ * Described in header
*/
chunk_t asn1_algorithmIdentifier(int oid)
{
parameters = asn1_simple_object(ASN1_NULL, chunk_empty);
break;
}
- return asn1_wrap(ASN1_SEQUENCE, "mm", asn1_build_known_oid(oid), parameters);
+ return asn1_algorithmIdentifier_params(oid, parameters);
}
/*
/*
+ * Copyright (C) 2011-2017 Tobias Brunner
* Copyright (C) 2006 Martin Will
* Copyright (C) 2000-2008 Andreas Steffen
- *
- * Hochschule fuer Technik Rapperswil
+ * HSR Hochschule fuer Technik Rapperswil
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
/** Some ASN.1 analysis functions */
/**
- * Build an algorithmIdentifier from a known OID.
+ * Build an algorithmIdentifier from a known OID with empty parameters.
*
* @param oid known OID index
- * @return body of the corresponding OID, allocated
+ * @return body of the corresponding ASN.1 structure, allocated
*/
chunk_t asn1_algorithmIdentifier(int oid);
/**
+ * Build an algorithmIdentifier from a known OID and the given prameters.
+ *
+ * @param oid known OID index
+ * @param params parameters to encode in the algorithmIdentifier (adopted)
+ * @return body of the corresponding ASN.1 structure, allocated
+ */
+chunk_t asn1_algorithmIdentifier_params(int oid, chunk_t params);
+
+/**
* Converts an ASN.1 OID into a known OID index
*
* @param object body of an OID