Exemplo n.º 1
0
        static CredentialTypeEx ConvertCredentials(MsmqAuthenticationMode credentials)
        {
            switch (credentials)
            {
            case MsmqAuthenticationMode.Certificate:
            {
                return(CredentialTypeEx.Certificate);
            }

            case MsmqAuthenticationMode.None:
            {
                return(CredentialTypeEx.None);
            }

            case MsmqAuthenticationMode.WindowsDomain:
            {
                return(CredentialTypeEx.Windows);
            }

            default:
            {
                throw new InvalidOperationException("Unknown credentials type");
            }
            }
        }
 public MsmqTransportSecurity()
 {
     this.msmqAuthenticationMode  = MsmqDefaults.MsmqAuthenticationMode;
     this.msmqEncryptionAlgorithm = MsmqDefaults.MsmqEncryptionAlgorithm;
     this.msmqHashAlgorithm       = MsmqDefaults.MsmqSecureHashAlgorithm;
     this.msmqProtectionLevel     = MsmqDefaults.MsmqProtectionLevel;
 }
 public MsmqTransportSecurity()
 {
     this.msmqAuthenticationMode = MsmqDefaults.MsmqAuthenticationMode;
     this.msmqEncryptionAlgorithm = MsmqDefaults.MsmqEncryptionAlgorithm;
     this.msmqHashAlgorithm = MsmqDefaults.MsmqSecureHashAlgorithm;
     this.msmqProtectionLevel = MsmqDefaults.MsmqProtectionLevel;
 }
 public MsmqTransportSecurity(MsmqTransportSecurity other)
 {
     if (null == other)
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("other");
     this.msmqAuthenticationMode = other.MsmqAuthenticationMode;
     this.msmqEncryptionAlgorithm = other.MsmqEncryptionAlgorithm;
     this.msmqHashAlgorithm = other.MsmqSecureHashAlgorithm;
     this.msmqProtectionLevel = other.MsmqProtectionLevel;
 }
 public MsmqTransportSecurity(MsmqTransportSecurity other)
 {
     if (null == other)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("other");
     }
     this.msmqAuthenticationMode  = other.MsmqAuthenticationMode;
     this.msmqEncryptionAlgorithm = other.MsmqEncryptionAlgorithm;
     this.msmqHashAlgorithm       = other.MsmqSecureHashAlgorithm;
     this.msmqProtectionLevel     = other.MsmqProtectionLevel;
 }
Exemplo n.º 6
0
 static CredentialTypeEx ConvertCredentials(MsmqAuthenticationMode credentials)
 {
    switch(credentials)
    {
       case MsmqAuthenticationMode.Certificate:
       {
          return CredentialTypeEx.Certificate;
       }
       case MsmqAuthenticationMode.None:
       {
          return CredentialTypeEx.None;
       }
       case MsmqAuthenticationMode.WindowsDomain:
       {
          return CredentialTypeEx.Windows;
       }
       default:
       {
          throw new InvalidOperationException("Unknown credentials type");
       }
    }
 }
Exemplo n.º 7
0
 internal void ApplyCertificateIfNeeded(SecurityTokenProviderContainer certificateTokenProvider, MsmqAuthenticationMode authenticationMode, TimeSpan timeout)
 {
     if (MsmqAuthenticationMode.Certificate == authenticationMode)
     {
         if (certificateTokenProvider == null)
         {
             throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("certificateTokenProvider");
         }
         X509Certificate2 certificate = certificateTokenProvider.GetCertificate(timeout);
         if (certificate == null)
         {
             throw DiagnosticUtility.ExceptionUtility.ThrowHelperCritical(new InvalidOperationException(System.ServiceModel.SR.GetString("MsmqCertificateNotFound")));
         }
         this.senderCert.SetBufferReference(certificate.GetRawCertData());
     }
 }
Exemplo n.º 8
0
 public static bool IsDefined(MsmqAuthenticationMode mode)
 {
     return(mode >= MsmqAuthenticationMode.None && mode <= MsmqAuthenticationMode.Certificate);
 }
 internal void Disable()
 {
     this.msmqAuthenticationMode = MsmqAuthenticationMode.None;
     this.msmqProtectionLevel = ProtectionLevel.None;
 }
 internal void Disable()
 {
     this.msmqAuthenticationMode = MsmqAuthenticationMode.None;
     this.msmqProtectionLevel    = ProtectionLevel.None;
 }
 public static bool IsDefined(MsmqAuthenticationMode mode)
 {
     return mode >= MsmqAuthenticationMode.None && mode <= MsmqAuthenticationMode.Certificate;
 }
 public static bool IsDefined(MsmqAuthenticationMode mode)
 {
     return ((mode >= MsmqAuthenticationMode.None) && (mode <= MsmqAuthenticationMode.Certificate));
 }