crypto-secret.cr/README.md

1.8 KiB

crypto-secret.cr

Crystal CI GitHub release GitHub commits since latest release (by date) for a branch Docs

Interface intended to hold sensitive information.

Installation

  1. Add the dependency to your shard.yml:

    dependencies:
      crypto-secret:
        github: didactic-drunk/crypto-secret
    
  2. Run shards install

Usage

require "crypto-secret/not"

not_secret = Crypto::Secret::Not.new 32

Implementing a new Secret holding class

Intended for use by crypto library authors

class MySecret
  include Crypto::Secret

  def initialize(size)
    # allocate storage
    # optionally mlock
  end

  def to_slice : Bytes
    # Return a slice
    # Slice.new pointer, size
  end

  # optionally override [noaccess, readonly, readwrite]
end

Contributing

  1. Fork it (https://github.com/your-github-user/crypto-secret/fork)
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors

sodium.cr