~ubuntu-branches/ubuntu/trusty/libtasn1-3/trusty-proposed

« back to all changes in this revision

Viewing changes to doc/libtasn1.html

  • Committer: Bazaar Package Importer
  • Author(s): Andreas Metzler
  • Date: 2011-02-12 16:38:16 UTC
  • mfrom: (4.2.2 experimental)
  • Revision ID: james.westby@ubuntu.com-20110212163816-c32zjlxe94c7ecvo
Tags: 2.9-2
* Upload to unstable.
* Downgrade libtasn1-3 priority to standard.
* Drop superfluous code from debian/rules.
* set CFLAGS += -Wall, the latest combination of cdbs + dpkg-dev does not
  seem to set it by default.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
<html lang="en">
2
2
<head>
3
 
<title>GNU Libtasn1 2.7</title>
 
3
<title>GNU Libtasn1 2.9</title>
4
4
<meta http-equiv="Content-Type" content="text/html">
5
 
<meta name="description" content="GNU Libtasn1 2.7">
 
5
<meta name="description" content="GNU Libtasn1 2.9">
6
6
<meta name="generator" content="makeinfo 4.13">
7
7
<link title="Top" rel="top" href="#Top">
8
8
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
9
9
<!--
10
10
This manual is for GNU Libtasn1
11
 
(version 2.7, 20 April 2010),
 
11
(version 2.9, 30 September 2010),
12
12
which is a library for Abstract Syntax Notation One (ASN.1) and
13
13
Distinguish Encoding Rules (DER) manipulation.
14
14
 
79
79
--></style>
80
80
</head>
81
81
<body>
82
 
<h1 class="settitle">GNU Libtasn1 2.7</h1>
 
82
<h1 class="settitle">GNU Libtasn1 2.9</h1>
83
83
<div class="contents">
84
84
<h2>Table of Contents</h2>
85
85
<ul>
128
128
<h2 class="unnumbered">Libtasn1</h2>
129
129
 
130
130
<p>This manual is for GNU Libtasn1
131
 
(version 2.7, 20 April 2010),
 
131
(version 2.9, 30 September 2010),
132
132
which is a library for Abstract Syntax Notation One (ASN.1) and
133
133
Distinguish Encoding Rules (DER) manipulation.
134
134
 
538
538
        <p>Function used to start the parse algorithm.  Creates the structures
539
539
needed to manage the definitions included in <code>file_name</code> file.
540
540
 
541
 
        <p><strong>Returns:</strong> </p></blockquote></div>
 
541
        <p><strong>Returns:</strong> <code>ASN1_SUCCESS</code> if the file has a correct syntax and every
 
542
identifier is known, <code>ASN1_ELEMENT_NOT_EMPTY</code> if <code>definitions</code> not
 
543
<code>ASN1_TYPE_EMPTY</code>, <code>ASN1_FILE_NOT_FOUND</code> if an error occured while
 
544
opening <code>file_name</code>, <code>ASN1_SYNTAX_ERROR</code> if the syntax is not
 
545
correct, <code>ASN1_IDENTIFIER_NOT_FOUND</code> if in the file there is an
 
546
identifier that is not defined, <code>ASN1_NAME_TOO_LONG</code> if in the
 
547
file there is an identifier whith more than <code>ASN1_MAX_NAME_SIZE</code>
 
548
characters. 
 
549
</p></blockquote></div>
542
550
 
543
551
<h4 class="subheading">asn1_parser2array</h4>
544
552
 
564
572
"/aa/bb/xx_asn1_tab.c".  If <code>vectorName</code> is <code>NULL</code> the vector name
565
573
will be "xx_asn1_tab".
566
574
 
567
 
        <p><strong>Returns:</strong> </p></blockquote></div>
 
575
        <p><strong>Returns:</strong> <code>ASN1_SUCCESS</code> if the file has a correct syntax and every
 
576
identifier is known, <code>ASN1_FILE_NOT_FOUND</code> if an error occured
 
577
while opening <code>inputFileName</code>, <code>ASN1_SYNTAX_ERROR</code> if the syntax is
 
578
not correct, <code>ASN1_IDENTIFIER_NOT_FOUND</code> if in the file there is
 
579
an identifier that is not defined, <code>ASN1_NAME_TOO_LONG</code> if in the
 
580
file there is an identifier whith more than <code>ASN1_MAX_NAME_SIZE</code>
 
581
characters. 
 
582
</p></blockquote></div>
568
583
 
569
584
<div class="node">
570
585
<a name="ASN.1-field-functions"></a>
594
609
        <p>Creates the structures needed to manage the ASN.1 definitions. 
595
610
<code>array</code> is a vector created by <code>asn1_parser2array()</code>.
596
611
 
597
 
        <p><strong>Returns:</strong> </p></blockquote></div>
 
612
        <p><strong>Returns:</strong> <code>ASN1_SUCCESS</code> if structure was created correctly,
 
613
<code>ASN1_ELEMENT_NOT_EMPTY</code> if *<code>definitions</code> not ASN1_TYPE_EMPTY,
 
614
<code>ASN1_IDENTIFIER_NOT_FOUND</code> if in the file there is an identifier
 
615
that is not defined (see <code>errorDescription</code> for more information),
 
616
<code>ASN1_ARRAY_ERROR</code> if the array pointed by <code>array</code> is wrong. 
 
617
</p></blockquote></div>
598
618
 
599
619
<h4 class="subheading">asn1_delete_structure</h4>
600
620
 
607
627
        <p>Deletes the structure *<code>structure</code>.  At the end, *<code>structure</code> is set
608
628
to ASN1_TYPE_EMPTY.
609
629
 
610
 
        <p><strong>Returns:</strong> </p></blockquote></div>
 
630
        <p><strong>Returns:</strong> <code>ASN1_SUCCESS</code> if successful, <code>ASN1_ELEMENT_NOT_FOUND</code> if
 
631
*<code>structure</code> was ASN1_TYPE_EMPTY. 
 
632
</p></blockquote></div>
611
633
 
612
634
<h4 class="subheading">asn1_delete_element</h4>
613
635
 
622
644
 
623
645
        <p>Deletes the element named *<code>element_name</code> inside *<code>structure</code>.
624
646
 
625
 
        <p><strong>Returns:</strong> </p></blockquote></div>
 
647
        <p><strong>Returns:</strong> <code>ASN1_SUCCESS</code> if successful, <code>ASN1_ELEMENT_NOT_FOUND</code> if
 
648
the <code>element_name</code> was not found. 
 
649
</p></blockquote></div>
626
650
 
627
651
<h4 class="subheading">asn1_create_element</h4>
628
652
 
642
666
 
643
667
        <p>rc = asn1_create_element(cert_def, "PKIX1.Certificate", certptr);
644
668
 
645
 
        <p><strong>Returns:</strong> </p></blockquote></div>
 
669
        <p><strong>Returns:</strong> <code>ASN1_SUCCESS</code> if creation OK, <code>ASN1_ELEMENT_NOT_FOUND</code> if
 
670
<code>source_name</code> is not known. 
 
671
</p></blockquote></div>
646
672
 
647
673
<h4 class="subheading">asn1_print_structure</h4>
648
674
 
679
705
        <p>Counts the number of elements of a sub-structure called NAME with
680
706
names equal to "?1","?2", ...
681
707
 
682
 
        <p><strong>Returns:</strong> </p></blockquote></div>
 
708
        <p><strong>Returns:</strong> <code>ASN1_SUCCESS</code> if successful, <code>ASN1_ELEMENT_NOT_FOUND</code> if
 
709
<code>name</code> is not known, <code>ASN1_GENERIC_ERROR</code> if pointer <code>num</code> is <code>NULL</code>. 
 
710
</p></blockquote></div>
683
711
 
684
712
<h4 class="subheading">asn1_find_structure_from_oid</h4>
685
713
 
714
742
 
715
743
        <p>Create a deep copy of a ASN1_TYPE variable.
716
744
 
717
 
        <p><strong>Return value:</strong> Return <code>ASN1_SUCCESS</code> on success. 
 
745
        <p><strong>Returns:</strong> Return <code>ASN1_SUCCESS</code> on success. 
718
746
</p></blockquote></div>
719
747
 
720
748
<h4 class="subheading">asn1_write_value</h4>
825
853
        <p>result=asn1_write_value(cert,
826
854
"tbsCertificate.subject.rdnSequence.?LAST", "NEW", 1);
827
855
 
828
 
        <p><strong>Returns:</strong> </p></blockquote></div>
 
856
        <p><strong>Returns:</strong> <code>ASN1_SUCCESS</code> if the value was set,
 
857
<code>ASN1_ELEMENT_NOT_FOUND</code> if <code>name</code> is not a valid element, and
 
858
<code>ASN1_VALUE_NOT_VALID</code> if <code>ivalue</code> has a wrong format. 
 
859
</p></blockquote></div>
829
860
 
830
861
<h4 class="subheading">asn1_read_value</h4>
831
862
 
888
919
        <p><strong>ANY:</strong> If NAME indicates an any type, VALUE will indicate the DER
889
920
encoding of the structure actually used.
890
921
 
891
 
        <p><strong>Returns:</strong> </p></blockquote></div>
 
922
        <p><strong>Returns:</strong> <code>ASN1_SUCCESS</code> if value is returned,
 
923
<code>ASN1_ELEMENT_NOT_FOUND</code> if <code>name</code> is not a valid element,
 
924
<code>ASN1_VALUE_NOT_FOUND</code> if there isn't any value for the element
 
925
selected, and <code>ASN1_MEM_ERROR</code> if The value vector isn't big enough
 
926
to store the result, and in this case <code>len</code> will contain the number of
 
927
bytes needed. 
 
928
</p></blockquote></div>
892
929
 
893
930
<h4 class="subheading">asn1_read_tag</h4>
894
931
 
910
947
<code>ASN1_CLASS_UNIVERSAL</code>, <code>ASN1_CLASS_PRIVATE</code> or
911
948
<code>ASN1_CLASS_CONTEXT_SPECIFIC</code>.
912
949
 
913
 
        <p><strong>Returns:</strong> </p></blockquote></div>
 
950
        <p><strong>Returns:</strong> <code>ASN1_SUCCESS</code> if successful, <code>ASN1_ELEMENT_NOT_FOUND</code> if
 
951
<code>name</code> is not a valid element. 
 
952
</p></blockquote></div>
914
953
 
915
954
<div class="node">
916
955
<a name="DER-functions"></a>
995
1034
        <p>Creates the DER encoding for the NAME structure (inside *POINTER
996
1035
structure).
997
1036
 
998
 
        <p><strong>Returns:</strong> </p></blockquote></div>
 
1037
        <p><strong>Returns:</strong> <code>ASN1_SUCCESS</code> if DER encoding OK, <code>ASN1_ELEMENT_NOT_FOUND</code>
 
1038
if <code>name</code> is not a valid element, <code>ASN1_VALUE_NOT_FOUND</code> if there
 
1039
is an element without a value, <code>ASN1_MEM_ERROR</code> if the <code>ider</code>
 
1040
vector isn't big enough and in this case <code>len</code> will contain the
 
1041
length needed. 
 
1042
</p></blockquote></div>
999
1043
 
1000
1044
<h4 class="subheading">asn1_get_length_der</h4>
1001
1045
 
1487
1531
of text.  A copy that is not &ldquo;Transparent&rdquo; is called &ldquo;Opaque&rdquo;.
1488
1532
 
1489
1533
     <p>Examples of suitable formats for Transparent copies include plain
1490
 
<span class="sc">ascii</span> without markup, Texinfo input format, LaTeX input
1491
 
format, <acronym>SGML</acronym> or <acronym>XML</acronym> using a publicly available
1492
 
<acronym>DTD</acronym>, and standard-conforming simple <acronym>HTML</acronym>,
1493
 
PostScript or <acronym>PDF</acronym> designed for human modification.  Examples
1494
 
of transparent image formats include <acronym>PNG</acronym>, <acronym>XCF</acronym> and
1495
 
<acronym>JPG</acronym>.  Opaque formats include proprietary formats that can be
1496
 
read and edited only by proprietary word processors, <acronym>SGML</acronym> or
1497
 
<acronym>XML</acronym> for which the <acronym>DTD</acronym> and/or processing tools are
1498
 
not generally available, and the machine-generated <acronym>HTML</acronym>,
1499
 
PostScript or <acronym>PDF</acronym> produced by some word processors for
 
1534
ASCII without markup, Texinfo input format, LaTeX input
 
1535
format, SGML or XML using a publicly available
 
1536
DTD, and standard-conforming simple HTML,
 
1537
PostScript or PDF designed for human modification.  Examples
 
1538
of transparent image formats include PNG, XCF and
 
1539
JPG.  Opaque formats include proprietary formats that can be
 
1540
read and edited only by proprietary word processors, SGML or
 
1541
XML for which the DTD and/or processing tools are
 
1542
not generally available, and the machine-generated HTML,
 
1543
PostScript or PDF produced by some word processors for
1500
1544
output purposes only.
1501
1545
 
1502
1546
     <p>The &ldquo;Title Page&rdquo; means, for a printed book, the title page itself,