Passed
Push — master ( 84e061...59fb84 )
by Tim
02:20
created

EncryptedData::toXML()   B

Complexity

Conditions 7
Paths 64

Size

Total Lines 31
Code Lines 15

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 7
eloc 15
nc 64
nop 1
dl 0
loc 31
rs 8.8333
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace SimpleSAML\XMLSecurity\XML\xenc;
6
7
use DOMElement;
8
use SimpleSAML\Assert\Assert;
9
use SimpleSAML\XML\Exception\InvalidDOMElementException;
10
use SimpleSAML\XML\Exception\MissingElementException;
11
use SimpleSAML\XML\Exception\TooManyElementsException;
12
use SimpleSAML\XMLSecurity\XML\ds\KeyInfo;
13
14
/**
15
 * Class containing encrypted data.
16
 *
17
 * Note: <xenc:EncryptionProperties> elements are not supported.
18
 *
19
 * @package simplesamlphp/xml-security
20
 */
21
class EncryptedData extends AbstractEncryptedType
22
{
23
    /**
24
     * EncryptedData constructor.
25
     *
26
     * @param \SimpleSAML\XMLSecurity\XML\xenc\CipherData $cipherData The CipherData object of this EncryptedData.
27
     * @param string|null $id The Id attribute of this object. Optional.
28
     * @param string|null $type The Type attribute of this object. Optional.
29
     * @param string|null $mimeType The MimeType attribute of this object. Optional.
30
     * @param string|null $encoding The Encoding attribute of this object. Optional.
31
     * @param \SimpleSAML\XMLSecurity\XML\xenc\EncryptionMethod|null $encryptionMethod
32
     *   The EncryptionMethod object of this EncryptedData. Optional.
33
     * @param \SimpleSAML\XMLSecurity\XML\ds\KeyInfo|null $keyInfo The KeyInfo object of this EncryptedData. Optional.
34
     */
35
    public function __construct(
36
        CipherData $cipherData,
37
        ?string $id = null,
38
        ?string $type = null,
39
        ?string $mimeType = null,
40
        ?string $encoding = null,
41
        ?EncryptionMethod $encryptionMethod = null,
42
        ?KeyInfo $keyInfo = null
43
    ) {
44
        parent::__construct($cipherData, $id, $type, $mimeType, $encoding, $encryptionMethod, $keyInfo);
45
    }
46
}
47