mirror of https://github.com/jwtk/jjwt.git
Added more descriptive backwards compatibility information
This commit is contained in:
parent
174e1b13b8
commit
c3e5f95242
|
@ -41,7 +41,13 @@ public class EllipticCurveSignatureValidator extends EllipticCurveProvider imple
|
|||
PublicKey publicKey = (PublicKey) key;
|
||||
try {
|
||||
int expectedSize = getSignatureByteArrayLength(alg);
|
||||
//if the expected size is not valid for JOSE, fall back to ASN.1 DER signature
|
||||
/**
|
||||
*
|
||||
* If the expected size is not valid for JOSE, fall back to ASN.1 DER signature.
|
||||
* This fallback is for backwards compatibility ONLY (to support tokens generated by previous versions of jjwt)
|
||||
* and backwards compatibility will possibly be removed in a future version of this library.
|
||||
*
|
||||
* **/
|
||||
byte[] derSignature = expectedSize != signature.length && signature[0] == 0x30 ? signature : EllipticCurveProvider.transcodeSignatureToDER(signature);
|
||||
return doVerify(sig, publicKey, data, derSignature);
|
||||
} catch (Exception e) {
|
||||
|
|
Loading…
Reference in New Issue