Created
July 3, 2019 12:38
-
-
Save miceiken/8b8b06a66ea646e84dc29360f4fcb16f to your computer and use it in GitHub Desktop.
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
using System; | |
namespace Identity.Models | |
{ | |
public enum CredentialType | |
{ | |
Password, | |
PublicKey, | |
Token, | |
}; | |
public abstract class Credential | |
{ | |
protected Credential(CredentialType credentialType) | |
{ | |
CredentialType = credentialType; | |
} | |
public CredentialType CredentialType { get; set; } | |
public DateTime CreationTime { get; set; } | |
} | |
public class PasswordCredential : Credential | |
{ | |
public PasswordCredential(byte[] salt, byte[] key) | |
: base(CredentialType.Password) | |
{ | |
Salt = salt; | |
Key = key; | |
} | |
public byte[] Salt { get; set; } | |
public byte[] Key { get; set; } | |
} | |
public class PublicKeyCredential : Credential | |
{ | |
public PublicKeyCredential(byte[] publicKey) | |
: base(CredentialType.PublicKey) | |
{ | |
PublicKey = publicKey; | |
} | |
public byte[] PublicKey { get; set; } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment