Forum Discussion
mhite_60883
Cirrocumulus
May 30, 2013Urgent -- Help with import_from_archive_stream() key/cert management API call
Hello,
I am trying to use the import_from_archive_stream() function as documented here:
https://devcentral.f5.com/wiki/iControl.Management__KeyCertificate__import_from_...
Jun 12, 2013
What are you passing in for the archive_stream parameter? It should be a base64 encoded version of the local .tgz file (not on the BIG-IP). The api call uploads the content, stores it in a temporary file (/var/run/tempKMArchive.tgz) and then calls the import_from_archive_file() method with the file path as a parameter.
You said you already uploaded the .tgz to the BIG-IP. If that's the case, then you'll likely want to use the import_from_archive_file() method where instead of passing in a blob with the .tgz base64 encoded content, you'll pass in the path on the BIG-IP where the .tgz file is located.
I believe the .Net bindings take care of the base64 encoding for you, but if you are using Perl, then you would do something like this
$tgz_content = &LoadContentFromFile("c:\temp\foo.tgz") (where LoadContentFromFile loads the content from the file - B-) ).\
$tgz_encoded = SOAP::Data->type(base64 => $tgz_content);
$soapresponse = $certkey->import_from_archive_stream(
SOAP::Data->name (mode => MANAGEMENT_MODE_DEFAULT ),
SOAP::Data->name (archive_stream => [$tgz_encoded] ),
SOAP::Data->name (keys => ["www.example.com.key"] ),
SOAP::Data->name (certs => ["www.example.com.crt"]),
);
or you could just use the import_from_archive_file method if you already have the .tgz in /var/tmp/myarchive.tgz on the BIG-IP.
$soapresponse = $certkey->import_from_archive_file(
SOAP::Data->name (mode => MANAGEMENT_MODE_DEFAULT ),
SOAP::Data->name (archive_location => ["/var/tmp"] ),
SOAP::Data->name (archive_name => ["myarchive.tgz"] ),
SOAP::Data->name (keys => ["www.example.com.key"] ),
SOAP::Data->name (certs => ["www.example.com.crt"]),
);
Hope this helps...
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects