Skip to content

Commit 28bd717

Browse files
authored
code fence entire element (#42303)
1 parent ec12733 commit 28bd717

File tree

41 files changed

+2174
-2174
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+2174
-2174
lines changed

docs/framework/wcf/configuration-editor-tool-svcconfigeditor-exe.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ The viewer automatically follows the configuration merge path and creates a view
6969
7070
### Services
7171

72-
The **Services** node displays all of the services currently assigned in the configuration file. Each sub-node in the tree corresponds to a sub-element of the <`services`> element in the configuration file.
72+
The **Services** node displays all of the services currently assigned in the configuration file. Each sub-node in the tree corresponds to a sub-element of the `<services>` element in the configuration file.
7373

7474
When you click the **Services** node, you can view or perform tasks on the service Summary Page in the **Detail** Pane.
7575

@@ -116,7 +116,7 @@ You can create a new service endpoint configuration in the following ways:
116116
117117
### Client
118118

119-
The **Client** node displays all of the client endpoints in the configuration file. Every sub-node in the tree corresponds to a sub-element of the <`client`> element in the configuration file.
119+
The **Client** node displays all of the client endpoints in the configuration file. Every sub-node in the tree corresponds to a sub-element of the `<client>` element in the configuration file.
120120

121121
When you click the **Client** node, you can view or perform tasks on the client **Summary Page** in the **Detail Pane**.
122122

@@ -176,7 +176,7 @@ If the standard endpoint is in used, a warning message is displayed when you att
176176

177177
Binding configurations are used to configure bindings on endpoints. Such configuration settings are stored in the **Binding** node. Endpoints reference binding configurations by name and multiple endpoints can reference a single binding configuration.
178178

179-
The **Bindings** node displays all of the binding settings in the configuration file. Every sub-node in the tree corresponds to a sub-element in the <`bindings`> element in the configuration file.
179+
The **Bindings** node displays all of the binding settings in the configuration file. Every sub-node in the tree corresponds to a sub-element in the `<bindings>` element in the configuration file.
180180

181181
When you click the **Bindings** node, you can view or perform tasks on the binding **Summary Page** in the **Detail Pane**.
182182

@@ -220,7 +220,7 @@ A custom binding is a collection of binding elements that form a stack. Each bin
220220

221221
### Diagnostics
222222

223-
The **Diagnostics** node displays all of the diagnostic settings in the configuration file. It enables you to turn performance counters on or off, enable or disable Windows Management Instrumentation (WMI), configure WCF tracing, and configure WCF message logging. The settings in the **Diagnostics** node correspond to the <`system.diagnostics`> section, and `<diagnostics>` section in `<system.serviceModel>` in the configuration file.
223+
The **Diagnostics** node displays all of the diagnostic settings in the configuration file. It enables you to turn performance counters on or off, enable or disable Windows Management Instrumentation (WMI), configure WCF tracing, and configure WCF message logging. The settings in the **Diagnostics** node correspond to the `<system.diagnostics>` section, and `<diagnostics>` section in `<system.serviceModel>` in the configuration file.
224224

225225
When you click the **Diagnostics** node, you can view or perform tasks on the diagnostics **Summary Page** in the **Detail Pane**.
226226

@@ -384,7 +384,7 @@ One way to create a new configuration file is to use the New Service Element Wiz
384384
385385
## Configuring COM+
386386

387-
The Service Configuration Editor enables you to create a new configuration file for an existing COM+ application, or edit an existing COM+ configuration. The **COM Contract** node is only visible when the <`comContract`> section exists in the configuration file.
387+
The Service Configuration Editor enables you to create a new configuration file for an existing COM+ application, or edit an existing COM+ configuration. The **COM Contract** node is only visible when the `<comContract>` section exists in the configuration file.
388388

389389
### Creating a New COM+ Configuration
390390

docs/framework/wcf/configuring-services-using-configuration-files.md

+250-250
Large diffs are not rendered by default.

docs/framework/wcf/configuring-wcf-services-in-code.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public class Service1 : IService1
7474
}
7575
```
7676

77-
The settings in the <`protocolMappings`> section are only used if no application endpoints are added to the <xref:System.ServiceModel.ServiceConfiguration> programmatically.You can optionally load the service configuration from the default application configuration file by calling <xref:System.ServiceModel.ServiceConfiguration.LoadFromConfiguration%2A> and then change the settings. The <xref:System.ServiceModel.ServiceConfiguration.LoadFromConfiguration> class also allows you to load configuration from a centralized configuration. The following code illustrates how to implement this:
77+
The settings in the `<protocolMappings>` section are only used if no application endpoints are added to the <xref:System.ServiceModel.ServiceConfiguration> programmatically.You can optionally load the service configuration from the default application configuration file by calling <xref:System.ServiceModel.ServiceConfiguration.LoadFromConfiguration%2A> and then change the settings. The <xref:System.ServiceModel.ServiceConfiguration.LoadFromConfiguration> class also allows you to load configuration from a centralized configuration. The following code illustrates how to implement this:
7878

7979
```csharp
8080
public class Service1 : IService1
@@ -88,7 +88,7 @@ public class Service1 : IService1
8888
```
8989

9090
> [!IMPORTANT]
91-
> Note that <xref:System.ServiceModel.ServiceConfiguration.LoadFromConfiguration%2A> ignores <`host`> settings within the <`service`> tag of <`system.serviceModel`>. Conceptually, <`host`> is about host configuration, not service configuration, and it gets loaded before the Configure method executes.
91+
> Note that <xref:System.ServiceModel.ServiceConfiguration.LoadFromConfiguration%2A> ignores `<host>` settings within the `<service>` tag of `<system.serviceModel>`. Conceptually, `<host>` is about host configuration, not service configuration, and it gets loaded before the Configure method executes.
9292
9393
## See also
9494

docs/framework/wcf/extending/overriding-the-identity-of-a-service-for-authentication.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ Typically, you do not have to set the identity on a service because the selectio
4848

4949
If you change the client credential type in the binding previously shown to `Certificate`, then the generated WSDL contains a Base64 serialized X.509 certificate for the identity value as shown in the following code. This is the default for all client credential types other than Windows.
5050

51-
You can change the value of the default service identity or change the type of the identity by using the <`identity`> element in configuration or by setting the identity in code. The following configuration code sets a domain name system (DNS) identity with the value `contoso.com`.
51+
You can change the value of the default service identity or change the type of the identity by using the `<identity>` element in configuration or by setting the identity in code. The following configuration code sets a domain name system (DNS) identity with the value `contoso.com`.
5252

5353
### Set Identity Programmatically
5454

docs/framework/wcf/extending/specifying-a-custom-crypto-algorithm.md

+116-116
Original file line numberDiff line numberDiff line change
@@ -6,124 +6,124 @@ ms.topic: how-to
66
---
77
# Specifying a Custom Crypto Algorithm
88

9-
WCF allows you to specify a custom crypto algorithm to use when encrypting data or computing digital signatures. This is done by the following steps:
10-
11-
1. Derive a class from <xref:System.ServiceModel.Security.SecurityAlgorithmSuite>
12-
13-
2. Register the algorithm
14-
15-
3. Configure the binding with the <xref:System.ServiceModel.Security.SecurityAlgorithmSuite>-derived class.
16-
17-
## Derive a class from SecurityAlgorithmSuite
18-
19-
The <xref:System.ServiceModel.Security.SecurityAlgorithmSuite> is an abstract base class that allows you to specify the algorithm to use when performing various security related operations. For example, computing a hash for a digital signature or encrypting a message. The following code shows how to derive a class from <xref:System.ServiceModel.Security.SecurityAlgorithmSuite>:
20-
21-
```csharp
22-
public class MyCustomAlgorithmSuite : SecurityAlgorithmSuite
23-
{
24-
public override string DefaultAsymmetricKeyWrapAlgorithm
25-
{
26-
get { return SecurityAlgorithms.RsaOaepKeyWrap; }
27-
}
28-
29-
public override string DefaultAsymmetricSignatureAlgorithm
30-
{
31-
get { return SecurityAlgorithms.RsaSha1Signature; }
32-
}
33-
34-
public override string DefaultCanonicalizationAlgorithm
35-
{
36-
get { return SecurityAlgorithms.ExclusiveC14n; ; }
37-
}
38-
39-
public override string DefaultDigestAlgorithm
40-
{
41-
get { return SecurityAlgorithms.MyCustomHashAlgorithm; }
42-
}
43-
44-
public override string DefaultEncryptionAlgorithm
45-
{
46-
get { return SecurityAlgorithms.Aes128Encryption; }
47-
}
48-
49-
public override int DefaultEncryptionKeyDerivationLength
50-
{
51-
get { return 128; }
52-
}
53-
54-
public override int DefaultSignatureKeyDerivationLength
55-
{
56-
get { return 128; }
57-
}
58-
59-
public override int DefaultSymmetricKeyLength
60-
{
61-
get { return 128; }
62-
}
63-
64-
public override string DefaultSymmetricKeyWrapAlgorithm
65-
{
66-
get { return SecurityAlgorithms.Aes128Encryption; }
67-
}
68-
69-
public override string DefaultSymmetricSignatureAlgorithm
70-
{
71-
get { return SecurityAlgorithms.HmacSha1Signature; }
72-
}
73-
74-
public override bool IsAsymmetricKeyLengthSupported(int length)
75-
{
76-
return length >= 1024 && length <= 4096;
77-
}
78-
79-
public override bool IsSymmetricKeyLengthSupported(int length)
80-
{
81-
return length >= 128 && length <= 256;
82-
}
83-
}
84-
```
85-
86-
## Register the Custom Algorithm
87-
88-
Registration can be done in a configuration file or in imperative code. Registering a custom algorithm is done by creating a mapping between a class that implements a crypto service provider and an alias. The alias is then mapped to a URI which is used when specifying the algorithm in the WCF service's binding. The following configuration snippet illustrates how to register a custom algorithm in config:
89-
90-
```xml
91-
<configuration>
92-
<mscorlib>
93-
<cryptographySettings>
94-
<cryptoNameMapping>
95-
<cryptoClasses>
96-
<cryptoClass SHA256CSP="System.Security.Cryptography.SHA256CryptoServiceProvider, System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
97-
</cryptoClasses>
98-
<nameEntry name="http://contoso.com/CustomAlgorithms/CustomHashAlgorithm"
99-
class="SHA256CSP" />
100-
</cryptoNameMapping>
101-
</cryptographySettings>
102-
</mscorlib>
103-
</configuration>
104-
```
105-
106-
The section under the <`cryptoClasses`> element creates the mapping between the SHA256CryptoServiceProvider and the alias "SHA256CSP". The <`nameEntry`> element creates the mapping between the "SHA256CSP" alias and the specified URL `http://contoso.com/CustomAlgorithms/CustomHashAlgorithm`.
107-
108-
To register the custom algorithm in code use the <xref:System.Security.Cryptography.CryptoConfig.AddAlgorithm(System.Type,System.String[])> method. This method creates both mappings. The following example shows how to call this method:
109-
9+
WCF allows you to specify a custom crypto algorithm to use when encrypting data or computing digital signatures. This is done by the following steps:
10+
11+
1. Derive a class from <xref:System.ServiceModel.Security.SecurityAlgorithmSuite>
12+
13+
2. Register the algorithm
14+
15+
3. Configure the binding with the <xref:System.ServiceModel.Security.SecurityAlgorithmSuite>-derived class.
16+
17+
## Derive a class from SecurityAlgorithmSuite
18+
19+
The <xref:System.ServiceModel.Security.SecurityAlgorithmSuite> is an abstract base class that allows you to specify the algorithm to use when performing various security related operations. For example, computing a hash for a digital signature or encrypting a message. The following code shows how to derive a class from <xref:System.ServiceModel.Security.SecurityAlgorithmSuite>:
20+
21+
```csharp
22+
public class MyCustomAlgorithmSuite : SecurityAlgorithmSuite
23+
{
24+
public override string DefaultAsymmetricKeyWrapAlgorithm
25+
{
26+
get { return SecurityAlgorithms.RsaOaepKeyWrap; }
27+
}
28+
29+
public override string DefaultAsymmetricSignatureAlgorithm
30+
{
31+
get { return SecurityAlgorithms.RsaSha1Signature; }
32+
}
33+
34+
public override string DefaultCanonicalizationAlgorithm
35+
{
36+
get { return SecurityAlgorithms.ExclusiveC14n; ; }
37+
}
38+
39+
public override string DefaultDigestAlgorithm
40+
{
41+
get { return SecurityAlgorithms.MyCustomHashAlgorithm; }
42+
}
43+
44+
public override string DefaultEncryptionAlgorithm
45+
{
46+
get { return SecurityAlgorithms.Aes128Encryption; }
47+
}
48+
49+
public override int DefaultEncryptionKeyDerivationLength
50+
{
51+
get { return 128; }
52+
}
53+
54+
public override int DefaultSignatureKeyDerivationLength
55+
{
56+
get { return 128; }
57+
}
58+
59+
public override int DefaultSymmetricKeyLength
60+
{
61+
get { return 128; }
62+
}
63+
64+
public override string DefaultSymmetricKeyWrapAlgorithm
65+
{
66+
get { return SecurityAlgorithms.Aes128Encryption; }
67+
}
68+
69+
public override string DefaultSymmetricSignatureAlgorithm
70+
{
71+
get { return SecurityAlgorithms.HmacSha1Signature; }
72+
}
73+
74+
public override bool IsAsymmetricKeyLengthSupported(int length)
75+
{
76+
return length >= 1024 && length <= 4096;
77+
}
78+
79+
public override bool IsSymmetricKeyLengthSupported(int length)
80+
{
81+
return length >= 128 && length <= 256;
82+
}
83+
}
84+
```
85+
86+
## Register the Custom Algorithm
87+
88+
Registration can be done in a configuration file or in imperative code. Registering a custom algorithm is done by creating a mapping between a class that implements a crypto service provider and an alias. The alias is then mapped to a URI which is used when specifying the algorithm in the WCF service's binding. The following configuration snippet illustrates how to register a custom algorithm in config:
89+
90+
```xml
91+
<configuration>
92+
<mscorlib>
93+
<cryptographySettings>
94+
<cryptoNameMapping>
95+
<cryptoClasses>
96+
<cryptoClass SHA256CSP="System.Security.Cryptography.SHA256CryptoServiceProvider, System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
97+
</cryptoClasses>
98+
<nameEntry name="http://contoso.com/CustomAlgorithms/CustomHashAlgorithm"
99+
class="SHA256CSP" />
100+
</cryptoNameMapping>
101+
</cryptographySettings>
102+
</mscorlib>
103+
</configuration>
104+
```
105+
106+
The section under the `<cryptoClasses>` element creates the mapping between the SHA256CryptoServiceProvider and the alias "SHA256CSP". The `<nameEntry>` element creates the mapping between the "SHA256CSP" alias and the specified URL `http://contoso.com/CustomAlgorithms/CustomHashAlgorithm`.
107+
108+
To register the custom algorithm in code use the <xref:System.Security.Cryptography.CryptoConfig.AddAlgorithm(System.Type,System.String[])> method. This method creates both mappings. The following example shows how to call this method:
109+
110110
```csharp
111111
// Register the custom URI string defined for the hashAlgorithm in MyCustomAlgorithmSuite class to create the
112-
// SHA256CryptoServiceProvider hash algorithm object.
113-
CryptoConfig.AddAlgorithm(typeof(SHA256CryptoServiceProvider), "http://contoso.com/CustomAlgorithms/CustomHashAlgorithm");
114-
```
115-
116-
## Configure the Binding
117-
118-
You configure the binding by specifying the custom <xref:System.ServiceModel.Security.SecurityAlgorithmSuite>-derived class in the binding settings as shown in the following code snippet:
119-
120-
```csharp
121-
WSHttpBinding binding = new WSHttpBinding();
122-
binding.Security.Message.AlgorithmSuite = new MyCustomAlgorithmSuite();
123-
```
124-
125-
For a complete code example, see the [Cryptographic Agility in WCF Security](../samples/cryptographic-agility-in-wcf-security.md) sample.
126-
112+
// SHA256CryptoServiceProvider hash algorithm object.
113+
CryptoConfig.AddAlgorithm(typeof(SHA256CryptoServiceProvider), "http://contoso.com/CustomAlgorithms/CustomHashAlgorithm");
114+
```
115+
116+
## Configure the Binding
117+
118+
You configure the binding by specifying the custom <xref:System.ServiceModel.Security.SecurityAlgorithmSuite>-derived class in the binding settings as shown in the following code snippet:
119+
120+
```csharp
121+
WSHttpBinding binding = new WSHttpBinding();
122+
binding.Security.Message.AlgorithmSuite = new MyCustomAlgorithmSuite();
123+
```
124+
125+
For a complete code example, see the [Cryptographic Agility in WCF Security](../samples/cryptographic-agility-in-wcf-security.md) sample.
126+
127127
## See also
128128

129129
- [Securing Services and Clients](../feature-details/securing-services-and-clients.md)

docs/framework/wcf/extending/walkthrough-creating-custom-client-and-service-credentials.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,9 @@ Once you have the configuration handler class, it can be integrated into the WCF
108108

109109
#### To register and use a custom client credentials configuration handler in the application configuration
110110

111-
1. Add an <`extensions`> element and a <`behaviorExtensions`> element to the configuration file.
111+
1. Add an `<extensions>` element and a `<behaviorExtensions>` element to the configuration file.
112112

113-
2. Add an <`add`> element to the <`behaviorExtensions`> element and set the `name` attribute to an appropriate value.
113+
2. Add an `<add>` element to the `<behaviorExtensions>` element and set the `name` attribute to an appropriate value.
114114

115115
3. Set the `type` attribute to the fully-qualified type name. Also include the assembly name and other assembly attributes.
116116

@@ -124,7 +124,7 @@ Once you have the configuration handler class, it can be integrated into the WCF
124124
</system.serviceModel>
125125
```
126126

127-
4. After registering your configuration handler, the custom credentials element can be used inside the same configuration file instead of the system-provided <`clientCredentials`> element. You can use both the system-provided properties and any new properties that you have added to your configuration handler implementation. The following example sets the value of a custom property using the `creditCardNumber` attribute.
127+
4. After registering your configuration handler, the custom credentials element can be used inside the same configuration file instead of the system-provided `<clientCredentials>` element. You can use both the system-provided properties and any new properties that you have added to your configuration handler implementation. The following example sets the value of a custom property using the `creditCardNumber` attribute.
128128

129129
```xml
130130
<behaviors>

0 commit comments

Comments
 (0)