Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support latest ruby via openssl_pkcs8_pure #23

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions lib/crxmake.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,14 @@ class OpenSSL::PKey::RSA
alias_method :to_pem, :to_pem_pkcs8
end
rescue LoadError
$pkcs8_warning=1
begin
require 'openssl_pkcs8_pure'
class OpenSSL::PKey::RSA
alias_method :to_pem, :to_pem_pkcs8
end
rescue LoadError
$pkcs8_warning=1
end
end

class CrxMake < Object
Expand Down Expand Up @@ -153,7 +160,7 @@ def read_key
def generate_key
if defined?($pkcs8_warning)&&@verbose
$stderr.puts 'Warn: generated pem must be converted into PKCS8 in order to upload to Chrome WebStore.'
$stderr.puts 'To suppress this message, do: gem install openssl_pkcs8'
$stderr.puts 'To suppress this message, do: gem install openssl_pkcs8_pure'
end
puts "generate pemkey to \"#{@pkey_o}\"" if @verbose
@key = OpenSSL::PKey::RSA.generate(KEY_SIZE)
Expand Down