Skip to content

Commit 28d2227

Browse files
authored
Revert "Enable Nullability for important Certificate Handling classes (#2989)" (#3007)
This reverts commit 23d167a.
1 parent 38388f1 commit 28d2227

14 files changed

+283
-362
lines changed

Stack/Opc.Ua.Core/Schema/ApplicationConfiguration.cs

Lines changed: 33 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -2848,7 +2848,6 @@ public ServerRegistrationCollection(int capacity) : base(capacity) { }
28482848
#endregion
28492849

28502850
#region CertificateStoreIdentifier Class
2851-
#nullable enable
28522851
/// <summary>
28532852
/// Describes a certificate store.
28542853
/// </summary>
@@ -2863,7 +2862,7 @@ public partial class CertificateStoreIdentifier
28632862
/// If the StoreName is not empty, the CertificateStoreType.X509Store is returned, otherwise the StoreType is returned.
28642863
/// </value>
28652864
[DataMember(IsRequired = false, EmitDefaultValue = false, Order = 0)]
2866-
public string? StoreType
2865+
public string StoreType
28672866
{
28682867
get
28692868
{
@@ -2890,13 +2889,13 @@ public string? StoreType
28902889
/// If the StoreName is empty, the m_storePath is returned.
28912890
/// </value>
28922891
[DataMember(IsRequired = false, EmitDefaultValue = false, Order = 1)]
2893-
public string? StorePath
2892+
public string StorePath
28942893
{
28952894
get
28962895
{
2897-
if (!string.IsNullOrEmpty(m_storeName))
2896+
if (!String.IsNullOrEmpty(m_storeName))
28982897
{
2899-
if (string.IsNullOrEmpty(m_storeLocation))
2898+
if (String.IsNullOrEmpty(m_storeLocation))
29002899
{
29012900
return CurrentUser + m_storeName;
29022901
}
@@ -2926,7 +2925,7 @@ public string? StorePath
29262925
/// </summary>
29272926
[DataMember(IsRequired = false, EmitDefaultValue = false, Order = 2)]
29282927
[Obsolete("Use StoreType/StorePath instead")]
2929-
public string? StoreName
2928+
public string StoreName
29302929
{
29312930
get { return m_storeName; }
29322931
set { m_storeName = value; }
@@ -2937,7 +2936,7 @@ public string? StoreName
29372936
/// </summary>
29382937
[DataMember(IsRequired = false, EmitDefaultValue = false, Order = 3)]
29392938
[Obsolete("Use StoreType/StorePath instead")]
2940-
public string? StoreLocation
2939+
public string StoreLocation
29412940
{
29422941
get { return m_storeLocation; }
29432942
set { m_storeLocation = value; }
@@ -2955,18 +2954,16 @@ private int XmlEncodedValidationOptions
29552954
#endregion
29562955

29572956
#region Private Fields
2958-
private string? m_storeType;
2959-
private string? m_storePath;
2960-
private string? m_storeLocation;
2961-
private string? m_storeName;
2957+
private string m_storeType;
2958+
private string m_storePath;
2959+
private string m_storeLocation;
2960+
private string m_storeName;
29622961
private CertificateValidationOptions m_validationOptions;
29632962
#endregion
29642963
}
2965-
#nullable disable
29662964
#endregion
29672965

29682966
#region CertificateTrustList Class
2969-
#nullable enable
29702967
[DataContract(Namespace = Namespaces.OpcUaConfig)]
29712968
[KnownType(typeof(CertificateTrustList))]
29722969
public partial class CertificateTrustList : CertificateStoreIdentifier
@@ -2977,8 +2974,6 @@ public partial class CertificateTrustList : CertificateStoreIdentifier
29772974
/// </summary>
29782975
public CertificateTrustList()
29792976
{
2980-
//set in initialize
2981-
m_trustedCertificates = null!;
29822977
Initialize();
29832978
}
29842979

@@ -3029,7 +3024,6 @@ public CertificateIdentifierCollection TrustedCertificates
30293024
private CertificateIdentifierCollection m_trustedCertificates;
30303025
#endregion
30313026
}
3032-
#nullable disable
30333027
#endregion
30343028

30353029
#region CertificateIdentifierCollection Class
@@ -3055,7 +3049,6 @@ public CertificateIdentifierCollection(int capacity) : base(capacity) { }
30553049
#endregion
30563050

30573051
#region CertificateIdentifier Class
3058-
#nullable enable
30593052
[DataContract(Namespace = Namespaces.OpcUaConfig)]
30603053
public partial class CertificateIdentifier
30613054
{
@@ -3117,11 +3110,11 @@ private void Initialize()
31173110
/// </summary>
31183111
/// <value>The type of the store - defined in the <see cref="CertificateStoreType"/>.</value>
31193112
[DataMember(IsRequired = false, EmitDefaultValue = false, Order = 10)]
3120-
public string? StoreType
3113+
public string StoreType
31213114
{
31223115
get
31233116
{
3124-
if (!string.IsNullOrEmpty(m_storeName))
3117+
if (!String.IsNullOrEmpty(m_storeName))
31253118
{
31263119
return CertificateStoreType.X509Store;
31273120
}
@@ -3140,13 +3133,13 @@ public string? StoreType
31403133
/// </summary>
31413134
/// <value>The store path in the form <c>StoreName\\Store Location</c> .</value>
31423135
[DataMember(IsRequired = false, EmitDefaultValue = false, Order = 15)]
3143-
public string? StorePath
3136+
public string StorePath
31443137
{
31453138
get
31463139
{
3147-
if (!string.IsNullOrEmpty(m_storeName))
3140+
if (!String.IsNullOrEmpty(m_storeName))
31483141
{
3149-
if (string.IsNullOrEmpty(m_storeLocation))
3142+
if (String.IsNullOrEmpty(m_storeLocation))
31503143
{
31513144
return Utils.Format("LocalMachine\\{0}", m_storeName);
31523145
}
@@ -3161,9 +3154,9 @@ public string? StorePath
31613154
{
31623155
m_storePath = value;
31633156

3164-
if (!string.IsNullOrEmpty(m_storePath))
3157+
if (!String.IsNullOrEmpty(m_storePath))
31653158
{
3166-
if (string.IsNullOrEmpty(m_storeType))
3159+
if (String.IsNullOrEmpty(m_storeType))
31673160
{
31683161
m_storeType = CertificateStoreIdentifier.DetermineStoreType(m_storePath);
31693162
}
@@ -3178,7 +3171,7 @@ public string? StorePath
31783171
/// <seealso cref="System.Security.Cryptography.X509Certificates.StoreName"/>
31793172
[DataMember(IsRequired = false, EmitDefaultValue = false, Order = 20)]
31803173
[Obsolete("Use StoreType/StorePath instead")]
3181-
public string? StoreName
3174+
public string StoreName
31823175
{
31833176
get { return m_storeName; }
31843177
set { m_storeName = value; }
@@ -3191,7 +3184,7 @@ public string? StoreName
31913184
/// <seealso cref="System.Security.Cryptography.X509Certificates.StoreLocation"/>
31923185
[DataMember(IsRequired = false, EmitDefaultValue = false, Order = 30)]
31933186
[Obsolete("Use StoreType/StorePath instead")]
3194-
public string? StoreLocation
3187+
public string StoreLocation
31953188
{
31963189
get { return m_storeLocation; }
31973190
set { m_storeLocation = value; }
@@ -3245,7 +3238,7 @@ public string? StoreLocation
32453238
/// <seealso cref="System.Security.Cryptography.X509Certificates.X500DistinguishedName"/>
32463239
/// <seealso cref="System.Security.Cryptography.AsnEncodedData"/>
32473240
[DataMember(IsRequired = false, EmitDefaultValue = false, Order = 40)]
3248-
public string? SubjectName
3241+
public string SubjectName
32493242
{
32503243
get
32513244
{
@@ -3277,7 +3270,7 @@ public string? SubjectName
32773270
/// <value>The thumbprint of a certificate..</value>
32783271
/// <seealso cref="X509Certificate2"/>
32793272
[DataMember(IsRequired = false, EmitDefaultValue = false, Order = 50)]
3280-
public string? Thumbprint
3273+
public string Thumbprint
32813274
{
32823275
get
32833276
{
@@ -3308,7 +3301,7 @@ public string? Thumbprint
33083301
/// </summary>
33093302
/// <value>A byte array containing the X.509 certificate data.</value>
33103303
[DataMember(IsRequired = false, EmitDefaultValue = false, Order = 60)]
3311-
public byte[]? RawData
3304+
public byte[] RawData
33123305
{
33133306
get
33143307
{
@@ -3351,7 +3344,7 @@ private int XmlEncodedValidationOptions
33513344
/// </summary>
33523345
/// <value>The NodeId of the certificate type, e.g. EccNistP256ApplicationCertificateType.</value>
33533346
[DataMember(IsRequired = false, EmitDefaultValue = false, Order = 80)]
3354-
public NodeId? CertificateType
3347+
public NodeId CertificateType
33553348
{
33563349
get => m_certificateType;
33573350
set => m_certificateType = value;
@@ -3362,27 +3355,27 @@ public NodeId? CertificateType
33623355
/// </summary>
33633356
/// <value>Rsa, RsaMin, RsaSha256, NistP256, NistP384, BrainpoolP256r1, BrainpoolP384r1, Curve25519, Curve448</value>
33643357
[DataMember(IsRequired = false, EmitDefaultValue = false, Order = 90)]
3365-
public string? CertificateTypeString
3358+
public string CertificateTypeString
33663359
{
33673360
get => EncodeCertificateType(m_certificateType);
33683361
set => m_certificateType = DecodeCertificateType(value);
33693362
}
33703363
#endregion
33713364

33723365
#region Private Fields
3373-
private string? m_storeType;
3374-
private string? m_storePath;
3375-
private string? m_storeLocation;
3376-
private string? m_storeName;
3377-
private string? m_subjectName;
3378-
private string? m_thumbprint;
3379-
private X509Certificate2? m_certificate;
3380-
private NodeId? m_certificateType;
3366+
private string m_storeType;
3367+
private string m_storePath;
3368+
private string m_storeLocation;
3369+
private string m_storeName;
3370+
private string m_subjectName;
3371+
private string m_thumbprint;
3372+
private X509Certificate2 m_certificate;
3373+
private NodeId m_certificateType;
33813374
private CertificateValidationOptions m_validationOptions;
33823375
#endregion
33833376
}
3384-
#nullable disable
33853377
#endregion
3378+
33863379
#region ConfiguredEndpointCollection Class
33873380
/// <summary>
33883381
/// Stores a list of cached endpoints.

0 commit comments

Comments
 (0)