This documentation is archived and is not being maintained.

EncryptedKey Class

Note: This class is new in the .NET Framework version 2.0.

Represents the <EncryptedKey> element in XML encryption. This class cannot be inherited.

Namespace: System.Security.Cryptography.Xml
Assembly: System.Security (in system.security.dll)

public ref class EncryptedKey sealed : public EncryptedType
public final class EncryptedKey extends EncryptedType
public final class EncryptedKey extends EncryptedType

This class represents the <EncryptedKey> element in XML encryption. The <EncryptedKey> element is used to send encryption keys. It can be created in a stand-alone XML document, be placed within an application document, or be inside an <EncryptedData> element as a child of a <KeyInfo> element. The key value is always encrypted to the recipient. When <EncryptedKey> is decrypted, the resulting key is made available to the <EncryptionMethod> algorithm without any additional processing.

The <EncryptedKey> element is similar to the <EncryptedData> element of the EncryptedData class except that the data encrypted is always a key value.

The following code example illustrates how to encrypt and decrypt an XML element using the EncryptedKey class. This example then displays the values of various properties of the EncryptedKey class to the console.

No code example is currently available or this language may not be supported.

System.Object
   System.Security.Cryptography.Xml.EncryptedType
    System.Security.Cryptography.Xml.EncryptedKey

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0
Show: