class JWS implements Serializable {

    public boolean isValidSignature() {
        String signedData = headerString + "." + payloadString;
        try {
            Signature signatureObj = SignatureUtil.createSignature(header.getAlg().getJcaName());
            PublicKey publicKey = header.getX5c().getEndEntityAttestationCertificate().getCertificate().getPublicKey();
            signatureObj.initVerify(publicKey);
            signatureObj.update(signedData.getBytes());
            byte[] sig;
            if (publicKey instanceof ECPublicKey) {
                sig = JWSSignatureUtil.convertJwsSignatureToDerSignature(signature);
            } else {
                sig = signature;
            }
            return signatureObj.verify(sig);
        } catch (SignatureException | InvalidKeyException e) {
            logger.debug("Signature verification failed", e);
            return false;
        }
    }

      JWS(JWSHeader header, String headerString, T payload, String payloadString, byte[] signature);

}