42 lines
1.5 KiB
C#
42 lines
1.5 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
namespace ln.identities
|
|
{
|
|
public class AuthenticationChallenges
|
|
{
|
|
public AuthenticationChallenge[] Challenges => authenticationChallenges.ToArray();
|
|
|
|
List<AuthenticationChallenge> authenticationChallenges = new List<AuthenticationChallenge>();
|
|
|
|
private AuthenticationChallenges()
|
|
{
|
|
}
|
|
|
|
public AuthenticationChallenges(IEnumerable<SecureAttribute> secureAttributes)
|
|
{
|
|
foreach (SecureAttribute secureAttribute in secureAttributes)
|
|
{
|
|
authenticationChallenges.Add(new AuthenticationChallenge(secureAttribute));
|
|
}
|
|
}
|
|
}
|
|
|
|
public class AuthenticationChallenge
|
|
{
|
|
public Guid SecureAttributeID { get; private set; }
|
|
public String SecureAttributeTypeName { get; private set; }
|
|
public string SecureAttributeLabel { get; private set; }
|
|
public String AuthenticationParameters { get; private set; }
|
|
public byte[] Challenge { get; private set; }
|
|
|
|
public AuthenticationChallenge(SecureAttribute secureAttribute)
|
|
{
|
|
SecureAttributeID = secureAttribute.UniqueID;
|
|
SecureAttributeTypeName = secureAttribute.GetAttributeTypeName();
|
|
SecureAttributeLabel = secureAttribute.Label;
|
|
AuthenticationParameters = secureAttribute.GetAuthenticationParameters();
|
|
Challenge = secureAttribute.CreateChallenge();
|
|
}
|
|
}
|
|
}
|