Skip to content

Commit

Permalink
Fix netstandard2.0 compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
mrsuciu committed Jul 4, 2024
1 parent e973433 commit a28d901
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 13 deletions.
26 changes: 16 additions & 10 deletions Libraries/Opc.Ua.Server/Session/Session.cs
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,7 @@ public virtual void SetEccUserTokenSecurityPolicy(string securityPolicyUri)
}
}

#if ECC_SUPPORT
/// <summary>
/// Create new ECC ephemeral key
/// </summary>
Expand All @@ -412,6 +413,17 @@ public virtual EphemeralKeyType GetNewEccKey()
}
}

/// <summary>
/// The Server generated ephemeral key
/// </summary>
public EphemeralKeyType EphemeralKey
{
set
{
m_ephemeralKey = value;
}
}
#endif
/// <summary>
/// Returns the session's endpoint
/// </summary>
Expand All @@ -434,16 +446,7 @@ public string SecureChannelId
}
}

/// <summary>
/// The Server generated ephemeral key
/// </summary>
public EphemeralKeyType EphemeralKey
{
set
{
m_ephemeralKey = value;
}
}


/// <summary>
/// Validates the request.
Expand Down Expand Up @@ -1247,7 +1250,10 @@ private void UpdateDiagnosticCounters(RequestType requestType, bool error, bool
private List<ContinuationPoint> m_browseContinuationPoints;
private List<HistoryContinuationPoint> m_historyContinuationPoints;

#if ECC_SUPPORT
private EphemeralKeyType m_ephemeralKey;
#endif

#endregion
}
}
18 changes: 15 additions & 3 deletions Stack/Opc.Ua.Core/Stack/Types/UserIdentityToken.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,23 @@ namespace Opc.Ua
/// </summary>
public partial class UserIdentityToken
{
#region Public Methods
#region Public Methods
/// <summary>
/// Encrypts the token (implemented by the subclass).
/// </summary>
#if ECC_SUPPORT
[Obsolete("Use Encrypt(X509Certificate2, byte[], string securityPolicyUri, Nonce, X509Certificate2, X509Certificate2Collection, bool) ")]
#endif
public virtual void Encrypt(X509Certificate2 certificate, byte[] receiverNonce, string securityPolicyUri)
{
}

/// <summary>
/// Decrypts the token (implemented by the subclass).
/// </summary>
#if ECC_SUPPORT
[Obsolete("Use Decrypt(X509Certificate2, Nonce, string, Nonce, X509Certificate2, X509Certificate2Collection, CertificateValidator) ")]
#endif
public virtual void Decrypt(X509Certificate2 certificate, byte[] receiverNonce, string securityPolicyUri)
{
}
Expand Down Expand Up @@ -101,11 +105,13 @@ public string DecryptedPassword
}
#endregion

#region Public Methods
#region Public Methods
/// <summary>
/// Encrypts the DecryptedPassword using the EncryptionAlgorithm and places the result in Password
/// </summary>
#if ECC_SUPPORT
[Obsolete("Use Encrypt(X509Certificate2, byte[], string securityPolicyUri, Nonce, X509Certificate2, X509Certificate2Collection, bool)")]
#endif
public override void Encrypt(X509Certificate2 certificate, byte[] senderNonce, string securityPolicyUri)
{
Encrypt(certificate, senderNonce, securityPolicyUri, null);
Expand All @@ -114,7 +120,9 @@ public override void Encrypt(X509Certificate2 certificate, byte[] senderNonce, s
/// <summary>
/// Decrypts the Password using the EncryptionAlgorithm and places the result in DecryptedPassword
/// </summary>
#if ECC_SUPPORT
[Obsolete("Use Decrypt(X509Certificate2, Nonce, string, Nonce, X509Certificate2, X509Certificate2Collection, CertificateValidator) ")]
#endif
public override void Decrypt(X509Certificate2 certificate, byte[] senderNonce, string securityPolicyUri)
{
Decrypt(certificate, Nonce.CreateNonce(securityPolicyUri, senderNonce), securityPolicyUri);
Expand Down Expand Up @@ -416,11 +424,13 @@ public byte[] DecryptedTokenData
}
#endregion

#region Public Methods
#region Public Methods
/// <summary>
/// Encrypts the DecryptedTokenData using the EncryptionAlgorithm and places the result in Password
/// </summary>
#if ECC_SUPPORT
[Obsolete("Use Encrypt(X509Certificate2, byte[], string securityPolicyUri, Nonce, X509Certificate2, X509Certificate2Collection, bool)")]
#endif
public override void Encrypt(X509Certificate2 certificate, byte[] senderNonce, string securityPolicyUri)
{
Encrypt(certificate, senderNonce, securityPolicyUri, null);
Expand All @@ -429,7 +439,9 @@ public override void Encrypt(X509Certificate2 certificate, byte[] senderNonce, s
/// <summary>
/// Decrypts the Password using the EncryptionAlgorithm and places the result in DecryptedPassword
/// </summary>
#if ECC_SUPPORT
[Obsolete("Use Decrypt(X509Certificate2, Nonce, string, Nonce, X509Certificate2, X509Certificate2Collection, CertificateValidator) ")]
#endif
public override void Decrypt(X509Certificate2 certificate, byte[] senderNonce, string securityPolicyUri)
{
Decrypt(certificate, Nonce.CreateNonce(securityPolicyUri, senderNonce), securityPolicyUri);
Expand Down

0 comments on commit a28d901

Please sign in to comment.