/// <summary>
        /// Constructor
        /// </summary>
        /// <param name="requestContext"></param>
        /// <param name="succeeded"></param>
        /// <param name="errorCode"></param>
        /// <param name="errorMessage"></param>
        public CARevocationResult(string requestContext, bool succeeded, CARequestErrorCode errorCode, string errorMessage)
        {
            // Validation of params
            if (string.IsNullOrWhiteSpace(requestContext))
            {
                throw new ArgumentNullException(nameof(requestContext));
            }
            if (succeeded && (errorCode != CARequestErrorCode.None || !string.IsNullOrWhiteSpace(errorMessage)))
            {
                throw new ArgumentException($"CARevocationResult be set to Succeeded=true along with an error code or error message. Error Code: {errorCode}; Error Message: {errorMessage};");
            }

            this.RequestContext = requestContext;
            this.Succeeded      = succeeded;
            this.ErrorCode      = errorCode;
            this.ErrorMessage   = errorMessage;
        }
Exemplo n.º 2
0
        private static void RevokeCertificate(string serialNumber, out bool succeeded, out CARequestErrorCode errorCode, out string errorMessage)
        {
            Console.WriteLine($"Revoking Certificate on the Certificate Authority. Serial Number {serialNumber}");

            succeeded    = true;
            errorCode    = CARequestErrorCode.None;
            errorMessage = "";

            // throw new NotImplementedException();
        }