Liking cljdoc? Tell your friends :D

clj-pgp.generate

This namespace provides functionality to generate PGP keypairs and keyrings using a convenient macro syntax.

The two primary supported key types are RSA keys (via rsa-keypair-generator) and Elliptic Curve keys (via ec-keypair-generator). A set of the supported named curves can be found in elliptic-curve-names.

To generate PGP keyrings with designater master keys and subkeys with specific roles and restrictions, use the generate-keys macro. This returns a map with :public and :secret entries containing the respective keyrings.

This namespace provides functionality to generate PGP keypairs and keyrings
using a convenient macro syntax.

The two primary supported key types are RSA keys (via `rsa-keypair-generator`)
and Elliptic Curve keys (via `ec-keypair-generator`). A set of the supported
named curves can be found in `elliptic-curve-names`.

To generate PGP keyrings with designater master keys and subkeys with specific
roles and restrictions, use the `generate-keys` macro. This returns a map with
`:public` and `:secret` entries containing the respective keyrings.
raw docstring

add-subkey!clj

(add-subkey! generator subkey sig-gen)

Adds a subkey and signature packet to a keyring genrator.

Adds a subkey and signature packet to a keyring genrator.
sourceraw docstring

ec-keypair-generatorclj

(ec-keypair-generator curve & opts)

Constructs a new generator for keypairs on the named elliptic curve.

Opts may include:

  • :random a custom random number generator
Constructs a new generator for keypairs on the named elliptic curve.

Opts may include:

- `:random` a custom random number generator
sourceraw docstring

elliptic-curve-namesclj

Set of supported elliptic curves.

Set of supported elliptic curves.
sourceraw docstring

generate-keypairclj

(generate-keypair generator algorithm)

Builds a new PGP keypair from a generator.

Builds a new PGP keypair from a generator.
sourceraw docstring

generate-keyringsclj

(generate-keyrings keyring-gen)

Generates both the public and secret keyrings from the given generator.

Generates both the public and secret keyrings from the given generator.
sourceraw docstring

generate-keyscljmacro

(generate-keys user-id passphrase & key-specs)

Macro to generate keys with a mini-language to specify preferences and subkeys.

An example invocation that creates a master key with signing and encryption subkeys:

(pgp-gen/generate-keys
  "test user" "test passphrase"
  (master-key
    (keypair rsa :rsa-general)
    (prefer-symmetric :aes-256 :aes-128)
    (prefer-hash :sha512 :sha256 :sha1)
    (prefer-compression :zlib :bzip2))
  (signing-key
    (keypair rsa :rsa-general)
    (expires 36000))
  (encryption-key
    (keypair rsa :rsa-general)))
Macro to generate keys with a mini-language to specify preferences and
subkeys.

An example invocation that creates a master key with signing and encryption
subkeys:

```
(pgp-gen/generate-keys
  "test user" "test passphrase"
  (master-key
    (keypair rsa :rsa-general)
    (prefer-symmetric :aes-256 :aes-128)
    (prefer-hash :sha512 :sha256 :sha1)
    (prefer-compression :zlib :bzip2))
  (signing-key
    (keypair rsa :rsa-general)
    (expires 36000))
  (encryption-key
    (keypair rsa :rsa-general)))
```
sourceraw docstring

keyring-generatorclj

(keyring-generator user-id passphrase master-key master-sig-gen)

Constructs a new generator for a keyring for a user-id, encrypted with the given passphrase. The provided keypair will become the master key with any options specified in the signature subpacket.

Constructs a new generator for a keyring for a user-id, encrypted with the
given passphrase. The provided keypair will become the master key with any
options specified in the signature subpacket.
sourceraw docstring

prefer-compression-algorithms!clj

(prefer-compression-algorithms! generator__5866__auto__
                                &
                                algorithms__5867__auto__)

Sets the list of preferred algorithms on a signature generator for use when sending messages to the key.

Sets the list of preferred algorithms on a signature generator for
use when sending messages to the key.
sourceraw docstring

prefer-hash-algorithms!clj

(prefer-hash-algorithms! generator__5866__auto__ & algorithms__5867__auto__)

Sets the list of preferred algorithms on a signature generator for use when sending messages to the key.

Sets the list of preferred algorithms on a signature generator for
use when sending messages to the key.
sourceraw docstring

prefer-symmetric-algorithms!clj

(prefer-symmetric-algorithms! generator__5866__auto__
                              &
                              algorithms__5867__auto__)

Sets the list of preferred algorithms on a signature generator for use when sending messages to the key.

Sets the list of preferred algorithms on a signature generator for
use when sending messages to the key.
sourceraw docstring

rsa-keypair-generatorclj

(rsa-keypair-generator strength & opts)

Constructs a new generator for RSA keypairs with the given bit strength. Other parameters may be customized with keyword options.

Opts may include:

  • :random a custom random number generator
  • :exponent RSA algorithm public exponent
  • :certainty threshold for probabilistic prime generation
Constructs a new generator for RSA keypairs with the given bit strength.
Other parameters may be customized with keyword options.

Opts may include:

- `:random` a custom random number generator
- `:exponent` RSA algorithm public exponent
- `:certainty` threshold for probabilistic prime generation
sourceraw docstring

set-key-expiration!clj

(set-key-expiration! generator lifetime)

Sets a key expiration time on a signature generator. The lifetime is expressed as a number of seconds since the key creation time.

Sets a key expiration time on a signature generator. The lifetime is
expressed as a number of seconds since the key creation time.
sourceraw docstring

signature-generatorclj

(signature-generator mode)

Constructs a signature subpacket generator with a preset mode. This can be one of :master, :signing, or :encryption.

Constructs a signature subpacket generator with a preset mode. This can be
one of `:master`, `:signing`, or `:encryption`.
sourceraw docstring

signature-subpacket-generatorclj

(signature-subpacket-generator & flags)

Constructs a new generator for key signature subpackets. The given flags will be applied to the key.

Constructs a new generator for key signature subpackets. The given flags
will be applied to the key.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close