Hi Andreas,

to have "real" REST API you need to write a wrapper yourself that
translates a REST path to a call to the RPC system and rewrites the
result to the expected return structure. There is no ready-to-go
component in OpenXPKI CE for this as such an interface is always very
customer specific.

Oliver

Am 23.09.21 um 18:23 schrieb [email protected]:
>
> Hi Oliver,
>
>  
>
> thanks a lot!
>
> Your reference to
>
>  
>
> "_map_certificate: [% Certificate.pem(...) %]“
>
>  
>
> … was close and guided me to the right direction, but – big surprise –
> it didn’t work.
> Finally I found out that the following line works:
>
>  
>
> “_map_pem: "[% USE Certificate %][%
> Certificate.pem(context.cert_identifier) %]"
>
>  
>
> Of cause, I had to adjust the file enroll.yaml appropriately too:
>
>  
>
> [SearchCertificate]
>
> workflow = certificate_search
>
> param = common_name
>
> output = cert_identifier, pem, notbefore, notafter, status
>
>  
>
> The result was pretty much what I had been searching for:**
>
>  
>
> curl -s -F "method=SearchCertificate"  -F "common_name=Rob Roberts"
> http://localhost:8080/rpc/enroll | python -m json.tool
>
> {
>
>     "result": {
>
>         "data": {
>
>             "cert_identifier": "jLy7gIbwwvnvOCMRpTPgdw6uVpg",
>
>             "notafter": "2022-03-16T16:54:56",
>
>             "notbefore": "2021-09-16T16:54:56",
>
>             "pem": "-----BEGIN CERTIFICATE-----\nm ……..
> v9MRebfA=\n-----END CERTIFICATE-----",
>
>             "status": "ISSUED"
>
>         },
>
>         "id": 0,
>
>         "pid": 70,
>
>         "proc_state": "finished",
>
>         "state": "SUCCESS"
>
>     }
>
> }
>
>  
>
> So far, so good (and once again: thank you for your help!)
>
>  
>
> What remains open, is my question, how to switch from RPC to REST.
>
> Could you give me a hint, how to achieve that?
>
>  
>
> Kind regards
>
>  
>
> Andreas
>
>  
>
>  
>
>
>
> _______________________________________________
> OpenXPKI-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/openxpki-users


-- 
Protect your environment -  close windows and adopt a penguin! 

_______________________________________________
OpenXPKI-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openxpki-users

Reply via email to