aries / net.globalid.aries.decorators.signature / SignatureUtils / verifySignature

verifySignature

@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.

Parameters

decorator - is the SignatureDecorator that contains the signature

type - class of object

Return
single T is the deserialized object

fun <reified T : Any> verifySignature(decorator: SignatureDecorator): Single<T>

See SignatureUtils.verifySignature.