X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=blobdiff_plain;f=doc%2Fcrypto%2FASN1_generate_nconf.pod;h=92f624fa24d39b10ff75f8cea57d8be04943fed1;hp=b4c89377f6a331d38db2a02aaec4072415c4ce86;hb=69b017f66b2b743c827fe885aa575066fef71ec9;hpb=d78254aa2816f6c80220ada64f2231879003278b diff --git a/doc/crypto/ASN1_generate_nconf.pod b/doc/crypto/ASN1_generate_nconf.pod index b4c89377f6..92f624fa24 100644 --- a/doc/crypto/ASN1_generate_nconf.pod +++ b/doc/crypto/ASN1_generate_nconf.pod @@ -6,8 +6,10 @@ ASN1_generate_nconf, ASN1_generate_v3 - ASN1 generation functions =head1 SYNOPSIS - ASN1_TYPE *ASN1_generate_nconf(char *str, CONF *nconf); - ASN1_TYPE *ASN1_generate_v3(char *str, X509V3_CTX *cnf); + #include + + ASN1_TYPE *ASN1_generate_nconf(const char *str, CONF *nconf); + ASN1_TYPE *ASN1_generate_v3(const char *str, X509V3_CTX *cnf); =head1 DESCRIPTION @@ -17,7 +19,7 @@ in an B structure. B contains the string to encode B or B contains the optional configuration information where additional strings will be read from. B will typically come from a config -file wherease B is obtained from an B structure +file whereas B is obtained from an B structure which will typically be used by X509 v3 certificate extension functions. B or B can be set to B if no additional configuration will be used. @@ -28,13 +30,17 @@ The actual data encoded is determined by the string B and the configuration information. The general format of the string is: - B<[modifier,]type[:value]> +=over 2 + +=item B<[modifier,]type[:value]> + +=back That is zero or more comma separated modifiers followed by a type followed by an optional colon and a value. The formats of B, B and B are explained below. -=head2 SUPPORTED TYPES +=head2 Supported Types The supported types are listed below. Unless otherwise specified only the B format is permissible. @@ -46,7 +52,7 @@ only the B format is permissible. This encodes a boolean type. The B string is mandatory and should be B or B. Additionally B, B, B, B, B, B, B, B, B, B, B and B -are acceptable. +are acceptable. =item B @@ -55,7 +61,7 @@ Encode the B type, the B string must not be present. =item B, B Encodes an ASN1 B type. The B string represents -the value of the integer, it can be preceeded by a minus sign and +the value of the integer, it can be prefaced by a minus sign and is normally interpreted as a decimal value unless the prefix B<0x> is included. @@ -72,22 +78,22 @@ a short name, a long name or numerical format. =item B, B Encodes an ASN1 B structure, the value should be in -the format B. +the format B. =item B, B Encodes an ASN1 B structure, the value should be in -the format B. +the format B. =item B, B -Emcodes an ASN1 B. B represents the contents +Encodes an ASN1 B. B represents the contents of this structure, the format strings B and B can be used to specify the format of B. -=item B, B +=item B, B -Emcodes an ASN1 B. B represents the contents +Encodes an ASN1 B. B represents the contents of this structure, the format strings B, B and B can be used to specify the format of B. @@ -97,7 +103,8 @@ bits is set to zero. =item B, B, B, B, B, B, B, B, B, B, B, B, B, -B, B +B, B, B, B, +B These encode the corresponding string types. B represents the contents of this structure. The format can be B or B. @@ -112,7 +119,7 @@ will be encoded. =back -=head2 MODIFIERS +=head2 Modifiers Modifiers affect the following structure, they can be used to add EXPLICIT or IMPLICIT tagging, add wrappers or to change @@ -147,10 +154,11 @@ bits is set to zero. This specifies the format of the ultimate value. It should be followed by a colon and one of the strings B, B, B or B. -If no format specifier is included then B is used. If B is specified -then the value string must be a valid B string. For B the output must -be a set of hex digits. B (which is only valid for a BIT STRING) is a -comma separated list of set bits. +If no format specifier is included then B is used. If B is +specified then the value string must be a valid B string. For B the +output must be a set of hex digits. B (which is only valid for a BIT +STRING) is a comma separated list of the indices of the set bits, all other +bits are zero. =back @@ -168,16 +176,20 @@ An IA5String explicitly tagged using APPLICATION tagging: EXPLICIT:0A,IA5STRING:Hello World +A BITSTRING with bits 1 and 5 set and all others zero: + + FORMAT:BITLIST,BITSTRING:1,5 + A more complex example using a config file to produce a -SEQUENCE consiting of a BOOL an OID and a UTF8String: +SEQUENCE consisting of a BOOL an OID and a UTF8String: -asn1 = SEQUENCE:seq_section + asn1 = SEQUENCE:seq_section -[seq_section] + [seq_section] -field1 = BOOLEAN:TRUE -field2 = OID:commonName -field3 = UTF8:Third field + field1 = BOOLEAN:TRUE + field2 = OID:commonName + field3 = UTF8:Third field This example produces an RSAPrivateKey structure, this is the key contained in the file client.pem in all OpenSSL distributions @@ -240,14 +252,19 @@ structure: ASN1_generate_nconf() and ASN1_generate_v3() return the encoded data as an B structure or B if an error occurred. -The error codes that can be obtained by L. +The error codes that can be obtained by L. =head1 SEE ALSO -L +L + +=head1 COPYRIGHT -=head1 HISTORY +Copyright 2002-2016 The OpenSSL Project Authors. All Rights Reserved. -ASN1_generate_nconf() and ASN1_generate_v3() were added to OpenSSL 0.9.8 +Licensed under the OpenSSL license (the "License"). You may not use +this file except in compliance with the License. You can obtain a copy +in the file LICENSE in the source distribution or at +L. =cut