summaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2015-03-28 14:07:47 +0000
committerDr. Stephen Henson <steve@openssl.org>2015-03-30 22:01:31 +0100
commit22f5bd3dd2a660f6f50ef86de78985b995c63a85 (patch)
tree32e86c5a8497761d4650514955e15aaab2371106 /doc
parent94f4b4b31314c07a4b6c9898e14c1023a112d0d0 (diff)
New ASN1_TYPE SEQUENCE functions.
Add new functions ASN1_TYPE_pack_sequence and ASN1_TYPE_unpack_sequence: these encode and decode ASN.1 SEQUENCE using an ASN1_TYPE structure. Update ordinals. Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'doc')
-rw-r--r--doc/crypto/ASN1_TYPE_get.pod23
1 files changed, 22 insertions, 1 deletions
diff --git a/doc/crypto/ASN1_TYPE_get.pod b/doc/crypto/ASN1_TYPE_get.pod
index a6c65aaa34..79f2e382e1 100644
--- a/doc/crypto/ASN1_TYPE_get.pod
+++ b/doc/crypto/ASN1_TYPE_get.pod
@@ -2,7 +2,7 @@
=head1 NAME
-ASN1_TYPE_get, ASN1_TYPE_set, ASN1_TYPE_set1, ASN1_TYPE_cmp - ASN1_TYPE utility
+ASN1_TYPE_get, ASN1_TYPE_set, ASN1_TYPE_set1, ASN1_TYPE_cmp, ASN1_TYPE_unpack_sequence, ASN1_TYPE_pack_sequence - ASN1_TYPE utility
functions
=head1 SYNOPSIS
@@ -14,6 +14,10 @@ functions
int ASN1_TYPE_set1(ASN1_TYPE *a, int type, const void *value);
int ASN1_TYPE_cmp(const ASN1_TYPE *a, const ASN1_TYPE *b);
+ void *ASN1_TYPE_unpack_sequence(const ASN1_ITEM *it, const ASN1_TYPE *t);
+ ASN1_TYPE *ASN1_TYPE_pack_sequence(const ASN1_ITEM *it, void *s,
+ ASN1_TYPE **t);
+
=head1 DESCRIPTION
These functions allow an ASN1_TYPE structure to be manipulated. The
@@ -31,6 +35,17 @@ ASN1_TYPE_set1() sets the value of B<a> to B<type> a copy of B<value>.
ASN1_TYPE_cmp() compares ASN.1 types B<a> and B<b> and returns 0 if
they are identical and non-zero otherwise.
+ASN1_TYPE_unpack_sequence() attempts to parse the SEQUENCE present in
+B<t> using the ASN.1 structure B<it>. If successful it returns a pointer
+to the ASN.1 structure corresponding to B<it> which must be freed by the
+caller. If it fails it return NULL.
+
+ASN1_TYPE_pack_sequence() attempts to encode the ASN.1 structure B<s>
+corresponding to B<it> into an ASN1_TYPE. If successful the encoded
+ASN1_TYPE is returned. If B<t> and B<*t> are not NULL the encoded type
+is written to B<t> overwriting any existing data. If B<t> is not NULL
+but B<*t> is NULL the returned ASN1_TYPE is written to B<*t>.
+
=head1 NOTES
The type and meaning of the B<value> parameter for ASN1_TYPE_set() and
@@ -67,4 +82,10 @@ ASN1_TYPE_set1() returns 1 for sucess and 0 for failure.
ASN1_TYPE_cmp() returns 0 if the types are identical and non-zero otherwise.
+ASN1_TYPE_unpack_sequence() returns a pointer to an ASN.1 structure or
+NULL on failure.
+
+ASN1_TYPE_pack_sequence() return an ASN1_TYPE structure if it succeeds or
+NULL on failure.
+
=cut