function sign(cert, key) {
	if (cert.signatures.x509 === undefined)
		cert.signatures.x509 = {};
	var sig = cert.signatures.x509;

	sig.algo = key.type + '-' + key.defaultHashAlgorithm();
	if (SIGN_ALGS[sig.algo] === undefined)
		return (false);

	var der = new asn1.BerWriter();
	writeTBSCert(cert, der);
	var blob = der.buffer;
	sig.cache = blob;

	var signer = key.createSign();
	signer.write(blob);
	cert.signatures.x509.signature = signer.sign();

	return (true);
}
Remove cached schema(s).
If no parameter is passed all schemas but meta-schemas are removed.
If RegExp is passed all schemas with key/id matching pattern but meta-schemas are removed.
Even if schema is referenced by other schemas it still can be removed as other schemas have local references.
@this   Ajv
@param  {String|Object|RegExp} schemaKeyRef key, ref, pattern to match key/ref or schema object
@return {Ajv} this for method chaining