summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjmc <>2004-02-18 21:06:40 +0000
committerjmc <>2004-02-18 21:06:40 +0000
commit27f1f59dd87005608f656e5d9a2115472545c8a4 (patch)
treee0dc10d717bfd4a8c4894f66123c752f232a41ed
parent0e9a672f0ef59215a3c880a7c883953f7a3dfad2 (diff)
downloadopenbsd-27f1f59dd87005608f656e5d9a2115472545c8a4.tar.gz
openbsd-27f1f59dd87005608f656e5d9a2115472545c8a4.tar.bz2
openbsd-27f1f59dd87005608f656e5d9a2115472545c8a4.zip
clean up openssl req;
-rw-r--r--src/usr.sbin/openssl/openssl.1495
1 files changed, 247 insertions, 248 deletions
diff --git a/src/usr.sbin/openssl/openssl.1 b/src/usr.sbin/openssl/openssl.1
index d728e90e5d..a181d5f8bb 100644
--- a/src/usr.sbin/openssl/openssl.1
+++ b/src/usr.sbin/openssl/openssl.1
@@ -1,4 +1,4 @@
1.\" $OpenBSD: openssl.1,v 1.35 2004/02/06 13:28:15 jmc Exp $ 1.\" $OpenBSD: openssl.1,v 1.36 2004/02/18 21:06:40 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.\"
@@ -4282,49 +4282,50 @@ Multiple files can be specified separated by a
4282.Sh REQ 4282.Sh REQ
4283.Nm openssl req 4283.Nm openssl req
4284.Bk -words 4284.Bk -words
4285.Op Fl inform Ar DER | PEM 4285.Op Fl asn1-kludge
4286.Op Fl outform Ar DER | PEM 4286.Op Fl batch
4287.Op Fl in Ar file 4287.Op Fl md2 | md4 | md5 | sha1
4288.Op Fl passin Ar arg
4289.Op Fl out Ar file
4290.Op Fl passout Ar arg
4291.Op Fl text
4292.Op Fl pubkey
4293.Op Fl noout
4294.Op Fl verify
4295.Op Fl modulus 4288.Op Fl modulus
4296.Op Fl new 4289.Op Fl new
4297.Op Fl rand Ar file ... 4290.Op Fl newhdr
4291.Op Fl nodes
4292.Op Fl noout
4293.Op Fl pubkey
4294.Op Fl subject
4295.Op Fl text
4296.Op Fl utf8
4297.Op Fl verbose
4298.Op Fl verify
4299.Op Fl x509
4300.Op Fl config Ar file
4301.Op Fl days Ar n
4302.Op Fl engine Ar id
4303.Op Fl extensions Ar section
4304.Op Fl in Ar file
4305.Op Fl inform Ar DER | PEM
4306.Op Fl key Ar file
4307.Op Fl keyform Ar DER | PEM
4308.Op Fl keyout Ar file
4309.Op Fl nameopt Ar option
4298.Oo Xo 4310.Oo Xo
4299.Fl newkey 4311.Fl newkey
4300.Ar rsa : Ns Ar bits 4312.Ar dsa : Ns Ar file
4301.Xc 4313.Xc
4302.Oc 4314.Oc
4303.Oo Xo 4315.Oo Xo
4304.Fl newkey 4316.Fl newkey
4305.Ar dsa : Ns Ar file 4317.Ar rsa : Ns Ar bits
4306.Xc 4318.Xc
4307.Oc 4319.Oc
4308.Op Fl nodes 4320.Op Fl out Ar file
4309.Op Fl subject 4321.Op Fl outform Ar DER | PEM
4310.Op Fl key Ar file 4322.Op Fl passin Ar arg
4311.Op Fl keyform Ar DER | PEM 4323.Op Fl passout Ar arg
4312.Op Fl keyout Ar file 4324.Op Fl rand Ar file ...
4313.Op Fl md5 | sha1 | md2 | md4
4314.Op Fl config Ar file
4315.Op Fl subj Ar arg
4316.Op Fl x509
4317.Op Fl days Ar n
4318.Op Fl set_serial Ar n
4319.Op Fl asn1-kludge
4320.Op Fl newhdr
4321.Op Fl extensions Ar section
4322.Op Fl reqexts Ar section 4325.Op Fl reqexts Ar section
4323.Op Fl utf8 4326.Op Fl reqopt Ar option
4324.Op Fl nameopt 4327.Op Fl set_serial Ar n
4325.Op Fl batch 4328.Op Fl subj Ar arg
4326.Op Fl verbose
4327.Op Fl engine Ar id
4328.Ek 4329.Ek
4329.Pp 4330.Pp
4330The 4331The
@@ -4336,20 +4337,56 @@ for use as root CAs, for example.
4336.Pp 4337.Pp
4337The options are as follows: 4338The options are as follows:
4338.Bl -tag -width "XXXX" 4339.Bl -tag -width "XXXX"
4339.It Fl inform Ar DER | PEM 4340.It Fl asn1-kludge
4340This specifies the input format. 4341By default, the
4341The 4342.Nm req
4342.Ar DER 4343command outputs certificate requests containing
4343argument uses an ASN1 DER-encoded form compatible with the PKCS#10. 4344no attributes in the correct PKCS#10 format.
4344The 4345However certain CAs will only
4345.Ar PEM 4346accept requests containing no attributes in an invalid form: this
4346form is the default format: 4347option produces this invalid format.
4347it consists of the DER format base64-encoded with additional header and 4348.Pp
4348footer lines. 4349More precisely, the
4349.It Fl outform Ar DER | PEM 4350.Em Attributes
4350This specifies the output format; the options have the same meaning as the 4351in a PKCS#10 certificate request are defined as a SET OF Attribute.
4351.Fl inform 4352They are
4352option. 4353.Em not
4354optional, so if no attributes are present then they should be encoded as an
4355empty SET OF.
4356The invalid form does not include the empty
4357SET OF, whereas the correct form does.
4358.Pp
4359It should be noted that very few CAs still require the use of this option.
4360.It Fl batch
4361Non-interactive mode.
4362.It Fl config Ar file
4363This allows an alternative configuration file to be specified;
4364this overrides the compile time filename or any specified in
4365the
4366.Ev OPENSSL_CONF
4367environment variable.
4368.It Fl days Ar n
4369When the
4370.Fl x509
4371option is being used, this specifies the number of
4372days to certify the certificate for.
4373The default is 30 days.
4374.It Fl engine Ar id
4375Specifying an engine (by it's unique
4376.Ar id
4377string) will cause
4378.Nm req
4379to attempt to obtain a functional reference to the specified engine,
4380thus initialising it if needed.
4381The engine will then be set as the default for all available algorithms.
4382.It Fl extensions Ar section , Fl reqexts Ar section
4383These options specify alternative sections to include certificate
4384extensions (if the
4385.Fl x509
4386option is present) or certificate request extensions.
4387This allows several different sections to
4388be used in the same configuration file to specify requests for
4389a variety of purposes.
4353.It Fl in Ar file 4390.It Fl in Ar file
4354This specifies the input 4391This specifies the input
4355.Ar file 4392.Ar file
@@ -4360,35 +4397,47 @@ A request is only read if the creation options
4360and 4397and
4361.Fl newkey 4398.Fl newkey
4362are not specified. 4399are not specified.
4363.It Fl passin Ar arg 4400.It Fl inform Ar DER | PEM
4364The input file password source. 4401This specifies the input format.
4365For more information about the format of 4402The
4366.Ar arg , 4403.Ar DER
4367see the 4404argument uses an ASN1 DER-encoded form compatible with the PKCS#10.
4368.Sx PASS PHRASE ARGUMENTS 4405The
4369section above. 4406.Ar PEM
4370.It Fl out Ar file 4407form is the default format:
4371This specifies the output 4408it consists of the DER format base64-encoded with additional header and
4409footer lines.
4410.It Fl key Ar file
4411This specifies the file to read the private key from.
4412It also accepts PKCS#8 format private keys for PEM format files.
4413.It Fl keyform Ar DER | PEM
4414The format of the private key file specified in the
4415.Fl key
4416argument.
4417.Ar PEM
4418is the default.
4419.It Fl keyout Ar file
4420This gives the
4372.Ar file 4421.Ar file
4373to write to, or standard output by default. 4422to write the newly created private key to.
4374.It Fl passout Ar arg 4423If this option is not specified, then the filename present in the
4375The output file password source. 4424configuration file is used.
4376For more information about the format of 4425.It Fl md2 | md4 | md5 | sha1
4377.Ar arg , 4426This specifies the message digest to sign the request with.
4378see the 4427This overrides the digest algorithm specified in the configuration file.
4379.Sx PASS PHRASE ARGUMENTS 4428This option is ignored for DSA requests: they always use SHA1.
4380section above.
4381.It Fl text
4382Prints out the certificate request in text form.
4383.It Fl pubkey
4384Outputs the public key.
4385.It Fl noout
4386This option prevents output of the encoded version of the request.
4387.It Fl modulus 4429.It Fl modulus
4388This option prints out the value of the modulus of the public key 4430This option prints out the value of the modulus of the public key
4389contained in the request. 4431contained in the request.
4390.It Fl verify 4432.It Fl nameopt Ar option , Fl reqopt Ar option
4391Verifies the signature on the request. 4433These options determine how the subject or issuer names are displayed.
4434The
4435.Ar option
4436argument can be a single option or multiple options separated by commas.
4437Alternatively, these options may be used more than once to set multiple options.
4438See the
4439.Sx X509
4440section below for details.
4392.It Fl new 4441.It Fl new
4393This option generates a new certificate request. 4442This option generates a new certificate request.
4394It will prompt the user for the relevant field values. 4443It will prompt the user for the relevant field values.
@@ -4399,12 +4448,12 @@ If the
4399.Fl key 4448.Fl key
4400option is not used, it will generate a new RSA private 4449option is not used, it will generate a new RSA private
4401key using information specified in the configuration file. 4450key using information specified in the configuration file.
4402.It Fl rand Ar file ... 4451.It Fl newhdr
4403A file or files containing random data used to seed the random number generator, 4452Adds the word NEW to the PEM file header and footer lines
4404or an EGD socket (see 4453on the outputed request.
4405.Xr RAND_egd 3 ) . 4454Some software
4406Multiple files can be specified separated by a 4455.Pq Netscape certificate server
4407.Sq \&: . 4456and some CAs need this.
4408.It Fl newkey Ar arg 4457.It Fl newkey Ar arg
4409This option creates a new certificate request and a new private key. 4458This option creates a new certificate request and a new private key.
4410The argument takes one of two forms: 4459The argument takes one of two forms:
@@ -4417,36 +4466,46 @@ in size.
4417.Ar dsa : Ns Ar file 4466.Ar dsa : Ns Ar file
4418generates a DSA key using the parameters in the file 4467generates a DSA key using the parameters in the file
4419.Ar file . 4468.Ar file .
4420.It Fl key Ar file
4421This specifies the file to read the private key from.
4422It also accepts PKCS#8 format private keys for PEM format files.
4423.It Fl keyform Ar DER | PEM
4424The format of the private key file specified in the
4425.Fl key
4426argument.
4427.Ar PEM
4428is the default.
4429.It Fl keyout Ar file
4430This gives the
4431.Ar file
4432to write the newly created private key to.
4433If this option is not specified, then the filename present in the
4434configuration file is used.
4435.It Fl nodes 4469.It Fl nodes
4436If this option is specified and a private key is created, it 4470If this option is specified and a private key is created, it
4437will not be encrypted. 4471will not be encrypted.
4438.It Fl subject 4472.It Fl noout
4439Output the request's subject. 4473This option prevents output of the encoded version of the request.
4440.It Fl md5 | sha1 | md2 | md4 4474.It Fl out Ar file
4441This specifies the message digest to sign the request with. 4475This specifies the output
4442This overrides the digest algorithm specified in the configuration file. 4476.Ar file
4443This option is ignored for DSA requests: they always use SHA1. 4477to write to, or standard output by default.
4444.It Fl config Ar file 4478.It Fl outform Ar DER | PEM
4445This allows an alternative configuration file to be specified; 4479This specifies the output format; the options have the same meaning as the
4446this overrides the compile time filename or any specified in 4480.Fl inform
4447the 4481option.
4448.Ev OPENSSL_CONF 4482.It Fl passin Ar arg
4449environment variable. 4483The input file password source.
4484For more information about the format of
4485.Ar arg ,
4486see the
4487.Sx PASS PHRASE ARGUMENTS
4488section above.
4489.It Fl passout Ar arg
4490The output file password source.
4491For more information about the format of
4492.Ar arg ,
4493see the
4494.Sx PASS PHRASE ARGUMENTS
4495section above.
4496.It Fl pubkey
4497Outputs the public key.
4498.It Fl rand Ar file ...
4499A file or files containing random data used to seed the random number generator,
4500or an EGD socket (see
4501.Xr RAND_egd 3 ) .
4502Multiple files can be specified separated by a
4503.Sq \&: .
4504.It Fl set_serial Ar n
4505Serial number to use when outputting a self-signed certificate.
4506This may be specified as a decimal value or a hex value if preceded by
4507.Sq 0x .
4508It is possible to use negative serial numbers but this is not recommended.
4450.It Fl subj Ar arg 4509.It Fl subj Ar arg
4451Sets subject name for new request or supersedes the subject name 4510Sets subject name for new request or supersedes the subject name
4452when processing a request. 4511when processing a request.
@@ -4456,6 +4515,19 @@ characters may be escaped by
4456.Sq \e 4515.Sq \e
4457.Pq backslash , 4516.Pq backslash ,
4458no spaces are skipped. 4517no spaces are skipped.
4518.It Fl subject
4519Output the request's subject.
4520.It Fl text
4521Prints out the certificate request in text form.
4522.It Fl utf8
4523This option causes field values to be interpreted as UTF8 strings;
4524by default they are interpreted as ASCII.
4525This means that the field values, whether prompted from a terminal or
4526obtained from a configuration file, must be valid UTF8 strings.
4527.It Fl verbose
4528Print extra details about the operations being performed.
4529.It Fl verify
4530Verifies the signature on the request.
4459.It Fl x509 4531.It Fl x509
4460This option outputs a self-signed certificate instead of a certificate 4532This option outputs a self-signed certificate instead of a certificate
4461request. 4533request.
@@ -4467,79 +4539,6 @@ are specified in the configuration file.
4467Unless specified using the 4539Unless specified using the
4468.Fl set_serial 4540.Fl set_serial
4469option, 0 will be used for the serial number. 4541option, 0 will be used for the serial number.
4470.It Fl days Ar n
4471When the
4472.Fl x509
4473option is being used, this specifies the number of
4474days to certify the certificate for.
4475The default is 30 days.
4476.It Fl set_serial Ar n
4477Serial number to use when outputting a self-signed certificate.
4478This may be specified as a decimal value or a hex value if preceded by
4479.Sq 0x .
4480It is possible to use negative serial numbers but this is not recommended.
4481.It Fl extensions Ar section , Fl reqexts Ar section
4482These options specify alternative sections to include certificate
4483extensions (if the
4484.Fl x509
4485option is present) or certificate request extensions.
4486This allows several different sections to
4487be used in the same configuration file to specify requests for
4488a variety of purposes.
4489.It Fl utf8
4490This option causes field values to be interpreted as UTF8 strings;
4491by default they are interpreted as ASCII.
4492This means that the field values, whether prompted from a terminal or
4493obtained from a configuration file, must be valid UTF8 strings.
4494.It Fl nameopt Ar option
4495Option which determines how the subject or issuer names are displayed.
4496The
4497.Ar option
4498argument can be a single option or multiple options separated by commas.
4499Alternatively, the
4500.Fl nameopt
4501switch may be used more than once to set multiple options.
4502See the
4503.Sx X509
4504section below for details.
4505.It Fl asn1-kludge
4506By default, the
4507.Nm req
4508command outputs certificate requests containing
4509no attributes in the correct PKCS#10 format.
4510However certain CAs will only
4511accept requests containing no attributes in an invalid form: this
4512option produces this invalid format.
4513.Pp
4514More precisely, the
4515.Em Attributes
4516in a PKCS#10 certificate request are defined as a SET OF Attribute.
4517They are
4518.Em not
4519optional, so if no attributes are present then they should be encoded as an
4520empty SET OF.
4521The invalid form does not include the empty
4522SET OF, whereas the correct form does.
4523.Pp
4524It should be noted that very few CAs still require the use of this option.
4525.It Fl newhdr
4526Adds the word NEW to the PEM file header and footer lines
4527on the outputed request.
4528Some software
4529.Pq Netscape certificate server
4530and some CAs need this.
4531.It Fl batch
4532Non-interactive mode.
4533.It Fl verbose
4534Print extra details about the operations being performed.
4535.It Fl engine Ar id
4536Specifying an engine (by it's unique
4537.Ar id
4538string) will cause
4539.Nm req
4540to attempt to obtain a functional reference to the specified engine,
4541thus initialising it if needed.
4542The engine will then be set as the default for all available algorithms.
4543.El 4542.El
4544.Sh REQ CONFIGURATION FILE FORMAT 4543.Sh REQ CONFIGURATION FILE FORMAT
4545The configuration options are specified in the 4544The configuration options are specified in the
@@ -4554,16 +4553,18 @@ section is searched too.
4554.Pp 4553.Pp
4555The options available are described in detail below. 4554The options available are described in detail below.
4556.Bl -tag -width "XXXX" 4555.Bl -tag -width "XXXX"
4557.It Ar input_password | output_password 4556.It Ar attributes
4558The passwords for the input private key file 4557This specifies the section containing any request attributes: its format
4559.Pq if present 4558is the same as
4560and the output private key file 4559.Ar distinguished_name .
4561.Pq if one will be created . 4560Typically these may contain the
4562The command line options 4561.Em challengePassword
4563.Fl passin 4562or
4564and 4563.Em unstructuredName
4565.Fl passout 4564types.
4566override the configuration file values. 4565They are currently ignored by
4566.Nm OpenSSL Ns Li 's
4567request signing utilities, but some CAs might want them.
4567.It Ar default_bits 4568.It Ar default_bits
4568This specifies the default key size in bits. 4569This specifies the default key size in bits.
4569If not specified, then 512 is used. 4570If not specified, then 512 is used.
@@ -4579,6 +4580,40 @@ If not specified, the key is written to standard output.
4579This can be overridden by the 4580This can be overridden by the
4580.Fl keyout 4581.Fl keyout
4581option. 4582option.
4583.It Ar default_md
4584This option specifies the digest algorithm to use.
4585Possible values include
4586.Ar md5
4587and
4588.Ar sha1 .
4589If not present, then MD5 is used.
4590This option can be overridden on the command line.
4591.It Ar distinguished_name
4592This specifies the section containing the distinguished name fields to
4593prompt for when generating a certificate or certificate request.
4594The format is described in the next section.
4595.It Ar encrypt_key
4596If this is set to
4597.Em no
4598and a private key is generated, it is
4599.Em not
4600encrypted.
4601This is equivalent to the
4602.Fl nodes
4603command line option.
4604For compatibility,
4605.Ar encrypt_rsa_key
4606is an equivalent option.
4607.It Ar input_password | output_password
4608The passwords for the input private key file
4609.Pq if present
4610and the output private key file
4611.Pq if one will be created .
4612The command line options
4613.Fl passin
4614and
4615.Fl passout
4616override the configuration file values.
4582.It Ar oid_file 4617.It Ar oid_file
4583This specifies a file containing additional OBJECT IDENTIFIERS. 4618This specifies a file containing additional OBJECT IDENTIFIERS.
4584Each line of the file should consist of the numerical form of the 4619Each line of the file should consist of the numerical form of the
@@ -4592,31 +4627,27 @@ object identifier followed by
4592.Sq = 4627.Sq =
4593and the numerical form. 4628and the numerical form.
4594The short and long names are the same when this option is used. 4629The short and long names are the same when this option is used.
4630.It Ar prompt
4631If set to the value
4632.Em no ,
4633this disables prompting of certificate fields
4634and just takes values from the config file directly.
4635It also changes the expected format of the
4636.Em distinguished_name
4637and
4638.Em attributes
4639sections.
4595.It Ar RANDFILE 4640.It Ar RANDFILE
4596This specifies a file in which random number seed information is 4641This specifies a file in which random number seed information is
4597placed and read from, or an EGD socket (see 4642placed and read from, or an EGD socket (see
4598.Xr RAND_egd 3 ) . 4643.Xr RAND_egd 3 ) .
4599It is used for private key generation. 4644It is used for private key generation.
4600.It Ar encrypt_key 4645.It Ar req_extensions
4601If this is set to 4646This specifies the configuration file section containing a list of
4602.Em no 4647extensions to add to the certificate request.
4603and a private key is generated, it is 4648It can be overridden by the
4604.Em not 4649.Fl reqexts
4605encrypted. 4650command line switch.
4606This is equivalent to the
4607.Fl nodes
4608command line option.
4609For compatibility,
4610.Ar encrypt_rsa_key
4611is an equivalent option.
4612.It Ar default_md
4613This option specifies the digest algorithm to use.
4614Possible values include
4615.Ar md5
4616and
4617.Ar sha1 .
4618If not present, then MD5 is used.
4619This option can be overridden on the command line.
4620.It Ar string_mask 4651.It Ar string_mask
4621This option masks out the use of certain string types in certain 4652This option masks out the use of certain string types in certain
4622fields. 4653fields.
@@ -4652,12 +4683,13 @@ certain software has problems with
4652and 4683and
4653.Em UTF8Strings : 4684.Em UTF8Strings :
4654in particular Netscape. 4685in particular Netscape.
4655.It Ar req_extensions 4686.It Ar utf8
4656This specifies the configuration file section containing a list of 4687If set to the value
4657extensions to add to the certificate request. 4688.Em yes ,
4658It can be overridden by the 4689then field values are interpreted as UTF8 strings;
4659.Fl reqexts 4690by default they are interpreted as ASCII.
4660command line switch. 4691This means that the field values, whether prompted from a terminal or
4692obtained from a configuration file, must be valid UTF8 strings.
4661.It Ar x509_extensions 4693.It Ar x509_extensions
4662This specifies the configuration file section containing a list of 4694This specifies the configuration file section containing a list of
4663extensions to add to a certificate generated when the 4695extensions to add to a certificate generated when the
@@ -4666,39 +4698,6 @@ switch is used.
4666It can be overridden by the 4698It can be overridden by the
4667.Fl extensions 4699.Fl extensions
4668command line switch. 4700command line switch.
4669.It Ar prompt
4670If set to the value
4671.Em no ,
4672this disables prompting of certificate fields
4673and just takes values from the config file directly.
4674It also changes the expected format of the
4675.Em distinguished_name
4676and
4677.Em attributes
4678sections.
4679.It Ar utf8
4680If set to the value
4681.Em yes ,
4682then field values are interpreted as UTF8 strings;
4683by default they are interpreted as ASCII.
4684This means that the field values, whether prompted from a terminal or
4685obtained from a configuration file, must be valid UTF8 strings.
4686.It Ar attributes
4687This specifies the section containing any request attributes: its format
4688is the same as
4689.Ar distinguished_name .
4690Typically these may contain the
4691.Em challengePassword
4692or
4693.Em unstructuredName
4694types.
4695They are currently ignored by
4696.Nm OpenSSL Ns Li 's
4697request signing utilities, but some CAs might want them.
4698.It Ar distinguished_name
4699This specifies the section containing the distinguished name fields to
4700prompt for when generating a certificate or certificate request.
4701The format is described in the next section.
4702.El 4701.El
4703.Sh REQ DISTINGUISHED NAME AND ATTRIBUTE SECTION FORMAT 4702.Sh REQ DISTINGUISHED NAME AND ATTRIBUTE SECTION FORMAT
4704There are two separate formats for the distinguished name and attribute 4703There are two separate formats for the distinguished name and attribute
@@ -4796,7 +4795,7 @@ options in the configuration file.
4796Any additional fields will be treated as though they were a 4795Any additional fields will be treated as though they were a
4797.Em DirectoryString . 4796.Em DirectoryString .
4798.Sh REQ EXAMPLES 4797.Sh REQ EXAMPLES
4799Examine and verify certificate request: 4798Examine and verify a certificate request:
4800.Pp 4799.Pp
4801.Dl $ openssl req -in req.pem -text -verify -noout 4800.Dl $ openssl req -in req.pem -text -verify -noout
4802.Pp 4801.Pp