Skip to content

import-certificate-file

Import a new certificate from a file into the S-Filer Portal certificate manager.

Syntax:

shell
sfiler-cli [options] import-certificate-file [command options]
Command optionsRequired / OptionalDescription
-aRequiredThe certificate alias (the certificate alias must be unique).
-fRequiredThe certificate file (.cer, .der, .p12 or .pfx).
-pwOptionalThe password for the certificate file (required only when importing a key pair).
-opwOptionalThe obfuscated password for the certificate file (required only when importing a key pair).
-dammOptionalIndicates the behavior if the specified alias already exists in the database. Possible values are: fail, replace or generate-new. Default value: fail.
-apply-configuratorOptionalThis property is used to indicate if the generated key pair must be used by the Administrative Console. If the value is set, it must point to a valid configuration file so the value could be inserted or replaced in the targeted file.

Example:

shell
./sfiler-config-cli.sh -l my-user -p my-password -cf "conf/sfiler.conf" import-certificate-file -a "My Imported Certificate" -f cert-to-import.cer

The execution of this command will import the certificate from the file cert-to-import.cer with the alias "My Imported Certificate" into the S-Filer Portal certificate manager.

If the same command is executed again, the command will return an error because the alias "My Imported Certificate" already exists in the database. To prevent this error, the -damm option can be used to specify the behavior if the alias already exists in the database.

The possible values are:

  • fail : the command will return an error (default value).
  • replace : the existing certificate with this alias will be deleted and the certificate will be inserted with the same alias.
  • generate-new : a new alias will be generated based on the one specified and the certificate will be imported with the specified alias.

When the certificate file is password-protected, the -pw or -opw option must be used to specify the password. If both options are used, -pw takes precedence.