-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
145 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace SimpleSAML\XMLSecurity; | ||
|
||
/** | ||
* Canonicalization algorithms | ||
*/ | ||
enum C14N: string | ||
{ | ||
case INCLUSIVE_WITH_COMMENTS = 'http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments'; | ||
case INCLUSIVE_WITHOUT_COMMENTS = 'http://www.w3.org/TR/2001/REC-xml-c14n-20010315'; | ||
case EXCLUSIVE_WITH_COMMENTS = 'http://www.w3.org/2001/10/xml-exc-c14n#WithComments'; | ||
case EXCLUSIVE_WITHOUT_COMMENTS = 'http://www.w3.org/2001/10/xml-exc-c14n#'; | ||
|
||
/** | ||
* @return bool | ||
*/ | ||
public function withComments(): bool | ||
{ | ||
return match($this) | ||
{ | ||
C14N::INCLUSIVE_WITH_COMMENTS, C14N::EXCLUSIVE_WITH_COMMENTS => true, | ||
default => false, | ||
}; | ||
} | ||
|
||
|
||
/** | ||
* @return bool | ||
*/ | ||
public function withoutComments(): bool | ||
{ | ||
return match($this) | ||
{ | ||
C14N::INCLUSIVE_WITHOUT_COMMENTS, C14N::EXCLUSIVE_WITHOUT_COMMENTS => true, | ||
default => false, | ||
}; | ||
} | ||
|
||
|
||
/** | ||
* @return bool | ||
*/ | ||
public function exclusive(): bool | ||
{ | ||
return match($this) | ||
{ | ||
C14N::EXCLUSIVE_WITH_COMMENTS, C14N::EXCLUSIVE_WITHOUT_COMMENTS => true, | ||
default => false, | ||
}; | ||
} | ||
|
||
|
||
/** | ||
* @return bool | ||
*/ | ||
public function inclusive(): bool | ||
{ | ||
return match($this) | ||
{ | ||
C14N::INCLUSIVE_WITH_COMMENTS, C14N::INCLUSIVE_WITHOUT_COMMENTS => true, | ||
default => false, | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.