This command allows basic operations on SAP certificates store. It allows to list, create or remove PSEs, and upload or list X.509 certificates, which are used for SSL peer verification of remote servers.
STRUST Identity consists of PSE Context
and PSE Application
. Consequently, there are
defined multiple Storages
which are used as aliases for Identities.
List of available Storages
:
server_standard
:- PSE context:
SSLS
- PSE application:
DFAULT
- PSE context:
client_anonymous
:- PSE context:
SSLC
- PSE application:
ANONYM
- PSE context:
client_standard
:- PSE context:
SSLC
- PSE application:
SSLC
- PSE context:
- list
- createpse
- removepse
- createidentity
- getcsr
- putpkc
- upload
- putcertificate
- listcertificates
- dumpcertificates
List all existing STRUST identities.
sapcli strust list
Creates a new (or replaces an existing) PSE.
sapcli strust createpse [-i|--identity IDENTITY] [-s|--storage STORAGE] [--dn DN] [-k|--key-length KEY_LENGTH] [-l|--algorithm ALGORITHM] [--overwrite]
Parameters:
--identity
: STRUST identity (PSE context + PSE application). (Mutually exclusive with the option --storage)--storage
: Predefined STRUST identities. (Mutually exclusive with the option --identity)--dn
: Distinguished Name (LDAP DN) of PSE. (optional)--key-length
: Key Length of PSE file, default is2048
. (optional)--algorithm
: PSE file Encryption algorithm, default isRSAwithSHA256
. (optional)--overwrite
: Overwrite the existing PSE file, default isFalse
. (optional)
Deletes PSE based on STRUST identity.
sapcli strust removepse [-i|--identity IDENTITY] [-s|--storage STORAGE]
Parameters:
--identity
: STRUST identity (PSE context + PSE application). (Mutually exclusive with the option --storage)--storage
: Predefined STRUST identities. (Mutually exclusive with the option --identity)
Creates a new (or replaces an existing) STRUST Identity. The description will be store under the current users language settings.
sapcli strust createidentity [-i|--identity IDENTITY] [-s|--storage STORAGE] [-d|--description DESCRIPTION] [-l|--language-iso-code LANG-ISO-639] [--overwrite]
Parameters:
--identity
: STRUST identity (PSE context + PSE application). (Mutually exclusive with the option --storage)--storage
: Predefined STRUST identities. (Mutually exclusive with the option --identity)--description
: Identity Description. (optional)--language-iso-code
: Language of Identity Description - if not given, the language will be deduced from the current system locale. (optional)--overwrite
: Overwrite the existing Identity, default isFalse
. (optional)
Prints out Certificate Signing Request.
sapcli strust getcsr [-i|--identity IDENTITY] [-s|--storage STORAGE]
Parameters:
--identity
: STRUST identity (PSE context + PSE application). (Mutually exclusive with the option --storage)--storage
: Predefined STRUST identities. (Mutually exclusive with the option --identity)
Uploads Identity Certificate.
sapcli strust putpkc [-i|--identity IDENTITY] [-s|--storage STORAGE] PATH
Parameters:
--identity
: STRUST identity (PSE context + PSE application). (Mutually exclusive with the option --storage)--storage
: Predefined STRUST identities. (Mutually exclusive with the option --identity)PATH
: Path to the file containing the certificate (multiple can be specified), or-
to read fromstandard input
.
Uploads complete PSE file (and possibly replaces an existing PSE).
sapcli strust upload [-i|--identity IDENTITY] [-s|--storage STORAGE] [--pse-password PASSWORD] [--ask-pse-password] [--overwrite] PATH
Parameters:
--identity
: STRUST identity (PSE context + PSE application). (Mutually exclusive with the option --storage)--storage
: Predefined STRUST identities. (Mutually exclusive with the option --identity)--pse-password
: PSE export password. (optional)--aks-pse-password
: Ask for PSE export password. Ignored when password is specified using--pse-password
. (optional)--overwrite
: Overwrite the existing PSE file, default isFalse
. (optional)PATH
: Path to the PSE file in the form ofPKCS#12 (*.pfx)
.
Puts the given certificate onto list of trusted certificates of the give PSE. The certificate can be passed from local filesystem or read from input stream. Both the file and data in input stream shall be PEM encoded X.509 certificate.
sapcli strust putcertificate [-i|--identity IDENTITY] [-s|--storage STORAGE] [-a|--algorithm ALGORITHM] [-k|--key-length KEYLEGNTH] [-d|--dn DN] [-|PATH ...]
Parameters:
--identity
: STRUST identity (PSE context + PSE application). (Mutually exclusive with the option --storage)--storage
: Predefined STRUST identities. (Mutually exclusive with the option --identity)--algorithm
: Algorithm used to create a new PSE if the requeste does not exist--key-length
: Key-length used to create a new PSE if the requeste does not exist--dn
: Distinguished Name used to create a new PSE if the requeste does not existPATH
: Path to the certificate files in the form PEM encoded X.509.-
: if the symbol dash is used instead of PATH, the certifate will be read from STDIN
Prints out PSE certificate in the form PEM encoded X.509.
sapcli strust getowncert [-i|--identity IDENTITY] [-s|--storage STORAGE]
Parameters:
--identity
: STRUST identity (PSE context + PSE application). (Mutually exclusive with the option --storage)--storage
: Predefined STRUST identities. (Mutually exclusive with the option --identity)
Lists (briefly) all certificates from specified identities and stores.
sapcli strust listcertificates --store client_standard"
Dumps all certificates from specified identities and stores in PEM format.
sapcli strust dumpcertificates --store client_standard"
And this is how to process pem output in shell (csplit
and openssl
commands
have to be available). Each certificate will be stored as single file:
# output dump to a file
sapcli strust listcertificate --store client_standard > certs.pem
# split into files - one file per one certificate
csplit -s -z -f cert- certs.pem '/-----BEGIN CERTIFICATE-----/' '{*}'
# show issuer and expiration date for each certificatte
for $f in cert-* do; cat $f | openssl x509 -issuer -enddate -noout; done
were:
-s
skips printing output of file sizes-z
does not create empty files
- Storage
client_standart
is replaced byclient_standard
(fixed typo)