You are here

public function JwtTranscoderInterface::setPrivateKey in JSON Web Token Authentication (JWT) 8.0

Same name and namespace in other branches
  1. 8 src/Transcoder/JwtTranscoderInterface.php \Drupal\jwt\Transcoder\JwtTranscoderInterface::setPrivateKey()

Sets the private key used to create signatures for an asymmetric algorithm.

This key is only used when an asymmetric algorithm is selected. Currently supported asymmetric algorithms are:

  • RS256

Parameters

string $private_key: A PEM encoded private key.

bool $derive_public_key: (Optional) Derive the public key from the private key. Defaults to true.

Return value

bool Function does some validation of the key. Returns TRUE on success.

1 method overrides JwtTranscoderInterface::setPrivateKey()
JwtTranscoder::setPrivateKey in src/Transcoder/JwtTranscoder.php
Sets the private key used to create signatures for an asymmetric algorithm.

File

src/Transcoder/JwtTranscoderInterface.php, line 77

Class

JwtTranscoderInterface
Interface JwtTranscoderInterface.

Namespace

Drupal\jwt\Transcoder

Code

public function setPrivateKey($private_key, $derive_public_key = TRUE);