Org.BouncyCastle.Asn1.Cms.SignerInfo.GetInstance C# (CSharp) Method

GetInstance() public static method

public static GetInstance ( object obj ) : SignerInfo
obj object
return SignerInfo
        public static SignerInfo GetInstance(
            object obj)
        {
            if (obj == null || obj is SignerInfo)
                return (SignerInfo) obj;

            if (obj is Asn1Sequence)
                return new SignerInfo((Asn1Sequence) obj);

            throw new ArgumentException("Unknown object in factory: " + obj.GetType().FullName, "obj");
        }

Usage Example

示例#1
0
 private bool CheckForVersion3(Asn1Set signerInfs)
 {
     global::System.Collections.IEnumerator enumerator = signerInfs.GetEnumerator();
     try
     {
         while (enumerator.MoveNext())
         {
             object     current  = enumerator.get_Current();
             SignerInfo instance = SignerInfo.GetInstance(current);
             if (instance.Version.Value.IntValue == 3)
             {
                 return(true);
             }
         }
     }
     finally
     {
         global::System.IDisposable disposable = enumerator as global::System.IDisposable;
         if (disposable != null)
         {
             disposable.Dispose();
         }
     }
     return(false);
 }
All Usage Examples Of Org.BouncyCastle.Asn1.Cms.SignerInfo::GetInstance