@@ -56,9 +56,6 @@ public Asn1Builder AddInteger(BigInteger value) {
5656 /// </param>
5757 /// <returns>Current instance with added value.</returns>
5858 public Asn1Builder AddBitString ( ReadOnlySpan < Byte > value , Byte unusedBits ) {
59- if ( value == null ) {
60- throw new ArgumentNullException ( nameof ( value ) ) ;
61- }
6259 _rawData . Add ( new Asn1BitString ( value , unusedBits ) . GetRawDataAsMemory ( ) ) ;
6360 return this ;
6461 }
@@ -73,9 +70,6 @@ public Asn1Builder AddBitString(ReadOnlySpan<Byte> value, Byte unusedBits) {
7370 /// </param>
7471 /// <returns>Current instance with added value.</returns>
7572 public Asn1Builder AddBitString ( ReadOnlySpan < Byte > value , Boolean calculateUnusedBits = false ) {
76- if ( value == null ) {
77- throw new ArgumentNullException ( nameof ( value ) ) ;
78- }
7973 _rawData . Add ( new Asn1BitString ( value , calculateUnusedBits ) . GetRawDataAsMemory ( ) ) ;
8074 return this ;
8175 }
@@ -91,7 +85,6 @@ public Asn1Builder AddBitString(ReadOnlySpan<Byte> value, Boolean calculateUnuse
9185 /// <returns>Current instance with added value.</returns>
9286 public Asn1Builder AddOctetString ( ReadOnlyMemory < Byte > value ) {
9387 _rawData . Add ( new Asn1OctetString ( value , false ) . GetRawDataAsMemory ( ) ) ;
94-
9588 return this ;
9689 }
9790 /// <summary>
@@ -113,7 +106,7 @@ public Asn1Builder AddNull() {
113106 /// </exception>
114107 /// <returns>Current instance with added value.</returns>
115108 public Asn1Builder AddObjectIdentifier ( Oid value ) {
116- if ( value == null ) {
109+ if ( value is null ) {
117110 throw new ArgumentNullException ( nameof ( value ) ) ;
118111 }
119112 _rawData . Add ( new Asn1ObjectIdentifier ( value ) . GetRawDataAsMemory ( ) ) ;
@@ -131,7 +124,7 @@ public Asn1Builder AddObjectIdentifier(Oid value) {
131124 /// <exception cref="FormatException">Specified value doesn't represent valid decimal-dot format.</exception>
132125 /// <returns>Current instance with added value.</returns>
133126 public Asn1Builder AddRelativeOid ( String value ) {
134- if ( value == null ) {
127+ if ( value is null ) {
135128 throw new ArgumentNullException ( nameof ( value ) ) ;
136129 }
137130 _rawData . Add ( new Asn1RelativeOid ( value ) . GetRawDataAsMemory ( ) ) ;
@@ -159,7 +152,7 @@ public Asn1Builder AddEnumerated(UInt64 value) {
159152 /// </exception>
160153 /// <returns>Current instance with added value.</returns>
161154 public Asn1Builder AddUTF8String ( String value ) {
162- if ( value == null ) {
155+ if ( value is null ) {
163156 throw new ArgumentNullException ( nameof ( value ) ) ;
164157 }
165158 _rawData . Add ( new Asn1UTF8String ( value ) . GetRawDataAsMemory ( ) ) ;
@@ -212,7 +205,7 @@ public Asn1Builder AddSet(ReadOnlySpan<Byte> value) {
212205 /// </exception>
213206 /// <returns>Current instance with added value.</returns>
214207 public Asn1Builder AddNumericString ( String value ) {
215- if ( value == null ) {
208+ if ( value is null ) {
216209 throw new ArgumentNullException ( nameof ( value ) ) ;
217210 }
218211 _rawData . Add ( new Asn1NumericString ( value ) . GetRawDataAsMemory ( ) ) ;
@@ -229,7 +222,7 @@ public Asn1Builder AddNumericString(String value) {
229222 /// </exception>
230223 /// <returns>Current instance with added value.</returns>
231224 public Asn1Builder AddPrintableString ( String value ) {
232- if ( value == null ) {
225+ if ( value is null ) {
233226 throw new ArgumentNullException ( nameof ( value ) ) ;
234227 }
235228 _rawData . Add ( new Asn1PrintableString ( value ) . GetRawDataAsMemory ( ) ) ;
@@ -246,7 +239,7 @@ public Asn1Builder AddPrintableString(String value) {
246239 /// </exception>
247240 /// <returns>Current instance with added value.</returns>
248241 public Asn1Builder AddTeletexString ( String value ) {
249- if ( value == null ) {
242+ if ( value is null ) {
250243 throw new ArgumentNullException ( nameof ( value ) ) ;
251244 }
252245 _rawData . Add ( new Asn1TeletexString ( value ) . GetRawDataAsMemory ( ) ) ;
@@ -263,7 +256,7 @@ public Asn1Builder AddTeletexString(String value) {
263256 /// </exception>
264257 /// <returns>Current instance with added value.</returns>
265258 public Asn1Builder AddVideotexString ( String value ) {
266- if ( value == null ) {
259+ if ( value is null ) {
267260 throw new ArgumentNullException ( nameof ( value ) ) ;
268261 }
269262 _rawData . Add ( Asn1Utils . Encode ( Encoding . ASCII . GetBytes ( value ) . AsSpan ( ) , Asn1Type . VideotexString ) ) ;
@@ -280,7 +273,7 @@ public Asn1Builder AddVideotexString(String value) {
280273 /// </exception>
281274 /// <returns>Current instance with added value.</returns>
282275 public Asn1Builder AddIA5String ( String value ) {
283- if ( value == null ) {
276+ if ( value is null ) {
284277 throw new ArgumentNullException ( nameof ( value ) ) ;
285278 }
286279 _rawData . Add ( new Asn1IA5String ( value ) . GetRawDataAsMemory ( ) ) ;
@@ -337,7 +330,7 @@ public Asn1Builder AddRfcDateTime(DateTime value) {
337330 /// </exception>
338331 /// <returns>Current instance with added value.</returns>
339332 public Asn1Builder AddVisibleString ( String value ) {
340- if ( value == null ) {
333+ if ( value is null ) {
341334 throw new ArgumentNullException ( nameof ( value ) ) ;
342335 }
343336 _rawData . Add ( new Asn1VisibleString ( value ) . GetRawDataAsMemory ( ) ) ;
@@ -354,7 +347,7 @@ public Asn1Builder AddVisibleString(String value) {
354347 /// </exception>
355348 /// <returns>Current instance with added value.</returns>
356349 public Asn1Builder AddUniversalString ( String value ) {
357- if ( value == null ) {
350+ if ( value is null ) {
358351 throw new ArgumentNullException ( nameof ( value ) ) ;
359352 }
360353 _rawData . Add ( new Asn1UniversalString ( value ) . GetRawDataAsMemory ( ) ) ;
@@ -371,7 +364,7 @@ public Asn1Builder AddUniversalString(String value) {
371364 /// </exception>
372365 /// <returns>Current instance with added value.</returns>
373366 public Asn1Builder AddBMPString ( String value ) {
374- if ( value == null ) {
367+ if ( value is null ) {
375368 throw new ArgumentNullException ( nameof ( value ) ) ;
376369 }
377370 _rawData . Add ( new Asn1BMPString ( value ) . GetRawDataAsMemory ( ) ) ;
@@ -424,9 +417,6 @@ public Asn1Builder AddDerData(ReadOnlyMemory<Byte> value, Byte outerTag) {
424417 /// <param name="mustEncode">
425418 /// Specifies if data in <strong>value</strong> parameter must be encoded or not. See Remarks for more details.
426419 /// </param>
427- /// <exception cref="ArgumentNullException">
428- /// <strong>value</strong> parameter is null.
429- /// </exception>
430420 /// <exception cref="InvalidDataException">
431421 /// <strong>value</strong> is not encoded.
432422 /// </exception>
@@ -440,9 +430,6 @@ public Asn1Builder AddDerData(ReadOnlyMemory<Byte> value, Byte outerTag) {
440430 /// <strong>value</strong> parameter is untagged, an exception will be thrown.
441431 /// </remarks>
442432 public Asn1Builder AddImplicit ( Byte implicitTag , ReadOnlySpan < Byte > value , Boolean mustEncode ) {
443- if ( value == null ) {
444- throw new ArgumentNullException ( nameof ( value ) ) ;
445- }
446433 if ( mustEncode ) {
447434 _rawData . Add ( Asn1Utils . Encode ( value , ( Byte ) ( 0x80 + implicitTag ) ) ) ;
448435 } else {
@@ -469,9 +456,6 @@ public Asn1Builder AddImplicit(Byte implicitTag, ReadOnlySpan<Byte> value, Boole
469456 /// <param name="mustEncode">
470457 /// Specifies if data in <strong>value</strong> parameter must be encoded or not. See Remarks for more details.
471458 /// </param>
472- /// <exception cref="ArgumentNullException">
473- /// <strong>value</strong> parameter is null.
474- /// </exception>
475459 /// <exception cref="InvalidDataException">
476460 /// <strong>value</strong> is not encoded.
477461 /// </exception>
@@ -484,9 +468,6 @@ public Asn1Builder AddImplicit(Byte implicitTag, ReadOnlySpan<Byte> value, Boole
484468 /// is untagged, invalid type will be produced.
485469 /// </remarks>
486470 public Asn1Builder AddExplicit ( Byte explicitTag , ReadOnlySpan < Byte > value , Boolean mustEncode ) {
487- if ( value == null ) {
488- throw new ArgumentNullException ( nameof ( value ) ) ;
489- }
490471 if ( mustEncode ) {
491472 _rawData . Add ( Asn1Utils . Encode ( value , ( Byte ) ( 0xa0 + explicitTag ) ) ) ;
492473 } else {
@@ -510,7 +491,7 @@ public Asn1Builder AddExplicit(Byte explicitTag, ReadOnlySpan<Byte> value, Boole
510491 /// In the current implementation, constructed BIT_STRING is encoded using primitive form.
511492 /// </remarks>
512493 public Asn1Builder AddBitString ( Func < Asn1Builder , Asn1Builder > selector ) {
513- if ( selector == null ) {
494+ if ( selector is null ) {
514495 throw new ArgumentNullException ( nameof ( selector ) ) ;
515496 }
516497 Asn1Builder b = selector ( new Asn1Builder ( ) ) ;
@@ -529,7 +510,7 @@ public Asn1Builder AddBitString(Func<Asn1Builder, Asn1Builder> selector) {
529510 /// In the current implementation, constructed OCTET_STRING is encoded using primitive form.
530511 /// </remarks>
531512 public Asn1Builder AddOctetString ( Func < Asn1Builder , Asn1Builder > selector ) {
532- if ( selector == null ) {
513+ if ( selector is null ) {
533514 throw new ArgumentNullException ( nameof ( selector ) ) ;
534515 }
535516 Asn1Builder b = selector ( new Asn1Builder ( ) ) ;
@@ -545,7 +526,7 @@ public Asn1Builder AddOctetString(Func<Asn1Builder, Asn1Builder> selector) {
545526 /// </exception>
546527 /// <returns>Current instance with added value.</returns>
547528 public Asn1Builder AddSequence ( Func < Asn1Builder , Asn1Builder > selector ) {
548- if ( selector == null ) {
529+ if ( selector is null ) {
549530 throw new ArgumentNullException ( nameof ( selector ) ) ;
550531 }
551532 Asn1Builder b = selector ( new Asn1Builder ( ) ) ;
@@ -561,7 +542,7 @@ public Asn1Builder AddSequence(Func<Asn1Builder, Asn1Builder> selector) {
561542 /// </exception>
562543 /// <returns>Current instance with added value.</returns>
563544 public Asn1Builder AddSet ( Func < Asn1Builder , Asn1Builder > selector ) {
564- if ( selector == null ) {
545+ if ( selector is null ) {
565546 throw new ArgumentNullException ( nameof ( selector ) ) ;
566547 }
567548 Asn1Builder b = selector ( new Asn1Builder ( ) ) ;
@@ -580,7 +561,7 @@ public Asn1Builder AddSet(Func<Asn1Builder, Asn1Builder> selector) {
580561 /// </exception>
581562 /// <returns>Current instance with added value.</returns>
582563 public Asn1Builder AddExplicit ( Byte explicitTag , Func < Asn1Builder , Asn1Builder > selector ) {
583- if ( selector == null ) {
564+ if ( selector is null ) {
584565 throw new ArgumentNullException ( nameof ( selector ) ) ;
585566 }
586567 Asn1Builder b = selector ( new Asn1Builder ( ) ) ;
0 commit comments