This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Last revision Both sides next revision | ||
component:data [2021/02/07 09:50] tshaw [Tier 3 Callbacks] |
component:data [2021/02/07 10:05] tshaw [Examples] |
||
---|---|---|---|
Line 64: | Line 64: | ||
* (The following items are to be done on the RECEIVER) | * (The following items are to be done on the RECEIVER) | ||
* Generate a public key (rPublic) and private key (rPrivate). | * Generate a public key (rPublic) and private key (rPrivate). | ||
- | * *\*If no automated key exchange, then you'll need to send rPublic to the SENDER. | + | * *\*If no automated key exchange, then you'll need to send rPublic to the SENDER manually. |
The SENDER must: | The SENDER must: | ||
* Read the RECEIVER's public key (rPublic), unserialize it, and rebuild the key object. | * Read the RECEIVER's public key (rPublic), unserialize it, and rebuild the key object. | ||
* Generate a public key (sPublic) and private key (sPrivate). | * Generate a public key (sPublic) and private key (sPrivate). | ||
- | * Generate an encryption key using rPublic and sPrivate. | + | * *Generate an encryption key using rPublic and sPrivate. |
* Generate an Initialization Vector (IV). | * Generate an Initialization Vector (IV). | ||
* Convert sPublic into a string with sPublic.serialize(). | * Convert sPublic into a string with sPublic.serialize(). | ||
Line 78: | Line 78: | ||
* Read the RECEIVER's private key (rPrivate), unserialize it, and rebuild the key object. | * Read the RECEIVER's private key (rPrivate), unserialize it, and rebuild the key object. | ||
* Receive the message and unserialize it using the serialization library, then deserialize sPublic using data.deserializeKey(). | * Receive the message and unserialize it using the serialization library, then deserialize sPublic using data.deserializeKey(). | ||
- | * Generate a decryption key using sPublic and rPrivate. | + | * *Generate a decryption key using sPublic and rPrivate. |
* Use the decryption key, along with the IV, to decrypt the message. | * Use the decryption key, along with the IV, to decrypt the message. | ||
* Unserialize the decrypted data. | * Unserialize the decrypted data. | ||
Line 98: | Line 98: | ||
{ | { | ||
sPublic = nil, | sPublic = nil, | ||
- | iv = nil | + | iv = nil |
}, | }, | ||