Skip to content

Commit

Permalink
Support 'otp' rdnSequence in X509.CSR.new
Browse files Browse the repository at this point in the history
  • Loading branch information
voltone committed Feb 29, 2020
1 parent c00cc0e commit 72e8129
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions lib/x509/csr.ex
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,15 @@ defmodule X509.CSR do
# Convert subject to RDNSequence, if necessary
subject_rdn_sequence =
case subject do
{:rdnSequence, _} -> subject
rdn -> RDNSequence.new(rdn)
{:rdnSequence, [[{:AttributeTypeAndValue, _oid, value} | _] | _]}
when is_binary(value) ->
subject

{:rdnSequence, _} ->
:pubkey_cert_records.transform(subject, :encode)

rdn ->
RDNSequence.new(rdn)
end

attributes =
Expand Down

0 comments on commit 72e8129

Please sign in to comment.