Passed
Push — master ( ff3228...e5a9b6 )
by Tim
14:22
created

EncryptedAttribute::getEncryptionBackend()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 5
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace SimpleSAML\SAML2\XML\saml;
6
7
use SimpleSAML\SAML2\XML\EncryptedElementTrait;
8
use SimpleSAML\XML\DOMDocumentFactory;
9
use SimpleSAML\XMLSecurity\XML\EncryptedElementInterface;
10
use SimpleSAML\XMLSecurity\Alg\Encryption\EncryptionAlgorithmInterface;
11
12
/**
13
 * Class handling encrypted attributes.
14
 *
15
 * @package simplesamlphp/saml2
16
 */
17
class EncryptedAttribute extends AbstractSamlElement implements EncryptedElementInterface
18
{
19
    use EncryptedElementTrait;
0 ignored issues
show
introduced by
The trait SimpleSAML\SAML2\XML\EncryptedElementTrait requires some properties which are not provided by SimpleSAML\SAML2\XML\saml\EncryptedAttribute: $localName, $namespaceURI
Loading history...
20
21
22
    /**
23
     * @inheritDoc
24
     *
25
     * @return \SimpleSAML\SAML2\XML\saml\Attribute
26
     */
27
    public function decrypt(EncryptionAlgorithmInterface $decryptor): Attribute
28
    {
29
        return Attribute::fromXML(
30
            DOMDocumentFactory::fromString($this->decryptData($decryptor))->documentElement,
31
        );
32
    }
33
}
34