[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Handle-info] curl examples with certificates to talk to the handle RESTFUL API
Once you have a properly set up certificate cert.pem and private key privatekey.pem, you can use the following:
curl -i -k --cert cert.pem --key privatekey.pem -H 'Authorization: Handle clientCert="true"' 'https://...:8000/api/handles/...'
To create a PEM file privatekey.pem from a Handle-formatted private key, you can use
hdl-convert-key admpriv.bin -o privatekey.pem
To generate a certificate in the expected format, you can use'
openssl req -new -x509 -key privatekey.pem -subj '/UID=300:YOUR\/HANDLE' -days 3652 -out cert.pem
Here 300:YOUR/HANDLE should be replaced with your handle admin identity; but note that the slash needs to be escaped with a backslash.
Let me know if that works for you! And apologies for the delayed response.
Robert
> On Aug 2, 2016, at 4:39 AM, Robert Verkerk <robert.verkerk@surfsara.nl> wrote:
>
> Hi,
>
> I know the b2handle library (https://github.com/EUDAT-B2SAFE/B2HANDLE ) uses certificates to authenticate and do its magic talking to the handle server 8.x. That works very well.
>
> Does anybody have some examples how to use curl and certificates against the handle server 8.x.
>
> --
> Met vriendelijke groet,
>
> Robert Verkerk
> systeem programmeur
> Data Services
>
> Robert Verkerk
> | Dataservices | SURFsara | Science Park 140 | 1098 XG Amsterdam | T +31 (0)20 8001300 | robert.verkerk@surfsara.nl | www.surfsara.nl
>
>
>
>
>
>
>
>
>
> _______________________________________________
> Handle-Info mailing list
> Handle-Info@cnri.reston.va.us
> http://www.handle.net/mailman/listinfo/handle-info
_______________________________________________
Handle-Info mailing list
Handle-Info@cnri.reston.va.us
http://www.handle.net/mailman/listinfo/handle-info