encrypted_field 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d69fd39c30e96379111a39c9301a51d0df7cdbb5
4
- data.tar.gz: f36e39e7252a1b0311a967f6d022bfb0cd6db485
3
+ metadata.gz: d0a5b29b39b0f21234f8c32cbacf4dacea0cd8ec
4
+ data.tar.gz: a960784ffb0be6ed0cc29a2eb682765b46cac545
5
5
  SHA512:
6
- metadata.gz: 81a7bec18d3a777414276f236351df5c1750ef453dc2e5eb606837c35bac7c3e16146a6ffb4f4cc314ee54ba21f1b26bee0c319c3de751315d512059cb283870
7
- data.tar.gz: 52fe0c14053ecf987571b16f28fe5216747084ba3346a3bd27549d25c6aa85be6603044ff415f34d3405e0b6aa1759fade0caaed0b3a5ef1699c941045022740
6
+ metadata.gz: f79690de1cc0f7f500ae9ffa01481b6ee0c58fb7d51953486c26b6cd3e18ae6b2d6602f92d29657ee38e3930ed977a23dc2df05342a1add3ea8da0582f14dc61
7
+ data.tar.gz: 85327e301b2931ce0afbbcf938eb38b5a9171e3fd0bd5de798ade253233af59ec3b394a4dbf3d673ea01649c16d17e65460e8683a9cc292d38cc78cc2a0864c4
data/Rakefile CHANGED
@@ -1,6 +1,8 @@
1
1
  require "bundler/gem_tasks"
2
2
  require "rake/testtask"
3
3
 
4
+ import "./lib/tasks/generate_keypair.rake"
5
+
4
6
  Rake::TestTask.new(:test) do |t|
5
7
  t.libs << "test"
6
8
  t.libs << "lib"
@@ -1,5 +1,5 @@
1
1
  require "encrypted_field/version"
2
+ require "openssl"
2
3
 
3
4
  module EncryptedField
4
- # Your code goes here...
5
5
  end
@@ -1,3 +1,3 @@
1
1
  module EncryptedField
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
@@ -0,0 +1,17 @@
1
+ namespace :keypair do
2
+ desc "generate key pair"
3
+ task :generate, [:path] do |t, args|
4
+ rsa_key = OpenSSL::PKey::RSA.new(2048)
5
+ private_key = rsa_key.to_pem
6
+ public_key = rsa_key.public_key.to_pem
7
+ path = (args[:path] || '.')
8
+
9
+ File.open("#{path}/encrypted_field_public_key.pem", "w+") do |f|
10
+ f.write public_key
11
+ end
12
+
13
+ File.open("#{path}/encrypted_field_private_key.pem", "w+") do |f|
14
+ f.write private_key
15
+ end
16
+ end
17
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: encrypted_field
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - akil
@@ -71,6 +71,7 @@ files:
71
71
  - encrypted_field.gemspec
72
72
  - lib/encrypted_field.rb
73
73
  - lib/encrypted_field/version.rb
74
+ - lib/tasks/generate_keypair.rake
74
75
  homepage:
75
76
  licenses:
76
77
  - MIT