README.md in cose-0.3.0 vs README.md in cose-0.4.0
- old
+ new
@@ -23,16 +23,35 @@
## Usage
### Key Objects
+```ruby
+cbor_data = "..."
+
+key = COSE::Key.deserialize(cbor_data)
+
+case key.class
+when COSE::Key::EC2
+ key.curve
+ key.x_coordinate
+ key.y_coordinate
+ key.d_coordinate
+when COSE::Key::RSA
+ key.modulus_n
+ key.public_exponent_e
+when COSE::Key::Symmetric
+ key.key_value
+end
+```
+
#### EC2
```ruby
cbor_data = "..."
-key = COSE::Key::EC2.from_cbor(cbor_data)
+key = COSE::Key::EC2.deserialize(cbor_data)
key.curve
key.x_coordinate
key.y_coordinate
key.d_coordinate
@@ -41,12 +60,23 @@
#### Symmetric
```ruby
cbor_data = "..."
-key = COSE::Key::Symmetric.from_cbor(cbor_data)
+key = COSE::Key::Symmetric.deserialize(cbor_data)
key.key_value
+```
+
+#### RSA
+
+```ruby
+cbor_data = "..."
+
+key = COSE::Key::RSA.deserialize(cbor_data)
+
+key.modulus_n
+key.public_exponent_e
```
### Signing Objects
#### COSE_Sign