@@ -31,13 +31,14 @@ trait EncryptedElementTrait
3131 * Constructor for encrypted elements.
3232 *
3333 * @param \SimpleSAML\XMLSecurity\XML\xenc\EncryptedData $encryptedData The EncryptedData object.
34- * @param \SimpleSAML\XMLSecurity\XML\xenc\EncryptedKey[] $decryptionKeys The EncryptedKey objects.
34+ * @param \SimpleSAML\XMLSecurity\XML\xenc\EncryptedKey[] $encryptedKey The EncryptedKey objects.
3535 */
3636 final public function __construct (
3737 protected EncryptedData $ encryptedData ,
38- protected array $ decryptionKeys = [],
38+ array $ encryptedKey = [],
3939 ) {
40- Assert::allIsInstanceOf ($ decryptionKeys , EncryptedKey::class, ProtocolViolationException::class);
40+ Assert::allIsInstanceOf ($ encryptedKey , EncryptedKey::class, ProtocolViolationException::class);
41+ $ this ->encryptedKey = $ encryptedKey ;
4142
4243 /**
4344 * 6.2: The <EncryptedData> element's Type attribute SHOULD be used and, if it is
@@ -74,9 +75,9 @@ public function getEncryptionBackend(): ?EncryptionBackend
7475 }
7576
7677
77- public function getDecryptionKeys (): array
78+ public function getEncryptedKeys (): array
7879 {
79- return $ this ->decryptionKeys ;
80+ return $ this ->encryptedKey ;
8081 }
8182
8283
@@ -118,7 +119,7 @@ public function toXML(?DOMElement $parent = null): DOMElement
118119 {
119120 $ e = $ this ->instantiateParentElement ($ parent );
120121 $ this ->encryptedData ->toXML ($ e );
121- foreach ($ this ->getDecryptionKeys () as $ key ) {
122+ foreach ($ this ->getEncryptedKeys () as $ key ) {
122123 $ key ->toXML ($ e );
123124 }
124125 return $ e ;
0 commit comments