Bootstrap FreeKB - Broadcom API Gateway - Export Private Key using the Gateway Migration Utility
Broadcom API Gateway - Export Private Key using the Gateway Migration Utility

Updated:   |  Broadcom API Gateway articles

This assumes you are familiar with the basic usage of the Gateway Migration Utility. Before you export a private key into the API Gateway, you may want to list the private keys that are already in the API Gateway. Let's say you have a private key that has the following ID.

<l7:Id>00000000000000000000000000000002:key001</l7:Id>

 

Create an XML file.

touch exportPrivateKey.xml

 

Add the following to the XML file. In this example, key001 with password itsasecret will be exported.

<l7:PrivateKeyExportContext xmlns:l7="http://ns.l7tech.com/2010/04/gateway-management">
  <l7:Password>itsasecret</l7:Password>
</l7:PrivateKeyExportContext>

 

Then issue this command.

/path/to/GatewayMigrationUtility.sh restman
-host apig.example.com
-port 8443
-username john.doe
-password f5VPX0yUJPg.m4BrjdgMv84UgktddJD3xA
-method PUT
-path '1.0/privateKeys/00000000000000000000000000000002:key001/export'
-request exportPrivateKey.xml
-response key001.xml

 

Or the -argFile option can be used, to reduce the number of options that are used on the command line.

/path/to/GatewayMigrationUtility.sh restman
-argFile example.properties
-method PUT
-path '1.0/privateKeys/00000000000000000000000000000002:key001/export'
-request exportPrivateKey.xml
-response key001.xml

 

key001.xml should contain something like this.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<l7:Item xmlns:l7="http://ns.l7tech.com/2010/04/gateway-management">
    <l7:Name>00000000000000000000000000000002:key001 Export</l7:Name>
    <l7:Id>00000000000000000000000000000002:key001</l7:Id>
    <l7:Type>PrivateKeyExportResult</l7:Type>
    <l7:TimeStamp>2021-01-27T21:11:43.681-06:00</l7:TimeStamp>
    <l7:Link rel="self" uri="https://apig.example.com:8443/restman/1.0/privateKeys/00000000000000000000000000000002:key001/export"/>
    <l7:Link rel="privateKey" uri="https://apig.example.com:8443/restman/1.0/privateKeys/00000000000000000000000000000002:key001"/>
    <l7:Resource>
        <l7:PrivateKeyExportResult>
          <l7:Pkcs12Data>MIACAQMwgAYJKoZIhvcNAQcBoIAkgASCA+gwgDCABgkqhkiG9w0BBwGgg . . ./l7:Pkcs12Data>
        </l7:PrivateKeyExportResult>
    </l7:Resource>
</l7:Item>

 




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


Please enter 2a583a in the box below so that we can be sure you are a human.