summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjmc <>2016-08-27 20:43:05 +0000
committerjmc <>2016-08-27 20:43:05 +0000
commit9304d31ee77186647e4a011b65ec5bc5f7aaa6b2 (patch)
tree06b13e9537424ad354263d3356506f618769ec60 /src
parent954bb2192e13413aea9af5f2b62fca949e50a79e (diff)
downloadopenbsd-9304d31ee77186647e4a011b65ec5bc5f7aaa6b2.tar.gz
openbsd-9304d31ee77186647e4a011b65ec5bc5f7aaa6b2.tar.bz2
openbsd-9304d31ee77186647e4a011b65ec5bc5f7aaa6b2.zip
shorten the req text;
Diffstat (limited to 'src')
-rw-r--r--src/usr.bin/openssl/openssl.1641
1 files changed, 189 insertions, 452 deletions
diff --git a/src/usr.bin/openssl/openssl.1 b/src/usr.bin/openssl/openssl.1
index 9fabe16cd9..7a416e74f2 100644
--- a/src/usr.bin/openssl/openssl.1
+++ b/src/usr.bin/openssl/openssl.1
@@ -1,4 +1,4 @@
1.\" $OpenBSD: openssl.1,v 1.62 2016/08/25 14:37:28 jmc Exp $ 1.\" $OpenBSD: openssl.1,v 1.63 2016/08/27 20:43:05 jmc Exp $
2.\" ==================================================================== 2.\" ====================================================================
3.\" Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. 3.\" Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved.
4.\" 4.\"
@@ -112,7 +112,7 @@
112.\" 112.\"
113.\" OPENSSL 113.\" OPENSSL
114.\" 114.\"
115.Dd $Mdocdate: August 25 2016 $ 115.Dd $Mdocdate: August 27 2016 $
116.Dt OPENSSL 1 116.Dt OPENSSL 1
117.Os 117.Os
118.Sh NAME 118.Sh NAME
@@ -3089,9 +3089,6 @@ verification succeeded or failed.
3089.It Fl verifyrecover 3089.It Fl verifyrecover
3090Verify the input data and output the recovered data. 3090Verify the input data and output the recovered data.
3091.El 3091.El
3092.\"
3093.\" PRIME
3094.\"
3095.Sh PRIME 3092.Sh PRIME
3096.Cm openssl prime 3093.Cm openssl prime
3097.Op Fl bits Ar n 3094.Op Fl bits Ar n
@@ -3136,9 +3133,6 @@ Test if number
3136.Ar p 3133.Ar p
3137is prime. 3134is prime.
3138.El 3135.El
3139.\"
3140.\" RAND
3141.\"
3142.Sh RAND 3136.Sh RAND
3143.nr nS 1 3137.nr nS 1
3144.Nm "openssl rand" 3138.Nm "openssl rand"
@@ -3163,26 +3157,21 @@ encoding on the output.
3163.It Fl hex 3157.It Fl hex
3164Specify hexadecimal output. 3158Specify hexadecimal output.
3165.It Fl out Ar file 3159.It Fl out Ar file
3166Write to 3160The output file to write to,
3167.Ar file 3161or standard output if not specified.
3168instead of standard output.
3169.El 3162.El
3170.\"
3171.\" REQ
3172.\"
3173.Sh REQ 3163.Sh REQ
3174.nr nS 1 3164.nr nS 1
3175.Nm "openssl req" 3165.Nm "openssl req"
3176.Bk -words
3177.Op Fl asn1-kludge 3166.Op Fl asn1-kludge
3178.Op Fl batch 3167.Op Fl batch
3179.Op Fl config Ar file 3168.Op Fl config Ar file
3180.Op Fl days Ar n 3169.Op Fl days Ar n
3181.Op Fl extensions Ar section 3170.Op Fl extensions Ar section
3182.Op Fl in Ar file 3171.Op Fl in Ar file
3183.Op Fl inform Ar DER | PEM 3172.Op Fl inform Cm der | pem
3184.Op Fl key Ar keyfile 3173.Op Fl key Ar keyfile
3185.Op Fl keyform Ar DER | PEM 3174.Op Fl keyform Cm der | pem
3186.Op Fl keyout Ar file 3175.Op Fl keyout Ar file
3187.Op Fl md4 | md5 | sha1 3176.Op Fl md4 | md5 | sha1
3188.Op Fl modulus 3177.Op Fl modulus
@@ -3194,7 +3183,7 @@ instead of standard output.
3194.Op Fl nodes 3183.Op Fl nodes
3195.Op Fl noout 3184.Op Fl noout
3196.Op Fl out Ar file 3185.Op Fl out Ar file
3197.Op Fl outform Ar DER | PEM 3186.Op Fl outform Cm der | pem
3198.Op Fl passin Ar arg 3187.Op Fl passin Ar arg
3199.Op Fl passout Ar arg 3188.Op Fl passout Ar arg
3200.Op Fl pubkey 3189.Op Fl pubkey
@@ -3208,7 +3197,6 @@ instead of standard output.
3208.Op Fl verbose 3197.Op Fl verbose
3209.Op Fl verify 3198.Op Fl verify
3210.Op Fl x509 3199.Op Fl x509
3211.Ek
3212.nr nS 0 3200.nr nS 0
3213.Pp 3201.Pp
3214The 3202The
@@ -3221,103 +3209,71 @@ for use as root CAs, for example.
3221The options are as follows: 3209The options are as follows:
3222.Bl -tag -width Ds 3210.Bl -tag -width Ds
3223.It Fl asn1-kludge 3211.It Fl asn1-kludge
3224By default, the 3212Produce requests in an invalid format for certain picky CAs.
3225.Nm req 3213Very few CAs still require the use of this option.
3226command outputs certificate requests containing
3227no attributes in the correct PKCS#10 format.
3228However certain CAs will only
3229accept requests containing no attributes in an invalid form: this
3230option produces this invalid format.
3231.Pp
3232More precisely, the
3233.Em Attributes
3234in a PKCS#10 certificate request are defined as a SET OF Attribute.
3235They are
3236.Em not
3237optional, so if no attributes are present then they should be encoded as an
3238empty SET OF.
3239The invalid form does not include the empty
3240SET OF, whereas the correct form does.
3241.Pp
3242It should be noted that very few CAs still require the use of this option.
3243.It Fl batch 3214.It Fl batch
3244Non-interactive mode. 3215Non-interactive mode.
3245.It Fl config Ar file 3216.It Fl config Ar file
3246This allows an alternative configuration file to be specified; 3217Specify an alternative configuration file.
3247this overrides the compile time filename or any specified in
3248the
3249.Ev OPENSSL_CONF
3250environment variable.
3251.It Fl days Ar n 3218.It Fl days Ar n
3252When the 3219Specify the number of days to certify the certificate for.
3253.Fl x509
3254option is being used, this specifies the number of
3255days to certify the certificate for.
3256The default is 30 days. 3220The default is 30 days.
3257.It Fl extensions Ar section , Fl reqexts Ar section 3221Used with the
3258These options specify alternative sections to include certificate
3259extensions (if the
3260.Fl x509 3222.Fl x509
3261option is present) or certificate request extensions. 3223option.
3262This allows several different sections to 3224.It Fl extensions Ar section , Fl reqexts Ar section
3263be used in the same configuration file to specify requests for 3225Specify alternative sections to include certificate
3264a variety of purposes. 3226extensions (with
3227.Fl x509 )
3228or certificate request extensions,
3229allowing several different sections to be used in the same configuration file.
3265.It Fl in Ar file 3230.It Fl in Ar file
3266This specifies the input 3231The input file to read a request from,
3267.Ar file 3232or standard input if not specified.
3268to read a request from, or standard input
3269if this option is not specified.
3270A request is only read if the creation options 3233A request is only read if the creation options
3271.Fl new 3234.Fl new
3272and 3235and
3273.Fl newkey 3236.Fl newkey
3274are not specified. 3237are not specified.
3275.It Fl inform Ar DER | PEM 3238.It Fl inform Cm der | pem
3276This specifies the input format. 3239The input format.
3277The 3240.Cm der
3278.Ar DER 3241uses an ASN1 DER-encoded form compatible with the PKCS#10.
3279argument uses an ASN1 DER-encoded form compatible with the PKCS#10. 3242.Cm pem
3280The 3243is the default format:
3281.Ar PEM
3282form is the default format:
3283it consists of the DER format base64-encoded with additional header and 3244it consists of the DER format base64-encoded with additional header and
3284footer lines. 3245footer lines.
3285.It Fl key Ar keyfile 3246.It Fl key Ar keyfile
3286This specifies the file to read the private key from. 3247The file to read the private key from.
3287It also accepts PKCS#8 format private keys for PEM format files. 3248It also accepts PKCS#8 format private keys for PEM format files.
3288.It Fl keyform Ar DER | PEM 3249.It Fl keyform Cm der | pem
3289The format of the private key file specified in the 3250The format of the private key file specified in the
3290.Fl key 3251.Fl key
3291argument. 3252argument.
3292.Ar PEM 3253The default is PEM.
3293is the default.
3294.It Fl keyout Ar file 3254.It Fl keyout Ar file
3295This gives the 3255The file to write the newly created private key to.
3296.Ar file 3256If this option is not specified,
3297to write the newly created private key to. 3257the filename present in the configuration file is used.
3298If this option is not specified, the filename present in the
3299configuration file is used.
3300.It Fl md5 | sha1 | sha256 3258.It Fl md5 | sha1 | sha256
3301This specifies the message digest to sign the request with. 3259The message digest to sign the request with.
3302This overrides the digest algorithm specified in the configuration file. 3260This overrides the digest algorithm specified in the configuration file.
3303.Pp 3261.Pp
3304Some public key algorithms may override this choice. 3262Some public key algorithms may override this choice.
3305For instance, DSA signatures always use SHA1. 3263For instance, DSA signatures always use SHA1.
3306.It Fl modulus 3264.It Fl modulus
3307This option prints out the value of the modulus of the public key 3265Print the value of the modulus of the public key contained in the request.
3308contained in the request.
3309.It Fl nameopt Ar option , Fl reqopt Ar option 3266.It Fl nameopt Ar option , Fl reqopt Ar option
3310These options determine how the subject or issuer names are displayed. 3267Determine how the subject or issuer names are displayed.
3311The
3312.Ar option 3268.Ar option
3313argument can be a single option or multiple options separated by commas. 3269can be a single option or multiple options separated by commas.
3314Alternatively, these options may be used more than once to set multiple options. 3270Alternatively, these options may be used more than once to set multiple options.
3315See the 3271See the
3316.Sx X509 3272.Sx X509
3317section below for details. 3273section below for details.
3318.It Fl new 3274.It Fl new
3319This option generates a new certificate request. 3275Generate a new certificate request.
3320It will prompt the user for the relevant field values. 3276The user is prompted for the relevant field values.
3321The actual fields prompted for and their maximum and minimum sizes 3277The actual fields prompted for and their maximum and minimum sizes
3322are specified in the configuration file and any requested extensions. 3278are specified in the configuration file and any requested extensions.
3323.Pp 3279.Pp
@@ -3326,88 +3282,68 @@ If the
3326option is not used, it will generate a new RSA private 3282option is not used, it will generate a new RSA private
3327key using information specified in the configuration file. 3283key using information specified in the configuration file.
3328.It Fl newhdr 3284.It Fl newhdr
3329Adds the word NEW to the PEM file header and footer lines 3285Add the word NEW to the PEM file header and footer lines
3330on the outputed request. 3286on the outputed request.
3331Some software 3287Some software and CAs need this.
3332.Pq Netscape certificate server
3333and some CAs need this.
3334.It Fl newkey Ar arg 3288.It Fl newkey Ar arg
3335This option creates a new certificate request and a new private key. 3289Create a new certificate request and a new private key.
3336The argument takes one of several forms. 3290The argument takes one of several forms.
3337.Ar rsa : Ns Ar nbits , 3291.Pp
3338where 3292.No rsa : Ns Ar nbits
3339.Ar nbits 3293generates an RSA key
3340is the number of bits, generates an RSA key
3341.Ar nbits 3294.Ar nbits
3342in size. 3295in size.
3343If 3296If
3344.Ar nbits 3297.Ar nbits
3345is omitted, i.e.\& 3298is omitted
3346.Cm -newkey rsa 3299the default key size is used.
3347specified, 3300.Pp
3348the default key size, specified in the configuration file, is used. 3301.No dsa : Ns Ar file
3349.Pp 3302generates a DSA key using the parameters in
3350All other algorithms support the 3303.Ar file .
3351.Ar alg : Ns Ar file 3304.Pp
3352form, 3305.No param : Ns Ar file
3306generates a key using the parameters or certificate in
3307.Ar file .
3308.Pp
3309All other algorithms support the form
3310.Ar algorithm : Ns Ar file ,
3353where file may be an algorithm parameter file, 3311where file may be an algorithm parameter file,
3354created by the 3312created by the
3355.Cm genpkey -genparam 3313.Cm genpkey -genparam
3356command or an X.509 certificate for a key with appropriate algorithm. 3314command or an X.509 certificate for a key with appropriate algorithm.
3357.Pp 3315.Ar file
3358.Ar param : Ns Ar file 3316can be omitted,
3359generates a key using the parameter file or certificate 3317in which case any parameters can be specified via the
3360.Ar file ;
3361the algorithm is determined by the parameters.
3362.Ar algname : Ns Ar file
3363use algorithm
3364.Ar algname
3365and parameter file
3366.Ar file :
3367the two algorithms must match or an error occurs.
3368.Ar algname
3369just uses algorithm
3370.Ar algname ,
3371and parameters, if necessary,
3372should be specified via the
3373.Fl pkeyopt 3318.Fl pkeyopt
3374option. 3319option.
3375.Pp
3376.Ar dsa : Ns Ar file
3377generates a DSA key using the parameters in the file
3378.Ar file .
3379.It Fl no-asn1-kludge 3320.It Fl no-asn1-kludge
3380Reverses the effect of 3321Reverse the effect of
3381.Fl asn1-kludge . 3322.Fl asn1-kludge .
3382.It Fl nodes 3323.It Fl nodes
3383If this option is specified and a private key is created, it 3324Do not encrypt the private key.
3384will not be encrypted.
3385.It Fl noout 3325.It Fl noout
3386This option prevents output of the encoded version of the request. 3326Do not output the encoded version of the request.
3387.It Fl out Ar file 3327.It Fl out Ar file
3388This specifies the output 3328The output file to write to,
3389.Ar file 3329or standard output if not spceified.
3390to write to, or standard output by default. 3330.It Fl outform Cm der | pem
3391.It Fl outform Ar DER | PEM 3331The output format.
3392This specifies the output format; the options have the same meaning as the
3393.Fl inform
3394option.
3395.It Fl passin Ar arg 3332.It Fl passin Ar arg
3396The key password source. 3333The key password source.
3397.It Fl passout Ar arg 3334.It Fl passout Ar arg
3398The output file password source. 3335The output file password source.
3399.It Fl pubkey 3336.It Fl pubkey
3400Outputs the public key. 3337Output the public key.
3401.It Fl reqopt Ar option 3338.It Fl reqopt Ar option
3402Customise the output format used with 3339Customise the output format used with
3403.Fl text . 3340.Fl text .
3404The 3341The
3405.Ar option 3342.Ar option
3406argument can be a single option or multiple options separated by commas. 3343argument can be a single option or multiple options separated by commas.
3407.Pp 3344See also the discussion of
3408See the discussion of the
3409.Fl certopt 3345.Fl certopt
3410option in the 3346in the
3411.Nm x509 3347.Nm x509
3412command. 3348command.
3413.It Fl set_serial Ar n 3349.It Fl set_serial Ar n
@@ -3416,219 +3352,180 @@ This may be specified as a decimal value or a hex value if preceded by
3416.Sq 0x . 3352.Sq 0x .
3417It is possible to use negative serial numbers but this is not recommended. 3353It is possible to use negative serial numbers but this is not recommended.
3418.It Fl subj Ar arg 3354.It Fl subj Ar arg
3419Replaces subject field of input request with specified data and outputs 3355Replaces the subject field of an input request
3420modified request. 3356with the specified data and output the modified request.
3421The arg must be formatted as 3357.Ar arg
3422.Em /type0=value0/type1=value1/type2=... ; 3358must be formatted as /type0=value0/type1=value1/type2=...;
3423characters may be escaped by 3359characters may be escaped by
3424.Sq \e 3360.Sq \e
3425.Pq backslash ; 3361(backslash);
3426no spaces are skipped. 3362no spaces are skipped.
3427.It Fl subject 3363.It Fl subject
3428Prints out the request subject (or certificate subject if 3364Print the request subject (or certificate subject if
3429.Fl x509 3365.Fl x509
3430is specified. 3366is specified).
3431.It Fl text 3367.It Fl text
3432Prints out the certificate request in text form. 3368Print the certificate request in text form.
3433.It Fl utf8 3369.It Fl utf8
3434This option causes field values to be interpreted as UTF8 strings; 3370Interpret field values as UTF8 strings, not ASCII.
3435by default they are interpreted as ASCII.
3436This means that the field values, whether prompted from a terminal or
3437obtained from a configuration file, must be valid UTF8 strings.
3438.It Fl verbose 3371.It Fl verbose
3439Print extra details about the operations being performed. 3372Print extra details about the operations being performed.
3440.It Fl verify 3373.It Fl verify
3441Verifies the signature on the request. 3374Verify the signature on the request.
3442.It Fl x509 3375.It Fl x509
3443This option outputs a self-signed certificate instead of a certificate 3376Output a self-signed certificate instead of a certificate request.
3444request. 3377This is typically used to generate a test certificate or a self-signed root CA.
3445This is typically used to generate a test certificate or 3378The extensions added to the certificate (if any)
3446a self-signed root CA.
3447The extensions added to the certificate
3448.Pq if any
3449are specified in the configuration file. 3379are specified in the configuration file.
3450Unless specified using the 3380Unless specified using the
3451.Fl set_serial 3381.Fl set_serial
3452option, 0 will be used for the serial number. 3382option, 0 is used for the serial number.
3453.El 3383.El
3454.Sh REQ CONFIGURATION FILE FORMAT 3384.Pp
3455The configuration options are specified in the 3385The configuration options are specified in the
3456.Em req 3386.Qq req
3457section of the configuration file. 3387section of the configuration file.
3458As with all configuration files, if no value is specified in the specific 3388As with all configuration files, if no value is specified in the specific
3459section (i.e.\& 3389section then the initial unnamed or default section is searched too.
3460.Em req )
3461then the initial unnamed or
3462.Em default
3463section is searched too.
3464.Pp 3390.Pp
3465The options available are described in detail below. 3391The options available are as follows:
3466.Bl -tag -width "XXXX" 3392.Bl -tag -width "XXXX"
3467.It Ar attributes 3393.It Cm attributes
3468This specifies the section containing any request attributes: its format 3394The section containing any request attributes: its format
3469is the same as 3395is the same as
3470.Ar distinguished_name . 3396.Cm distinguished_name .
3471Typically these may contain the 3397Typically these may contain the challengePassword or unstructuredName types.
3472.Em challengePassword 3398They are currently ignored by the
3473or 3399.Nm openssl
3474.Em unstructuredName
3475types.
3476They are currently ignored by
3477.Nm OpenSSL Ns Li 's
3478request signing utilities, but some CAs might want them. 3400request signing utilities, but some CAs might want them.
3479.It Ar default_bits 3401.It Cm default_bits
3480This specifies the default key size in bits. 3402The default key size, in bits.
3481If not specified, 2048 is used. 3403The default is 2048.
3482It is used if the 3404It is used if the
3483.Fl new 3405.Fl new
3484option is used. 3406option is used and can be overridden by using the
3485It can be overridden by using the
3486.Fl newkey 3407.Fl newkey
3487option. 3408option.
3488.It Ar default_keyfile 3409.It Cm default_keyfile
3489This is the default file to write a private key to. 3410The default file to write a private key to,
3490If not specified, the key is written to standard output. 3411or standard output if not specified.
3491This can be overridden by the 3412It can be overridden by the
3492.Fl keyout 3413.Fl keyout
3493option. 3414option.
3494.It Ar default_md 3415.It Cm default_md
3495This option specifies the digest algorithm to use. 3416The digest algorithm to use.
3496Possible values include 3417Possible values include
3497.Ar md5 , 3418.Cm md5 ,
3498.Ar sha1 3419.Cm sha1
3499and 3420and
3500.Ar sha256 . 3421.Cm sha256
3501If not present, SHA256 is used. 3422(the default).
3502This option can be overridden on the command line. 3423It can be overridden on the command line.
3503.It Ar distinguished_name 3424.It Cm distinguished_name
3504This specifies the section containing the distinguished name fields to 3425The section containing the distinguished name fields to
3505prompt for when generating a certificate or certificate request. 3426prompt for when generating a certificate or certificate request.
3506The format is described in the next section. 3427The format is described below.
3507.It Ar encrypt_key 3428.It Cm encrypt_key
3508If this is set to 3429If set to
3509.Em no 3430.Qq no
3510and a private key is generated, it is 3431and a private key is generated, it is not encrypted.
3511.Em not 3432It is equivalent to the
3512encrypted.
3513This is equivalent to the
3514.Fl nodes 3433.Fl nodes
3515command line option. 3434option.
3516For compatibility, 3435For compatibility,
3517.Ar encrypt_rsa_key 3436.Cm encrypt_rsa_key
3518is an equivalent option. 3437is an equivalent option.
3519.It Ar input_password | output_password 3438.It Cm input_password | output_password
3520The passwords for the input private key file 3439The passwords for the input private key file (if present)
3521.Pq if present 3440and the output private key file (if one will be created).
3522and the output private key file
3523.Pq if one will be created .
3524The command line options 3441The command line options
3525.Fl passin 3442.Fl passin
3526and 3443and
3527.Fl passout 3444.Fl passout
3528override the configuration file values. 3445override the configuration file values.
3529.It Ar oid_file 3446.It Cm oid_file
3530This specifies a file containing additional OBJECT IDENTIFIERS. 3447A file containing additional OBJECT IDENTIFIERS.
3531Each line of the file should consist of the numerical form of the 3448Each line of the file should consist of the numerical form of the
3532object identifier, followed by whitespace, then the short name followed 3449object identifier, followed by whitespace, then the short name followed
3533by whitespace and finally the long name. 3450by whitespace and finally the long name.
3534.It Ar oid_section 3451.It Cm oid_section
3535This specifies a section in the configuration file containing extra 3452Specify a section in the configuration file containing extra
3536object identifiers. 3453object identifiers.
3537Each line should consist of the short name of the 3454Each line should consist of the short name of the
3538object identifier followed by 3455object identifier followed by
3539.Sq = 3456.Sq =
3540and the numerical form. 3457and the numerical form.
3541The short and long names are the same when this option is used. 3458The short and long names are the same when this option is used.
3542.It Ar prompt 3459.It Cm prompt
3543If set to the value 3460If set to
3544.Em no , 3461.Qq no ,
3545this disables prompting of certificate fields 3462it disables prompting of certificate fields
3546and just takes values from the config file directly. 3463and just takes values from the config file directly.
3547It also changes the expected format of the 3464It also changes the expected format of the
3548.Em distinguished_name 3465.Cm distinguished_name
3549and 3466and
3550.Em attributes 3467.Cm attributes
3551sections. 3468sections.
3552.It Ar req_extensions 3469.It Cm req_extensions
3553This specifies the configuration file section containing a list of 3470The configuration file section containing a list of
3554extensions to add to the certificate request. 3471extensions to add to the certificate request.
3555It can be overridden by the 3472It can be overridden by the
3556.Fl reqexts 3473.Fl reqexts
3557command line switch. 3474option.
3558.It Ar string_mask 3475.It Cm string_mask
3559This option limits the string types for encoding certain 3476Limit the string types for encoding certain fields.
3560fields.
3561The following values may be used, limiting strings to the indicated types: 3477The following values may be used, limiting strings to the indicated types:
3562.Bl -tag -width "MASK:number" 3478.Bl -tag -width "MASK:number"
3563.It Ar utf8only 3479.It Cm utf8only
3564.Em UTF8String. 3480UTF8String.
3565This is the default, as recommended by PKIX in RFC 2459. 3481This is the default, as recommended by PKIX in RFC 2459.
3566.It Ar default 3482.It Cm default
3567.Em PrintableString , IA5String , T61String , BMPString , UTF8String . 3483PrintableString, IA5String, T61String, BMPString, UTF8String.
3568.It Ar pkix 3484.It Cm pkix
3569.Em PrintableString , IA5String , BMPString , UTF8String . 3485PrintableString, IA5String, BMPString, UTF8String.
3570This was inspired by the PKIX recommendation in RFC 2459 for certificates 3486Inspired by the PKIX recommendation in RFC 2459 for certificates
3571generated before 2004, but differs by also permitting 3487generated before 2004, but differs by also permitting IA5String.
3572.Em IA5String . 3488.It Cm nombstr
3573.It Ar nombstr 3489PrintableString, IA5String, T61String, UniversalString.
3574.Em PrintableString , IA5String , T61String , UniversalString . 3490A workaround for some ancient software that had problems
3575This was a workaround for some ancient software that had problems 3491with the variable-sized BMPString and UTF8String types.
3576with the variable-sized
3577.Em BMPString
3578and
3579.Em UTF8String
3580types.
3581.It Cm MASK : Ns Ar number 3492.It Cm MASK : Ns Ar number
3582This is an explicit bitmask of permitted types, where 3493An explicit bitmask of permitted types, where
3583.Ar number 3494.Ar number
3584is a C-style hex, decimal, or octal number that's a bit-wise OR of 3495is a C-style hex, decimal, or octal number that's a bit-wise OR of
3585.Dv B_ASN1_* 3496.Dv B_ASN1_*
3586values from 3497values from
3587.In openssl/asn1.h . 3498.In openssl/asn1.h .
3588.El 3499.El
3589.It Ar utf8 3500.It Cm utf8
3590If set to the value 3501If set to
3591.Em yes , 3502.Qq yes ,
3592then field values are interpreted as UTF8 strings; 3503field values are interpreted as UTF8 strings, not ASCII.
3593by default they are interpreted as ASCII. 3504.It Cm x509_extensions
3594This means that the field values, whether prompted from a terminal or 3505The configuration file section containing a list of
3595obtained from a configuration file, must be valid UTF8 strings.
3596.It Ar x509_extensions
3597This specifies the configuration file section containing a list of
3598extensions to add to a certificate generated when the 3506extensions to add to a certificate generated when the
3599.Fl x509 3507.Fl x509
3600switch is used. 3508switch is used.
3601It can be overridden by the 3509It can be overridden by the
3602.Fl extensions 3510.Fl extensions
3603command line switch. 3511option.
3604.El 3512.El
3605.Sh REQ DISTINGUISHED NAME AND ATTRIBUTE SECTION FORMAT 3513.Pp
3606There are two separate formats for the distinguished name and attribute 3514There are two separate formats for the distinguished name and attribute
3607sections. 3515sections.
3608If the 3516If the
3609.Fl prompt 3517.Fl prompt
3610option is set to 3518option is set to
3611.Em no , 3519.Qq no ,
3612then these sections just consist of field names and values: for example, 3520the sections consist of just field names and values,
3613.Bd -unfilled -offset indent 3521which allows external programs to generate a template file
3614CN=My Name 3522with all the field names and values and just pass it to
3615OU=My Organization
3616emailAddress=someone@somewhere.org
3617.Ed
3618.Pp
3619This allows external programs
3620.Pq e.g. GUI based
3621to generate a template file with all the field names and values
3622and just pass it to
3623.Nm req . 3523.Nm req .
3624An example of this kind of configuration file is contained in the
3625.Sx REQ EXAMPLES
3626section.
3627.Pp 3524.Pp
3628Alternatively if the 3525Alternatively if the
3629.Fl prompt 3526.Fl prompt
3630option is absent or not set to 3527option is absent or not set to
3631.Em no , 3528.Qq no ,
3632then the file contains field prompting information. 3529then the file contains field prompting information.
3633It consists of lines of the form: 3530It consists of lines of the form:
3634.Bd -unfilled -offset indent 3531.Bd -unfilled -offset indent
@@ -3640,8 +3537,8 @@ fieldName_max= 4
3640.Pp 3537.Pp
3641.Qq fieldName 3538.Qq fieldName
3642is the field name being used, for example 3539is the field name being used, for example
3643.Em commonName 3540.Cm commonName
3644.Pq or CN . 3541(or CN).
3645The 3542The
3646.Qq prompt 3543.Qq prompt
3647string is used to ask the user to enter the relevant details. 3544string is used to ask the user to enter the relevant details.
@@ -3653,197 +3550,72 @@ if the user just enters the
3653character. 3550character.
3654.Pp 3551.Pp
3655The number of characters entered must be between the 3552The number of characters entered must be between the
3656.Em fieldName_min 3553fieldName_min and fieldName_max limits:
3657and
3658.Em fieldName_max
3659limits:
3660there may be additional restrictions based on the field being used 3554there may be additional restrictions based on the field being used
3661(for example 3555(for example
3662.Em countryName 3556.Cm countryName
3663can only ever be two characters long and must fit in a 3557can only ever be two characters long and must fit in a
3664.Em PrintableString ) . 3558.Cm PrintableString ) .
3665.Pp 3559.Pp
3666Some fields (such as 3560Some fields (such as
3667.Em organizationName ) 3561.Cm organizationName )
3668can be used more than once in a DN. 3562can be used more than once in a DN.
3669This presents a problem because configuration files will 3563This presents a problem because configuration files will
3670not recognize the same name occurring twice. 3564not recognize the same name occurring twice.
3671To avoid this problem, if the 3565To avoid this problem, if the
3672.Em fieldName 3566.Cm fieldName
3673contains some characters followed by a full stop, they will be ignored. 3567contains some characters followed by a full stop, they will be ignored.
3674So, for example, a second 3568So, for example, a second
3675.Em organizationName 3569.Cm organizationName
3676can be input by calling it 3570can be input by calling it
3677.Qq 1.organizationName . 3571.Qq 1.organizationName .
3678.Pp 3572.Pp
3679The actual permitted field names are any object identifier short or 3573The actual permitted field names are any object identifier short or
3680long names. 3574long names.
3681These are compiled into 3575These are compiled into
3682.Nm OpenSSL 3576.Nm openssl
3683and include the usual values such as 3577and include the usual values such as
3684.Em commonName , countryName , localityName , organizationName , 3578.Cm commonName , countryName , localityName , organizationName ,
3685.Em organizationUnitName , stateOrProvinceName . 3579.Cm organizationUnitName , stateOrProvinceName .
3686Additionally, 3580Additionally,
3687.Em emailAddress 3581.Cm emailAddress
3688is included as well as 3582is included as well as
3689.Em name , surname , givenName initials 3583.Cm name , surname , givenName , initials
3690and 3584and
3691.Em dnQualifier . 3585.Cm dnQualifier .
3692.Pp 3586.Pp
3693Additional object identifiers can be defined with the 3587Additional object identifiers can be defined with the
3694.Ar oid_file 3588.Cm oid_file
3695or 3589or
3696.Ar oid_section 3590.Cm oid_section
3697options in the configuration file. 3591options in the configuration file.
3698Any additional fields will be treated as though they were a 3592Any additional fields will be treated as though they were a
3699.Em DirectoryString . 3593.Cm DirectoryString .
3700.Sh REQ EXAMPLES
3701Examine and verify a certificate request:
3702.Pp
3703.Dl $ openssl req -in req.pem -text -verify -noout
3704.Pp
3705Create a private key and then generate a certificate request from it:
3706.Bd -literal -offset indent
3707$ openssl genrsa -out key.pem 2048
3708$ openssl req -new -key key.pem -out req.pem
3709.Ed
3710.Pp
3711The same but just using req:
3712.Pp
3713.Dl $ openssl req -newkey rsa:2048 -keyout key.pem -out req.pem
3714.Pp
3715Generate a self-signed root certificate:
3716.Pp
3717.Dl "$ openssl req -x509 -newkey rsa:2048 -keyout key.pem -out req.pem"
3718.Pp
3719Example of a file pointed to by the
3720.Ar oid_file
3721option:
3722.Bd -unfilled -offset indent
37231.2.3.4 shortName A longer Name
37241.2.3.6 otherName Other longer Name
3725.Ed
3726.Pp
3727Example of a section pointed to by
3728.Ar oid_section
3729making use of variable expansion:
3730.Bd -unfilled -offset indent
3731testoid1=1.2.3.5
3732testoid2=${testoid1}.6
3733.Ed
3734.Pp 3594.Pp
3735Sample configuration file prompting for field values:
3736.Bd -literal
3737\& [ req ]
3738\& default_bits = 1024
3739\& default_keyfile = privkey.pem
3740\& distinguished_name = req_distinguished_name
3741\& attributes = req_attributes
3742\& x509_extensions = v3_ca
3743
3744\& dirstring_type = nobmp
3745
3746\& [ req_distinguished_name ]
3747\& countryName = Country Name (2 letter code)
3748\& countryName_default = AU
3749\& countryName_min = 2
3750\& countryName_max = 2
3751
3752\& localityName = Locality Name (eg, city)
3753
3754\& organizationalUnitName = Organizational Unit Name (eg, section)
3755
3756\& commonName = Common Name (eg, YOUR name)
3757\& commonName_max = 64
3758
3759\& emailAddress = Email Address
3760\& emailAddress_max = 40
3761
3762\& [ req_attributes ]
3763\& challengePassword = A challenge password
3764\& challengePassword_min = 4
3765\& challengePassword_max = 20
3766
3767\& [ v3_ca ]
3768
3769\& subjectKeyIdentifier=hash
3770\& authorityKeyIdentifier=keyid:always,issuer:always
3771\& basicConstraints = CA:true
3772.Ed
3773.Pp
3774Sample configuration containing all field values:
3775.Bd -literal
3776
3777\& [ req ]
3778\& default_bits = 1024
3779\& default_keyfile = keyfile.pem
3780\& distinguished_name = req_distinguished_name
3781\& attributes = req_attributes
3782\& prompt = no
3783\& output_password = mypass
3784
3785\& [ req_distinguished_name ]
3786\& C = GB
3787\& ST = Test State or Province
3788\& L = Test Locality
3789\& O = Organization Name
3790\& OU = Organizational Unit Name
3791\& CN = Common Name
3792\& emailAddress = test@email.address
3793
3794\& [ req_attributes ]
3795\& challengePassword = A challenge password
3796.Ed
3797.Sh REQ NOTES
3798The header and footer lines in the PEM format are normally: 3595The header and footer lines in the PEM format are normally:
3799.Bd -unfilled -offset indent 3596.Bd -unfilled -offset indent
3800-----BEGIN CERTIFICATE REQUEST----- 3597-----BEGIN CERTIFICATE REQUEST-----
3801-----END CERTIFICATE REQUEST----- 3598-----END CERTIFICATE REQUEST-----
3802.Ed 3599.Ed
3803.Pp 3600.Pp
3804Some software 3601Some software instead needs:
3805.Pq some versions of Netscape certificate server
3806instead needs:
3807.Bd -unfilled -offset indent 3602.Bd -unfilled -offset indent
3808-----BEGIN NEW CERTIFICATE REQUEST----- 3603-----BEGIN NEW CERTIFICATE REQUEST-----
3809-----END NEW CERTIFICATE REQUEST----- 3604-----END NEW CERTIFICATE REQUEST-----
3810.Ed 3605.Ed
3811.Pp 3606.Pp
3812which is produced with the
3813.Fl newhdr
3814option but is otherwise compatible.
3815Either form is accepted transparently on input.
3816.Pp
3817The certificate requests generated by Xenroll with MSIE have extensions added.
3818It includes the
3819.Em keyUsage
3820extension which determines the type of key
3821.Pq signature only or general purpose
3822and any additional OIDs entered by the script in an
3823.Em extendedKeyUsage
3824extension.
3825.Sh REQ DIAGNOSTICS
3826The following messages are frequently asked about: 3607The following messages are frequently asked about:
3827.Bd -unfilled -offset indent 3608.Bd -unfilled -offset indent
3828Using configuration from /some/path/openssl.cnf 3609Using configuration from /some/path/openssl.cnf
3829Unable to load config info 3610Unable to load config info
3830.Ed 3611\&...
3831.Pp
3832This is followed some time later by...
3833.Bd -unfilled -offset indent
3834unable to find 'distinguished_name' in config 3612unable to find 'distinguished_name' in config
3835problems making Certificate Request 3613problems making Certificate Request
3836.Ed 3614.Ed
3837.Pp 3615.Pp
3838The first error message is the clue: it can't find the configuration 3616In this case it can't find the configuration file!
3839file!
3840Certain operations
3841.Pq like examining a certificate request
3842don't need a configuration file so its use isn't enforced.
3843Generation of certificates or requests, however, do need a configuration file.
3844This could be regarded as a bug.
3845.Pp 3617.Pp
3846Another puzzling message is this: 3618Another puzzling message is:
3847.Bd -unfilled -offset indent 3619.Bd -unfilled -offset indent
3848Attributes: 3620Attributes:
3849 a0:00 3621 a0:00
@@ -3851,51 +3623,16 @@ Attributes:
3851.Pp 3623.Pp
3852This is displayed when no attributes are present and the request includes 3624This is displayed when no attributes are present and the request includes
3853the correct empty SET OF structure 3625the correct empty SET OF structure
3854.Pq the DER encoding of which is 0xa0 0x00 . 3626(the DER encoding of which is 0xa0 0x00).
3855If you just see: 3627If the message is instead:
3856.Pp 3628.Pp
3857.D1 Attributes: 3629.D1 Attributes:
3858.Pp 3630.Pp
3859then the SET OF is missing and the encoding is technically invalid 3631then the SET OF is missing and the encoding is technically invalid
3860.Pq but it is tolerated . 3632(but it is tolerated).
3861See the description of the command line option 3633See the description
3862.Fl asn1-kludge 3634.Fl asn1-kludge
3863for more information. 3635for more information.
3864.Sh REQ ENVIRONMENT VARIABLES
3865The variable
3866.Ev OPENSSL_CONF ,
3867if defined, allows an alternative configuration
3868file location to be specified; it will be overridden by the
3869.Fl config
3870command line switch if it is present.
3871.Sh REQ BUGS
3872.Nm OpenSSL Ns Li 's
3873handling of T61Strings
3874.Pq aka TeletexStrings
3875is broken: it effectively treats them as ISO 8859-1
3876.Pq Latin 1 ;
3877Netscape and MSIE have similar behaviour.
3878This can cause problems if you need characters that aren't available in
3879.Em PrintableStrings
3880and you don't want to or can't use
3881.Em BMPStrings .
3882.Pp
3883As a consequence of the T61String handling, the only correct way to represent
3884accented characters in
3885.Nm OpenSSL
3886is to use a
3887.Em BMPString :
3888unfortunately Netscape currently chokes on these.
3889If you have to use accented characters with Netscape
3890and MSIE then you currently need to use the invalid T61String form.
3891.Pp
3892The current prompting is not very friendly.
3893It doesn't allow you to confirm what you've just entered.
3894Other things, like extensions in certificate requests, are
3895statically defined in the configuration file.
3896Some of these, like an email address in
3897.Em subjectAltName ,
3898should be input by the user.
3899.\" 3636.\"
3900.\" RSA 3637.\" RSA
3901.\" 3638.\"