public class ContractAttachment implements Attachment
An interface Attachment
which represents a contract JAR.
interface Attachment
Modifier and Type | Class and Description |
---|---|
static class |
ContractAttachment.Companion |
Attachment.DefaultImpls
Modifier and Type | Field and Description |
---|---|
static ContractAttachment.Companion |
Companion |
Constructor and Description |
---|
ContractAttachment(Attachment attachment,
java.lang.String contract,
java.util.Set<java.lang.String> additionalContracts,
java.lang.String uploader) |
Modifier and Type | Method and Description |
---|---|
NonExistentClass |
extractFile(java.lang.String path,
java.io.OutputStream outputTo)
Finds the named file case insensitively and copies it to the output stream.
|
java.util.Set<java.lang.String> |
getAdditionalContracts()
Additional contract names contained within the JAR.
|
java.util.Set<java.lang.String> |
getAllContracts() |
Attachment |
getAttachment()
The attachment representing the contract JAR
|
java.lang.String |
getContract()
The contract name contained within the JAR.
|
SecureHash |
getId() |
java.util.List<java.security.PublicKey> |
getSignerKeys()
The keys that have correctly signed the whole attachment.
|
java.util.List<net.corda.core.identity.Party> |
getSigners()
Deprecated.
|
int |
getSize()
Attachment size in bytes.
|
java.lang.String |
getUploader() |
int |
getVersion() |
boolean |
isSigned() |
java.io.InputStream |
open() |
java.util.jar.JarInputStream |
openAsJAR() |
java.lang.String |
toString() |
extractFile, getSignerKeys, getSigners, getSize, open, openAsJAR
getId
public static ContractAttachment.Companion Companion
public ContractAttachment(Attachment attachment, java.lang.String contract, java.util.Set<java.lang.String> additionalContracts, java.lang.String uploader)
public java.util.Set<java.lang.String> getAllContracts()
public boolean isSigned()
public java.lang.String toString()
public Attachment getAttachment()
The attachment representing the contract JAR
public java.lang.String getContract()
The contract name contained within the JAR.
A Contract attachment has to contain at least 1 contract.
public java.util.Set<java.lang.String> getAdditionalContracts()
Additional contract names contained within the JAR.
public java.lang.String getUploader()
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.
public int getVersion()
public SecureHash getId()
public java.util.List<net.corda.core.identity.Party> getSigners()
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 Attachment.getSignerKeys
.
Attachment.getSignerKeys
public int getSize()
Attachment size in bytes.
public NonExistentClass extractFile(java.lang.String path, java.io.OutputStream outputTo)
Finds the named file case insensitively and copies it to the output stream.
public java.io.InputStream open()
public java.util.jar.JarInputStream openAsJAR()