Socket
Socket
Sign inDemoInstall

securedgram-psk-aes

Package Overview
Dependencies
0
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    securedgram-psk-aes

A partial DTLS 1.0 implementation for Node.js


Version published
Maintainers
1
Install size
126 kB
Created

Readme

Source

securedgram-psk-aes

A partial DTLS 1.0 implementation for Node.js. Unofficial library, not supported by Sigma Designs.

This 'securedgram' library is designed to be a mostly-drop-in replacement for the standard node.js 'dgram' library.

This library supports DTLS 1.0 and the following ciphersuites:

  • TLS_PSK_WITH_AES_128_CBC_SHA
  • TLS_PSK_WITH_AES_256_CBC_SHA
To install the library

npm install securedgram-psk-aes

To import the library

let securedgram = require('securedgram-psk-aes');

To create a socket instance

let dtlsSocket = securedgram.createDtlsSocket(ipAddressFamily, callbackObject, callback);

  • ipAddressFamily options: ['udp4', 'udp6']
  • callbackObject: OPTIONAL object passed in first parameter of callback to tag this socket
  • callback: OPTIONAL callback, called when a message is received
To send a message

dtlsSocket.send(message, offset, length, port, host, pskIdentity, pskPassword, callback);

  • message: buffer containing message to send
  • offset: offset (within buffer)
  • length: length (within buffer)
  • port: port #
  • host: hostname or ip address
  • pskIdentity: PSK "identity" parameter
  • pskPassword: Pre-shared key ("PSK password")
  • callback: OPTIONAL callback
To receive a message (via createDtlsSocket-specified callback)

let onMessage = function(callbackObject, data, rinfo) {
    // handle message here
}

NOTE: the developer must pass this function as the callback parameter when instantiating the DtlsSocket.
To close a socket instance

dtlsSocket.close(callback);

Keywords

FAQs

Last updated on 06 Mar 2017

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc