示例#1
0
        /// <summary>
        /// Return a control value of the specified type.
        /// </summary>
        /// <param name="type">the type OID for the control value we are checking for.</param>
        /// <returns>the control value if present, null otherwise.</returns>
        public IControl GetControl(DerObjectIdentifier type)
        {
            AttributeTypeAndValue found = FindControl(type);

            if (found != null)
            {
                if (found.Type.Equals(CrmfObjectIdentifiers.id_regCtrl_pkiArchiveOptions))
                {
                    return(new PkiArchiveControl(PkiArchiveOptions.GetInstance(found.Value)));
                }

                if (found.Type.Equals(CrmfObjectIdentifiers.id_regCtrl_regToken))
                {
                    return(new RegTokenControl(DerUtf8String.GetInstance(found.Value)));
                }

                if (found.Type.Equals(CrmfObjectIdentifiers.id_regCtrl_authenticator))
                {
                    return(new AuthenticatorControl(DerUtf8String.GetInstance(found.Value)));
                }
            }
            return(null);
        }
 /// <summary>
 /// Basic constructor - build from an PKIArchiveOptions structure.
 /// </summary>
 /// <param name="pkiArchiveOptions">the ASN.1 structure that will underlie this control.</param>
 public PkiArchiveControl(PkiArchiveOptions pkiArchiveOptions)
 {
     this.pkiArchiveOptions = pkiArchiveOptions;
 }