example of adding othername SAN to a CSR? #18
|
Hi, let csr = Thanks! |
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) |
You just need to construct an
OtherNamestruct, which is an OID and ASN1 value.