public const int Unauthorized		= 6;	// Request unauthorized

		public OcspResp Generate(
			int     status,
			object  response)
		{
			if (response == null)
			{
				return new OcspResp(new OcspResponse(new OcspResponseStatus(status),null));
			}
			if (response is BasicOcspResp)
			{
				BasicOcspResp r = (BasicOcspResp)response;
				Asn1OctetString octs;

				try
				{
					octs = new DerOctetString(r.GetEncoded());
				}
				catch (Exception e)
				{
					throw new OcspException("can't encode object.", e);
				}

				ResponseBytes rb = new ResponseBytes(
					OcspObjectIdentifiers.PkixOcspBasic, octs);

				return new OcspResp(new OcspResponse(
					new OcspResponseStatus(status), rb));
			}

			throw new OcspException("unknown response object");
		}
		public OcspResponse(
            OcspResponseStatus	responseStatus,
            ResponseBytes		responseBytes)
        {
			if (responseStatus == null)
				throw new ArgumentNullException("responseStatus");

			this.responseStatus = responseStatus;
            this.responseBytes = responseBytes;
        }
Exemple #3
0
        private OcspResponse(
            Asn1Sequence seq)
        {
            responseStatus = new OcspResponseStatus(
                DerEnumerated.GetInstance(seq[0]));

            if (seq.Count == 2)
            {
                responseBytes = ResponseBytes.GetInstance(
                    (Asn1TaggedObject)seq[1], true);
            }
        }
Exemple #4
0
        public OcspResponse(
            OcspResponseStatus responseStatus,
            ResponseBytes responseBytes)
        {
            if (responseStatus == null)
            {
                throw new ArgumentNullException("responseStatus");
            }

            this.responseStatus = responseStatus;
            this.responseBytes  = responseBytes;
        }
		private OcspResponse(
            Asn1Sequence seq)
        {
            responseStatus = new OcspResponseStatus(
				DerEnumerated.GetInstance(seq[0]));

			if (seq.Count == 2)
            {
                responseBytes = ResponseBytes.GetInstance(
					(Asn1TaggedObject)seq[1], true);
            }
        }