Import .p12 keystore: Request

Prev Next

To import a .p12 keystore, send the following request:

POST https://<IA_IP_address>:<port_number>/config/v1/auth/x509/client/p12

Note

To use this request, your user account must have sudo access.

Required headers:

Cookie: px=<token> X-Username: <user> X-Role: <role>

Options

  • IA_IP_address—The IP address of the NDR appliance running the NDR API.

  • port_number—The port number of the NDR appliance running the NDR API.

  • token—This token authenticates the session. By default, the session times out after 24 hours.

  • user—The user ID.

  • role—The user's role.

Example

POST https://xxx.xxx.xxx.xxx:443/config/v1/auth/x509/client/p12

Required headers:

Cookie: px=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx X-Username: wheel X-Role: wheel

Import .p12 keystore: Response

HTTP/1.1 [Response Code] [Response Message]				
Date: [Date]				
Content-Type: [Content Type]
Content-Disposition: inline; filename="keystore.pfx"
Response fields
  • Response code—A standard HTTP response code.

    • 200—Request successful; the configuration was successful.

  • Response message—A standard HTTP response message.

    • OK—Request successful; the configuration was successful.

  • Date—Standard HTML date format.

  • Content type—The response format.

Example
HTTP/1.1 200 OK
Server: nginx
Date: Fri, 16 Aug 2019 11:31:54 GMT
Content-Type: application/pkcs10
Content-Disposition: inline; filename="keystore.pfx"

cURL code sample: Import .p12 keystore

curl -k -X POST --cookie "px=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" 
-H "X-Username: wheel" -H "X-Role: wheel" 
https://xxx.xxx.xxx.xxx:443/config/v1/auth/x509/client/p12 
-F "f=@/path/to/keystore.pfx" -F "passphrase=hammerhead"

This cURL sample includes the following options:

  • -k—This option explicitly allows cURL to perform insecure SSL connections and transfers, which allows you to test your SSL connection without installing a CA certificate.

  • -X POST—Specifies using the POST method.

  • --cookie "px=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"—This option specifies the authentication token for this session.

  • -F "f=@/path/to/keystore.pfx"—The path to the keystore file.

  • -F "passphrase=hammerhead"—The user's password.

  • -H "X-Username: wheel"—User name.

  • -H "X-Role: wheel"—User role.

  • https://xxx.xxx.xxx.xxx:443/config/v1/auth/x509/client/p12—The keystore request URL. Replace xxx.xxx.xxx.xxx with the IP address of your NDR appliance.

Results

This example imports a .p12 keystore file.