public StrongName(System.Security.Permissions.StrongNamePublicKeyBlob !blob, string !name, Version !version)
 {
     CodeContract.Requires(name != null);
     CodeContract.Requires(blob != null);
     CodeContract.Requires(version != null);
     return(default(StrongName));
 }
Example #2
0
        private void ParseKeyBlob()
        {
            lock (this)
            {
                if (m_element == null)
                {
                    return;
                }

                String elBlob = m_element.Attribute(s_tagPublicKeyBlob);
                StrongNamePublicKeyBlob publicKeyBlob = new StrongNamePublicKeyBlob();

                if (elBlob != null)
                {
                    publicKeyBlob.PublicKey = System.Security.Util.Hex.DecodeHexString(elBlob);
                }
                else
                {
                    throw new ArgumentException(Environment.GetResourceString("Argument_BlobCannotBeNull"));
                }

                m_publicKeyBlob = publicKeyBlob;

                if ((Object)m_version != null && m_name != null && m_publicKeyBlob != null)
                {
                    m_element = null;
                }
            }
        }
 /// <include file='doc\StrongNameMembershipCondition.uex' path='docs/doc[@for="StrongNameMembershipCondition.StrongNameMembershipCondition"]/*' />
 public StrongNameMembershipCondition( StrongNamePublicKeyBlob blob,
                                       String name,
                                       Version version )
 {
     if (blob == null)
         throw new ArgumentNullException( "blob" );
 
     m_publicKeyBlob = blob;
     m_name = name;
     m_version = version;
 }
Example #4
0
        /// <include file='doc\StrongNameMembershipCondition.uex' path='docs/doc[@for="StrongNameMembershipCondition.StrongNameMembershipCondition"]/*' />
        public StrongNameMembershipCondition(StrongNamePublicKeyBlob blob,
                                             String name,
                                             Version version)
        {
            if (blob == null)
            {
                throw new ArgumentNullException("blob");
            }

            m_publicKeyBlob = blob;
            m_name          = name;
            m_version       = version;
        }
        public StrongNameMembershipCondition( StrongNamePublicKeyBlob blob,
                                              String name,
                                              Version version )
        {
            if (blob == null)
                throw new ArgumentNullException( "blob" );

            if (name != null && name.Equals( "" ))
                throw new ArgumentException( Environment.GetResourceString( "Argument_EmptyStrongName" ) );      

            m_publicKeyBlob = blob;
            m_name = name;
            m_version = version;
        }
Example #6
0
        /// <include file='doc\StrongNameMembershipCondition.uex' path='docs/doc[@for="StrongNameMembershipCondition.StrongNameMembershipCondition"]/*' />
        public StrongNameMembershipCondition(StrongNamePublicKeyBlob blob,
                                             String name,
                                             Version version)
        {
            if (blob == null)
            {
                throw new ArgumentNullException("blob");
            }

            // Add this in Whidbey
            // if (name != null && name.Equals( "" ))
            //     throw new ArgumentException( Environment.GetResourceString( "Argument_EmptyStrongName" ) );

            m_publicKeyBlob = blob;
            m_name          = name;
            m_version       = version;
        }
Example #7
0
        /// <include file='doc\StrongNameMembershipCondition.uex' path='docs/doc[@for="StrongNameMembershipCondition.FromXml1"]/*' />
        public void FromXml(SecurityElement e, PolicyLevel level)
        {
            if (e == null)
            {
                throw new ArgumentNullException("e");
            }

            if (!e.Tag.Equals("IMembershipCondition"))
            {
                throw new ArgumentException(Environment.GetResourceString("Argument_MembershipConditionElement"));
            }

            lock (this)
            {
                m_name          = null;
                m_publicKeyBlob = null;
                m_version       = null;
                m_element       = e;
            }
        }
        private void ParseKeyBlob()
        {
            lock (this)
            {
                if (m_element == null)
                    return;

                String elBlob = m_element.Attribute( s_tagPublicKeyBlob );
                StrongNamePublicKeyBlob publicKeyBlob = new StrongNamePublicKeyBlob();
            
                if (elBlob != null)
                    publicKeyBlob.PublicKey = System.Security.Util.Hex.DecodeHexString( elBlob );
                else
                    throw new ArgumentException( Environment.GetResourceString( "Argument_BlobCannotBeNull" ) );

                m_publicKeyBlob = publicKeyBlob;

                if ((Object) m_version != null && m_name != null && m_publicKeyBlob != null)
                {
                    m_element = null;
                }
            }    
        }    
 public void FromXml( SecurityElement e, PolicyLevel level )
 {
     if (e == null)
         throw new ArgumentNullException("e");
 
     if (!e.Tag.Equals( "IMembershipCondition" ))
     {
         throw new ArgumentException( Environment.GetResourceString( "Argument_MembershipConditionElement" ) );
     }
     Contract.EndContractBlock();
     
     lock (this)
     {
         m_name = null;
         m_publicKeyBlob = null;
         m_version = null;
         m_element = e;
     }
 }
 public StrongNameMembershipCondition(System.Security.Permissions.StrongNamePublicKeyBlob blob, string name, Version version)
 {
     Contract.Requires(blob != null);
     return(default(StrongNameMembershipCondition));
 }
 public StrongNameMembershipCondition(System.Security.Permissions.StrongNamePublicKeyBlob blob, string name, System.Version version)
 {
 }
 // Constructors
 public StrongName(System.Security.Permissions.StrongNamePublicKeyBlob blob, string name, System.Version version)
 {
 }