SignedData
Keywords: net.corda.core.crypto.SignedData class
Date: 2023-09-18

net.corda.core.crypto

## Class SignedData<T>

- net.corda.core.crypto.SignedData<T>

-     public class SignedData<T>

  A serialized piece of data and its signature. Enforces signature validity in order to deserialize the data contained within.

- - ### Constructor Detail

    - #### SignedData

          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.

      Parameters:
        `raw` - the raw serialized data.
        `sig` - the (unverified) signature for the data.

  - ### Method Detail

    - #### verified

          @NotNull
          public T verified()

      Return the deserialized data if the signature can be verified.

      Throws:
        `IllegalArgumentException` - if the data is invalid (only used if verifyData() is overloaded).
        `SignatureException` - if the signature is invalid.

    - #### verifyData

          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.

      Throws:
        `IllegalArgumentException` - if the data is invalid.

    - #### getRaw

          @NotNull
          public SerializedBytes<T> getRaw()

      the raw serialized data.

    - #### getSig

          @NotNull
          public net.corda.core.crypto.DigitalSignature.WithKey getSig()

      the

      (unverified) signature for the data.