Skip to content

Commit

Permalink
Add deprecated attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
David R. Williamson committed Oct 4, 2021
1 parent f484281 commit e1d3f7c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions iothub/service/src/Common/Security/CryptoKeyGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ static public class CryptoKeyGenerator
/// </summary>
/// <param name="keySize">The size of the key.</param>
/// <returns>Byte array representing the key.</returns>
[Obsolete("This method will be deprecated in a future version.")]
public static byte[] GenerateKeyBytes(int keySize)
{
#if NET451
Expand All @@ -61,6 +62,7 @@ public static byte[] GenerateKeyBytes(int keySize)
/// </summary>
/// <param name="keySize">Desired key size.</param>
/// <returns>A generated key.</returns>
[Obsolete("This method will be deprecated in a future version.")]
public static string GenerateKey(int keySize)
{
return Convert.ToBase64String(GenerateKeyBytes(keySize));
Expand All @@ -72,6 +74,7 @@ public static string GenerateKey(int keySize)
/// </summary>
/// <param name="keySize">Desired key size.</param>
/// <returns>A generated hexadecimal key.</returns>
[Obsolete("This method will not be carried forward to newer .NET targets.")]
public static string GenerateKeyInHex(int keySize)
{
byte[] keyBytes = new byte[keySize];
Expand All @@ -85,6 +88,7 @@ public static string GenerateKeyInHex(int keySize)
/// Generate a GUID using random bytes from the framework's cryptograpically strong RNG (Random Number Generator).
/// </summary>
/// <returns>A cryptographically secure GUID.</returns>
[Obsolete("This method will not be carried forward to newer .NET targets.")]
public static Guid GenerateGuid()
{
byte[] bytes = new byte[GuidLength];
Expand Down Expand Up @@ -116,6 +120,7 @@ public static Guid GenerateGuid()
/// Generate a unique password with a default length and without converting it to Base64String.
/// </summary>
/// <returns>A unique password.</returns>
[Obsolete("This method will not be carried forward to newer .NET targets.")]
public static string GeneratePassword()
{
return GeneratePassword(DefaultPasswordLength, false);
Expand All @@ -127,6 +132,7 @@ public static string GeneratePassword()
/// <param name="length">Desired length of the password.</param>
/// <param name="base64Encoding">Encode the password if set to True. False otherwise.</param>
/// <returns>A generated password.</returns>
[Obsolete("This method will not be carried forward to newer .NET targets.")]
public static string GeneratePassword(int length, bool base64Encoding)
{
string password = Membership.GeneratePassword(length, length / 2);
Expand Down

0 comments on commit e1d3f7c

Please sign in to comment.