Class: GenRelease::Commands::Sign
- Inherits:
-
Object
- Object
- GenRelease::Commands::Sign
- Defined in:
- lib/genRelease/commands/sign.rb
Constant Summary collapse
- FILENAME =
"Release.rsa"
Instance Method Summary collapse
-
#initialize(options) ⇒ Sign
constructor
A new instance of Sign.
- #sign ⇒ Object
Constructor Details
#initialize(options) ⇒ Sign
Returns a new instance of Sign.
8 9 10 11 |
# File 'lib/genRelease/commands/sign.rb', line 8 def initialize = @current_dir = Dir.getwd end |
Instance Method Details
#sign ⇒ Object
13 14 15 16 17 18 |
# File 'lib/genRelease/commands/sign.rb', line 13 def sign @rsa = ::OpenSSL::PKey::RSA.new File.read "#{@current_dir}#{File::SEPARATOR}rsa.pem" content = File.open("#{@current_dir}#{File::SEPARATOR}Release",'rb') {|file| file.read} = @rsa.private_encrypt(content.gsub("\n","")) ::GenRelease::FileUtils::write "#{@current_dir}#{File::SEPARATOR}#{FILENAME}", end |