Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
CryptKey example
$publicKey
=
$this
->
getContainer
(
)
->
get
(
'shopware.public_key'
)
;
$result
= JWTConfigurationFactory::
createJWTConfiguration
(
$signer
,
$privateKey
,
$publicKey
)
;
static
::
assertSame
(
$signer
,
$result
->
signer
(
)
)
;
}
public
function
testWithInMemoryKey
(
)
: void
{
$signer
=
$this
->
getContainer
(
)
->
get
(
'shopware.jwt_signer'
)
;
$privateKey
=
$this
->
getContainer
(
)
->
get
(
'shopware.private_key'
)
;
$publicKey
=
$this
->
getContainer
(
)
->
get
(
'shopware.public_key'
)
;
$inMemoryPrivateKey
=
new
CryptKey
(
$privateKey
->
getKeyContents
(
)
,
$privateKey
->
getPassPhrase
(
)
)
;
$inMemoryPublicKey
=
new
CryptKey
(
$publicKey
->
getKeyContents
(
)
)
;
$result
= JWTConfigurationFactory::
createJWTConfiguration
(
$signer
,
$inMemoryPrivateKey
,
$inMemoryPublicKey
)
;
static
::
assertSame
(
$signer
,
$result
->
signer
(
)
)
;
}
}