EncryptedKey Class

 

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

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

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

[HostProtectionAttribute(SecurityAction::LinkDemand, MayLeakOnAbort = true)]
public ref class EncryptedKey sealed : EncryptedType

NameDescription
System_CAPS_pubmethodEncryptedKey()

Initializes a new instance of the EncryptedKey class.

NameDescription
System_CAPS_pubpropertyCarriedKeyName

Gets or sets the optional <CarriedKeyName> element in XML encryption.

System_CAPS_pubpropertyCipherData

Gets or sets the CipherData value for an instance of an EncryptedType class.(Inherited from EncryptedType.)

System_CAPS_pubpropertyEncoding

Gets or sets the Encoding attribute of an EncryptedType instance in XML encryption.(Inherited from EncryptedType.)

System_CAPS_pubpropertyEncryptionMethod

Gets or sets the <EncryptionMethod> element for XML encryption.(Inherited from EncryptedType.)

System_CAPS_pubpropertyEncryptionProperties

Gets or sets the <EncryptionProperties> element in XML encryption.(Inherited from EncryptedType.)

System_CAPS_pubpropertyId

Gets or sets the Id attribute of an EncryptedType instance in XML encryption.(Inherited from EncryptedType.)

System_CAPS_pubpropertyKeyInfo

Gets of sets the <KeyInfo> element in XML encryption.(Inherited from EncryptedType.)

System_CAPS_pubpropertyMimeType

Gets or sets the MimeType attribute of an EncryptedType instance in XML encryption.(Inherited from EncryptedType.)

System_CAPS_pubpropertyRecipient

Gets or sets the optional Recipient attribute in XML encryption.

System_CAPS_pubpropertyReferenceList

Gets or sets the <ReferenceList> element in XML encryption.

System_CAPS_pubpropertyType

Gets or sets the Type attribute of an EncryptedType instance in XML encryption.(Inherited from EncryptedType.)

NameDescription
System_CAPS_pubmethodAddProperty(EncryptionProperty^)

Adds an <EncryptionProperty> child element to the <EncryptedProperties> element in the current EncryptedType object in XML encryption.(Inherited from EncryptedType.)

System_CAPS_pubmethodAddReference(DataReference^)

Adds a <DataReference> element to the <ReferenceList> element.

System_CAPS_pubmethodAddReference(KeyReference^)

Adds a <KeyReference> element to the <ReferenceList> element.

System_CAPS_pubmethodEquals(Object^)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_pubmethodGetXml()

Returns the XML representation of the EncryptedKey object.(Overrides EncryptedType::GetXml().)

System_CAPS_pubmethodLoadXml(XmlElement^)

Loads the specified XML information into the <EncryptedKey> element in XML encryption.(Overrides EncryptedType::LoadXml(XmlElement^).)

System_CAPS_pubmethodToString()

Returns a string that represents the current object.(Inherited from Object.)

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 example illustrates how to encrypt and decrypt an XML element by 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.

.NET Framework
Available since 2.0

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

Return to top
Show: