Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// Pull in dependencies.
const getdns = require("getdns");
const async = require("async");
const ursa = require("ursa");
const pem = require("pem");
const openpgp = require("openpgp");
openpgp.initWorker({ path: "openpgp.worker.js" });
// Names.
const PGP_NAME = "77fa5113ab6a532ce2e6901f3bd3351c0db5845e0b1b5fb09907808d._openpgpkey.getdnsapi.net";
const PGP_TYPE = 65280;
const TLSA_NAME = "77fa5113ab6a532ce2e6901f3bd3351c0db5845e0b1b5fb09907808d._smimecert.getdnsapi.org";
const TLSA_TYPE = getdns.RRTYPE_TLSA;
// Message.
const MESSAGE = "Hello, World";
// Context options.
const options = {
return_dnssec_status: true,
// Request timeout time in millis.
timeout: 5000,
};
// Create the context with the above options.
const context = getdns.createContext(options);
// Response util - get a secure response of a particular type.
const getFirstSecureResponse = (result, type) => {