About: Drm License server responsible for Generating/Validating licenses
If available in Hex, the package can be installed by adding drm
to your list of
dependencies in mix.exs
:
def deps do
[
{:drm, "~> 0.2.1"}
]
end
config :drm,
allow_burner_emails: true,
max_floats: 5,
path: Path.expand("../priv/license", __DIR__),
refresh_interval: 2000,
key: "yyyyy",
salt: "xxxx"
config :drm, Encryption.Vault, ciphers: [
default: { Cloak.Ciphers.AES.GCM, tag: "AES.GCM.V1", key: Base.decode64!(System.get_env("ENCRYPTION_KEY")), iv_length: 12 }
]
iex> license = %{hash: "license-key12", meta: %{email: "[email protected]", name: "licensee name"}, policy: %{name: "
policy name", type: "free", expiration: nil, validation_type: "strict", checkin: false, checkin_interval: nil,
max_fingerprints: nil, fingerprint: "umbrella-app-hash-id"}}
iex> License.create(license)
iex> License.fingerprint_valid?(license.policy.fingerprint)
This will also create an encrypted key file on the filesystem you can decide if/how you want to distribute it.
Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/license.