AnsweredAssumed Answered

Alias issue for private key import

Question asked by Kumar1234 on Apr 22, 2019
Latest reply on May 2, 2019 by DirkBleyenberg

Hello,

I am trying to import private key using Restman API and it is asking for the alias name even though it is optional. Can someone please point me any issue with my config? below is the info I'm using from postman

URL: https://hostname:9443/restman/1.0/privateKeys/00000000000000000000000000000002:apigw/import 

headers: Content-Type: application/xml

Authorization: Basic base64(username:password)

Request Body:

<l7:PrivateKeyImportContext xmlns:l7="http://ns.l7tech.com/2010/04/gateway-management">
<l7:Pkcs12Data>base64(pkcs12)</l7:Pkcs12Data>
<l7:Password>Password123!</l7:Password>
</l7:PrivateKeyImportContext>

Response: 

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<l7:Error xmlns:l7="http://ns.l7tech.com/2010/04/gateway-management">
<l7:Type>InvalidResource</l7:Type>
<l7:TimeStamp>2019-04-22T17:20:26.189-05:00</l7:TimeStamp>
<l7:Link rel="self" uri="https://hostname:9443/restman/1.0/privateKeys/00000000000000000000000000000002:apigw/import"/>
<l7:Detail>Resource validation failed due to 'INVALID_VALUES' Alias must be specified : [string]</l7:Detail>
</l7:Error>

 

I tried to use the same alias name given in the URI in request body to workaround this and got another error that alias not found. Below is the info I'm using for this call from postman.

URL: https://hostname:9443/restman/1.0/privateKeys/00000000000000000000000000000002:apigw/import 

headers: Content-Type: application/xml

Authorization: Basic base64(username:password)

Request Body:

<l7:PrivateKeyImportContext xmlns:l7="http://ns.l7tech.com/2010/04/gateway-management">
<l7:Pkcs12Data>base64(pkcs12)</l7:Pkcs12Data>
<l7:Alias>apigw</l7:Alias>
<l7:Password>Password123!</l7:Password>
</l7:PrivateKeyImportContext>

Response: 

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<l7:Error xmlns:l7="http://ns.l7tech.com/2010/04/gateway-management">
<l7:Type>InvalidResource</l7:Type>
<l7:TimeStamp>2019-04-22T17:27:02.547-05:00</l7:TimeStamp>
<l7:Link rel="self" uri="https://hostname:9443/restman/1.0/privateKeys/00000000000000000000000000000002:apigw/import"/>
<l7:Detail>Resource validation failed due to 'INVALID_VALUES' Aliases not found : apigw</l7:Detail>
</l7:Error>

 

Any help is appreciated! Thank you!

Outcomes