@JvmStatic fun <T : Any> verifySignature(decorator: SignatureDecorator, type: Class<T>): Single<T>
Verifies a signature from a given SignatureDecorator and returns the plaintext data. By the signature schema, we base64 URL-safe decode the signer (to get the plaintext public key), the message (to get the byte array) and the signature (to get the byte array). If the signature is valid, we base64 URL-safe decode the signature data, skipping the first 8 bytes (the first byte contains the UNIX time). The remaining bytes represent the object of type T.
decorator
- is the SignatureDecorator that contains the signature
Return
single T is the deserialized object
fun <reified T : Any> verifySignature(decorator: SignatureDecorator): Single<T>