bfournier2 Absent Member.
Absent Member.
620 views

Certificate - Import Private/Public keypair using REST API

Hello,

I can manually import my public/private key (.pfx file) using the "Import Private/Public Keypair..." in the Administration console.
I would like to do the same using the REST API that is provided. Is that something feasible?

Thanks.

Regards,

Brice
0 Likes
4 Replies
ScorpionSting Absent Member.
Absent Member.

Re: Certificate - Import Private/Public keypair using REST A

0 Likes
bfournier2 Absent Member.
Absent Member.

Re: Certificate - Import Private/Public keypair using REST A

Thanks.
I am trying to use this AP now and in the administration console,
I have the following certificates list:

3 item(s)
Name Subject Used By Starting Date Ending Date State
NAM-RP-Certificate CN=[...] June 23, 2017 June 23, 2027
SLB_NAM-RP-Certificate CN=[...], [...] July 20, 2017 July 19, 2020
test C=test, ST=test, L=test, O=test, OU=test, CN=test July 21, 2017 July 21, 2019

If I send a PUT request using this path: amsvc/v1/security/certificates/NAM-RP-Certificate
It seems to find the certificate.

However, when I send a request using the following path: amsvc/v1/security/certificates/test
I have the following error:
{
"response": {
"code": "BAD_REQUEST",
"detail": ""Certificate not found. Check the specified certificate name."",
"cause": "com.microfocus.roma.RomaException: "Certificate not found. Check the specified certificate name.""
}
}

How can I specify the certificate name to update the test certificate that I have in my certificates list?
0 Likes
Knowledge Partner Knowledge Partner
Knowledge Partner

Re: Certificate - Import Private/Public keypair using REST API

On 7/22/2017 3:14 AM, bfournier2 wrote:
>
> Thanks.
> I am trying to use this AP now and in the administration console,
> I have the following certificates list:
>
> 3 item(s)
> Name Subject Used By Starting Date Ending Date State
>
> NAM-RP-Certificate CN=[...] June 23, 2017 June 23, 2027
>
> SLB_NAM-RP-Certificate CN=[...], [...] July 20, 2017 July
> 19, 2020
> *test *C=test, ST=test, L=test, O=test, OU=test, CN=test July
> 21, 2017 July 21, 2019
>
> If I send a PUT request using this path:
> amsvc/v1/security/certificates/NAM-RP-Certificate
> It seems to find the certificate.
>
> However, when I send a request using the following path:
> amsvc/v1/security/certificates/*test*
> I have the following error:
> {
> "response": {
> "code": "BAD_REQUEST",
> "detail": ""Certificate not found. Check the specified certificate
> name."",
> "cause": "com.microfocus.roma.RomaException: "Certificate not found.
> Check the specified certificate name.""
> }
> }
>
> How can I specify the certificate name to update the *test* certificate
> that I have in my certificates list?
>
>


Interesting, looking at the rest api using swagger it indicates it wants a certificateID. I doubt that this is the same as the cert name.

--
Cheers,
Edward
0 Likes
ScorpionSting Absent Member.
Absent Member.

Re: Certificate - Import Private/Public keypair using REST A

Use a LDAP Browser to have a look under o=novell.....check that your "test" certificate actually has a CN of "test" and not something like "test " (extra space) or some other value.

Visit my Website for links to Cool Solution articles.
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.