public override CredentialState GetCredentialState(string Token)
        {
            ParametersValidation validation = new ParametersValidation();

            validation.Add(ParameterType.String, "Token", Token);
            CredentialState result = (CredentialState)ExecuteGetCommand(validation, CredentialServiceTest.GetCredentialStateTest);

            return(result);
        }
        public override string CreateCredential(Credential Credential, CredentialState State)
        {
            ParametersValidation validation = new ParametersValidation();

            validation.Add(ParameterType.String, "Credential.token", Credential.token);
            validation.Add(ParameterType.String, "Credential.CredentialHolderReference", Credential.CredentialHolderReference);
            validation.Add(ParameterType.String, "Credential.Description", Credential.Description);
            if (Credential.ValidFromSpecified)
            {
                validation.Add(ParameterType.Log, "Credential.ValidFrom", Credential.ValidFrom);
            }
            if (Credential.ValidToSpecified)
            {
                validation.Add(ParameterType.Log, "Credential.ValidTo", Credential.ValidTo);
            }

            if (Credential.CredentialAccessProfile != null && Credential.CredentialAccessProfile.Length > 0)
            {
                if (Credential.CredentialAccessProfile[0].ValidFromSpecified)
                {
                    validation.Add(ParameterType.Log, "Credential.CredentialAccessProfile0.ValidFrom", Credential.CredentialAccessProfile[0].ValidFrom);
                }
                if (Credential.CredentialAccessProfile[0].ValidToSpecified)
                {
                    validation.Add(ParameterType.Log, "Credential.CredentialAccessProfile0.ValidTo", Credential.CredentialAccessProfile[0].ValidTo);
                }
            }


            //validation.Add(ParameterType.String, "Credential.CredentialAccessProfile[0].ValidFrom", Credential.CredentialAccessProfile[0].ValidFrom);
            //validation.Add(ParameterType.String, "Credential.CredentialAccessProfile[0].ValidTo", Credential.CredentialAccessProfile[0].ValidTo);

            //TODO: Credential.ValidFrom validation
            //TODO: Credential.ValidTo validation
            //TODO: Credential.CredentialAccessProfile validation
            //TODO: Credential.CredentialIdentifier validation

            if (Credential.CredentialIdentifier != null && Credential.CredentialIdentifier.Length > 0)
            {
                validation.Add(ParameterType.Log, "Credential.CredentialIdentifier0.Value", Credential.CredentialIdentifier[0].Value);
            }

            validation.Add(ParameterType.String, "State.Enabled", State.Enabled.ToString());
            if (State.AntipassbackState != null)
            {
                validation.Add(ParameterType.String, "State.AntipassbackState.AntipassbackViolated", State.AntipassbackState.AntipassbackViolated.ToString());
            }
            validation.Add(ParameterType.String, "State.Reason", State.Reason);


            string result = (string)ExecuteGetCommand(validation, CredentialServiceTest.CreateCredentialTest);

            return(result);
        }
Exemplo n.º 3
0
 public abstract string CreateCredential(Credential Credential, CredentialState State);