CoreFiles by mySites.guru
SignatureConverter.php34 lines, 1,034 bytes, from Joomla_5.2.0-Stable-Full_Package.zip
Raw History Compare with 5.1.4
md5
914e8cafd261af046884f031e8ee2af8
sha1
0d1bdc8731397ccbb734aa49514ab7b7268f865a
sha256
0f2b62378e523c0eaf8c204addd3afff5a2c92c672001b72f07ba9d7a322caa2
<?php
declare(strict_types=1);

namespace Lcobucci\JWT\Signer\Ecdsa;

/**
 * Manipulates the result of a ECDSA signature (points R and S) according to the
 * JWA specs.
 *
 * OpenSSL creates a signature using the ASN.1 format and, according the JWA specs,
 * the signature for JWTs must be the concatenated values of points R and S (in
 * big-endian octet order).
 *
 * @internal
 *
 * @see https://tools.ietf.org/html/rfc7518#page-9
 * @see https://en.wikipedia.org/wiki/Abstract_Syntax_Notation_One
 */
interface SignatureConverter
{
    /**
     * Converts the signature generated by OpenSSL into what JWA defines
     *
     * @throws ConversionFailed When there was an issue during the format conversion.
     */
    public function fromAsn1(string $signature, int $length): string;

    /**
     * Converts the JWA signature into something OpenSSL understands
     *
     * @throws ConversionFailed When there was an issue during the format conversion.
     */
    public function toAsn1(string $points, int $length): string;
}

The same content is in 158 releases, Joomla 5.0.0-alpha1 to 6.3.0-alpha1. See them all, or every version of this file.