AsnWriter.WriteUtcTime Method

Definition

Overloads

WriteUtcTime(DateTimeOffset, Nullable<Asn1Tag>)

Write the provided value as a UTCTime with a specified tag, accepting the two-digit year as valid in context.

WriteUtcTime(DateTimeOffset, Int32, Nullable<Asn1Tag>)

Write the provided value as a UTCTime with a specified tag, provided the year is in the allowed range.

WriteUtcTime(DateTimeOffset, Nullable<Asn1Tag>)

Source:
AsnWriter.UtcTime.cs
Source:
AsnWriter.UtcTime.cs
Source:
AsnWriter.UtcTime.cs

Write the provided value as a UTCTime with a specified tag, accepting the two-digit year as valid in context.

public void WriteUtcTime (DateTimeOffset value, System.Formats.Asn1.Asn1Tag? tag = default);
member this.WriteUtcTime : DateTimeOffset * Nullable<System.Formats.Asn1.Asn1Tag> -> unit
Public Sub WriteUtcTime (value As DateTimeOffset, Optional tag As Nullable(Of Asn1Tag) = Nothing)

Parameters

value
DateTimeOffset

The value to write.

tag
Nullable<Asn1Tag>

The tag to write, or null for the default tag (Universal 23).

Exceptions

tag.TagClass is Universal, but tag.TagValue is not correct for the method.

Applies to

WriteUtcTime(DateTimeOffset, Int32, Nullable<Asn1Tag>)

Source:
AsnWriter.UtcTime.cs
Source:
AsnWriter.UtcTime.cs
Source:
AsnWriter.UtcTime.cs

Write the provided value as a UTCTime with a specified tag, provided the year is in the allowed range.

public void WriteUtcTime (DateTimeOffset value, int twoDigitYearMax, System.Formats.Asn1.Asn1Tag? tag = default);
member this.WriteUtcTime : DateTimeOffset * int * Nullable<System.Formats.Asn1.Asn1Tag> -> unit
Public Sub WriteUtcTime (value As DateTimeOffset, twoDigitYearMax As Integer, Optional tag As Nullable(Of Asn1Tag) = Nothing)

Parameters

value
DateTimeOffset

The value to write.

twoDigitYearMax
Int32

The maximum valid year for value, after conversion to UTC. For the X.509 Time.utcTime range of 1950-2049, pass 2049.

tag
Nullable<Asn1Tag>

The tag to write, or null for the default tag (Universal 23).

Exceptions

tag.TagClass is Universal, but tag.TagValue is not correct for the method.

value.Year (after conversion to UTC) is not in the range (twoDigitYearMax - 100, twoDigitYearMax].

Applies to