Method: JOSE::JWK::KTY_OKP_Ed448#signer

Defined in:
lib/jose/jwk/kty_okp_ed448.rb

#signer(fields = nil) ⇒ Object



87
88
89
90
91
92
93
94
95
# File 'lib/jose/jwk/kty_okp_ed448.rb', line 87

def signer(fields = nil)
  if okp.bytesize == SK_BYTES and fields and fields['use'] == 'sig' and not fields['alg'].nil?
    return JOSE::Map['alg' => fields['alg']]
  elsif okp.bytesize == SK_BYTES
    return JOSE::Map['alg' => 'EdDSA']
  else
    raise ArgumentError, "signing not supported for public keys"
  end
end