How to use the getdns.RRTYPE_TLSA function in getdns

To help you get started, we’ve selected a few getdns examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github getdnsapi / getdns-node / samples / getdns-node-sample-crypto / index.js View on Github external
// 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) => {

getdns

getdns bindings for Node.js. getdns is a modern asynchronous DNS API. It implements DNS entry points from a design developed and vetted by application developers, in an API specification.

BSD-3-Clause
Latest version published 3 years ago

Package Health Score

49 / 100
Full package analysis