Method: JOSE::JWK::KTY_OKP_Ed448.from_okp
- Defined in:
- lib/jose/jwk/kty_okp_ed448.rb
.from_okp(okp) ⇒ Object
API functions
114 115 116 117 118 119 120 |
# File 'lib/jose/jwk/kty_okp_ed448.rb', line 114 def self.from_okp(okp) if okp.is_a?(Array) and okp.length == 2 and okp[0] == :Ed448 and okp[1].is_a?(String) and (okp[1].bytesize == PK_BYTES or okp[1].bytesize == SK_BYTES) return JOSE::JWK::KTY_OKP_Ed448.new(okp[1]), JOSE::Map[] else raise ArgumentError, "'okp' must be an Array in the form of [:Ed448, String]" end end |