Class: Sigstore::Internal::Key::EDCSA
- Inherits:
-
Sigstore::Internal::Key
- Object
- Sigstore::Internal::Key
- Sigstore::Internal::Key::EDCSA
- Defined in:
- lib/sigstore/internal/key.rb
Instance Attribute Summary
Attributes inherited from Sigstore::Internal::Key
Instance Method Summary collapse
-
#initialize ⇒ EDCSA
constructor
A new instance of EDCSA.
Methods inherited from Sigstore::Internal::Key
from_key_details, #public_to_der, read, #to_der, #to_pem, #verify
Methods included from Loggable
Constructor Details
#initialize ⇒ EDCSA
Returns a new instance of EDCSA.
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 |
# File 'lib/sigstore/internal/key.rb', line 90 def initialize(...) super unless @key_type == "ecdsa" || @key_type == "ecdsa-sha2-nistp256" raise ArgumentError, "key_type must be edcsa, given #{@key_type}" end unless @key.is_a?(OpenSSL::PKey::EC) raise ArgumentError, "key must be an OpenSSL::PKey::EC, is #{@key.inspect}" end case @schema when "ecdsa-sha2-nistp256" unless @key.group.curve_name == "prime256v1" raise ArgumentError, "Expected prime256v1 curve, got #{@key.group.curve_name}" end else raise ArgumentError, "Unsupported schema #{schema}" end end |