example of adding othername SAN to a CSR? #18
-
Hi, let csr =
Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
You just need to construct an // Construct your "OtherName"
let myOtherName = OtherName("1.3.18.0.2.4.318", ASN1.utf8String("test@example.com"))
// Add it to CSR builder
let csr =
try CertificationRequest.Builder()
.subject(name: NameBuilder().add("Outfox Signing", forTypeName: "CN").name)
.alternativeNames(names: .otherName(myOtherName))
.publicKey(keyPair: Self.keyPair, usage: [.keyEncipherment])
.extendedKeyUsage(keyPurposes: [kp.clientAuth.oid, kp.serverAuth.oid], isCritical: true)
.build(signingKey: Self.keyPair.privateKey, digestAlgorithm: .sha256) |
Beta Was this translation helpful? Give feedback.
You just need to construct an
OtherName
struct, which is an OID and ASN1 value.