Skip to content

Commit cb6d983

Browse files
authored
Import EncryptedElementInterface from saml2 library
1 parent 974d743 commit cb6d983

1 file changed

Lines changed: 50 additions & 0 deletions

File tree

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace SimpleSAML\XMLSecurity\XML;
6+
7+
use SimpleSAML\XML\AbstractXMLElement;
8+
use SimpleSAML\XMLSecurity\XML\xenc\EncryptedData;
9+
use SimpleSAML\XMLSecurity\XMLSecurityKey;
10+
11+
/**
12+
* Interface for encrypted elements.
13+
*
14+
* @package simplesamlphp/saml2
15+
*/
16+
interface EncryptedElementInterface
17+
{
18+
/**
19+
* Constructor for encrypted elements.
20+
*
21+
* @param \SimpleSAML\XMLSecurity\XML\xenc\EncryptedData $encryptedData The EncryptedData object.
22+
* @param \SimpleSAML\XMLSecurity\XML\xenc\EncryptedKey[] $encryptedKeys An array of zero or more EncryptedKey objects.
23+
*/
24+
public function __construct(EncryptedData $encryptedData, array $encryptedKeys);
25+
26+
27+
/**
28+
* @param \SimpleSAML\XMLSecurity\XMLSecurityKey $key The key we should use to decrypt the element.
29+
* @param string[] $blacklist List of blacklisted encryption algorithms.
30+
*
31+
* @return \SimpleSAML\XML\AbstractXMLElement The decrypted element.
32+
*/
33+
public function decrypt(XMLSecurityKey $key, array $blacklist = []): AbstractXMLElement;
34+
35+
36+
/**
37+
* Get the EncryptedData object.
38+
*
39+
* @return \SimpleSAML\XMLSecurity\XML\xenc\EncryptedData
40+
*/
41+
public function getEncryptedData(): EncryptedData;
42+
43+
44+
/**
45+
* Get the array of EncryptedKey objects
46+
*
47+
* @return \SimpleSAML\XMLSecurity\XML\xenc\EncryptedKey[]
48+
*/
49+
public function getEncryptedKeys(): array;
50+
}

0 commit comments

Comments
 (0)