Ejemplo n.º 1
0
		public ResponseData(
			ResponderID         responderID,
			DerGeneralizedTime  producedAt,
			Asn1Sequence        responses,
			X509Extensions      responseExtensions)
			: this(V1, responderID, producedAt, responses, responseExtensions)
		{
		}
Ejemplo n.º 2
0
		public OcspIdentifier(
			ResponderID	ocspResponderID,
			DateTime	producedAt)
		{
			if (ocspResponderID == null)
				throw new ArgumentNullException();

			this.ocspResponderID = ocspResponderID;
			this.producedAt = new DerGeneralizedTime(producedAt);
		}
Ejemplo n.º 3
0
		private OcspIdentifier(
			Asn1Sequence seq)
		{
			if (seq == null)
				throw new ArgumentNullException("seq");
			if (seq.Count != 2)
				throw new ArgumentException("Bad sequence size: " + seq.Count, "seq");

			this.ocspResponderID = ResponderID.GetInstance(seq[0].ToAsn1Object());
			this.producedAt = (DerGeneralizedTime) seq[1].ToAsn1Object();
		}
Ejemplo n.º 4
0
		public RespID(
			X509Name name)
		{
		    try
		    {
		        this.id = new ResponderID(name);
		    }
		    catch (Exception e)
		    {
		        throw new ArgumentException("can't decode name.", e);
		    }
		}
Ejemplo n.º 5
0
		public ResponseData(
			DerInteger          version,
			ResponderID         responderID,
			DerGeneralizedTime  producedAt,
			Asn1Sequence        responses,
			X509Extensions      responseExtensions)
		{
			this.version = version;
			this.responderID = responderID;
			this.producedAt = producedAt;
			this.responses = responses;
			this.responseExtensions = responseExtensions;
		}
Ejemplo n.º 6
0
 public ResponseData(
     DerInteger version,
     ResponderID responderID,
     DerGeneralizedTime producedAt,
     Asn1Sequence responses,
     X509Extensions responseExtensions)
 {
     this.version            = version;
     this.responderID        = responderID;
     this.producedAt         = producedAt;
     this.responses          = responses;
     this.responseExtensions = responseExtensions;
 }
Ejemplo n.º 7
0
		public RespID(
			AsymmetricKeyParameter publicKey)
		{
			try
			{
				SubjectPublicKeyInfo info = SubjectPublicKeyInfoFactory.CreateSubjectPublicKeyInfo(publicKey);

				byte[] keyHash = DigestUtilities.CalculateDigest("SHA1", info.PublicKeyData.GetBytes());

				this.id = new ResponderID(new DerOctetString(keyHash));
			}
			catch (Exception e)
			{
				throw new OcspException("problem creating ID: " + e, e);
			}
		}
Ejemplo n.º 8
0
        private ResponseData(
            Asn1Sequence seq)
        {
            int index = 0;

            Asn1Encodable enc = seq[0];

            if (enc is Asn1TaggedObject)
            {
                Asn1TaggedObject o = (Asn1TaggedObject)enc;

                if (o.TagNo == 0)
                {
                    this.versionPresent = true;
                    this.version        = DerInteger.GetInstance(o, true);
                    index++;
                }
                else
                {
                    this.version = V1;
                }
            }
            else
            {
                this.version = V1;
            }

            this.responderID = ResponderID.GetInstance(seq[index++]);
            this.producedAt  = (DerGeneralizedTime)seq[index++];
            this.responses   = (Asn1Sequence)seq[index++];

            if (seq.Count > index)
            {
                this.responseExtensions = X509Extensions.GetInstance(
                    (Asn1TaggedObject)seq[index], true);
            }
        }
Ejemplo n.º 9
0
		public RespID(
			ResponderID id)
		{
			this.id = id;
		}
Ejemplo n.º 10
0
		private ResponseData(
			Asn1Sequence seq)
		{
			int index = 0;

			Asn1Encodable enc = seq[0];
			if (enc is Asn1TaggedObject)
			{
				Asn1TaggedObject o = (Asn1TaggedObject)enc;

				if (o.TagNo == 0)
				{
					this.versionPresent = true;
					this.version = DerInteger.GetInstance(o, true);
					index++;
				}
				else
				{
					this.version = V1;
				}
			}
			else
			{
				this.version = V1;
			}

			this.responderID = ResponderID.GetInstance(seq[index++]);
			this.producedAt = (DerGeneralizedTime)seq[index++];
			this.responses = (Asn1Sequence)seq[index++];

			if (seq.Count > index)
			{
				this.responseExtensions = X509Extensions.GetInstance(
					(Asn1TaggedObject)seq[index], true);
			}
		}