ContractAttachment
Keywords: net.corda.core.contracts.ContractAttachment class
Date: 2023-09-18

net.corda.core.contracts

## Class ContractAttachment

- net.corda.core.contracts.ContractAttachment

- All Implemented Interfaces:
    Attachment, NamedByHash

      public class ContractAttachment
      implements Attachment

  An `interface Attachment` which represents a contract JAR.

  See Also:
    `interface Attachment`

- - ### Field Detail

    - #### Companion

          public static net.corda.core.contracts.ContractAttachment.Companion Companion

  - ### Constructor Detail

    - #### ContractAttachment

          @JvmOverloads
          public ContractAttachment(@NotNull
                                                  Attachment attachment,
                                                  @NotNull
                                                  java.lang.String contract,
                                                  @NotNull
                                                  java.util.Set<java.lang.String> additionalContracts,
                                                  @Nullable
                                                  java.lang.String uploader)

    - #### ContractAttachment

          @JvmOverloads
          public ContractAttachment(@NotNull
                                                  Attachment attachment,
                                                  @NotNull
                                                  java.lang.String contract,
                                                  @NotNull
                                                  java.util.Set<java.lang.String> additionalContracts)

    - #### ContractAttachment

          @JvmOverloads
          public ContractAttachment(@NotNull
                                                  Attachment attachment,
                                                  @NotNull
                                                  java.lang.String contract)

  - ### Method Detail

    - #### getAllContracts

          @NotNull
          public java.util.Set<java.lang.String> getAllContracts()

    - #### isSigned

          public boolean isSigned()

    - #### toString

          @NotNull
          public java.lang.String toString()

    - #### getAttachment

          @NotNull
          public Attachment getAttachment()

      The attachment representing the contract JAR

    - #### getContract

          @NotNull
          public java.lang.String getContract()

      The contract name contained within the JAR.

      A Contract attachment has to contain at least 1 contract.

    - #### getAdditionalContracts

          @NotNull
          public java.util.Set<java.lang.String> getAdditionalContracts()

      Additional contract names contained within the JAR.

    - #### getUploader

          @Nullable
          public java.lang.String getUploader()

    - #### getSignerKeys

          @NotNull
          public java.util.List<java.security.PublicKey> getSignerKeys()

      The keys that have correctly signed the whole attachment.

      Can be empty, for example non-contract attachments won't be necessarily be signed.

    - #### getVersion

          public int getVersion()

    - #### getId

          @NotNull
          public SecureHash getId()

    - #### getSigners

          @NotNull
          public java.util.List<net.corda.core.identity.Party> getSigners()

      Deprecated.

      The parties that have correctly signed the whole attachment. Even though this returns a list of party objects, it is not required that these parties exist on the network, but rather they are a mapping from the signing key to the X.500 name.

      Note: Anyone can sign attachments, not only Corda parties. It's recommended to use `signerKeys`.

      See Also:
        `signerKeys`

    - #### getSize

          public int getSize()

      Attachment size in bytes.

    - #### open

          @NotNull
          public java.io.InputStream open()