diff options
Diffstat (limited to 'src/lib/libssl/src/doc')
| -rw-r--r-- | src/lib/libssl/src/doc/apps/ec.pod | 190 | ||||
| -rw-r--r-- | src/lib/libssl/src/doc/apps/ecparam.pod | 179 | ||||
| -rw-r--r-- | src/lib/libssl/src/doc/apps/x509v3_config.pod | 456 | ||||
| -rw-r--r-- | src/lib/libssl/src/doc/crypto/ASN1_generate_nconf.pod | 262 | ||||
| -rw-r--r-- | src/lib/libssl/src/doc/crypto/BN_BLINDING_new.pod | 109 | ||||
| -rw-r--r-- | src/lib/libssl/src/doc/crypto/ERR_set_mark.pod | 38 | ||||
| -rw-r--r-- | src/lib/libssl/src/doc/crypto/OPENSSL_Applink.pod | 21 | ||||
| -rw-r--r-- | src/lib/libssl/src/doc/crypto/OPENSSL_ia32cap.pod | 43 | ||||
| -rw-r--r-- | src/lib/libssl/src/doc/crypto/ecdsa.pod | 210 | ||||
| -rw-r--r-- | src/lib/libssl/src/doc/crypto/x509.pod | 64 |
10 files changed, 1572 insertions, 0 deletions
diff --git a/src/lib/libssl/src/doc/apps/ec.pod b/src/lib/libssl/src/doc/apps/ec.pod new file mode 100644 index 0000000000..1d4a36dbf4 --- /dev/null +++ b/src/lib/libssl/src/doc/apps/ec.pod | |||
| @@ -0,0 +1,190 @@ | |||
| 1 | =pod | ||
| 2 | |||
| 3 | =head1 NAME | ||
| 4 | |||
| 5 | ec - EC key processing | ||
| 6 | |||
| 7 | =head1 SYNOPSIS | ||
| 8 | |||
| 9 | B<openssl> B<ec> | ||
| 10 | [B<-inform PEM|DER>] | ||
| 11 | [B<-outform PEM|DER>] | ||
| 12 | [B<-in filename>] | ||
| 13 | [B<-passin arg>] | ||
| 14 | [B<-out filename>] | ||
| 15 | [B<-passout arg>] | ||
| 16 | [B<-des>] | ||
| 17 | [B<-des3>] | ||
| 18 | [B<-idea>] | ||
| 19 | [B<-text>] | ||
| 20 | [B<-noout>] | ||
| 21 | [B<-param_out>] | ||
| 22 | [B<-pubin>] | ||
| 23 | [B<-pubout>] | ||
| 24 | [B<-conv_form arg>] | ||
| 25 | [B<-param_enc arg>] | ||
| 26 | [B<-engine id>] | ||
| 27 | |||
| 28 | =head1 DESCRIPTION | ||
| 29 | |||
| 30 | The B<ec> command processes EC keys. They can be converted between various | ||
| 31 | forms and their components printed out. B<Note> OpenSSL uses the | ||
| 32 | private key format specified in 'SEC 1: Elliptic Curve Cryptography' | ||
| 33 | (http://www.secg.org/). To convert a OpenSSL EC private key into the | ||
| 34 | PKCS#8 private key format use the B<pkcs8> command. | ||
| 35 | |||
| 36 | =head1 COMMAND OPTIONS | ||
| 37 | |||
| 38 | =over 4 | ||
| 39 | |||
| 40 | =item B<-inform DER|PEM> | ||
| 41 | |||
| 42 | This specifies the input format. The B<DER> option with a private key uses | ||
| 43 | an ASN.1 DER encoded SEC1 private key. When used with a public key it | ||
| 44 | uses the SubjectPublicKeyInfo structur as specified in RFC 3280. | ||
| 45 | The B<PEM> form is the default format: it consists of the B<DER> format base64 | ||
| 46 | encoded with additional header and footer lines. In the case of a private key | ||
| 47 | PKCS#8 format is also accepted. | ||
| 48 | |||
| 49 | =item B<-outform DER|PEM> | ||
| 50 | |||
| 51 | This specifies the output format, the options have the same meaning as the | ||
| 52 | B<-inform> option. | ||
| 53 | |||
| 54 | =item B<-in filename> | ||
| 55 | |||
| 56 | This specifies the input filename to read a key from or standard input if this | ||
| 57 | option is not specified. If the key is encrypted a pass phrase will be | ||
| 58 | prompted for. | ||
| 59 | |||
| 60 | =item B<-passin arg> | ||
| 61 | |||
| 62 | the input file password source. For more information about the format of B<arg> | ||
| 63 | see the B<PASS PHRASE ARGUMENTS> section in L<openssl(1)|openssl(1)>. | ||
| 64 | |||
| 65 | =item B<-out filename> | ||
| 66 | |||
| 67 | This specifies the output filename to write a key to or standard output by | ||
| 68 | is not specified. If any encryption options are set then a pass phrase will be | ||
| 69 | prompted for. The output filename should B<not> be the same as the input | ||
| 70 | filename. | ||
| 71 | |||
| 72 | =item B<-passout arg> | ||
| 73 | |||
| 74 | the output file password source. For more information about the format of B<arg> | ||
| 75 | see the B<PASS PHRASE ARGUMENTS> section in L<openssl(1)|openssl(1)>. | ||
| 76 | |||
| 77 | =item B<-des|-des3|-idea> | ||
| 78 | |||
| 79 | These options encrypt the private key with the DES, triple DES, IDEA or | ||
| 80 | any other cipher supported by OpenSSL before outputting it. A pass phrase is | ||
| 81 | prompted for. | ||
| 82 | If none of these options is specified the key is written in plain text. This | ||
| 83 | means that using the B<ec> utility to read in an encrypted key with no | ||
| 84 | encryption option can be used to remove the pass phrase from a key, or by | ||
| 85 | setting the encryption options it can be use to add or change the pass phrase. | ||
| 86 | These options can only be used with PEM format output files. | ||
| 87 | |||
| 88 | =item B<-text> | ||
| 89 | |||
| 90 | prints out the public, private key components and parameters. | ||
| 91 | |||
| 92 | =item B<-noout> | ||
| 93 | |||
| 94 | this option prevents output of the encoded version of the key. | ||
| 95 | |||
| 96 | =item B<-modulus> | ||
| 97 | |||
| 98 | this option prints out the value of the public key component of the key. | ||
| 99 | |||
| 100 | =item B<-pubin> | ||
| 101 | |||
| 102 | by default a private key is read from the input file: with this option a | ||
| 103 | public key is read instead. | ||
| 104 | |||
| 105 | =item B<-pubout> | ||
| 106 | |||
| 107 | by default a private key is output. With this option a public | ||
| 108 | key will be output instead. This option is automatically set if the input is | ||
| 109 | a public key. | ||
| 110 | |||
| 111 | =item B<-conv_form> | ||
| 112 | |||
| 113 | This specifies how the points on the elliptic curve are converted | ||
| 114 | into octet strings. Possible values are: B<compressed> (the default | ||
| 115 | value), B<uncompressed> and B<hybrid>. For more information regarding | ||
| 116 | the point conversion forms please read the X9.62 standard. | ||
| 117 | B<Note> Due to patent issues the B<compressed> option is disabled | ||
| 118 | by default for binary curves and can be enabled by defining | ||
| 119 | the preprocessor macro B<OPENSSL_EC_BIN_PT_COMP> at compile time. | ||
| 120 | |||
| 121 | =item B<-param_enc arg> | ||
| 122 | |||
| 123 | This specifies how the elliptic curve parameters are encoded. | ||
| 124 | Possible value are: B<named_curve>, i.e. the ec parameters are | ||
| 125 | specified by a OID, or B<explicit> where the ec parameters are | ||
| 126 | explicitly given (see RFC 3279 for the definition of the | ||
| 127 | EC parameters structures). The default value is B<named_curve>. | ||
| 128 | B<Note> the B<implicitlyCA> alternative ,as specified in RFC 3279, | ||
| 129 | is currently not implemented in OpenSSL. | ||
| 130 | |||
| 131 | =item B<-engine id> | ||
| 132 | |||
| 133 | specifying an engine (by it's unique B<id> string) will cause B<req> | ||
| 134 | to attempt to obtain a functional reference to the specified engine, | ||
| 135 | thus initialising it if needed. The engine will then be set as the default | ||
| 136 | for all available algorithms. | ||
| 137 | |||
| 138 | =back | ||
| 139 | |||
| 140 | =head1 NOTES | ||
| 141 | |||
| 142 | The PEM private key format uses the header and footer lines: | ||
| 143 | |||
| 144 | -----BEGIN EC PRIVATE KEY----- | ||
| 145 | -----END EC PRIVATE KEY----- | ||
| 146 | |||
| 147 | The PEM public key format uses the header and footer lines: | ||
| 148 | |||
| 149 | -----BEGIN PUBLIC KEY----- | ||
| 150 | -----END PUBLIC KEY----- | ||
| 151 | |||
| 152 | =head1 EXAMPLES | ||
| 153 | |||
| 154 | To encrypt a private key using triple DES: | ||
| 155 | |||
| 156 | openssl ec -in key.pem -des3 -out keyout.pem | ||
| 157 | |||
| 158 | To convert a private key from PEM to DER format: | ||
| 159 | |||
| 160 | openssl ec -in key.pem -outform DER -out keyout.der | ||
| 161 | |||
| 162 | To print out the components of a private key to standard output: | ||
| 163 | |||
| 164 | openssl ec -in key.pem -text -noout | ||
| 165 | |||
| 166 | To just output the public part of a private key: | ||
| 167 | |||
| 168 | openssl ec -in key.pem -pubout -out pubkey.pem | ||
| 169 | |||
| 170 | To change the parameters encoding to B<explicit>: | ||
| 171 | |||
| 172 | openssl ec -in key.pem -param_enc explicit -out keyout.pem | ||
| 173 | |||
| 174 | To change the point conversion form to B<compressed>: | ||
| 175 | |||
| 176 | openssl ec -in key.pem -conv_form compressed -out keyout.pem | ||
| 177 | |||
| 178 | =head1 SEE ALSO | ||
| 179 | |||
| 180 | L<ecparam(1)|ecparam(1)>, L<dsa(1)|dsa(1)>, L<rsa(1)|rsa(1)> | ||
| 181 | |||
| 182 | =head1 HISTORY | ||
| 183 | |||
| 184 | The ec command was first introduced in OpenSSL 0.9.8. | ||
| 185 | |||
| 186 | =head1 AUTHOR | ||
| 187 | |||
| 188 | Nils Larsch for the OpenSSL project (http://www.openssl.org). | ||
| 189 | |||
| 190 | =cut | ||
diff --git a/src/lib/libssl/src/doc/apps/ecparam.pod b/src/lib/libssl/src/doc/apps/ecparam.pod new file mode 100644 index 0000000000..1a12105da7 --- /dev/null +++ b/src/lib/libssl/src/doc/apps/ecparam.pod | |||
| @@ -0,0 +1,179 @@ | |||
| 1 | =pod | ||
| 2 | |||
| 3 | =head1 NAME | ||
| 4 | |||
| 5 | ecparam - EC parameter manipulation and generation | ||
| 6 | |||
| 7 | =head1 SYNOPSIS | ||
| 8 | |||
| 9 | B<openssl ecparam> | ||
| 10 | [B<-inform DER|PEM>] | ||
| 11 | [B<-outform DER|PEM>] | ||
| 12 | [B<-in filename>] | ||
| 13 | [B<-out filename>] | ||
| 14 | [B<-noout>] | ||
| 15 | [B<-text>] | ||
| 16 | [B<-C>] | ||
| 17 | [B<-check>] | ||
| 18 | [B<-name arg>] | ||
| 19 | [B<-list_curve>] | ||
| 20 | [B<-conv_form arg>] | ||
| 21 | [B<-param_enc arg>] | ||
| 22 | [B<-no_seed>] | ||
| 23 | [B<-rand file(s)>] | ||
| 24 | [B<-genkey>] | ||
| 25 | [B<-engine id>] | ||
| 26 | |||
| 27 | =head1 DESCRIPTION | ||
| 28 | |||
| 29 | This command is used to manipulate or generate EC parameter files. | ||
| 30 | |||
| 31 | =head1 OPTIONS | ||
| 32 | |||
| 33 | =over 4 | ||
| 34 | |||
| 35 | =item B<-inform DER|PEM> | ||
| 36 | |||
| 37 | This specifies the input format. The B<DER> option uses an ASN.1 DER encoded | ||
| 38 | form compatible with RFC 3279 EcpkParameters. The PEM form is the default | ||
| 39 | format: it consists of the B<DER> format base64 encoded with additional | ||
| 40 | header and footer lines. | ||
| 41 | |||
| 42 | =item B<-outform DER|PEM> | ||
| 43 | |||
| 44 | This specifies the output format, the options have the same meaning as the | ||
| 45 | B<-inform> option. | ||
| 46 | |||
| 47 | =item B<-in filename> | ||
| 48 | |||
| 49 | This specifies the input filename to read parameters from or standard input if | ||
| 50 | this option is not specified. | ||
| 51 | |||
| 52 | =item B<-out filename> | ||
| 53 | |||
| 54 | This specifies the output filename parameters to. Standard output is used | ||
| 55 | if this option is not present. The output filename should B<not> be the same | ||
| 56 | as the input filename. | ||
| 57 | |||
| 58 | =item B<-noout> | ||
| 59 | |||
| 60 | This option inhibits the output of the encoded version of the parameters. | ||
| 61 | |||
| 62 | =item B<-text> | ||
| 63 | |||
| 64 | This option prints out the EC parameters in human readable form. | ||
| 65 | |||
| 66 | =item B<-C> | ||
| 67 | |||
| 68 | This option converts the EC parameters into C code. The parameters can then | ||
| 69 | be loaded by calling the B<get_ec_group_XXX()> function. | ||
| 70 | |||
| 71 | =item B<-check> | ||
| 72 | |||
| 73 | Validate the elliptic curve parameters. | ||
| 74 | |||
| 75 | =item B<-name arg> | ||
| 76 | |||
| 77 | Use the EC parameters with the specified 'short' name. Use B<-list_curves> | ||
| 78 | to get a list of all currently implemented EC parameters. | ||
| 79 | |||
| 80 | =item B<-list_curves> | ||
| 81 | |||
| 82 | If this options is specified B<ecparam> will print out a list of all | ||
| 83 | currently implemented EC parameters names and exit. | ||
| 84 | |||
| 85 | =item B<-conv_form> | ||
| 86 | |||
| 87 | This specifies how the points on the elliptic curve are converted | ||
| 88 | into octet strings. Possible values are: B<compressed> (the default | ||
| 89 | value), B<uncompressed> and B<hybrid>. For more information regarding | ||
| 90 | the point conversion forms please read the X9.62 standard. | ||
| 91 | B<Note> Due to patent issues the B<compressed> option is disabled | ||
| 92 | by default for binary curves and can be enabled by defining | ||
| 93 | the preprocessor macro B<OPENSSL_EC_BIN_PT_COMP> at compile time. | ||
| 94 | |||
| 95 | =item B<-param_enc arg> | ||
| 96 | |||
| 97 | This specifies how the elliptic curve parameters are encoded. | ||
| 98 | Possible value are: B<named_curve>, i.e. the ec parameters are | ||
| 99 | specified by a OID, or B<explicit> where the ec parameters are | ||
| 100 | explicitly given (see RFC 3279 for the definition of the | ||
| 101 | EC parameters structures). The default value is B<named_curve>. | ||
| 102 | B<Note> the B<implicitlyCA> alternative ,as specified in RFC 3279, | ||
| 103 | is currently not implemented in OpenSSL. | ||
| 104 | |||
| 105 | =item B<-no_seed> | ||
| 106 | |||
| 107 | This option inhibits that the 'seed' for the parameter generation | ||
| 108 | is included in the ECParameters structure (see RFC 3279). | ||
| 109 | |||
| 110 | =item B<-genkey> | ||
| 111 | |||
| 112 | This option will generate a EC private key using the specified parameters. | ||
| 113 | |||
| 114 | =item B<-rand file(s)> | ||
| 115 | |||
| 116 | a file or files containing random data used to seed the random number | ||
| 117 | generator, or an EGD socket (see L<RAND_egd(3)|RAND_egd(3)>). | ||
| 118 | Multiple files can be specified separated by a OS-dependent character. | ||
| 119 | The separator is B<;> for MS-Windows, B<,> for OpenVMS, and B<:> for | ||
| 120 | all others. | ||
| 121 | |||
| 122 | =item B<-engine id> | ||
| 123 | |||
| 124 | specifying an engine (by it's unique B<id> string) will cause B<req> | ||
| 125 | to attempt to obtain a functional reference to the specified engine, | ||
| 126 | thus initialising it if needed. The engine will then be set as the default | ||
| 127 | for all available algorithms. | ||
| 128 | |||
| 129 | =back | ||
| 130 | |||
| 131 | =head1 NOTES | ||
| 132 | |||
| 133 | PEM format EC parameters use the header and footer lines: | ||
| 134 | |||
| 135 | -----BEGIN EC PARAMETERS----- | ||
| 136 | -----END EC PARAMETERS----- | ||
| 137 | |||
| 138 | OpenSSL is currently not able to generate new groups and therefore | ||
| 139 | B<ecparam> can only create EC parameters from known (named) curves. | ||
| 140 | |||
| 141 | =head1 EXAMPLES | ||
| 142 | |||
| 143 | To create EC parameters with the group 'prime192v1': | ||
| 144 | |||
| 145 | openssl ecparam -out ec_param.pem -name prime192v1 | ||
| 146 | |||
| 147 | To create EC parameters with explicit parameters: | ||
| 148 | |||
| 149 | openssl ecparam -out ec_param.pem -name prime192v1 -param_enc explicit | ||
| 150 | |||
| 151 | To validate given EC parameters: | ||
| 152 | |||
| 153 | openssl ecparam -in ec_param.pem -check | ||
| 154 | |||
| 155 | To create EC parameters and a private key: | ||
| 156 | |||
| 157 | openssl ecparam -out ec_key.pem -name prime192v1 -genkey | ||
| 158 | |||
| 159 | To change the point encoding to 'compressed': | ||
| 160 | |||
| 161 | openssl ecparam -in ec_in.pem -out ec_out.pem -conv_form compressed | ||
| 162 | |||
| 163 | To print out the EC parameters to standard output: | ||
| 164 | |||
| 165 | openssl ecparam -in ec_param.pem -noout -text | ||
| 166 | |||
| 167 | =head1 SEE ALSO | ||
| 168 | |||
| 169 | L<ec(1)|ec(1)>, L<dsaparam(1)|dsaparam(1)> | ||
| 170 | |||
| 171 | =head1 HISTORY | ||
| 172 | |||
| 173 | The ecparam command was first introduced in OpenSSL 0.9.8. | ||
| 174 | |||
| 175 | =head1 AUTHOR | ||
| 176 | |||
| 177 | Nils Larsch for the OpenSSL project (http://www.openssl.org) | ||
| 178 | |||
| 179 | =cut | ||
diff --git a/src/lib/libssl/src/doc/apps/x509v3_config.pod b/src/lib/libssl/src/doc/apps/x509v3_config.pod new file mode 100644 index 0000000000..38c46e85c4 --- /dev/null +++ b/src/lib/libssl/src/doc/apps/x509v3_config.pod | |||
| @@ -0,0 +1,456 @@ | |||
| 1 | =pod | ||
| 2 | |||
| 3 | =for comment openssl_manual_section:5 | ||
| 4 | |||
| 5 | =head1 NAME | ||
| 6 | |||
| 7 | x509v3_config - X509 V3 certificate extension configuration format | ||
| 8 | |||
| 9 | =head1 DESCRIPTION | ||
| 10 | |||
| 11 | Several of the OpenSSL utilities can add extensions to a certificate or | ||
| 12 | certificate request based on the contents of a configuration file. | ||
| 13 | |||
| 14 | Typically the application will contain an option to point to an extension | ||
| 15 | section. Each line of the extension section takes the form: | ||
| 16 | |||
| 17 | extension_name=[critical,] extension_options | ||
| 18 | |||
| 19 | If B<critical> is present then the extension will be critical. | ||
| 20 | |||
| 21 | The format of B<extension_options> depends on the value of B<extension_name>. | ||
| 22 | |||
| 23 | There are four main types of extension: I<string> extensions, I<multi-valued> | ||
| 24 | extensions, I<raw> and I<arbitrary> extensions. | ||
| 25 | |||
| 26 | String extensions simply have a string which contains either the value itself | ||
| 27 | or how it is obtained. | ||
| 28 | |||
| 29 | For example: | ||
| 30 | |||
| 31 | nsComment="This is a Comment" | ||
| 32 | |||
| 33 | Multi-valued extensions have a short form and a long form. The short form | ||
| 34 | is a list of names and values: | ||
| 35 | |||
| 36 | basicConstraints=critical,CA:true,pathlen:1 | ||
| 37 | |||
| 38 | The long form allows the values to be placed in a separate section: | ||
| 39 | |||
| 40 | basicConstraints=critical,@bs_section | ||
| 41 | |||
| 42 | [bs_section] | ||
| 43 | |||
| 44 | CA=true | ||
| 45 | pathlen=1 | ||
| 46 | |||
| 47 | Both forms are equivalent. | ||
| 48 | |||
| 49 | The syntax of raw extensions is governed by the extension code: it can | ||
| 50 | for example contain data in multiple sections. The correct syntax to | ||
| 51 | use is defined by the extension code itself: check out the certificate | ||
| 52 | policies extension for an example. | ||
| 53 | |||
| 54 | If an extension type is unsupported then the I<arbitrary> extension syntax | ||
| 55 | must be used, see the L<ARBITRART EXTENSIONS|/"ARBITRARY EXTENSIONS"> section for more details. | ||
| 56 | |||
| 57 | =head1 STANDARD EXTENSIONS | ||
| 58 | |||
| 59 | The following sections describe each supported extension in detail. | ||
| 60 | |||
| 61 | =head2 Basic Constraints. | ||
| 62 | |||
| 63 | This is a multi valued extension which indicates whether a certificate is | ||
| 64 | a CA certificate. The first (mandatory) name is B<CA> followed by B<TRUE> or | ||
| 65 | B<FALSE>. If B<CA> is B<TRUE> then an optional B<pathlen> name followed by an | ||
| 66 | non-negative value can be included. | ||
| 67 | |||
| 68 | For example: | ||
| 69 | |||
| 70 | basicConstraints=CA:TRUE | ||
| 71 | |||
| 72 | basicConstraints=CA:FALSE | ||
| 73 | |||
| 74 | basicConstraints=critical,CA:TRUE, pathlen:0 | ||
| 75 | |||
| 76 | A CA certificate B<must> include the basicConstraints value with the CA field | ||
| 77 | set to TRUE. An end user certificate must either set CA to FALSE or exclude the | ||
| 78 | extension entirely. Some software may require the inclusion of basicConstraints | ||
| 79 | with CA set to FALSE for end entity certificates. | ||
| 80 | |||
| 81 | The pathlen parameter indicates the maximum number of CAs that can appear | ||
| 82 | below this one in a chain. So if you have a CA with a pathlen of zero it can | ||
| 83 | only be used to sign end user certificates and not further CAs. | ||
| 84 | |||
| 85 | |||
| 86 | =head2 Key Usage. | ||
| 87 | |||
| 88 | Key usage is a multi valued extension consisting of a list of names of the | ||
| 89 | permitted key usages. | ||
| 90 | |||
| 91 | The supporte names are: digitalSignature, nonRepudiation, keyEncipherment, | ||
| 92 | dataEncipherment, keyAgreement, keyCertSign, cRLSign, encipherOnly | ||
| 93 | and decipherOnly. | ||
| 94 | |||
| 95 | Examples: | ||
| 96 | |||
| 97 | keyUsage=digitalSignature, nonRepudiation | ||
| 98 | |||
| 99 | keyUsage=critical, keyCertSign | ||
| 100 | |||
| 101 | |||
| 102 | =head2 Extended Key Usage. | ||
| 103 | |||
| 104 | This extensions consists of a list of usages indicating purposes for which | ||
| 105 | the certificate public key can be used for, | ||
| 106 | |||
| 107 | These can either be object short names of the dotted numerical form of OIDs. | ||
| 108 | While any OID can be used only certain values make sense. In particular the | ||
| 109 | following PKIX, NS and MS values are meaningful: | ||
| 110 | |||
| 111 | Value Meaning | ||
| 112 | ----- ------- | ||
| 113 | serverAuth SSL/TLS Web Server Authentication. | ||
| 114 | clientAuth SSL/TLS Web Client Authentication. | ||
| 115 | codeSigning Code signing. | ||
| 116 | emailProtection E-mail Protection (S/MIME). | ||
| 117 | timeStamping Trusted Timestamping | ||
| 118 | msCodeInd Microsoft Individual Code Signing (authenticode) | ||
| 119 | msCodeCom Microsoft Commercial Code Signing (authenticode) | ||
| 120 | msCTLSign Microsoft Trust List Signing | ||
| 121 | msSGC Microsoft Server Gated Crypto | ||
| 122 | msEFS Microsoft Encrypted File System | ||
| 123 | nsSGC Netscape Server Gated Crypto | ||
| 124 | |||
| 125 | Examples: | ||
| 126 | |||
| 127 | extendedKeyUsage=critical,codeSigning,1.2.3.4 | ||
| 128 | extendedKeyUsage=nsSGC,msSGC | ||
| 129 | |||
| 130 | |||
| 131 | =head2 Subject Key Identifier. | ||
| 132 | |||
| 133 | This is really a string extension and can take two possible values. Either | ||
| 134 | the word B<hash> which will automatically follow the guidelines in RFC3280 | ||
| 135 | or a hex string giving the extension value to include. The use of the hex | ||
| 136 | string is strongly discouraged. | ||
| 137 | |||
| 138 | Example: | ||
| 139 | |||
| 140 | subjectKeyIdentifier=hash | ||
| 141 | |||
| 142 | |||
| 143 | =head2 Authority Key Identifier. | ||
| 144 | |||
| 145 | The authority key identifier extension permits two options. keyid and issuer: | ||
| 146 | both can take the optional value "always". | ||
| 147 | |||
| 148 | If the keyid option is present an attempt is made to copy the subject key | ||
| 149 | identifier from the parent certificate. If the value "always" is present | ||
| 150 | then an error is returned if the option fails. | ||
| 151 | |||
| 152 | The issuer option copies the issuer and serial number from the issuer | ||
| 153 | certificate. This will only be done if the keyid option fails or | ||
| 154 | is not included unless the "always" flag will always include the value. | ||
| 155 | |||
| 156 | Example: | ||
| 157 | |||
| 158 | authorityKeyIdentifier=keyid,issuer | ||
| 159 | |||
| 160 | |||
| 161 | =head2 Subject Alternative Name. | ||
| 162 | |||
| 163 | The subject alternative name extension allows various literal values to be | ||
| 164 | included in the configuration file. These include B<email> (an email address) | ||
| 165 | B<URI> a uniform resource indicator, B<DNS> (a DNS domain name), B<RID> (a | ||
| 166 | registered ID: OBJECT IDENTIFIER), B<IP> (an IP address), B<dirName> | ||
| 167 | (a distinguished name) and otherName. | ||
| 168 | |||
| 169 | The email option include a special 'copy' value. This will automatically | ||
| 170 | include and email addresses contained in the certificate subject name in | ||
| 171 | the extension. | ||
| 172 | |||
| 173 | The IP address used in the B<IP> options can be in either IPv4 or IPv6 format. | ||
| 174 | |||
| 175 | The value of B<dirName> should point to a section containing the distinguished | ||
| 176 | name to use as a set of name value pairs. Multi values AVAs can be formed by | ||
| 177 | preceeding the name with a B<+> character. | ||
| 178 | |||
| 179 | otherName can include arbitrary data associated with an OID: the value | ||
| 180 | should be the OID followed by a semicolon and the content in standard | ||
| 181 | ASN1_generate_nconf() format. | ||
| 182 | |||
| 183 | Examples: | ||
| 184 | |||
| 185 | subjectAltName=email:copy,email:my@other.address,URI:http://my.url.here/ | ||
| 186 | subjectAltName=IP:192.168.7.1 | ||
| 187 | subjectAltName=IP:13::17 | ||
| 188 | subjectAltName=email:my@other.address,RID:1.2.3.4 | ||
| 189 | subjectAltName=otherName:1.2.3.4;UTF8:some other identifier | ||
| 190 | |||
| 191 | subjectAltName=dirName:dir_sect | ||
| 192 | |||
| 193 | [dir_sect] | ||
| 194 | C=UK | ||
| 195 | O=My Organization | ||
| 196 | OU=My Unit | ||
| 197 | CN=My Name | ||
| 198 | |||
| 199 | |||
| 200 | =head2 Issuer Alternative Name. | ||
| 201 | |||
| 202 | The issuer alternative name option supports all the literal options of | ||
| 203 | subject alternative name. It does B<not> support the email:copy option because | ||
| 204 | that would not make sense. It does support an additional issuer:copy option | ||
| 205 | that will copy all the subject alternative name values from the issuer | ||
| 206 | certificate (if possible). | ||
| 207 | |||
| 208 | Example: | ||
| 209 | |||
| 210 | issuserAltName = issuer:copy | ||
| 211 | |||
| 212 | |||
| 213 | =head2 Authority Info Access. | ||
| 214 | |||
| 215 | The authority information access extension gives details about how to access | ||
| 216 | certain information relating to the CA. Its syntax is accessOID;location | ||
| 217 | where I<location> has the same syntax as subject alternative name (except | ||
| 218 | that email:copy is not supported). accessOID can be any valid OID but only | ||
| 219 | certain values are meaningful, for example OCSP and caIssuers. | ||
| 220 | |||
| 221 | Example: | ||
| 222 | |||
| 223 | authorityInfoAccess = OCSP;URI:http://ocsp.my.host/ | ||
| 224 | authorityInfoAccess = caIssuers;URI:http://my.ca/ca.html | ||
| 225 | |||
| 226 | |||
| 227 | =head2 CRL distribution points. | ||
| 228 | |||
| 229 | This is a multi-valued extension that supports all the literal options of | ||
| 230 | subject alternative name. Of the few software packages that currently interpret | ||
| 231 | this extension most only interpret the URI option. | ||
| 232 | |||
| 233 | Currently each option will set a new DistributionPoint with the fullName | ||
| 234 | field set to the given value. | ||
| 235 | |||
| 236 | Other fields like cRLissuer and reasons cannot currently be set or displayed: | ||
| 237 | at this time no examples were available that used these fields. | ||
| 238 | |||
| 239 | Examples: | ||
| 240 | |||
| 241 | crlDistributionPoints=URI:http://myhost.com/myca.crl | ||
| 242 | crlDistributionPoints=URI:http://my.com/my.crl,URI:http://oth.com/my.crl | ||
| 243 | |||
| 244 | =head2 Certificate Policies. | ||
| 245 | |||
| 246 | This is a I<raw> extension. All the fields of this extension can be set by | ||
| 247 | using the appropriate syntax. | ||
| 248 | |||
| 249 | If you follow the PKIX recommendations and just using one OID then you just | ||
| 250 | include the value of that OID. Multiple OIDs can be set separated by commas, | ||
| 251 | for example: | ||
| 252 | |||
| 253 | certificatePolicies= 1.2.4.5, 1.1.3.4 | ||
| 254 | |||
| 255 | If you wish to include qualifiers then the policy OID and qualifiers need to | ||
| 256 | be specified in a separate section: this is done by using the @section syntax | ||
| 257 | instead of a literal OID value. | ||
| 258 | |||
| 259 | The section referred to must include the policy OID using the name | ||
| 260 | policyIdentifier, cPSuri qualifiers can be included using the syntax: | ||
| 261 | |||
| 262 | CPS.nnn=value | ||
| 263 | |||
| 264 | userNotice qualifiers can be set using the syntax: | ||
| 265 | |||
| 266 | userNotice.nnn=@notice | ||
| 267 | |||
| 268 | The value of the userNotice qualifier is specified in the relevant section. | ||
| 269 | This section can include explicitText, organization and noticeNumbers | ||
| 270 | options. explicitText and organization are text strings, noticeNumbers is a | ||
| 271 | comma separated list of numbers. The organization and noticeNumbers options | ||
| 272 | (if included) must BOTH be present. If you use the userNotice option with IE5 | ||
| 273 | then you need the 'ia5org' option at the top level to modify the encoding: | ||
| 274 | otherwise it will not be interpreted properly. | ||
| 275 | |||
| 276 | Example: | ||
| 277 | |||
| 278 | certificatePolicies=ia5org,1.2.3.4,1.5.6.7.8,@polsect | ||
| 279 | |||
| 280 | [polsect] | ||
| 281 | |||
| 282 | policyIdentifier = 1.3.5.8 | ||
| 283 | CPS.1="http://my.host.name/" | ||
| 284 | CPS.2="http://my.your.name/" | ||
| 285 | userNotice.1=@notice | ||
| 286 | |||
| 287 | [notice] | ||
| 288 | |||
| 289 | explicitText="Explicit Text Here" | ||
| 290 | organization="Organisation Name" | ||
| 291 | noticeNumbers=1,2,3,4 | ||
| 292 | |||
| 293 | The B<ia5org> option changes the type of the I<organization> field. In RFC2459 | ||
| 294 | it can only be of type DisplayText. In RFC3280 IA5Strring is also permissible. | ||
| 295 | Some software (for example some versions of MSIE) may require ia5org. | ||
| 296 | |||
| 297 | =head2 Policy Constraints | ||
| 298 | |||
| 299 | This is a multi-valued extension which consisting of the names | ||
| 300 | B<requireExplicitPolicy> or B<inhibitPolicyMapping> and a non negative intger | ||
| 301 | value. At least one component must be present. | ||
| 302 | |||
| 303 | Example: | ||
| 304 | |||
| 305 | policyConstraints = requireExplicitPolicy:3 | ||
| 306 | |||
| 307 | |||
| 308 | =head2 Inhibit Any Policy | ||
| 309 | |||
| 310 | This is a string extension whose value must be a non negative integer. | ||
| 311 | |||
| 312 | Example: | ||
| 313 | |||
| 314 | inhibitAnyPolicy = 2 | ||
| 315 | |||
| 316 | |||
| 317 | =head2 Name Constraints | ||
| 318 | |||
| 319 | The name constraints extension is a multi-valued extension. The name should | ||
| 320 | begin with the word B<permitted> or B<excluded> followed by a B<;>. The rest of | ||
| 321 | the name and the value follows the syntax of subjectAltName except email:copy | ||
| 322 | is not supported and the B<IP> form should consist of an IP addresses and | ||
| 323 | subnet mask separated by a B</>. | ||
| 324 | |||
| 325 | Examples: | ||
| 326 | |||
| 327 | nameConstraints=permitted;IP:192.168.0.0/255.255.0.0 | ||
| 328 | |||
| 329 | nameConstraints=permitted;email:.somedomain.com | ||
| 330 | |||
| 331 | nameConstraints=excluded;email:.com | ||
| 332 | |||
| 333 | =head1 DEPRECATED EXTENSIONS | ||
| 334 | |||
| 335 | The following extensions are non standard, Netscape specific and largely | ||
| 336 | obsolete. Their use in new applications is discouraged. | ||
| 337 | |||
| 338 | =head2 Netscape String extensions. | ||
| 339 | |||
| 340 | Netscape Comment (B<nsComment>) is a string extension containing a comment | ||
| 341 | which will be displayed when the certificate is viewed in some browsers. | ||
| 342 | |||
| 343 | Example: | ||
| 344 | |||
| 345 | nsComment = "Some Random Comment" | ||
| 346 | |||
| 347 | Other supported extensions in this category are: B<nsBaseUrl>, | ||
| 348 | B<nsRevocationUrl>, B<nsCaRevocationUrl>, B<nsRenewalUrl>, B<nsCaPolicyUrl> | ||
| 349 | and B<nsSslServerName>. | ||
| 350 | |||
| 351 | |||
| 352 | =head2 Netscape Certificate Type | ||
| 353 | |||
| 354 | This is a multi-valued extensions which consists of a list of flags to be | ||
| 355 | included. It was used to indicate the purposes for which a certificate could | ||
| 356 | be used. The basicConstraints, keyUsage and extended key usage extensions are | ||
| 357 | now used instead. | ||
| 358 | |||
| 359 | Acceptable values for nsCertType are: B<client>, B<server>, B<email>, | ||
| 360 | B<objsign>, B<reserved>, B<sslCA>, B<emailCA>, B<objCA>. | ||
| 361 | |||
| 362 | |||
| 363 | =head1 ARBITRARY EXTENSIONS | ||
| 364 | |||
| 365 | If an extension is not supported by the OpenSSL code then it must be encoded | ||
| 366 | using the arbitrary extension format. It is also possible to use the arbitrary | ||
| 367 | format for supported extensions. Extreme care should be taken to ensure that | ||
| 368 | the data is formatted correctly for the given extension type. | ||
| 369 | |||
| 370 | There are two ways to encode arbitrary extensions. | ||
| 371 | |||
| 372 | The first way is to use the word ASN1 followed by the extension content | ||
| 373 | using the same syntax as ASN1_generate_nconf(). For example: | ||
| 374 | |||
| 375 | 1.2.3.4=critical,ASN1:UTF8String:Some random data | ||
| 376 | |||
| 377 | 1.2.3.4=ASN1:SEQUENCE:seq_sect | ||
| 378 | |||
| 379 | [seq_sect] | ||
| 380 | |||
| 381 | field1 = UTF8:field1 | ||
| 382 | field2 = UTF8:field2 | ||
| 383 | |||
| 384 | It is also possible to use the word DER to include the raw encoded data in any | ||
| 385 | extension. | ||
| 386 | |||
| 387 | 1.2.3.4=critical,DER:01:02:03:04 | ||
| 388 | 1.2.3.4=DER:01020304 | ||
| 389 | |||
| 390 | The value following DER is a hex dump of the DER encoding of the extension | ||
| 391 | Any extension can be placed in this form to override the default behaviour. | ||
| 392 | For example: | ||
| 393 | |||
| 394 | basicConstraints=critical,DER:00:01:02:03 | ||
| 395 | |||
| 396 | =head1 WARNING | ||
| 397 | |||
| 398 | There is no guarantee that a specific implementation will process a given | ||
| 399 | extension. It may therefore be sometimes possible to use certificates for | ||
| 400 | purposes prohibited by their extensions because a specific application does | ||
| 401 | not recognize or honour the values of the relevant extensions. | ||
| 402 | |||
| 403 | The DER and ASN1 options should be used with caution. It is possible to create | ||
| 404 | totally invalid extensions if they are not used carefully. | ||
| 405 | |||
| 406 | |||
| 407 | =head1 NOTES | ||
| 408 | |||
| 409 | If an extension is multi-value and a field value must contain a comma the long | ||
| 410 | form must be used otherwise the comma would be misinterpreted as a field | ||
| 411 | separator. For example: | ||
| 412 | |||
| 413 | subjectAltName=URI:ldap://somehost.com/CN=foo,OU=bar | ||
| 414 | |||
| 415 | will produce an error but the equivalent form: | ||
| 416 | |||
| 417 | subjectAltName=@subject_alt_section | ||
| 418 | |||
| 419 | [subject_alt_section] | ||
| 420 | subjectAltName=URI:ldap://somehost.com/CN=foo,OU=bar | ||
| 421 | |||
| 422 | is valid. | ||
| 423 | |||
| 424 | Due to the behaviour of the OpenSSL B<conf> library the same field name | ||
| 425 | can only occur once in a section. This means that: | ||
| 426 | |||
| 427 | subjectAltName=@alt_section | ||
| 428 | |||
| 429 | [alt_section] | ||
| 430 | |||
| 431 | email=steve@here | ||
| 432 | email=steve@there | ||
| 433 | |||
| 434 | will only recognize the last value. This can be worked around by using the form: | ||
| 435 | |||
| 436 | [alt_section] | ||
| 437 | |||
| 438 | email.1=steve@here | ||
| 439 | email.2=steve@there | ||
| 440 | |||
| 441 | =head1 HISTORY | ||
| 442 | |||
| 443 | The X509v3 extension code was first added to OpenSSL 0.9.2. | ||
| 444 | |||
| 445 | Policy mappings, inhibit any policy and name constraints support was added in | ||
| 446 | OpenSSL 0.9.8 | ||
| 447 | |||
| 448 | The B<directoryName> and B<otherName> option as well as the B<ASN1> option | ||
| 449 | for arbitrary extensions was added in OpenSSL 0.9.8 | ||
| 450 | |||
| 451 | =head1 SEE ALSO | ||
| 452 | |||
| 453 | L<req(1)|req(1)>, L<ca(1)|ca(1)>, L<x509(1)|x509(1)> | ||
| 454 | |||
| 455 | |||
| 456 | =cut | ||
diff --git a/src/lib/libssl/src/doc/crypto/ASN1_generate_nconf.pod b/src/lib/libssl/src/doc/crypto/ASN1_generate_nconf.pod new file mode 100644 index 0000000000..1157cff510 --- /dev/null +++ b/src/lib/libssl/src/doc/crypto/ASN1_generate_nconf.pod | |||
| @@ -0,0 +1,262 @@ | |||
| 1 | =pod | ||
| 2 | |||
| 3 | =head1 NAME | ||
| 4 | |||
| 5 | ASN1_generate_nconf, ASN1_generate_v3 - ASN1 generation functions | ||
| 6 | |||
| 7 | =head1 SYNOPSIS | ||
| 8 | |||
| 9 | ASN1_TYPE *ASN1_generate_nconf(char *str, CONF *nconf); | ||
| 10 | ASN1_TYPE *ASN1_generate_v3(char *str, X509V3_CTX *cnf); | ||
| 11 | |||
| 12 | =head1 DESCRIPTION | ||
| 13 | |||
| 14 | These functions generate the ASN1 encoding of a string | ||
| 15 | in an B<ASN1_TYPE> structure. | ||
| 16 | |||
| 17 | B<str> contains the string to encode B<nconf> or B<cnf> contains | ||
| 18 | the optional configuration information where additional strings | ||
| 19 | will be read from. B<nconf> will typically come from a config | ||
| 20 | file wherease B<cnf> is obtained from an B<X509V3_CTX> structure | ||
| 21 | which will typically be used by X509 v3 certificate extension | ||
| 22 | functions. B<cnf> or B<nconf> can be set to B<NULL> if no additional | ||
| 23 | configuration will be used. | ||
| 24 | |||
| 25 | =head1 GENERATION STRING FORMAT | ||
| 26 | |||
| 27 | The actual data encoded is determined by the string B<str> and | ||
| 28 | the configuration information. The general format of the string | ||
| 29 | is: | ||
| 30 | |||
| 31 | =over 2 | ||
| 32 | |||
| 33 | =item B<[modifier,]type[:value]> | ||
| 34 | |||
| 35 | =back | ||
| 36 | |||
| 37 | That is zero or more comma separated modifiers followed by a type | ||
| 38 | followed by an optional colon and a value. The formats of B<type>, | ||
| 39 | B<value> and B<modifier> are explained below. | ||
| 40 | |||
| 41 | =head2 SUPPORTED TYPES | ||
| 42 | |||
| 43 | The supported types are listed below. Unless otherwise specified | ||
| 44 | only the B<ASCII> format is permissible. | ||
| 45 | |||
| 46 | =over 2 | ||
| 47 | |||
| 48 | =item B<BOOLEAN>, B<BOOL> | ||
| 49 | |||
| 50 | This encodes a boolean type. The B<value> string is mandatory and | ||
| 51 | should be B<TRUE> or B<FALSE>. Additionally B<TRUE>, B<true>, B<Y>, | ||
| 52 | B<y>, B<YES>, B<yes>, B<FALSE>, B<false>, B<N>, B<n>, B<NO> and B<no> | ||
| 53 | are acceptable. | ||
| 54 | |||
| 55 | =item B<NULL> | ||
| 56 | |||
| 57 | Encode the B<NULL> type, the B<value> string must not be present. | ||
| 58 | |||
| 59 | =item B<INTEGER>, B<INT> | ||
| 60 | |||
| 61 | Encodes an ASN1 B<INTEGER> type. The B<value> string represents | ||
| 62 | the value of the integer, it can be preceeded by a minus sign and | ||
| 63 | is normally interpreted as a decimal value unless the prefix B<0x> | ||
| 64 | is included. | ||
| 65 | |||
| 66 | =item B<ENUMERATED>, B<ENUM> | ||
| 67 | |||
| 68 | Encodes the ASN1 B<ENUMERATED> type, it is otherwise identical to | ||
| 69 | B<INTEGER>. | ||
| 70 | |||
| 71 | =item B<OBJECT>, B<OID> | ||
| 72 | |||
| 73 | Encodes an ASN1 B<OBJECT IDENTIFIER>, the B<value> string can be | ||
| 74 | a short name, a long name or numerical format. | ||
| 75 | |||
| 76 | =item B<UTCTIME>, B<UTC> | ||
| 77 | |||
| 78 | Encodes an ASN1 B<UTCTime> structure, the value should be in | ||
| 79 | the format B<YYMMDDHHMMSSZ>. | ||
| 80 | |||
| 81 | =item B<GENERALIZEDTIME>, B<GENTIME> | ||
| 82 | |||
| 83 | Encodes an ASN1 B<GeneralizedTime> structure, the value should be in | ||
| 84 | the format B<YYYYMMDDHHMMSSZ>. | ||
| 85 | |||
| 86 | =item B<OCTETSTRING>, B<OCT> | ||
| 87 | |||
| 88 | Encodes an ASN1 B<OCTET STRING>. B<value> represents the contents | ||
| 89 | of this structure, the format strings B<ASCII> and B<HEX> can be | ||
| 90 | used to specify the format of B<value>. | ||
| 91 | |||
| 92 | =item B<BITSTRING>, B<BITSTR> | ||
| 93 | |||
| 94 | Encodes an ASN1 B<BIT STRING>. B<value> represents the contents | ||
| 95 | of this structure, the format strings B<ASCII>, B<HEX> and B<BITLIST> | ||
| 96 | can be used to specify the format of B<value>. | ||
| 97 | |||
| 98 | If the format is anything other than B<BITLIST> the number of unused | ||
| 99 | bits is set to zero. | ||
| 100 | |||
| 101 | =item B<UNIVERSALSTRING>, B<UNIV>, B<IA5>, B<IA5STRING>, B<UTF8>, | ||
| 102 | B<UTF8String>, B<BMP>, B<BMPSTRING>, B<VISIBLESTRING>, | ||
| 103 | B<VISIBLE>, B<PRINTABLESTRING>, B<PRINTABLE>, B<T61>, | ||
| 104 | B<T61STRING>, B<TELETEXSTRING>, B<GeneralString> | ||
| 105 | |||
| 106 | These encode the corresponding string types. B<value> represents the | ||
| 107 | contents of this structure. The format can be B<ASCII> or B<UTF8>. | ||
| 108 | |||
| 109 | =item B<SEQUENCE>, B<SEQ>, B<SET> | ||
| 110 | |||
| 111 | Formats the result as an ASN1 B<SEQUENCE> or B<SET> type. B<value> | ||
| 112 | should be a section name which will contain the contents. The | ||
| 113 | field names in the section are ignored and the values are in the | ||
| 114 | generated string format. If B<value> is absent then an empty SEQUENCE | ||
| 115 | will be encoded. | ||
| 116 | |||
| 117 | =back | ||
| 118 | |||
| 119 | =head2 MODIFIERS | ||
| 120 | |||
| 121 | Modifiers affect the following structure, they can be used to | ||
| 122 | add EXPLICIT or IMPLICIT tagging, add wrappers or to change | ||
| 123 | the string format of the final type and value. The supported | ||
| 124 | formats are documented below. | ||
| 125 | |||
| 126 | =over 2 | ||
| 127 | |||
| 128 | =item B<EXPLICIT>, B<EXP> | ||
| 129 | |||
| 130 | Add an explicit tag to the following structure. This string | ||
| 131 | should be followed by a colon and the tag value to use as a | ||
| 132 | decimal value. | ||
| 133 | |||
| 134 | By following the number with B<U>, B<A>, B<P> or B<C> UNIVERSAL, | ||
| 135 | APPLICATION, PRIVATE or CONTEXT SPECIFIC tagging can be used, | ||
| 136 | the default is CONTEXT SPECIFIC. | ||
| 137 | |||
| 138 | =item B<IMPLICIT>, B<IMP> | ||
| 139 | |||
| 140 | This is the same as B<EXPLICIT> except IMPLICIT tagging is used | ||
| 141 | instead. | ||
| 142 | |||
| 143 | =item B<OCTWRAP>, B<SEQWRAP>, B<SETWRAP>, B<BITWRAP> | ||
| 144 | |||
| 145 | The following structure is surrounded by an OCTET STRING, a SEQUENCE, | ||
| 146 | a SET or a BIT STRING respectively. For a BIT STRING the number of unused | ||
| 147 | bits is set to zero. | ||
| 148 | |||
| 149 | =item B<FORMAT> | ||
| 150 | |||
| 151 | This specifies the format of the ultimate value. It should be followed | ||
| 152 | by a colon and one of the strings B<ASCII>, B<UTF8>, B<HEX> or B<BITLIST>. | ||
| 153 | |||
| 154 | If no format specifier is included then B<ASCII> is used. If B<UTF8> is | ||
| 155 | specified then the value string must be a valid B<UTF8> string. For B<HEX> the | ||
| 156 | output must be a set of hex digits. B<BITLIST> (which is only valid for a BIT | ||
| 157 | STRING) is a comma separated list of the indices of the set bits, all other | ||
| 158 | bits are zero. | ||
| 159 | |||
| 160 | =back | ||
| 161 | |||
| 162 | =head1 EXAMPLES | ||
| 163 | |||
| 164 | A simple IA5String: | ||
| 165 | |||
| 166 | IA5STRING:Hello World | ||
| 167 | |||
| 168 | An IA5String explicitly tagged: | ||
| 169 | |||
| 170 | EXPLICIT:0,IA5STRING:Hello World | ||
| 171 | |||
| 172 | An IA5String explicitly tagged using APPLICATION tagging: | ||
| 173 | |||
| 174 | EXPLICIT:0A,IA5STRING:Hello World | ||
| 175 | |||
| 176 | A BITSTRING with bits 1 and 5 set and all others zero: | ||
| 177 | |||
| 178 | FORMAT=BITLIST,BITSTRING:1,5 | ||
| 179 | |||
| 180 | A more complex example using a config file to produce a | ||
| 181 | SEQUENCE consiting of a BOOL an OID and a UTF8String: | ||
| 182 | |||
| 183 | asn1 = SEQUENCE:seq_section | ||
| 184 | |||
| 185 | [seq_section] | ||
| 186 | |||
| 187 | field1 = BOOLEAN:TRUE | ||
| 188 | field2 = OID:commonName | ||
| 189 | field3 = UTF8:Third field | ||
| 190 | |||
| 191 | This example produces an RSAPrivateKey structure, this is the | ||
| 192 | key contained in the file client.pem in all OpenSSL distributions | ||
| 193 | (note: the field names such as 'coeff' are ignored and are present just | ||
| 194 | for clarity): | ||
| 195 | |||
| 196 | asn1=SEQUENCE:private_key | ||
| 197 | [private_key] | ||
| 198 | version=INTEGER:0 | ||
| 199 | |||
| 200 | n=INTEGER:0xBB6FE79432CC6EA2D8F970675A5A87BFBE1AFF0BE63E879F2AFFB93644\ | ||
| 201 | D4D2C6D000430DEC66ABF47829E74B8C5108623A1C0EE8BE217B3AD8D36D5EB4FCA1D9 | ||
| 202 | |||
| 203 | e=INTEGER:0x010001 | ||
| 204 | |||
| 205 | d=INTEGER:0x6F05EAD2F27FFAEC84BEC360C4B928FD5F3A9865D0FCAAD291E2A52F4A\ | ||
| 206 | F810DC6373278C006A0ABBA27DC8C63BF97F7E666E27C5284D7D3B1FFFE16B7A87B51D | ||
| 207 | |||
| 208 | p=INTEGER:0xF3929B9435608F8A22C208D86795271D54EBDFB09DDEF539AB083DA912\ | ||
| 209 | D4BD57 | ||
| 210 | |||
| 211 | q=INTEGER:0xC50016F89DFF2561347ED1186A46E150E28BF2D0F539A1594BBD7FE467\ | ||
| 212 | 46EC4F | ||
| 213 | |||
| 214 | exp1=INTEGER:0x9E7D4326C924AFC1DEA40B45650134966D6F9DFA3A7F9D698CD4ABEA\ | ||
| 215 | 9C0A39B9 | ||
| 216 | |||
| 217 | exp2=INTEGER:0xBA84003BB95355AFB7C50DF140C60513D0BA51D637272E355E397779\ | ||
| 218 | E7B2458F | ||
| 219 | |||
| 220 | coeff=INTEGER:0x30B9E4F2AFA5AC679F920FC83F1F2DF1BAF1779CF989447FABC2F5\ | ||
| 221 | 628657053A | ||
| 222 | |||
| 223 | This example is the corresponding public key in a SubjectPublicKeyInfo | ||
| 224 | structure: | ||
| 225 | |||
| 226 | # Start with a SEQUENCE | ||
| 227 | asn1=SEQUENCE:pubkeyinfo | ||
| 228 | |||
| 229 | # pubkeyinfo contains an algorithm identifier and the public key wrapped | ||
| 230 | # in a BIT STRING | ||
| 231 | [pubkeyinfo] | ||
| 232 | algorithm=SEQUENCE:rsa_alg | ||
| 233 | pubkey=BITWRAP,SEQUENCE:rsapubkey | ||
| 234 | |||
| 235 | # algorithm ID for RSA is just an OID and a NULL | ||
| 236 | [rsa_alg] | ||
| 237 | algorithm=OID:rsaEncryption | ||
| 238 | parameter=NULL | ||
| 239 | |||
| 240 | # Actual public key: modulus and exponent | ||
| 241 | [rsapubkey] | ||
| 242 | n=INTEGER:0xBB6FE79432CC6EA2D8F970675A5A87BFBE1AFF0BE63E879F2AFFB93644\ | ||
| 243 | D4D2C6D000430DEC66ABF47829E74B8C5108623A1C0EE8BE217B3AD8D36D5EB4FCA1D9 | ||
| 244 | |||
| 245 | e=INTEGER:0x010001 | ||
| 246 | |||
| 247 | =head1 RETURN VALUES | ||
| 248 | |||
| 249 | ASN1_generate_nconf() and ASN1_generate_v3() return the encoded | ||
| 250 | data as an B<ASN1_TYPE> structure or B<NULL> if an error occurred. | ||
| 251 | |||
| 252 | The error codes that can be obtained by L<ERR_get_error(3)|ERR_get_error(3)>. | ||
| 253 | |||
| 254 | =head1 SEE ALSO | ||
| 255 | |||
| 256 | L<ERR_get_error(3)|ERR_get_error(3)> | ||
| 257 | |||
| 258 | =head1 HISTORY | ||
| 259 | |||
| 260 | ASN1_generate_nconf() and ASN1_generate_v3() were added to OpenSSL 0.9.8 | ||
| 261 | |||
| 262 | =cut | ||
diff --git a/src/lib/libssl/src/doc/crypto/BN_BLINDING_new.pod b/src/lib/libssl/src/doc/crypto/BN_BLINDING_new.pod new file mode 100644 index 0000000000..7b087f7288 --- /dev/null +++ b/src/lib/libssl/src/doc/crypto/BN_BLINDING_new.pod | |||
| @@ -0,0 +1,109 @@ | |||
| 1 | =pod | ||
| 2 | |||
| 3 | =head1 NAME | ||
| 4 | |||
| 5 | BN_BLINDING_new, BN_BLINDING_free, BN_BLINDING_update, BN_BLINDING_convert, | ||
| 6 | BN_BLINDING_invert, BN_BLINDING_convert_ex, BN_BLINDING_invert_ex, | ||
| 7 | BN_BLINDING_get_thread_id, BN_BLINDING_set_thread_id, BN_BLINDING_get_flags, | ||
| 8 | BN_BLINDING_set_flags, BN_BLINDING_create_param - blinding related BIGNUM | ||
| 9 | functions. | ||
| 10 | |||
| 11 | =head1 SYNOPSIS | ||
| 12 | |||
| 13 | #include <openssl/bn.h> | ||
| 14 | |||
| 15 | BN_BLINDING *BN_BLINDING_new(const BIGNUM *A, const BIGNUM *Ai, | ||
| 16 | BIGNUM *mod); | ||
| 17 | void BN_BLINDING_free(BN_BLINDING *b); | ||
| 18 | int BN_BLINDING_update(BN_BLINDING *b,BN_CTX *ctx); | ||
| 19 | int BN_BLINDING_convert(BIGNUM *n, BN_BLINDING *b, BN_CTX *ctx); | ||
| 20 | int BN_BLINDING_invert(BIGNUM *n, BN_BLINDING *b, BN_CTX *ctx); | ||
| 21 | int BN_BLINDING_convert_ex(BIGNUM *n, BIGNUM *r, BN_BLINDING *b, | ||
| 22 | BN_CTX *ctx); | ||
| 23 | int BN_BLINDING_invert_ex(BIGNUM *n, const BIGNUM *r, BN_BLINDING *b, | ||
| 24 | BN_CTX *ctx); | ||
| 25 | unsigned long BN_BLINDING_get_thread_id(const BN_BLINDING *); | ||
| 26 | void BN_BLINDING_set_thread_id(BN_BLINDING *, unsigned long); | ||
| 27 | unsigned long BN_BLINDING_get_flags(const BN_BLINDING *); | ||
| 28 | void BN_BLINDING_set_flags(BN_BLINDING *, unsigned long); | ||
| 29 | BN_BLINDING *BN_BLINDING_create_param(BN_BLINDING *b, | ||
| 30 | const BIGNUM *e, BIGNUM *m, BN_CTX *ctx, | ||
| 31 | int (*bn_mod_exp)(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, | ||
| 32 | const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx), | ||
| 33 | BN_MONT_CTX *m_ctx); | ||
| 34 | |||
| 35 | =head1 DESCRIPTION | ||
| 36 | |||
| 37 | BN_BLINDING_new() allocates a new B<BN_BLINDING> structure and copies | ||
| 38 | the B<A> and B<Ai> values into the newly created B<BN_BLINDING> object. | ||
| 39 | |||
| 40 | BN_BLINDING_free() frees the B<BN_BLINDING> structure. | ||
| 41 | |||
| 42 | BN_BLINDING_update() updates the B<BN_BLINDING> parameters by squaring | ||
| 43 | the B<A> and B<Ai> or, after specific number of uses and if the | ||
| 44 | necessary parameters are set, by re-creating the blinding parameters. | ||
| 45 | |||
| 46 | BN_BLINDING_convert_ex() multiplies B<n> with the blinding factor B<A>. | ||
| 47 | If B<r> is not NULL a copy the inverse blinding factor B<Ai> will be | ||
| 48 | returned in B<r> (this is useful if a B<RSA> object is shared amoung | ||
| 49 | several threads). BN_BLINDING_invert_ex() multiplies B<n> with the | ||
| 50 | inverse blinding factor B<Ai>. If B<r> is not NULL it will be used as | ||
| 51 | the inverse blinding. | ||
| 52 | |||
| 53 | BN_BLINDING_convert() and BN_BLINDING_invert() are wrapper | ||
| 54 | functions for BN_BLINDING_convert_ex() and BN_BLINDING_invert_ex() | ||
| 55 | with B<r> set to NULL. | ||
| 56 | |||
| 57 | BN_BLINDING_set_thread_id() and BN_BLINDING_get_thread_id() | ||
| 58 | set and get the "thread id" value of the B<BN_BLINDING> structure, | ||
| 59 | a field provided to users of B<BN_BLINDING> structure to help them | ||
| 60 | provide proper locking if needed for multi-threaded use. The | ||
| 61 | "thread id" of a newly allocated B<BN_BLINDING> structure is zero. | ||
| 62 | |||
| 63 | BN_BLINDING_get_flags() returns the BN_BLINDING flags. Currently | ||
| 64 | there are two supported flags: B<BN_BLINDING_NO_UPDATE> and | ||
| 65 | B<BN_BLINDING_NO_RECREATE>. B<BN_BLINDING_NO_UPDATE> inhibits the | ||
| 66 | automatic update of the B<BN_BLINDING> parameters after each use | ||
| 67 | and B<BN_BLINDING_NO_RECREATE> inhibits the automatic re-creation | ||
| 68 | of the B<BN_BLINDING> parameters after a fixed number of uses (currently | ||
| 69 | 32). In newly allocated B<BN_BLINDING> objects no flags are set. | ||
| 70 | BN_BLINDING_set_flags() sets the B<BN_BLINDING> parameters flags. | ||
| 71 | |||
| 72 | BN_BLINDING_create_param() creates new B<BN_BLINDING> parameters | ||
| 73 | using the exponent B<e> and the modulus B<m>. B<bn_mod_exp> and | ||
| 74 | B<m_ctx> can be used to pass special functions for exponentiation | ||
| 75 | (normally BN_mod_exp_mont() and B<BN_MONT_CTX>). | ||
| 76 | |||
| 77 | =head1 RETURN VALUES | ||
| 78 | |||
| 79 | BN_BLINDING_new() returns the newly allocated B<BN_BLINDING> structure | ||
| 80 | or NULL in case of an error. | ||
| 81 | |||
| 82 | BN_BLINDING_update(), BN_BLINDING_convert(), BN_BLINDING_invert(), | ||
| 83 | BN_BLINDING_convert_ex() and BN_BLINDING_invert_ex() return 1 on | ||
| 84 | success and 0 if an error occured. | ||
| 85 | |||
| 86 | BN_BLINDING_get_thread_id() returns the thread id (a B<unsigned long> | ||
| 87 | value) or 0 if not set. | ||
| 88 | |||
| 89 | BN_BLINDING_get_flags() returns the currently set B<BN_BLINDING> flags | ||
| 90 | (a B<unsigned long> value). | ||
| 91 | |||
| 92 | BN_BLINDING_create_param() returns the newly created B<BN_BLINDING> | ||
| 93 | parameters or NULL on error. | ||
| 94 | |||
| 95 | =head1 SEE ALSO | ||
| 96 | |||
| 97 | L<bn(3)|bn(3)> | ||
| 98 | |||
| 99 | =head1 HISTORY | ||
| 100 | |||
| 101 | BN_BLINDING_convert_ex, BN_BLINDIND_invert_ex, BN_BLINDING_get_thread_id, | ||
| 102 | BN_BLINDING_set_thread_id, BN_BLINDING_set_flags, BN_BLINDING_get_flags | ||
| 103 | and BN_BLINDING_create_param were first introduced in OpenSSL 0.9.8 | ||
| 104 | |||
| 105 | =head1 AUTHOR | ||
| 106 | |||
| 107 | Nils Larsch for the OpenSSL project (http://www.openssl.org). | ||
| 108 | |||
| 109 | =cut | ||
diff --git a/src/lib/libssl/src/doc/crypto/ERR_set_mark.pod b/src/lib/libssl/src/doc/crypto/ERR_set_mark.pod new file mode 100644 index 0000000000..d3ca4f2e77 --- /dev/null +++ b/src/lib/libssl/src/doc/crypto/ERR_set_mark.pod | |||
| @@ -0,0 +1,38 @@ | |||
| 1 | =pod | ||
| 2 | |||
| 3 | =head1 NAME | ||
| 4 | |||
| 5 | ERR_set_mark, ERR_pop_to_mark - set marks and pop errors until mark | ||
| 6 | |||
| 7 | =head1 SYNOPSIS | ||
| 8 | |||
| 9 | #include <openssl/err.h> | ||
| 10 | |||
| 11 | int ERR_set_mark(void); | ||
| 12 | |||
| 13 | int ERR_pop_to_mark(void); | ||
| 14 | |||
| 15 | =head1 DESCRIPTION | ||
| 16 | |||
| 17 | ERR_set_mark() sets a mark on the current topmost error record if there | ||
| 18 | is one. | ||
| 19 | |||
| 20 | ERR_pop_to_mark() will pop the top of the error stack until a mark is found. | ||
| 21 | The mark is then removed. If there is no mark, the whole stack is removed. | ||
| 22 | |||
| 23 | =head1 RETURN VALUES | ||
| 24 | |||
| 25 | ERR_set_mark() returns 0 if the error stack is empty, otherwise 1. | ||
| 26 | |||
| 27 | ERR_pop_to_mark() returns 0 if there was no mark in the error stack, which | ||
| 28 | implies that the stack became empty, otherwise 1. | ||
| 29 | |||
| 30 | =head1 SEE ALSO | ||
| 31 | |||
| 32 | L<err(3)|err(3)> | ||
| 33 | |||
| 34 | =head1 HISTORY | ||
| 35 | |||
| 36 | ERR_set_mark() and ERR_pop_to_mark() were added in OpenSSL 0.9.8. | ||
| 37 | |||
| 38 | =cut | ||
diff --git a/src/lib/libssl/src/doc/crypto/OPENSSL_Applink.pod b/src/lib/libssl/src/doc/crypto/OPENSSL_Applink.pod new file mode 100644 index 0000000000..e54de12cc8 --- /dev/null +++ b/src/lib/libssl/src/doc/crypto/OPENSSL_Applink.pod | |||
| @@ -0,0 +1,21 @@ | |||
| 1 | =pod | ||
| 2 | |||
| 3 | =head1 NAME | ||
| 4 | |||
| 5 | OPENSSL_Applink - glue between OpenSSL BIO and Win32 compiler run-time | ||
| 6 | |||
| 7 | =head1 SYNOPSIS | ||
| 8 | |||
| 9 | __declspec(dllexport) void **OPENSSL_Applink(); | ||
| 10 | |||
| 11 | =head1 DESCRIPTION | ||
| 12 | |||
| 13 | OPENSSL_Applink is application-side interface which provides a glue | ||
| 14 | between OpenSSL BIO layer and Win32 compiler run-time environment. | ||
| 15 | Even though it appears at application side, it's essentially OpenSSL | ||
| 16 | private interface. For this reason application developers are not | ||
| 17 | expected to implement it, but to compile provided module with | ||
| 18 | compiler of their choice and link it into the target application. | ||
| 19 | The referred module is available as <openssl>/ms/applink.c. | ||
| 20 | |||
| 21 | =cut | ||
diff --git a/src/lib/libssl/src/doc/crypto/OPENSSL_ia32cap.pod b/src/lib/libssl/src/doc/crypto/OPENSSL_ia32cap.pod new file mode 100644 index 0000000000..2e659d34a5 --- /dev/null +++ b/src/lib/libssl/src/doc/crypto/OPENSSL_ia32cap.pod | |||
| @@ -0,0 +1,43 @@ | |||
| 1 | =pod | ||
| 2 | |||
| 3 | =head1 NAME | ||
| 4 | |||
| 5 | OPENSSL_ia32cap - finding the IA-32 processor capabilities | ||
| 6 | |||
| 7 | =head1 SYNOPSIS | ||
| 8 | |||
| 9 | unsigned long *OPENSSL_ia32cap_loc(void); | ||
| 10 | #define OPENSSL_ia32cap (*(OPENSSL_ia32cap_loc())) | ||
| 11 | |||
| 12 | =head1 DESCRIPTION | ||
| 13 | |||
| 14 | Value returned by OPENSSL_ia32cap_loc() is address of a variable | ||
| 15 | containing IA-32 processor capabilities bit vector as it appears in EDX | ||
| 16 | register after executing CPUID instruction with EAX=1 input value (see | ||
| 17 | Intel Application Note #241618). Naturally it's meaningful on IA-32[E] | ||
| 18 | platforms only. The variable is normally set up automatically upon | ||
| 19 | toolkit initialization, but can be manipulated afterwards to modify | ||
| 20 | crypto library behaviour. For the moment of this writing six bits are | ||
| 21 | significant, namely: | ||
| 22 | |||
| 23 | 1. bit #28 denoting Hyperthreading, which is used to distiguish | ||
| 24 | cores with shared cache; | ||
| 25 | 2. bit #26 denoting SSE2 support; | ||
| 26 | 3. bit #25 denoting SSE support; | ||
| 27 | 4. bit #23 denoting MMX support; | ||
| 28 | 5. bit #20, reserved by Intel, is used to choose between RC4 code | ||
| 29 | pathes; | ||
| 30 | 6. bit #4 denoting presence of Time-Stamp Counter. | ||
| 31 | |||
| 32 | For example, clearing bit #26 at run-time disables high-performance | ||
| 33 | SSE2 code present in the crypto library. You might have to do this if | ||
| 34 | target OpenSSL application is executed on SSE2 capable CPU, but under | ||
| 35 | control of OS which does not support SSE2 extentions. Even though you | ||
| 36 | can manipulate the value programmatically, you most likely will find it | ||
| 37 | more appropriate to set up an environment variable with the same name | ||
| 38 | prior starting target application, e.g. on Intel P4 processor 'env | ||
| 39 | OPENSSL_ia32cap=0x12900010 apps/openssl', to achieve same effect | ||
| 40 | without modifying the application source code. Alternatively you can | ||
| 41 | reconfigure the toolkit with no-sse2 option and recompile. | ||
| 42 | |||
| 43 | =cut | ||
diff --git a/src/lib/libssl/src/doc/crypto/ecdsa.pod b/src/lib/libssl/src/doc/crypto/ecdsa.pod new file mode 100644 index 0000000000..49b10f2249 --- /dev/null +++ b/src/lib/libssl/src/doc/crypto/ecdsa.pod | |||
| @@ -0,0 +1,210 @@ | |||
| 1 | =pod | ||
| 2 | |||
| 3 | =head1 NAME | ||
| 4 | |||
| 5 | ecdsa - Elliptic Curve Digital Signature Algorithm | ||
| 6 | |||
| 7 | =head1 SYNOPSIS | ||
| 8 | |||
| 9 | #include <openssl/ecdsa.h> | ||
| 10 | |||
| 11 | ECDSA_SIG* ECDSA_SIG_new(void); | ||
| 12 | void ECDSA_SIG_free(ECDSA_SIG *sig); | ||
| 13 | int i2d_ECDSA_SIG(const ECDSA_SIG *sig, unsigned char **pp); | ||
| 14 | ECDSA_SIG* d2i_ECDSA_SIG(ECDSA_SIG **sig, const unsigned char **pp, | ||
| 15 | long len); | ||
| 16 | |||
| 17 | ECDSA_SIG* ECDSA_do_sign(const unsigned char *dgst, int dgst_len, | ||
| 18 | EC_KEY *eckey); | ||
| 19 | ECDSA_SIG* ECDSA_do_sign_ex(const unsigned char *dgst, int dgstlen, | ||
| 20 | const BIGNUM *kinv, const BIGNUM *rp, | ||
| 21 | EC_KEY *eckey); | ||
| 22 | int ECDSA_do_verify(const unsigned char *dgst, int dgst_len, | ||
| 23 | const ECDSA_SIG *sig, EC_KEY* eckey); | ||
| 24 | int ECDSA_sign_setup(EC_KEY *eckey, BN_CTX *ctx, | ||
| 25 | BIGNUM **kinv, BIGNUM **rp); | ||
| 26 | int ECDSA_sign(int type, const unsigned char *dgst, | ||
| 27 | int dgstlen, unsigned char *sig, | ||
| 28 | unsigned int *siglen, EC_KEY *eckey); | ||
| 29 | int ECDSA_sign_ex(int type, const unsigned char *dgst, | ||
| 30 | int dgstlen, unsigned char *sig, | ||
| 31 | unsigned int *siglen, const BIGNUM *kinv, | ||
| 32 | const BIGNUM *rp, EC_KEY *eckey); | ||
| 33 | int ECDSA_verify(int type, const unsigned char *dgst, | ||
| 34 | int dgstlen, const unsigned char *sig, | ||
| 35 | int siglen, EC_KEY *eckey); | ||
| 36 | int ECDSA_size(const EC_KEY *eckey); | ||
| 37 | |||
| 38 | const ECDSA_METHOD* ECDSA_OpenSSL(void); | ||
| 39 | void ECDSA_set_default_method(const ECDSA_METHOD *meth); | ||
| 40 | const ECDSA_METHOD* ECDSA_get_default_method(void); | ||
| 41 | int ECDSA_set_method(EC_KEY *eckey,const ECDSA_METHOD *meth); | ||
| 42 | |||
| 43 | int ECDSA_get_ex_new_index(long argl, void *argp, | ||
| 44 | CRYPTO_EX_new *new_func, | ||
| 45 | CRYPTO_EX_dup *dup_func, | ||
| 46 | CRYPTO_EX_free *free_func); | ||
| 47 | int ECDSA_set_ex_data(EC_KEY *d, int idx, void *arg); | ||
| 48 | void* ECDSA_get_ex_data(EC_KEY *d, int idx); | ||
| 49 | |||
| 50 | =head1 DESCRIPTION | ||
| 51 | |||
| 52 | The B<ECDSA_SIG> structure consists of two BIGNUMs for the | ||
| 53 | r and s value of a ECDSA signature (see X9.62 or FIPS 186-2). | ||
| 54 | |||
| 55 | struct | ||
| 56 | { | ||
| 57 | BIGNUM *r; | ||
| 58 | BIGNUM *s; | ||
| 59 | } ECDSA_SIG; | ||
| 60 | |||
| 61 | ECDSA_SIG_new() allocates a new B<ECDSA_SIG> structure (note: this | ||
| 62 | function also allocates the BIGNUMs) and initialize it. | ||
| 63 | |||
| 64 | ECDSA_SIG_free() frees the B<ECDSA_SIG> structure B<sig>. | ||
| 65 | |||
| 66 | i2d_ECDSA_SIG() creates the DER encoding of the ECDSA signature | ||
| 67 | B<sig> and writes the encoded signature to B<*pp> (note: if B<pp> | ||
| 68 | is NULL B<i2d_ECDSA_SIG> returns the expected length in bytes of | ||
| 69 | the DER encoded signature). B<i2d_ECDSA_SIG> returns the length | ||
| 70 | of the DER encoded signature (or 0 on error). | ||
| 71 | |||
| 72 | d2i_ECDSA_SIG() decodes a DER encoded ECDSA signature and returns | ||
| 73 | the decoded signature in a newly allocated B<ECDSA_SIG> structure. | ||
| 74 | B<*sig> points to the buffer containing the DER encoded signature | ||
| 75 | of size B<len>. | ||
| 76 | |||
| 77 | ECDSA_size() returns the maximum length of a DER encoded | ||
| 78 | ECDSA signature created with the private EC key B<eckey>. | ||
| 79 | |||
| 80 | ECDSA_sign_setup() may be used to precompute parts of the | ||
| 81 | signing operation. B<eckey> is the private EC key and B<ctx> | ||
| 82 | is a pointer to B<BN_CTX> structure (or NULL). The precomputed | ||
| 83 | values or returned in B<kinv> and B<rp> and can be used in a | ||
| 84 | later call to B<ECDSA_sign_ex> or B<ECDSA_do_sign_ex>. | ||
| 85 | |||
| 86 | ECDSA_sign() is wrapper function for ECDSA_sign_ex with B<kinv> | ||
| 87 | and B<rp> set to NULL. | ||
| 88 | |||
| 89 | ECDSA_sign_ex() computes a digital signature of the B<dgstlen> bytes | ||
| 90 | hash value B<dgst> using the private EC key B<eckey> and the optional | ||
| 91 | pre-computed values B<kinv> and B<rp>. The DER encoded signatures is | ||
| 92 | stored in B<sig> and it's length is returned in B<sig_len>. Note: B<sig> | ||
| 93 | must point to B<ECDSA_size> bytes of memory. The parameter B<type> | ||
| 94 | is ignored. | ||
| 95 | |||
| 96 | ECDSA_verify() verifies that the signature in B<sig> of size | ||
| 97 | B<siglen> is a valid ECDSA signature of the hash value | ||
| 98 | value B<dgst> of size B<dgstlen> using the public key B<eckey>. | ||
| 99 | The parameter B<type> is ignored. | ||
| 100 | |||
| 101 | ECDSA_do_sign() is wrapper function for ECDSA_do_sign_ex with B<kinv> | ||
| 102 | and B<rp> set to NULL. | ||
| 103 | |||
| 104 | ECDSA_do_sign_ex() computes a digital signature of the B<dgst_len> | ||
| 105 | bytes hash value B<dgst> using the private key B<eckey> and the | ||
| 106 | optional pre-computed values B<kinv> and B<rp>. The signature is | ||
| 107 | returned in a newly allocated B<ECDSA_SIG> structure (or NULL on error). | ||
| 108 | |||
| 109 | ECDSA_do_verify() verifies that the signature B<sig> is a valid | ||
| 110 | ECDSA signature of the hash value B<dgst> of size B<dgst_len> | ||
| 111 | using the public key B<eckey>. | ||
| 112 | |||
| 113 | =head1 RETURN VALUES | ||
| 114 | |||
| 115 | ECDSA_size() returns the maximum length signature or 0 on error. | ||
| 116 | |||
| 117 | ECDSA_sign_setup() and ECDSA_sign() return 1 if successful or -1 | ||
| 118 | on error. | ||
| 119 | |||
| 120 | ECDSA_verify() and ECDSA_do_verify() return 1 for a valid | ||
| 121 | signature, 0 for an invalid signature and -1 on error. | ||
| 122 | The error codes can be obtained by L<ERR_get_error(3)|ERR_get_error(3)>. | ||
| 123 | |||
| 124 | =head1 EXAMPLES | ||
| 125 | |||
| 126 | Creating a ECDSA signature of given SHA-1 hash value using the | ||
| 127 | named curve secp192k1. | ||
| 128 | |||
| 129 | First step: create a EC_KEY object (note: this part is B<not> ECDSA | ||
| 130 | specific) | ||
| 131 | |||
| 132 | int ret; | ||
| 133 | ECDSA_SIG *sig; | ||
| 134 | EC_KEY *eckey = EC_KEY_new(); | ||
| 135 | if (eckey == NULL) | ||
| 136 | { | ||
| 137 | /* error */ | ||
| 138 | } | ||
| 139 | key->group = EC_GROUP_new_by_nid(NID_secp192k1); | ||
| 140 | if (key->group == NULL) | ||
| 141 | { | ||
| 142 | /* error */ | ||
| 143 | } | ||
| 144 | if (!EC_KEY_generate_key(eckey)) | ||
| 145 | { | ||
| 146 | /* error */ | ||
| 147 | } | ||
| 148 | |||
| 149 | Second step: compute the ECDSA signature of a SHA-1 hash value | ||
| 150 | using B<ECDSA_do_sign> | ||
| 151 | |||
| 152 | sig = ECDSA_do_sign(digest, 20, eckey); | ||
| 153 | if (sig == NULL) | ||
| 154 | { | ||
| 155 | /* error */ | ||
| 156 | } | ||
| 157 | |||
| 158 | or using B<ECDSA_sign> | ||
| 159 | |||
| 160 | unsigned char *buffer, *pp; | ||
| 161 | int buf_len; | ||
| 162 | buf_len = ECDSA_size(eckey); | ||
| 163 | buffer = OPENSSL_malloc(buf_len); | ||
| 164 | pp = buffer; | ||
| 165 | if (!ECDSA_sign(0, dgst, dgstlen, pp, &buf_len, eckey); | ||
| 166 | { | ||
| 167 | /* error */ | ||
| 168 | } | ||
| 169 | |||
| 170 | Third step: verify the created ECDSA signature using B<ECDSA_do_verify> | ||
| 171 | |||
| 172 | ret = ECDSA_do_verify(digest, 20, sig, eckey); | ||
| 173 | |||
| 174 | or using B<ECDSA_verify> | ||
| 175 | |||
| 176 | ret = ECDSA_verify(0, digest, 20, buffer, buf_len, eckey); | ||
| 177 | |||
| 178 | and finally evaluate the return value: | ||
| 179 | |||
| 180 | if (ret == -1) | ||
| 181 | { | ||
| 182 | /* error */ | ||
| 183 | } | ||
| 184 | else if (ret == 0) | ||
| 185 | { | ||
| 186 | /* incorrect signature */ | ||
| 187 | } | ||
| 188 | else /* ret == 1 */ | ||
| 189 | { | ||
| 190 | /* signature ok */ | ||
| 191 | } | ||
| 192 | |||
| 193 | =head1 CONFORMING TO | ||
| 194 | |||
| 195 | ANSI X9.62, US Federal Information Processing Standard FIPS 186-2 | ||
| 196 | (Digital Signature Standard, DSS) | ||
| 197 | |||
| 198 | =head1 SEE ALSO | ||
| 199 | |||
| 200 | L<dsa(3)|dsa(3)>, L<rsa(3)|rsa(3)> | ||
| 201 | |||
| 202 | =head1 HISTORY | ||
| 203 | |||
| 204 | The ecdsa implementation was first introduced in OpenSSL 0.9.8 | ||
| 205 | |||
| 206 | =head1 AUTHOR | ||
| 207 | |||
| 208 | Nils Larsch for the OpenSSL project (http://www.openssl.org). | ||
| 209 | |||
| 210 | =cut | ||
diff --git a/src/lib/libssl/src/doc/crypto/x509.pod b/src/lib/libssl/src/doc/crypto/x509.pod new file mode 100644 index 0000000000..f9e58e0e41 --- /dev/null +++ b/src/lib/libssl/src/doc/crypto/x509.pod | |||
| @@ -0,0 +1,64 @@ | |||
| 1 | =pod | ||
| 2 | |||
| 3 | =head1 NAME | ||
| 4 | |||
| 5 | x509 - X.509 certificate handling | ||
| 6 | |||
| 7 | =head1 SYNOPSIS | ||
| 8 | |||
| 9 | #include <openssl/x509.h> | ||
| 10 | |||
| 11 | =head1 DESCRIPTION | ||
| 12 | |||
| 13 | A X.509 certificate is a structured grouping of information about | ||
| 14 | an individual, a device, or anything one can imagine. A X.509 CRL | ||
| 15 | (certificate revocation list) is a tool to help determine if a | ||
| 16 | certificate is still valid. The exact definition of those can be | ||
| 17 | found in the X.509 document from ITU-T, or in RFC3280 from PKIX. | ||
| 18 | In OpenSSL, the type X509 is used to express such a certificate, and | ||
| 19 | the type X509_CRL is used to express a CRL. | ||
| 20 | |||
| 21 | A related structure is a certificate request, defined in PKCS#10 from | ||
| 22 | RSA Security, Inc, also reflected in RFC2896. In OpenSSL, the type | ||
| 23 | X509_REQ is used to express such a certificate request. | ||
| 24 | |||
| 25 | To handle some complex parts of a certificate, there are the types | ||
| 26 | X509_NAME (to express a certificate name), X509_ATTRIBUTE (to express | ||
| 27 | a certificate attributes), X509_EXTENSION (to express a certificate | ||
| 28 | extension) and a few more. | ||
| 29 | |||
| 30 | Finally, there's the supertype X509_INFO, which can contain a CRL, a | ||
| 31 | certificate and a corresponding private key. | ||
| 32 | |||
| 33 | B<X509_>I<...>, B<d2i_X509_>I<...> and B<i2d_X509_>I<...> handle X.509 | ||
| 34 | certificates, with some exceptions, shown below. | ||
| 35 | |||
| 36 | B<X509_CRL_>I<...>, B<d2i_X509_CRL_>I<...> and B<i2d_X509_CRL_>I<...> | ||
| 37 | handle X.509 CRLs. | ||
| 38 | |||
| 39 | B<X509_REQ_>I<...>, B<d2i_X509_REQ_>I<...> and B<i2d_X509_REQ_>I<...> | ||
| 40 | handle PKCS#10 certificate requests. | ||
| 41 | |||
| 42 | B<X509_NAME_>I<...> handle certificate names. | ||
| 43 | |||
| 44 | B<X509_ATTRIBUTE_>I<...> handle certificate attributes. | ||
| 45 | |||
| 46 | B<X509_EXTENSION_>I<...> handle certificate extensions. | ||
| 47 | |||
| 48 | =head1 SEE ALSO | ||
| 49 | |||
| 50 | L<X509_NAME_ENTRY_get_object(3)|X509_NAME_ENTRY_get_object(3)>, | ||
| 51 | L<X509_NAME_add_entry_by_txt(3)|X509_NAME_add_entry_by_txt(3)>, | ||
| 52 | L<X509_NAME_add_entry_by_NID(3)|X509_NAME_add_entry_by_NID(3)>, | ||
| 53 | L<X509_NAME_print_ex(3)|X509_NAME_print_ex(3)>, | ||
| 54 | L<X509_NAME_new(3)|X509_NAME_new(3)>, | ||
| 55 | L<d2i_X509(3)|d2i_X509(3)>, | ||
| 56 | L<d2i_X509_ALGOR(3)|d2i_X509_ALGOR(3)>, | ||
| 57 | L<d2i_X509_CRL(3)|d2i_X509_CRL(3)>, | ||
| 58 | L<d2i_X509_NAME(3)|d2i_X509_NAME(3)>, | ||
| 59 | L<d2i_X509_REQ(3)|d2i_X509_REQ(3)>, | ||
| 60 | L<d2i_X509_SIG(3)|d2i_X509_SIG(3)>, | ||
| 61 | L<crypto(3)|crypto(3)>, | ||
| 62 | L<x509v3(3)|x509v3(3)> | ||
| 63 | |||
| 64 | =cut | ||
