本文整理汇总了C#中ProtectionLevel类的典型用法代码示例。如果您正苦于以下问题:C# ProtectionLevel类的具体用法?C# ProtectionLevel怎么用?C# ProtectionLevel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ProtectionLevel类属于命名空间,在下文中一共展示了ProtectionLevel类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AuthenticateAsClient
//
public virtual void AuthenticateAsClient( NetworkCredential credential,
string targetName,
ProtectionLevel requiredProtectionLevel, //this will be the ultimate result or exception
TokenImpersonationLevel allowedImpersonationLevel) //this OR LOWER will be ultimate result in auth context
{
AuthenticateAsClient(credential, null, targetName, requiredProtectionLevel, allowedImpersonationLevel);
}
示例2: ValidateCreateContext
internal void ValidateCreateContext(
string package,
NetworkCredential credential,
string servicePrincipalName,
ExtendedProtectionPolicy policy,
ProtectionLevel protectionLevel,
TokenImpersonationLevel impersonationLevel)
{
if (policy != null)
{
// One of these must be set if EP is turned on
if (policy.CustomChannelBinding == null && policy.CustomServiceNames == null)
{
throw new ArgumentException(SR.net_auth_must_specify_extended_protection_scheme, nameof(policy));
}
_extendedProtectionPolicy = policy;
}
else
{
_extendedProtectionPolicy = new ExtendedProtectionPolicy(PolicyEnforcement.Never);
}
ValidateCreateContext(package, true, credential, servicePrincipalName, _extendedProtectionPolicy.CustomChannelBinding, protectionLevel, impersonationLevel);
}
示例3: MsmqTransportSecurity
public MsmqTransportSecurity()
{
this.msmqAuthenticationMode = System.ServiceModel.MsmqAuthenticationMode.WindowsDomain;
this.msmqEncryptionAlgorithm = System.ServiceModel.MsmqEncryptionAlgorithm.RC4Stream;
this.msmqHashAlgorithm = System.ServiceModel.MsmqSecureHashAlgorithm.Sha1;
this.msmqProtectionLevel = ProtectionLevel.Sign;
}
示例4: TcpTransportSecurity
public TcpTransportSecurity()
{
this.clientCredentialType = DefaultClientCredentialType;
this.protectionLevel = DefaultProtectionLevel;
this.extendedProtectionPolicy = ChannelBindingUtility.DefaultPolicy;
this.sslProtocols = TransportDefaults.SslProtocols;
}
示例5: MsmqTransportSecurity
public MsmqTransportSecurity()
{
this.msmqAuthenticationMode = MsmqDefaults.MsmqAuthenticationMode;
this.msmqEncryptionAlgorithm = MsmqDefaults.MsmqEncryptionAlgorithm;
this.msmqHashAlgorithm = MsmqDefaults.MsmqSecureHashAlgorithm;
this.msmqProtectionLevel = MsmqDefaults.MsmqProtectionLevel;
}
示例6: BindingProperties
public BindingProperties(SecurityMode securityMode, MessageCredentialType messageCredentialType,
TcpClientCredentialType tcpClientCredentialType, ProtectionLevel protectionLevel,
int maxConnections, long maxReceivedMessageSize, long maxBufferPoolSize, int maxArrayLength,
int maxBytesPerRead, int maxDepth, int maxStringContentLength, int maxBufferSize,
TimeSpan openTimeout, TimeSpan closeTimeout, TimeSpan receiveTimeout, TimeSpan sendTimeout)
{
m_SecurityMode = securityMode;
m_MessageCredentialType = messageCredentialType;
m_TcpClientCredentialType = tcpClientCredentialType;
m_ProtectionLevel = protectionLevel;
m_MaxConnections = maxConnections;
m_MaxReceivedMessageSize = maxReceivedMessageSize;
m_MaxBufferPoolSize = maxBufferPoolSize;
m_MaxArrayLength = maxArrayLength;
m_MaxBytesPerRead = maxBytesPerRead;
m_MaxDepth = maxDepth;
m_MaxStringContentLength = maxStringContentLength;
m_MaxBufferSize = maxBufferSize;
m_OpenTimeout = openTimeout;
m_CloseTimeout = closeTimeout;
m_ReceiveTimeout = receiveTimeout;
m_SendTimeout = sendTimeout;
}
示例7: WindowsStreamSecurityUpgradeProvider
public WindowsStreamSecurityUpgradeProvider(WindowsStreamSecurityBindingElement bindingElement,
BindingContext context, bool isClient)
: base(context.Binding)
{
this.extractGroupsForWindowsAccounts = TransportDefaults.ExtractGroupsForWindowsAccounts;
this.protectionLevel = bindingElement.ProtectionLevel;
this.scheme = context.Binding.Scheme;
this.isClient = isClient;
this.listenUri = TransportSecurityHelpers.GetListenUri(context.ListenUriBaseAddress, context.ListenUriRelativeAddress);
SecurityCredentialsManager credentialProvider = context.BindingParameters.Find<SecurityCredentialsManager>();
if (credentialProvider == null)
{
if (isClient)
{
credentialProvider = ClientCredentials.CreateDefaultCredentials();
}
else
{
credentialProvider = ServiceCredentials.CreateDefaultCredentials();
}
}
this.securityTokenManager = credentialProvider.CreateSecurityTokenManager();
}
示例8: WindowsStreamSecurityUpgradeProvider
public WindowsStreamSecurityUpgradeProvider(WindowsStreamSecurityBindingElement bindingElement,
BindingContext context, bool isClient)
: base(context.Binding)
{
_extractGroupsForWindowsAccounts = TransportDefaults.ExtractGroupsForWindowsAccounts;
_protectionLevel = bindingElement.ProtectionLevel;
_scheme = context.Binding.Scheme;
_isClient = isClient;
_listenUri = TransportSecurityHelpers.GetListenUri(context.ListenUriBaseAddress, context.ListenUriRelativeAddress);
SecurityCredentialsManager credentialProvider = context.BindingParameters.Find<SecurityCredentialsManager>();
if (credentialProvider == null)
{
if (isClient)
{
credentialProvider = ClientCredentials.CreateDefaultCredentials();
}
else
{
throw ExceptionHelper.PlatformNotSupported("WindowsStreamSecurityUpgradeProvider for server is not supported.");
}
}
_securityTokenManager = credentialProvider.CreateSecurityTokenManager();
}
示例9: SecurityCapabilities
public SecurityCapabilities(bool supportsClientAuth, bool supportsServerAuth, bool supportsClientWindowsIdentity, ProtectionLevel requestProtectionLevel, ProtectionLevel responseProtectionLevel)
{
this.supportsClientAuth = supportsClientAuth;
this.supportsServerAuth = supportsServerAuth;
this.supportsClientWindowsIdentity = supportsClientWindowsIdentity;
this.requestProtectionLevel = requestProtectionLevel;
this.responseProtectionLevel = responseProtectionLevel;
}
示例10: WSHttpContextBinding
private WSHttpContextBinding(WSHttpBinding wsHttpBinding)
{
this.contextProtectionLevel = ProtectionLevel.Sign;
this.contextManagementEnabled = true;
WSHttpContextBindingPropertyTransferHelper helper = new WSHttpContextBindingPropertyTransferHelper();
helper.InitializeFrom(wsHttpBinding);
helper.SetBindingElementType(typeof(WSHttpContextBinding));
helper.ApplyConfiguration(this);
}
示例11: ValidateCreateContext
internal void ValidateCreateContext(string package,
NetworkCredential credential,
string servicePrincipalName,
ExtendedProtectionPolicy policy,
ProtectionLevel protectionLevel,
TokenImpersonationLevel impersonationLevel)
{
throw new PlatformNotSupportedException();
}
示例12: NetTcpContextBinding
private NetTcpContextBinding(NetTcpBinding netTcpBinding)
{
this.contextManagementEnabled = true;
this.contextProtectionLevel = ProtectionLevel.Sign;
NetTcpContextBindingPropertyTransferHelper helper = new NetTcpContextBindingPropertyTransferHelper();
helper.InitializeFrom(netTcpBinding);
helper.SetBindingElementType(typeof(NetTcpContextBinding));
helper.ApplyConfiguration(this);
}
示例13: ChannelProtectionRequirements
internal ChannelProtectionRequirements(ChannelProtectionRequirements other, ProtectionLevel newBodyProtectionLevel)
{
if (other == null)
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("other"));
_incomingSignatureParts = new ScopedMessagePartSpecification(other._incomingSignatureParts, newBodyProtectionLevel != ProtectionLevel.None);
_incomingEncryptionParts = new ScopedMessagePartSpecification(other._incomingEncryptionParts, newBodyProtectionLevel == ProtectionLevel.EncryptAndSign);
_outgoingSignatureParts = new ScopedMessagePartSpecification(other._outgoingSignatureParts, newBodyProtectionLevel != ProtectionLevel.None);
_outgoingEncryptionParts = new ScopedMessagePartSpecification(other._outgoingEncryptionParts, newBodyProtectionLevel == ProtectionLevel.EncryptAndSign);
}
示例14: SetProtectionLevel
void SetProtectionLevel(ProtectionLevel protectionLevel)
{
m_NonProtectionRadioButton.Enabled = true;
m_SignedRadioButton.Enabled = true;
m_EncryptRadioButton.Enabled = true;
m_NonProtectionRadioButton.Checked = protectionLevel == ProtectionLevel.None;
m_SignedRadioButton.Checked = protectionLevel == ProtectionLevel.Sign;
m_EncryptRadioButton.Checked = protectionLevel == ProtectionLevel.EncryptAndSign;
}
示例15: protectionLevel
public static HtmlBuilder protectionLevel(this HtmlBuilder builder, ProtectionLevel plevel)
{
switch (plevel)
{
case ProtectionLevel.PRIVATE: return builder.text("private");
case ProtectionLevel.INTERNAL: return builder.text("internal"); ;
case ProtectionLevel.PROTECTED: return builder.text("protected");
default:
case ProtectionLevel.PUBLIC: return builder.text("public");
}
}