Create Key with PKCS12 File
POST {{apiPath}}/environments/{{envID}}/keys
The POST /environments/{{envID}}/keys
operation creates a new key resource for the specified environment. It creates a key from an upload of a PKSCS12 file. Properties returned in the response are parsed from the uploaded file.
The PKSCS12 file can be encrypted or unencrypted. If the file is encrypted without a specified export password, an INVALID_DATA
error is returned.
This operation also supports the application/x-pkcs12-certificates
media type to upload a pkcs12
file instead of posting the key attributes in the request body.
The response returns a 201 Created
message and shows the certificate data parsed from the uploaded certificate file.
Prerequisites
- See Certificate Management for important overview information.
Request Body
[{"name"=>"usageType", "value"=>"ENCRYPTION", "datatype"=>"string"}, {"name"=>"file", "value"=>nil, "datatype"=>"null"}, {"name"=>"password", "value"=>"Optional for encrypted files", "datatype"=>"string"}]
HEADERS
Key | Datatype | Required | Description |
---|---|---|---|
Content-Type | string |
RESPONSES
status: Created
{"_links":{"self":{"href":"https://api.pingone.com/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6/keys/611b9a62-048b-4821-b636-d024e3b91145"}},"id":"611b9a62-048b-4821-b636-d024e3b91145","serialNumber":12737138739537859429,"subjectDN":"O=ping, ST=Some-State, C=CA","issuerDN":"O=ping, ST=Some-State, C=CA","algorithm":"RSA","keyLength":4096,"createdAt":"2020-12-16T20:26:46.540Z","startsAt":"2020-12-16T19:20:35.000Z","expiresAt":"2030-12-14T19:20:35.000Z","validityPeriod":3650,"signatureAlgorithm":"SHA256withRSA","usageType":"ENCRYPTION","status":"VALID","organization":{"id":"bed432e6-676a-4ebe-b5a5-6b3b54e46bda"},"environment":{"id":"abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6"},"default":false}