From 7ab3746e1e5ffccc01f963d79ec780845bd1ae46 Mon Sep 17 00:00:00 2001 From: Thomas Cioppettini <544875+tomciopp@users.noreply.github.com> Date: Tue, 25 Jun 2024 07:13:39 -0400 Subject: [PATCH] Use sigil for charlists in doctests (#74) --- lib/x509/certificate/extension.ex | 8 ++++---- lib/x509/certificate/validity.ex | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/x509/certificate/extension.ex b/lib/x509/certificate/extension.ex index 7a9c960..0903700 100644 --- a/lib/x509/certificate/extension.ex +++ b/lib/x509/certificate/extension.ex @@ -250,11 +250,11 @@ defmodule X509.Certificate.Extension do iex> X509.Certificate.Extension.subject_alt_name(["www.example.com", "example.com"]) {:Extension, {2, 5, 29, 17}, false, - [dNSName: 'www.example.com', dNSName: 'example.com']} + [dNSName: ~c"www.example.com", dNSName: ~c"example.com"]} - iex> X509.Certificate.Extension.subject_alt_name(emailAddress: 'user@example.com') + iex> X509.Certificate.Extension.subject_alt_name(emailAddress: ~c"user@example.com") {:Extension, {2, 5, 29, 17}, false, - [emailAddress: 'user@example.com']} + [emailAddress: ~c"user@example.com"]} """ @spec subject_alt_name([san_value()]) :: t() def subject_alt_name(value) do @@ -289,7 +289,7 @@ defmodule X509.Certificate.Extension do {:Extension, {2, 5, 29, 31}, false, [ {:DistributionPoint, - {:fullName, [uniformResourceIdentifier: 'http://crl.example.org/root.crl']}, + {:fullName, [uniformResourceIdentifier: ~c"http://crl.example.org/root.crl"]}, :asn1_NOVALUE, :asn1_NOVALUE} ]} """ diff --git a/lib/x509/certificate/validity.ex b/lib/x509/certificate/validity.ex index d3413b5..fa640c3 100644 --- a/lib/x509/certificate/validity.ex +++ b/lib/x509/certificate/validity.ex @@ -26,13 +26,13 @@ defmodule X509.Certificate.Validity do iex> {:ok, not_before, 0} = DateTime.from_iso8601("2018-01-01T00:00:00Z") iex> {:ok, not_after, 0} = DateTime.from_iso8601("2018-12-31T23:59:59Z") iex> X509.Certificate.Validity.new(not_before, not_after) - {:Validity, {:utcTime, '180101000000Z'}, {:utcTime, '181231235959Z'}} + {:Validity, {:utcTime, ~c"180101000000Z"}, {:utcTime, ~c"181231235959Z"}} iex> {:ok, not_before, 0} = DateTime.from_iso8601("2051-01-01T00:00:00Z") iex> {:ok, not_after, 0} = DateTime.from_iso8601("2051-12-31T23:59:59Z") iex> X509.Certificate.Validity.new(not_before, not_after) - {:Validity, {:generalTime, '20510101000000Z'}, - {:generalTime, '20511231235959Z'}} + {:Validity, {:generalTime, ~c"20510101000000Z"}, + {:generalTime, ~c"20511231235959Z"}} """ @spec new(DateTime.t(), DateTime.t()) :: t() def new(%DateTime{} = not_before, %DateTime{} = not_after) do