15 [CollectionName(
"ContractSharedSecretStates")]
17 [Index(
"BareJid",
"ContractId")]
22 private string objectId =
null;
24 private string contractId =
string.
Empty;
25 private string creatorJid =
string.
Empty;
27 private byte[] sharedSecret =
null;
52 set => this.objectId = value;
61 set => this.bareJid = value;
69 get => this.contractId;
70 set => this.contractId = value;
76 [DefaultValueStringEmpty]
79 get => this.creatorJid;
80 set => this.creatorJid = value;
88 get => this.keyAlgorithm;
89 set => this.keyAlgorithm = value;
107 return this.sharedSecret;
112 if (!(this.sharedSecret is
null))
115 this.sharedSecret = value;
134 if (!(approvedSources is
null))
135 throw new NotSupportedException(
"Changing approved sources not permitted.");
137 approvedSources = ApprovedSources;
140 private static void AssertAllowed()
142 if (!(approvedSources is
null))
149 StringBuilder sb =
new StringBuilder();
151 sb.Append(this.bareJid);
153 sb.Append(this.contractId);
155 sb.Append(this.creatorJid);
157 sb.Append(this.keyAlgorithm.ToString());
159 if (!(this.sharedSecret is
null))
160 sb.Append(
", SharedSecret");
162 return sb.ToString();
Contains a persisted shared secret associated with a smart contract.
bool HasSharedSecret
If a shared secret snapshot is available for the contract.
string CreatorJid
Bare JID of the contract creator.
SymmetricCipherAlgorithms KeyAlgorithm
Symmetric encryption algorithm used with the shared secret.
string[] EncryptedProperties
Array of properties that are encrypted.
string ContractId
Contract ID.
byte[] SharedSecret
Shared secret snapshot stored with the contract state.
ContractSharedSecretState(string ContractId)
Contains a persisted shared secret associated with a smart contract.
static void SetAllowedSources(ICallStackCheck[] ApprovedSources)
If access to sensitive properties is only accessible from a set of approved sources.
CaseInsensitiveString BareJid
Bare JID of the client owning the contract state.
override string ToString()
string ObjectId
Object ID.
ContractSharedSecretState()
Contains a persisted shared secret associated with a smart contract.
Represents a case-insensitive string.
static readonly CaseInsensitiveString Empty
Empty case-insensitive string
Static class containing methods that can be used to make sure calls are made from appropriate locatio...
static void CallFromSource(params string[] Sources)
Makes sure the call is made from one of the listed sources.
Interface for objects containing encrypted properties. Mark the properties that are encrypted with th...
Interface for call stack checks.
SymmetricCipherAlgorithms
Enumeration of symmetric cipher algorithms available in the library.
TypeNameSerialization
How the type name should be serialized.