Layer 7 API Management

Expand all | Collapse all

RESTMAN API for Private Keys

Jump to Best Answer
  • 1.  RESTMAN API for Private Keys

    Posted 07-30-2018 05:49 AM

    Hello Team,

     

    I am using RESTMAN API for generating Private Keys. Now i need to Export the private key and i use the URL as below:

     

    https://192.168.45.138:8443/restman/1.0/privateKeys/00000000000000000000000000000002:testpk/export

     

    I am getting success results also. But now I am confuse/stuck what to do next. Shall i need to save the result in some format in my local machine. 

     

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <l7:Item xmlns:l7="http://ns.l7tech.com/2010/04/gateway-management">
    <l7:Name>00000000000000000000000000000002:testpk Export</l7:Name>
    <l7:Id>00000000000000000000000000000002:testpk</l7:Id>
    <l7:Type>PrivateKeyExportResult</l7:Type>
    <l7:TimeStamp>2018-07-30T15:08:05.017+05:30</l7:TimeStamp>
    <l7:Link rel="self" uri="https://gateway1.l7tech.com:8443/restman/1.0/privateKeys/00000000000000000000000000000002:testpk/export"/>
    <l7:Link rel="privateKey" uri="https://gateway1.l7tech.com:8443/restman/1.0/privateKeys/00000000000000000000000000000002:testpk"/>
    <l7:Resource>
    <l7:PrivateKeyExportResult>
    <l7:Pkcs12Data>MIACAQMwgAYJKoZIhvcNAQcBoIAkgASCA+gwgDCABgkqhkiG9w0BBwGggCSABIIB7zCCAeswggHnBgsqhkiG9w0BDAoBAqCCAZIwggGOMCgGCiqGSIb3DQEMAQMwGgQUIOKtJlTAIJ08cvJHUHt+eM93+oMCAgQABIIBYHctcnfhFQugt0adkOLZqIupAbaR8DxmUh4BRJJRlvWVk9Gs5rMLv38cGl6+ERo6ItZmit5tzfua/UKsWh8jp1kOry7HyJsSretbrnATHO5WYkF54V1SNAgumthDAGcsnSVDdk1QjqZ2v990GBwXKfOYnvKkz+65TsMK6AEyr8CUgLZDBhLnd5qJnGbLnv1KMJ18IcYZCUzffulZs7yoRPiwDnrty3HodSO/Gd22M0bbslVgHW5IK78p/8YHsYGa/SfMBSSMY2rkxkgIoXq+TRIWxHz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pD2z14VZqc2NbvxkTpPnS2uUScEFBzAFw4yaWEocqPnS4/2kK68GvnlAgIEAAAA</l7:Pkcs12Data>
    </l7:PrivateKeyExportResult>
    </l7:Resource>
    </l7:Item>

     

     

     

    Please help me in getting the details on what to do after export of private keys done. If i need to store in which format do i need to store.

     

     

    Thanks

    Pratyush



  • 2.  Re: RESTMAN API for Private Keys

    Posted 07-30-2018 08:22 PM

    It's easier to use GMU, if you have a policy using a private key, migrate that policy will migrate the private key as well.



  • 3.  Re: RESTMAN API for Private Keys

    Posted 07-30-2018 10:18 PM

    Hi Zhijun,

     

    Thanks for reply.

     

    I am trying to create private keys so that i can use them in order to login into Policy Manager.

     

    Thanks

    Pratyush



  • 4.  Re: RESTMAN API for Private Keys
    Best Answer

    Posted 07-31-2018 09:36 PM

    The <l7:Pkcs12Data> is the data of p12 file, but it's base64 encoded, just base64 decode and save it as p12 file.

     

    I tested on my linux box,

     

    echo <copy and paste l7:Pkcs12Data> | base64 -d > test.p12

     

    and verified by openssl,

    openssl pkcs12 -info -in test.p12

     

    it returns the detail of the private key successfully.



  • 5.  Re: RESTMAN API for Private Keys

    Posted 08-01-2018 05:03 AM

    Thanks alot it resolves my issue.

     

    Regards

    Pratyush