Inheritance: Org.BouncyCastle.Asn1.Asn1Encodable
		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");
		}
Exemple #2
0
 private OcspResponse(Asn1Sequence seq)
 {
     responseStatus = new OcspResponseStatus(DerEnumerated.GetInstance(seq[0]));
     if (seq.Count == 2)
     {
         responseBytes = ResponseBytes.GetInstance((Asn1TaggedObject)seq[1], explicitly: true);
     }
 }
 public OcspResponse(OcspResponseStatus responseStatus, ResponseBytes responseBytes)
 {
     if (responseStatus == null)
     {
         throw new ArgumentNullException("responseStatus");
     }
     this.responseStatus = responseStatus;
     this.responseBytes  = responseBytes;
 }
Exemple #4
0
 public OcspResponse(OcspResponseStatus responseStatus, ResponseBytes responseBytes)
 {
     //IL_000e: Unknown result type (might be due to invalid IL or missing references)
     if (responseStatus == null)
     {
         throw new ArgumentNullException("responseStatus");
     }
     this.responseStatus = responseStatus;
     this.responseBytes  = responseBytes;
 }
		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);
            }
        }
Exemple #7
0
 public static ResponseBytes GetInstance(Asn1TaggedObject obj, bool explicitly)
 {
     return(ResponseBytes.GetInstance(Asn1Sequence.GetInstance(obj, explicitly)));
 }