static bool isSignedWithKey_verbose; static boolean isSignedWithKey(S signed, S key) { try { L lines = toLines(signed); if (swic(last(lines), "signer:")) popLast(lines); S sigLine = last(lines); S text = fromLines(dropLast(lines)); S sig = dropPrefixMandatory("sig: ", sigLine); ret PKI.verifySignature(PKI.publicKeyFromString(key), PKI.signatureFromString(sig), toUtf8(text)); } catch (RuntimeException e) { if (isSignedWithKey_verbose) printStackTrace(e); ret false; } }