Generate encryption keys for dacs
dacskey [\m[blue]dacsoptions\m[]\s-2\u[1]\d\s+2]
[-check | -gen | -priv | -private | -pub | -public]
[-p | -pf passphrase-file] [-pem] [-vfs] [-rsa_key_bits number] [--] keyfile
This program is part of the DACS suite.
The dacskey utility generates encryption keys for DACS that are cryptographically sound. Keys are represented externally as an XML document called a keyfile. The program can also validate a keyfile or display a key.
Keys are created for at least three different purposes, although every keyfile has the same format:
Keys that are shared by all of the jurisdictions within the same DACS federation, identified by the virtual filestore item type federation_keys. It is through these "master" keys that any jurisdiction is able to decrypt and validate credentials created by any other jurisdiction within the same federation quickly and without any additional communication. These keys are generated initially by a designated federation administrator at the time a federation is created. These keys can be generated at any jurisdiction within the federation.
Ideally, new keys should be generated at regular intervals and also whenever warranted to maintain security, such as when a jurisdiction leaves the federation or if a key may have been compromised. When a jurisdiction joins a federation, it must receive a copy of the current keys. There is currently no automated key management support; administrators must distribute these keys to all jurisdictions over a secure channel whenever they are changed. Besides using some method of encryption to ensure the keys remain private during distribution, take care not to mangle the XML document (e.g., through line breaks or truncation).
Keys that are used by a jurisdiction for its own purposes, identified by the virtual filestore item type jurisdiction_keys. These keys are kept private to the jurisdiction (they are not shared with any other jurisdiction) and are ordinarily generated at that jurisdiction. These keys should be regenerated periodically as a routine security measure.
Keys that are used by a DACS application at a particular jurisdiction for its own purposes (\m[blue]dacsgrid(1)\m[]\s-2\u[2]\d\s+2, for instance). These keys should be regenerated periodically, but take care to retain the old keys so that they can be used for decryption before information is re-encrypted using the new keys.
The program ordinarily uses OpenSSL's \m[blue]ssl(3)\m[]\s-2\u[3]\d\s+2 library to acquire high-quality random material. In certain situations, an experienced administrator might find the -p and -pf options useful; others should avoid them, however.
When keys are generated, the output is written to keyfile, which is either created or truncated. In this context, keyfile must be a pathname. Unless directly written to where federation_keys (or jurisdiction_keys) points, keyfile must be copied there.
Assuming that the default site configuration file (conf/site.conf-std, which establishes default locations for these files) has been installed:
% dacskey -u mysite.example.com -q fkeys % install -o root -g www -m 0640 fkeys \ /usr/local/dacs/federations/example.com/federation_keyfile % dacskey -u mysite.example.com -q jkeys % install -o root -g www -m 0640 jkeys \ /usr/local/dacs/federations/example.com/mysite/jurisdiction_keyfile
The owner, group, and mode assigned to these files in this example are typical but are only suggestions.
Security
A keyfile generated by this command must be accessible (readable and writable) only by DACS web services and the DACS administrator. It must be kept unreadable and unwritable by all others.
When not generating keys, by default keyfile is a pathname. If the -vfs flag is given, then keyfile is a DACS URI, item type, or absolute pathname.
In addition to the standard \m[blue]dacsoptions\m[]\s-2\u[1]\d\s+2, dacskey recognizes these options:
-gen
Generate new keys. This is the default operation.
-check
Validate keyfile, an existing keyfile. The keyfile is expressed as a vfs-ref or an absolute filename (see \m[blue]dacs.conf(5)\m[]\s-2\u[4]\d\s+2).
-priv
-private
Print the private key found in keyfile, an existing keyfile, to stdout. The private key is not encrypted. If the -pem flag is present, the PEM format is used, otherwise the DACS base-64 encoding is used (the latter is used when keys appear in XML attribute values).
-pub
-public
Print the public key found in keyfile, an existing keyfile, to stdout. If the -pem flag is present, the PEM format is used, otherwise the DACS base-64 encoding is used (the latter is used when keys appear in XML attribute values).
-p
Rather than using the default source for generating random strings, derive the random strings from material read from the standard input. The user is prompted for input. This option should not be used under normal circumstances.
-pem
When printing a key, use the PEM format.
-pf passphrase-file
Rather than using the default source for generating random strings, derive the random strings from material read from passphrase-file. If the filename argument is "-", the standard input is read. This option should not be used under normal circumstances.
-rsa_key_bits number
This specifies the length of the RSA modulus, in bits, used for asymmetric key generation. Used as the num argument to \m[blue]RSA_generate_key(3)\m[]\s-2\u[5]\d\s+2, the value must satisfy that function's constraints.
--
This argument explicitly marks the end of the flags.
The program exits 0 if everything was fine, 1 if an error occurred.
\m[blue]dacsauth(1)\m[]\s-2\u[6]\d\s+2, \m[blue]dacsgrid(1)\m[]\s-2\u[2]\d\s+2, \m[blue]dacsinit(1)\m[]\s-2\u[7]\d\s+2, \m[blue]dacsrlink(1)\m[]\s-2\u[8]\d\s+2\m[blue]dacstoken(1)\m[]\s-2\u[9]\d\s+2, \m[blue]dacs.install(7)\m[]\s-2\u[10]\d\s+2, \m[blue]dacs_acs(8)\m[]\s-2\u[11]\d\s+2
Distributed Systems Software (\m[blue]www.dss.ca\m[]\s-2\u[12]\d\s+2)
Copyright2003-2013 Distributed Systems Software. See the \m[blue]LICENSE\m[]\s-2\u[13]\d\s+2 file that accompanies the distribution for licensing information.
dacsoptions
http://dacs.dss.ca/man/dacs.1.html#dacsoptions
http://dacs.dss.ca/man/dacsgrid.1.html
ssl(3)
http://www.freebsd.org/cgi/man.cgi?query=ssl&apropos=0&sektion=3&manpath=FreeBSD+9.1-RELEASE&format=html
dacs.conf(5)
http://dacs.dss.ca/man/dacs.conf.5.html#VFS
RSA_generate_key(3)
http://www.freebsd.org/cgi/man.cgi?query=RSA_generate_key&apropos=0&sektion=3&manpath=FreeBSD+9.1-RELEASE&format=html
http://dacs.dss.ca/man/dacsauth.1.html
http://dacs.dss.ca/man/dacsinit.1.html
http://dacs.dss.ca/man/dacsrlink.1.html
http://dacs.dss.ca/man/dacstoken.1.html
http://dacs.dss.ca/man/dacs.install.7.html
http://dacs.dss.ca/man/dacs_acs.8.html
www.dss.ca
http://www.dss.ca
LICENSE
http://dacs.dss.ca/man/../misc/LICENSE