-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moved EncryptedAttribute in the Ciphers project (where it should've been in a first place...)
- Loading branch information
vmelamed
committed
Nov 30, 2015
1 parent
e2664f1
commit 43ce4d3
Showing
10 changed files
with
62 additions
and
53 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
Aspects/Security/Cryptography/Ciphers/DecryptedAttribute.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
using System; | ||
|
||
namespace vm.Aspects.Security.Cryptography.Ciphers | ||
{ | ||
/// <summary> | ||
/// DecryptedAttribute marks a property or field as one that must be first decrypted before accessing its actual value. | ||
/// This class cannot be inherited. | ||
/// </summary> | ||
[Serializable] | ||
[AttributeUsage( | ||
AttributeTargets.Field | | ||
AttributeTargets.Property, | ||
AllowMultiple = false, | ||
Inherited = true)] | ||
public sealed class DecryptedAttribute : Attribute | ||
{ | ||
/// <summary> | ||
/// The default name of a property or field that holds the encrypted value. | ||
/// </summary> | ||
public const string DefaultEncryptedProperty = "Encypted"; | ||
|
||
/// <summary> | ||
/// Gets or sets the name of the property or field which holds the encrypted value. | ||
/// </summary> | ||
public string EncryptedIn { get; } | ||
|
||
/// <summary> | ||
/// Gets a string that can be used to resolve which cipher should be selected from the DI container. | ||
/// </summary> | ||
public string CipherResolver { get; set; } | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the <see cref="DecryptedAttribute"/> class. | ||
/// </summary> | ||
/// <param name="encrypted"> | ||
/// Sets the name of a property or field that holds the encrypted value. | ||
/// </param> | ||
public DecryptedAttribute( | ||
string encrypted = DefaultEncryptedProperty) | ||
{ | ||
EncryptedIn = encrypted; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters