Module: Acme::Client::JWK
- Defined in:
- lib/acme/client/jwk.rb
Defined Under Namespace
Classes: Base, ECDSA, HMAC, RSA
Class Method Summary collapse
-
.from_private_key(private_key) ⇒ Object
Make a JWK from a private key.
Class Method Details
.from_private_key(private_key) ⇒ Object
Make a JWK from a private key.
private_key - An OpenSSL::PKey::EC or OpenSSL::PKey::RSA instance.
Returns a JWK::Base subclass instance.
7 8 9 10 11 12 13 14 15 16 |
# File 'lib/acme/client/jwk.rb', line 7 def self.from_private_key(private_key) case private_key when OpenSSL::PKey::RSA Acme::Client::JWK::RSA.new(private_key) when OpenSSL::PKey::EC Acme::Client::JWK::ECDSA.new(private_key) else raise ArgumentError, 'private_key must be EC or RSA' end end |