GetInstance() public static method

public static GetInstance ( object obj ) : OtherHashAlgAndValue
obj object
return OtherHashAlgAndValue
Ejemplo n.º 1
0
 public static OtherHash GetInstance(object obj)
 {
     if (obj == null || obj is OtherHash)
     {
         return((OtherHash)obj);
     }
     if (obj is Asn1OctetString)
     {
         return(new OtherHash((Asn1OctetString)obj));
     }
     return(new OtherHash(OtherHashAlgAndValue.GetInstance(obj)));
 }
Ejemplo n.º 2
0
 private SignaturePolicyId(Asn1Sequence seq)
 {
     if (seq == null)
     {
         throw new ArgumentNullException("seq");
     }
     if (seq.Count < 2 || seq.Count > 3)
     {
         throw new ArgumentException("Bad sequence size: " + seq.Count, "seq");
     }
     this.sigPolicyIdentifier = (DerObjectIdentifier)seq[0].ToAsn1Object();
     this.sigPolicyHash       = OtherHashAlgAndValue.GetInstance(seq[1].ToAsn1Object());
     if (seq.Count > 2)
     {
         this.sigPolicyQualifiers = (Asn1Sequence)seq[2].ToAsn1Object();
     }
 }
Ejemplo n.º 3
0
 private SignaturePolicyId(Asn1Sequence seq)
 {
     //IL_000e: Unknown result type (might be due to invalid IL or missing references)
     //IL_0040: Unknown result type (might be due to invalid IL or missing references)
     if (seq == null)
     {
         throw new ArgumentNullException("seq");
     }
     if (seq.Count < 2 || seq.Count > 3)
     {
         throw new ArgumentException(string.Concat((object)"Bad sequence size: ", (object)seq.Count), "seq");
     }
     sigPolicyIdentifier = (DerObjectIdentifier)seq[0].ToAsn1Object();
     sigPolicyHash       = OtherHashAlgAndValue.GetInstance(seq[1].ToAsn1Object());
     if (seq.Count > 2)
     {
         sigPolicyQualifiers = (Asn1Sequence)seq[2].ToAsn1Object();
     }
 }