Archive

Expand all | Collapse all

Set private key as default using restman API

Jump to Best Answer
  • 1.  Set private key as default using restman API

    Posted 11-14-2017 10:48 AM

    Hello Techies ,

    To set the Private Key by using rest man API with Mark as Default  below URL we  can use but if we will set method as PUT that time we require content in body and media type . not sure what content need to pass their .
    URL to Update Private Key setting:
    PUT https://<gateway>:8443/restman/1.0/privateKeys/00000000000000000000000000000002:{alias name}/Mark as Default
    Also need to pass Authorization  Header(s) but not sure what would be value of header .

     

    Please help .

     

    Thanks!

    Prashant Srivastava



  • 2.  Re: Set private key as default using restman API
    Best Answer

    Posted 11-14-2017 11:15 AM

    Prashant, 


    If you have installed the Restman server then you can review the documentation here;

    https://<APIGatewayHost>:8443/restman/1.0/doc/home.html

    Content-Typeapplication/xml

     

    below are example to Create and Update, I hope this helps 

     

     

    Update

    Updates an existing private key. This api call can be used to replace a private key's certificate chain or change its security zone.
    Request
    PUT 1.0/privateKeys/{id}
    Path Parameters
    ParamTypeDescription
    idstringThe ID of the private key to update
    Body
    The updated private key.
    Elementl7:PrivateKey
    Content-Typeapplication/xml
    Response
    Body
    A reference to the newly updated private key.

     

     

    CREATE a KEY 

    Example request:

     <l7:PrivateKeyCreationContext xmlns:l7="http://ns.l7tech.com/2010/04/gateway-management">      <l7:Dn>CN=srcAlias</l7:Dn>      <l7:Properties>          <l7:Property key="signatureHashAlgorithm">              <l7:StringValue>SHA384</l7:StringValue>          </l7:Property>          <l7:Property key="rsaKeySize">              <l7:IntegerValue>516</l7:IntegerValue>          </l7:Property>          <l7:Property key="ecName">              <l7:StringValue>secp384r1</l7:StringValue>          </l7:Property>          <l7:Property key="daysUntilExpiry">              <l7:IntegerValue>2</l7:IntegerValue>          </l7:Property>          <l7:Property key="caCapable">              <l7:BooleanValue>true</l7:BooleanValue>          </l7:Property>      </l7:Properties>  </l7:PrivateKeyCreationContext>  

    This responds with a reference to the newly created private key.

     



  • 3.  Re: Set private key as default using restman API

    Posted 11-14-2017 11:42 AM

    Thanks for reply Do we require authorization header ?Also if we are selecting  content type as applicaiton:xml then what value need to pass.

     

    For example if we are using SOAPUI to hit the url  http://gateway>:8443/restman/1.0/privateKeys/00000000000000000000000000000002:{alias name}/Mark as Default

    Method  used : PUT

    Content Type :application:xml

    value of Application : What would be value that we need to pass here ?

     

    Thanks!

    Prashant



  • 4.  Re: Set private key as default using restman API

    Posted 11-14-2017 12:06 PM

    yes you do need Authorization header, admin account for policy manager 

     

    important property you would be passing I believe is 

     

    <l7:Property key="specialPurposes">
    <l7:StringValue>Default SSL Key</l7:StringValue>
    </l7:Property>

     

    if you do GET on Private keys   ... /restman/1.0/privateKeys

    you will see what properties are part of every key... 

    you would have to play with it a bit to create a correct body part  

     

     

     

    also please look at our documentation for more details 

     

    If you have installed the Restman server then you can review the documentation here;

    https://<APIGatewayHost>:8443/restman/1.0/doc/home.html

     

    Thanks 

    Kemal