Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

messagemedia_signingkeys_sdk

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

messagemedia_signingkeys_sdk

  • 1.1.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

MessageMedia Signature Key Management Ruby SDK

Build Status Gem Version

The MessageMedia Signature Key API provides a number of endpoints for managing key used to sign each unique request to ensure security and the requests can't (easily) be spoofed. This is similar to using HMAC in your outbound messaging (rather than HTTP Basic).

⭐️ Install via RubyGems

  • Run the following command to install the SDK via RubyGems: gem install messagemedia_signingkeys_sdk

🎬 Get Started

It's easy to get started. Simply enter the API Key and secret you obtained from the MessageMedia Developers Portal into the code snippet below and a mobile number you wish to send to.

🚀 Create a signature key

require 'message_media_signing_keys'
require 'pp'

# Configuration parameters and credentials
basic_auth_user_name = 'basic_auth_user_name' # The username to use with basic authentication
basic_auth_password = 'basic_auth_password' # The password to use with basic authentication

client = MessageMediaSigningKeys::MessageMediaSigningKeysClient.new(
  basic_auth_user_name: basic_auth_user_name,
  basic_auth_password: basic_auth_password
)

signatureKeyManagement_controller = client.signature_key_management

body_value = "{   
                \"digest\": \"SHA224\",   
                \"cipher\": \"RSA\"
}";
body = JSON.parse(body_value);

result = signatureKeyManagement_controller.create_signature_key(body)
pp result

📥 Get signature key details

You can get a key_id by looking at the id of the signature key created from the response of the above example.

require 'message_media_signing_keys'
require 'pp'

# Configuration parameters and credentials
basic_auth_user_name = 'basic_auth_user_name' # The username to use with basic authentication
basic_auth_password = 'basic_auth_password' # The password to use with basic authentication

client = MessageMediaSigningKeys::MessageMediaSigningKeysClient.new(
  basic_auth_user_name: basic_auth_user_name,
  basic_auth_password: basic_auth_password
)

signatureKeyManagement_controller = client.signature_key_management

key_id = 'key_id'

result = signatureKeyManagement_controller.get_signature_key_detail(key_id)
pp result

📥 Get signature keys list

require 'message_media_signing_keys'
require 'pp'

# Configuration parameters and credentials
basic_auth_user_name = 'basic_auth_user_name' # The username to use with basic authentication
basic_auth_password = 'basic_auth_password' # The password to use with basic authentication

client = MessageMediaSigningKeys::MessageMediaSigningKeysClient.new(
  basic_auth_user_name: basic_auth_user_name,
  basic_auth_password: basic_auth_password
)

signatureKeyManagement_controller = client.signature_key_management

result = signatureKeyManagement_controller.get_signature_key_list()
pp result

❌ Delete signature key

You can get the key_id by looking at the ids of the signature keys returned from the response of the Get signature keys list example.

require 'message_media_signing_keys'

# Configuration parameters and credentials
basic_auth_user_name = 'basic_auth_user_name' # The username to use with basic authentication
basic_auth_password = 'basic_auth_password' # The password to use with basic authentication

client = MessageMediaSigningKeys::MessageMediaSigningKeysClient.new(
  basic_auth_user_name: basic_auth_user_name,
  basic_auth_password: basic_auth_password
)

signatureKeyManagement_controller = client.signature_key_management

key_id = 'key_id'

signatureKeyManagement_controller.delete_signature_key(key_id)

☑️ Enable a signature key

You can get the key_id by looking at the ids of the signature keys returned from the response of the Get signature keys list example.

require 'message_media_signing_keys'
require 'pp'

# Configuration parameters and credentials
basic_auth_user_name = 'basic_auth_user_name' # The username to use with basic authentication
basic_auth_password = 'basic_auth_password' # The password to use with basic authentication

client = MessageMediaSigningKeys::MessageMediaSigningKeysClient.new(
  basic_auth_user_name: basic_auth_user_name,
  basic_auth_password: basic_auth_password
)

signatureKeyManagement_controller = client.signature_key_management

body = EnableSignatureKeyRequest.new({
    "key_id": "7ca628a8-08b0-4e42-aeb8-960b37049c31"
})

result = signatureKeyManagement_controller.update_enable_signature_key(body)
pp result

📥 Get enabled signature key

require 'message_media_signing_keys'
require 'pp'

# Configuration parameters and credentials
basic_auth_user_name = 'basic_auth_user_name' # The username to use with basic authentication
basic_auth_password = 'basic_auth_password' # The password to use with basic authentication

client = MessageMediaSigningKeys::MessageMediaSigningKeysClient.new(
  basic_auth_user_name: basic_auth_user_name,
  basic_auth_password: basic_auth_password
)

signatureKeyManagement_controller = client.signature_key_management

result = signatureKeyManagement_controller.get_enabled_signature_key()
pp result

🚫 Disable an enabled signature key

require 'message_media_signing_keys'

# Configuration parameters and credentials
basic_auth_user_name = 'basic_auth_user_name' # The username to use with basic authentication
basic_auth_password = 'basic_auth_password' # The password to use with basic authentication

client = MessageMediaSigningKeys::MessageMediaSigningKeysClient.new(
  basic_auth_user_name: basic_auth_user_name,
  basic_auth_password: basic_auth_password
)

signatureKeyManagement_controller = client.signature_key_management

signatureKeyManagement_controller.delete_disable_the_current_enabled_signature_key()

📕 Documentation

Check out the full API documentation for more detailed information.

😕 Need help?

Please contact developer support at developers@messagemedia.com or check out the developer portal at developers.messagemedia.com

📃 License

Apache License. See the LICENSE file.

FAQs

Package last updated on 05 Jul 2018

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc