Home > Class Reference > %SYS namespace > %XML.Security.EncryptedKey


class %XML.Security.EncryptedKey extends %XML.Security.KeyInfoClause, %XML.Security.EncryptedType

XML Encryption element.

Property Inventory

Method Inventory


Inherited description: ELEMENTQUALIFIED controls the format of exported XML. The ELEMENTQUALIFIED specification should be based on the elementFormDefault attribute of the schema that defines the type. To maintain compatibility, ELEMENTQUALIFIED will default to 1 (true) for literal format export and will default to 0 (false) for encoded or encoded12 format export. These were the values always previously assumed for the elementFormDefault attribute. NOTE: Direct use of XMLExport method does not support the ELEMENTQUALIFIED. The export must be done using %XML.Writer or SOAP support.
parameter NAMESPACE = http://www.w3.org/2001/04/xmlenc#;
Inherited description: NAMESPACE specifies the XML namespace to be used when projecting the class to XML. If NAMESPACE = "", the default namespace is used for the XML schema is used as the namespace for his class.
parameter XMLFORMAT = literal;
Inherited description: The XMLFORMAT parameter controls the generation of the XMLExport and XMLImport methods for XML enabled classes to include code for only literal or only encoded format. This allows the generated routines to be significantly smaller since usually both formats are not needed.
If XMLFORMAT="Literal", then only support for literal format import and export is generated.
If XMLFORMAT="Encoded", then only support for SOAP encoded format import and export is generated.
The default is to generate support for both literal and encoded format.


property CarriedKeyName as %String);
Property methods: CarriedKeyNameDisplayToLogical(), CarriedKeyNameGet(), CarriedKeyNameIsValid(), CarriedKeyNameLogicalToDisplay(), CarriedKeyNameLogicalToOdbc(), CarriedKeyNameNormalize(), CarriedKeyNameSet()
property CipherData as %XML.Security.CipherData (XMLREF = 1) [ Required ];
Property methods: CipherDataGet(), CipherDataGetSwizzled(), CipherDataIsValid(), CipherDataNewObject(), CipherDataSet()
property EncryptionOptions as %Integer (XMLPROJECTION = "none");
EncryptionOptions specifies which parts of the message are to be signed. See %soap.inc definitions of $$$SOAPWSEncrypt.... for possibilities.
Property methods: EncryptionOptionsDisplayToLogical(), EncryptionOptionsGet(), EncryptionOptionsIsValid(), EncryptionOptionsLogicalToDisplay(), EncryptionOptionsNormalize(), EncryptionOptionsSet(), EncryptionOptionsXSDToLogical()
property EncryptionProperties as %XML.Security.EncryptionProperties (XMLREF = 1);
Property methods: EncryptionPropertiesGet(), EncryptionPropertiesGetSwizzled(), EncryptionPropertiesIsValid(), EncryptionPropertiesNewObject(), EncryptionPropertiesSet()
property Recipient as %String);
Property methods: RecipientDisplayToLogical(), RecipientGet(), RecipientIsValid(), RecipientLogicalToDisplay(), RecipientLogicalToOdbc(), RecipientNormalize(), RecipientSet()
property ReferenceList as %XML.Security.ReferenceList (XMLREF = 1);
Property methods: ReferenceListGet(), ReferenceListGetSwizzled(), ReferenceListIsValid(), ReferenceListNewObject(), ReferenceListSet()
property UsedAsEncryptionKey as %Boolean (XMLPROJECTION = "none");
UsedAsEncryptionKey is true if this EncryptedKey element was used for encryption
Property methods: UsedAsEncryptionKeyDisplayToLogical(), UsedAsEncryptionKeyGet(), UsedAsEncryptionKeyIsValid(), UsedAsEncryptionKeyLogicalToDisplay(), UsedAsEncryptionKeyLogicalToXSD(), UsedAsEncryptionKeyNormalize(), UsedAsEncryptionKeySet(), UsedAsEncryptionKeyXSDToLogical()
property UsedAsSigningKey as %Boolean (XMLPROJECTION = "none");
UsedAsSigningKey is true if this EncryptedKey element was used for signing
Property methods: UsedAsSigningKeyDisplayToLogical(), UsedAsSigningKeyGet(), UsedAsSigningKeyIsValid(), UsedAsSigningKeyLogicalToDisplay(), UsedAsSigningKeyLogicalToXSD(), UsedAsSigningKeyNormalize(), UsedAsSigningKeySet(), UsedAsSigningKeyXSDToLogical()


method AddReference(reference As %XML.Security.DataReference, doNotReuse As %Boolean = 0) [ Language = objectscript ]
Add a reference to XML element using a %XML.Security.DataReference. The reference may be created by using the ##class(%XML.Security.Reference).Create method. If doNotReuse is true, then this reference will be removed during Reset
classmethod CreateX509(credentials As %SYS.X509Credentials = "", encryptionOptions As %Integer, referenceOption As %Integer, Output status As %Status) as %XML.Security.EncryptedKey [ Language = objectscript ]
Create an EncryptedKey element that is to carry a symmetric key which is encrypted using an X.509 certificate's public key.
  • The certificate is specified in the token argument by a %SYS.X509Credentials instance containing the certificate or a BinarySecurityToken containing the X509 certificate.
  • The encryptionOptions argument specifies the parts of the SOAP message to be encrypted. The default is to encrypt the body - $$$SOAPWSEncryptSoapBody. $$$SOAPWSEncryptNoBody means body will not be encrypted, but other parts added using AddReference method. $$$SOAPWSEncryptNone means there will be no ReferenceList in the EncryptedKey element. See %soap.inc definitions of $$$SOAPWSEncrypt.... for possibilities.
  • The referenceOption argument specifies the type of reference to create. See %soap.inc definitions of $$$SOAPWSReference.... The default is to use the Thumbprint if the first argument is a %SYS.X509Credentials instance.
method Equals(credentials As %XML.Security.EncryptedKey) as %Boolean [ Language = objectscript ]
Return true if the same Key.
method GetEncryptedKeySHA1() as %Binary [ Language = objectscript ]
Get EncryptedKeySHA1 format of this EncryptedKey element. Get EncryptedKeySHA1 format of this EncryptedKey element.
method Initialize() as %Status [ Language = objectscript ]
Initialize an EncryptedKey element that is intended for creating EncryptedKey elements which will not be in the Security header. EncryptionMethod, and Algorithm or KeySize are expected to be set or defaulted.
method Reset() [ Language = objectscript ]
Reset the element.

Inherited Members

Inherited Properties

Inherited Methods