Skip to content

How to add attributes to a CSR? #32

Answered by kdubb
randix asked this question in Q&A
Nov 4, 2021 · 1 comments · 3 replies
Discussion options

You must be logged in to vote

Name Issue

I'm not sure what you mean when you say "crash where it is parsed" but using an example from the tests (CertificationReguestBuilderTests) I was able to generate a CSR and parse it in an online generator
(https://redkestrel.co.uk/products/decoder).

// Create name with `userid` value
let name = try NameBuilder()
  .add("Outfox Signing", forTypeName: "CN")
  .add("test-user", forType: itu.data.pss.ucl.pilot.pilotAttributeType.userId.oid)
  .name

let keyPurpose = iso.org.dod.internet.security.mechanisms.pkix.kp.self
let csr =
  try CertificationRequest.Builder()
    .subject(name: name)
    .alternativeNames(names: .dnsName("outfoxx.io"))
    .publicKey(keyPair: Self.keyPair, usag…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@randix
Comment options

@kdubb
Comment options

@randix
Comment options

Answer selected by randix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants