Community discussions

 
mtk42
just joined
Topic Author
Posts: 2
Joined: Tue Jan 15, 2019 12:20 pm

Using API to sign certificate using template

Tue Jan 15, 2019 12:25 pm

Hi, I am trying to sign a certificate via API.

sign my-template ca="domain.com" name="name@domain.com"

How can I do this via API, I can't seem to get it to work. I get an error message from the router:
unknown parameter
 
nescafe2002
Long time Member
Long time Member
Posts: 622
Joined: Tue Aug 11, 2015 12:46 pm
Location: Netherlands

Re: Using API to sign certificate using template

Tue Jan 15, 2019 12:56 pm

API expects an attribute name and value.

https://wiki.mikrotik.com/wiki/Manual:A ... ibute_word

Attribute word structure consists of 5 parts in this order:
  • encoded length
  • content prefix equals sigh - =
  • attribute name
  • separating equals sign - =
  • value of attribute if there is one. It is possible that attribute does not have a value

Try rephrasing the CLI command to API words, using the default parameter name 'number':

sign number=my-template ca="domain.com" name="name@domain.com"

The default parameter is displayed in bold in CLI autocompletion list.
 
mtk42
just joined
Topic Author
Posts: 2
Joined: Tue Jan 15, 2019 12:20 pm

Re: Using API to sign certificate using template

Tue Jan 15, 2019 4:22 pm

This seems to work...
'.id'  => 'my-template',

Who is online

Users browsing this forum: No registered users and 3 guests