riboseinc / digicert

Ruby bindings for the Digicert Services API
https://www.digicert.com/services/v2/documentation
MIT License
8 stars 10 forks source link

Streamline order duplication flow #102

Open ronaldtse opened 7 years ago

ronaldtse commented 7 years ago

Hi @abunashir ,

Here's the flow that we wish to utilize in our certificate generation code. Could you have a look and see what gaps we still need to fill? Thanks.

order = Digicert::Order.filter(
  common_name: "*.example.com",
  product_type: Digicert::Product::WildcardSsl
)

%(name1 name2).each do |name|

  key = load_key(keypath[name])
  csr = Digicert::Csr.new(
    order: order, # obtain attributes from order that aren't provided here
    key: key # only change the key in this CSR
  )

  duplicate_request = order.duplicate(csr: csr)

  downloaded_certs = duplicate_request.download_certificate(format: "zip")

  root_cert = downloaded_certs[:root]
  intermediate_cert = downloaded_certs[:intermediate]
  cert = downloaded_certs[:cert]
end
ronaldtse commented 7 years ago

@abunashir is this type of flow possible now? Thanks!

abunashir commented 7 years ago

@ronaldtse: Not exactly the same way, as we are still using the OpenStruct but we can do that same thing through the find interface and then download the certificate content.

Once we have done this https://github.com/riboseinc/digicert/issues/103#issuecomment-308664330 then we can do it like the above flow.