salt.modules.win_certutil#
This module allows you to install certificates into the windows certificate manager.
salt '*' certutil.add_store salt://cert.cer 'TrustedPublisher'
- salt.modules.win_certutil.add_store(source, store, retcode=False, saltenv='base')#
Add the cert to the given Certificate Store
- Parameters:
source (str) -- The source certificate file. This is either the path to a local file or a file from the file server in the form of
salt://path/to/filestore (str) -- The certificate store to add the certificate to
retcode (
bool, optional) -- IfTrue, return the retcode instead of stdout. Default isFalse.saltenv (
str, optional) -- The salt environment to use. This is ignored if the path is local. Default isbase.
CLI Example:
salt '*' certutil.add_store salt://cert.cer TrustedPublisher salt '*' certutil.add_store C:\path\to\local.cer TrustedPublisher
- salt.modules.win_certutil.del_store(source, store, retcode=False, saltenv='base')#
Delete the cert from the given Certificate Store
- Parameters:
source (str) -- The source certificate file. This is either the path to a local file or a file from the file server in the form of
salt://path/to/filestore (str) -- The certificate store to delete the certificate from
retcode (
bool, optional) -- IfTrue, return the retcode instead of stdout. Default isFalsesaltenv (
str, optional) -- The salt environment to use. This is ignored if the path is local. Default isbase.
CLI Example:
salt '*' certutil.del_store salt://cert.cer TrustedPublisher salt '*' certutil.del_store 'C:\path\to\local.cer' TrustedPublisher
- salt.modules.win_certutil.get_cert_serial(cert_file, saltenv='base')#
Get the serial number of a certificate file
- Parameters:
- Returns:
The serial number of the certificate if found, otherwise
None.- Return type:
CLI Example:
salt '*' certutil.get_cert_serial <certificate name>
- salt.modules.win_certutil.get_stored_cert_serials(store)#
Get all of the certificate serials in the specified store
- store (str):
The store to get all the certificate serials from
- Returns:
A list of serial numbers found, or an empty list if none found
- Return type:
CLI Example:
salt '*' certutil.get_stored_cert_serials <store>