File tree Expand file tree Collapse file tree
VerifiableCredentials/Factories Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -41,10 +41,7 @@ public function fromData(
4141 array $ payload ,
4242 array $ header ,
4343 ): EntityStatement {
44-
45- if (!array_key_exists (ClaimsEnum::Typ->value , $ header )) {
46- $ header [ClaimsEnum::Typ->value ] = JwtTypesEnum::EntityStatementJwt->value ;
47- }
44+ $ header [ClaimsEnum::Typ->value ] = JwtTypesEnum::EntityStatementJwt->value ;
4845
4946 return new EntityStatement (
5047 $ this ->jwsDecoratorBuilder ->fromData (
Original file line number Diff line number Diff line change 55namespace SimpleSAML \OpenID \Federation \Factories ;
66
77use SimpleSAML \OpenID \Algorithms \SignatureAlgorithmEnum ;
8+ use SimpleSAML \OpenID \Codebooks \ClaimsEnum ;
9+ use SimpleSAML \OpenID \Codebooks \JwtTypesEnum ;
810use SimpleSAML \OpenID \Federation \TrustMarkDelegation ;
911use SimpleSAML \OpenID \Jwk \JwkDecorator ;
1012use SimpleSAML \OpenID \Jws \Factories \ParsedJwsFactory ;
@@ -35,6 +37,8 @@ public function fromData(
3537 array $ payload ,
3638 array $ header ,
3739 ): TrustMarkDelegation {
40+ $ header [ClaimsEnum::Typ->value ] = JwtTypesEnum::TrustMarkDelegationJwt->value ;
41+
3842 return new TrustMarkDelegation (
3943 $ this ->jwsDecoratorBuilder ->fromData (
4044 $ signingKey ,
Original file line number Diff line number Diff line change 55namespace SimpleSAML \OpenID \Federation \Factories ;
66
77use SimpleSAML \OpenID \Algorithms \SignatureAlgorithmEnum ;
8+ use SimpleSAML \OpenID \Codebooks \ClaimsEnum ;
89use SimpleSAML \OpenID \Codebooks \JwtTypesEnum ;
910use SimpleSAML \OpenID \Federation \TrustMark ;
1011use SimpleSAML \OpenID \Jwk \JwkDecorator ;
@@ -40,6 +41,8 @@ public function fromData(
4041 array $ header ,
4142 JwtTypesEnum $ expectedJwtType = JwtTypesEnum::TrustMarkJwt,
4243 ): TrustMark {
44+ $ header [ClaimsEnum::Typ->value ] = $ expectedJwtType ;
45+
4346 return new TrustMark (
4447 $ this ->jwsDecoratorBuilder ->fromData (
4548 $ signingKey ,
Original file line number Diff line number Diff line change 44
55namespace SimpleSAML \OpenID ;
66
7- use Psr \Log \LoggerInterface ;
87use SimpleSAML \OpenID \Jwk \Factories \JwkDecoratorFactory ;
98
109class Jwk
1110{
1211 protected ?JwkDecoratorFactory $ jwkDecoratorFactory = null ;
1312
14- public function __construct (
15- protected readonly ?LoggerInterface $ logger = null ,
16- ) {
17- }
18-
1913 public function jwkDecoratorFactory (): JwkDecoratorFactory
2014 {
2115 return $ this ->jwkDecoratorFactory ??= new JwkDecoratorFactory ();
Original file line number Diff line number Diff line change 55namespace SimpleSAML \OpenID \Jwks \Factories ;
66
77use SimpleSAML \OpenID \Algorithms \SignatureAlgorithmEnum ;
8+ use SimpleSAML \OpenID \Codebooks \ClaimsEnum ;
9+ use SimpleSAML \OpenID \Codebooks \JwtTypesEnum ;
810use SimpleSAML \OpenID \Jwk \JwkDecorator ;
911use SimpleSAML \OpenID \Jwks \SignedJwks ;
1012use SimpleSAML \OpenID \Jws \Factories \ParsedJwsFactory ;
@@ -38,6 +40,8 @@ public function fromData(
3840 array $ payload ,
3941 array $ header ,
4042 ): SignedJwks {
43+ $ header [ClaimsEnum::Typ->value ] = JwtTypesEnum::JwkSetJwt->value ;
44+
4145 return new SignedJwks (
4246 $ this ->jwsDecoratorBuilder ->fromData (
4347 $ signingKey ,
Original file line number Diff line number Diff line change @@ -35,6 +35,9 @@ public function fromData(
3535 array $ payload ,
3636 array $ header ,
3737 ): JwtVcJson {
38+ // TODO mivanci Set type header
39+ // $header[ClaimsEnum::Typ->value] = JwtTypesEnum::->value;
40+
3841 return new JwtVcJson (
3942 $ this ->jwsDecoratorBuilder ->fromData (
4043 $ signingKey ,
You can’t perform that action at this time.
0 commit comments