To create a new private key, you have to POST the private key as a JSON object to the https://<IP-address-of-SPS>/api/private_keys endpoint. For details, see Create a new object. The body of the POST request must contain a JSON object with the parameters listed in Element . The response to a successful POST message is a JSON object that includes the reference ID of the created private key in its key attribute. You can reference this ID in other parts of the configuration. Note that you can use a private-key object for only one purpose, that is, you cannot reference one object twice.
URL
POST https://<IP-address-of-SPS>/api/configuration/private_keys
-
Note that the GET method is not permitted on this endpoint, you cannot list the existing private keys. However, if you know the reference ID of a private key, you can display its properties:
GET https://<IP-address-of-SPS>/api/configuration/private_keys/<reference-ID-of-the-private-key;>
-
You cannot directly delete or modify a private key, the DELETE and PUT methods are not permitted on private key objects. To update a private key, create a new one, then update the object that uses the old private key to reference the new private key.
Table 5: Headers
Content-Type |
Specifies the type of the data sent. SPS uses the JSON format |
Required |
application/json |
session_id |
Contains the authentication token of the user |
Required |
The value of the session ID cookie received from the REST server in the authentication response, for example, a1f71d030e657634730b9e887cb59a5e56162860. For details on authentication, see Authenticate to the SPS REST API. |
Sample request
The following command creates a new private key object. Note the following requirements:
-
The key must be in PKCS-1 or PKCS-8 PEM format.
-
Encrypted private keys are not supported.
-
The body of the POST message must be the private key as a single line, enclosed in double-quotes.
-
Replace line-breaks in the PEM file with \n
curl -X POST -H "Content-Type: application/json" --cookie cookies https://<IP-address-of-SPS>/api/configuration/private_keys --data "-----BEGIN RSA PRIVATE KEY-----\nMIIEpAIBAAKCAQEAu3QMMhqeg9ZMLNfdvQoNN1deVRE2SR0VKY+ALnzPZF4fUoJy\n.....\nI2SchDibk/Xj/ZvuEQ23LvzayWOVVuVHtH3JZX3SU4Sa0vpaeC+3oddVTwQOWRq0\n ......... Qbn5W3xKz4vXDDQHEbEsvDQ9A7+uCEuHpO4s33IK9KEa0Zdp745AU0DSGXN4HFzc\n-----END RSA PRIVATE KEY-----\n"
Querying a specific key returns the following information about the key:
curl --cookie cookies https://<IP-address-of-SPS>/api/configuration/private_keys/<reference-ID-of-the-private-key;>
public-key-fingerprint |
|
string |
The fingerprint of the public key that matches the private key. |
|
digest |
string |
The fingerprint of the key, for example 2048 SHA256:JPKdfkT6wU9c11bbqX53hovDo7KbIB8OREfumUWDh9f no comment (RSA) |
|
hash_algorithm |
string |
The hash algorithm used to create the fingerprint, for example, sha256. |
type |
string |
The type of the private key. Must be rsa |
Response
The response to a successful POST message is a JSON object that includes the reference ID of the created public key in its key attribute.
For details of the meta object, see Message format.
{
"key": "faa96916-c85e-46ff-8697-f4cc5e596e7f",
"meta": {
"href": "/api/configuration/private_keys/faa96916-c85e-46ff-8697-f4cc5e596e7f",
"parent": "/api/configuration/private_keys",
"transaction": "/api/transaction"
}
}
The response to querying a specific key is a JSON object that includes the parameters of the key, for example:
{
"body": {
"public-key-fingerprint": {
"digest": "2048 SHA256:JPKdfkT6wU9c11bbqX53hovDo7KbIB8OREfumUWDh9f no comment (RSA)",
"hash_algorithm": "sha256"
},
"type": "rsa"
},
"key": "6c4d1116-d79d-475b-bb37-9f844f085c14",
"meta": {
"first": "/api/configuration/private_keys/e5d13d18-07c5-43fa-89f4-c3d2ece17c71",
"href": "/api/configuration/private_keys/6c4d1116-d79d-475b-bb37-9f844f085c14",
"last": "/api/configuration/private_keys/6c4d1116-d79d-475b-bb37-9f844f085c14",
"next": null,
"parent": "/api/configuration/private_keys",
"previous": "/api/configuration/private_keys/e5d13d18-07c5-43fa-89f4-c3d2ece17c71",
"transaction": "/api/transaction"
}
Status and error codes
The following table lists the typical status and error codes for this request. For a complete list of error codes, see Application level error codes.
201 |
Created |
The new resource was successfully created. |
400 |
SyntacticError |
Syntax error: Could not load PEM key: Unsupported private key format, only PKCS-1 and PKCS-8 is supported. Encrypted private keys are not supported. |
401 |
Unauthenticated |
The requested resource cannot be retrieved because the client is not authenticated and the resource requires authorization to access it. The details section contains the path that was attempted to be accessed, but could not be retrieved. |
403 |
Unauthorized |
The requested resource cannot be retrieved because the client is not authorized to access it. The details section contains the path that was attempted to be accessed, but could not be retrieved. |
404 |
NotFound |
The requested object does not exist. |
405 |
MethodNotAllowed |
The method <method> is not allowed for this node. |
Modify or delete private key
You cannot directly delete or modify a private key, the DELETE and PUT methods are not permitted on private key objects. To update a private key, create a new one, then update the object that uses the old private key to reference the new private key. After you commit the transaction, SPS will automatically delete the old private key.
In some security contexts it might be a requirement to generate private keys on the appliance so that you can avoid any kind of eavesdropping during the transfer of the unencrypted key. Safeguard for Privileged Sessions supports generating Elliptic Curve (secp256r1) private keys on its REST API. You must use the REST API to use the generated key in the configuration. SPS supports the on-box generated private keys to be used for the following purposes:
-
for the web server, timestamping authority or CA (/api/configuration/management/certificates, see Internal certificates)
-
SMTP client authentication (/api/configuration/management/email, see Mail settings)
-
Syslog client authentication (/api/configuration/management/syslog, see Syslog server settings)
-
LDAP client authentication (for policies: /api/configuration/policies/ldap_servers, see LDAP servers, and for authentication: /api/configuration/aaa/ldap_servers, see Configuring LDAP servers)
Overview of the steps required to use on-box generated private keys in the configuration:
-
Generate a private key and a certificate signing request (CSR).
-
Obtain the CSR and send it to a certificate authority (CA). The required steps for performing the validation are mandated by the CA.
-
Once the CA signs the certificate, upload it to SPS.
-
Change the relevant REST configuration element to refer to the freshly generated 'X.509 identifier' (which is a reference to a private key and the associated certificate chain).
-
(Optional): You might want to delete the private key if you want to prevent the key to be used for a different purpose on the SPS.
NOTE: In this case, whenever the certificate expires, you must generate a fresh private key and CSR.
Perequisites: A certificate authority must be configured in Trust stores.
URL
https://<IP-address-of-SPS>/api/pki/certificate
Table 6: Headers
Content-Type |
Specifies the type of the data sent. SPS uses the JSON format |
Required |
application/json |
session_id |
Contains the authentication token of the user |
Required |
The value of the session ID cookie received from the REST server in the authentication response, for example, a1f71d030e657634730b9e887cb59a5e56162860. For details on authentication, see Authenticate to the SPS REST API. |
Operations
Operations with the /api/pki/certificate endpoint include:
Generating a new CSR |
POST |
/api/pki/certificate/requests |
|
Adding an X.509 certificate chain to a CSR to create a X.509 identifier |
PUT |
/api/pki/certificate/requests/<ID-of-the-CSR> |
|
Setting or replacing a certificate chain for a CSR without knowing the CSR identifier |
POST |
/api/pki/certificate |
X.509 identifier that have been referenced in the configuration will not be updated automatically, when you replace a certificate chain for a CSR. If you want to use the newly created X.509 identifier, you must set or update the reference to it in the configuration. |
Querying existing CSRs |
GET |
/api/pki/certificate/requests |
Querying a single CSR
|
GET |
/api/pki/certificate/requests/<ID-of-the-CSR> |
|
Deleting a CSR
|
DELETE |
/api/pki/certificate/requests/<ID-of-the-CSR> |
Deleting a CSR does not remove the corresponding X.509 identifier from the configuration, that is, the existing private key and certificate chain pair remains in use until you update the reference. Unreferenced X.509 identifier are removed automatically. |
Example: Generating a new CSR
The following command creates a new CSR.
curl --cookie cookies https://<IP-address-of-SPS>/api/pki/certificate/requests
{
"subject": [
{"name": "countryName", "value": "US"},
{"name": "stateOrProvinceName", "value": "CA"},
{"name": "streetAddress", "value": "Example Street"},
{"name": "organizationName", "value": "Example Organization"},
{"name": "commonName", "value": "first.example.com"},
{"name": "emailAddress", "value": "info@example.com"}
],
"extensions": [
{"name": "basicConstraints", "value": "CA:FALSE", "critical": true},
{"name": "keyUsage", "value": "digitalSignature,keyAgreement", "critical": true},
{"name": "extendedKeyUsage", "value": "clientAuth", "critical": false},
{"name": "subjectAltName", "value": "IP:123.123.123.123,DNS:example2.organization.com", "critical": false}
]
}
Elements of the request message body include:
subject |
|
|
|
subject.name |
string |
The subject name must be an object identifier (OID), or a name that can be translated to an OID. |
Example values are:
- countryName
- stateOrProvinceName
- streetAddress
- organizationName
- commonName
- emailAddress
|
subject.value |
string |
|
|
extensions |
object |
The list of extensions. |
If you do not want to specify any extensions in the request, use an empty list. |
extensions.name |
enum |
The name of the extension. |
Possible values are:
- basicConstraints
- keyUsage
- extendedKeyUsage
- subjectAltName
- subjectInfoAccess
|
extensions.value |
string |
The value of the extension. |
|
extensions.critical |
boolean |
Indicates whether the extension should be marked as critical in the request. |
|
Response
The following is a sample response received when a new CSR is created.
For details of the meta object, see Message format.
{
"key": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
"meta": {
"href": "/api/pki/certificate/requests/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
"parent": "/api/pki/certificate/requests"
}
}
Setting or updating a certificate chain for a CSR
There are two ways to set or update a certificate chain for a CSR:
-
Use a PUT request, if you know the CSR identifier.
-
Use a POST request, if you do not know the CSR identifier. In this case the REST API automatically selects the CSR based on the information in the first certificate in the chain.
Example with PUT request: Replacing a web server certificate
To replace a web server certificate, you have to
-
Generate a new CSR. You can find a detailed description of the available parameters listed in the request message body table of Example: Generating a new CSR. The result will be the identifier of the new CSR.
-
Send a GET request to the https://<IP-address-of-SPS>/api/pki/certificate/requests/<ID-of-the-CSR> endpoint. Obtain the PEM value of the CSR.
-
Send the CSR to the trusted certificate authority (CA).
The CA validates your request for using the stored certificate. If the validation is successful, it will respond with a signed X.509 certificate chain. The first element of this certificate chain must be the certificate to be used by SPS. The chain might contain CA certificates in the hierarchy.
-
-
Open a transaction.
For more information, see Open a transaction.
-
Send a PUT request to the https://<IP-address-of-SPS>/api/pki/certificate/requests/<ID-of-the-CSR> endpoint. The request must include:
-
the X.509 certificate chain
-
the identifier of the trust store that is used to validate the certificate chain, or null, if you want to disable validation
{
"certificate_chain": "-----BEGIN CERTIFICATE-----\nMIID+zCCAeOgAwIBAgIBTDANBgkqhkiG9w0BAQsFADAXMRUwEwYDVQQDDAxFeGFt\ncGxlIENBIDIwHhcNMjAwODMxMTIyMDU2WhcNMzAxMDE4MTIyMDU2WjCBsjELMAkG\nA1UEBhMCVVMxCzAJBgNVBAgMAkNBMRcwFQYDVQQHDA5FeGFtcGxlIENpdHkgMjEf\nMB0GA1UECgwWRXhhbXBsZSBPcmdhbml6YXRpb24gMjEVMBMGA1UECwwMRXhhbXBs\nZSBVbml0MRowGAYDVQQDDBF0aGlyZC5leGFtcGxlLmNvbTEOMAwGA1UEEQwFMTIz\nNDUxGTAXBgNVBAkMEEV4YW1wbGUgU3RyZWV0IDIwWTATBgcqhkjOPQIBB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EV4YW1wbGUgQ0EgMoIBAjANBgkq\nhkiG9w0BAQ0FAAOCAgEAkf2J2M4eHDnRTGQsZTcs91SdV/2fH0W+NLTRdGO9V0NL\nKMRXrlJ8Gy3A/4U/Hx5Lo4dQQckePTdXzFQARX5m/7VIf2+YlUDlNre/fMt5aeWG\n67vlUnUYLqgHqV2G5QmqZ26DUwcMTXK3oy8rqel1xtQAk1Cpfdvfi7gn2cEFRD7U\nexg3AemJMBV26spcGnaf/smfcHeVWo9lwqzyWzwvGYTEeb1MajCgINnh39DZBHlO\nPE77yRyuANtDzWMo0ZNnlU+FpHTexhooQnYRKtEagHDTTF2ZuSkcJnczlTFAP4cM\ntvEro4ePMdxLuMf4lVrBt+OudsVnoij+U9OHJst7Czk5MXyZzGHgkmXOg+JUW49D\nOfjDq0HiW64QeWYu+lsEFS+2sHES82R/JBmXWbqHy68JhDUubzAi7nRXEHkKP9N3\nXF6jD3Fyn47kN4uYeHas9eCvMFmxfv6TGzCPgfS9PH0ZaZLM/Cp6u9l4DhyvFV9n\nuazsa9pkwlQftE8L1Xo/hGmKBdLGJDRDQo1r4eYYZlzS94tj5p0thztTmUWZFOl2\ndOTyux8EvhpsefDYwtlJ1wxqvFdDm5WGCxeZd6YAsV/KukVQLakX1LS/i7FEFsuL\nZ89WjWdHC2A3liKOa/y0/vy9gOY7GScvRnyUSthQ2Y0DYO89KDzY6Q6ILbpsVr8=\n-----END CERTIFICATE-----",
"trust_store": "2222"
}
Elements of the request message body include:
certificate_chain |
string or list |
The certificate chain can be specified as a string of individual certificates separated by a newline, or as a list of strings containing the certificates. The certificates must be specified in PEM format. |
|
trust_store |
string |
The identifier of the trust store that is used to validate the certificate chain, or null, if you want to disable validation. |
|
The result will be the X.509 identifier referring to the private key + certificate chain pair.
NOTE: The X.509 identifier can only be used in REST configuration.
-
Use the X.509 identifier to replace your web server certificate. For more information, see Internal certificates.
-
-
Commit your changes.
For more information, see Commit a transaction.
Example with POST request: Replacing a web server certificate
To replace a web server certificate without knowing the CSR identifier, you have to
-
Generate a new CSR. You can find a detailed description of the available parameters listed in the request message body table of Example: Generating a new CSR. The result will be the identifier of the new CSR.
-
Send a GET request to the https://<IP-address-of-SPS>/api/pki/certificate/requests/<ID-of-the-CSR> endpoint. Obtain the PEM value of the CSR.
-
Send the CSR to the trusted certificate authority (CA).
The CA validates your request for using the stored certificate. If the validation is successful, it will respond with a signed X.509 certificate chain. The first element of this certificate chain must be the certificate to be used by SPS. The chain might contain CA certificates in the hierarchy.
-
-
Open a transaction.
For more information, see Open a transaction.
-
Send a POST request to the https://<IP-address-of-SPS>/api/pki/certificate endpoint. The request must include:
-
the X.509 certificate chain
-
the identifier of the trust store that is used to validate the certificate chain, or null, if you want to disable validation
{
"certificate_chain": "-----BEGIN CERTIFICATE-----\nMIID+zCCAeOgAwIBAgIBTDANBgkqhkiG9w0BAQsFADAXMRUwEwYDVQQDDAxFeGFt\ncGxlIENBIDIwHhcNMjAwODMxMTIyMDU2WhcNMzAxMDE4MTIyMDU2WjCBsjELMAkG\nA1UEBhMCVVMxCzAJBgNVBAgMAkNBMRcwFQYDVQQHDA5FeGFtcGxlIENpdHkgMjEf\nMB0GA1UECgwWRXhhbXBsZSBPcmdhbml6YXRpb24gMjEVMBMGA1UECwwMRXhhbXBs\nZSBVbml0MRowGAYDVQQDDBF0aGlyZC5leGFtcGxlLmNvbTEOMAwGA1UEEQwFMTIz\nNDUxGTAXBgNVBAkMEEV4YW1wbGUgU3RyZWV0IDIwWTATBgcqhkjOPQIBBggqhkjO\nPQMBBwNCAASYBjc7KadwuOFlI4YAPxtBUxc1fUj9DIguud5Bl+06jTdPnTqVo00w\n23LO0ILzuJ+JXMc8gvv+BtRhzrNM1IYao4GAMH4wCQYDVR0TBAIwADALBgNVHQ8E\nBAMCA4gwEwYDVR0lBAwwCgYIKwYBBQUHAwIwEQYJYIZIAYb4QgEBBAQDAgeAMB0G\nA1UdDgQWBBSt0NXz4/3yMPCmfoz8hurej0mByzAdBgNVHREEFjAUgh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VWo9lwqzyWzwvGYTEeb1MajCgINnh39DZBHlO\nPE77yRyuANtDzWMo0ZNnlU+FpHTexhooQnYRKtEagHDTTF2ZuSkcJnczlTFAP4cM\ntvEro4ePMdxLuMf4lVrBt+OudsVnoij+U9OHJst7Czk5MXyZzGHgkmXOg+JUW49D\nOfjDq0HiW64QeWYu+lsEFS+2sHES82R/JBmXWbqHy68JhDUubzAi7nRXEHkKP9N3\nXF6jD3Fyn47kN4uYeHas9eCvMFmxfv6TGzCPgfS9PH0ZaZLM/Cp6u9l4DhyvFV9n\nuazsa9pkwlQftE8L1Xo/hGmKBdLGJDRDQo1r4eYYZlzS94tj5p0thztTmUWZFOl2\ndOTyux8EvhpsefDYwtlJ1wxqvFdDm5WGCxeZd6YAsV/KukVQLakX1LS/i7FEFsuL\nZ89WjWdHC2A3liKOa/y0/vy9gOY7GScvRnyUSthQ2Y0DYO89KDzY6Q6ILbpsVr8=\n-----END CERTIFICATE-----",
"trust_store": "2222"
}
Elements of the request message body include:
certificate_chain |
string or list |
The certificate chain can be specified as a string of individual certificates separated by a newline, or as a list of strings containing the certificates. The certificates must be specified in PEM format. |
|
trust_store |
string |
The identifier of the trust store that is used to validate the certificate chain, or null, if you want to disable validation. |
|
The result will be the X.509 identifier referring to the private key + certificate chain pair.
NOTE: The X.509 identifier can only be used in REST configuration.
-
Use the X.509 identifier to replace your web server certificate. For more information, see Internal certificates.
-
-
Commit your changes.
For more information, see Commit a transaction.
Example: Querying existing CSRs
The following is a sample response received when existing CSRs are queried.
For details of the meta object, see Message format.
{
"meta": {
"href": "/api/pki/certificate/requests",
"parent": "/api/pki/certificate"
},
"items": [
{
"meta": {"href": "/api/pki/certificate/requests/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"},
"key": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
"body": {
"certificate_chain": null,
"fingerprint": {
"digest": "eb:46:b6:bf:dc:4e:c6:cb:81:9b:ee:fd:a1:8d:7d:72:86:3d:48:87:ba:94:e0:0c:79:8e:73:77:fd:5b:97:3b",
"hash_algorithm": "sha256"
},
"subject": [
{"name": "countryName", "value": "US"},
{"name": "stateOrProvinceName", "value": "CA"},
{"name": "streetAddress", "value": "Example Street"},
{"name": "organizationName", "value": "Example Organization"},
{"name": "commonName", "value": "first.example.com"},
{"name": "emailAddress", "value": "info@example.com"}
],
"extensions": [
{"name": "basicConstraints", "value": "CA:FALSE", "critical": true},
{"name": "keyUsage", "value": "digitalSignature,keyAgreement", "critical": true},
{"name": "extendedKeyUsage", "value": "clientAuth","critical": false},
{"name": "subjectAltName", "value": "IP:123.123.123.123,DNS:second.example.com", "critical": false}
],
"pem": "-----BEGIN CERTIFICATE REQUEST-----\nMIICPzCCAeQCAQAwgegxCzAJBgNVBAYTAlVTMQ4wDAYDVQQRDAUxMjM0NTELMAkG\nA1UECAwCQ0ExFTATBgNVBAcMDEV4YW1wbGUgQ2l0eTEXMBUGA1UECQwORXhhbXBs\nZSBTdHJlZXQxHTAbBgNVBAoMFEV4YW1wbGUgT3JnYW5pemF0aW9uMRcwFQYDVQQL\nDA5FeGFtcGxlIFVuaXQgMTEXMBUGA1UECwwORXhhbXBsZSBVbml0IDIxGjAYBgNV\nBAMMEWZpcnN0LmV4YW1wbGUuY29tMR8wHQYJKoZIhvcNAQkBFhBpbmZvQGV4YW1w\nbGUuY29tMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEC/MAO3IIhG6zInpQxOJ9\nfFnOQlW11IoeMXHfhrhRC9OI9W77MjxRNX7gXS1WVcEQPxgXtE9sHdc6Z8jgupIi\ncKCBmDCBlQYJKoZIhvcNAQkOMYGHMIGEMAkGA1UdEwQCMAAwCwYDVR0PBAQDAgOI\nMBMGA1UdJQQMMAoGCCsGAQUFBwMCMBEGCWCGSAGG+EIBAQQEAwIGQDAdBgNVHQ4E\nFgQUDr0ZP/F5s++a46mW+yIgs1CNWwYwIwYDVR0RBBwwGocEe3t7e4ISc2Vjb25k\nLmV4YW1wbGUuY29tMAoGCCqGSM49BAMEA0kAMEYCIQCrRLitgHeDJ34VSksqwbZy\nUA0Klz6l2EzrRHGR0UOPbAIhAKA7u8xplNauUutkQPd4KHT5eyBMs0GUYJm1gr3r\ntZFr\n-----END CERTIFICATE REQUEST-----\n",
"public_key": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEC/MAO3IIhG6zInpQxOJ9fFnOQlW1\n1IoeMXHfhrhRC9OI9W77MjxRNX7gXS1WVcEQPxgXtE9sHdc6Z8jgupIicA==\n-----END PUBLIC KEY-----\n"
}
},
{
"meta": {"href": "/api/pki/certificate/requests/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXY"},
"key": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXY",
"body": {
"certificate_chain": [
"-----BEGIN CERTIFICATE-----\nMIID+zCCAeOgAwIBAgIBSzANBgkqhkiG9w0BAQsFADAXMRUwEwYDVQQDDAxFeGFt\ncGxlIENBIDIwHhcNMjAwNzE0MTUxMzAwWhcNMzAwODMxMTUxMzAwWjCBsjELMAkG\nA1UEBhMCVVMxCzAJBgNVBAgMAkNBMRcwFQYDVQQHDA5FeGFtcGxlIENpdHkgMjEf\nMB0GA1UECgwWRXhhbXBsZSBPcmdhbml6YXRpb24gMjEVMBMGA1UECwwMRXhhbXBs\nZSBVbml0MRowGAYDVQQDDBF0aGlyZC5leGFtcGxlLmNvbTEOMAwGA1UEEQwFMTIz\nNDUxGTAXBgNVBAkMEEV4YW1wbGUgU3RyZWV0IDIwWTATBgcqhkjOPQIBBggqhkjO\nPQMBBwNCAASYBjc7KadwuOFlI4YAPxtBUxc1fUj9DIguud5Bl+06jTdPnTqVo00w\n23LO0ILzuJ+JXMc8gvv+BtRhzrNM1IYao4GAMH4wCQYDVR0TBAIwADALBgNVHQ8E\nBAMCA4gwEwYDVR0lBAwwCgYIKwYBBQUHAwIwEQYJYIZIAYb4QgEBBAQ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UwcMTXK3oy8rqel1xtQAk1Cpfdvfi7gn2cEFRD7U\nexg3AemJMBV26spcGnaf/smfcHeVWo9lwqzyWzwvGYTEeb1MajCgINnh39DZBHlO\nPE77yRyuANtDzWMo0ZNnlU+FpHTexhooQnYRKtEagHDTTF2ZuSkcJnczlTFAP4cM\ntvEro4ePMdxLuMf4lVrBt+OudsVnoij+U9OHJst7Czk5MXyZzGHgkmXOg+JUW49D\nOfjDq0HiW64QeWYu+lsEFS+2sHES82R/JBmXWbqHy68JhDUubzAi7nRXEHkKP9N3\nXF6jD3Fyn47kN4uYeHas9eCvMFmxfv6TGzCPgfS9PH0ZaZLM/Cp6u9l4DhyvFV9n\nuazsa9pkwlQftE8L1Xo/hGmKBdLGJDRDQo1r4eYYZlzS94tj5p0thztTmUWZFOl2\ndOTyux8EvhpsefDYwtlJ1wxqvFdDm5WGCxeZd6YAsV/KukVQLakX1LS/i7FEFsuL\nZ89WjWdHC2A3liKOa/y0/vy9gOY7GScvRnyUSthQ2Y0DYO89KDzY6Q6ILbpsVr8=\n-----END CERTIFICATE-----\n"
],
"fingerprint": {
"digest": "a3:34:5a:77:3d:14:da:a6:d7:de:7a:43:4d:e3:2c:36:35:53:74:5c:61:cf:c1:39:bb:75:50:40:29:30:dc:2e",
"hash_algorithm": "sha256"
},
"subject": [
{"name": "countryName", "value": "US"},
{"name": "stateOrProvinceName", "value": "CA"},
{"name": "streetAddress", "value": "Example Street 2"},
{"name": "organizationName", "value": "Example Organization 2"},
{"name": "commonName", "value": "third.example.com"},
{"name": "emailAddress", "value": "info2@example.com"}
],
"extensions": [
{"name": "basicConstraints", "value": "CA:FALSE", "critical": true},
{"name": "keyUsage", "value": "digitalSignature,keyAgreement", "critical": true},
{"name": "extendedKeyUsage", "value": "clientAuth", "critical": false},
{"name": "subjectAltName", "value": "DNS:fourth.example.com", "critical": false}
],
"pem": "-----BEGIN CERTIFICATE REQUEST-----\nMIICIzCCAckCAQAwgdQxCzAJBgNVBAYTAlVTMQ4wDAYDVQQRDAUxMjM0NTELMAkG\nA1UECAwCQ0ExFzAVBgNVBAcMDkV4YW1wbGUgQ2l0eSAyMRkwFwYDVQQJDBBFeGFt\ncGxlIFN0cmVldCAyMR8wHQYDVQQKDBZFeGFtcGxlIE9yZ2FuaXphdGlvbiAyMRUw\nEwYDVQQLDAxFeGFtcGxlIFVuaXQxGjAYBgNVBAMMEXRoaXJkLmV4YW1wbGUuY29t\nMSAwHgYJKoZIhvcNAQkBFhFpbmZvMkBleGFtcGxlLmNvbTBZMBMGByqGSM49AgEG\nCCqGSM49AwEHA0IABJgGNzspp3C44WUjhgA/G0FTFzV9SP0MiC653kGX7TqNN0+d\nOpWjTTDbcs7QgvO4n4lcxzyC+/4G1GHOs0zUhhqggZEwgY4GCSqGSIb3DQEJDjGB\ngDB+MAkGA1UdEwQCMAAwCwYDVR0PBAQDAgOIMBMGA1UdJQQMMAoGCCsGAQUFBwMC\nMBEGCWCGSAGG+EIBAQQEAwIHgDAdBgNVHQ4EFgQUrdDV8+P98jDwpn6M/Ibq3o9J\ngcswHQYDVR0RBBYwFIISZm91cnRoLmV4YW1wbGUuY29tMAoGCCqGSM49BAMEA0gA\nMEUCIQDn5/JLVu3TGZqBXodETmj6ndamg9wFi7bxow4krngQtQIgTaDXwBvl0L36\ncHEQP5At2ss8kKB4QIxEFeesGgMkwx8=\n-----END CERTIFICATE REQUEST-----\n",
"public_key": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEmAY3OymncLjhZSOGAD8bQVMXNX1I\n/QyILrneQZftOo03T506laNNMNtyztCC87ifiVzHPIL7/gbUYc6zTNSGGg==\n-----END PUBLIC KEY-----\n"
}
}
]
}
Example: Querying a single CSR
The following is a sample response received when a single CSR is queried.
For details of the meta object, see Message format.
{
"meta": {
"href": "/api/pki/certificate/requests/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
"parent": "/api/pki/certificate/requests"
},
"key": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
"body": {
"certificate_chain": null,
"fingerprint": {
"digest": "eb:46:b6:bf:dc:4e:c6:cb:81:9b:ee:fd:a1:8d:7d:72:86:3d:48:87:ba:94:e0:0c:79:8e:73:77:fd:5b:97:3b",
"hash_algorithm": "sha256"
},
"subject": [
{"name": "countryName", "value": "US"},
{"name": "stateOrProvinceName", "value": "CA"},
{"name": "streetAddress", "value": "Example Street"},
{"name": "organizationName", "value": "Example Organization"},
{"name": "commonName", "value": "first.example.com"},
{"name": "emailAddress", "value": "info@example.com"}
],
"extensions": [
{"name": "basicConstraints", "value": "CA:FALSE", "critical": true},
{"name": "keyUsage", "value": "digitalSignature,keyAgreement", "critical": true},
{"name": "extendedKeyUsage", "value": "clientAuth", "critical": false},
{"name": "subjectAltName", "value": "IP:123.123.123.123,DNS:second.example.com", "critical": false}
],
"pem": "-----BEGIN CERTIFICATE REQUEST-----\nMIICPzCCAeQCAQAwgegxCzAJBgNVBAYTAlVTMQ4wDAYDVQQRDAUxMjM0NTELMAkG\nA1UECAwCQ0ExFTATBgNVBAcMDEV4YW1wbGUgQ2l0eTEXMBUGA1UECQwORXhhbXBs\nZSBTdHJlZXQxHTAbBgNVBAoMFEV4YW1wbGUgT3JnYW5pemF0aW9uMRcwFQYDVQQL\nDA5FeGFtcGxlIFVuaXQgMTEXMBUGA1UECwwORXhhbXBsZSBVbml0IDIxGjAYBgNV\nBAMMEWZpcnN0LmV4YW1wbGUuY29tMR8wHQYJKoZIhvcNAQkBFhBpbmZvQGV4YW1w\nbGUuY29tMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEC/MAO3IIhG6zInpQxOJ9\nfFnOQlW11IoeMXHfhrhRC9OI9W77MjxRNX7gXS1WVcEQPxgXtE9sHdc6Z8jgupIi\ncKCBmDCBlQYJKoZIhvcNAQkOMYGHMIGEMAkGA1UdEwQCMAAwCwYDVR0PBAQDAgOI\nMBMGA1UdJQQMMAoGCCsGAQUFBwMCMBEGCWCGSAGG+EIBAQQEAwIGQDAdBgNVHQ4E\nFgQUDr0ZP/F5s++a46mW+yIgs1CNWwYwIwYDVR0RBBwwGocEe3t7e4ISc2Vjb25k\nLmV4YW1wbGUuY29tMAoGCCqGSM49BAMEA0kAMEYCIQCrRLitgHeDJ34VSksqwbZy\nUA0Klz6l2EzrRHGR0UOPbAIhAKA7u8xplNauUutkQPd4KHT5eyBMs0GUYJm1gr3r\ntZFr\n-----END CERTIFICATE REQUEST-----\n",
"public_key": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEC/MAO3IIhG6zInpQxOJ9fFnOQlW1\n1IoeMXHfhrhRC9OI9W77MjxRNX7gXS1WVcEQPxgXtE9sHdc6Z8jgupIicA==\n-----END PUBLIC KEY-----\n"
}
}
Elements of the response message body include:
certificate_chain |
string |
The certificate chain received from the trusted CA. |
|
fingerprint |
object |
|
|
fingerprint.digest |
string |
The fingerprint of the certificate, for example ef:d3:8e:d0:81:4f:a2:8f:3b:8b:0c:dd:c7:8f:8c:7e. |
|
fingerprint.hash_algorithm |
string |
The hash algorithm used to create the fingerprint, for example, sha256. |
|
subject |
object |
The subject string of the certificate. |
|
extensions |
object |
The list of extensions. |
|
pem |
string |
The certificate signing request in PEM format. |
|
public_key |
string |
The public key in PEM format. |
|
Example: Deleting a CSR
The following is a sample response received when a CSR is deleted.
For details of the meta object, see Message format.
{
"meta": {
"href": "/api/pki/certificate/requests",
"parent": "/api/pki/certificate"
},
"items": []
}
HTTP response codes
HTTP response codes comprise of standard or endpoint-specific HTTP status and error codes. The following table lists the endpoint-specific HTTP response codes for this request.
400 |
SyntacticError |
Syntax error: Could not load PEM certificate: Unable to load certificate; error=\"[('PEM routines', 'get_name', 'no start line')]\" |
400 |
CertChainValidationError |
You have attempted to store a certificate chain, which could not be validated with the specified Trust Store. |
400 |
OnlyOnCentralNode |
Certificate signing requests can only be created or updated on the Central management node of the cluster. |
404 |
NoMatchingCsrFound |
You have attempted to store a certificate chain which belongs to a private key for which no certificate signing requests can be found. Make sure to only send certificates which belong to a private key for which a certificate signing request exists. |
For more information and a complete list of standard HTTP response codes, see Application level error codes.
To create a new certificate, you have to POST the certificate and its private key as a JSON object to the https://<IP-address-of-SPS>/api/x509 endpoint. For details, see Create a new object. The body of the POST request must contain a JSON object with the parameters listed in Element . The response to a successful POST message is a JSON object that includes the reference ID of the created certificate in its key attribute. You can reference this ID in other parts of the configuration. Note that you can use a certificate object for only one purpose, that is, you cannot reference one object twice.
URL
POST https://<IP-address-of-SPS>/api/configuration/x509
-
Note that the GET method is not permitted on this endpoint, you cannot list the existing certificates. However, if you know the reference ID of a certificate, you can display its properties:
GET https://<IP-address-of-SPS>/api/configuration/x509/<reference-ID-of-the-private-key;>
-
You cannot directly delete or modify a certificate, the DELETE and PUT methods are not permitted on certificate objects. To update a certificate, create a new one, then update the object that uses the old certificate to reference the new certificate.
Table 7: Headers
Content-Type |
Specifies the type of the data sent. SPS uses the JSON format |
Required |
application/json |
session_id |
Contains the authentication token of the user |
Required |
The value of the session ID cookie received from the REST server in the authentication response, for example, a1f71d030e657634730b9e887cb59a5e56162860. For details on authentication, see Authenticate to the SPS REST API. |
Sample request
The following command creates a new certificate object. Note the following requirements:
The key must be in PKCS-1 PEM format.
You need the certificate and the private key as well.
Encrypted private keys are not supported.
The attributes of the POST message that contain the certificate and the private key must be a single line, enclosed in double-quotes.
Replace line-breaks in the PEM certificate with \n
The certificate and the certificate chain must be valid, SPS will reject invalid certificates and invalid certificate chains.
curl -X POST -H "Content-Type: application/json" --cookie cookies https://<IP-address-of-SPS>/api/configuration/x509 --data '{"private_key": "-----BEGIN RSA PRIVATE KEY-----\nMIIEpAIBAAKCAQEAu3QMMhqeg9ZMLNfdvQoNN1deVRE2SR0VKY+ALnzPZF4fUoJy\n.....\nI2SchDibk/Xj/ZvuEQ23LvzayWOVVuVHtH3JZX3SU4Sa0vpaeC+3oddVTwQOWRq0\n ......... Qbn5W3xKz4vXDDQHEbEsvDQ9A7+uCEuHpO4s33IK9KEa0Zdp745AU0DSGXN4HFzc\n-----END RSA PRIVATE KEY-----\n"}'
The body should be:
{
"certificate": "-----BEGIN CERTIFICATE-----\nMIIEpAIBAAKCAQEAu3QMMhqeg9ZMLNfdvQoNN1deVRE2SR0VKY+ALnzPZF4fUoJy\n.....\nI2SchDibk/Xj/ZvuEQ23LvzayWOVVuVHtH3JZX3SU4Sa0vpaeC+3oddVTwQOWRq0\n ......... Qbn5W3xKz4vXDDQHEbEsvDQ9A7+uCEuHpO4s33IK9KEa0Zdp745AU0DSGXN4HFzc\n-----END CERTIFICATE-----",
"private_key": "-----BEGIN RSA PRIVATE KEY-----\nMIIEpAIBAAKCAQEAu3QMMhqeg9ZMLNfdvQoNN1deVRE2SR0VKY+ALnzPZF4fUoJy\n.....\nI2SchDibk/Xj/ZvuEQ23LvzayWOVVuVHtH3JZX3SU4Sa0vpaeC+3oddVTwQOWRq0\n ......... Qbn5W3xKz4vXDDQHEbEsvDQ9A7+uCEuHpO4s33IK9KEa0Zdp745AU0DSGXN4HFzc\n-----END RSA PRIVATE KEY-----",
"issuer_chain": []
}
certificate |
|
string |
The certificate in PKCS-1 PEM format (replace line-breaks with \n). For example: -----BEGIN CERTIFICATE-----\nMIIEpAIBAAKCAQEAu3QMMhqeg9ZMLNfdvQoNN1deVRE2SR0VKY+ALnzPZF4fUoJy\n.....\nI2SchDibk/Xj/ZvuEQ23LvzayWOVVuVHtH3JZX3SU4Sa0vpaeC+3oddVTwQOWRq0\n ......... Qbn5W3xKz4vXDDQHEbEsvDQ9A7+uCEuHpO4s33IK9KEa0Zdp745AU0DSGXN4HFzc\n-----END CERTIFICATE----- |
|
private_key |
string |
The private key of the certificate, without encryption or password protection (replace line-breaks with \n). For example:
-----BEGIN RSA PRIVATE KEY-----\nMIIEpAIBAAKCAQEAu3QMMhqeg9ZMLNfdvQoNN1deVRE2SR0VKY+ALnzPZF4fUoJy\n.....\nI2SchDibk/Xj/ZvuEQ23LvzayWOVVuVHtH3JZX3SU4Sa0vpaeC+3oddVTwQOWRq0\n ......... Qbn5W3xKz4vXDDQHEbEsvDQ9A7+uCEuHpO4s33IK9KEa0Zdp745AU0DSGXN4HFzc\n-----END RSA PRIVATE KEY----- |
|
issuer_chain |
list |
A comma-separated list of the Certificate Authority (CA) certificates that can be used to validate the uploaded certificate. |
Querying a specific key returns the following information about the key:
curl --cookie cookies https://<IP-address-of-SPS>/api/configuration/x509/<reference-ID-of-the-private-key;>
fingerprint |
|
string |
The fingerprint of the certificate. |
|
digest |
string |
The fingerprint of the certificate, for example ef:d3:8e:d0:81:4f:a2:8f:3b:8b:0c:dd:c7:8f:8c:7e |
|
hash_algorithm |
string |
The hash algorithm used to create the fingerprint, for example, sha256. |
subject |
string |
The subject string of the certificate. |
Response
The response to a successful POST message is a JSON object that includes the reference ID of the created certificate in its key attribute.
For details of the meta object, see Message format.
{
"key": "faa96916-c85e-46ff-8697-f4cc5e596e7f",
"meta": {
"href": "/api/configuration/x509/faa96916-c85e-46ff-8697-f4cc5e596e7f",
"parent": "/api/configuration/x509",
"transaction": "/api/transaction"
}
}
The response to querying a specific certificate is a JSON object that includes the parameters of the certificate, for example:
{
"body": {
"fingerprint": {
"digest": "ef:d3:8e:d0:81:4f:a2:8f:3b:8b:0c:dd:c7:8f:8c:7e",
"hash_algorithm": "md5"
},
"subject": "C=RO/ST=State/L=Locality/O=Organization/OU=OrganizationalUnit/CN=example.com/emailAddress=root@example.com"
},
"key": "6c4d1116-d79d-475b-bb37-9f844f085c14",
"meta": {
"first": "/api/configuration/x509/e5d13d18-07c5-43fa-89f4-c3d2ece17c71",
"href": "/api/configuration/x509/6c4d1116-d79d-475b-bb37-9f844f085c14",
"last": "/api/configuration/x509/6c4d1116-d79d-475b-bb37-9f844f085c14",
"next": null,
"parent": "/api/configuration/x509",
"previous": "/api/configuration/x509/e5d13d18-07c5-43fa-89f4-c3d2ece17c71",
"transaction": "/api/transaction"
}
Status and error codes
The following table lists the typical status and error codes for this request. For a complete list of error codes, see Application level error codes.
201 |
Created |
The new resource was successfully created. |
400 |
SyntacticError |
Syntax error: Could not load PEM key: Unsupported private key format, only PKCS-1 is supported. Encrypted private keys are not supported. |
401 |
Unauthenticated |
The requested resource cannot be retrieved because the client is not authenticated and the resource requires authorization to access it. The details section contains the path that was attempted to be accessed, but could not be retrieved. |
403 |
Unauthorized |
The requested resource cannot be retrieved because the client is not authorized to access it. The details section contains the path that was attempted to be accessed, but could not be retrieved. |
404 |
NotFound |
The requested object does not exist. |
405 |
MethodNotAllowed |
The method <method> is not allowed for this node. |
Modify or delete certificate
You cannot directly delete or modify a certificate, the DELETE and PUT methods are not permitted on certificate objects. To update a certificate, create a new one, then update the object that uses the old certificate to reference the new certificate. After you commit the transaction, SPS will automatically delete the old certificate.
Exclusively for troubleshooting purposes, you can access the SPS host using SSH. Completing the Welcome Wizard automatically disables SSH access to SPS. Re-enabling it allows you to connect remotely to the SPS host and login using the root user. The password of the root user is the one you provided in the Welcome Wizard.
The following encryption algorithms are configured on the local SSH service of SPS:
-
Key exchange (KEX) algorithms:
diffie-hellman-group-exchange-sha256
-
Ciphers:
aes256-ctr,aes128-ctr
-
Message authentication codes:
hmac-sha2-512,hmac-sha2-256
URL
GET https://<IP-address-of-SPS>/api/configuration/local_services/ssh
Cookies
session_id |
Contains the authentication token of the user |
Required |
The value of the session ID cookie received from the REST server in the authentication response, for example, a1f71d030e657634730b9e887cb59a5e56162860. For details on authentication, see Authenticate to the SPS REST API.
NOTE: This session ID refers to the connection between the REST client and the SPS REST API. It is not related to the sessions that SPS records (and which also have a session ID, but in a different format).. |
Sample request
The following command lists the configuration options.
curl --cookie cookies https://<IP-address-of-SPS>/api/configuration/local_services/ssh
Response
The following is a sample response received when listing the configuration options.
For details of the meta object, see Message format.
{
"body": {
"access_restriction": {
"allowed_from": [
"10.40.0.48/24"
],
"enabled": true
},
"allow_password_auth": true,
"bruteforce_protection": true,
"enabled": true,
"listen": [
{
"address": {
"key": "nic1.interfaces.ff7574025754b3df1647001.addresses.1",
"meta": {
"href": "/api/configuration/network/nics/nic1#interfaces/ff7574025754b3df1647001/addresses/1"
}
},
"port": 23
}
],
"public_keys": [
{
"comment": "key-comment anothercomment",
"selection": "rsa",
"value": "AAAAB3NzaC1yc2EAAAADAQABAAABAQDTnisLCjZ3vONMXqFBIdvpZ0BY73+GdHpgoaL8YsydxJBsYg9dYTDzVVtYFVvdCVzBdcwCjyOuPwtZoYU3pLEFQ7OVoDUDPmVnl6idS/6tB2m89I5zdc02xUeCWTBpTGoOhNtc+YDmxPGZ1FQIpXCw0MT91jviWm3JydDd5YKINwvdTh8zsRT/702ZD9uZslwkQA/b2B9/hidCAkQkvs5H1B3o4laTd0JE9k90N+qbaQjVvoInr+jdXaWvrScwFVxZhb7Q1LvUL6oxW889bOWFMSa+/mnENarw6rpwfk9Ayi5uQQ2imY/tSnfgbS2RvIa1sKwUsJasDqN2lo/DuhON"
}
]
},
"key": "ssh",
"meta": {
"first": "/api/configuration/local_services/admin_web",
"href": "/api/configuration/local_services/ssh",
"last": "/api/configuration/local_services/user_web",
"next": "/api/configuration/local_services/user_web",
"parent": "/api/configuration/local_services",
"previous": "/api/configuration/local_services/snmp_agent",
"transaction": "/api/transaction"
}
key |
|
|
string |
Top level element, contains the ID of the endpoint. |
body |
|
|
Top level element (string) |
Contains the configuration options of the SSH server. |
|
access_restriction |
|
JSON object |
Enables and configures limitations on the clients that can access the web interface, based on the IP address of the clients. |
|
|
allowed_from |
list |
The list of IP networks from where the administrators are permitted to access this management interface. To specify the IP addresses or networks, use the IPv4-Address/prefix format, for example, 10.40.0.0/16. |
|
|
enabled |
boolean |
Set it to true to restrict access to the specified client addresses. |
|
allow_password_auth |
|
boolean |
Enables password-based authentication, so administrators can remotely login to SPS. If this option is set to False, SPS ignores every other option of this endpoint. |
|
bruteforce_protection |
|
boolean |
Enables protection against brute-force attacks by denying access after failed login attempts for increasingly longer period. Enabled by default. |
|
enabled |
|
boolean |
Enables the SSH server, so administrators can remotely login to SPS. If this option is set to False, SPS ignores every other option of this endpoint. |
|
listen |
|
list |
Selects the network interface, IP address, and port where the clients can access the web interface. |
|
|
address |
JSON object |
A reference to a configured network interface and IP address where this local service accepts connections. For example, if querying the interface /api/configuration/network/nics/nic1#interfaces/ff7574025754b3df1647001/addresses/ returns the following response: {
"body": {
"interfaces": {
"@order": [
"ff7574025754b3df1647001"
],
"ff7574025754b3df1647001": {
"addresses": {
"1": "10.40.255.171/24",
"@order": [
"1"
]
},
"name": "default",
"vlantag": 0
}
},
"name": "eth0",
"speed": "auto"
},
"key": "nic1",
"meta": {
"first": "/api/configuration/network/nics/nic1",
"href": "/api/configuration/network/nics/nic1",
"last": "/api/configuration/network/nics/nic3",
"next": "/api/configuration/network/nics/nic2",
"parent": "/api/configuration/network/nics",
"previous": null,
"transaction": "/api/transaction"
}
}
Then the listening address of the local service is the following. nic1.interfaces.ff7574025754b3df1647001.addresses.1
This is the format you have to use when configuring the address of the local service using REST: "address": "nic1.interfaces.ff7574025754b3df1647001.addresses.1"
When querying a local services endpoint, the response will contain a reference to the IP address of the interface in the following format: "address": {
"key": "nic1.interfaces.ff7574025754b3df1647001.addresses.1",
"meta": {
"href": "/api/configuration/network/nics/nic1#interfaces/ff7574025754b3df1647001/addresses/1"
}
}, |
|
|
port |
integer |
The port number where this local service accepts connections. |
|
public_keys |
|
list |
Lists the public keys that can be used to authenticate on SPS. For example: "public_keys": [
{
"comment": "user@example.com anothercomment",
"key": {
"selection": "rsa",
"value": "AADDB3NzaC1yc2EABBADAQA......./DuhON"
}
},
{
"comment": "username@example.com",
"key": {
"selection": "rsa",
"value": "ASFDFAB3NzaC1yc2EAAAABIwAAASdfASF/EuQh9zc2umxX...dU="
}
}
]
TIP: One Identity recommends using 2048-bit RSA keys (or stronger). |
|
comment |
|
string |
Comments of the public key. |
|
key |
|
JSON object |
Contains the type of the key and the key itself. For example: "key": {
"selection": "rsa",
"value": "ASFDFAB3NzaC1yc2EAAAABIwAAASdfASF/EuQh9zc2umxX...dU="
} |
|
|
selection |
rsa |
The type of the public key. Must be rsa. |
|
|
value |
string |
The public key itself. |
Status and error codes
The following table lists the typical status and error codes for this request. For a complete list of error codes, see Application level error codes.
401 |
Unauthenticated |
The requested resource cannot be retrieved because the client is not authenticated and the resource requires authorization to access it. The details section contains the path that was attempted to be accessed, but could not be retrieved. |
403 |
Unauthorized |
The requested resource cannot be retrieved because the client is not authorized to access it. The details section contains the path that was attempted to be accessed, but could not be retrieved. |
404 |
NotFound |
The requested object does not exist. |