Class: MooTool::Models::ECCPublicKey
- Inherits:
-
Object
- Object
- MooTool::Models::ECCPublicKey
- Includes:
- Helpers::IMG4
- Defined in:
- lib/mootool/models/ecc_public_key.rb
Constant Summary
Constants included from Helpers::IMG4
Helpers::IMG4::DECODE_TAGS, Helpers::IMG4::FIRMWARE_TAGS, Helpers::IMG4::HASH_LENGTHS, Helpers::IMG4::KEY_INSTANCE_TAGS, Helpers::IMG4::KVP_TAGS, Helpers::IMG4::OCTET_TAGS, Helpers::IMG4::SEQUENCE_TAGS, Helpers::IMG4::SIGNATURE_TAGS
Instance Attribute Summary collapse
-
#curve ⇒ Object
readonly
Returns the value of attribute curve.
-
#point ⇒ Object
readonly
Returns the value of attribute point.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(key) ⇒ ECCPublicKey
constructor
A new instance of ECCPublicKey.
Methods included from Helpers::IMG4
#construct, #construct_object, #decode_construct, parse_4cc
Constructor Details
#initialize(key) ⇒ ECCPublicKey
Returns a new instance of ECCPublicKey.
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/mootool/models/ecc_public_key.rb', line 10 def initialize(key) if key.is_a?(OpenSSL::PKey::EC::Point) @value = key @curve = @value.group @point = @value else @value = OpenSSL::ASN1.decode(key) @curve = OpenSSL::PKey::EC::Group.new @value.value[0].value[1].value @point = OpenSSL::PKey::EC::Point.new @curve, @value.value[1].value end end |
Instance Attribute Details
#curve ⇒ Object (readonly)
Returns the value of attribute curve.
8 9 10 |
# File 'lib/mootool/models/ecc_public_key.rb', line 8 def curve @curve end |
#point ⇒ Object (readonly)
Returns the value of attribute point.
8 9 10 |
# File 'lib/mootool/models/ecc_public_key.rb', line 8 def point @point end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
8 9 10 |
# File 'lib/mootool/models/ecc_public_key.rb', line 8 def value @value end |
Instance Method Details
#==(other) ⇒ Object
23 24 25 26 27 28 29 30 |
# File 'lib/mootool/models/ecc_public_key.rb', line 23 def ==(other) case other when MooTool::Models::ECCPublicKey @curve == other.curve && @point == other.point when OpenSSL::PKey::EC @curve == other.group && @point = other.public_key end end |