Liking cljdoc? Tell your friends :D
Clojure only.

puppetlabs.puppetserver.certificate-authority


AccessControlclj

Defines which clients are allowed access to the various CA endpoints. Each endpoint has a sub-section containing the client whitelist. Currently we only control access to the certificate_status(es) endpoints.

Defines which clients are allowed access to the various CA endpoints.
Each endpoint has a sub-section containing the client whitelist.
Currently we only control access to the certificate_status(es) endpoints.
sourceraw docstring

allowed-extension?clj

(allowed-extension? extension)

Inputs: [extension :- Extension]

A predicate that answers if an extension is allowed or not. This logic is copied out of the ruby CA.

Inputs: [extension :- Extension]

A predicate that answers if an extension is allowed or not.
This logic is copied out of the ruby CA.
sourceraw docstring

authorization-extensionsclj

(authorization-extensions cert-or-csr)

Inputs: [cert-or-csr :- CertificateOrCSR] Returns: #:schema{Str schema/Str}

Get the authorization extensions for the certificate or CSR. These are extensions that fall under the ppAuthCert OID arc. Returns a map of OIDS to values.

Inputs: [cert-or-csr :- CertificateOrCSR]
Returns: #:schema{Str schema/Str}

Get the authorization extensions for the certificate or CSR.
These are extensions that fall under the ppAuthCert OID arc.
Returns a map of OIDS to values.
sourceraw docstring

autosign-certificate-request!clj

(autosign-certificate-request! subject
                               csr
                               {:keys [cacert cakey signeddir ca-ttl
                                       allow-auto-renewal auto-renewal-cert-ttl]
                                :as ca-settings}
                               report-activity)

Inputs: [subject :- schema/Str csr :- CertificateRequest {:keys [cacert cakey signeddir ca-ttl allow-auto-renewal auto-renewal-cert-ttl], :as ca-settings} :- CaSettings report-activity]

Given a subject name, their certificate request, and the CA settings from Puppet, auto-sign the request and write the certificate to disk.

Inputs: [subject :- schema/Str csr :- CertificateRequest {:keys [cacert cakey signeddir ca-ttl allow-auto-renewal auto-renewal-cert-ttl], :as ca-settings} :- CaSettings report-activity]

Given a subject name, their certificate request, and the CA settings
from Puppet, auto-sign the request and write the certificate to disk.
sourceraw docstring

autosign-csr?clj

(autosign-csr? autosign subject csr-stream)
(autosign-csr? autosign subject csr-stream ruby-load-path gem-path)

Inputs: ([autosign :- AutoSignInput subject :- schema/Str csr-stream :- InputStream] [autosign :- AutoSignInput subject :- schema/Str csr-stream :- InputStream ruby-load-path :- [schema/Str] gem-path :- schema/Str]) Returns: schema/Bool

Return true if the CSR should be automatically signed given Puppet's autosign setting, and false otherwise.

Inputs: ([autosign :- AutoSignInput subject :- schema/Str csr-stream :- InputStream] [autosign :- AutoSignInput subject :- schema/Str csr-stream :- InputStream ruby-load-path :- [schema/Str] gem-path :- schema/Str])
Returns: schema/Bool

Return true if the CSR should be automatically signed given
Puppet's autosign setting, and false otherwise.
sourceraw docstring

AutoSignInputclj

source

base-16-str->bigintegerclj

(base-16-str->biginteger serial)

Inputs: [serial :- schema/Str] Returns: BigInteger

Given a base-16 string with a leading 0x, return the result as a BigInteger

Inputs: [serial :- schema/Str]
Returns: BigInteger

Given a base-16 string with a leading 0x, return the result as a BigInteger
sourceraw docstring

buffer-copy-sizeclj

source

ca-expiration-datesclj

(ca-expiration-dates ca-cert-file)

Inputs: [ca-cert-file :- schema/Str]

Returns of a map of subject names of certs in the CA bundle to their expiration dates.

Inputs: [ca-cert-file :- schema/Str]

Returns of a map of subject names of certs in the CA bundle
to their expiration dates.
sourceraw docstring

CaSettingsclj

Settings from Puppet that are necessary for CA initialization and request handling during normal Puppet operation. Most of these are Puppet configuration settings.

Settings from Puppet that are necessary for CA initialization
and request handling during normal Puppet operation.
Most of these are Puppet configuration settings.
sourceraw docstring

cert-authority-id-match-ca-subject-id?clj

(cert-authority-id-match-ca-subject-id? incoming-cert ca-cert)

Inputs: [incoming-cert :- X509Certificate ca-cert :- X509Certificate] Returns: schema/Bool

Given a certificate, and the ca-cert, validate that the certificate was signed by the CA provided

Inputs: [incoming-cert :- X509Certificate ca-cert :- X509Certificate]
Returns: schema/Bool

Given a certificate, and the ca-cert, validate that the certificate was signed by the CA provided
sourceraw docstring

cert-validity-datesclj

(cert-validity-dates ca-ttl)

Inputs: [ca-ttl :- schema/Int] Returns: {:not-before Date, :not-after Date}

Calculate the not-before & not-after dates that define a certificate's period of validity. The value of ca-ttl is expected to be in seconds, and the dates will be based on the current time. Returns a map in the form {:not-before Date :not-after Date}.

Inputs: [ca-ttl :- schema/Int]
Returns: {:not-before Date, :not-after Date}

Calculate the not-before & not-after dates that define a certificate's
 period of validity. The value of `ca-ttl` is expected to be in seconds,
 and the dates will be based on the current time. Returns a map in the
 form {:not-before Date :not-after Date}.
sourceraw docstring

Certificateclj

source

certificate-exists?clj

(certificate-exists? {:keys [signeddir]} subject)

Inputs: [{:keys [signeddir]} :- CaSettings subject :- schema/Str] Returns: schema/Bool

Do we have a certificate for the given subject?

Inputs: [{:keys [signeddir]} :- CaSettings subject :- schema/Str]
Returns: schema/Bool

Do we have a certificate for the given subject?
sourceraw docstring

certificate-stateclj

(certificate-state cert-or-csr crl)

Inputs: [cert-or-csr :- CertificateOrCSR crl :- CertificateRevocationList] Returns: CertificateState

Determine the state a certificate is in.

Inputs: [cert-or-csr :- CertificateOrCSR crl :- CertificateRevocationList]
Returns: CertificateState

Determine the state a certificate is in.
sourceraw docstring

CertificateDetailsclj

CA and client certificate details; notAfter, notBefore and serial values.

CA and client certificate details; notAfter, notBefore and serial values.
sourceraw docstring

CertificateOrCSRclj

source

CertificateRequestclj

source

CertificateRevocationListclj

source

CertificateStateclj

The list of states a certificate may be in.

The list of states a certificate may be in.
sourceraw docstring

CertificateStatusResultclj

Various information about the state of a certificate or certificate request that is provided by the certificate status endpoint.

Various information about the state of a certificate or
certificate request that is provided by the certificate
status endpoint.
sourceraw docstring

cli-auth-oidclj

source

config->ca-settingsclj

(config->ca-settings {:keys [puppetserver jruby-puppet certificate-authority
                             authorization]})

Inputs: [{:keys [puppetserver jruby-puppet certificate-authority authorization]}] Returns: CaSettings

Given the configuration map from the Puppet Server config service return a map with of all the CA settings.

Inputs: [{:keys [puppetserver jruby-puppet certificate-authority authorization]}]
Returns: CaSettings

Given the configuration map from the Puppet Server config
 service return a map with of all the CA settings.
sourceraw docstring

config->master-settingsclj

(config->master-settings {:keys [puppetserver]})

Inputs: [{:keys [puppetserver]}] Returns: MasterSettings

Given the configuration map from the Puppet Server config service return a map with of all the master settings.

Inputs: [{:keys [puppetserver]}]
Returns: MasterSettings

Given the configuration map from the Puppet Server config
service return a map with of all the master settings.
sourceraw docstring

contains-uppercase?clj

(contains-uppercase? s)

Does the given string contain any uppercase letters?

Does the given string contain any uppercase letters?
sourceraw docstring

create-agent-extensionsclj

(create-agent-extensions csr cacert)

Inputs: [csr :- CertificateRequest cacert :- Certificate] Returns: (schema/pred utils/extension-list?)

Given a certificate signing request, generate a list of extensions that should be signed onto the certificate. This includes a base set of standard extensions in addition to any valid extensions found on the signing request.

Inputs: [csr :- CertificateRequest cacert :- Certificate]
Returns: (schema/pred utils/extension-list?)

Given a certificate signing request, generate a list of extensions that
should be signed onto the certificate. This includes a base set of standard
extensions in addition to any valid extensions found on the signing request.
sourceraw docstring

create-ca-extensionsclj

(create-ca-extensions issuer-public-key ca-public-key)

Inputs: [issuer-public-key :- (schema/pred utils/public-key?) ca-public-key :- (schema/pred utils/public-key?)] Returns: (schema/pred utils/extension-list?)

Create a list of extensions to be added to the CA certificate.

Inputs: [issuer-public-key :- (schema/pred utils/public-key?) ca-public-key :- (schema/pred utils/public-key?)]
Returns: (schema/pred utils/extension-list?)

Create a list of extensions to be added to the CA certificate.
sourceraw docstring

create-csr-attrs-extsclj

(create-csr-attrs-exts csr-attributes-file)

Inputs: [csr-attributes-file :- schema/Str] Returns: (schema/maybe (schema/pred utils/extension-list?))

Parse the CSR attributes yaml file at the given path and create a list of certificate extensions from the extensions_requests section.

Inputs: [csr-attributes-file :- schema/Str]
Returns: (schema/maybe (schema/pred utils/extension-list?))

Parse the CSR attributes yaml file at the given path and create a list of
certificate extensions from the `extensions_requests` section.
sourceraw docstring

create-file-with-permsclj

(create-file-with-perms path permissions)

Inputs: [path :- schema/Str permissions :- schema/Str] Returns: File

Create a new empty file which has the provided posix file permissions. The permissions string is in the form of the standard 9 character posix format.

Inputs: [path :- schema/Str permissions :- schema/Str]
Returns: File

Create a new empty file which has the provided posix file permissions. The
permissions string is in the form of the standard 9 character posix format. 
sourceraw docstring

create-master-extensionsclj

(create-master-extensions master-certname
                          master-public-key
                          ca-cert
                          {:keys [dns-alt-names csr-attributes]})

Inputs: [master-certname :- schema/Str master-public-key :- (schema/pred utils/public-key?) ca-cert :- Certificate {:keys [dns-alt-names csr-attributes]} :- MasterSettings] Returns: (schema/pred utils/extension-list?)

Create a list of extensions to be added to the master certificate.

Inputs: [master-certname :- schema/Str master-public-key :- (schema/pred utils/public-key?) ca-cert :- Certificate {:keys [dns-alt-names csr-attributes]} :- MasterSettings]
Returns: (schema/pred utils/extension-list?)

Create a list of extensions to be added to the master certificate.
sourceraw docstring

create-parent-directories!clj

(create-parent-directories! paths)

Create all intermediate directories present in each of the file paths. Throws an exception if the directory cannot be created.

Create all intermediate directories present in each of the file paths.
Throws an exception if the directory cannot be created.
sourceraw docstring

create-report-activity-fnclj

(create-report-activity-fn report-activity request)
source

create-subject-alt-names-extclj

(create-subject-alt-names-ext host-name alt-names)

Inputs: [host-name :- schema/Str alt-names :- schema/Str] Returns: Extension

Given a hostname and a comma-separated list of DNS (and possibly IP) alt names, create a Subject Alternative Names extension. If there are no alt names provided then defaults will be used.

Inputs: [host-name :- schema/Str alt-names :- schema/Str]
Returns: Extension

Given a hostname and a comma-separated list of DNS (and possibly IP) alt names,
 create a Subject Alternative Names extension. If there are no alt names
 provided then defaults will be used.
sourceraw docstring

crl-expiration-datesclj

(crl-expiration-dates crl-chain-file)

Inputs: [crl-chain-file :- schema/Str]

Inputs: [crl-chain-file :- schema/Str]
sourceraw docstring

crl-expiration-window-daysclj

source

crl-expires-in-n-days?clj

(crl-expires-in-n-days? crl-path
                        {:keys [crl-lock crl-lock-timeout-seconds]}
                        days)

Inputs: [crl-path {:keys [crl-lock crl-lock-timeout-seconds]} :- CaSettings days :- schema/Int]

Inputs: [crl-path {:keys [crl-lock crl-lock-timeout-seconds]} :- CaSettings days :- schema/Int]
sourceraw docstring

crl-lock-descriptorclj

Text used in exceptions to help identify locking issues

Text used in exceptions to help identify locking issues
sourceraw docstring

csr-exists?clj

(csr-exists? {:keys [csrdir]} subject)

Inputs: [{:keys [csrdir]} :- CaSettings subject :- schema/Str] Returns: schema/Bool

Do we have a CSR for the given subject?

Inputs: [{:keys [csrdir]} :- CaSettings subject :- schema/Str]
Returns: schema/Bool

Do we have a CSR for the given subject?
sourceraw docstring

csr-validation-failure?clj

(csr-validation-failure? x)

Does the given object represent a CSR validation failure? (thrown from one of the CSR validate-* function, using slingshot)

Does the given object represent a CSR validation failure?
(thrown from one of the CSR validate-* function, using slingshot)
sourceraw docstring

default-allow-auth-extensionsclj

source

default-allow-subj-alt-namesclj

source

default-auto-ttl-renewalclj

source

default-auto-ttl-renewal-secondsclj

source

default-crl-lock-timeout-secondsclj

source

default-inventory-lock-timeout-secondsclj

source

default-serial-lock-timeout-secondsclj

source

delete-certificate!clj

(delete-certificate! {signeddir :signeddir} subject)

Inputs: [{signeddir :signeddir} :- CaSettings subject :- schema/Str]

Delete the certificate for the given subject. Note this does not revoke the certificate.

Inputs: [{signeddir :signeddir} :- CaSettings subject :- schema/Str]

Delete the certificate for the given subject.
 Note this does not revoke the certificate.
sourceraw docstring

delete-certificate-request!clj

(delete-certificate-request! {:keys [csrdir]} subject)

Inputs: [{:keys [csrdir]} :- CaSettings subject :- schema/Str] Returns: OutcomeInfo

Delete pending certificate requests for subject

Inputs: [{:keys [csrdir]} :- CaSettings subject :- schema/Str]
Returns: OutcomeInfo

Delete pending certificate requests for subject
sourceraw docstring

delete-certificates!clj

(delete-certificates! ca-settings subjects)

Inputs: [ca-settings :- CaSettings subjects :- [schema/Str]]

Delete each of the given certificates. Note that this does not revoke the certs.

Inputs: [ca-settings :- CaSettings subjects :- [schema/Str]]

Delete each of the given certificates.
Note that this does not revoke the certs.
sourceraw docstring

DesiredCertificateStateclj

The pair of states that may be submitted to the certificate status endpoint for signing and revoking certificates.

The pair of states that may be submitted to the certificate
status endpoint for signing and revoking certificates.
sourceraw docstring

digits-with-unit-patternclj

source

dns-alt-namesclj

(dns-alt-names cert-or-csr)

Inputs: [cert-or-csr :- CertificateOrCSR] Returns: [schema/Str]

Get the list of DNS alt names on the provided certificate or CSR. Each name will be prepended with 'DNS:'.

Inputs: [cert-or-csr :- CertificateOrCSR]
Returns: [schema/Str]

Get the list of DNS alt names on the provided certificate or CSR.
 Each name will be prepended with 'DNS:'.
sourceraw docstring

duration-str->secclj

(duration-str->sec string-input)

Converts a string containing any combination of duration string pairs in the format '<num>y' '<num>d' '<num>m' '<num>h' '<num>s' to a total number of seconds. nil is returned if the input is not a string or not a string containing any valid duration string pairs.

Converts a string containing any combination of duration string pairs in the format '<num>y' '<num>d' '<num>m' '<num>h' '<num>s'
to a total number of seconds.
nil is returned if the input is not a string or not a string containing any valid duration string pairs.
sourceraw docstring

duration-string?clj

(duration-string? maybe-duration-string)

Returns true if string is formatted with duration string pairs only, otherwise returns nil. Ignores whitespace.

Returns true if string is formatted with duration string pairs only, otherwise returns nil.
Ignores whitespace.
sourceraw docstring

ensure-ca-file-perms!clj

(ensure-ca-file-perms! settings)

Inputs: [settings :- CaSettings]

Ensure that the CA's private key file has the correct permissions set. If it does not, then correct them.

Inputs: [settings :- CaSettings]

Ensure that the CA's private key file has the correct permissions set. If it
does not, then correct them.
sourceraw docstring

ensure-cn-as-sanclj

(ensure-cn-as-san extension cn)

Inputs: [extension :- utils/SSLExtension cn :- schema/Str] Returns: utils/SSLExtension

Given the SSLExtension for subject alt names and a common name, ensure that the CN is listed in the SAN dns name list.

Inputs: [extension :- utils/SSLExtension cn :- schema/Str]
Returns: utils/SSLExtension

Given the SSLExtension for subject alt names and a common name, ensure that the CN is listed in the SAN dns name list.
sourceraw docstring

ensure-directories-exist!clj

(ensure-directories-exist! settings)

Inputs: [settings :- CaSettings]

Create any directories used by the CA if they don't already exist.

Inputs: [settings :- CaSettings]

Create any directories used by the CA if they don't already exist.
sourceraw docstring

ensure-ext-list-has-cn-sanclj

(ensure-ext-list-has-cn-san cn extensions)

Inputs: [cn :- schema/Str extensions :- (schema/pred utils/extension-list?)]

Given a list of extensions to be signed onto a certificate, ensure that a CN is provided as a subject alternative name; if no subject alternative name extension is found, generate a new extension and add it to the list with the CN supplied

Inputs: [cn :- schema/Str extensions :- (schema/pred utils/extension-list?)]

Given a list of extensions to be signed onto a certificate, ensure that a CN is provided
 as a subject alternative name; if no subject alternative name extension is found, generate a new
 extension and add it to the list with the CN supplied
sourceraw docstring

ensure-no-authorization-extensions!clj

(ensure-no-authorization-extensions! csr allow-authorization-extensions)

Inputs: [csr :- CertificateRequest allow-authorization-extensions :- schema/Bool]

Throws an exception if the CSR contains authorization exceptions AND the user has chosen to disallow authorization-extensions. This ensures that certificates with authentication extensions can only be signed intentionally.

Inputs: [csr :- CertificateRequest allow-authorization-extensions :- schema/Bool]

Throws an exception if the CSR contains authorization exceptions AND the user
 has chosen to disallow authorization-extensions.  This ensures that
 certificates with authentication extensions can only be signed intentionally.
sourceraw docstring

ensure-subject-alt-names-allowed!clj

(ensure-subject-alt-names-allowed! csr allow-subject-alt-names)

Inputs: [csr :- CertificateRequest allow-subject-alt-names :- schema/Bool]

Throws an exception if the CSR contains subject-alt-names AND the user has chosen to disallow subject-alt-names. Subject alt names can be allowed by setting allow-subject-alt-names to true in the ca.conf file. Always allows a single subject alt name that matches the CSR subject, which may be present to comply with RFC 2818 (see SERVER-2338).

Inputs: [csr :- CertificateRequest allow-subject-alt-names :- schema/Bool]

Throws an exception if the CSR contains subject-alt-names AND the user has
 chosen to disallow subject-alt-names. Subject alt names can be allowed by
 setting allow-subject-alt-names to true in the ca.conf file. Always allows
 a single subject alt name that matches the CSR subject, which may be
 present to comply with RFC 2818 (see SERVER-2338).
sourceraw docstring

execute-autosign-command!clj

(execute-autosign-command! executable
                           subject
                           csr-stream
                           ruby-load-path
                           gem-path)

Inputs: [executable :- schema/Str subject :- schema/Str csr-stream :- InputStream ruby-load-path :- [schema/Str] gem-path :- schema/Str] Returns: shell-utils/ExecutionResult

Execute the autosign script and return a map containing the standard-out, standard-err, and exit code. The subject will be passed in as input, and the CSR stream will be provided on standard-in. The ruby-load-path will be prepended to the RUBYLIB found in the environment, and is intended to make the Puppet and Facter Ruby libraries available to the autosign script. All output (stdout & stderr) will be logged at the debug level. Warnings are issued for nonzero exit code or if stderr is generated by the autosign script.

Inputs: [executable :- schema/Str subject :- schema/Str csr-stream :- InputStream ruby-load-path :- [schema/Str] gem-path :- schema/Str]
Returns: shell-utils/ExecutionResult

Execute the autosign script and return a map containing the standard-out,
 standard-err, and exit code. The subject will be passed in as input, and
 the CSR stream will be provided on standard-in. The ruby-load-path will be
 prepended to the RUBYLIB found in the environment, and is intended to make
 the Puppet and Facter Ruby libraries available to the autosign script.
 All output (stdout & stderr) will be logged at the debug level. Warnings are
 issued for nonzero exit code or if stderr is generated by the autosign
 script.
sourceraw docstring

expired-inventory-serialsclj

(expired-inventory-serials {:keys [cert-inventory inventory-lock
                                   inventory-lock-timeout-seconds]})

Inputs: [{:keys [cert-inventory inventory-lock inventory-lock-timeout-seconds]} :- CaSettings] Returns: [BigInteger]

Inputs: [{:keys [cert-inventory inventory-lock inventory-lock-timeout-seconds]} :- CaSettings]
Returns: [BigInteger]
sourceraw docstring

Extensionclj

source

extract-active-infra-serialsclj

(extract-active-infra-serials {:keys [infra-nodes-path signeddir] :as settings})

Inputs: [{:keys [infra-nodes-path signeddir], :as settings} :- CaSettings] Returns: [BigInteger]

Read the infra nodes file to determine which nodes are infrastructure nodes. For each node, check the inventory file for any serial numbers for that node, Also check the filesystem for a signed cert for that node. Return a sorted unique set of serial numbers for nodes in the infra file

Inputs: [{:keys [infra-nodes-path signeddir], :as settings} :- CaSettings]
Returns: [BigInteger]

Read the infra nodes file to determine which nodes are infrastructure nodes.
For each node, check the inventory file for any serial numbers for that node,
Also check the filesystem for a signed cert for that node.  Return a sorted unique
set of serial numbers for nodes in the infra file
sourceraw docstring

extract-inventory-row-contentsclj

(extract-inventory-row-contents row)
source

filter-already-revoked-serialsclj

(filter-already-revoked-serials serials crl)

Inputs: [serials :- [BigInteger] crl :- X509CRL] Returns: [BigInteger]

Given a list of serials and Puppet's CA CRL, returns vector of serials with any already-revoked serials removed.

Inputs: [serials :- [BigInteger] crl :- X509CRL]
Returns: [BigInteger]

Given a list of serials and Puppet's CA CRL, returns vector of serials with
 any already-revoked serials removed.
sourceraw docstring

filter-by-certificate-stateclj

(filter-by-certificate-state {:keys [csrdir signeddir cacert cacrl cakey]}
                             state)

Inputs: [{:keys [csrdir signeddir cacert cacrl cakey]} :- CaSettings state :- schema/Str] Returns: [CertificateStatusResult]

Get the status of all certificates in the given state.

Inputs: [{:keys [csrdir signeddir cacert cacrl cakey]} :- CaSettings state :- schema/Str]
Returns: [CertificateStatusResult]

Get the status of all certificates in the given state.
sourceraw docstring

find-matching-valid-serial-numbersclj

(find-matching-valid-serial-numbers {:keys [cert-inventory inventory-lock
                                            inventory-lock-timeout-seconds]}
                                    certname)

Inputs: [{:keys [cert-inventory inventory-lock inventory-lock-timeout-seconds]} :- CaSettings certname :- schema/Str] Returns: [BigInteger]

Inputs: [{:keys [cert-inventory inventory-lock inventory-lock-timeout-seconds]} :- CaSettings certname :- schema/Str]
Returns: [BigInteger]
sourceraw docstring

fingerprintclj

(fingerprint cert-or-csr algorithm)

Inputs: [cert-or-csr :- CertificateOrCSR algorithm :- schema/Str] Returns: schema/Str

Calculate the hash of the certificate or CSR using the given algorithm, which must be one of SHA-1, SHA-256, or SHA-512.

Inputs: [cert-or-csr :- CertificateOrCSR algorithm :- schema/Str]
Returns: schema/Str

Calculate the hash of the certificate or CSR using the given
 algorithm, which must be one of SHA-1, SHA-256, or SHA-512.
sourceraw docstring

format-date-timeclj

(format-date-time date-time)

Inputs: [date-time :- Date] Returns: schema/Str

Formats a date-time into the format expected by the ruby puppet code.

Inputs: [date-time :- Date]
Returns: schema/Str

Formats a date-time into the format expected by the ruby puppet code.
sourceraw docstring

format-serial-numberclj

(format-serial-number serial-number)

Inputs: [serial-number :- schema/Int] Returns: schema/Str

Converts a serial number to the format it needs to be written in on disk. This function has to write serial numbers in the same format that the puppet ruby code does, to maintain compatibility with things like 'puppet cert'; for whatever arcane reason, that format is 0-padding up to 4 digits.

Inputs: [serial-number :- schema/Int]
Returns: schema/Str

Converts a serial number to the format it needs to be written in on disk.
This function has to write serial numbers in the same format that the puppet
ruby code does, to maintain compatibility with things like 'puppet cert';
for whatever arcane reason, that format is 0-padding up to 4 digits.
sourceraw docstring

generate-cert-message-from-requestclj

(generate-cert-message-from-request request subjects activity-type)

Extract params from request and create successful cert signing message. Returns message, subject, certname and ip address

Extract params from request and create successful cert signing message.
Returns message, subject, certname and ip address
sourceraw docstring

generate-infra-serials!clj

(generate-infra-serials! {:keys [infra-node-serials-path] :as settings})

Inputs: [{:keys [infra-node-serials-path], :as settings} :- CaSettings]

Given a list of infra nodes it will create a file containing serial numbers of their certificates (listed on separate lines). It is expected have at least one entry (MoM)

Inputs: [{:keys [infra-node-serials-path], :as settings} :- CaSettings]

Given a list of infra nodes it will create a file containing
 serial numbers of their certificates (listed on separate lines).
 It is expected have at least one entry (MoM)
sourceraw docstring

generate-master-ssl-files!clj

(generate-master-ssl-files! settings certname ca-settings)

Inputs: [settings :- MasterSettings certname :- schema/Str ca-settings :- CaSettings]

Given master configuration settings, certname, and CA settings, generate and write to disk all of the necessary SSL files for the master. Any existing files will be replaced.

Inputs: [settings :- MasterSettings certname :- schema/Str ca-settings :- CaSettings]

Given master configuration settings, certname, and CA settings,
 generate and write to disk all of the necessary SSL files for
 the master. Any existing files will be replaced.
sourceraw docstring

generate-master-ssl-keys!clj

(generate-master-ssl-keys! {:keys [hostprivkey hostpubkey] :as settings})

Inputs: [{:keys [hostprivkey hostpubkey], :as settings} :- MasterSettings] Returns: (schema/pred utils/public-key?)

Generate and store ssl public and private keys for the master to disk. If the files are both already present, new ones will not be generated to replace them. Returns the public key.

Inputs: [{:keys [hostprivkey hostpubkey], :as settings} :- MasterSettings]
Returns: (schema/pred utils/public-key?)

Generate and store ssl public and private keys for the master to disk.  If
the files are both already present, new ones will not be generated to replace
them.  Returns the public key.
sourceraw docstring

generate-master-ssl-keys!*clj

(generate-master-ssl-keys!* {:keys [hostprivkey hostpubkey keylength]})

Inputs: [{:keys [hostprivkey hostpubkey keylength]} :- MasterSettings] Returns: (schema/pred utils/public-key?)

Generate and store ssl public and private keys for the master to disk. Returns the public key.

Inputs: [{:keys [hostprivkey hostpubkey keylength]} :- MasterSettings]
Returns: (schema/pred utils/public-key?)

Generate and store ssl public and private keys for the master to disk.
Returns the public key.
sourceraw docstring

generate-ssl-files!clj

(generate-ssl-files! ca-settings)

Inputs: [ca-settings :- CaSettings]

Given the CA settings, generate and write to disk all of the necessary SSL files for the CA. Any existing files will be replaced.

Inputs: [ca-settings :- CaSettings]

Given the CA settings, generate and write to disk all of the necessary
SSL files for the CA. Any existing files will be replaced.
sourceraw docstring

get-auth-key-idclj

(get-auth-key-id crl)

Inputs: [crl :- X509CRL]

Inputs: [crl :- X509CRL]
sourceraw docstring

get-ca-ttlclj

(get-ca-ttl puppetserver certificate-authority)

Returns ca-ttl value as an integer. If a value is set in certificate-authority that value is returned. Otherwise puppet config setting is returned

Returns ca-ttl value as an integer. If a value is set in certificate-authority that value is returned.
Otherwise puppet config setting is returned
sourceraw docstring

get-cert-and-csr-statusesclj

(get-cert-and-csr-statuses {:keys [csrdir signeddir cacert cacrl cakey]})

Inputs: [{:keys [csrdir signeddir cacert cacrl cakey]} :- CaSettings] Returns: [CertificateStatusResult]

Get the status of all certificates and certificate requests.

Inputs: [{:keys [csrdir signeddir cacert cacrl cakey]} :- CaSettings]
Returns: [CertificateStatusResult]

Get the status of all certificates and certificate requests.
sourceraw docstring

get-cert-or-csr-statusclj

(get-cert-or-csr-status {:keys [csrdir signeddir cacert cacrl cakey]} subject)

Inputs: [{:keys [csrdir signeddir cacert cacrl cakey]} :- CaSettings subject :- schema/Str] Returns: CertificateStatusResult

Get the status of the subject's certificate or certificate request. The status includes the state of the certificate (signed, revoked, requested), DNS alt names, and several different fingerprint hashes of the certificate.

Inputs: [{:keys [csrdir signeddir cacert cacrl cakey]} :- CaSettings subject :- schema/Str]
Returns: CertificateStatusResult

Get the status of the subject's certificate or certificate request.
 The status includes the state of the certificate (signed, revoked, requested),
 DNS alt names, and several different fingerprint hashes of the certificate.
sourceraw docstring

get-cert-or-csr-status*clj

(get-cert-or-csr-status* crl is-cert? subject cert-or-csr)

Inputs: [crl :- CertificateRevocationList is-cert? :- schema/Bool subject :- schema/Str cert-or-csr :- CertificateOrCSR]

Inputs: [crl :- CertificateRevocationList is-cert? :- schema/Bool subject :- schema/Str cert-or-csr :- CertificateOrCSR]
sourceraw docstring

get-cert-or-csr-statusesclj

(get-cert-or-csr-statuses dir crl fetch-cert?)

Inputs: [dir :- schema/Str crl :- CertificateRevocationList fetch-cert? :- schema/Bool] Returns: [CertificateStatusResult]

Get the statuses of either all the CSR or all the certificate.

Inputs: [dir :- schema/Str crl :- CertificateRevocationList fetch-cert? :- schema/Bool]
Returns: [CertificateStatusResult]

Get the statuses of either all the CSR or all the certificate.
sourceraw docstring

get-cert-serialclj

(get-cert-serial path-to-cert)

Inputs: [path-to-cert] Returns: BigInteger

Inputs: [path-to-cert]
Returns: BigInteger
sourceraw docstring

get-certificateclj

(get-certificate subject cacert signeddir)

Inputs: [subject :- schema/Str cacert :- schema/Str signeddir :- schema/Str] Returns: (schema/maybe schema/Str)

Given a subject name and path to the certificate directory and the CA certificate, return the subject's certificate as a string, or nil if not found. If the subject is 'ca', then use the cacert path instead.

Inputs: [subject :- schema/Str cacert :- schema/Str signeddir :- schema/Str]
Returns: (schema/maybe schema/Str)

Given a subject name and path to the certificate directory and the CA
certificate, return the subject's certificate as a string, or nil if not found.
If the subject is 'ca', then use the `cacert` path instead.
sourceraw docstring

get-certificate-detailsclj

(get-certificate-details cert)

Inputs: [cert] Returns: CertificateDetails

Return details from a X509 certificate.

Inputs: [cert]
Returns: CertificateDetails

Return details from a X509 certificate.
sourceraw docstring

get-certificate-pathclj

(get-certificate-path subject cacert signeddir)

Inputs: [subject :- schema/Str cacert :- schema/Str signeddir :- schema/Str] Returns: (schema/maybe schema/Str)

Given a subject name and paths to the CA certificate and path to the certificate directory return the path to the subject's certificate as a string, or nil if not found. If the subject is 'ca', then use the cacert path instead.

Inputs: [subject :- schema/Str cacert :- schema/Str signeddir :- schema/Str]
Returns: (schema/maybe schema/Str)

Given a subject name and paths to the CA certificate and path
to the certificate directory return the path to the subject's
certificate as a string, or nil if not found.
If the subject is 'ca', then use the `cacert` path instead.
sourceraw docstring

get-certificate-requestclj

(get-certificate-request subject csrdir)

Inputs: [subject :- schema/Str csrdir :- schema/Str] Returns: (schema/maybe schema/Str)

Given a subject name, return their certificate request as a string, or nil if not found. Looks for certificate requests in csrdir.

Inputs: [subject :- schema/Str csrdir :- schema/Str]
Returns: (schema/maybe schema/Str)

Given a subject name, return their certificate request as a string, or nil if
not found.  Looks for certificate requests in `csrdir`.
sourceraw docstring

get-certificate-revocation-listclj

(get-certificate-revocation-list cacrl lock lock-descriptor lock-timeout)

Inputs: [cacrl :- schema/Str lock :- ReentrantReadWriteLock lock-descriptor :- schema/Str lock-timeout :- PosInt] Returns: schema/Str

Given the value of the 'cacrl' setting from Puppet, return the CRL from the .pem file on disk.

Inputs: [cacrl :- schema/Str lock :- ReentrantReadWriteLock lock-descriptor :- schema/Str lock-timeout :- PosInt]
Returns: schema/Str

Given the value of the 'cacrl' setting from Puppet,
return the CRL from the .pem file on disk.
sourceraw docstring

get-csr-attributesclj

(get-csr-attributes csr)

Inputs: [csr :- PKCS10CertificationRequest] Returns: utils/SSLMultiValueAttributeList

Inputs: [csr :- PKCS10CertificationRequest]
Returns: utils/SSLMultiValueAttributeList
sourceraw docstring

get-csr-subjectclj

(get-csr-subject csr)

Inputs: [csr :- CertificateRequest] Returns: schema/Str

Inputs: [csr :- CertificateRequest]
Returns: schema/Str
sourceraw docstring

get-custom-oid-mappingsclj

(get-custom-oid-mappings custom-oid-mapping-file)

Inputs: [custom-oid-mapping-file :- schema/Str] Returns: (schema/maybe OIDMappings)

Given a path to a custom OID mappings file, return a map of all oids to shortnames

Inputs: [custom-oid-mapping-file :- schema/Str]
Returns: (schema/maybe OIDMappings)

Given a path to a custom OID mappings file, return a map of all oids to
shortnames
sourceraw docstring

get-file-last-modifiedclj

(get-file-last-modified path)
(get-file-last-modified path lock lock-descriptor lock-timeout)

Inputs: ([path :- schema/Str] [path :- schema/Str lock :- ReentrantReadWriteLock lock-descriptor :- schema/Str lock-timeout :- PosInt]) Returns: DateTime

Given a path to a file, return a Joda DateTime instance of when the file was last modified. an optional lock, description, and timeout may be passed to serialize access to files.

Inputs: ([path :- schema/Str] [path :- schema/Str lock :- ReentrantReadWriteLock lock-descriptor :- schema/Str lock-timeout :- PosInt])
Returns: DateTime

Given a path to a file, return a Joda DateTime instance of when the file was last modified.
 an optional lock, description, and timeout may be passed to serialize access to files.
sourceraw docstring

get-newest-crlclj

(get-newest-crl crls)

Inputs: [crls :- [CertificateRevocationList]] Returns: CertificateRevocationList

Determine the newest CRL by looking for the highest CRL Number. This assumes all given CRLs have the same issuer. Fails if more than one CRL has the highest CRL Number.

Inputs: [crls :- [CertificateRevocationList]]
Returns: CertificateRevocationList

Determine the newest CRL by looking for the highest CRL Number. This assumes
all given CRLs have the same issuer. Fails if more than one CRL has the
highest CRL Number.
sourceraw docstring

get-oid-mappingsclj

(get-oid-mappings custom-oid-mapping-file)

Inputs: [custom-oid-mapping-file :- (schema/maybe schema/Str)] Returns: OIDMappings

Inputs: [custom-oid-mapping-file :- (schema/maybe schema/Str)]
Returns: OIDMappings
sourceraw docstring

get-paths-to-all-certificate-requestsclj

(get-paths-to-all-certificate-requests csrdir)

Inputs: [csrdir :- schema/Str] Returns: [Path]

Given a csr directory, return Path entries to all the files that could be CSRs

Inputs: [csrdir :- schema/Str]
Returns: [Path]

Given a csr directory, return Path entries to all the files that could be CSRs
sourceraw docstring

get-serial-number!clj

(get-serial-number! {:keys [serial serial-lock serial-lock-timeout-seconds]})

Inputs: [{:keys [serial serial-lock serial-lock-timeout-seconds]} :- CaSettings] Returns: schema/Int

Reads the serial number file from disk and returns the serial number.

Inputs: [{:keys [serial serial-lock serial-lock-timeout-seconds]} :- CaSettings]
Returns: schema/Int

Reads the serial number file from disk and returns the serial number.
sourceraw docstring

glob-matches?clj

(glob-matches? glob subject)

Inputs: [glob :- schema/Str subject :- schema/Str] Returns: schema/Bool

Test if a subject matches the domain-name glob from the autosign whitelist. The glob is expected to start with a '*' and be in a form like *.foo.bar. The subject is expected to contain only lowercase characters and be in a form like agent.foo.bar. Capitalization in the glob will be ignored. Examples: (glob-matches? *.foo.bar agent.foo.bar) => true (glob-matches? *.baz baz) => true (glob-matches? *.QUX 0.1.qux) => true

Inputs: [glob :- schema/Str subject :- schema/Str]
Returns: schema/Bool

Test if a subject matches the domain-name glob from the autosign whitelist.
 The glob is expected to start with a '*' and be in a form like `*.foo.bar`.
 The subject is expected to contain only lowercase characters and be in a
 form like `agent.foo.bar`. Capitalization in the glob will be ignored.
 Examples:
   (glob-matches? *.foo.bar agent.foo.bar) => true
   (glob-matches? *.baz baz) => true
   (glob-matches? *.QUX 0.1.qux) => true
sourceraw docstring

in-cert-inventory-file?clj

(in-cert-inventory-file? {:keys [cert-inventory inventory-lock
                                 inventory-lock-timeout-seconds]}
                         certname)

Inputs: [{:keys [cert-inventory inventory-lock inventory-lock-timeout-seconds]} :- CaSettings certname :- schema/Str] Returns: schema/Bool

Inputs: [{:keys [cert-inventory inventory-lock inventory-lock-timeout-seconds]} :- CaSettings certname :- schema/Str]
Returns: schema/Bool
sourceraw docstring

initialize!clj

(initialize! settings)

Inputs: [settings :- CaSettings]

Given the CA configuration settings, ensure that all required SSL files exist. If all files exist, new ones will not be generated. If only some are found (but others are missing), an exception is thrown.

Inputs: [settings :- CaSettings]

Given the CA configuration settings, ensure that all
 required SSL files exist. If all files exist,
 new ones will not be generated. If only some are found
 (but others are missing), an exception is thrown.
sourceraw docstring

initialize-ca-configclj

(initialize-ca-config ca-data)

Inputs: [ca-data]

Adds in default ca config keys/values, which may be overwritten if a value for any of those keys already exists in the ca-data

Inputs: [ca-data]

Adds in default ca config keys/values, which may be overwritten if a value for
any of those keys already exists in the ca-data
sourceraw docstring

initialize-master-ssl!clj

(initialize-master-ssl! {:keys [hostprivkey hostcert] :as settings}
                        certname
                        ca-settings)

Inputs: [{:keys [hostprivkey hostcert], :as settings} :- MasterSettings certname :- schema/Str ca-settings :- CaSettings]

Given configuration settings, certname, and CA settings, ensure all necessary SSL files exist on disk by regenerating all of them if any are found to be missing.

Inputs: [{:keys [hostprivkey hostcert], :as settings} :- MasterSettings certname :- schema/Str ca-settings :- CaSettings]

Given configuration settings, certname, and CA settings, ensure all
 necessary SSL files exist on disk by regenerating all of them if any
 are found to be missing.
sourceraw docstring

initialize-serial-file!clj

(initialize-serial-file! {:keys [serial serial-lock
                                 serial-lock-timeout-seconds]})

Inputs: [{:keys [serial serial-lock serial-lock-timeout-seconds]} :- CaSettings]

Initializes the serial number file on disk. Serial numbers start at 1.

Inputs: [{:keys [serial serial-lock serial-lock-timeout-seconds]} :- CaSettings]

Initializes the serial number file on disk.  Serial numbers start at 1.
sourceraw docstring

input-stream->byte-arrayclj

(input-stream->byte-array input-stream)
source

inventory-date-formatterclj

source

inventory-lock-descriptorclj

Text used in exceptions to help identify locking issues

Text used in exceptions to help identify locking issues
sourceraw docstring

is-expired?clj

(is-expired? now [_serial _not-before not-after _row-subject])

Inputs: [now :- DateTime [_serial _not-before not-after _row-subject] :- [schema/Str]] Returns: schema/Bool

Inputs: [now :- DateTime [_serial _not-before not-after _row-subject] :- [schema/Str]]
Returns: schema/Bool
sourceraw docstring

is-not-expired?clj

(is-not-expired? now [_serial _not-before not-after _row-subject])

Inputs: [now :- DateTime [_serial _not-before not-after _row-subject] :- [schema/Str]] Returns: schema/Bool

Inputs: [now :- DateTime [_serial _not-before not-after _row-subject] :- [schema/Str]]
Returns: schema/Bool
sourceraw docstring

is-revoked?clj

(is-revoked? cert
             {:keys [cacert cacrl crl-lock crl-lock-timeout-seconds cakey]})

Inputs: [cert :- X509Certificate {:keys [cacert cacrl crl-lock crl-lock-timeout-seconds cakey]} :- CaSettings] Returns: schema/Bool

Inputs: [cert :- X509Certificate {:keys [cacert cacrl crl-lock crl-lock-timeout-seconds cakey]} :- CaSettings]
Returns: schema/Bool
sourceraw docstring

is-san?clj

(is-san? extension)

Inputs: [extension]

Inputs: [extension]
sourceraw docstring

is-subject-in-inventory-row?clj

(is-subject-in-inventory-row? cn-subject
                              [_serial _not-before _not-after row-subject])

Inputs: [cn-subject :- utils/ValidX500Name [_serial _not-before _not-after row-subject] :- [schema/Str]] Returns: schema/Bool

Inputs: [cn-subject :- utils/ValidX500Name [_serial _not-before _not-after row-subject] :- [schema/Str]]
Returns: schema/Bool
sourceraw docstring

KeyIdExtensionclj

source

line-matches?clj

(line-matches? whitelist subject line)

Inputs: [whitelist :- schema/Str subject :- schema/Str line :- schema/Str] Returns: schema/Bool

Test if the subject matches the line from the autosign whitelist. The line is expected to be an exact certname or a domain-name glob. A single line with the character '*' will match all subjects. If the line contains invalid characters it will be logged and false will be returned.

Inputs: [whitelist :- schema/Str subject :- schema/Str line :- schema/Str]
Returns: schema/Bool

Test if the subject matches the line from the autosign whitelist.
 The line is expected to be an exact certname or a domain-name glob.
 A single line with the character '*' will match all subjects.
 If the line contains invalid characters it will be logged and
 false will be returned.
sourceraw docstring

look-for-serial-numbersclj

(look-for-serial-numbers settings certname)

Inputs: [settings :- CaSettings certname :- schema/Str] Returns: [BigInteger]

Inputs: [settings :- CaSettings certname :- schema/Str]
Returns: [BigInteger]
sourceraw docstring

MasterSettingsclj

Settings from Puppet that are necessary for SSL initialization on the master. Most of these are files and directories within the SSL directory, excluding the CA directory and its contents; see CaSettings for more information. All of these are Puppet configuration settings.

Settings from Puppet that are necessary for SSL initialization on the master.
Most of these are files and directories within the SSL directory, excluding
the CA directory and its contents; see `CaSettings` for more information.
All of these are Puppet configuration settings.
sourceraw docstring

max-ca-ttlclj

The longest valid duration for CA certs, in seconds. 50 standard years.

The longest valid duration for CA certs, in seconds. 50 standard years.
sourceraw docstring

maybe-replace-crlclj

(maybe-replace-crl crl key-crl-map)

Inputs: [crl :- CertificateRevocationList key-crl-map :- {KeyIdExtension [CertificateRevocationList]}] Returns: CertificateRevocationList

Given a CRL and a map of key identifiers to CRLs, determine the newest CRL with the key-id of the given CRL. Warn if the newest CRL is the given CRL. Never replaces the CRL corresponding to the Puppet CA signing cert.

Inputs: [crl :- CertificateRevocationList key-crl-map :- {KeyIdExtension [CertificateRevocationList]}]
Returns: CertificateRevocationList

Given a CRL and a map of key identifiers to CRLs, determine the
newest CRL with the key-id of the given CRL. Warn if the newest CRL
is the given CRL. Never replaces the CRL corresponding to the Puppet
CA signing cert.
sourceraw docstring

maybe-sign-oneclj

(maybe-sign-one subject
                csr-path
                cacert
                casubject
                ca-private-key
                {:keys [signeddir ca-ttl allow-auto-renewal
                        allow-subject-alt-names allow-authorization-extensions
                        auto-renewal-cert-ttl]
                 :as ca-settings})

Inputs: [subject :- schema/Str csr-path :- schema/Str cacert :- Certificate casubject :- schema/Str ca-private-key :- PrivateKey {:keys [signeddir ca-ttl allow-auto-renewal allow-subject-alt-names allow-authorization-extensions auto-renewal-cert-ttl], :as ca-settings} :- CaSettings] Returns: (schema/enum :signed :signing-errors)

Inputs: [subject :- schema/Str csr-path :- schema/Str cacert :- Certificate casubject :- schema/Str ca-private-key :- PrivateKey {:keys [signeddir ca-ttl allow-auto-renewal allow-subject-alt-names allow-authorization-extensions auto-renewal-cert-ttl], :as ca-settings} :- CaSettings]
Returns: (schema/enum :signed :signing-errors)
sourceraw docstring

maybe-update-crls-for-expirationclj

(maybe-update-crls-for-expiration {:keys [cacrl enable-infra-crl infra-crl-path]
                                   :as settings})

Inputs: [{:keys [cacrl enable-infra-crl infra-crl-path], :as settings} :- CaSettings]

Inputs: [{:keys [cacrl enable-infra-crl infra-crl-path], :as settings} :- CaSettings]
sourceraw docstring

maybe-write-to-infra-serial!clj

(maybe-write-to-infra-serial! serial
                              certname
                              {:keys [infra-nodes-path
                                      infra-node-serials-path]})

Inputs: [serial :- BigInteger certname :- schema/Str {:keys [infra-nodes-path infra-node-serials-path]} :- CaSettings]

Determine if the host in question is an infra host, and if it is, add the provided serial number to the infra-serials file

Inputs: [serial :- BigInteger certname :- schema/Str {:keys [infra-nodes-path infra-node-serials-path]} :- CaSettings]

Determine if the host in question is an infra host, and if it is, add the provided serial number to the
infra-serials file
sourceraw docstring

netscape-comment-valueclj

Standard value applied to the Netscape Comment extension for certificates

Standard value applied to the Netscape Comment extension for certificates
sourceraw docstring

next-serial-number!clj

(next-serial-number! {:keys [serial serial-lock serial-lock-timeout-seconds]
                      :as ca-settings})

Inputs: [{:keys [serial serial-lock serial-lock-timeout-seconds], :as ca-settings} :- CaSettings] Returns: schema/Int

Returns the next serial number to be used when signing a certificate request. Reads the serial number as a hex value from the given file and replaces the contents of serial-file with the next serial number for a subsequent call. Puppet's $serial setting defines the location of the serial number file.

Inputs: [{:keys [serial serial-lock serial-lock-timeout-seconds], :as ca-settings} :- CaSettings]
Returns: schema/Int

Returns the next serial number to be used when signing a certificate request.
Reads the serial number as a hex value from the given file and replaces the
contents of `serial-file` with the next serial number for a subsequent call.
Puppet's $serial setting defines the location of the serial number file.
sourceraw docstring

OIDMappingsclj

source

OutcomeInfoclj

Generic map of outcome & message for API consumers

Generic map of outcome & message for API consumers
sourceraw docstring

overwrite-existing-crl!clj

(overwrite-existing-crl! crl
                         rest-of-full-chain
                         capub
                         cakey
                         cacert
                         valid-serials
                         crl-path)

Inputs: [crl :- X509CRL rest-of-full-chain capub :- schema/Str cakey :- schema/Str cacert :- X509Certificate valid-serials :- [BigInteger] crl-path :- schema/Str]

Inputs: [crl :- X509CRL rest-of-full-chain capub :- schema/Str cakey :- schema/Str cacert :- X509Certificate valid-serials :- [BigInteger] crl-path :- schema/Str]
sourceraw docstring

parse-date-timeclj

(parse-date-time date-time)

Inputs: [date-time :- schema/Str] Returns: DateTime

parses a date-time string into a DateTime instance

Inputs: [date-time :- schema/Str]
Returns: DateTime

parses a date-time string into a DateTime instance
sourceraw docstring

parse-serial-numberclj

(parse-serial-number serial-number)

Inputs: [serial-number :- schema/Str] Returns: schema/Int

Parses a serial number from its format on disk. See format-serial-number for the awful, gory details.

Inputs: [serial-number :- schema/Str]
Returns: schema/Int

Parses a serial number from its format on disk.  See `format-serial-number`
for the awful, gory details.
sourceraw docstring

partial-state-errorclj

(partial-state-error master-or-ca found-files missing-files)

Inputs: [master-or-ca :- schema/Str found-files :- [schema/Str] missing-files :- [schema/Str]] Returns: Exception

Construct an exception appropriate for the end-user to signify that there are missing SSL files and the master or CA cannot start until action is taken.

Inputs: [master-or-ca :- schema/Str found-files :- [schema/Str] missing-files :- [schema/Str]]
Returns: Exception

Construct an exception appropriate for the end-user to signify that there
 are missing SSL files and the master or CA cannot start until action is taken.
sourceraw docstring

path-to-certclj

(path-to-cert signeddir subject)

Return a path to the subjects certificate file under the signeddir.

Return a path to the `subject`s certificate file under the `signeddir`.
sourceraw docstring

path-to-cert-requestclj

(path-to-cert-request csrdir subject)

Return a path to the subjects certificate request file under the csrdir.

Return a path to the `subject`s certificate request file under the `csrdir`.
sourceraw docstring

pattern-match-dotclj

source

pattern-matches-alphanumeric-with-symbols-stringclj

source

pattern-starts-with-alphanumeric-or-underscoreclj

source

PosIntclj

Any integer z in Z where z > 0.

Any integer z in Z where z > 0.
sourceraw docstring

positive-integer?clj

(positive-integer? i)
source

pp_auth_auto_renew-attributeclj

source

ppAuthCertExtclj

The OID for the extension with shortname 'ppAuthCertExt'.

The OID for the extension with shortname 'ppAuthCertExt'.
sourceraw docstring

ppPrivCertExtclj

The OID for the extension with shortname 'ppPrivCertExt'.

The OID for the extension with shortname 'ppPrivCertExt'.
sourceraw docstring

ppRegCertExtclj

The OID for the extension with shortname 'ppRegCertExt'.

The OID for the extension with shortname 'ppRegCertExt'.
sourceraw docstring

private-key-dir-permsclj

Posix permissions for the private key directory on disk.

Posix permissions for the private key directory on disk.
sourceraw docstring

private-key-permsclj

Posix permissions for all private keys on disk.

Posix permissions for all private keys on disk.
sourceraw docstring

process-csr-submission!clj

(process-csr-submission! subject
                         certificate-request
                         {:keys [autosign csrdir ruby-load-path gem-path
                                 allow-subject-alt-names
                                 allow-authorization-extensions]
                          :as settings}
                         report-activity)

Inputs: [subject :- schema/Str certificate-request :- InputStream {:keys [autosign csrdir ruby-load-path gem-path allow-subject-alt-names allow-authorization-extensions], :as settings} :- CaSettings report-activity]

Given a CSR for a subject (typically from the HTTP endpoint), perform policy checks and sign or save the CSR (based on autosign). Throws a slingshot exception if the CSR is invalid.

Inputs: [subject :- schema/Str certificate-request :- InputStream {:keys [autosign csrdir ruby-load-path gem-path allow-subject-alt-names allow-authorization-extensions], :as settings} :- CaSettings report-activity]

Given a CSR for a subject (typically from the HTTP endpoint),
 perform policy checks and sign or save the CSR (based on autosign).
 Throws a slingshot exception if the CSR is invalid.
sourceraw docstring

public-key-permsclj

Posix permissions for all public keys on disk.

Posix permissions for all public keys on disk.
sourceraw docstring

puppet-oid-arcclj

The parent OID for all Puppet Labs specific X.509 certificate extensions.

The parent OID for all Puppet Labs specific X.509 certificate extensions.
sourceraw docstring

puppet-short-namesclj

A mapping of Puppet extension short names to their OIDs. These appear in csr_attributes.yaml.

A mapping of Puppet extension short names to their OIDs. These appear in
csr_attributes.yaml.
sourceraw docstring

read-infra-nodesclj

(read-infra-nodes infra-file-reader)

Inputs: [infra-file-reader :- Reader]

Returns a list of infra nodes or infra node serials from the specified file organized as one item per line.

Inputs: [infra-file-reader :- Reader]

Returns a list of infra nodes or infra node serials from the specified file organized as one item per line.
sourceraw docstring

reject-delta-crlclj

(reject-delta-crl crl)

Inputs: [crl :- CertificateRevocationList]

Inputs: [crl :- CertificateRevocationList]
sourceraw docstring

renew-certificate!clj

(renew-certificate! certificate
                    {:keys [cacert cakey auto-renewal-cert-ttl signeddir]
                     :as ca-settings}
                    report-activity)

Inputs: [certificate :- X509Certificate {:keys [cacert cakey auto-renewal-cert-ttl signeddir], :as ca-settings} :- CaSettings report-activity] Returns: X509Certificate

Given a certificate and CaSettings create a new signed certificate using the public key from the certificate. It recreates all the extensions in the original certificate.

Inputs: [certificate :- X509Certificate {:keys [cacert cakey auto-renewal-cert-ttl signeddir], :as ca-settings} :- CaSettings report-activity]
Returns: X509Certificate

Given a certificate and CaSettings create a new signed certificate using the public key from the certificate.
It recreates all the extensions in the original certificate.
sourceraw docstring

repeated-digits-with-unit-patternclj

source

replace-authority-identifierclj

(replace-authority-identifier extensions ca-cert)

Inputs: [extensions :- utils/SSLExtensionList ca-cert :- X509Certificate] Returns: utils/SSLExtensionList

Inputs: [extensions :- utils/SSLExtensionList ca-cert :- X509Certificate]
Returns: utils/SSLExtensionList
sourceraw docstring

replace-subject-identifierclj

(replace-subject-identifier extensions subject-public-key)

Inputs: [extensions :- utils/SSLExtensionList subject-public-key :- PublicKey] Returns: utils/SSLExtensionList

Inputs: [extensions :- utils/SSLExtensionList subject-public-key :- PublicKey]
Returns: utils/SSLExtensionList
sourceraw docstring

report-cert-eventclj

(report-cert-event report-activity
                   message
                   subject
                   certnames
                   ip-address
                   activity-type)

Log message and report to the activity service if available about cert activties, ie signing and revoking.

Log message and report to the activity service if available about cert activties, ie signing and revoking.
sourceraw docstring

required-ca-filesclj

(required-ca-files enable-infra-crl)

The set of SSL related files that are required on the CA.

The set of SSL related files that are required on the CA.
sourceraw docstring

retrieve-ca-cert!clj

(retrieve-ca-cert! cacert localcacert)

Inputs: [cacert :- schema/Str localcacert :- schema/Str]

Ensure a local copy of the CA cert is available on disk. cacert is the base CA cert file to copy from and localcacert is where the CA cert file should be copied to.

Inputs: [cacert :- schema/Str localcacert :- schema/Str]

Ensure a local copy of the CA cert is available on disk.  cacert is the base
CA cert file to copy from and localcacert is where the CA cert file should be
copied to.
sourceraw docstring

retrieve-ca-crl!clj

(retrieve-ca-crl! cacrl localcacrl)

Inputs: [cacrl :- schema/Str localcacrl :- schema/Str]

Ensure a local copy of the CA CRL, if one exists, is available on disk. cacrl is the base CRL file to copy from and localcacrl is where the CRL file should be copied to.

Inputs: [cacrl :- schema/Str localcacrl :- schema/Str]

Ensure a local copy of the CA CRL, if one exists, is available on disk.
cacrl is the base CRL file to copy from and localcacrl is where the CRL file
should be copied to.
sourceraw docstring

revoke-existing-certs!clj

(revoke-existing-certs! {:keys [cacert cacrl cakey infra-crl-path crl-lock
                                crl-lock-timeout-seconds infra-node-serials-path
                                enable-infra-crl]
                         :as settings}
                        subjects
                        report-activity)

Inputs: [{:keys [cacert cacrl cakey infra-crl-path crl-lock crl-lock-timeout-seconds infra-node-serials-path enable-infra-crl], :as settings} :- CaSettings subjects :- [schema/Str] report-activity]

Revoke the subjects' certificates. Note this does not destroy the certificates. The certificates will remain in the signed directory despite being revoked.

Inputs: [{:keys [cacert cacrl cakey infra-crl-path crl-lock crl-lock-timeout-seconds infra-node-serials-path enable-infra-crl], :as settings} :- CaSettings subjects :- [schema/Str] report-activity]

Revoke the subjects' certificates. Note this does not destroy the certificates.
 The certificates will remain in the signed directory despite being revoked.
sourceraw docstring

safe-get-cert-serialclj

(safe-get-cert-serial path-to-cert)

Inputs: [path-to-cert] Returns: [BigInteger]

Inputs: [path-to-cert]
Returns: [BigInteger]
sourceraw docstring

save-certificate-request!clj

(save-certificate-request! subject csr csrdir)

Inputs: [subject :- schema/Str csr :- CertificateRequest csrdir :- schema/Str]

Write the subject's certificate request to disk under the CSR directory.

Inputs: [subject :- schema/Str csr :- CertificateRequest csrdir :- schema/Str]

Write the subject's certificate request to disk under the CSR directory.
sourceraw docstring

serial-file-permissionsclj

source

serial-lock-descriptorclj

Text used in exceptions to help identify locking issues

Text used in exceptions to help identify locking issues
sourceraw docstring

set-certificate-status!clj

(set-certificate-status! settings subject desired-state report-activity)

Inputs: [settings :- CaSettings subject :- schema/Str desired-state :- DesiredCertificateState report-activity]

Sign or revoke the certificate for the given subject.

Inputs: [settings :- CaSettings subject :- schema/Str desired-state :- DesiredCertificateState report-activity]

Sign or revoke the certificate for the given subject.
sourceraw docstring

settings->cadir-pathsclj

(settings->cadir-paths ca-settings)

Inputs: [ca-settings :- CaSettings]

Trim down the CA settings to include only paths to files and directories. These paths are necessary during CA initialization for determining what needs to be created and where they should be placed.

Inputs: [ca-settings :- CaSettings]

Trim down the CA settings to include only paths to files and directories.
These paths are necessary during CA initialization for determining what needs
to be created and where they should be placed.
sourceraw docstring

settings->ssldir-pathsclj

(settings->ssldir-paths master-settings)

Inputs: [master-settings :- MasterSettings]

Remove all keys from the master settings map which are not file or directory paths. These paths are necessary during initialization for determining what needs to be created and where.

Inputs: [master-settings :- MasterSettings]

Remove all keys from the master settings map which are not file or directory
 paths. These paths are necessary during initialization for determining what
 needs to be created and where.
sourceraw docstring

sign-existing-csr!clj

(sign-existing-csr! {:keys [csrdir] :as settings} subject report-activity)

Inputs: [{:keys [csrdir], :as settings} :- CaSettings subject :- schema/Str report-activity]

Sign the subject's certificate request.

Inputs: [{:keys [csrdir], :as settings} :- CaSettings subject :- schema/Str report-activity]

Sign the subject's certificate request.
sourceraw docstring

sign-multiple-certificate-signing-requests!clj

(sign-multiple-certificate-signing-requests!
  subjects
  {:keys [cacert cakey csrdir inventory-lock inventory-lock-timeout-seconds
          serial-lock serial-lock-timeout-seconds]
   :as ca-settings}
  report-activity)

Inputs: [subjects :- [schema/Str] {:keys [cacert cakey csrdir inventory-lock inventory-lock-timeout-seconds serial-lock serial-lock-timeout-seconds], :as ca-settings} :- CaSettings report-activity] Returns: {:signed [schema/Str], :no-csr [schema/Str], :signing-errors [schema/Str]}

Inputs: [subjects :- [schema/Str] {:keys [cacert cakey csrdir inventory-lock inventory-lock-timeout-seconds serial-lock serial-lock-timeout-seconds], :as ca-settings} :- CaSettings report-activity]
Returns: {:signed [schema/Str], :no-csr [schema/Str], :signing-errors [schema/Str]}
sourceraw docstring

split-hostnamesclj

(split-hostnames hostnames)

Inputs: [hostnames :- (schema/maybe schema/Str)] Returns: (schema/maybe [schema/Str])

Given a comma-separated list of hostnames, return a list of the individual dns alt names with all surrounding whitespace removed. If hostnames is empty or nil, then nil is returned.

Inputs: [hostnames :- (schema/maybe schema/Str)]
Returns: (schema/maybe [schema/Str])

Given a comma-separated list of hostnames, return a list of the
individual dns alt names with all surrounding whitespace removed. If
hostnames is empty or nil, then nil is returned.
sourceraw docstring

ssl-client-certclj

OID which indicates that a certificate can be used as an SSL client certificate.

OID which indicates that a certificate can be used as an SSL client
certificate.
sourceraw docstring

ssl-server-certclj

OID which indicates that a certificate can be used as an SSL server certificate.

OID which indicates that a certificate can be used as an SSL server
certificate.
sourceraw docstring

stream-content-to-fileclj

(stream-content-to-file cert-inventory entry writer)
source

subject-alt-namesclj

(subject-alt-names cert-or-csr)

Inputs: [cert-or-csr :- CertificateOrCSR] Returns: [schema/Str]

Get the list of both DNS and IP alt names on the provided certificate or CSR. Each name will be prepended with 'DNS:' or 'IP:'.

Inputs: [cert-or-csr :- CertificateOrCSR]
Returns: [schema/Str]

Get the list of both DNS and IP alt names on the provided certificate or CSR.
 Each name will be prepended with 'DNS:' or 'IP:'.
sourceraw docstring

subject-alt-names-oidclj

source

supports-auto-renewal?clj

(supports-auto-renewal? csr)

Inputs: [csr] Returns: schema/Bool

Given a csr, determine if the requester is capable of supporting auto-renewal by looking for a specific attribute

Inputs: [csr]
Returns: schema/Bool

Given a csr, determine if the requester is capable of supporting auto-renewal by looking for a specific attribute
sourceraw docstring

(symlink-cadir cadir)

Symlinks the new cadir that ends in 'puppetserver/ca' to the old cadir of 'puppet/ssl/ca' for backwards compatibility. Will delete the old cadir if it exists. Does nothing if set to a custom value.

Symlinks the new cadir that ends in 'puppetserver/ca' to the old cadir
of 'puppet/ssl/ca' for backwards compatibility. Will delete the old cadir
if it exists. Does nothing if set to a custom value.
sourceraw docstring

TTLDurationclj

source

update-and-sign-crl!clj

(update-and-sign-crl!
  path-to-crl
  {:keys [crl-lock crl-lock-timeout-seconds cacert cakey capub] :as settings})

Inputs: [path-to-crl {:keys [crl-lock crl-lock-timeout-seconds cacert cakey capub], :as settings} :- CaSettings]

Given a path to a CRL, and the ca-settings, update the CRl with all known valid serials that have been revoked

Inputs: [path-to-crl {:keys [crl-lock crl-lock-timeout-seconds cacert cakey capub], :as settings} :- CaSettings]

Given a path to a CRL, and the ca-settings, update the CRl with all known valid serials that have been revoked
sourceraw docstring

update-crlsclj

(update-crls incoming-crls crl-path cert-chain-path)

Inputs: [incoming-crls :- [X509CRL] crl-path :- schema/Str cert-chain-path :- schema/Str]

Given a collection of CRLs, update the CRL chain and confirm that all CRLs are currently valid. NOTE: assumes appropriate locking is in place

Inputs: [incoming-crls :- [X509CRL] crl-path :- schema/Str cert-chain-path :- schema/Str]

Given a collection of CRLs, update the CRL chain and confirm that
all CRLs are currently valid.
NOTE: assumes appropriate locking is in place
sourceraw docstring

update-crls!clj

(update-crls! incoming-crls
              crl-path
              cacert
              {:keys [crl-lock crl-lock-timeout-seconds enable-infra-crl
                      infra-crl-path]})

Inputs: [incoming-crls :- [X509CRL] crl-path :- schema/Str cacert :- schema/Str {:keys [crl-lock crl-lock-timeout-seconds enable-infra-crl infra-crl-path]} :- CaSettings]

Apply write locking to the crls, and update the crls as appropriate.

Inputs: [incoming-crls :- [X509CRL] crl-path :- schema/Str cacert :- schema/Str {:keys [crl-lock crl-lock-timeout-seconds enable-infra-crl infra-crl-path]} :- CaSettings]

Apply write locking to the crls, and update the crls as appropriate.
sourceraw docstring

update-extensions-for-new-signingclj

(update-extensions-for-new-signing extensions ca-cert subject-public-key)

Inputs: [extensions :- utils/SSLExtensionList ca-cert :- X509Certificate subject-public-key :- PublicKey] Returns: utils/SSLExtensionList

Inputs: [extensions :- utils/SSLExtensionList ca-cert :- X509Certificate subject-public-key :- PublicKey]
Returns: utils/SSLExtensionList
sourceraw docstring

validate-certs-and-crlsclj

(validate-certs-and-crls cert-chain crl-chain)

Inputs: [cert-chain :- [Certificate] crl-chain :- [CertificateRevocationList]]

Given a list of certificates and a list of CRLs, validate the certificate chain, i.e. ensure that none of the certs have been revoked by checking the appropriate CRL, which must be present and currently valid. Delta CRLs are not supported. Returns nil if successful.

Inputs: [cert-chain :- [Certificate] crl-chain :- [CertificateRevocationList]]

Given a list of certificates and a list of CRLs, validate the certificate
 chain, i.e. ensure that none of the certs have been revoked by checking the
 appropriate CRL, which must be present and currently valid. Delta CRLs are
 not supported. Returns nil if successful.
sourceraw docstring

validate-csrclj

(validate-csr {:keys [csrdir allow-subject-alt-names
                      allow-authorization-extensions]
               :as _settings}
              subject)

Inputs: [{:keys [csrdir allow-subject-alt-names allow-authorization-extensions], :as _settings} :- CaSettings subject :- schema/Str]

Validates the CSR (on disk) for the specified subject. Assumes existence of the CSR on disk; duplicate CSR or certificate policy will not be checked. If the CSR is invalid, returns a user-facing message. Otherwise, returns nil.

Inputs: [{:keys [csrdir allow-subject-alt-names allow-authorization-extensions], :as _settings} :- CaSettings subject :- schema/Str]

Validates the CSR (on disk) for the specified subject.
 Assumes existence of the CSR on disk; duplicate CSR or
 certificate policy will not be checked.
 If the CSR is invalid, returns a user-facing message.
 Otherwise, returns nil.
sourceraw docstring

validate-csr-signature!clj

(validate-csr-signature! certificate-request)

Inputs: [certificate-request :- CertificateRequest]

Throws an exception when the CSR's signature is invalid. See signature-valid? for more detail.

Inputs: [certificate-request :- CertificateRequest]

Throws an exception when the CSR's signature is invalid.
See `signature-valid?` for more detail.
sourceraw docstring

validate-duplicate-cert-policy!clj

(validate-duplicate-cert-policy! csr
                                 {:keys [allow-duplicate-certs csrdir signeddir]
                                  :as settings})

Inputs: [csr :- CertificateRequest {:keys [allow-duplicate-certs csrdir signeddir], :as settings} :- CaSettings]

Throw a slingshot exception if allow-duplicate-certs is false, and we already have a certificate or CSR for the subject. The exception map will look like: {:kind :duplicate-cert :msg <specific error message>}

Inputs: [csr :- CertificateRequest {:keys [allow-duplicate-certs csrdir signeddir], :as settings} :- CaSettings]

Throw a slingshot exception if allow-duplicate-certs is false,
 and we already have a certificate or CSR for the subject.
 The exception map will look like:
 {:kind :duplicate-cert
  :msg  <specific error message>}
sourceraw docstring

validate-extensions!clj

(validate-extensions! extensions)

Inputs: [extensions :- (schema/pred utils/extension-list?)]

Throws an error if the extensions list contains any invalid extensions, according to allowed-extension?

Inputs: [extensions :- (schema/pred utils/extension-list?)]

Throws an error if the extensions list contains any invalid extensions,
according to `allowed-extension?`
sourceraw docstring

validate-settings!clj

(validate-settings! settings)

Inputs: [settings :- CaSettings]

Ensure config values are valid for basic CA behaviors.

Inputs: [settings :- CaSettings]

Ensure config values are valid for basic CA behaviors.
sourceraw docstring

validate-subject!clj

(validate-subject! hostname subject)

Inputs: [hostname :- schema/Str subject :- schema/Str]

Validate the CSR or certificate's subject name. The subject name must:

  • match the hostname specified in the HTTP request (the subject parameter)
  • not contain any non-printable characters or slashes
  • not contain any capital letters
  • not contain the wildcard character (*)
Inputs: [hostname :- schema/Str subject :- schema/Str]

Validate the CSR or certificate's subject name.  The subject name must:
  * match the hostname specified in the HTTP request (the `subject` parameter)
  * not contain any non-printable characters or slashes
  * not contain any capital letters
  * not contain the wildcard character (*)
sourceraw docstring

validate-subject-alt-names!clj

(validate-subject-alt-names! {value :value})

Inputs: [{value :value} :- Extension]

Validate that the provided Subject Alternative Names extension is valid for a cert signed by this CA. This entails:

  • Only DNS and IP alternative names are allowed, no other types
  • Each DNS name does not contain a wildcard character (*)
Inputs: [{value :value} :- Extension]

Validate that the provided Subject Alternative Names extension is valid for
a cert signed by this CA. This entails:
  * Only DNS and IP alternative names are allowed, no other types
  * Each DNS name does not contain a wildcard character (*)
sourceraw docstring

whitelist-matches?clj

(whitelist-matches? whitelist subject)

Inputs: [whitelist :- schema/Str subject :- schema/Str] Returns: schema/Bool

Test if the whitelist file contains an entry that matches the subject. Each line of the file is expected to contain a single entry, either as an exact certname or a domain-name glob, and will be evaluated verbatim. All blank lines and comment lines (starting with '#') will be ignored. If an invalid pattern is encountered, it will be logged and ignored.

Inputs: [whitelist :- schema/Str subject :- schema/Str]
Returns: schema/Bool

Test if the whitelist file contains an entry that matches the subject.
 Each line of the file is expected to contain a single entry, either as
 an exact certname or a domain-name glob, and will be evaluated verbatim.
 All blank lines and comment lines (starting with '#') will be ignored.
 If an invalid pattern is encountered, it will be logged and ignored.
sourceraw docstring

write-certclj

(write-cert cert path)

Inputs: [cert :- Certificate path :- schema/Str]

Encode a certificate to PEM format and write it to a file atomically and with appropriate permissions.

Inputs: [cert :- Certificate path :- schema/Str]

Encode a certificate to PEM format and write it to a file atomically and with
appropriate permissions.
sourceraw docstring

write-cert-to-inventory!clj

(write-cert-to-inventory! cert
                          {:keys [inventory-lock inventory-lock-timeout-seconds]
                           :as settings})

Inputs: [cert :- Certificate {:keys [inventory-lock inventory-lock-timeout-seconds], :as settings} :- CaSettings]

Same behavior as `write-cert-to-inventory-unlocked! but acquires the inventory lock prior to doing the work. Writes an entry into Puppet's inventory file for a given certificate. The location of this file is defined by Puppet's 'cert_inventory' setting. The inventory is a text file where each line represents a certificate in the following format: $SN $NB $NA /$S where:

  • $SN = The serial number of the cert. The serial number is formatted as a hexadecimal number, with a leading 0x, and zero-padded up to four digits, eg. 0x002f.
  • $NB = The 'not before' field of the cert, as a date/timestamp in UTC.
  • $NA = The 'not after' field of the cert, as a date/timestamp in UTC.
  • $S = The distinguished name of the cert's subject.
Inputs: [cert :- Certificate {:keys [inventory-lock inventory-lock-timeout-seconds], :as settings} :- CaSettings]

Same behavior as `write-cert-to-inventory-unlocked! but acquires the inventory lock prior to doing the work.
Writes an entry into Puppet's inventory file for a given certificate.
The location of this file is defined by Puppet's 'cert_inventory' setting.
The inventory is a text file where each line represents a certificate in the
following format:
$SN $NB $NA /$S
where:
  * $SN = The serial number of the cert.  The serial number is formatted as a
          hexadecimal number, with a leading 0x, and zero-padded up to four
          digits, eg. 0x002f.
  * $NB = The 'not before' field of the cert, as a date/timestamp in UTC.
  * $NA = The 'not after' field of the cert, as a date/timestamp in UTC.
  * $S  = The distinguished name of the cert's subject.
sourceraw docstring

write-cert-to-inventory-unlocked!clj

(write-cert-to-inventory-unlocked! cert {:keys [cert-inventory] :as settings})

Inputs: [cert :- Certificate {:keys [cert-inventory], :as settings} :- CaSettings]

Writes an entry into Puppet's inventory file for a given certificate. The location of this file is defined by Puppet's 'cert_inventory' setting. The inventory is a text file where each line represents a certificate in the following format: $SN $NB $NA /$S where:

  • $SN = The serial number of the cert. The serial number is formatted as a hexadecimal number, with a leading 0x, and zero-padded up to four digits, eg. 0x002f.
  • $NB = The 'not before' field of the cert, as a date/timestamp in UTC.
  • $NA = The 'not after' field of the cert, as a date/timestamp in UTC.
  • $S = The distinguished name of the cert's subject.
Inputs: [cert :- Certificate {:keys [cert-inventory], :as settings} :- CaSettings]

Writes an entry into Puppet's inventory file for a given certificate.
The location of this file is defined by Puppet's 'cert_inventory' setting.
The inventory is a text file where each line represents a certificate in the
following format:
$SN $NB $NA /$S
where:
  * $SN = The serial number of the cert.  The serial number is formatted as a
          hexadecimal number, with a leading 0x, and zero-padded up to four
          digits, eg. 0x002f.
  * $NB = The 'not before' field of the cert, as a date/timestamp in UTC.
  * $NA = The 'not after' field of the cert, as a date/timestamp in UTC.
  * $S  = The distinguished name of the cert's subject.
sourceraw docstring

write-crlclj

(write-crl crl path)

Inputs: [crl :- CertificateRevocationList path :- schema/Str]

Encode a CRL to PEM format and write it to a file atomically and with appropriate permissions.

Inputs: [crl :- CertificateRevocationList path :- schema/Str]

Encode a CRL to PEM format and write it to a file atomically and with
appropriate permissions.
sourceraw docstring

write-crlsclj

(write-crls crls path)

Inputs: [crls :- [CertificateRevocationList] path :- schema/Str]

Encode a list of CRLS to PEM format and write it to a file atomically and with appropriate permissions. Note, assumes proper locking is done.

Inputs: [crls :- [CertificateRevocationList] path :- schema/Str]

Encode a list of CRLS to PEM format and write it to a file atomically and
with appropriate permissions.  Note, assumes proper locking is done.
sourceraw docstring

write-csrclj

(write-csr csr path)

Inputs: [csr :- CertificateRequest path :- schema/Str]

Encode a CSR to PEM format and write it to a file atomically and with appropriate permissions.

Inputs: [csr :- CertificateRequest path :- schema/Str]

Encode a CSR to PEM format and write it to a file atomically and with
appropriate permissions.
sourceraw docstring

write-infra-serials-to-writerclj

(write-infra-serials-to-writer writer settings)

Inputs: [writer :- BufferedWriter settings :- CaSettings]

Inputs: [writer :- BufferedWriter settings :- CaSettings]
sourceraw docstring

write-local-cacrl!clj

(write-local-cacrl! localcacrl-path cacrl-contents)

Inputs: [localcacrl-path :- schema/Str cacrl-contents :- schema/Str] Returns: (schema/maybe Exception)

Spits the contents of 'cacrl-contents' string to the 'localcacrl' file location if the 'cacrl' string contains valid CRL pem data. On success, return nil. On failure, return the Exception captured from the failed attempt to parse the CRL pem data.

Inputs: [localcacrl-path :- schema/Str cacrl-contents :- schema/Str]
Returns: (schema/maybe Exception)

Spits the contents of 'cacrl-contents' string to the 'localcacrl' file
location if the 'cacrl' string contains valid CRL pem data. On success, return
nil. On failure, return the Exception captured from the failed attempt to
parse the CRL pem data.
sourceraw docstring

write-private-keyclj

(write-private-key key path)

Inputs: [key :- PrivateKey path :- schema/Str]

Encode a key to PEM format and write it to a file atomically and with appropriate permissions for a private key.

Inputs: [key :- PrivateKey path :- schema/Str]

Encode a key to PEM format and write it to a file atomically and with
appropriate permissions for a private key.
sourceraw docstring

write-public-keyclj

(write-public-key key path)

Inputs: [key :- PublicKey path :- schema/Str]

Encode a key to PEM format and write it to a file atomically and with appropriate permissions for a public key.

Inputs: [key :- PublicKey path :- schema/Str]

Encode a key to PEM format and write it to a file atomically and with
appropriate permissions for a public key.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close