You are here

private static function JWT::encodeDER in Auth0 Single Sign On 8.2

Encodes a value into a DER object.

Parameters

int $type DER tag:

string $value the value to encode:

Return value

string the encoded object

1 call to JWT::encodeDER()
JWT::signatureToDER in vendor/firebase/php-jwt/src/JWT.php
Convert an ECDSA signature to an ASN.1 DER sequence

File

vendor/firebase/php-jwt/src/JWT.php, line 431

Class

JWT
JSON Web Token implementation, based on this spec: https://tools.ietf.org/html/rfc7519

Namespace

Firebase\JWT

Code

private static function encodeDER($type, $value) {
  $tag_header = 0;
  if ($type === self::ASN1_SEQUENCE) {
    $tag_header |= 0x20;
  }

  // Type
  $der = \chr($tag_header | $type);

  // Length
  $der .= \chr(\strlen($value));
  return $der . $value;
}