public class SignedData<T>
A serialized piece of data and its signature. Enforces signature validity in order to deserialize the data contained within.
public SignedData(@NotNull SerializedBytes<T> raw, @NotNull net.corda.core.crypto.DigitalSignature.WithKey sig)
A serialized piece of data and its signature. Enforces signature validity in order to deserialize the data contained within.
raw
- the raw serialized data.sig
- the (unverified) signature for the data.@NotNull public T verified()
Return the deserialized data if the signature can be verified.
IllegalArgumentException
- if the data is invalid (only used if verifyData() is overloaded).SignatureException
- if the signature is invalid.protected void verifyData(@NotNull T data)
Verify the wrapped data after the signature has been verified and the data deserialised. Provided as an extension point for subclasses.
IllegalArgumentException
- if the data is invalid.@NotNull public SerializedBytes<T> getRaw()
the raw serialized data.
@NotNull public net.corda.core.crypto.DigitalSignature.WithKey getSig()
the
(unverified) signature for the data.